var __defProp = Object.defineProperty;
var __typeError = (msg) => {
  throw TypeError(msg);
};
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var __privateWrapper = (obj, member, setter, getter) => ({
  set _(value) {
    __privateSet(obj, member, value, setter);
  },
  get _() {
    return __privateGet(obj, member, getter);
  }
});
var _emittingCount;
import * as a$d from "cesium";
import * as b$e from "@turf/turf";
import { bbox } from "@turf/turf";
const defaultToken = { "ion": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MjNjYmVlOC1kZDA0LTQ0OGUtYTVjZS1jNDFlNTYxZTdkMjkiLCJpZCI6MjAxOTQ4LCJpYXQiOjE3MTA0MjI1ODZ9.giSWCQOKlRs3mxr3X1Z1grwevurK1c89rNhLueeEvQo" };
const defaultViewRectangle = [41.728921, -26.042904, 174.271087, 86.861514];
const defaultViewCenter = [108, 34];
const pick = (obj, keys2) => {
  if (!obj)
    return {};
  return keys2.reduce((acc, key) => {
    if (Object.prototype.hasOwnProperty.call(obj, key))
      acc[key] = obj[key];
    return acc;
  }, {});
};
const omit = (obj, keys2) => {
  if (!obj)
    return {};
  if (!keys2 || keys2.length === 0)
    return obj;
  return keys2.reduce(
    (acc, key) => {
      delete acc[key];
      return acc;
    },
    { ...obj }
  );
};
const get$2 = (value, path, defaultValue) => {
  const segments = path.split(/[\.\[\]]/g);
  let current = value;
  for (const key of segments) {
    if (current === null)
      return defaultValue;
    if (current === void 0)
      return defaultValue;
    const dequoted = key.replace(/['"]/g, "");
    if (dequoted.trim() === "")
      continue;
    current = current[dequoted];
  }
  if (current === void 0)
    return defaultValue;
  return current;
};
const toString$1 = Object["prototype"]["toString"];
function is(a2, b2) {
  return toString$1["call"](a2) === "[object " + b2 + "]";
}
function isDef(a2) {
  return typeof a2 !== "undefined";
}
function isUnDef(a2) {
  return !isDef(a2);
}
function isObject(a2) {
  return a2 !== null && is(a2, "Object");
}
function isEmpty(a2) {
  if (isArray(a2) || isString(a2)) return a2["length"] === 0;
  if (a2 instanceof Map || a2 instanceof Set) return a2["size"] === 0;
  if (isObject(a2)) return Object["keys"](a2)["length"] === 0;
  return ![];
}
function isDate(a2) {
  return is(a2, "Date");
}
function isNumber(a2) {
  return is(a2, "Number");
}
function isPromise(a2) {
  return is(a2, "Promise") && isObject(a2) && isFunction(a2["then"]) && isFunction(a2["catch"]);
}
function isString(a2) {
  return is(a2, "String");
}
function isFunction(a2) {
  return typeof a2 === "function";
}
function isBoolean(a2) {
  return is(a2, "Boolean");
}
function isRegExp(a2) {
  return is(a2, "RegExp");
}
function isArray(a2) {
  return a2 && Array["isArray"](a2);
}
function isWindow(a2) {
  return typeof window !== "undefined" && is(a2, "Window");
}
function isElement(a2) {
  return a2 !== null && typeof a2 === "object" && a2["nodeType"] === 1 && typeof a2["tagName"] === "string";
}
function isMap(a2) {
  return is(a2, "Map");
}
function isUrl(a2) {
  const b2 = /^(http|https):\/\//;
  return b2["test"](a2);
}
function isDark() {
  return window["matchMedia"]("(prefers-color-scheme: dark)")["matches"];
}
function isImgPath(a2) {
  return /(https?:\/\/|data:image\/).*?\.(png|jpg|jpeg|gif|svg|webp|ico)/i["test"](a2);
}
function isMergeableObject(a2) {
  const b2 = a2 && typeof a2 === "object";
  return b2 && Object["prototype"]["toString"]["call"](a2) !== "[object RegExp]" && Object["prototype"]["toString"]["call"](a2) !== "[object Date]";
}
function isSimpleType(a2) {
  if (a2 == null || a2 == void 0) return ![];
  return isString(a2) || isBoolean(a2) || isNumber(a2) || Array["isArray"](a2) ? !![] : ![];
}
function formatNum(b2, c2 = 0) {
  const d2 = 10 ** c2;
  return Math["round"](b2 * d2) / d2;
}
const templateReg = /\{\{\s*([\w\u4E00-\u9FA5]+)\s*\}\}/g;
function template(b2, c2, d2 = ![]) {
  if (b2 == null || !templateReg["test"](b2)) return b2;
  return b2["replace"](templateReg, (e2, f2, g2, h2) => {
    let i2 = get$2(c2, f2);
    if (!a$d["defined"](i2)) return d2 ? "" : e2;
    if (isFunction(i2)) {
      i2 = i2(c2);
      if (!a$d["defined"](i2)) return d2 ? "" : e2;
    } else {
      if (i2["getValue"] && isFunction(i2["getValue"])) {
        i2 = i2["getValue"](a$d["JulianDate"]["now"]());
        if (!a$d["defined"](i2)) return d2 ? "" : e2;
      }
    }
    return i2;
  });
}
const _LatLngPoint = class _LatLngPoint {
  constructor(b2, c2, d2) {
    __publicField(this, "_lng");
    __publicField(this, "_lat");
    __publicField(this, "_alt");
    this["_lng"] = b2 !== void 0 ? +b2 : 0, this["_lat"] = c2 !== void 0 ? +c2 : 0, this["_alt"] = d2 !== void 0 ? +d2 : 0;
  }
  static ["parse"](b2, c2) {
    if (!b2) return new _LatLngPoint();
    let d2;
    if (typeof b2 === "string") d2 = _LatLngPoint["fromString"](b2);
    else {
      if (Array["isArray"](b2)) d2 = _LatLngPoint["fromArray"](b2);
      else {
        if (b2 instanceof _LatLngPoint) d2 = b2["clone"]();
        else {
          if (a$d["defined"](b2["lat"]) && a$d["defined"](b2["lng"])) {
            d2 = new _LatLngPoint(b2["lng"], b2["lat"], b2["alt"]);
            for (const e2 in b2) {
              d2[e2] = b2[e2];
            }
          } else {
            if (b2 instanceof a$d["Cartesian3"] || b2["_value"] || typeof b2["getValue"] === "function") d2 = _LatLngPoint["fromCartesian"](b2, c2);
            else {
              if (b2 instanceof a$d["Cartographic"]) d2 = _LatLngPoint["fromCartographic"](b2);
              else {
                if (a$d["defined"](b2["x"]) && a$d["defined"](b2["y"])) {
                  const f2 = new a$d["Cartesian3"](b2["x"], b2["y"], b2["z"]);
                  d2 = _LatLngPoint["fromCartesian"](f2, c2);
                } else d2 = new _LatLngPoint(), handlerError("NOT_THROW", "parse: 坐标解析失败，请确认参数是否无误：" + b2);
              }
            }
          }
        }
      }
    }
    return d2;
  }
  static ["fromArray"](b2) {
    const c2 = new _LatLngPoint();
    return Array["isArray"](b2) && (c2["lng"] = b2[0] || 0, c2["lat"] = b2[1] || 0, c2["alt"] = b2[2] || 0), c2;
  }
  static ["fromString"](b2) {
    let c2 = new _LatLngPoint();
    if (b2 && typeof b2 === "string") {
      const d2 = b2["split"](",");
      c2 = _LatLngPoint["fromArray"](d2["map"](Number["parseFloat"]));
    }
    return c2;
  }
  static ["fromCartesian"](b2, c2) {
    const d2 = new _LatLngPoint();
    let e2;
    if (b2 instanceof a$d["Cartesian3"]) e2 = b2;
    else {
      if (b2["_value"] && b2["_value"] instanceof a$d["Cartesian3"]) e2 = b2["_value"];
      else typeof b2["getValue"] == "function" ? e2 = b2["getValue"](c2 || a$d["JulianDate"]["now"]()) : e2 = void 0;
    }
    if (e2) {
      const f2 = a$d["Cartographic"]["fromCartesian"](e2);
      f2 && (d2["lat"] = a$d["Math"]["toDegrees"](f2["latitude"]), d2["lng"] = a$d["Math"]["toDegrees"](f2["longitude"]), d2["alt"] = f2["height"], d2["format"]());
    }
    return d2;
  }
  static ["fromCartographic"](b2) {
    const c2 = new _LatLngPoint();
    return b2 && (c2["lat"] = a$d["Math"]["toDegrees"](b2["latitude"]), c2["lng"] = a$d["Math"]["toDegrees"](b2["longitude"]), c2["alt"] = b2["height"]), c2;
  }
  static ["toCartesian"](b2, c2) {
    return _LatLngPoint["parse"](b2, c2)["toCartesian"]();
  }
  static ["toCartographic"](b2, c2) {
    return _LatLngPoint["parse"](b2, c2)["toCartographic"]();
  }
  get ["lng"]() {
    return this["_lng"];
  }
  set ["lng"](b2) {
    this["setLng"](+b2);
  }
  ["setLng"](b2) {
    this["_lng"] = +b2;
  }
  get ["lat"]() {
    return this["_lat"];
  }
  set ["lat"](b2) {
    this["setLat"](+b2);
  }
  ["setLat"](b2) {
    this["_lat"] = +b2;
  }
  get ["alt"]() {
    return this["_alt"] || 0;
  }
  set ["alt"](b2) {
    this["setAlt"](+b2);
  }
  ["setAlt"](b2) {
    this["_alt"] = +b2;
  }
  ["clone"]() {
    const b2 = new _LatLngPoint();
    return b2["lng"] = this["lng"] || 0, b2["lat"] = this["lat"] || 0, b2["alt"] = this["alt"] || 0, b2;
  }
  ["format"]() {
    return this["lng"] = formatNum(this["lng"], _LatLngPoint["FormatLength"]), this["lat"] = formatNum(this["lat"], _LatLngPoint["FormatLength"]), this["alt"] = formatNum(this["alt"], _LatLngPoint["FormatAltLength"]), this;
  }
  ["toArray"](b2 = ![]) {
    return this["format"](), b2 ? [this["lng"], this["lat"], this["alt"]] : [this["lng"], this["lat"]];
  }
  ["toString"]() {
    return this["format"](), this["lng"] + "," + this["lat"] + "," + this["alt"];
  }
  ["toCartesian"]() {
    return a$d["Cartesian3"]["fromDegrees"](this["lng"], this["lat"], this["alt"]);
  }
  ["toCartographic"]() {
    return a$d["Cartographic"]["fromDegrees"](this["lng"], this["lat"], this["alt"]);
  }
  ["equals"](b2) {
    return this === b2 || b2 instanceof _LatLngPoint && this["_alt"] === b2["_alt"] && this["_lat"] === b2["_lat"] && this["_lng"] === b2["_lng"];
  }
  ["valid"]() {
    return this["_lat"] !== 0 && this["_lat"] >= -90 && this["_lat"] <= 90 && this["_lng"] !== 0 && this["_lng"] >= -180 && this["_lng"] <= 180;
  }
};
__publicField(_LatLngPoint, "FormatLength", 6);
__publicField(_LatLngPoint, "FormatAltLength", 2);
let LatLngPoint = _LatLngPoint;
const ChinaCRS = { "WGS84": "WGS84", "GCJ02": "GCJ02", "BD09": "BD09" };
const ClipType = { "Z": 1, "ZR": 2, "X": 3, "XR": 4, "Y": 5, "YR": 6 };
const CRS = { "EPSG3857": "EPSG:3857", "EPSG4326": "EPSG:4326", "EPSG4490": "EPSG:4490", "CGCS2000_GK_Zone_3": "CGCS2000_GK_Zone_3", "CGCS2000_GK_Zone_6": "CGCS2000_GK_Zone_6", "CGCS2000_GK_CM_3": "CGCS2000_GK_CM_3", "CGCS2000_GK_CM_6": "CGCS2000_GK_CM_6" };
const CustomShaderType = { "DistanceColorChange": "DistanceColorChange", "DynamicHalo": "DynamicHalo" };
const State = { "CREATED": "created", "INITED": "inited", "ADDED": "added", "REMOVED": "removed", "DESTROYED": "destroyed" };
class BaseClass {
  constructor(a2) {
    __publicField(this, "originOptions");
    __publicField(this, "uuid");
    __publicField(this, "_onEventHook");
    __publicField(this, "_events");
    __publicField(this, "_eventParents");
    __privateAdd(this, _emittingCount, 0);
    this["originOptions"] = { ...a2 }, this["uuid"] = (a2 == null ? void 0 : a2["uuid"]) ?? guid();
  }
  ["_on"](a2, b2, c2) {
    this["_events"] = this["_events"] || {};
    let d2 = this["_events"][a2];
    !d2 && (d2 = [], this["_events"][a2] = d2);
    c2 == this && (c2 = void 0);
    const e2 = { "fn": b2, "ctx": c2 };
    for (let f2 = 0, g2 = d2["length"]; f2 < g2; f2++) {
      if (d2[f2]["fn"] == b2 && d2[f2]["ctx"] == c2) return;
    }
    d2["push"](e2);
  }
  ["_off"](a2, b2, c2) {
    let d2, e2, f2;
    if (!this["_events"]) return;
    d2 = this["_events"][a2];
    if (!d2) return;
    if (!b2) {
      for (e2 = 0, f2 = d2["length"]; e2 < f2; e2++) {
        d2[e2]["fn"] = falseFn;
      }
      delete this["_events"][a2];
      return;
    }
    c2 == this && (c2 = void 0);
    if (d2) for (e2 = 0, f2 = d2["length"]; e2 < f2; e2++) {
      const g2 = d2[e2];
      if (g2["ctx"] != c2) continue;
      if (g2["fn"] == b2) {
        g2["fn"] = falseFn;
        __privateGet(this, _emittingCount) && (this["_events"][a2] = d2 = d2["slice"]());
        d2["splice"](e2, 1);
        return;
      }
    }
  }
  ["_propagateEvent"](a2) {
    for (const b2 in this["_eventParents"]) {
      this["_eventParents"][b2]["emit"](a2["type"], { "layer": a2["target"], "propagatedFrom": a2["target"], ...a2 }, !![]);
    }
  }
  ["destroy"](a2 = !![]) {
    if (a2) for (const b2 in this) {
      delete this[b2];
    }
  }
  ["on"](a2, b2, c2) {
    if (!a2) return handlerError("NOT_THROW", "on: 绑定事件时传入了空值"), this;
    if (Array["isArray"](a2)) for (let d2 = 0, e2 = a2["length"]; d2 < e2; d2++) {
      this["_on"](a2[d2], b2, c2);
    }
    else {
      if (isObject(a2)) for (const f2 in a2) {
        this["_on"](f2, a2[f2], c2);
      }
      else {
        a2 = a2["trim"]()["split"](/\s+/);
        for (let g2 = 0, h2 = a2["length"]; g2 < h2; g2++) {
          this["_on"](a2[g2], b2, c2);
        }
      }
    }
    return this["_onEventHook"] && this["_onEventHook"](a2), this;
  }
  ["off"](a2, b2, c2) {
    if (!a2) delete this["_events"];
    else {
      if (Array["isArray"](a2)) for (let d2 = 0, e2 = a2["length"]; d2 < e2; d2++) {
        this["_off"](a2[d2], b2, c2);
      }
      else {
        if (isObject(a2)) for (const f2 in a2) {
          this["_off"](f2, a2[f2], c2);
        }
        else {
          a2 = a2["trim"]()["split"](/\s+/);
          for (let g2 = 0, h2 = a2["length"]; g2 < h2; g2++) {
            this["_off"](a2[g2], b2, c2);
          }
        }
      }
    }
    return this;
  }
  ["emit"](a2, b2, c2) {
    if (!this["hasListener"](a2, c2)) return this;
    const d2 = { "type": a2, "target": this, "sourceTarget": (b2 == null ? void 0 : b2["sourceTarget"]) || this, "data": { ...b2 }, "_stopPropagation": ![], "stopPropagation"() {
      this["_stopPropagation"] = !![];
    } };
    if (this["_events"]) {
      const e2 = this["_events"][a2];
      if (e2) {
        __privateSet(this, _emittingCount, __privateGet(this, _emittingCount) + 1 || 1);
        for (let f2 = 0, g2 = e2["length"]; f2 < g2; f2++) {
          const h2 = e2[f2];
          h2["fn"]["call"](h2["ctx"] || this, d2);
        }
        __privateWrapper(this, _emittingCount)._--;
      }
    }
    return c2 && !d2["_stopPropagation"] && this["_propagateEvent"](d2), this;
  }
  ["once"](a2, b2, c2) {
    if (isObject(a2)) {
      for (const e2 in a2) {
        this["once"](e2, a2[e2], c2);
      }
      return this;
    }
    const d2 = bind(() => {
      this["off"](a2, b2, c2)["off"](a2, d2, c2);
    }, this);
    return this["on"](a2, b2, c2)["on"](a2, d2, c2);
  }
  ["hasListener"](a2, b2) {
    const c2 = this["_events"] && this["_events"][a2];
    if (c2 && c2["length"]) return !![];
    if (b2) for (const d2 in this["_eventParents"]) {
      if (this["_eventParents"][d2]["hasListener"](a2, b2)) return !![];
    }
    return ![];
  }
  ["addEventParent"](a2) {
    return this["_eventParents"] = this["_eventParents"] || {}, this["_eventParents"][a2["uuid"]] = a2, this;
  }
  ["removeEventParent"](a2) {
    return this["_eventParents"] && delete this["_eventParents"][a2["uuid"]], this;
  }
  ["hasEventParent"](a2) {
    return this["_eventParents"] && this["_eventParents"][a2["uuid"]] ? !![] : ![];
  }
}
_emittingCount = new WeakMap();
function falseFn() {
  return ![];
}
function bind(a2, b2, ...c2) {
  const d2 = Array["prototype"]["slice"];
  if (a2["bind"]) return a2["bind"]["apply"](a2, [b2]["concat"](d2["call"](c2)));
  return function(...e2) {
    return a2["apply"](b2, c2["length"] > 0 ? c2["concat"](e2) : e2);
  };
}
class BaseEffect extends BaseClass {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "_enable");
    __publicField(this, "_state", State["CREATED"]);
    __publicField(this, "_initCompleted");
    __publicField(this, "_earth");
    __publicField(this, "options");
    this["options"] = b2, this["_enable"] = a$d["defaultValue"](b2["enable"], !![]);
  }
  get ["target"]() {
    return this["_postProcessStage"];
  }
  get ["earth"]() {
    return this["_earth"];
  }
  get ["viewer"]() {
    var _a;
    return (_a = this["_earth"]) == null ? void 0 : _a["viewer"];
  }
  get ["type"]() {
    return this["_type"];
  }
  get ["state"]() {
    return this["_state"];
  }
  get ["enable"]() {
    return this["_enable"];
  }
  set ["enable"](b2) {
    this["setEnable"](b2);
  }
  async ["_onAdd"](b2) {
    if (this["_state"] == State["ADDED"]) return;
    this["_earth"] = b2, this["options"]["eventParent"] !== ![] && (this["options"]["eventParent"] ? this["addEventParent"](this["options"]["eventParent"]) : this["addEventParent"](b2)), !this["_initCompleted"] && (this["_initHooks"](), this["_initCompleted"] = !![], this["_state"] = State["INITED"]), await this["_addHooks"](), this["_state"] = State["ADDED"], this["emit"](EventType["add"], { "effect": this }, !![]), this["emit"](EventType["addEffect"], { "effect": this }, !![]);
  }
  ["_onRemove"]() {
    if (this["_state"] == State["REMOVED"]) return;
    if (!this["_earth"]) return;
    this["_removeHooks"](), this["_state"] = State["REMOVED"], this["emit"](EventType["remove"], { "effect": this }, !![]), this["emit"](EventType["removeEffect"], { "effect": this }, !![]);
    if (this["options"]["eventParent"]) this["removeEventParent"](this["options"]["eventParent"]);
    else {
      if (this["options"]["eventParent"] === ![]) ;
      else this["removeEventParent"](this["_earth"]);
    }
    this["_earth"] = void 0;
  }
  ["setEnable"](b2) {
    if (this["_enable"] == b2 || this["_state"] == State["DESTROYED"]) return;
    this["options"]["enable"] = b2, this["_enable"] = b2, this["state"] == State["ADDED"] && (this["_enableHooks"](b2), b2 ? this["emit"](EventType["enable"], { "effect": this }, b2) : this["emit"](EventType["unable"], { "effect": this }, b2));
  }
  ["addTo"](b2) {
    b2 && b2["addEffect"] && b2["addEffect"](this);
  }
  ["removeTo"](b2 = ![]) {
    this["_earth"] && this["_earth"]["removeEffect"](this, b2);
  }
  ["addedPromise"]() {
    return new Promise((b2) => {
      let c2 = setInterval(() => {
        this["state"] == State["ADDED"] && (clearInterval(c2), c2 = void 0, b2(this));
      }, 100);
    });
  }
  ["destroy"]() {
    this["_state"] != State["REMOVED"] && this["removeTo"](), this["_destroyHooks"](), super["destroy"](), this["_state"] = State["DESTROYED"];
  }
}
var Fog_default = "float getDistance(sampler2D depthTexture, vec2 texCoords)\r\n{\r\n    float depth = czm_unpackDepth(texture(depthTexture, texCoords));\r\n    if (depth == 0.0) {\r\n        return czm_infinity;\r\n    }\r\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\r\n    return -eyeCoordinate.z / eyeCoordinate.w;\r\n}\r\nfloat interpolateByDistance(vec4 nearFarScalar, float distance)\r\n{\r\n    float startDistance = nearFarScalar.x;\r\n    float startValue = nearFarScalar.y;\r\n    float endDistance = nearFarScalar.z;\r\n    float endValue = nearFarScalar.w;\r\n    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\r\n    return mix(startValue, endValue, t);\r\n}\r\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)\r\n{\r\n    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\r\n}\r\nuniform sampler2D colorTexture;\r\nuniform sampler2D depthTexture;\r\nuniform vec4 fogByDistance;\r\nuniform vec4 fogColor;\r\nin vec2 v_textureCoordinates;\r\nout vec4 FragColor;\r\nvoid main(void)\r\n{\r\n    float distance = getDistance(depthTexture, v_textureCoordinates);\r\n    vec4 sceneColor = texture(colorTexture, v_textureCoordinates);\r\n    float blendAmount = interpolateByDistance(fogByDistance, distance);\r\n    vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);\r\n    FragColor = alphaBlend(finalFogColor, sceneColor);\r\n}";
class FogEffect extends BaseEffect {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_type", "fog");
    __publicField(this, "_postProcessStage");
    __publicField(this, "options");
    __publicField(this, "fogByDistance");
    __publicField(this, "color");
    __publicField(this, "maxHeight");
    this["options"] = c2, this["fogByDistance"] = this["options"]["fogByDistance"] = a$d["defaultValue"](this["options"]["fogByDistance"], new a$d["Cartesian4"](500, 0, 5e3, 0.7)), this["color"] = this["options"]["color"] = a$d["defaultValue"](this["options"]["color"], a$d["Color"]["WHITE"]), this["maxHeight"] = this["options"]["maxHeight"];
  }
  async ["_initHooks"]() {
    this["_postProcessStage"] = new a$d["PostProcessStage"]({ "name": this["uuid"], "fragmentShader": Fog_default, "uniforms": { "fogByDistance": () => {
      return this["fogByDistance"];
    }, "fogColor": () => {
      return this["color"];
    } }, "enabled": this["enable"] });
  }
  async ["_addHooks"]() {
    var _a, _b;
    this["_enableHooks"](this["enable"]), (_a = this["viewer"]) == null ? void 0 : _a["scene"]["camera"]["changed"]["addEventListener"](this["_camera_changedHandler"], this), this["_postProcessStage"] && ((_b = this["viewer"]) == null ? void 0 : _b["scene"]["postProcessStages"]["add"](this["_postProcessStage"]));
  }
  ["_removeHooks"]() {
    var _a, _b;
    (_a = this["viewer"]) == null ? void 0 : _a["scene"]["camera"]["changed"]["removeEventListener"](this["_camera_changedHandler"], this), this["_postProcessStage"] && ((_b = this["viewer"]) == null ? void 0 : _b["scene"]["postProcessStages"]["remove"](this["_postProcessStage"]), this["_postProcessStage"] = void 0);
  }
  ["_destroyHooks"]() {
  }
  ["_enableHooks"](c2) {
    this["_postProcessStage"] && (this["_postProcessStage"]["enabled"] = c2);
  }
  ["_camera_changedHandler"](c2) {
    if (!this["_postProcessStage"]) return;
    !this["maxHeight"] || this["viewer"] && this["viewer"]["camera"]["positionCartographic"]["height"] < this["maxHeight"] ? this["_postProcessStage"]["enabled"] = this["enable"] : this["_postProcessStage"]["enabled"] = ![];
  }
}
var Rain_default = "uniform sampler2D colorTexture;\nin vec2 v_textureCoordinates;\r\nuniform float speed;\r\nuniform float size;\r\nuniform float direction;\r\nout vec4 FragColor;\n\nfloat hash(float x){\r\n    return fract(sin(x*23.3)*13.13);\r\n}\n\nvoid main(void){\n\n    float time = czm_frameNumber * speed/ 1000.0;\r\n    vec2 resolution = czm_viewport.zw;\n\n    vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\r\n    vec3 finalColor=vec3(0.1,0.2,0.3);\n\n    float si=sin(direction),co=cos(direction);\r\n    uv*=mat2(co,-si,si,co);\r\n    uv*=length(uv+vec2(0,4.9))*0.3+1.0;\n\n    float v=1.-sin(hash(floor(uv.x*100.0))*2.0);\r\n    float b=clamp(abs(sin(20.0*time*v+uv.y*(5./(2.0+v))))-.95,0.0,1.0)*size;\r\n    finalColor*=v*b; \n\n    FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1.0), 0.3); \n}";
class RainEffect extends BaseEffect {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_type", "rain");
    __publicField(this, "_postProcessStage");
    __publicField(this, "options");
    this["options"] = c2;
  }
  get ["speed"]() {
    var _a;
    return (_a = this["_postProcessStage"]) == null ? void 0 : _a["uniforms"]["speed"];
  }
  set ["speed"](c2) {
    this["options"]["speed"] = c2, this["_postProcessStage"] && (this["_postProcessStage"]["uniforms"]["speed"] = c2);
  }
  get ["size"]() {
    var _a;
    return (_a = this["_postProcessStage"]) == null ? void 0 : _a["uniforms"]["size"];
  }
  set ["size"](c2) {
    this["options"]["size"] = c2, this["_postProcessStage"] && (this["_postProcessStage"]["uniforms"]["size"] = c2);
  }
  get ["direction"]() {
    var _a;
    return (_a = this["_postProcessStage"]) == null ? void 0 : _a["uniforms"]["direction"];
  }
  set ["direction"](c2) {
    this["options"]["direction"] = c2, this["_postProcessStage"] && (this["_postProcessStage"]["uniforms"]["direction"] = a$d["Math"]["toRadians"](c2));
  }
  async ["_initHooks"]() {
    this["_postProcessStage"] = new a$d["PostProcessStage"]({ "name": this["uuid"], "fragmentShader": Rain_default, "uniforms": { "speed": a$d["defaultValue"](this["options"]["speed"], 10), "size": a$d["defaultValue"](this["options"]["size"], 20), "direction": a$d["Math"]["toRadians"](a$d["defaultValue"](this["options"]["direction"], -30)) }, "enabled": this["enable"] });
  }
  async ["_addHooks"]() {
    var _a;
    this["_enableHooks"](this["enable"]), this["_postProcessStage"] && ((_a = this["viewer"]) == null ? void 0 : _a["scene"]["postProcessStages"]["add"](this["_postProcessStage"]));
  }
  ["_removeHooks"]() {
    var _a;
    this["_postProcessStage"] && ((_a = this["viewer"]) == null ? void 0 : _a["scene"]["postProcessStages"]["remove"](this["_postProcessStage"]), this["_postProcessStage"] = void 0);
  }
  ["_destroyHooks"]() {
  }
  ["_enableHooks"](c2) {
    this["_postProcessStage"] && (this["_postProcessStage"]["enabled"] = c2);
  }
}
var Snow_default = "uniform sampler2D colorTexture; \nin vec2 v_textureCoordinates;\r\nuniform float speed;\r\nout vec4 FragColor;\r\nfloat snow(vec2 uv,float scale){\r\n    float time = czm_frameNumber * speed / 1000.0 ;\r\n    float w=smoothstep(1.0,0.0,-uv.y*(scale/10.0));\r\n    if(w<0.1)return 0.0;\r\n    uv+=time/scale;\r\n    uv.y+=time*2.0/scale;\r\n    uv.x+=sin(uv.y+time*0.5)/scale;\r\n    uv*=scale;\n\n    vec2 s=floor(uv),f=fract(uv),p;\r\n    float k=3.0,d;\r\n    p=0.5+0.35*sin(11.0*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.0))-f;\r\n    d=length(p);k=min(d,k);\r\n    k=smoothstep(0.0,k,sin(f.x+f.y)*0.01);\r\n    return k*w;\r\n}\n\nvoid main(void){\r\n    vec2 resolution = czm_viewport.zw;\r\n    vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n\n    float c = 0.0;\r\n    c+=snow(uv,15.);\r\n    c+=snow(uv,10.);\r\n    c+=snow(uv,9.);\r\n    c+=snow(uv,8.);\r\n    c+=snow(uv,7.);\r\n    c+=snow(uv,6.);\r\n    c+=snow(uv,5.);\r\n    c+=snow(uv,4.);\n\n    vec3 finalColor=(vec3(c)); \n\n    FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1.0), 0.3);  \n\n}";
class SnowEffect extends BaseEffect {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_type", "snow");
    __publicField(this, "_postProcessStage");
    __publicField(this, "options");
    this["options"] = c2;
  }
  get ["speed"]() {
    var _a;
    return (_a = this["_postProcessStage"]) == null ? void 0 : _a["uniforms"]["speed"];
  }
  set ["speed"](c2) {
    this["options"]["speed"] = c2, this["_postProcessStage"] && (this["_postProcessStage"]["uniforms"]["speed"] = c2);
  }
  async ["_initHooks"]() {
    this["_postProcessStage"] = new a$d["PostProcessStage"]({ "name": this["uuid"], "fragmentShader": Snow_default, "uniforms": { "speed": a$d["defaultValue"](this["options"]["speed"], 10) }, "enabled": this["enable"] });
  }
  async ["_addHooks"]() {
    var _a;
    this["_enableHooks"](this["enable"]), this["_postProcessStage"] && ((_a = this["viewer"]) == null ? void 0 : _a["scene"]["postProcessStages"]["add"](this["_postProcessStage"]));
  }
  ["_removeHooks"]() {
    var _a;
    this["_postProcessStage"] && ((_a = this["viewer"]) == null ? void 0 : _a["scene"]["postProcessStages"]["remove"](this["_postProcessStage"]), this["_postProcessStage"] = void 0);
  }
  ["_destroyHooks"]() {
  }
  ["_enableHooks"](c2) {
    this["_postProcessStage"] && (this["_postProcessStage"]["enabled"] = c2);
  }
}
var SnowCover_default = "uniform float alpha;\r\nuniform sampler2D colorTexture;\r\nuniform sampler2D depthTexture;\r\nin vec2 v_textureCoordinates;\r\nvec4 toEye(in vec2 uv, in float depth) {\r\n  vec2 xy = vec2((uv.x * 2. - 1.), (uv.y * 2. - 1.));\r\n  vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.);\r\n  posInCamera = posInCamera / posInCamera.w;\r\n  return posInCamera;\r\n}\r\nfloat getDepth(in vec4 depth) {\r\n  float z_window = czm_unpackDepth(depth);\r\n  z_window = czm_reverseLogDepth(z_window);\r\n  float n_range = czm_depthRange.near;\r\n  float f_range = czm_depthRange.far;\r\n  return (2. * z_window - n_range - f_range) / (f_range - n_range);\r\n}\r\nvoid main(void) {\r\n  vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\r\n  vec4 color = texture(colorTexture, v_textureCoordinates);\r\n  vec4 originDepth = texture(depthTexture, v_textureCoordinates);\r\n  float depth = czm_unpackDepth(originDepth);\r\n  vec4 positionEC = toEye(v_textureCoordinates, depth);\r\n  vec4 positionWC = czm_inverseView * positionEC;\r\n  float padx = czm_pixelRatio / czm_viewport.z;\r\n  float pady = czm_pixelRatio / czm_viewport.w;\r\n  float depth2 = getDepth(texture(depthTexture, v_textureCoordinates + vec2(-padx, 0.)));\r\n  vec4 eyeCoordinates2 = toEye(v_textureCoordinates + vec2(-padx, 0.), depth2);\r\n  float depth3 = getDepth(texture(depthTexture, v_textureCoordinates + vec2(padx, 0.)));\r\n  vec4 eyeCoordinates3 = toEye(v_textureCoordinates + vec2(padx, 0.), depth3);\r\n  float depth4 = getDepth(texture(depthTexture, v_textureCoordinates + vec2(0., -pady)));\r\n  vec4 eyeCoordinates4 = toEye(v_textureCoordinates + vec2(0., -pady), depth4);\r\n  float depth5 = getDepth(texture(depthTexture, v_textureCoordinates + vec2(0., pady)));\r\n  vec4 eyeCoordinates5 = toEye(v_textureCoordinates + vec2(0., pady), depth5);\r\n  vec3 dx = eyeCoordinates3.xyz - eyeCoordinates2.xyz;\r\n  vec3 dy = eyeCoordinates4.xyz - eyeCoordinates5.xyz;\r\n  vec3 normalEC = normalize(cross(dy, dx));\r\n  vec3 normalWC = czm_inverseViewRotation * normalEC;\r\n  vec3 upWC = normalize(positionWC.xyz);\r\n  float angle = dot(upWC, normalWC);\r\n  if(depth >= 1.0) {\r\n    out_FragColor = color;\r\n  } else {\r\n    out_FragColor = mix(color, white, clamp(angle, 0., 1. * alpha));\r\n  }\r\n}";
class SnowCoverEffect extends BaseEffect {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_type", "snowCover");
    __publicField(this, "_postProcessStage");
    __publicField(this, "maxHeight");
    __publicField(this, "options");
    this["options"] = c2, this["maxHeight"] = this["options"]["maxHeight"] = a$d["defaultValue"](c2["maxHeight"], 5e3);
  }
  get ["alpha"]() {
    var _a;
    return (_a = this["_postProcessStage"]) == null ? void 0 : _a["uniforms"]["alpha"];
  }
  set ["alpha"](c2) {
    this["_postProcessStage"] && (this["_postProcessStage"]["uniforms"]["alpha"] = c2);
  }
  async ["_initHooks"]() {
    this["_postProcessStage"] = new a$d["PostProcessStage"]({ "name": this["uuid"], "fragmentShader": SnowCover_default, "uniforms": { "alpha": a$d["defaultValue"](this["options"]["alpha"], 1) }, "enabled": this["enable"] });
  }
  async ["_addHooks"]() {
    var _a, _b;
    this["_enableHooks"](this["enable"]), (_a = this["viewer"]) == null ? void 0 : _a["scene"]["camera"]["changed"]["addEventListener"](this["_camera_changedHandler"], this), this["_postProcessStage"] && ((_b = this["viewer"]) == null ? void 0 : _b["scene"]["postProcessStages"]["add"](this["_postProcessStage"]));
  }
  ["_removeHooks"]() {
    var _a, _b;
    (_a = this["viewer"]) == null ? void 0 : _a["scene"]["camera"]["changed"]["removeEventListener"](this["_camera_changedHandler"], this), this["_postProcessStage"] && ((_b = this["viewer"]) == null ? void 0 : _b["scene"]["postProcessStages"]["remove"](this["_postProcessStage"]), this["_postProcessStage"] = void 0);
  }
  ["_destroyHooks"]() {
  }
  ["_enableHooks"](c2) {
    this["_postProcessStage"] && (this["_postProcessStage"]["enabled"] = c2);
  }
  ["_camera_changedHandler"](c2) {
    if (!this["_postProcessStage"]) return;
    !this["maxHeight"] || this["viewer"] && this["viewer"]["camera"]["positionCartographic"]["height"] < this["maxHeight"] ? this["_postProcessStage"]["enabled"] = this["enable"] : this["_postProcessStage"]["enabled"] = ![];
  }
}
var Lightning_default = "float hash(float x) {\r\n  return fract(21654.6512 * sin(385.51 * x));\r\n}\r\nfloat hash(vec2 p) {\r\n  return fract(1654.65157 * sin(15.5134763 * p.x + 45.5173247 * p.y + 5.21789));\r\n}\r\nvec2 hash2(vec2 p) {\r\n  return vec2(hash(p * .754), hash(1.5743 * p + 4.5476351));\r\n}\r\nvec2 add = vec2(1.0, 0.0);\r\nvec2 noise2(vec2 x) {\r\n  vec2 p = floor(x);\r\n  vec2 f = fract(x);\r\n  f = f * f * (3.0 - 2.0 * f);\r\n  vec2 res = mix(mix(hash2(p), hash2(p + add.xy), f.x), mix(hash2(p + add.yx), hash2(p + add.xx), f.x), f.y);\r\n  return res;\r\n}\r\nvec2 fbm2(vec2 x) {\r\n  vec2 r = vec2(0.0);\r\n  float a = 1.0;\r\n  for(int i = 0; i < 8; i++) {\r\n    r += noise2(x) * a;\r\n    x *= 2.;\r\n    a *= .5;\r\n  }\r\n  return r;\r\n}\r\nfloat dseg(vec2 ba, vec2 pa) {\r\n  float h = clamp(dot(pa, ba) / dot(ba, ba), -0.2, 1.);\r\n  return length(pa - ba * h);\r\n}\r\nuniform float fallGap;\r\nuniform float mixFactor;\r\nuniform sampler2D colorTexture;\r\nin vec2 v_textureCoordinates;\r\nout vec4 FragColor;\n\nvoid main() {\r\n  vec2 uv = gl_FragCoord.xy;\r\n  float iTime = czm_frameNumber * fallGap * clamp(fallGap * 0.1, 0.01, 0.1);\r\n  vec2 p = uv / czm_viewport.zw;\r\n  vec2 d;\r\n  vec2 tgt = vec2(1., -1.);\r\n  float c = 0.;\r\n  if(p.y >= 0.) {\r\n    c = (1. - (fbm2((p + .2) * p.y + .1 * iTime)).x) * p.y;\r\n  } else {\r\n    c = (1. - (fbm2(p + .2 + .1 * iTime)).x) * p.y * p.y;\r\n  }\r\n  vec3 col = vec3(0.);\r\n  \n  vec3 col1 = c * vec3(.3, .5, 1.);\r\n  float mdist = 100000.;\r\n  float t = hash(floor(5. * iTime));\r\n  tgt += 4. * hash2(tgt + t) - 1.5;\r\n  if(hash(t + 2.3) > .6)\r\n    for(int i = 0; i < 100; i++) {\r\n      vec2 dtgt = tgt - p;\r\n      d = .05 * (vec2(-.5, -1.) + hash2(vec2(float(i), t)));\r\n      \n      float dist = dseg(d, dtgt);\r\n      \n      mdist = min(mdist, dist);\r\n      tgt -= d;\r\n      c = exp(-1.2 * dist) + exp(-55. * mdist);\r\n      col = c * vec3(.7, .8, 1.);\r\n    }\r\n  \n  col += col1;\r\n  FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(col, 0.0), mixFactor);\r\n}";
class LightningEffect extends BaseEffect {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_type", "lightning");
    __publicField(this, "_postProcessStage");
    __publicField(this, "options");
    this["options"] = c2;
  }
  get ["fallGap"]() {
    var _a;
    return (_a = this["_postProcessStage"]) == null ? void 0 : _a["uniforms"]["fallGap"];
  }
  set ["fallGap"](c2) {
    this["options"]["fallGap"] = c2, this["_postProcessStage"] && (this["_postProcessStage"]["uniforms"]["fallGap"] = c2);
  }
  get ["mixFactor"]() {
    var _a;
    return (_a = this["_postProcessStage"]) == null ? void 0 : _a["uniforms"]["mixFactor"];
  }
  set ["mixFactor"](c2) {
    this["options"]["mixFactor"] = c2, this["_postProcessStage"] && (this["_postProcessStage"]["uniforms"]["mixFactor"] = a$d["Math"]["toRadians"](c2));
  }
  async ["_initHooks"]() {
    this["_postProcessStage"] = new a$d["PostProcessStage"]({ "name": this["uuid"], "fragmentShader": Lightning_default, "uniforms": { "mixFactor": a$d["defaultValue"](this["options"]["mixFactor"], 0.3), "fallGap": a$d["defaultValue"](this["options"]["fallGap"], 1) }, "enabled": this["enable"] });
  }
  async ["_addHooks"]() {
    var _a;
    this["_enableHooks"](this["enable"]), this["_postProcessStage"] && ((_a = this["viewer"]) == null ? void 0 : _a["scene"]["postProcessStages"]["add"](this["_postProcessStage"]));
  }
  ["_removeHooks"]() {
    var _a;
    this["_postProcessStage"] && ((_a = this["viewer"]) == null ? void 0 : _a["scene"]["postProcessStages"]["remove"](this["_postProcessStage"]), this["_postProcessStage"] = void 0);
  }
  ["_destroyHooks"]() {
  }
  ["_enableHooks"](c2) {
    this["_postProcessStage"] && (this["_postProcessStage"]["enabled"] = c2);
  }
}
const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseEffect,
  FogEffect,
  LightningEffect,
  RainEffect,
  SnowCoverEffect,
  SnowEffect
}, Symbol.toStringTag, { value: "Module" }));
const EffectType = { "fog": FogEffect, "rain": RainEffect, "snow": SnowEffect, "snowCover": SnowCoverEffect, "lightning": LightningEffect };
const EventType = { "add": "add", "remove": "remove", "addLayer": "addLayer", "removeLayer": "removeLayer", "addEffect": "addEffect", "removeEffect": "removeEffect", "enable": "enable", "unable": "unable", "show": "show", "hide": "hide", "click": "click", "clickGraphic": "clickGraphic", "clickTileGraphic": "clickTileGraphic", "clickMap": "clickMap", "dblClick": "dblClick", "leftDown": "leftDown", "leftUp": "leftUp", "mouseMove": "mouseMove", "mouseMoveTarget": "mouseMoveTarget", "wheel": "wheel", "rightClick": "rightClick", "rightDown": "rightDown", "rightUp": "rightUp", "middleClick": "middleClick", "middleDown": "middleDown", "middleUp": "middleUp", "mouseDown": "mouseDown", "mouseUp": "mouseUp", "mouseOver": "mouseOver", "mouseOut": "mouseOut", "pinchStart": "pinchStart", "pinchEnd": "pinchEnd", "pinchMove": "pinchMove", "keydown": "keydown", "keyup": "keyup", "cameraMoveStart": "cameraMoveStart", "cameraMoveEnd": "cameraMoveEnd", "cameraChanged": "cameraChanged", "preUpdate": "preUpdate", "postUpdate": "postUpdate", "preRender": "preRender", "postRender": "postRender", "renderError": "renderError", "morphStart": "morphStart", "morphComplete": "morphComplete", "clockTick": "clockTick", "terrainChange": "terrainChange", "tileLoadProgress": "tileLoadProgress", "openPopup": "openPopup", "closePopup": "closePopup", "destroyPopup": "destroyPopup", "changePopupPosition": "changePopupPosition", "showPopup": "showPopup", "hidePopup": "hidePopup", "tileVisible": "tileVisible", "initialTilesLoaded": "initialTilesLoaded", "allTilesLoaded": "allTilesLoaded", "loadMetadata": "loadMetadata" };
const OptsConverClass = {};
function registerOptsConver(b2, c2) {
  OptsConverClass[b2] && handlerError("NOT_THROW", "registerOptsConver: " + b2 + "类型已存在"), OptsConverClass[b2] = c2;
}
const MaterialClass = {};
function registerMaterial(b2, c2) {
  MaterialClass[b2] && handlerError("NOT_THROW", "registerMaterial: " + b2 + "类型已存在"), MaterialClass[b2] = c2;
}
const MaterialPropertyClass = {};
function registerProperty(b2, c2) {
  MaterialPropertyClass[b2] && handlerError("NOT_THROW", "registerProperty: " + b2 + "属性类型已存在"), MaterialPropertyClass[b2] = c2;
}
function createMaterial(b2, c2) {
  if (!b2) {
    handlerError("NOT_THROW", "createMaterial：请指定MaterialType类型");
    return;
  }
  const d2 = OptsConverClass[b2] || OptsConverClass["default"];
  d2 && (c2["materialType"] = b2, c2 = d2["toCesiumVal"](c2));
  let e2;
  const f2 = MaterialClass[b2];
  return f2 ? e2 = new f2(c2) : e2 = a$d["Material"]["fromType"](b2, c2), e2["options"] = c2, e2["_kbe3d_type"] = b2, e2;
}
function createMaterialProperty(b2, c2) {
  const d2 = MaterialPropertyClass[b2];
  if (d2) {
    const e2 = OptsConverClass[b2] || OptsConverClass["default"];
    e2 && (c2["materialType"] = b2, c2 = e2["toCesiumVal"](c2, {}, !![]));
    const f2 = new d2(c2);
    return f2["_kbe3d_type"] = b2, f2["options"] = c2, f2;
  } else handlerError("NOT_THROW", "createMaterialProperty: 未找到该类型的对应材质属性");
}
function toJSON(b2, c2 = {}) {
  var _a;
  let d2;
  if (b2["_kbe3d_type"]) d2 = b2["_kbe3d_type"];
  else {
    if ((_a = b2 == null ? void 0 : b2["_template"]) == null ? void 0 : _a["type"]) d2 = b2["_template"]["type"];
    else (b2 == null ? void 0 : b2["getType"]) && (d2 = b2["getType"]());
  }
  !d2 && (b2 instanceof a$d["Color"] ? d2 = "Color" : handlerError("NOT_THROW", "toJSON: 未识别的材质类型"));
  const e2 = OptsConverClass[d2] || OptsConverClass["default"];
  return e2 && (c2["materialType"] = d2, e2["toJSON"](b2, c2)), c2;
}
const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  createMaterial,
  createMaterialProperty,
  registerMaterial,
  registerOptsConver,
  registerProperty,
  toJSON
}, Symbol.toStringTag, { value: "Module" }));
function deepClone(a2, b2 = [], c2 = 5) {
  if (a2 == null || typeof a2 !== "object") return a2;
  if (a2 instanceof Date) return new Date(a2["getTime"]());
  if (Array["isArray"](a2) && c2 >= 0) {
    const d2 = [];
    for (let e2 = 0, f2 = a2["length"]; e2 < f2; ++e2) {
      d2[e2] = deepClone(a2[e2], b2, c2 - 1);
    }
    return d2;
  }
  if (typeof a2 === "object" && c2 >= 0) {
    const g2 = {};
    for (const h2 in a2) {
      if (typeof a2[h2] === "function") continue;
      if (b2["includes"](h2)) continue;
      Reflect["has"](a2, h2) && (g2[h2] = deepClone(a2[h2], b2, c2 - 1));
    }
    return g2;
  }
  return a2;
}
const a$c = "data:image/png;base64, ";
function createDom(a2, b2 = "", c2 = null) {
  const d2 = document["createElement"](a2);
  return d2["className"] = b2, c2 && c2["appendChild"](d2), d2;
}
function createSvg(a2, b2, c2, d2 = null) {
  const e2 = document["createElementNS"]("http://www.w3.org/2000/svg", "svg");
  e2["setAttribute"]("class", "svg-path"), e2["setAttribute"]("width", "" + a2), e2["setAttribute"]("height", "" + b2), e2["setAttribute"]("viewBox", "0 0 " + a2 + " " + b2);
  const f2 = document["createElementNS"]("http://www.w3.org/2000/svg", "path");
  return f2["setAttribute"]("d", c2), e2["appendChild"](f2), d2 && d2["appendChild"](e2), e2;
}
function createVideo(a2, b2, c2, d2) {
  const e2 = createDom("video", c2, d2);
  e2["setAttribute"]("autoplay", "true"), e2["setAttribute"]("loop", "true"), e2["setAttribute"]("crossorigin", "anonymous");
  !b2 && (b2 = a2["substring"](a2["lastIndexOf"](".") + 1, a2["length"]));
  const f2 = createDom("source", "", e2);
  return f2["setAttribute"]("src", a2), f2["setAttribute"]("type", "video/" + b2), e2;
}
function get$1(a2) {
  return typeof a2 == "string" ? document["getElementById"](a2) : a2;
}
function parseDom(a2, b2 = ![], c2) {
  const d2 = document["createElement"]("div");
  return c2 && (d2["className"] = c2), d2["innerHTML"] = a2, b2 ? d2 : d2["childNodes"];
}
function remove(a2) {
  const b2 = typeof a2 === "string" ? document["getElementById"](a2) : a2;
  if (!b2) return;
  const c2 = b2["parentNode"];
  c2 && c2["removeChild"](b2);
}
function empty(a2) {
  while (a2["firstChild"]) {
    a2["removeChild"](a2["firstChild"]);
  }
}
function getStyle(a2, b2) {
  var _a, _b;
  let c2 = a2["style"][b2] || ((_a = window["getComputedStyle"](a2, null)) == null ? void 0 : _a["getPropertyValue"](b2)) || null;
  return (!c2 || c2 === "auto") && (c2 = ((_b = window["getComputedStyle"](a2, null)) == null ? void 0 : _b["getPropertyValue"](b2)) || null), c2 === "auto" ? null : c2;
}
function hasClass(a2, b2) {
  if (!a2) return ![];
  if (a2["classList"]) return a2["classList"]["contains"](b2);
  const c2 = a2["className"];
  return c2["length"] > 0 && new RegExp("(^|\\s)" + b2 + "(\\s|$)")["test"](c2);
}
function addClass(a2, b2) {
  if (!a2) return;
  if (a2["classList"]) {
    const c2 = b2["trim"]()["split"](/\s+/);
    for (let d2 = 0; d2 < c2["length"]; d2++) {
      a2["classList"]["add"](c2[d2]);
    }
  } else {
    const e2 = a2["className"]["trim"](), f2 = (e2 + " " + b2)["trim"]();
    f2 !== e2 && (a2["className"] = f2);
  }
}
function removeClass(a2, b2) {
  if (!a2) return;
  a2["classList"] ? a2["classList"]["remove"](b2) : hasClass(a2, b2) && (a2["className"] = (" " + a2["className"] + " ")["replace"](" " + b2 + " ", " ")["trim"]());
}
function setClass(a2, b2) {
  a2 instanceof SVGElement ? a2["className"]["baseVal"] = b2 : a2["className"] = b2;
}
function getClass(a2) {
  a2["correspondingElement"] && (a2 = a2["correspondingElement"]);
  if (a2 instanceof SVGElement) return a2["className"]["baseVal"];
  return a2["className"];
}
function enterFullscreen(a2) {
  if (!a2) return ![];
  const b2 = a2["requestFullscreen"] || a2["msRequestFullscreen"] || a2["mozRequestFullScreen"] || a2["webkitRequestFullscreen"];
  if (b2) return b2["call"](a2), !![];
  return ![];
}
function exitFullscreen() {
  const a2 = ["exitFullscreen", "msExitFullscreen", "mozCancelFullScreen", "webkitExitFullscreen"];
  for (const b2 of a2) {
    if (document[b2]) return document[b2](), !![];
  }
  return ![];
}
class Popup extends BaseClass {
  constructor(d2, e2 = {}) {
    super(e2);
    __publicField(this, "_viewer");
    __publicField(this, "_id");
    __publicField(this, "_container");
    __publicField(this, "_containerArrow");
    __publicField(this, "_containerContent");
    __publicField(this, "_containerCloseSvg");
    __publicField(this, "_currentWindowPosition");
    __publicField(this, "_currentCartesian");
    __publicField(this, "_htmlTemplate");
    __publicField(this, "_componentElement");
    __publicField(this, "_cameraCache");
    __publicField(this, "_direction");
    __publicField(this, "_contentType");
    __publicField(this, "_hasHide", ![]);
    __publicField(this, "emptyText", "暂无数据");
    __publicField(this, "_entity");
    __publicField(this, "options");
    this["options"] = e2, this["_viewer"] = d2, this["_id"] = a$d["defaultValue"](e2["id"], this["uuid"]), this["_direction"] = a$d["defaultValue"](e2["direction"], "top"), this["_contentType"] = a$d["defaultValue"](e2["contentType"], "html"), this["_htmlTemplate"] = e2["htmlTemplate"], this["_componentElement"] = e2["componentElement"], this["emptyText"] = a$d["defaultValue"](e2["emptyText"], "暂无数据"), this["setEntity"](this["options"]["entity"]), this["_initContainer"](), this["_bindPostRender"]();
  }
  get ["id"]() {
    return this["_id"];
  }
  get ["container"]() {
    return this["_container"];
  }
  get ["viewerContainer"]() {
    var _a;
    return (_a = this["_viewer"]) == null ? void 0 : _a["container"];
  }
  get ["direction"]() {
    return this["_direction"];
  }
  set ["direction"](d2) {
    this["_direction"] = d2, this["_setDivPosition"]();
  }
  get ["currentWindowPosition"]() {
    return this["_currentWindowPosition"];
  }
  set ["currentWindowPosition"](d2) {
    this["_currentWindowPosition"] = d2, this["_setDivPosition"]();
  }
  get ["currentCartesian"]() {
    return this["_currentCartesian"];
  }
  set ["currentCartesian"](d2) {
    this["_currentCartesian"] = d2, this["_setEntityPosition"]();
  }
  get ["entity"]() {
    return this["_entity"];
  }
  set ["entity"](d2) {
    this["setEntity"](d2);
  }
  ["_initContainer"]() {
    this["_contentType"] == "html" && (this["_container"] = createDom("div", "kbe3d-popup"), this["_container"]["setAttribute"]("uuid", this["uuid"]), this["_container"]["setAttribute"]("id", "kbe3d-popup-" + this["id"]), this["_container"]["style"]["display"] = "none", this["_containerArrow"] = createDom("div", "kbe3d-popup-arrow kbe3d-popup-rightArrow", this["_container"]), this["_containerContent"] = createDom("div", "kbe3d-popup-inner", this["_container"]), this["_containerCloseSvg"] = parseDom('<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z"/></svg>')[0], this["_containerCloseSvg"]["classList"]["add"]("kbe3d-popup-close"), this["_container"]["append"](this["_containerCloseSvg"]), this["_containerCloseSvg"]["addEventListener"]("click", (d2) => {
      this["close"]();
    }), this["viewerContainer"]["appendChild"](this["_container"]));
  }
  ["_bindPostRender"]() {
    this["_viewer"]["scene"]["postRender"]["addEventListener"](this["_render"], this);
  }
  ["_unbindPostRender"]() {
    this["_viewer"]["scene"]["postRender"]["removeEventListener"](this["_render"], this);
  }
  ["_render"]() {
    var _a, _b, _c, _d;
    if (!this["currentCartesian"]) return;
    const d2 = this["currentCartesian"], e2 = this["_viewer"]["scene"], f2 = this["_contentType"] == "html" ? ((_a = this["_container"]) == null ? void 0 : _a["clientHeight"]) ?? 0 : this["_contentType"] == "component" ? ((_b = this["_componentElement"]) == null ? void 0 : _b["clientHeight"]) ?? 0 : 0, g2 = this["_contentType"] == "html" ? ((_c = this["_container"]) == null ? void 0 : _c["clientWidth"]) ?? 0 : this["_contentType"] == "component" ? ((_d = this["_componentElement"]) == null ? void 0 : _d["clientWidth"]) ?? 0 : 0;
    if (this["_isUnchange"](g2, f2)) return;
    if (e2["mode"] == a$d["SceneMode"]["SCENE3D"]) {
      const i2 = new a$d["EllipsoidalOccluder"](e2["globe"]["ellipsoid"], e2["camera"]["positionWC"]), j2 = i2["isPointVisible"](d2);
      if (!j2) {
        this["_container"] && (this["_container"]["style"]["display"] = "none");
        this["_componentElement"] && (this["_componentElement"]["style"]["display"] = "none");
        return;
      }
    }
    this["_container"] && (this["_container"]["style"]["display"] = this["_hasHide"] ? "none" : "block");
    this["_componentElement"] && (this["_componentElement"]["style"]["display"] = this["_hasHide"] ? "none" : "block");
    const h2 = getCanvasXY(this["_viewer"], d2) ?? this["_currentWindowPosition"];
    this["currentWindowPosition"] = h2;
  }
  ["_isUnchange"](d2, e2) {
    var _a, _b, _c;
    const f2 = this["_viewer"]["scene"]["camera"], g2 = { "x": (_a = this["_currentCartesian"]) == null ? void 0 : _a["x"], "y": (_b = this["_currentCartesian"]) == null ? void 0 : _b["y"], "z": (_c = this["_currentCartesian"]) == null ? void 0 : _c["z"], "p1": d2, "p2": e2, "p3": f2["positionWC"]["x"], "p4": f2["positionWC"]["y"], "p5": f2["positionWC"]["z"], "p6": f2["heading"], "p7": f2["pitch"], "p8": f2["roll"] };
    if (this["_cameraCache"] && g2["x"] == this["_cameraCache"]["x"] && g2["x"] == this["_cameraCache"]["x"] && g2["y"] == this["_cameraCache"]["y"] && g2["z"] == this["_cameraCache"]["z"] && g2["p1"] == this["_cameraCache"]["p1"] && g2["p2"] == this["_cameraCache"]["p2"] && g2["p3"] == this["_cameraCache"]["p3"] && g2["p4"] == this["_cameraCache"]["p4"] && g2["p5"] == this["_cameraCache"]["p5"] && g2["p6"] == this["_cameraCache"]["p6"] && g2["p7"] == this["_cameraCache"]["p7"] && g2["p8"] == this["_cameraCache"]["p8"]) return !![];
    return this["_cameraCache"] = g2, ![];
  }
  ["_setDivPosition"]() {
    var _a, _b, _c, _d;
    if (!this["_currentWindowPosition"]) return;
    const d2 = { "top": "unset", "left": "unset", "right": "unset", "bottom": "unset" }, e2 = this["_contentType"] == "html" ? ((_a = this["_container"]) == null ? void 0 : _a["clientHeight"]) ?? 0 : this["_contentType"] == "component" ? ((_b = this["_componentElement"]) == null ? void 0 : _b["clientHeight"]) ?? 0 : 0, f2 = this["_contentType"] == "html" ? ((_c = this["_container"]) == null ? void 0 : _c["clientWidth"]) ?? 0 : this["_contentType"] == "component" ? ((_d = this["_componentElement"]) == null ? void 0 : _d["clientWidth"]) ?? 0 : 0;
    if (this["direction"] == "right") d2["left"] = this["_currentWindowPosition"]["x"] + 5 + "px", d2["top"] = this["_currentWindowPosition"]["y"] - e2 / 2 + "px";
    else {
      if (this["direction"] == "left") d2["left"] = this["_currentWindowPosition"]["x"] - f2 - 5 + "px", d2["top"] = this["_currentWindowPosition"]["y"] - e2 / 2 + "px";
      else {
        if (this["direction"] == "top") d2["left"] = this["_currentWindowPosition"]["x"] - f2 / 2 + "px", d2["top"] = this["_currentWindowPosition"]["y"] - e2 - 5 + "px";
        else this["direction"] == "bottom" && (d2["left"] = this["_currentWindowPosition"]["x"] - f2 / 2 + "px", d2["top"] = this["_currentWindowPosition"]["y"] + 5 + "px");
      }
    }
    this["_contentType"] == "component" && this["_componentElement"] && (this["_componentElement"]["style"]["top"] = d2["top"], this["_componentElement"]["style"]["left"] = d2["left"]);
    if (this["_contentType"] == "html" && this["_container"]) {
      this["_container"]["style"]["top"] = d2["top"], this["_container"]["style"]["left"] = d2["left"];
      if (this["_containerArrow"]) {
        if (this["direction"] == "right") addClass(this["_containerArrow"], "kbe3d-popup-rightArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-leftArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-topArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-bottomArrow");
        else {
          if (this["direction"] == "left") addClass(this["_containerArrow"], "kbe3d-popup-leftArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-rightArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-topArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-bottomArrow");
          else {
            if (this["direction"] == "top") addClass(this["_containerArrow"], "kbe3d-popup-topArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-rightArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-leftArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-bottomArrow");
            else this["direction"] == "bottom" && (addClass(this["_containerArrow"], "kbe3d-popup-bottomArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-rightArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-leftArrow"), removeClass(this["_containerArrow"], "kbe3d-popup-topArrow"));
          }
        }
      }
    }
    this["emit"]("changePopupPosition", { "id": this["id"], "popup": this, "pos": { "direction": this["direction"], ...d2 } });
  }
  ["_setEntityPosition"]() {
    this["_entity"] && this["_currentCartesian"] && (this["_entity"]["position"] = this["_currentCartesian"]);
  }
  ["_hidePopup"]() {
    this["_cameraCache"] = void 0, this["_hasHide"] = !![], this["_entity"] && (this["_entity"]["show"] = ![]), this["_container"] && (this["_container"]["style"]["display"] = "none"), this["_componentElement"] && (this["_componentElement"]["style"]["display"] = "none");
  }
  ["_showPopup"]() {
    this["_cameraCache"] = void 0, this["_hasHide"] = ![], this["_entity"] && (this["_entity"]["show"] = !![]), this["_container"] && (this["_container"]["style"]["display"] = "block"), this["_componentElement"] && (this["_componentElement"]["style"]["display"] = "block");
  }
  ["open"](d2, e2) {
    if (e2 instanceof a$d["Cartesian3"]) this["currentCartesian"] = e2;
    else e2 instanceof a$d["Cartesian2"] ? this["currentCartesian"] = new a$d["Cartesian3"](e2["x"], e2["y"], 0) : this["currentCartesian"] = this["currentCartesian"] ?? a$d["Cartesian3"]["ZERO"];
    const f2 = d2 ?? this["emptyText"];
    if (this["_containerContent"]) {
      this["_containerContent"]["innerHTML"] = "";
      if (isObject(f2) && this["_htmlTemplate"]) {
        const g2 = template(this["_htmlTemplate"], f2, !![]);
        this["_containerContent"]["innerHTML"] = g2["toString"]();
      } else this["_containerContent"]["innerHTML"] = f2["toString"]();
    }
    this["show"](), this["currentWindowPosition"] = getCanvasXY(this["_viewer"], this["currentCartesian"]) ?? a$d["Cartesian2"]["ZERO"], this["emit"]("openPopup", { "id": this["id"], "popup": this, "info": { "showData": f2, "cartesian": this["currentCartesian"], "windowPosition": this["currentWindowPosition"] } });
  }
  ["close"]() {
    this["hide"](), this["_entity"] && (this["_entity"]["show"] = ![]), this["emit"]("closePopup", { "id": this["id"], "popup": this });
  }
  ["show"]() {
    this["_showPopup"](), this["emit"]("showPopup", { "id": this["id"], "popup": this });
  }
  ["hide"]() {
    this["_hidePopup"](), this["emit"]("hidePopup", { "id": this["id"], "popup": this });
  }
  ["destroy"]() {
    this["close"](), this["_container"] && this["_container"]["parentNode"] && this["viewerContainer"]["removeChild"](this["_container"]), this["_entity"] && (this["_viewer"]["entities"]["remove"](this["_entity"]), this["_entity"] = void 0), this["_unbindPostRender"](), this["emit"]("destroyPopup", { "id": this["id"], "popup": this }), super["destroy"](!![]);
  }
  ["setEntity"](d2) {
    var _a, _b;
    const e2 = ((_a = this["_entity"]) == null ? void 0 : _a["show"]) ?? ![], f2 = ((_b = this["_entity"]) == null ? void 0 : _b["position"]) ?? a$d["Cartesian3"]["ZERO"];
    this["_entity"] && this["_viewer"]["entities"]["remove"](this["_entity"]), d2 && (this["_entity"] = d2 instanceof a$d["Entity"] ? d2 : isObject(d2) ? new a$d["Entity"](d2) : new a$d["Entity"]({ "id": "kbe3d-popup-entity-" + this["id"], "position": a$d["Cartesian3"]["ZERO"], "billboard": { "image": a$c, "verticalOrigin": a$d["VerticalOrigin"]["CENTER"] } }), this["_entity"]["show"] = e2, this["_entity"]["position"] = f2, this["_viewer"]["entities"]["add"](this["_entity"]));
  }
  ["emit"](d2, e2) {
    return super["emit"](d2, e2, !![]);
  }
  ["on"](d2, e2, f2) {
    return super["on"](d2, e2, f2);
  }
  ["off"](d2, e2, f2) {
    return super["off"](d2, e2, f2);
  }
}
__publicField(Popup, "EventType", { ...pick(EventType, ["openPopup", "closePopup", "destroyPopup", "changePopupPosition", "showPopup", "hidePopup"]) });
class BaseLayer extends BaseClass {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "_show");
    __publicField(this, "_state", State["CREATED"]);
    __publicField(this, "_initCompleted");
    __publicField(this, "_popup");
    __publicField(this, "_earth");
    __publicField(this, "options");
    __publicField(this, "parent");
    this["options"] = b2, this["options"]["id"] = a$d["defaultValue"](b2["id"], this["uuid"]), this["options"]["pid"] = a$d["defaultValue"](b2["pid"], -1), this["options"]["name"] = a$d["defaultValue"](b2["name"], this["uuid"]), this["_show"] = a$d["defaultValue"](b2["show"], !![]);
  }
  get ["id"]() {
    return this["options"]["id"];
  }
  get ["pid"]() {
    return this["options"]["pid"];
  }
  get ["name"]() {
    return this["options"]["name"];
  }
  get ["earth"]() {
    return this["_earth"];
  }
  get ["viewer"]() {
    var _a;
    return (_a = this["_earth"]) == null ? void 0 : _a["viewer"];
  }
  get ["popup"]() {
    return this["_popup"];
  }
  get ["type"]() {
    return this["_type"];
  }
  get ["state"]() {
    return this["_state"];
  }
  get ["show"]() {
    return this["_show"];
  }
  set ["show"](b2) {
    this["setShow"](b2);
  }
  async ["_onAdd"](b2) {
    if (this["_state"] == State["ADDED"]) return;
    this["_earth"] = b2;
    this["options"]["eventParent"] !== ![] && (this["options"]["eventParent"] ? this["addEventParent"](this["options"]["eventParent"]) : this["addEventParent"](b2));
    if (!this["_initCompleted"]) {
      await this["_initHooks"]();
      if (this["viewer"] && a$d["defined"](this["options"]["popup"])) {
        if (this["options"]["popup"]) {
          if (isBoolean(this["options"]["popup"])) this["bindPopup"]();
          else isObject(this["options"]["popup"]) ? this["bindPopup"](this["options"]["popup"]) : handlerInfo("图层构造参数‘popup’有误，仅支持对象及布尔类型");
        }
      }
      this["_initCompleted"] = !![], this["_state"] = State["INITED"];
    }
    await this["_addHooks"](), this["_state"] = State["ADDED"], this["options"]["flyTo"] && this["flyTo"](), this["emit"](EventType["add"], { "layer": this }, !![]), this["emit"](EventType["addLayer"], { "layer": this }, !![]);
  }
  ["_onRemove"]() {
    if (this["_state"] == State["REMOVED"]) return;
    if (!this["_earth"]) return;
    this["_removeHooks"](), this["_state"] = State["REMOVED"], this["emit"](EventType["remove"], { "layer": this }, !![]), this["emit"](EventType["removeLayer"], { "layer": this }, !![]);
    if (this["options"]["eventParent"]) this["removeEventParent"](this["options"]["eventParent"]);
    else {
      if (this["options"]["eventParent"] === ![]) ;
      else this["removeEventParent"](this["_earth"]);
    }
    this["_earth"] = void 0;
  }
  ["setShow"](b2) {
    var _a, _b;
    if (this["_show"] == b2 || this["_state"] == State["DESTROYED"]) return;
    this["options"]["show"] = b2, this["_show"] = b2;
    if (this["layerSource"]) {
      if (isArray(this["layerSource"])) this["layerSource"]["forEach"]((c2) => {
        c2["show"] = b2;
      });
      else isObject(this["layerSource"]) && (this["layerSource"]["show"] = b2);
    }
    this["state"] == State["ADDED"] && (this["_showHooks"](b2), b2 ? ((_a = this["_popup"]) == null ? void 0 : _a["show"](), this["emit"](EventType["show"], { "layer": this }, !![])) : ((_b = this["_popup"]) == null ? void 0 : _b["hide"](), this["emit"](EventType["hide"], { "layer": this }, !![])));
  }
  ["flyTo"](b2) {
    if (!this["_earth"]) return ![];
    this["_earth"]["cancelFlyTo"]();
    if (this["options"]["homeVision"]) return this["_earth"]["flyTo"]({ ...this["options"]["homeVision"], ...b2 }), !![];
    else {
      if (this["getRectangle"]) {
        const c2 = this["getRectangle"](!![]);
        return c2 ? (this["_earth"]["flyToExtent"](c2, { ...b2 }), !![]) : ![];
      }
    }
    return ![];
  }
  ["toJSON"]() {
    const b2 = deepClone(this["options"], ["parent", "eventParent"]);
    return b2["type"] = this["type"], b2["show"] = this["show"], this["_toJsonHooks"](b2), b2;
  }
  ["addTo"](b2) {
    b2 && b2["addLayer"] && b2["addLayer"](this);
  }
  ["removeTo"](b2 = ![]) {
    this["_earth"] && this["_earth"]["removeLayer"](this, b2);
  }
  ["addedPromise"]() {
    return new Promise((b2) => {
      let c2 = setInterval(() => {
        this["state"] == State["ADDED"] && (clearInterval(c2), c2 = void 0, b2(this));
      }, 100);
    });
  }
  ["bindPopup"](b2 = {}) {
    var _a;
    this["_earth"] ? ((_a = this["_popup"]) == null ? void 0 : _a["destroy"](), this["_popup"] = new Popup(this["_earth"]["viewer"], b2), this["_popup"]["addEventParent"](this), this["_popup"]["addEventParent"](this["_earth"])) : handlerError("NOT_THROW", "绑定弹窗需要传入earth实例");
  }
  ["unbindPopup"]() {
    var _a;
    (_a = this["_popup"]) == null ? void 0 : _a["destroy"](), this["_popup"] = void 0;
  }
  ["destroy"]() {
    this["_state"] != State["REMOVED"] && this["removeTo"](), this["_destroyHooks"](), super["destroy"](), this["_state"] = State["DESTROYED"];
  }
}
__publicField(BaseLayer, "EventType", { ...pick(EventType, ["add", "addLayer", "remove", "removeLayer", "show", "hide", "click", "leftDown", "leftUp", "rightClick", "rightDown", "rightUp", "middleClick", "middleDown", "middleUp", "mouseDown", "mouseUp", "mouseOver", "mouseOut"]), ...Popup["EventType"] });
class BaseGraphicLayer extends BaseLayer {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "options");
    __publicField(this, "_primitiveCollection");
    __publicField(this, "_dataSource");
    this["options"] = b2;
  }
  get ["isTile"]() {
    return ![];
  }
  get ["zIndex"]() {
    return this["options"]["zIndex"] ?? -1;
  }
  set ["zIndex"](b2) {
    this["setZIndex"](b2);
  }
  get ["layerSource"]() {
    const b2 = [];
    return this["_primitiveCollection"] && b2["push"](this["_primitiveCollection"]), this["_dataSource"] && b2["push"](this["_dataSource"]), b2;
  }
  get ["primitiveCollection"]() {
    return this["_primitiveCollection"];
  }
  get ["dataSource"]() {
    return this["_dataSource"];
  }
  async ["_initHooks"]() {
    !this["_primitiveCollection"] && (this["_primitiveCollection"] = new a$d["PrimitiveCollection"](), this["_primitiveCollection"]["show"] = this["show"]), !this["_dataSource"] && (this["_dataSource"] = new a$d["CustomDataSource"](this["uuid"]), this["_dataSource"]["show"] = this["show"]);
  }
  async ["_addHooks"]() {
    var _a, _b;
    this["_primitiveCollection"] && ((_a = this["_earth"]) == null ? void 0 : _a["viewer"]["scene"]["primitives"]["add"](this["_primitiveCollection"])), this["_dataSource"] && ((_b = this["_earth"]) == null ? void 0 : _b["dataSources"]["add"](this["_dataSource"])), a$d["defined"](this["options"]["zIndex"]) && this["setZIndex"](this["options"]["zIndex"]);
  }
  ["_removeHooks"]() {
    var _a, _b;
    this["_primitiveCollection"] && (this["_earth"] && (this["_earth"]["viewer"]["scene"]["primitives"]["destroyPrimitives"] = ![]), (_a = this["_earth"]) == null ? void 0 : _a["viewer"]["scene"]["primitives"]["remove"](this["_primitiveCollection"])), this["_dataSource"] && ((_b = this["_earth"]) == null ? void 0 : _b["dataSources"]["remove"](this["_dataSource"], ![]));
  }
  ["_destroyHooks"]() {
    var _a, _b;
    this["_earth"] && (this["_earth"]["viewer"]["scene"]["primitives"]["destroyPrimitives"] = !![]), (_a = this["_primitiveCollection"]) == null ? void 0 : _a["removeAll"](), (_b = this["_dataSource"]) == null ? void 0 : _b["entities"]["removeAll"]();
  }
  ["_showHooks"](b2) {
  }
  ["_toJsonHooks"](b2) {
  }
  ["setZIndex"](b2) {
    this["options"]["zIndex"] = b2;
    if (!this["_earth"]) return;
    if (this["_primitiveCollection"] && this["_earth"]["viewer"]["scene"]["primitives"]["contains"](this["_primitiveCollection"])) {
      this["_primitiveCollection"]["_kbe3d_zIndex"] = b2, this["_earth"]["viewer"]["scene"]["primitives"]["raiseToTop"](this["_primitiveCollection"]);
      const c2 = this["_earth"]["viewer"]["scene"]["primitives"];
      for (let d2 = c2["length"] - 1; d2 >= 0; d2--) {
        const e2 = c2["get"](d2);
        if (e2 == this["_primitiveCollection"]) continue;
        a$d["defined"](e2["_kbe3d_zIndex"]) && b2 < e2["_kbe3d_zIndex"] && this["_earth"]["viewer"]["scene"]["primitives"]["lower"](this["_primitiveCollection"]);
      }
    }
    if (this["_dataSource"] && this["_earth"]["dataSources"]["contains"](this["_dataSource"])) {
      this["_dataSource"]["_kbe3d_zIndex"] = b2, this["_earth"]["dataSources"]["raiseToTop"](this["_dataSource"]);
      const f2 = this["_earth"]["dataSources"];
      for (let g2 = f2["length"] - 1; g2 >= 0; g2--) {
        const h2 = f2["get"](g2);
        if (h2 == this["_dataSource"]) continue;
        a$d["defined"](h2["_kbe3d_zIndex"]) && b2 < h2["_kbe3d_zIndex"] && this["_earth"]["dataSources"]["lower"](this["_dataSource"]);
      }
    }
  }
}
class ColorPatternGradientLayer extends BaseGraphicLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "colorPatternGradient");
    __publicField(this, "_colorPatternGradientPrimitive");
    __publicField(this, "_colorRamp");
    __publicField(this, "_rectangle");
    __publicField(this, "_aboveGround");
    __publicField(this, "_height");
    __publicField(this, "_uniforms");
    __publicField(this, "options");
    this["options"] = b2, !b2["colorRamp"] && handlerError("THROW", 'Constructor: 构造参数未传入色带数组 "colorRamp"，该项为必传项'), this["_colorRamp"] = b2["colorRamp"]["sort"]((c2, d2) => c2["value"] - d2["value"]), this["_aboveGround"] = a$d["defaultValue"](this["options"]["aboveGround"], ![]), this["_height"] = a$d["defaultValue"](this["options"]["height"], 0), this["_rectangle"] = parseRectangle(this["options"]["rectangle"]) ?? a$d["Rectangle"]["MAX_VALUE"], !b2["uniformOptions"]["image"] && handlerError("THROW", 'Constructor: 构造参数未传入数值预报查询图片接口返回的基础图片 "uniformOptions.image"，该项为必传项'), this["_uniforms"] = this["_createUniforms"](this["options"]["uniformOptions"]);
  }
  get ["rectangle"]() {
    return this["_rectangle"];
  }
  get ["colorRamp"]() {
    return this["_colorRamp"];
  }
  set ["colorRamp"](b2) {
    this["setColorRamp"](b2);
  }
  get ["opacity"]() {
    return this["options"]["uniformOptions"]["alpha"];
  }
  set ["opacity"](b2) {
    this["setOpacity"](b2 ?? 0.8);
  }
  async ["_initHooks"]() {
    super["_initHooks"]();
  }
  async ["_addHooks"]() {
    var _a;
    super["_addHooks"](), this["_colorPatternGradientPrimitive"] = this["_createColorPatternGradientPrimitive"](), (_a = this["primitiveCollection"]) == null ? void 0 : _a["add"](this["_colorPatternGradientPrimitive"]);
  }
  ["_removeHooks"]() {
    super["_removeHooks"]();
  }
  ["_destroyHooks"]() {
    super["_destroyHooks"]();
  }
  ["_showHooks"](b2) {
    super["_showHooks"](b2);
  }
  ["_toJsonHooks"](b2) {
    super["_toJsonHooks"](b2);
  }
  ["_getImgByColorRamp"](b2, c2, d2, e2 = "linear") {
    const f2 = document["createElement"]("canvas"), g2 = f2["getContext"]("2d");
    if (!g2) return;
    f2["width"] = 256, f2["height"] = 8;
    if (e2 === "linear") {
      const h2 = g2["createLinearGradient"](0, 0, 256, 0);
      d2["forEach"]((i2) => {
        const { value: j2, color: k2 } = i2;
        h2["addColorStop"]((j2 - b2) / (c2 - b2), k2);
      }), g2["fillStyle"] = h2, g2["fillRect"](0, 0, 256, 8);
    } else {
      let i2 = 0;
      d2["forEach"]((j2, k2, l2) => {
        const { value: m2, color: n2 } = j2, o2 = (m2 - b2) / (c2 - b2) * 256;
        g2["fillStyle"] = n2, g2["fillRect"](i2, 0, o2 - i2, 8), i2 = o2, k2 === l2["length"] - 1 && g2["fillRect"](o2, 0, 256 - o2, 8);
      });
    }
    return f2["toDataURL"]("image/png");
  }
  ["_createUniforms"](b2) {
    const c2 = a$d["defaultValue"](b2["alpha"], 0.8), d2 = a$d["defaultValue"](b2["resultSize"], new a$d["Cartesian2"](2880, 1440)), e2 = this["_colorRamp"]["sort"]((h2, i2) => {
      return h2["value"] - i2["value"];
    })[0]["value"], f2 = this["_colorRamp"]["sort"]((h2, i2) => {
      return i2["value"] - h2["value"];
    })[0]["value"], g2 = callWithErrorHandling("THROW", "getImgByColorRamp: 生成基于颜色映射的图像失败", () => this["_getImgByColorRamp"](e2, f2, this["_colorRamp"])) ?? "";
    return { "u_image": b2["image"], "u_colorImage": g2, "u_minValue": e2, "u_maxValue": f2, "u_alpha": c2, "u_resultSize": d2 };
  }
  ["_createColorPatternGradientPrimitive"]() {
    const b2 = this["_aboveGround"] ? a$d["GroundPrimitive"] : a$d["Primitive"], c2 = new b2({ "geometryInstances": new a$d["GeometryInstance"]({ "geometry": new a$d["RectangleGeometry"]({ "ellipsoid": a$d["Ellipsoid"]["WGS84"], "height": this["_aboveGround"] ? 0 : this["_height"], "rectangle": this["_rectangle"], "vertexFormat": a$d["EllipsoidSurfaceAppearance"]["VERTEX_FORMAT"] }) }), "appearance": new a$d["EllipsoidSurfaceAppearance"]({ "aboveGround": this["_aboveGround"] }) }), d2 = createMaterial(MaterialType["ColorPatternGradient"], { ...this["_uniforms"] });
    return d2 && (c2["appearance"]["material"] = d2), c2["_kbe3d_layerId"] = this["uuid"], c2;
  }
  ["getRectangle"](b2) {
    const c2 = this["_rectangle"] ?? a$d["Rectangle"]["MAX_VALUE"];
    return b2 === !![] ? formatRectangle(c2) : c2;
  }
  ["getLegendImage"](b2 = "linear") {
    var _a;
    const c2 = document["createElement"]("canvas"), e2 = c2["getContext"]("2d");
    if (!e2) return;
    const f2 = 256 / this["_colorRamp"]["length"], g2 = "10px serif", h2 = "white";
    let j2 = 256, k2 = 20, l2 = ![];
    const m2 = Math["PI"] / 4;
    this["_colorRamp"]["sort"]((n2, o2) => {
      return n2["value"] - o2["value"];
    });
    for (let n2 = 0; n2 < this["_colorRamp"]["length"]; n2++) {
      e2["font"] = g2;
      const o2 = this["_colorRamp"][n2]["value"]["toString"](), p2 = e2["measureText"](o2)["width"];
      l2 = p2 > f2;
      if (l2) {
        j2 = 270, k2 = 45;
        break;
      }
    }
    c2["width"] = j2, c2["height"] = k2;
    if (b2 === "linear") {
      const q2 = e2["createLinearGradient"](0, 0, 256, 0), r2 = this["_colorRamp"][0]["value"], s2 = ((_a = this["_colorRamp"]["at"](-1)) == null ? void 0 : _a["value"]) ?? 0;
      this["_colorRamp"]["forEach"]((t2) => {
        const { value: u2, color: v2 } = t2;
        q2["addColorStop"]((u2 - r2) / (s2 - r2), v2);
      }), e2["fillStyle"] = q2, e2["fillRect"](0, 0, j2, 8);
    }
    for (let t2 = 0; t2 < this["_colorRamp"]["length"]; t2++) {
      b2 === "block" && (e2["fillStyle"] = this["_colorRamp"][t2]["color"], e2["fillRect"](t2 * f2, 0, f2, 8));
      if (t2 < this["_colorRamp"]["length"]) {
        e2["save"]();
        let u2 = (t2 + 1) * f2, v2 = 18;
        const w2 = this["_colorRamp"][t2]["value"]["toString"]();
        let x2 = 0;
        if (l2) e2["translate"](u2, v2), e2["rotate"](m2), u2 = 0, v2 = 0, x2 = 5;
        else {
          const y2 = e2["measureText"](w2)["width"];
          x2 = y2 / 2;
        }
        this["_colorRamp"]["length"] > 20 ? t2 % 3 == 0 && (e2["fillStyle"] = h2, e2["font"] = g2, e2["fillText"](w2, u2 - x2, v2)) : (e2["fillStyle"] = h2, e2["font"] = g2, e2["fillText"](w2, u2 - x2, v2)), e2["restore"]();
      }
    }
    return c2["toDataURL"]("image/png");
  }
  ["setColorRamp"](b2) {
    this["_colorRamp"] = b2["sort"]((f2, g2) => f2["value"] - g2["value"]);
    const c2 = this["_colorRamp"]["sort"]((f2, g2) => {
      return f2["value"] - g2["value"];
    })[0]["value"], d2 = this["_colorRamp"]["sort"]((f2, g2) => {
      return g2["value"] - f2["value"];
    })[0]["value"], e2 = callWithErrorHandling("THROW", "getImgByColorRamp: 生成基于颜色映射的图像失败", () => this["_getImgByColorRamp"](c2, d2, this["_colorRamp"]));
    this["_colorPatternGradientPrimitive"] && (this["_colorPatternGradientPrimitive"]["appearance"]["material"]["uniforms"]["u_minValue"] = c2, this["_colorPatternGradientPrimitive"]["appearance"]["material"]["uniforms"]["u_maxValue"] = d2, this["_colorPatternGradientPrimitive"]["appearance"]["material"]["uniforms"]["u_colorImage"] = e2);
  }
  ["setUniforms"](b2) {
    Reflect["ownKeys"](b2)["forEach"]((c2) => {
      this["options"]["uniformOptions"][c2] = b2[c2], this["_uniforms"]["u_" + c2] = b2[c2], this["_colorPatternGradientPrimitive"] && (this["_colorPatternGradientPrimitive"]["appearance"]["material"]["uniforms"]["u_" + c2] = this["_uniforms"]["u_" + c2]);
    });
  }
  ["setOpacity"](b2) {
    this["setUniforms"]({ "alpha": b2 });
  }
}
(function(a2) {
  if (a2["TextEncoder"] && a2["TextDecoder"]) return ![];
  function b2(d2 = "utf-8") {
    if (d2 !== "utf-8") throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('" + d2 + "') is invalid.");
  }
  Object["defineProperty"](b2["prototype"], "encoding", { "value": "utf-8" }), b2["prototype"]["encode"] = function(d2, e2 = { "stream": ![] }) {
    if (e2["stream"]) throw new Error("Failed to encode: the 'stream' option is unsupported.");
    let f2 = 0;
    const g2 = d2["length"];
    let i2 = 0, j2 = Math["max"](32, g2 + (g2 >> 1) + 7), k2 = new Uint8Array(j2 >> 3 << 3);
    while (f2 < g2) {
      let l2 = d2["charCodeAt"](f2++);
      if (l2 >= 55296 && l2 <= 56319) {
        if (f2 < g2) {
          const m2 = d2["charCodeAt"](f2);
          (m2 & 64512) === 56320 && (++f2, l2 = ((l2 & 1023) << 10) + (m2 & 1023) + 65536);
        }
        if (l2 >= 55296 && l2 <= 56319) continue;
      }
      if (i2 + 4 > k2["length"]) {
        j2 += 8, j2 *= 1 + f2 / d2["length"] * 2, j2 = j2 >> 3 << 3;
        const n2 = new Uint8Array(j2);
        n2["set"](k2), k2 = n2;
      }
      if ((l2 & 4294967168) === 0) {
        k2[i2++] = l2;
        continue;
      } else {
        if ((l2 & 4294965248) === 0) k2[i2++] = l2 >> 6 & 31 | 192;
        else {
          if ((l2 & 4294901760) === 0) k2[i2++] = l2 >> 12 & 15 | 224, k2[i2++] = l2 >> 6 & 63 | 128;
          else {
            if ((l2 & 4292870144) === 0) k2[i2++] = l2 >> 18 & 7 | 240, k2[i2++] = l2 >> 12 & 63 | 128, k2[i2++] = l2 >> 6 & 63 | 128;
            else continue;
          }
        }
      }
      k2[i2++] = l2 & 63 | 128;
    }
    return k2["slice"](0, i2);
  };
  function c2(d2 = "utf-8", e2 = { "fatal": ![] }) {
    if (d2 !== "utf-8") throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('" + d2 + "') is invalid.");
    if (e2["fatal"]) throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");
  }
  Object["defineProperty"](c2["prototype"], "encoding", { "value": "utf-8" }), Object["defineProperty"](c2["prototype"], "fatal", { "value": ![] }), Object["defineProperty"](c2["prototype"], "ignoreBOM", { "value": ![] }), c2["prototype"]["decode"] = function(d2, e2 = { "stream": ![] }) {
    if (e2["stream"]) throw new Error("Failed to decode: the 'stream' option is unsupported.");
    const f2 = new Uint8Array(d2);
    let g2 = 0;
    const h2 = f2["length"], i2 = [];
    while (g2 < h2) {
      const j2 = f2[g2++];
      if (j2 === 0) break;
      if ((j2 & 128) === 0) i2["push"](j2);
      else {
        if ((j2 & 224) === 192) {
          const k2 = f2[g2++] & 63;
          i2["push"]((j2 & 31) << 6 | k2);
        } else {
          if ((j2 & 240) === 224) {
            const l2 = f2[g2++] & 63, m2 = f2[g2++] & 63;
            i2["push"]((j2 & 31) << 12 | l2 << 6 | m2);
          } else {
            if ((j2 & 248) === 240) {
              const n2 = f2[g2++] & 63, o2 = f2[g2++] & 63, p2 = f2[g2++] & 63;
              let q2 = (j2 & 7) << 18 | n2 << 12 | o2 << 6 | p2;
              q2 > 65535 && (q2 -= 65536, i2["push"](q2 >>> 10 & 1023 | 55296), q2 = 56320 | q2 & 1023), i2["push"](q2);
            }
          }
        }
      }
    }
    return String["fromCharCode"]["apply"](null, i2);
  }, a2["TextEncoder"] = b2, a2["TextDecoder"] = c2;
})(typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : void 0);
function decode$1(a2, b2 = "utf8") {
  const c2 = new TextDecoder(b2);
  return c2["decode"](a2);
}
const encoder = new TextEncoder();
function encode$1(a2) {
  return encoder["encode"](a2);
}
const defaultByteLength = 1024 * 8, hostBigEndian = (() => {
  const a2 = new Uint8Array(4), b2 = new Uint32Array(a2["buffer"]);
  return !((b2[0] = 1) & a2[0]);
})(), typedArrays = { "int8": globalThis["Int8Array"], "uint8": globalThis["Uint8Array"], "int16": globalThis["Int16Array"], "uint16": globalThis["Uint16Array"], "int32": globalThis["Int32Array"], "uint32": globalThis["Uint32Array"], "uint64": globalThis["BigUint64Array"], "int64": globalThis["BigInt64Array"], "float32": globalThis["Float32Array"], "float64": globalThis["Float64Array"] };
class IOBuffer {
  constructor(a2 = defaultByteLength, b2 = {}) {
    let c2 = ![];
    typeof a2 === "number" ? a2 = new ArrayBuffer(a2) : (c2 = !![], this["lastWrittenByte"] = a2["byteLength"]);
    const d2 = b2["offset"] ? b2["offset"] >>> 0 : 0, e2 = a2["byteLength"] - d2;
    let f2 = d2;
    (ArrayBuffer["isView"](a2) || a2 instanceof IOBuffer) && (a2["byteLength"] !== a2["buffer"]["byteLength"] && (f2 = a2["byteOffset"] + d2), a2 = a2["buffer"]), c2 ? this["lastWrittenByte"] = e2 : this["lastWrittenByte"] = 0, this["buffer"] = a2, this["length"] = e2, this["byteLength"] = e2, this["byteOffset"] = f2, this["offset"] = 0, this["littleEndian"] = !![], this["_data"] = new DataView(this["buffer"], f2, e2), this["_mark"] = 0, this["_marks"] = [];
  }
  ["available"](a2 = 1) {
    return this["offset"] + a2 <= this["length"];
  }
  ["isLittleEndian"]() {
    return this["littleEndian"];
  }
  ["setLittleEndian"]() {
    return this["littleEndian"] = !![], this;
  }
  ["isBigEndian"]() {
    return !this["littleEndian"];
  }
  ["setBigEndian"]() {
    return this["littleEndian"] = ![], this;
  }
  ["skip"](a2 = 1) {
    return this["offset"] += a2, this;
  }
  ["back"](a2 = 1) {
    return this["offset"] -= a2, this;
  }
  ["seek"](a2) {
    return this["offset"] = a2, this;
  }
  ["mark"]() {
    return this["_mark"] = this["offset"], this;
  }
  ["reset"]() {
    return this["offset"] = this["_mark"], this;
  }
  ["pushMark"]() {
    return this["_marks"]["push"](this["offset"]), this;
  }
  ["popMark"]() {
    const a2 = this["_marks"]["pop"]();
    if (a2 === void 0) throw new Error("Mark stack empty");
    return this["seek"](a2), this;
  }
  ["rewind"]() {
    return this["offset"] = 0, this;
  }
  ["ensureAvailable"](a2 = 1) {
    if (!this["available"](a2)) {
      const b2 = this["offset"] + a2, c2 = b2 * 2, d2 = new Uint8Array(c2);
      d2["set"](new Uint8Array(this["buffer"])), this["buffer"] = d2["buffer"], this["length"] = this["byteLength"] = c2, this["_data"] = new DataView(this["buffer"]);
    }
    return this;
  }
  ["readBoolean"]() {
    return this["readUint8"]() !== 0;
  }
  ["readInt8"]() {
    return this["_data"]["getInt8"](this["offset"]++);
  }
  ["readUint8"]() {
    return this["_data"]["getUint8"](this["offset"]++);
  }
  ["readByte"]() {
    return this["readUint8"]();
  }
  ["readBytes"](a2 = 1) {
    return this["readArray"](a2, "uint8");
  }
  ["readArray"](a2, b2) {
    const c2 = typedArrays[b2]["BYTES_PER_ELEMENT"] * a2, d2 = this["byteOffset"] + this["offset"], e2 = this["buffer"]["slice"](d2, d2 + c2);
    if (this["littleEndian"] === hostBigEndian && b2 !== "uint8" && b2 !== "int8") {
      const g2 = new Uint8Array(this["buffer"]["slice"](d2, d2 + c2));
      g2["reverse"]();
      const h2 = new typedArrays[b2](g2["buffer"]);
      return this["offset"] += c2, h2["reverse"](), h2;
    }
    const f2 = new typedArrays[b2](e2);
    return this["offset"] += c2, f2;
  }
  ["readInt16"]() {
    const a2 = this["_data"]["getInt16"](this["offset"], this["littleEndian"]);
    return this["offset"] += 2, a2;
  }
  ["readUint16"]() {
    const a2 = this["_data"]["getUint16"](this["offset"], this["littleEndian"]);
    return this["offset"] += 2, a2;
  }
  ["readInt32"]() {
    const a2 = this["_data"]["getInt32"](this["offset"], this["littleEndian"]);
    return this["offset"] += 4, a2;
  }
  ["readUint32"]() {
    const a2 = this["_data"]["getUint32"](this["offset"], this["littleEndian"]);
    return this["offset"] += 4, a2;
  }
  ["readFloat32"]() {
    const a2 = this["_data"]["getFloat32"](this["offset"], this["littleEndian"]);
    return this["offset"] += 4, a2;
  }
  ["readFloat64"]() {
    const a2 = this["_data"]["getFloat64"](this["offset"], this["littleEndian"]);
    return this["offset"] += 8, a2;
  }
  ["readBigInt64"]() {
    const a2 = this["_data"]["getBigInt64"](this["offset"], this["littleEndian"]);
    return this["offset"] += 8, a2;
  }
  ["readBigUint64"]() {
    const a2 = this["_data"]["getBigUint64"](this["offset"], this["littleEndian"]);
    return this["offset"] += 8, a2;
  }
  ["readChar"]() {
    return String["fromCharCode"](this["readInt8"]());
  }
  ["readChars"](a2 = 1) {
    let b2 = "";
    for (let c2 = 0; c2 < a2; c2++) {
      b2 += this["readChar"]();
    }
    return b2;
  }
  ["readUtf8"](a2 = 1) {
    return decode$1(this["readBytes"](a2));
  }
  ["decodeText"](a2 = 1, b2 = "utf-8") {
    return decode$1(this["readBytes"](a2), b2);
  }
  ["writeBoolean"](a2) {
    return this["writeUint8"](a2 ? 255 : 0), this;
  }
  ["writeInt8"](a2) {
    return this["ensureAvailable"](1), this["_data"]["setInt8"](this["offset"]++, a2), this["_updateLastWrittenByte"](), this;
  }
  ["writeUint8"](a2) {
    return this["ensureAvailable"](1), this["_data"]["setUint8"](this["offset"]++, a2), this["_updateLastWrittenByte"](), this;
  }
  ["writeByte"](a2) {
    return this["writeUint8"](a2);
  }
  ["writeBytes"](a2) {
    this["ensureAvailable"](a2["length"]);
    for (let b2 = 0; b2 < a2["length"]; b2++) {
      this["_data"]["setUint8"](this["offset"]++, a2[b2]);
    }
    return this["_updateLastWrittenByte"](), this;
  }
  ["writeInt16"](a2) {
    return this["ensureAvailable"](2), this["_data"]["setInt16"](this["offset"], a2, this["littleEndian"]), this["offset"] += 2, this["_updateLastWrittenByte"](), this;
  }
  ["writeUint16"](a2) {
    return this["ensureAvailable"](2), this["_data"]["setUint16"](this["offset"], a2, this["littleEndian"]), this["offset"] += 2, this["_updateLastWrittenByte"](), this;
  }
  ["writeInt32"](a2) {
    return this["ensureAvailable"](4), this["_data"]["setInt32"](this["offset"], a2, this["littleEndian"]), this["offset"] += 4, this["_updateLastWrittenByte"](), this;
  }
  ["writeUint32"](a2) {
    return this["ensureAvailable"](4), this["_data"]["setUint32"](this["offset"], a2, this["littleEndian"]), this["offset"] += 4, this["_updateLastWrittenByte"](), this;
  }
  ["writeFloat32"](a2) {
    return this["ensureAvailable"](4), this["_data"]["setFloat32"](this["offset"], a2, this["littleEndian"]), this["offset"] += 4, this["_updateLastWrittenByte"](), this;
  }
  ["writeFloat64"](a2) {
    return this["ensureAvailable"](8), this["_data"]["setFloat64"](this["offset"], a2, this["littleEndian"]), this["offset"] += 8, this["_updateLastWrittenByte"](), this;
  }
  ["writeBigInt64"](a2) {
    return this["ensureAvailable"](8), this["_data"]["setBigInt64"](this["offset"], a2, this["littleEndian"]), this["offset"] += 8, this["_updateLastWrittenByte"](), this;
  }
  ["writeBigUint64"](a2) {
    return this["ensureAvailable"](8), this["_data"]["setBigUint64"](this["offset"], a2, this["littleEndian"]), this["offset"] += 8, this["_updateLastWrittenByte"](), this;
  }
  ["writeChar"](a2) {
    return this["writeUint8"](a2["charCodeAt"](0));
  }
  ["writeChars"](a2) {
    for (let b2 = 0; b2 < a2["length"]; b2++) {
      this["writeUint8"](a2["charCodeAt"](b2));
    }
    return this;
  }
  ["writeUtf8"](a2) {
    return this["writeBytes"](encode$1(a2));
  }
  ["toArray"]() {
    return new Uint8Array(this["buffer"], this["byteOffset"], this["lastWrittenByte"]);
  }
  ["_updateLastWrittenByte"]() {
    this["offset"] > this["lastWrittenByte"] && (this["lastWrittenByte"] = this["offset"]);
  }
}
const types$1 = { "BYTE": 1, "CHAR": 2, "SHORT": 3, "INT": 4, "FLOAT": 5, "DOUBLE": 6 };
function num2str(a2) {
  switch (Number(a2)) {
    case types$1["BYTE"]:
      return "byte";
    case types$1["CHAR"]:
      return "char";
    case types$1["SHORT"]:
      return "short";
    case types$1["INT"]:
      return "int";
    case types$1["FLOAT"]:
      return "float";
    case types$1["DOUBLE"]:
      return "double";
    default:
      return "undefined";
  }
}
function num2bytes(a2) {
  switch (Number(a2)) {
    case types$1["BYTE"]:
      return 1;
    case types$1["CHAR"]:
      return 1;
    case types$1["SHORT"]:
      return 2;
    case types$1["INT"]:
      return 4;
    case types$1["FLOAT"]:
      return 4;
    case types$1["DOUBLE"]:
      return 8;
    default:
      return -1;
  }
}
function str2num(a2) {
  switch (String(a2)) {
    case "byte":
      return types$1["BYTE"];
    case "char":
      return types$1["CHAR"];
    case "short":
      return types$1["SHORT"];
    case "int":
      return types$1["INT"];
    case "float":
      return types$1["FLOAT"];
    case "double":
      return types$1["DOUBLE"];
    default:
      return -1;
  }
}
function readNumber(a2, b2) {
  if (a2 !== 1) {
    const c2 = new Array(a2);
    for (let d2 = 0; d2 < a2; d2++) {
      c2[d2] = b2();
    }
    return c2;
  } else return b2();
}
function readType(a2, b2, c2) {
  switch (b2) {
    case types$1["BYTE"]:
      return Array["from"](a2["readBytes"](c2));
    case types$1["CHAR"]:
      return trimNull(a2["readChars"](c2));
    case types$1["SHORT"]:
      return readNumber(c2, a2["readInt16"]["bind"](a2));
    case types$1["INT"]:
      return readNumber(c2, a2["readInt32"]["bind"](a2));
    case types$1["FLOAT"]:
      return readNumber(c2, a2["readFloat32"]["bind"](a2));
    case types$1["DOUBLE"]:
      return readNumber(c2, a2["readFloat64"]["bind"](a2));
    default:
      throw new Error("non valid type " + b2);
  }
}
function trimNull(a2) {
  if (a2["charCodeAt"](a2["length"] - 1) === 0) return a2["substring"](0, a2["length"] - 1);
  return a2;
}
function nonRecord(a2, b2) {
  const c2 = str2num(b2["type"]), d2 = b2["size"] / num2bytes(c2), e2 = new Array(d2);
  for (let f2 = 0; f2 < d2; f2++) {
    e2[f2] = readType(a2, c2, 1);
  }
  return e2;
}
function record(a2, b2, c2) {
  const d2 = str2num(b2["type"]), e2 = b2["size"] ? b2["size"] / num2bytes(d2) : 1, f2 = c2["length"], g2 = new Array(f2), h2 = c2["recordStep"];
  if (h2) for (let j2 = 0; j2 < f2; j2++) {
    const k2 = a2["offset"];
    g2[j2] = readType(a2, d2, e2), a2["seek"](k2 + h2);
  }
  else throw new Error("recordDimension.recordStep is undefined");
  return g2;
}
function notNetcdf(a2, b2) {
  if (a2) throw new TypeError("Not a valid NetCDF v3.x file: " + b2);
}
function padding(a2) {
  a2["offset"] % 4 !== 0 && a2["skip"](4 - a2["offset"] % 4);
}
function readName(a2) {
  const b2 = a2["readUint32"](), c2 = a2["readChars"](b2);
  return padding(a2), c2;
}
const ZERO = 0, NC_DIMENSION = 10, NC_VARIABLE = 11, NC_ATTRIBUTE = 12, NC_UNLIMITED = 0;
function header(a2, b2) {
  const c2 = { "version": b2 }, d2 = { "length": a2["readUint32"]() }, e2 = dimensionsList(a2);
  !Array["isArray"](e2) && (d2["id"] = e2["recordId"], d2["name"] = e2["recordName"], c2["dimensions"] = e2["dimensions"]);
  c2["globalAttributes"] = attributesList(a2);
  const f2 = variablesList(a2, d2 == null ? void 0 : d2["id"], b2);
  return !Array["isArray"](f2) && (c2["variables"] = f2["variables"], d2["recordStep"] = f2["recordStep"]), c2["recordDimension"] = d2, c2;
}
function dimensionsList(a2) {
  const b2 = {};
  let c2, d2;
  const e2 = a2["readUint32"]();
  let f2;
  if (e2 === ZERO) return notNetcdf(a2["readUint32"]() !== ZERO, "wrong empty tag for list of dimensions"), [];
  else {
    notNetcdf(e2 !== NC_DIMENSION, "wrong tag for list of dimensions");
    const g2 = a2["readUint32"]();
    f2 = new Array(g2);
    for (let h2 = 0; h2 < g2; h2++) {
      const i2 = readName(a2), j2 = a2["readUint32"]();
      j2 === NC_UNLIMITED && (c2 = h2, d2 = i2), f2[h2] = { "name": i2, "size": j2 };
    }
  }
  return c2 !== void 0 && (b2["recordId"] = c2), d2 !== void 0 && (b2["recordName"] = d2), b2["dimensions"] = f2, b2;
}
function attributesList(a2) {
  const b2 = a2["readUint32"]();
  let c2;
  if (b2 === ZERO) return notNetcdf(a2["readUint32"]() !== ZERO, "wrong empty tag for list of attributes"), [];
  else {
    notNetcdf(b2 !== NC_ATTRIBUTE, "wrong tag for list of attributes");
    const d2 = a2["readUint32"]();
    c2 = new Array(d2);
    for (let e2 = 0; e2 < d2; e2++) {
      const f2 = readName(a2), g2 = a2["readUint32"]();
      notNetcdf(g2 < 1 || g2 > 6, "non valid type " + g2);
      const h2 = a2["readUint32"](), i2 = readType(a2, g2, h2);
      padding(a2), c2[e2] = { "name": f2, "type": num2str(g2), "value": i2 };
    }
  }
  return c2;
}
function variablesList(a2, b2, c2) {
  const d2 = a2["readUint32"]();
  let e2 = 0, f2;
  if (d2 === ZERO) return notNetcdf(a2["readUint32"]() !== ZERO, "wrong empty tag for list of variables"), [];
  else {
    notNetcdf(d2 !== NC_VARIABLE, "wrong tag for list of variables");
    const g2 = a2["readUint32"]();
    f2 = new Array(g2);
    for (let h2 = 0; h2 < g2; h2++) {
      const i2 = readName(a2), j2 = a2["readUint32"](), k2 = new Array(j2);
      for (let q2 = 0; q2 < j2; q2++) {
        k2[q2] = a2["readUint32"]();
      }
      const l2 = attributesList(a2), m2 = a2["readUint32"]();
      notNetcdf(m2 < 1 && m2 > 6, "non valid type " + m2);
      const n2 = a2["readUint32"]();
      let o2 = a2["readUint32"]();
      c2 === 2 && (notNetcdf(o2 > 0, "offsets larger than 4GB not supported"), o2 = a2["readUint32"]());
      let p2 = ![];
      typeof b2 !== "undefined" && k2[0] === b2 && (e2 += n2, p2 = !![]), f2[h2] = { "name": i2, "dimensions": k2, "attributes": l2, "type": num2str(m2), "size": n2, "offset": o2, "record": p2 };
    }
  }
  return { "variables": f2, "recordStep": e2 };
}
function toString() {
  const a2 = [];
  a2["push"]("DIMENSIONS");
  for (const c2 of this["dimensions"]) {
    a2["push"]("  " + c2["name"]["padEnd"](30) + " = size: " + c2["size"]);
  }
  a2["push"](""), a2["push"]("GLOBAL ATTRIBUTES");
  for (const d2 of this["globalAttributes"]) {
    a2["push"]("  " + d2["name"]["padEnd"](30) + " = " + d2["value"]);
  }
  const b2 = JSON["parse"](JSON["stringify"](this["variables"]));
  a2["push"](""), a2["push"]("VARIABLES:");
  for (const e2 of b2) {
    e2["value"] = this["getDataVariable"](e2);
    let f2 = JSON["stringify"](e2["value"]);
    if (f2["length"] > 50) f2 = f2["substring"](0, 50);
    !isNaN(e2["value"]["length"]) && (f2 += " (length: " + e2["value"]["length"] + ")"), a2["push"]("  " + e2["name"]["padEnd"](30) + " = " + f2);
  }
  return a2["join"]("\n");
}
class NetCDFReader {
  constructor(a2) {
    this["toString"] = toString;
    const b2 = new IOBuffer(a2);
    b2["setBigEndian"](), notNetcdf(b2["readChars"](3) !== "CDF", "should start with CDF");
    const c2 = b2["readByte"]();
    notNetcdf(c2 > 2, "unknown version"), this["header"] = header(b2, c2), this["buffer"] = b2;
  }
  get ["version"]() {
    return this["header"]["version"] === 1 ? "classic format" : "64-bit offset format";
  }
  get ["recordDimension"]() {
    return this["header"]["recordDimension"];
  }
  get ["dimensions"]() {
    return this["header"]["dimensions"];
  }
  get ["globalAttributes"]() {
    return this["header"]["globalAttributes"];
  }
  ["getAttribute"](a2) {
    const b2 = this["globalAttributes"]["find"]((c2) => c2["name"] === a2);
    if (b2) return b2["value"];
    return null;
  }
  ["getDataVariableAsString"](a2) {
    const b2 = this["getDataVariable"](a2);
    if (b2) return b2["join"]("");
    return null;
  }
  get ["variables"]() {
    return this["header"]["variables"];
  }
  ["getDataVariable"](a2) {
    let b2;
    typeof a2 === "string" ? b2 = this["header"]["variables"]["find"]((c2) => {
      return c2["name"] === a2;
    }) : b2 = a2;
    if (b2 === void 0) throw new Error("Not a valid NetCDF v3.x file: variable not found");
    return this["buffer"]["seek"](b2["offset"]), b2["record"] ? record(this["buffer"], b2, this["header"]["recordDimension"]) : nonRecord(this["buffer"], b2);
  }
  ["dataVariableExists"](a2) {
    const b2 = this["header"]["variables"]["find"]((c2) => {
      return c2["name"] === a2;
    });
    return b2 !== void 0;
  }
  ["attributeExists"](a2) {
    const b2 = this["globalAttributes"]["find"]((c2) => c2["name"] === a2);
    return b2 !== void 0;
  }
}
var ColorPatternGridFS_default = "uniform vec2 u_line_width;\r\nuniform vec2 u_line_offset;\n\nuniform sampler2D u_texture_map;\r\nuniform float u_max_val;\r\nuniform float u_min_val;\r\nuniform float u_alpha;\r\nuniform vec3 u_size;\n\nin vec3 v_normal;\r\nin vec2 v_st;\r\nin float v_val;\n\nin vec3 v_positionEC;\r\nout vec4 FragColor;\n\nvoid main () {\n\n  vec2 st = v_st;\r\n  vec3 positionToEyeEC = -v_positionEC;\n\n  float scaledWidth = fract(u_size.s * st.s);  \n  scaledWidth = abs(scaledWidth - floor(scaledWidth) - u_line_offset.s);\r\n  float scaledHeight = fract(u_size.t * st.t);\r\n  scaledHeight = abs(scaledHeight - floor(scaledHeight) - u_line_offset.t);\r\n  \n  const float fuzz = 0.001;\n\n  float value;\r\n  #ifdef GL_OES_standard_derivatives\r\n    \n    vec2 thickness = (u_line_width * czm_pixelRatio) - 1.0;\r\n    \n    vec2 dx = abs(dFdx(st));\r\n    vec2 dy = abs(dFdy(st));\r\n    vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * vec2(u_size.s, u_size.t);\r\n    value = min(\r\n      smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\r\n      smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)\r\n    );\n\n    \n    \n   \n  #else\n\n    vec2 range = 1.0 - (u_line_width * czm_pixelRatio * 0.05);\r\n    value = min(\r\n      1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\r\n      1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)\r\n    );\r\n  #endif\n\n  \n  \n  float dRim = 1.0 - abs(dot(v_normal, normalize(positionToEyeEC)));\r\n  float sRim = smoothstep(1.0, 1.0, dRim);\r\n  value *= (1.0 - sRim);\n\n  float valInRange = (v_val-u_min_val)/(u_max_val-u_min_val);\r\n  vec4 color = texture(u_texture_map, vec2(valInRange, 0.5));\n\n  \n  color.a = color.a * (1.0 * value * clamp(u_alpha, 0.0, 1.0));\n\n  vec4 newColor = czm_gammaCorrect(color);\n\n  FragColor = newColor;\n\n}";
var ColorPatternGridVS_default = "in float val;\r\nin vec3 position;\r\nin vec2 st;\r\nin vec3 normal;\n\nout vec3 v_position;\r\nout vec2 v_st;\r\nout float v_val;\r\nout vec3 v_normal;\r\nout vec3 v_positionEC;\n\nvoid main () {\n\n  v_position = position;\r\n  v_st = st;\r\n  v_val = val;\r\n  v_normal = normal;\n\n  v_positionEC = (czm_modelView * vec4(position,1.0)).xyz;\n\n  gl_Position= czm_modelViewProjection * vec4(position,1.0);\n\n}";
const encodedJs = "IWZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYub25tZXNzYWdlPXM9Pntjb25zdHtkYXRhOmV9PXMsdD1lLnNpemVbMF0sbz1lLnNpemVbMV0sbj1lLmF0dHJpYnV0ZXMucG9zaXRpb24udmFsdWVzLGk9ZS5hdHRyaWJ1dGVzLm5vcm1hbC52YWx1ZXMscj1lLmF0dHJpYnV0ZXMuc3QudmFsdWVzLGw9ZS5zb3VyY2Uuc2xpY2UoMCxlLnNpemVbMF0qZS5zaXplWzFdKSxhPWUuaW5kaWNlcyx1PVtdLGM9W10sZj1bXSxoPVtdLHA9W107Zm9yKGxldCB3PTA7dzxvO3crKylmb3IobGV0IHM9MDtzPHQ7cysrKXtjb25zdCBlPXMrdyp0LG89YS5zbGljZSg2KmUsNiplKzYpLGc9bFtlXSxtPVtnLGcsZyxnXSx6PUFycmF5LmZyb20obmV3IFNldChvKSk7aC5wdXNoKC4uLm0pLHouZm9yRWFjaCgocz0+e2NvbnN0IGU9W25bMypzXSxuWzMqcysxXSxuWzMqcysyXV0sdD1baVszKnNdLGlbMypzKzFdLGlbMypzKzJdXSxvPVtyWzIqc10sclsyKnMrMV1dO3UucHVzaCguLi5lKSxjLnB1c2goLi4udCksZi5wdXNoKC4uLm8pfSkpO2NvbnN0IGI9dS5sZW5ndGgvMztwLnB1c2goYi00LGItMixiLTMsYi0zLGItMixiLTEpfXNlbGYucG9zdE1lc3NhZ2Uoe25ld1Bvc2l0aW9uczp1LG5ld05vcm1hbHM6YyxuZXdTdHM6ZixuZXdDb2xvcnM6aCxuZXdJbmRpY2VzOnB9KX0sc2VsZi5vbmVycm9yPXM9PmNvbnNvbGUubG9nKHMpfSgpOwo=";
const decodeBase64 = (base64) => Uint8Array.from(atob(base64), (c2) => c2.charCodeAt(0));
const blob = typeof self !== "undefined" && self.Blob && new Blob([decodeBase64(encodedJs)], { type: "text/javascript;charset=utf-8" });
function WorkerWrapper(options) {
  let objURL;
  try {
    objURL = blob && (self.URL || self.webkitURL).createObjectURL(blob);
    if (!objURL) throw "";
    const worker = new Worker(objURL, {
      name: options == null ? void 0 : options.name
    });
    worker.addEventListener("error", () => {
      (self.URL || self.webkitURL).revokeObjectURL(objURL);
    });
    return worker;
  } catch (e2) {
    return new Worker(
      "data:text/javascript;base64," + encodedJs,
      {
        name: options == null ? void 0 : options.name
      }
    );
  } finally {
    objURL && (self.URL || self.webkitURL).revokeObjectURL(objURL);
  }
}
const DEFAULT_COLOR_RAMP = [{ "color": "#00FF00", "value": 0.5 }, { "color": "#FFFF00", "value": 2 }, { "color": "#FF0000", "value": 6 }];
const _ColorPatternGridPrimitive = class _ColorPatternGridPrimitive extends BaseClass {
  constructor(d2) {
    var _a;
    super(d2);
    __publicField(this, "_maxVal");
    __publicField(this, "_minVal");
    __publicField(this, "_alpha", 1);
    __publicField(this, "_interval", 0.5);
    __publicField(this, "_heightScale", 1);
    __publicField(this, "_extent", [90, 0, 150, 50]);
    __publicField(this, "_size", [0, 0, 0]);
    __publicField(this, "_height", 1e3);
    __publicField(this, "_extrudedHeight", 0);
    __publicField(this, "_source");
    __publicField(this, "_texture");
    __publicField(this, "_drawCommand");
    __publicField(this, "_geometry");
    __publicField(this, "_image");
    __publicField(this, "_isDestroyed", ![]);
    __publicField(this, "_worker", new WorkerWrapper({ "name": "CreateGeometryWorker" }));
    __publicField(this, "_colorRamp");
    __publicField(this, "_show");
    this["_extent"] = a$d["defaultValue"](d2["extent"], this["_extent"]), this["_height"] = a$d["defaultValue"](d2["height"], this["_height"]), this["_heightScale"] = a$d["defaultValue"](d2["heightScale"], this["_heightScale"]), this["_extrudedHeight"] = a$d["defaultValue"](d2["extrudedHeight"], this["_extrudedHeight"]), this["_size"] = a$d["defaultValue"](d2["size"], this["_size"]), this["_source"] = a$d["defaultValue"](d2["source"], this["_source"]), this["_interval"] = a$d["defaultValue"](d2["interval"], this["_interval"]), this["_maxVal"] = Math["max"](...this["_source"]), this["_minVal"] = Math["min"](...this["_source"]), this["_alpha"] = a$d["defaultValue"](d2["alpha"], this["_alpha"]), this["_colorRamp"] = a$d["defaultValue"]((_a = d2["colorRamp"]) == null ? void 0 : _a["sort"]((f2, g2) => f2["value"] - g2["value"]), _ColorPatternGridPrimitive["DEFAULT_COLOR_RAMP"]), this["_show"] = a$d["defaultValue"](d2["show"], !![]);
    const e2 = this["_interval"] / 2;
    this["_extent"] = [this["_extent"][0] - e2, this["_extent"][1] - e2, this["_extent"][2] + e2, this["_extent"][3] + e2], this["_createGeometry"](), this["_image"] = this["_createColorRamp"]();
  }
  static ["getColorRamp"](d2, e2) {
    const f2 = e2;
    d2[d2["length"] - 1]["value"] = f2;
    const g2 = 100, h2 = 1, i2 = document["createElement"]("canvas");
    i2["width"] = g2, i2["height"] = h2;
    const j2 = i2["getContext"]("2d");
    let k2 = 0;
    return d2["forEach"]((m2) => {
      j2 && (j2["fillStyle"] = m2["color"]);
      const n2 = m2["value"], o2 = n2 / e2 * g2;
      j2 && j2["fillRect"](k2, 0, o2, h2), k2 += o2;
    }), i2;
  }
  get ["show"]() {
    return this["_show"];
  }
  set ["show"](d2) {
    this["setShow"](d2);
  }
  get ["alpha"]() {
    return this["_alpha"];
  }
  set ["alpha"](d2) {
    this["setAlpha"](d2);
  }
  get ["colorRamp"]() {
    return this["_colorRamp"];
  }
  set ["colorRamp"](d2) {
    this["setColorRamp"](d2);
  }
  get ["isDestroyed"]() {
    return this["_isDestroyed"];
  }
  ["_createColorRamp"]() {
    const d2 = _ColorPatternGridPrimitive["getColorRamp"](this["_colorRamp"], this["_maxVal"] - this["_minVal"]), e2 = new Image();
    return e2["src"] = d2["toDataURL"](), e2;
  }
  ["_createGeometry"]() {
    const { _extent: d2, _height: e2, _heightScale: f2, _extrudedHeight: g2 } = this, h2 = new a$d["RectangleGeometry"]({ "ellipsoid": a$d["Ellipsoid"]["WGS84"], "rectangle": a$d["Rectangle"]["fromDegrees"](...d2), "height": e2 * f2, "extrudedHeight": g2 * f2, "vertexFormat": new a$d["VertexFormat"]({ "position": !![], "st": !![], "normal": !![] }), "granularity": this["_interval"] / 180 * Math["PI"] }), i2 = a$d["RectangleGeometry"]["createGeometry"](h2);
    this["_worker"]["postMessage"]({ "source": this["_source"], "size": this["_size"], "attributes": i2 == null ? void 0 : i2["attributes"], "indices": i2 == null ? void 0 : i2["indices"] }), this["_worker"]["onmessage"] = (j2) => {
      const { newPositions: k2, newNormals: l2, newSts: m2, newColors: n2, newIndices: o2 } = j2["data"], p2 = Object["assign"]({}, i2 == null ? void 0 : i2["attributes"], { "color": new a$d["GeometryAttribute"]({ "componentDatatype": a$d["ComponentDatatype"]["FLOAT"], "componentsPerAttribute": 1, "values": new Float32Array(n2) }), "position": new a$d["GeometryAttribute"]({ "componentDatatype": a$d["ComponentDatatype"]["FLOAT"], "componentsPerAttribute": 3, "values": new Float32Array(k2) }), "normal": new a$d["GeometryAttribute"]({ "componentDatatype": a$d["ComponentDatatype"]["FLOAT"], "componentsPerAttribute": 3, "values": new Float32Array(l2) }), "st": new a$d["GeometryAttribute"]({ "componentDatatype": a$d["ComponentDatatype"]["FLOAT"], "componentsPerAttribute": 2, "values": new Float32Array(m2) }) });
      i2 && (i2["attributes"] = p2, i2["indices"] = o2), this["_geometry"] = i2, this["_worker"]["terminate"]();
    };
  }
  ["_createTexture"](d2) {
    return !this["_texture"] && (this["_texture"] = new a$d["Texture"]({ "context": d2, "pixelFormat": a$d["PixelFormat"]["RGBA"], "pixelDatatype": a$d["PixelDatatype"]["FLOAT"], "source": this["_image"] })), this["_texture"];
  }
  ["_createCommand"](d2) {
    if (!a$d["defined"](this["_geometry"])) return;
    const e2 = a$d["GeometryPipeline"]["createAttributeLocations"](this["_geometry"]), f2 = a$d["VertexArray"]["fromGeometry"]({ "context": d2, "geometry": this["_geometry"], "attributes": e2 }), g2 = a$d["RenderState"]["fromCache"]({ "depthTest": { "enabled": !![] }, "depthMask": { "enabled": !![] }, "blending": a$d["BlendingState"]["ALPHA_BLEND"] }), h2 = a$d["ShaderProgram"]["fromCache"]({ "context": d2, "vertexShaderSource": ColorPatternGridVS_default, "fragmentShaderSource": ColorPatternGridFS_default, "attributeLocations": e2 }), i2 = this, j2 = { "u_texture_map"() {
      return i2["_createTexture"](d2);
    }, "u_size"() {
      return new a$d["Cartesian3"](...i2["_size"]);
    }, "u_line_width"() {
      return new a$d["Cartesian2"](3, 3);
    }, "u_line_offset"() {
      return new a$d["Cartesian2"](0, 0);
    }, "u_min_val"() {
      return i2["_minVal"];
    }, "u_max_val"() {
      return i2["_maxVal"];
    }, "u_time"() {
      return performance["now"]() / 1e3;
    }, "u_alpha"() {
      return i2["_alpha"];
    }, "u_is_grid"() {
      return !![];
    } };
    this["_drawCommand"] = new a$d["DrawCommand"]({ "pass": a$d["Pass"]["OPAQUE"], "shaderProgram": h2, "renderState": g2, "vertexArray": f2, "uniformMap": j2, "primitiveType": a$d["PrimitiveType"]["TRIANGLES"] });
  }
  ["setShow"](d2) {
    this["_show"] = d2;
  }
  ["setAlpha"](d2) {
    this["_alpha"] = d2;
  }
  ["setColorRamp"](d2) {
    this["_colorRamp"] = d2["sort"]((e2, f2) => e2["value"] - f2["value"]), this["_image"] = this["_createColorRamp"](), this["_drawCommand"] = void 0, this["_texture"] = void 0;
  }
  ["update"](d2) {
    !this["_drawCommand"] && this["_createCommand"](d2["context"]), this["_show"] && this["_drawCommand"] && d2["commandList"]["push"](this["_drawCommand"]);
  }
  ["destroy"]() {
    this["_drawCommand"] = void 0, this["_worker"]["terminate"](), this["_isDestroyed"] = !![], super["destroy"]();
  }
};
__publicField(_ColorPatternGridPrimitive, "DEFAULT_COLOR_RAMP", DEFAULT_COLOR_RAMP);
let ColorPatternGridPrimitive = _ColorPatternGridPrimitive;
const _ColorPatternGridLayer = class _ColorPatternGridLayer extends BaseGraphicLayer {
  constructor(b2) {
    var _a;
    super(b2);
    __publicField(this, "_type", "colorPatternGrid");
    __publicField(this, "_size");
    __publicField(this, "_levelList");
    __publicField(this, "_showLevel");
    __publicField(this, "_colorRamp");
    __publicField(this, "_rectangle");
    __publicField(this, "_alpha");
    __publicField(this, "options");
    __publicField(this, "ncFileResult");
    this["options"] = b2, this["_colorRamp"] = a$d["defaultValue"]((_a = this["options"]["colorRamp"]) == null ? void 0 : _a["sort"]((c2, d2) => c2["value"] - d2["value"]), _ColorPatternGridLayer["DEFAULT_COLOR_RAMP"]), this["options"]["interval"] = a$d["defaultValue"](this["options"]["interval"], 0.5), this["options"]["heightScale"] = a$d["defaultValue"](this["options"]["heightScale"], 1), this["_alpha"] = a$d["defaultValue"](this["options"]["alpha"], 1);
  }
  get ["size"]() {
    return this["_size"];
  }
  get ["levelList"]() {
    return this["_levelList"];
  }
  get ["showLevel"]() {
    return this["_showLevel"];
  }
  set ["showLevel"](b2) {
    this["setShowLevel"](b2);
  }
  get ["colorRamp"]() {
    return this["_colorRamp"];
  }
  set ["colorRamp"](b2) {
    this["setColorRamp"](b2);
  }
  get ["alpha"]() {
    return this["_alpha"];
  }
  set ["alpha"](b2) {
    this["setAlpha"](b2);
  }
  get ["opacity"]() {
    return this["_alpha"];
  }
  set ["opacity"](b2) {
    this["setOpacity"](b2);
  }
  get ["rectangle"]() {
    return this["_rectangle"];
  }
  async ["_initHooks"]() {
    super["_initHooks"]();
  }
  async ["_addHooks"]() {
    var _a;
    super["_addHooks"]();
    const b2 = await this["_loadNcFile"](this["options"]["url"]);
    if (!b2) return;
    this["ncFileResult"] = b2;
    const { levArray: c2, valArray: d2, minx: e2, maxx: f2, miny: g2, maxy: h2, nx: j2, ny: k2, nz: l2 } = b2, m2 = [e2, g2, f2, h2];
    this["_rectangle"] = a$d["Rectangle"]["fromDegrees"](m2[0], m2[1], m2[2], m2[3]), this["_size"] = [j2, k2, l2], this["_levelList"] = Array["from"]({ "length": l2 })["map"]((n2, o2) => {
      return o2;
    });
    for (let n2 = 0; n2 < l2; n2++) {
      const o2 = j2 * k2, p2 = d2["slice"](o2 * n2, o2 * (n2 + 1)), q2 = this["_dealValues"](p2, j2, k2);
      this["ncFileResult"] && (this["ncFileResult"]["maxVal"] = Math["max"](...q2), this["ncFileResult"]["minVal"] = Math["min"](...q2));
      const r2 = new ColorPatternGridPrimitive({ "extent": m2, "source": q2, "size": [j2, k2, l2], "height": c2[n2], "show": this["options"]["show"], "colorRamp": this["options"]["colorRamp"], "heightScale": this["options"]["heightScale"], "interval": this["options"]["interval"], "alpha": this["_alpha"] });
      r2["_kbe3d_layerId"] = this["uuid"], (_a = this["primitiveCollection"]) == null ? void 0 : _a["add"](r2);
    }
    this["setShowLevel"](this["options"]["showLevel"]);
  }
  ["_removeHooks"]() {
    super["_removeHooks"]();
  }
  ["_destroyHooks"]() {
    super["_destroyHooks"]();
  }
  ["_showHooks"](b2) {
    super["_showHooks"](b2);
  }
  ["_toJsonHooks"](b2) {
    super["_toJsonHooks"](b2);
  }
  ["_arrayToMap"](b2) {
    return b2["reduce"]((c2, d2) => {
      return c2[d2["name"]] = d2, c2;
    }, {});
  }
  ["_dealValues"](b2, c2, d2) {
    const e2 = [];
    for (let f2 = d2 - 1; f2 >= 0; f2--) {
      const g2 = b2["slice"](f2 * c2, (f2 + 1) * c2);
      e2["push"](...g2);
    }
    return new Float32Array(e2);
  }
  async ["_loadNcFile"](b2) {
    var _a;
    return await ((_a = a$d["Resource"]["fetchArrayBuffer"]({ "url": b2 })) == null ? void 0 : _a["then"]((c2) => {
      return callWithErrorHandling("THROW", '_loadNcFile("' + b2 + '")加载nc数据失败，请按照规范输入nc数据文件地址', () => {
        const d2 = new NetCDFReader(c2), e2 = this["_arrayToMap"](d2["dimensions"]), f2 = new Float32Array(d2["getDataVariable"]("lon")["flat"]()), g2 = new Float32Array(d2["getDataVariable"]("lat")["flat"]()), h2 = new Float32Array(d2["getDataVariable"]("level")["flat"]()), i2 = new Float32Array(d2["getDataVariable"]("value")["flat"]()), j2 = Math["min"](...f2), k2 = Math["max"](...f2), l2 = Math["min"](...g2), m2 = Math["max"](...g2), n2 = e2["lon"]["size"], o2 = e2["lat"]["size"], p2 = e2["level"]["size"];
        return { "lonArray": f2, "latArray": g2, "levArray": h2, "valArray": i2, "minx": j2, "maxx": k2, "miny": l2, "maxy": m2, "nx": n2, "ny": o2, "nz": p2 };
      });
    }));
  }
  ["getRectangle"](b2) {
    const c2 = this["_rectangle"] ?? a$d["Rectangle"]["MAX_VALUE"];
    return b2 === !![] ? formatRectangle(c2) : c2;
  }
  ["setShowLevel"](b2) {
    var _a;
    this["_showLevel"] = b2;
    if (this["primitiveCollection"]) {
      if (!b2) for (let c2 = 0; c2 < this["primitiveCollection"]["length"]; c2++) {
        const d2 = this["primitiveCollection"]["get"](c2);
        d2 && (d2["show"] = !![]);
      }
      else {
        for (let e2 = 0; e2 < this["primitiveCollection"]["length"]; e2++) {
          const f2 = this["primitiveCollection"]["get"](e2);
          f2 && (f2["show"] = ![]);
        }
        (_a = this["_showLevel"]) == null ? void 0 : _a["forEach"]((g2) => {
          var _a2;
          const h2 = (_a2 = this["primitiveCollection"]) == null ? void 0 : _a2["get"](g2);
          h2 && (h2["show"] = !![]);
        });
      }
    }
  }
  ["setColorRamp"](b2) {
    this["_colorRamp"] = b2["sort"]((c2, d2) => c2["value"] - d2["value"]);
    if (this["primitiveCollection"]) for (let c2 = 0; c2 < this["primitiveCollection"]["length"]; c2++) {
      const d2 = this["primitiveCollection"]["get"](c2);
      d2["setColorRamp"](b2);
    }
  }
  ["setAlpha"](b2) {
    this["_alpha"] = b2;
    if (this["primitiveCollection"]) for (let c2 = 0; c2 < this["primitiveCollection"]["length"]; c2++) {
      const d2 = this["primitiveCollection"]["get"](c2);
      d2["setAlpha"](b2);
    }
  }
  ["setOpacity"](b2) {
    this["alpha"] = b2;
  }
};
__publicField(_ColorPatternGridLayer, "DEFAULT_COLOR_RAMP", DEFAULT_COLOR_RAMP);
let ColorPatternGridLayer = _ColorPatternGridLayer;
class GeojsonLayer extends BaseGraphicLayer {
  constructor(b2) {
    var _a, _b, _c, _d, _e, _f;
    super(b2);
    __publicField(this, "_type", "geojson");
    __publicField(this, "_labelCollection");
    __publicField(this, "_dataSource");
    __publicField(this, "_opacity", 1);
    __publicField(this, "_allGeojsonData");
    __publicField(this, "options");
    this["options"] = b2, (_a = this["options"])["keepOldSource"] ?? (_a["keepOldSource"] = ![]), (_b = this["options"])["opacity"] ?? (_b["opacity"] = 1), (_c = this["options"])["markerSize"] ?? (_c["markerSize"] = 48), (_d = this["options"])["markerSymbol"] ?? (_d["markerSymbol"] = ""), (_e = this["options"])["outlineWidth"] ?? (_e["outlineWidth"] = 1), (_f = this["options"])["clampToGround"] ?? (_f["clampToGround"] = ![]), this["options"]["markerColor"] = getCesiumColor(this["options"]["markerColor"], a$d["Color"]["ROYALBLUE"]), this["options"]["outline"] = getCesiumColor(this["options"]["outline"], a$d["Color"]["GREEN"]), this["options"]["fill"] = getCesiumColor(this["options"]["fill"], a$d["Color"]["YELLOW"]);
    if (this["options"]["label"]) {
      const c2 = this["options"]["label"]["constructorOptions"] ?? {};
      c2["backgroundColor"] = getCesiumColor(c2["backgroundColor"], new a$d["Color"](0.165, 0.165, 0.165, 0.8)), c2["fillColor"] = getCesiumColor(c2["fillColor"], a$d["Color"]["WHITE"]), c2["outlineColor"] = getCesiumColor(c2["outlineColor"], a$d["Color"]["BLACK"]), this["options"]["label"]["constructorOptions"] = { ...{ "show": !![], "font": "30px sans-serif", "style": a$d["LabelStyle"]["FILL"], "scale": 1, "showBackground": ![], "backgroundPadding": new a$d["Cartesian2"](7, 5), "pixelOffset": a$d["Cartesian2"]["ZERO"], "eyeOffset": a$d["Cartesian3"]["ZERO"], "horizontalOrigin": a$d["HorizontalOrigin"]["CENTER"], "verticalOrigin": a$d["VerticalOrigin"]["CENTER"], "heightReference": a$d["HeightReference"]["NONE"], "backgroundColor": new a$d["Color"](0.165, 0.165, 0.165, 0.8), "fillColor": a$d["Color"]["WHITE"], "outlineColor": a$d["Color"]["BLACK"], "outlineWidth": 1, "scaleByDistance": new a$d["NearFarScalar"](1e3, 1, 8e4, 0.5) }, ...c2 };
    }
  }
  get ["layerSource"]() {
    const b2 = [];
    return this["_labelCollection"] && b2["push"](this["_labelCollection"]), this["_dataSource"] && b2["push"](this["_dataSource"]), b2;
  }
  get ["labelCollection"]() {
    return this["_labelCollection"];
  }
  get ["entities"]() {
    var _a;
    return (_a = this["_dataSource"]) == null ? void 0 : _a["entities"];
  }
  get ["entitiesValues"]() {
    var _a;
    return (_a = this["_dataSource"]) == null ? void 0 : _a["entities"]["values"];
  }
  get ["allGeojsonData"]() {
    return this["_allGeojsonData"];
  }
  get ["opacity"]() {
    return this["_opacity"];
  }
  set ["opacity"](b2) {
    this["setOpacity"](b2);
  }
  async ["_initHooks"]() {
    await super["_initHooks"](), !this["_labelCollection"] && (this["_labelCollection"] = new a$d["LabelCollection"](), this["_labelCollection"]["show"] = this["show"]), this["_dataSource"] = new a$d["GeoJsonDataSource"](this["uuid"]), this["_dataSource"]["show"] = this["show"];
  }
  async ["_addHooks"]() {
    var _a;
    await super["_addHooks"](), this["_labelCollection"] && ((_a = this["_earth"]) == null ? void 0 : _a["viewer"]["scene"]["primitives"]["add"](this["_labelCollection"])), await this["load"](), a$d["defined"](this["options"]["zIndex"]) && this["setZIndex"](this["options"]["zIndex"]);
  }
  ["_removeHooks"]() {
    var _a;
    super["_removeHooks"](), this["_labelCollection"] && ((_a = this["_earth"]) == null ? void 0 : _a["viewer"]["scene"]["primitives"]["remove"](this["_labelCollection"]));
  }
  ["_destroyHooks"]() {
    var _a;
    super["_destroyHooks"](), (_a = this["_labelCollection"]) == null ? void 0 : _a["removeAll"]();
  }
  ["_filterEqualsAttr"](b2, c2) {
    const d2 = [];
    return b2["forEach"]((e2) => {
      let f2 = !![];
      if (e2["_attr"]) for (const g2 in c2) {
        if (e2["_attr"][g2] != c2[g2]) {
          f2 = ![];
          break;
        }
      }
      f2 && d2["push"](e2);
    }), d2;
  }
  ["_handlerDataSource"](b2) {
    var _a, _b, _c, _d, _e, _f;
    if (!this["_earth"]) return;
    if (!b2) {
      handlerError("NOT_THROW", "Cesium.GeoJsonDataSource.load: 未加载任何数据");
      return;
    }
    const c2 = b2["entities"]["values"], d2 = [];
    for (let e2 = 0, f2 = c2["length"]; e2 < f2; e2++) {
      const g2 = c2[e2];
      g2["_kbe3d_layerId"] = this["uuid"];
      const h2 = this["_getEntityAttr"](g2);
      g2["_attr"] = h2;
      g2["polygon"] && (g2["polygon"]["outlineWidth"] = 0, g2["polyline"] ?? (g2["polyline"] = new a$d["PolylineGraphics"]()), g2["polyline"]["positions"] = (_a = g2["polygon"]["hierarchy"]) == null ? void 0 : _a["getValue"]()["positions"], g2["polyline"]["width"] = this["options"]["outlineWidth"], g2["polyline"]["material"] = new a$d["PolylineOutlineMaterialProperty"]({ "color": this["options"]["outline"], "outlineWidth": 0 }));
      const j2 = h2[((_b = this["options"]["label"]) == null ? void 0 : _b["textField"]) ?? guid()];
      if (j2) {
        const k2 = this["_addLabel"](g2, j2, (_c = this["options"]["label"]) == null ? void 0 : _c["constructorOptions"], h2);
        if (k2) {
          const l2 = this["_filterEqualsAttr"](d2, h2);
          d2["push"](k2);
          for (const m2 of l2) {
            if (((_d = m2["_attr"]) == null ? void 0 : _d["_kbe3d_positionLength"]) && ((_e = k2["_attr"]) == null ? void 0 : _e["_kbe3d_positionLength"]) && m2["_attr"]["_kbe3d_positionLength"] >= k2["_attr"]["_kbe3d_positionLength"]) {
              d2["pop"](), (_f = this["_labelCollection"]) == null ? void 0 : _f["remove"](k2);
              break;
            }
          }
        }
      }
    }
    this["opacity"] = a$d["defaultValue"](this["options"]["opacity"], 1);
  }
  ["_addLabel"](b2, c2, d2 = {}, e2 = {}) {
    var _a;
    let f2 = a$d["Cartesian3"]["ZERO"];
    const g2 = { ...e2 };
    f2 = getCesiumValue(b2["position"]);
    if (b2["polyline"]) {
      const h2 = getCesiumValue(b2["polyline"]["positions"]);
      g2["_kbe3d_positionLength"] = h2["length"], f2 = h2[Math["floor"](h2["length"] / 2)];
    }
    if (b2["polygon"]) {
      const i2 = getPolygonPositions(b2["polygon"]);
      g2["_kbe3d_positionLength"] = i2["length"], f2 = getCenterFromParserArr(i2);
    }
    if (f2) {
      const j2 = (_a = this["_labelCollection"]) == null ? void 0 : _a["add"]({ ...d2, "position": f2, "text": c2 });
      return j2["_attr"] = g2, j2["_kbe3d_layerId"] = this["uuid"], j2;
    }
  }
  ["_getEntityAttr"](b2) {
    return getAttrVal(b2["properties"] ?? {});
  }
  ["_updatEntityAlpha"](b2, c2) {
    var _a, _b;
    if (!b2) return;
    let d2 = getCesiumValue(b2, a$d["Color"], (_a = this["_earth"]) == null ? void 0 : _a["viewer"]["clock"]["currentTime"]);
    if (!d2 || !d2["withAlpha"]) return b2;
    d2 = d2["withAlpha"](c2), (_b = b2["setValue"]) == null ? void 0 : _b.call(b2, d2);
  }
  ["getRectangle"](b2) {
    if (this["_allGeojsonData"]) {
      const c2 = bbox(this["_allGeojsonData"]), d2 = parseRectangle(c2);
      return d2 && b2 === !![] ? formatRectangle(d2) : d2;
    } else return void 0;
  }
  ["flyTo"](b2) {
    const c2 = super["flyTo"](b2);
    if (!c2 && this["_dataSource"]) {
      if (!this["_earth"]) return ![];
      return this["_earth"]["cancelFlyTo"](), this["_earth"]["viewer"]["flyTo"](this["_dataSource"], b2), !![];
    }
    return ![];
  }
  ["setZIndex"](b2) {
    super["setZIndex"](b2);
    if (!this["_earth"]) return;
    if (this["_labelCollection"] && this["_earth"]["viewer"]["scene"]["primitives"]["contains"](this["_labelCollection"])) {
      this["_labelCollection"]["_kbe3d_zIndex"] = b2, this["_earth"]["viewer"]["scene"]["primitives"]["raiseToTop"](this["_labelCollection"]);
      const c2 = this["_earth"]["viewer"]["scene"]["primitives"];
      for (let d2 = c2["length"] - 1; d2 >= 0; d2--) {
        const e2 = c2["get"](d2);
        if (e2 == this["_labelCollection"]) continue;
        a$d["defined"](e2["_kbe3d_zIndex"]) && b2 < e2["_kbe3d_zIndex"] && this["_earth"]["viewer"]["scene"]["primitives"]["lower"](this["_labelCollection"]);
      }
    }
  }
  async ["load"](b2 = {}) {
    var _a;
    this["options"] = { ...this["options"], ...b2 };
    if (this["options"]["source"]) {
      let c2;
      if (isString(this["options"]["source"]) || this["options"]["source"] instanceof a$d["Resource"]) {
        const d2 = a$d["Resource"]["createIfNeeded"](this["options"]["source"]);
        c2 = await d2["fetchJson"]();
      } else {
        if (isPromise(this["options"]["source"])) c2 = await this["options"]["source"];
        else {
          if (isFunction(this["options"]["source"])) c2 = this["options"]["source"]();
          else isObject(this["options"]["source"]) && (c2 = this["options"]["source"]);
        }
      }
      if (c2 && this["_dataSource"]) {
        this["_allGeojsonData"] = this["_allGeojsonData"] ? mergeGeojson([this["_allGeojsonData"], c2]) : c2, (_a = this["_labelCollection"]) == null ? void 0 : _a["removeAll"]();
        let e2 = "process";
        !this["options"]["keepOldSource"] && (e2 = "load");
        const f2 = await this["_dataSource"][e2](c2, this["options"]);
        this["_handlerDataSource"](f2);
      } else b2 && handlerError("NOT_THROW", "GeoJsonLayer: 传入 source 参数有误，无法加载数据，请检查参数");
    } else b2 && handlerError("NOT_THROW", "GeoJsonLayer: 没有传入 source 参数，无法加载数据");
  }
  ["setOpacity"](b2) {
    this["_opacity"] = b2;
    if (!this["_dataSource"]) return;
    const c2 = this["_dataSource"]["entities"]["values"];
    for (let d2 = 0, e2 = c2["length"]; d2 < e2; d2++) {
      const f2 = c2[d2];
      f2["polygon"] && f2["polygon"]["material"] && f2["polygon"]["material"]["color"] && (this["_updatEntityAlpha"](f2["polygon"]["material"]["color"], this["_opacity"]), f2["polygon"]["outlineColor"] && this["_updatEntityAlpha"](f2["polygon"]["outlineColor"], this["_opacity"])), !f2["polygon"] && f2["polyline"] && f2["polyline"]["material"] && f2["polyline"]["material"]["color"] && this["_updatEntityAlpha"](f2["polyline"]["material"]["color"], this["_opacity"]), f2["point"] && (f2["point"]["color"] = a$d["Color"]["WHITE"]["withAlpha"](this["_opacity"])), f2["billboard"] && (f2["billboard"]["color"] = a$d["Color"]["WHITE"]["withAlpha"](this["_opacity"])), f2["model"] && (f2["model"]["color"] = a$d["Color"]["WHITE"]["withAlpha"](this["_opacity"]));
    }
  }
}
class GraphicLayer extends BaseGraphicLayer {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "_type", "graphic");
    __publicField(this, "_opacity");
    __publicField(this, "options");
    this["options"] = b2, this["_opacity"] = a$d["defaultValue"](b2["opacity"], 1);
  }
  ["getRectangle"](b2) {
    return handlerError("NOT_THROW", "getRectangle：该方法未实现", new Error("Method not implemented.")), void 0;
  }
}
class GCJMercatorTilingScheme extends a$d["WebMercatorTilingScheme"] {
  constructor(b2) {
    super(b2);
    const c2 = b2["mapCRS"] ?? ChinaCRS["WGS84"], d2 = getTransFun(c2, b2["chinaCRS"]), e2 = getTransFun(b2["chinaCRS"], c2);
    if (d2) {
      const f2 = new a$d["WebMercatorProjection"]();
      this["_projection"]["project"] = function(g2, h2) {
        return h2 = d2([a$d["Math"]["toDegrees"](g2["longitude"]), a$d["Math"]["toDegrees"](g2["latitude"])]), h2 = f2["project"](new a$d["Cartographic"](a$d["Math"]["toRadians"](h2[0]), a$d["Math"]["toRadians"](h2[1]))), new a$d["Cartesian2"](h2["x"], h2["y"]);
      }, this["_projection"]["unproject"] = function(g2, h2) {
        const i2 = f2["unproject"](g2);
        return h2 = e2([a$d["Math"]["toDegrees"](i2["longitude"]), a$d["Math"]["toDegrees"](i2["latitude"])]), new a$d["Cartographic"](a$d["Math"]["toRadians"](h2[0]), a$d["Math"]["toRadians"](h2[1]));
      };
    }
  }
}
function createLayer(b2) {
  const c2 = LayerType[b2["type"]];
  if (c2) {
    const d2 = new c2(b2);
    return d2;
  } else return handlerError("NOT_THROW", ["createLayer: 无法获得" + b2["type"] + "类型的图层，请检查type参数是否正确", b2]), void 0;
}
function converTileLayerOptions(b2) {
  const c2 = {};
  for (const d2 in b2) {
    let e2 = b2[d2];
    if (e2 == null) continue;
    switch (d2) {
      case "crs":
        if (b2["chinaCRS"]) break;
        e2 = ("" + e2)["toUpperCase"]();
        if (e2 == CRS["EPSG4326"] || e2 == "4326" || e2 == "EPSG4326") c2["crs"] = CRS["EPSG4326"], c2["tilingScheme"] = new a$d["GeographicTilingScheme"]({ "numberOfLevelZeroTilesX": b2["numberOfLevelZeroTilesX"] || 2, "numberOfLevelZeroTilesY": b2["numberOfLevelZeroTilesY"] || 1 });
        else e2 == CRS["EPSG4490"] || e2 == "4490" || e2 == "EPSG4490" ? (c2["crs"] = CRS["EPSG4490"], c2["tilingScheme"] = new a$d["GeographicTilingScheme"]({ "numberOfLevelZeroTilesX": b2["numberOfLevelZeroTilesX"] || 2, "numberOfLevelZeroTilesY": b2["numberOfLevelZeroTilesY"] || 1 })) : (c2["crs"] = CRS["EPSG3857"], c2["tilingScheme"] = new a$d["WebMercatorTilingScheme"]({ "numberOfLevelZeroTilesX": b2["numberOfLevelZeroTilesX"] || 1, "numberOfLevelZeroTilesY": b2["numberOfLevelZeroTilesY"] || 1 }));
        break;
      case "chinaCRS":
        b2["chinaCRS"] != ChinaCRS["WGS84"] && (c2["tilingScheme"] = new GCJMercatorTilingScheme({ "chinaCRS": b2["chinaCRS"], "numberOfLevelZeroTilesX": b2["numberOfLevelZeroTilesX"] || 1, "numberOfLevelZeroTilesY": b2["numberOfLevelZeroTilesY"] || 1 }));
        break;
      case "rectangle":
        a$d["defined"](e2) && a$d["defined"](e2["xmin"]) && a$d["defined"](e2["xmax"]) && a$d["defined"](e2["ymin"]) && a$d["defined"](e2["ymax"]) ? c2["rectangle"] = a$d["Rectangle"]["fromDegrees"](e2["xmin"], e2["ymin"], e2["xmax"], e2["ymax"]) : c2["rectangle"] = e2;
        break;
      case "bbox":
        c2["rectangle"] = a$d["Rectangle"]["fromDegrees"](e2[0], e2[1], e2[2], e2[3]);
        break;
      default:
        c2[d2] = e2;
        break;
    }
  }
  return c2["crs"] = a$d["defaultValue"](c2["crs"], CRS["EPSG3857"]), c2["crs"] == CRS["EPSG4490"] && c2["url"] && (c2["url"] = c2["url"]["replace"](new RegExp("\\{z\\}", "g"), "{z4490}"), c2["url"] = c2["url"]["replace"](new RegExp("\\{arc_z\\}", "g"), "{arc_z4490}"), c2["url"] = c2["url"]["replace"](new RegExp("\\{arc_Z\\}", "g"), "{arc_Z4490}")), b2["tms"] && (c2["url"] = c2["url"]["replace"](new RegExp("\\{y\\}", "g"), "{reverseY}")), c2;
}
const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  converTileLayerOptions,
  createLayer
}, Symbol.toStringTag, { value: "Module" }));
class GroupLayer extends BaseLayer {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "_type", "group");
    __publicField(this, "_arrLayer", []);
    __publicField(this, "options");
    this["options"] = b2, this["_arrLayer"] = [];
  }
  get ["isTile"]() {
    return ![];
  }
  get ["layerSource"]() {
    return this["_arrLayer"];
  }
  get ["zIndex"]() {
    return this["options"]["zIndex"] ?? -1;
  }
  set ["zIndex"](b2) {
    this["setZIndex"](b2);
  }
  get ["length"]() {
    var _a, _b, _c;
    return a$d["defined"]((_a = this["options"]) == null ? void 0 : _a["layers"]) && ((_c = (_b = this["options"]) == null ? void 0 : _b["layers"]) == null ? void 0 : _c["length"]) > 0 ? this["options"]["layers"]["length"] : this["_arrLayer"]["length"];
  }
  get ["hasChildLayer"]() {
    return this["length"] > 0;
  }
  get ["hasEmptyGroup"]() {
    return this["length"] == 0;
  }
  async ["_initHooks"]() {
    const b2 = this["options"]["layers"];
    if (b2 && b2["length"] > 0) for (let c2 = 0; c2 < b2["length"]; c2++) {
      const d2 = b2[c2], e2 = createLayer({ ...d2, "isInternal": this["options"]["isInternal"], "eventParent": this });
      e2 && this["addLayer"](e2);
    }
  }
  async ["_addHooks"]() {
    this["eachLayer"]((b2) => {
      b2["options"]["eventParent"] = this, this["_earth"] && b2["_onAdd"](this["_earth"]);
    }, this);
  }
  ["_removeHooks"]() {
    this["eachLayer"]((b2) => {
      b2["_onRemove"]();
    }, this);
  }
  ["_destroyHooks"]() {
    this["eachLayer"]((b2) => {
      b2["destroy"]();
    }, this);
  }
  ["_showHooks"](b2) {
    this["eachLayer"]((c2) => {
      c2["show"] = b2;
    }, this);
  }
  ["_toJsonHooks"](b2) {
  }
  ["setZIndex"](b2) {
    this["options"]["zIndex"] = b2, this["eachLayer"]((c2) => {
      var _a;
      (_a = c2["setZIndex"]) == null ? void 0 : _a.call(c2, b2);
    }, this);
  }
  ["getRectangle"](b2) {
    let c2;
    const d2 = this["getChildLayers"]();
    return d2["forEach"]((e2) => {
      if (!e2["getRectangle"]) return;
      const f2 = e2["getRectangle"]();
      if (!a$d["defined"](f2)) return;
      c2 ? c2 = a$d["Rectangle"]["union"](f2, c2) : c2 = f2;
    }, this), b2 ? formatRectangle(c2) : c2;
  }
  ["addLayer"](b2) {
    var _a;
    b2["parent"] = this, b2["options"]["pid"] = this["id"], b2["options"]["eventParent"] = this, this["_arrLayer"]["push"](b2), this["state"] == State["ADDED"] && b2["state"] != State["ADDED"] ? (_a = this["_earth"]) == null ? void 0 : _a["addLayer"](b2) : (this["_earth"] && b2["removeEventParent"](this["_earth"]), b2["addEventParent"](this));
  }
  ["removeLayer"](b2) {
    b2["parent"] = void 0, b2["options"]["eventParent"] = this, b2["removeEventParent"](this);
    for (let c2 = 0; c2 < this["_arrLayer"]["length"]; c2++) {
      if (this["_arrLayer"][c2] == b2) return this["_arrLayer"]["splice"](c2, 1), !![];
    }
    this["_earth"] && b2["state"] == State["ADDED"] && this["_earth"]["removeLayer"](b2);
  }
  ["eachLayer"](b2, c2) {
    if (!this["_arrLayer"]) return;
    this["_arrLayer"]["forEach"]((d2) => {
      b2["call"](c2, d2);
    });
  }
  ["getChildLayers"]() {
    var _a;
    const b2 = this["_arrLayer"] || [];
    return (_a = this["_earth"]) == null ? void 0 : _a["eachLayer"]((c2) => {
      if (c2["pid"] !== this["id"]) return;
      if (this["_arrLayer"]["includes"](c2)) return;
      b2["push"](c2);
    }, this), b2;
  }
  ["getLayer"](b2) {
    const c2 = this["_arrLayer"];
    if (!this["_arrLayer"] || this["_arrLayer"]["length"] == 0) return;
    for (let d2 = 0, e2 = c2["length"]; d2 < e2; d2++) {
      const f2 = c2[d2];
      if (f2["uuid"] == b2 || f2["id"] == b2 || f2["name"] == b2) return f2;
    }
    return void 0;
  }
  ["hasLayer"](b2, c2) {
    for (let d2 = 0; d2 < this["_arrLayer"]["length"]; d2++) {
      const e2 = this["_arrLayer"][d2];
      if (c2 && e2 == c2) continue;
      if (e2["name"] == b2 || e2["id"] == b2) return !![];
    }
    return ![];
  }
}
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x2) {
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
}
var heatmap = { exports: {} };
(function(c2) {
  (function(d2, e2, f2) {
    if (c2["exports"]) c2["exports"] = f2();
    else e2[d2] = f2();
  })("h337", commonjsGlobal, function() {
    var d2 = { "defaultRadius": 40, "defaultRenderer": "canvas2d", "defaultGradient": { 0.25: "rgb(0,0,255)", 0.55: "rgb(0,255,0)", 0.85: "yellow", 1: "rgb(255,0,0)" }, "defaultMaxOpacity": 1, "defaultMinOpacity": 0, "defaultBlur": 0.85, "defaultXField": "x", "defaultYField": "y", "defaultValueField": "value", "plugins": {} }, e2 = function k2() {
      var l2 = function n2(o2) {
        this["_coordinator"] = {}, this["_data"] = [], this["_radi"] = [], this["_min"] = 10, this["_max"] = 1, this["_xField"] = o2["xField"] || o2["defaultXField"], this["_yField"] = o2["yField"] || o2["defaultYField"], this["_valueField"] = o2["valueField"] || o2["defaultValueField"], o2["radius"] && (this["_cfgRadius"] = o2["radius"]);
      }, m2 = d2["defaultRadius"];
      return l2["prototype"] = { "_organiseData": function(o2, p2) {
        var q2 = o2[this["_xField"]], r2 = o2[this["_yField"]], s2 = this["_radi"], t2 = this["_data"], u2 = this["_max"], v2 = this["_min"], w2 = o2[this["_valueField"]] || 1, z2 = o2["radius"] || this["_cfgRadius"] || m2;
        !t2[q2] && (t2[q2] = [], s2[q2] = []);
        !t2[q2][r2] ? (t2[q2][r2] = w2, s2[q2][r2] = z2) : t2[q2][r2] += w2;
        var A5 = t2[q2][r2];
        if (A5 > u2) return !p2 ? this["_max"] = A5 : this["setDataMax"](A5), ![];
        else return A5 < v2 ? (!p2 ? this["_min"] = A5 : this["setDataMin"](A5), ![]) : { "x": q2, "y": r2, "value": w2, "radius": z2, "min": v2, "max": u2 };
      }, "_unOrganizeData": function() {
        var o2 = [], p2 = this["_data"], q2 = this["_radi"];
        for (var r2 in p2) {
          for (var s2 in p2[r2]) {
            o2["push"]({ "x": r2, "y": s2, "radius": q2[r2][s2], "value": p2[r2][s2] });
          }
        }
        return { "min": this["_min"], "max": this["_max"], "data": o2 };
      }, "_onExtremaChange": function() {
        this["_coordinator"]["emit"]("extremachange", { "min": this["_min"], "max": this["_max"] });
      }, "addData": function() {
        if (arguments[0]["length"] > 0) {
          var o2 = arguments[0], p2 = o2["length"];
          while (p2--) {
            this["addData"]["call"](this, o2[p2]);
          }
        } else {
          var q2 = this["_organiseData"](arguments[0], !![]);
          q2 && (this["_data"]["length"] === 0 && (this["_min"] = this["_max"] = q2["value"]), this["_coordinator"]["emit"]("renderpartial", { "min": this["_min"], "max": this["_max"], "data": [q2] }));
        }
        return this;
      }, "setData": function(o2) {
        var p2 = o2["data"], q2 = p2["length"];
        this["_data"] = [], this["_radi"] = [];
        for (var r2 = 0; r2 < q2; r2++) {
          this["_organiseData"](p2[r2], ![]);
        }
        return this["_max"] = o2["max"], this["_min"] = o2["min"] || 0, this["_onExtremaChange"](), this["_coordinator"]["emit"]("renderall", this["_getInternalData"]()), this;
      }, "removeData": function() {
      }, "setDataMax": function(o2) {
        return this["_max"] = o2, this["_onExtremaChange"](), this["_coordinator"]["emit"]("renderall", this["_getInternalData"]()), this;
      }, "setDataMin": function(o2) {
        return this["_min"] = o2, this["_onExtremaChange"](), this["_coordinator"]["emit"]("renderall", this["_getInternalData"]()), this;
      }, "setCoordinator": function(o2) {
        this["_coordinator"] = o2;
      }, "_getInternalData": function() {
        return { "max": this["_max"], "min": this["_min"], "data": this["_data"], "radi": this["_radi"] };
      }, "getData": function() {
        return this["_unOrganizeData"]();
      } }, l2;
    }(), f2 = function l2() {
      var m2 = function(q2) {
        var r2 = q2["gradient"] || q2["defaultGradient"], s2 = document["createElement"]("canvas"), t2 = s2["getContext"]("2d");
        s2["width"] = 256, s2["height"] = 1;
        var u2 = t2["createLinearGradient"](0, 0, 256, 1);
        for (var v2 in r2) {
          u2["addColorStop"](v2, r2[v2]);
        }
        return t2["fillStyle"] = u2, t2["fillRect"](0, 0, 256, 1), t2["getImageData"](0, 0, 256, 1)["data"];
      }, n2 = function(q2, r2) {
        var s2 = document["createElement"]("canvas"), t2 = s2["getContext"]("2d"), u2 = q2, v2 = q2;
        s2["width"] = s2["height"] = q2 * 2;
        if (r2 == 1) t2["beginPath"](), t2["arc"](u2, v2, q2, 0, 2 * Math["PI"], ![]), t2["fillStyle"] = "rgba(0,0,0,1)", t2["fill"]();
        else {
          var w2 = t2["createRadialGradient"](u2, v2, q2 * r2, u2, v2, q2);
          w2["addColorStop"](0, "rgba(0,0,0,1)"), w2["addColorStop"](1, "rgba(0,0,0,0)"), t2["fillStyle"] = w2, t2["fillRect"](0, 0, 2 * q2, 2 * q2);
        }
        return s2;
      }, o2 = function(q2) {
        var r2 = [], s2 = q2["min"], t2 = q2["max"], u2 = q2["radi"], q2 = q2["data"], v2 = Object["keys"](q2), w2 = v2["length"];
        while (w2--) {
          var x2 = v2[w2], y2 = Object["keys"](q2[x2]), z2 = y2["length"];
          while (z2--) {
            var A5 = y2[z2], B2 = q2[x2][A5], C2 = u2[x2][A5];
            r2["push"]({ "x": x2, "y": A5, "value": B2, "radius": C2 });
          }
        }
        return { "min": s2, "max": t2, "data": r2 };
      };
      function p2(q2) {
        var r2 = q2["container"], s2 = this["shadowCanvas"] = document["createElement"]("canvas"), t2 = this["canvas"] = q2["canvas"] || document["createElement"]("canvas");
        this["_renderBoundaries"] = [1e4, 1e4, 0, 0];
        var v2 = getComputedStyle(q2["container"]) || {};
        t2["className"] = "heatmap-canvas", this["_width"] = t2["width"] = s2["width"] = q2["width"] || +v2["width"]["replace"](/px/, ""), this["_height"] = t2["height"] = s2["height"] = q2["height"] || +v2["height"]["replace"](/px/, ""), this["shadowCtx"] = s2["getContext"]("2d"), this["ctx"] = t2["getContext"]("2d"), t2["style"]["cssText"] = s2["style"]["cssText"] = "position:absolute;left:0;top:0;", r2["style"]["position"] = "relative", r2["appendChild"](t2), this["_palette"] = m2(q2), this["_templates"] = {}, this["_setStyles"](q2);
      }
      return p2["prototype"] = { "renderPartial": function(q2) {
        q2["data"]["length"] > 0 && (this["_drawAlpha"](q2), this["_colorize"]());
      }, "renderAll": function(q2) {
        this["_clear"](), q2["data"]["length"] > 0 && (this["_drawAlpha"](o2(q2)), this["_colorize"]());
      }, "_updateGradient": function(q2) {
        this["_palette"] = m2(q2);
      }, "updateConfig": function(q2) {
        q2["gradient"] && this["_updateGradient"](q2), this["_setStyles"](q2);
      }, "setDimensions": function(q2, r2) {
        this["_width"] = q2, this["_height"] = r2, this["canvas"]["width"] = this["shadowCanvas"]["width"] = q2, this["canvas"]["height"] = this["shadowCanvas"]["height"] = r2;
      }, "_clear": function() {
        this["shadowCtx"]["clearRect"](0, 0, this["_width"], this["_height"]), this["ctx"]["clearRect"](0, 0, this["_width"], this["_height"]);
      }, "_setStyles": function(q2) {
        this["_blur"] = q2["blur"] == 0 ? 0 : q2["blur"] || q2["defaultBlur"], q2["backgroundColor"] && (this["canvas"]["style"]["backgroundColor"] = q2["backgroundColor"]), this["_width"] = this["canvas"]["width"] = this["shadowCanvas"]["width"] = q2["width"] || this["_width"], this["_height"] = this["canvas"]["height"] = this["shadowCanvas"]["height"] = q2["height"] || this["_height"], this["_opacity"] = (q2["opacity"] || 0) * 255, this["_maxOpacity"] = (q2["maxOpacity"] || q2["defaultMaxOpacity"]) * 255, this["_minOpacity"] = (q2["minOpacity"] || q2["defaultMinOpacity"]) * 255, this["_useGradientOpacity"] = !!q2["useGradientOpacity"];
      }, "_drawAlpha": function(q2) {
        var r2 = this["_min"] = q2["min"], s2 = this["_max"] = q2["max"], q2 = q2["data"] || [], t2 = q2["length"], u2 = 1 - this["_blur"];
        while (t2--) {
          var v2 = q2[t2], w2 = v2["x"], z2 = v2["y"], A5 = v2["radius"], B2 = Math["min"](v2["value"], s2), C2 = w2 - A5, D2 = z2 - A5, E2 = this["shadowCtx"], F;
          !this["_templates"][A5] ? this["_templates"][A5] = F = n2(A5, u2) : F = this["_templates"][A5];
          var G = (B2 - r2) / (s2 - r2);
          E2["globalAlpha"] = G < 0.01 ? 0.01 : G, E2["drawImage"](F, C2, D2), C2 < this["_renderBoundaries"][0] && (this["_renderBoundaries"][0] = C2), D2 < this["_renderBoundaries"][1] && (this["_renderBoundaries"][1] = D2), C2 + 2 * A5 > this["_renderBoundaries"][2] && (this["_renderBoundaries"][2] = C2 + 2 * A5), D2 + 2 * A5 > this["_renderBoundaries"][3] && (this["_renderBoundaries"][3] = D2 + 2 * A5);
        }
      }, "_colorize": function() {
        var q2 = this["_renderBoundaries"][0], r2 = this["_renderBoundaries"][1], s2 = this["_renderBoundaries"][2] - q2, t2 = this["_renderBoundaries"][3] - r2, u2 = this["_width"], v2 = this["_height"], w2 = this["_opacity"], z2 = this["_maxOpacity"], A5 = this["_minOpacity"], B2 = this["_useGradientOpacity"];
        q2 < 0 && (q2 = 0);
        r2 < 0 && (r2 = 0);
        q2 + s2 > u2 && (s2 = u2 - q2);
        r2 + t2 > v2 && (t2 = v2 - r2);
        var C2 = this["shadowCtx"]["getImageData"](q2, r2, s2, t2), D2 = C2["data"], E2 = D2["length"], F = this["_palette"];
        for (var G = 3; G < E2; G += 4) {
          var H = D2[G], I2 = H * 4;
          if (!I2) continue;
          var J;
          w2 > 0 ? J = w2 : H < z2 ? H < A5 ? J = A5 : J = H : J = z2, D2[G - 3] = F[I2], D2[G - 2] = F[I2 + 1], D2[G - 1] = F[I2 + 2], D2[G] = B2 ? F[I2 + 3] : J;
        }
        this["ctx"]["putImageData"](C2, q2, r2), this["_renderBoundaries"] = [1e3, 1e3, 0, 0];
      }, "getValueAt": function(q2) {
        var r2, s2 = this["shadowCtx"], t2 = s2["getImageData"](q2["x"], q2["y"], 1, 1), u2 = t2["data"][3], v2 = this["_max"], w2 = this["_min"];
        return r2 = Math["abs"](v2 - w2) * (u2 / 255) >> 0, r2;
      }, "getDataURL": function() {
        return this["canvas"]["toDataURL"]();
      } }, p2;
    }(), g2 = function m2() {
      var n2 = ![];
      return d2["defaultRenderer"] === "canvas2d" && (n2 = f2), n2;
    }(), h2 = { "merge": function() {
      var n2 = {}, o2 = arguments["length"];
      for (var p2 = 0; p2 < o2; p2++) {
        var q2 = arguments[p2];
        for (var r2 in q2) {
          n2[r2] = q2[r2];
        }
      }
      return n2;
    } }, i2 = function n2() {
      var o2 = function r2() {
        function s2() {
          this["cStore"] = {};
        }
        return s2["prototype"] = { "on": function(t2, u2, v2) {
          var w2 = this["cStore"];
          !w2[t2] && (w2[t2] = []), w2[t2]["push"](function(x2) {
            return u2["call"](v2, x2);
          });
        }, "emit": function(t2, u2) {
          var v2 = this["cStore"];
          if (v2[t2]) {
            var w2 = v2[t2]["length"];
            for (var x2 = 0; x2 < w2; x2++) {
              var y2 = v2[t2][x2];
              y2(u2);
            }
          }
        } }, s2;
      }(), p2 = function(s2) {
        var t2 = s2["_renderer"], u2 = s2["_coordinator"], v2 = s2["_store"];
        u2["on"]("renderpartial", t2["renderPartial"], t2), u2["on"]("renderall", t2["renderAll"], t2), u2["on"]("extremachange", function(w2) {
          s2["_config"]["onExtremaChange"] && s2["_config"]["onExtremaChange"]({ "min": w2["min"], "max": w2["max"], "gradient": s2["_config"]["gradient"] || s2["_config"]["defaultGradient"] });
        }), v2["setCoordinator"](u2);
      };
      function q2() {
        var s2 = this["_config"] = h2["merge"](d2, arguments[0] || {});
        this["_coordinator"] = new o2();
        if (s2["plugin"]) {
          var t2 = s2["plugin"];
          if (!d2["plugins"][t2]) throw new Error("Plugin '" + t2 + "' not found. Maybe it was not registered.");
          else {
            var u2 = d2["plugins"][t2];
            this["_renderer"] = new u2["renderer"](s2), this["_store"] = new u2["store"](s2);
          }
        } else this["_renderer"] = new g2(s2), this["_store"] = new e2(s2);
        p2(this);
      }
      return q2["prototype"] = { "addData": function() {
        return this["_store"]["addData"]["apply"](this["_store"], arguments), this;
      }, "removeData": function() {
        return this["_store"]["removeData"] && this["_store"]["removeData"]["apply"](this["_store"], arguments), this;
      }, "setData": function() {
        return this["_store"]["setData"]["apply"](this["_store"], arguments), this;
      }, "setDataMax": function() {
        return this["_store"]["setDataMax"]["apply"](this["_store"], arguments), this;
      }, "setDataMin": function() {
        return this["_store"]["setDataMin"]["apply"](this["_store"], arguments), this;
      }, "configure": function(s2) {
        return this["_config"] = h2["merge"](this["_config"], s2), this["_renderer"]["updateConfig"](this["_config"]), this["_coordinator"]["emit"]("renderall", this["_store"]["_getInternalData"]()), this;
      }, "repaint": function() {
        return this["_coordinator"]["emit"]("renderall", this["_store"]["_getInternalData"]()), this;
      }, "getData": function() {
        return this["_store"]["getData"]();
      }, "getDataURL": function() {
        return this["_renderer"]["getDataURL"]();
      }, "getValueAt": function(s2) {
        if (this["_store"]["getValueAt"]) return this["_store"]["getValueAt"](s2);
        else return this["_renderer"]["getValueAt"] ? this["_renderer"]["getValueAt"](s2) : null;
      } }, q2;
    }(), j2 = { "create": function(o2) {
      return new i2(o2);
    }, "register": function(o2, p2) {
      d2["plugins"][o2] = p2;
    } };
    return j2;
  });
})(heatmap);
var heatmapExports = heatmap["exports"];
getDefaultExportFromCjs(heatmapExports);
class HeatLayer extends BaseGraphicLayer {
  constructor(c2) {
    super(c2);
    __publicField(this, "_type", "heat");
    __publicField(this, "_rectangle");
    __publicField(this, "_heat");
    __publicField(this, "_container");
    __publicField(this, "_primitive");
    __publicField(this, "_points", []);
    __publicField(this, "_colorRamp", []);
    __publicField(this, "_maxVal", 1);
    __publicField(this, "_minVal", 0);
    __publicField(this, "options");
    this["options"] = c2, this["options"]["maxCanvasSize"] = a$d["defaultValue"](this["options"]["maxCanvasSize"], document["body"]["clientWidth"]), this["options"]["maxCanvasSize"] = Math["min"](this["options"]["maxCanvasSize"], 5e3), this["options"]["minCanvasSize"] = a$d["defaultValue"](this["options"]["minCanvasSize"], document["body"]["clientHeight"]), this["options"]["minCanvasSize"] = Math["max"](this["options"]["minCanvasSize"], 700), this["options"]["heatStyle"] = { "maxOpacity": 0.8, "minOpacity": 0.3, "blur": 0.85, "radius": 25, "gradient": { 0: "blue", 0.2: "green", 0.4: "yellow", 0.7: "red", 1: "purple" }, ...this["options"]["heatStyle"] || {} };
    if (this["options"]["heatStyle"]["gradient"]) {
      this["_colorRamp"] = [];
      for (const d2 in this["options"]["heatStyle"]["gradient"]) {
        this["_colorRamp"]["push"]({ "color": this["options"]["heatStyle"]["gradient"][d2], "value": Number(d2) });
      }
    }
  }
  get ["rectangle"]() {
    return this["_rectangle"];
  }
  get ["heatStyle"]() {
    return this["options"]["heatStyle"];
  }
  set ["heatStyle"](c2) {
    this["setHeatStyle"](c2);
  }
  get ["points"]() {
    return this["_points"];
  }
  set ["points"](c2) {
    this["setPoints"](c2);
  }
  async ["_initHooks"]() {
    await super["_initHooks"]();
    let c2;
    if (isString(this["options"]["source"]) || this["options"]["source"] instanceof a$d["Resource"]) {
      const d2 = a$d["Resource"]["createIfNeeded"](this["options"]["source"]);
      c2 = await d2["fetchJson"]();
    } else {
      if (isPromise(this["options"]["source"])) c2 = await this["options"]["source"];
      else {
        if (isFunction(this["options"]["source"])) c2 = this["options"]["source"]();
        else isArray(this["options"]["source"]) && (c2 = this["options"]["source"]);
      }
    }
    this["_points"] = c2 ?? [];
  }
  async ["_addHooks"]() {
    await super["_addHooks"](), this["_render"](), a$d["defined"](this["options"]["zIndex"]) && this["setZIndex"](this["options"]["zIndex"]);
  }
  ["_render"]() {
    if (!this["_earth"] || !this["_points"] || this["_points"]["length"] === 0) return;
    const c2 = this["_createHeatCanvasImg"]();
    this["_createPrimitive"](c2);
  }
  ["_createHeatCanvasImg"]() {
    var _a, _b, _c;
    const c2 = [];
    let d2, e2, f2, g2;
    this["_points"]["forEach"]((A5) => {
      if (!a$d["defined"](A5["x"]) || !a$d["defined"](A5["y"]) || !a$d["defined"](A5["value"])) return;
      const B2 = LatLngPoint["parse"]({ "lng": A5["x"], "lat": A5["y"] });
      B2["value"] = A5["value"] || 1, d2 == void 0 ? (d2 = B2["lng"], e2 = B2["lng"], f2 = B2["lat"], g2 = B2["lat"]) : (d2 = Math["min"](d2, B2["lng"]), e2 = Math["max"](e2, B2["lng"]), f2 = Math["min"](f2, B2["lat"]), g2 = Math["max"](g2, B2["lat"])), c2["push"](B2);
    });
    const h2 = (_a = this["options"]["heatStyle"]) == null ? void 0 : _a["radius"], i2 = h2 * 1.5;
    let j2 = { "xmin": d2, "xmax": e2, "ymin": f2, "ymax": g2 };
    const k2 = getMercatorBounds(j2), l2 = Math["abs"](k2["xmax"] - k2["xmin"]), m2 = Math["abs"](k2["ymax"] - k2["ymin"]), n2 = Math["max"](l2, m2), o2 = Math["min"](l2, m2);
    let p2 = 1;
    const q2 = this["options"]["maxCanvasSize"], r2 = this["options"]["minCanvasSize"];
    if (n2 > q2) p2 = n2 / q2, o2 / p2 < r2 && (p2 = o2 / r2);
    else o2 < r2 && (p2 = o2 / r2, n2 / p2 > q2 && (p2 = n2 / q2));
    const s2 = l2 / p2 + i2 * 2, t2 = m2 / p2 + i2 * 2, u2 = i2 * p2;
    k2["xmin"] -= u2, k2["ymin"] -= u2, k2["xmax"] += u2, k2["ymax"] += u2, j2 = geLatLngBounds(k2), this["_rectangle"] = a$d["Rectangle"]["fromDegrees"](j2["xmin"], j2["ymin"], j2["xmax"], j2["ymax"]);
    let v2 = c2[0]["value"] ?? 1, w2 = c2[0]["value"] ?? 0;
    const x2 = [];
    c2["forEach"]((A5) => {
      const B2 = lonlat2mercator([A5["lng"], A5["lat"]]), C2 = A5["value"] || 1, D2 = Math["round"]((B2[0] - k2["xmin"]) / p2), E2 = Math["round"]((k2["ymax"] - B2[1]) / p2);
      v2 = Math["max"](v2, C2), w2 = Math["min"](w2, C2), x2["push"]({ "x": D2, "y": E2, "value": C2 });
    });
    const y2 = { "min": w2, "max": v2, "data": x2 };
    this["_maxVal"] = v2, this["_minVal"] = w2;
    !this["_container"] && ((_b = this["_earth"]) == null ? void 0 : _b["viewer"]["container"]) && (this["_container"] = createDom("div", "dearth-heatmap", this["_earth"]["viewer"]["container"]));
    if (!this["_container"]) return;
    this["_container"]["style"]["cssText"] = "\n        margin:0;\n        width:" + s2 + "px;\n        height:" + t2 + "px;";
    if (!this["options"]["heatStyle"]) return;
    !this["_heat"] ? this["_heat"] = heatmapExports.create({ ...this["options"]["heatStyle"], "container": this["_container"] }) : this["_heat"]["configure"]({ ...this["options"]["heatStyle"], "container": this["_container"] });
    this["_heat"]["setData"](y2);
    const z2 = this["_heat"]["_renderer"]["canvas"]["toDataURL"]("image/png");
    return this["_container"] && ((_c = this["_earth"]) == null ? void 0 : _c["viewer"]["container"]["removeChild"](this["_container"]), delete this["_container"]), z2;
  }
  ["_createPrimitive"](c2) {
    var _a, _b;
    this["_primitive"] && ((_a = this["_primitiveCollection"]) == null ? void 0 : _a["remove"](this["_primitive"]), this["_primitive"] = void 0);
    if (!this["_rectangle"]) return;
    const d2 = this["options"]["aboveGround"] ? a$d["GroundPrimitive"] : a$d["Primitive"];
    this["_primitive"] = new d2({ "geometryInstances": new a$d["GeometryInstance"]({ "geometry": new a$d["RectangleGeometry"]({ "ellipsoid": a$d["Ellipsoid"]["WGS84"], "height": this["options"]["aboveGround"] ? 0 : this["options"]["height"], "rectangle": this["_rectangle"], "vertexFormat": a$d["EllipsoidSurfaceAppearance"]["VERTEX_FORMAT"] }) }), "appearance": new a$d["EllipsoidSurfaceAppearance"]({ "aboveGround": this["options"]["aboveGround"], "flat": !![] }) });
    const e2 = createMaterial(MaterialType["Heat"], { "u_image": c2 });
    e2 && (this["_primitive"]["appearance"]["material"] = e2), this["_primitive"]["_kbe3d_layerId"] = this["uuid"], (_b = this["_primitiveCollection"]) == null ? void 0 : _b["add"](this["_primitive"]);
  }
  ["setPoints"](c2 = []) {
    this["_points"] = c2, this["_render"]();
  }
  ["setHeatStyle"](c2 = {}) {
    this["options"]["heatStyle"] = Object["assign"](this["options"]["heatStyle"] ?? {}, c2);
    if (c2["gradient"]) {
      this["_colorRamp"] = [];
      for (const d2 in c2["gradient"]) {
        this["_colorRamp"]["push"]({ "color": c2["gradient"][d2], "value": Number(d2) });
      }
    }
    this["_render"]();
  }
  ["addPosition"](c2) {
    this["_points"] = this["_points"] || [], this["_points"]["push"](c2), this["_render"]();
  }
  ["getRectangle"](c2) {
    return c2 && this["_rectangle"] ? formatRectangle(this["_rectangle"]) : this["_rectangle"];
  }
  ["getLegendImage"](c2 = "linear") {
    const e2 = document["createElement"]("canvas"), f2 = e2["getContext"]("2d");
    if (!f2) return;
    const g2 = 256 / this["_colorRamp"]["length"], h2 = "10px serif", j2 = "white";
    let k2 = 256, l2 = 20, m2 = ![];
    const n2 = Math["PI"] / 4;
    this["_colorRamp"]["sort"]((o2, p2) => {
      return o2["value"] - p2["value"];
    });
    for (let o2 = 0; o2 < this["_colorRamp"]["length"]; o2++) {
      f2["font"] = h2;
      const p2 = this["_colorRamp"][o2]["value"]["toString"](), q2 = f2["measureText"](p2)["width"];
      m2 = q2 > g2;
      if (m2) {
        k2 = 270, l2 = 45;
        break;
      }
    }
    e2["width"] = k2, e2["height"] = l2;
    if (c2 === "linear") {
      const r2 = f2["createLinearGradient"](0, 0, 256, 0);
      this["_colorRamp"]["forEach"]((s2) => {
        const { value: t2, color: u2 } = s2;
        r2["addColorStop"](t2, u2);
      }), f2["fillStyle"] = r2, f2["fillRect"](0, 0, k2, 8);
    }
    for (let s2 = 0; s2 < this["_colorRamp"]["length"]; s2++) {
      c2 === "block" && (f2["fillStyle"] = this["_colorRamp"][s2]["color"], f2["fillRect"](s2 * g2, 0, g2, 8));
      if (s2 < this["_colorRamp"]["length"]) {
        f2["save"]();
        let t2 = s2 * g2 + 10, u2 = 18;
        const v2 = Math["ceil"]((this["_maxVal"] - this["_minVal"]) * this["_colorRamp"][s2]["value"])["toFixed"](0);
        let w2 = 0;
        if (m2) f2["translate"](t2, u2), f2["rotate"](n2), t2 = 0, u2 = 0, w2 = 5;
        else {
          const x2 = f2["measureText"](v2)["width"];
          w2 = x2 / 2;
        }
        this["_colorRamp"]["length"] > 20 ? s2 % 3 == 0 && (f2["fillStyle"] = j2, f2["font"] = h2, f2["fillText"](v2, t2 - w2, u2)) : (f2["fillStyle"] = j2, f2["font"] = h2, f2["fillText"](v2, t2 - w2, u2)), f2["restore"]();
      }
    }
    return e2["toDataURL"]("image/png");
  }
}
class BaseTileLayer extends BaseLayer {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "_opacity");
    __publicField(this, "_proxy");
    __publicField(this, "_imageryLayer");
    __publicField(this, "_rectangle");
    __publicField(this, "options");
    this["options"] = b2, this["_rectangle"] = parseRectangle(this["options"]["rectangle"]) ?? a$d["Rectangle"]["MAX_VALUE"], this["_opacity"] = a$d["defaultValue"](b2["opacity"], 1), a$d["defined"](b2["alpha"]) && (this["_opacity"] = b2["alpha"]), this["options"]["proxy"] && (isString(this["options"]["proxy"]) ? this["_proxy"] = new a$d["DefaultProxy"](this["options"]["proxy"]) : this["_proxy"] = this["options"]["proxy"]);
  }
  get ["isTile"]() {
    return !![];
  }
  get ["layerSource"]() {
    return this["_imageryLayer"];
  }
  get ["zIndex"]() {
    return this["options"]["zIndex"] ?? -1;
  }
  set ["zIndex"](b2) {
    this["setZIndex"](b2);
  }
  get ["imageryProvider"]() {
    var _a;
    return (_a = this["_imageryLayer"]) == null ? void 0 : _a["imageryProvider"];
  }
  get ["opacity"]() {
    return this["_opacity"];
  }
  set ["opacity"](b2) {
    this["setOpacity"](b2);
  }
  get ["alpha"]() {
    return this["opacity"];
  }
  set ["alpha"](b2) {
    this["setAlpha"](b2);
  }
  get ["brightness"]() {
    var _a;
    return this["options"]["brightness"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["brightness"]);
  }
  set ["brightness"](b2) {
    this["setBrightness"](b2);
  }
  get ["contrast"]() {
    var _a;
    return this["options"]["contrast"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["contrast"]) || 1;
  }
  set ["contrast"](b2) {
    this["setContrast"](b2);
  }
  get ["hue"]() {
    var _a;
    return this["options"]["hue"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["hue"]) || 0;
  }
  set ["hue"](b2) {
    this["setHue"](b2);
  }
  get ["saturation"]() {
    var _a;
    return this["options"]["saturation"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["saturation"]) || 1;
  }
  set ["saturation"](b2) {
    this["setSaturation"](b2);
  }
  get ["gamma"]() {
    var _a;
    return this["options"]["gamma"] || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["gamma"]) || 1;
  }
  set ["gamma"](b2) {
    this["setGamma"](b2);
  }
  get ["rectangle"]() {
    return this["_rectangle"];
  }
  set ["rectangle"](b2) {
    this["setRectangle"](b2);
  }
  async ["_initHooks"]() {
    const b2 = await this["_createImageryProvider"]({ ...this["options"], "rectangle": this["_rectangle"] });
    if (!a$d["defined"](b2)) return;
    const c2 = this["options"], d2 = { "show": this["show"], "alpha": this["opacity"], ...c2, "rectangle": this["_rectangle"] };
    this["_imageryLayer"] = new a$d["ImageryLayer"](b2, d2), this["_imageryLayer"]["_kbe3d_layerId"] = this["uuid"], this["_imageryLayer"]["_kbe3d_zIndex"] = this["options"]["zIndex"];
  }
  async ["_addHooks"]() {
    var _a;
    !this["_imageryLayer"] && this["_initHooks"](), (_a = this["_earth"]) == null ? void 0 : _a["imageryLayers"]["add"](this["_imageryLayer"]), a$d["defined"](this["options"]["zIndex"]) && this["setZIndex"](this["options"]["zIndex"]);
  }
  ["_removeHooks"]() {
    var _a;
    this["_imageryLayer"] && ((_a = this["_earth"]) == null ? void 0 : _a["imageryLayers"]["remove"](this["_imageryLayer"], ![]));
  }
  ["_destroyHooks"]() {
    var _a;
    (_a = this["_imageryLayer"]) == null ? void 0 : _a["destroy"](), this["_imageryLayer"] = void 0;
  }
  ["_showHooks"](b2) {
  }
  ["_toJsonHooks"](b2) {
  }
  ["setZIndex"](b2) {
    var _a, _b, _c, _d, _e;
    this["options"]["zIndex"] = b2;
    if (this["_imageryLayer"] == null || b2 == null) return;
    (_c = (_b = (_a = this["_earth"]) == null ? void 0 : _a["viewer"]) == null ? void 0 : _b["imageryLayers"]) == null ? void 0 : _c["raiseToTop"](this["_imageryLayer"]);
    const c2 = (_d = this["_earth"]) == null ? void 0 : _d["imageryLayersArr"];
    if (c2) for (let d2 = c2["length"] - 1; d2 >= 0; d2--) {
      const e2 = c2[d2];
      if (e2 == this["_imageryLayer"]) continue;
      const f2 = e2["_kbe3d_zIndex"];
      a$d["defined"](f2) && (b2 < f2 && ((_e = this["_earth"]) == null ? void 0 : _e["imageryLayers"]["lower"](this["_imageryLayer"])));
    }
  }
  ["setOpacity"](b2) {
    this["_opacity"] = b2, this["_imageryLayer"] && (this["_imageryLayer"]["alpha"] = b2);
  }
  ["setAlpha"](b2) {
    this["opacity"] = b2;
  }
  ["setBrightness"](b2) {
    this["options"]["brightness"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["brightness"] = b2;
  }
  ["setContrast"](b2) {
    this["options"]["contrast"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["contrast"] = b2;
  }
  ["setHue"](b2) {
    this["options"]["hue"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["hue"] = b2;
  }
  ["setSaturation"](b2) {
    this["options"]["saturation"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["saturation"] = b2;
  }
  ["setGamma"](b2) {
    this["options"]["gamma"] = b2;
    if (this["_imageryLayer"] == null) return;
    this["_imageryLayer"]["gamma"] = b2;
  }
  ["setRectangle"](b2) {
    var _a, _b;
    this["_rectangle"] = b2 || ((_a = this["_imageryLayer"]) == null ? void 0 : _a["getImageryRectangle"]()) || a$d["Rectangle"]["MAX_VALUE"], this["options"]["rectangle"] = this["_rectangle"], ((_b = this["_imageryLayer"]) == null ? void 0 : _b["imageryProvider"]["rectangle"]) && (this["_imageryLayer"]["imageryProvider"]["_rectangle"] = this["_rectangle"]);
  }
  ["getRectangle"](b2) {
    const c2 = this["_rectangle"] ?? a$d["Rectangle"]["MAX_VALUE"];
    return b2 === !![] ? formatRectangle(c2) : c2;
  }
}
class ImageLayer extends BaseTileLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "image");
    __publicField(this, "options");
    this["options"] = b2;
  }
  static ["createImageryProvider"](b2) {
    return b2 = converTileLayerOptions(b2), !b2["tileWidth"] && (b2["tileWidth"] = 256), !b2["tileHeight"] && (b2["tileHeight"] = 256), new a$d["SingleTileImageryProvider"]({ ...b2, "rectangle": parseRectangle(b2["rectangle"]) });
  }
  ["_createImageryProvider"](b2) {
    return ImageLayer["createImageryProvider"](b2);
  }
}
const _TerrainLayer = class _TerrainLayer extends BaseLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "terrain");
    __publicField(this, "options");
    __publicField(this, "terrain");
    this["options"] = b2;
  }
  static async ["createTerrainProvider"](b2) {
    b2 = b2 || { "terrainType": TerrainType["ELLIPSOID"] }, b2["terrainType"] = b2["terrainType"] || TerrainType["ELLIPSOID"], b2["requestVertexNormals"] = a$d["defaultValue"](b2["requestVertexNormals"], !![]);
    let c2;
    if (b2["terrainType"] == TerrainType["ION"]) !isNumber(b2["source"]) && (b2["source"] = 1), c2 = await a$d["CesiumTerrainProvider"]["fromIonAssetId"](b2["source"], b2);
    else {
      c2 = _TerrainLayer["Ellipsoid"];
      if (b2["source"] && !isNumber(b2["source"])) switch (b2["terrainType"]) {
        case TerrainType["XYZ"]:
          c2 = await a$d["CesiumTerrainProvider"]["fromUrl"](b2["source"], b2);
          break;
        case TerrainType["ARCGIS"]:
          c2 = await a$d["ArcGISTiledElevationTerrainProvider"]["fromUrl"](b2["source"], b2);
          break;
        case TerrainType["VR"]:
          c2 = await a$d["VRTheWorldTerrainProvider"]["fromUrl"](b2["source"], b2);
          break;
        case TerrainType["ELLIPSOID"]:
          c2 = _TerrainLayer["Ellipsoid"];
          break;
        default:
          c2 = _TerrainLayer["Ellipsoid"], handlerError("NOT_THROW", "createTerrainProvider: 请输入有效的terrainType地形类型");
      }
      else c2 = _TerrainLayer["Ellipsoid"], handlerError("NOT_THROW", "createTerrainProvider: 请输入有效的source服务");
    }
    return c2;
  }
  get ["isTile"]() {
    return ![];
  }
  get ["layerSource"]() {
    var _a;
    return (_a = this["terrain"]) == null ? void 0 : _a["provider"];
  }
  ["_createTerrainProvider"](b2) {
    return _TerrainLayer["createTerrainProvider"](b2);
  }
  async ["_initHooks"]() {
    const b2 = this["_createTerrainProvider"](this["options"]);
    this["terrain"] = new a$d["Terrain"](b2), this["terrain"]["_kbe3d_layerId"] = this["uuid"];
  }
  async ["_addHooks"]() {
    this["_earth"] && this["terrain"] && this["_earth"]["viewer"]["scene"]["setTerrain"](this["terrain"]);
  }
  ["_removeHooks"]() {
    var _a;
    this["_earth"] && ((_a = this["terrain"]) == null ? void 0 : _a["provider"]) && (this["_earth"]["viewer"]["terrainProvider"] = _TerrainLayer["Ellipsoid"]);
  }
  ["_destroyHooks"]() {
    this["terrain"] = void 0;
  }
  ["_showHooks"](b2) {
    b2 ? this["_addHooks"]() : this["_removeHooks"]();
  }
  ["_toJsonHooks"](b2) {
  }
  ["getRectangle"](b2) {
    return void 0;
  }
};
__publicField(_TerrainLayer, "Ellipsoid", new a$d["EllipsoidTerrainProvider"]({ "ellipsoid": a$d["Ellipsoid"]["WGS84"] }));
let TerrainLayer = _TerrainLayer;
const defaultSchema = { "id": "default", "type": "edge", "selectedColor": a$d["Color"]["CYAN"], "length": 0.01 };
class HighlightTileset {
  constructor(b2) {
    __publicField(this, "_viewer");
    __publicField(this, "_tileset");
    __publicField(this, "edgeCache");
    __publicField(this, "selected");
    __publicField(this, "highlightSchemaCache");
    this["_viewer"] = b2["viewer"], this["_tileset"] = b2["tileset"], this["highlightSchemaCache"] = {}, this["edgeCache"] = {}, this["selected"] = {};
    const c2 = b2["schema"] ?? {};
    b2["mergeSchema"] && Reflect["ownKeys"](defaultSchema)["forEach"]((d2) => {
      var _a;
      c2[d2] = ((_a = b2["schema"]) == null ? void 0 : _a[d2]) ?? defaultSchema[d2];
    }), this["addHighlightSchema"](c2);
  }
  ["addHighlightSchema"](b2) {
    this["highlightSchemaCache"][b2["id"]] = b2, this["selected"][b2["id"]] = [];
    const c2 = a$d["PostProcessStageLibrary"]["createEdgeDetectionStage"]();
    c2["uniforms"]["color"] = getCesiumColor(b2["selectedColor"], defaultSchema["selectedColor"]), c2["uniforms"]["length"] = isNumber(b2["length"]) ? b2["length"] : defaultSchema["length"], c2["selected"] = [], this["_viewer"]["scene"]["postProcessStages"]["add"](a$d["PostProcessStageLibrary"]["createSilhouetteStage"]([c2])), this["edgeCache"][b2["id"]] = c2;
  }
  ["updateHighlightSchema"](b2, c2 = !![]) {
    if (this["highlightSchemaCache"][b2["id"]]) {
      c2 && Reflect["ownKeys"](this["highlightSchemaCache"][b2["id"]])["forEach"]((f2) => {
        f2 != "id" && (b2[f2] = b2[f2] ?? this["highlightSchemaCache"][b2["id"]][f2]);
      });
      this["highlightSchemaCache"][b2["id"]] = b2;
      const d2 = this["selected"][b2["id"]] ?? [];
      d2["forEach"]((f2) => {
        this["closeHighlight"](f2, b2["id"]);
      }), this["_viewer"]["scene"]["postProcessStages"]["remove"](this["edgeCache"][b2["id"]]), this["edgeCache"][b2["id"]]["destroy"]();
      const e2 = a$d["PostProcessStageLibrary"]["createEdgeDetectionStage"]();
      e2["uniforms"]["color"] = getCesiumColor(b2["selectedColor"], defaultSchema["selectedColor"]), e2["uniforms"]["length"] = isNumber(b2["length"]) ? b2["length"] : defaultSchema["length"], e2["selected"] = [], this["_viewer"]["scene"]["postProcessStages"]["add"](a$d["PostProcessStageLibrary"]["createSilhouetteStage"]([e2])), d2["forEach"]((f2) => {
        this["openHighlight"](f2, b2["id"]);
      }), this["edgeCache"][b2["id"]] = e2;
    }
  }
  ["removeHighlightSchema"](b2) {
    this["clearHighlight"](b2), this["_viewer"]["scene"]["postProcessStages"]["remove"](this["edgeCache"][b2]), this["edgeCache"][b2]["destroy"](), Reflect["deleteProperty"](this["edgeCache"], b2), Reflect["deleteProperty"](this["highlightSchemaCache"], b2), Reflect["deleteProperty"](this["selected"], b2);
  }
  ["openHighlight"](b2, c2 = defaultSchema["id"], d2) {
    d2 && this["clearHighlight"](c2), this["selected"][c2]["push"](b2), this["highlightSchemaCache"][c2]["type"] == "edge" ? this["edgeCache"][c2]["selected"] = [...this["selected"][c2]] : b2["color"] = getCesiumColor(this["highlightSchemaCache"][c2]["selectedColor"]);
  }
  ["closeHighlight"](b2, c2 = defaultSchema["id"]) {
    const d2 = this["selected"][c2]["findIndex"]((e2) => {
      return b2["content"]["url"] + "__batchId__" + b2["featureId"] == e2["content"]["url"] + "__batchId__" + e2["featureId"];
    });
    d2 > -1 && (this["selected"][c2]["splice"](d2, 1), this["highlightSchemaCache"][c2]["type"] == "edge" ? this["edgeCache"][c2]["selected"] = [...this["selected"][c2]] : b2["color"] = a$d["Color"]["WHITE"]);
  }
  ["clearHighlight"](b2 = defaultSchema["id"]) {
    this["selected"][b2]["forEach"]((c2) => {
      this["closeHighlight"](c2, b2);
    });
  }
  ["clearAllHighlight"]() {
    for (const b2 in this["highlightSchemaCache"]) {
      this["clearHighlight"](b2);
    }
  }
  ["destroy"]() {
    for (const b2 in this["highlightSchemaCache"]) {
      this["removeHighlightSchema"](b2);
    }
    for (const c2 in this) {
      delete this[c2];
    }
  }
}
class TilesetLayer extends BaseLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "tileset");
    __publicField(this, "_tileset");
    __publicField(this, "_originRotation", { "x": 0, "y": 0, "z": 0 });
    __publicField(this, "_originCenterPoint", new LatLngPoint());
    __publicField(this, "_originCenterPosition", new a$d["Cartesian3"]());
    __publicField(this, "_originMatrix");
    __publicField(this, "_center", new LatLngPoint());
    __publicField(this, "_opacity");
    __publicField(this, "_styleCallback");
    __publicField(this, "_isBindTileVisible", ![]);
    __publicField(this, "_primaryKey", "id");
    __publicField(this, "_propertiesCache", {});
    __publicField(this, "_highlightAll", ![]);
    __publicField(this, "_styleCache");
    __publicField(this, "options");
    __publicField(this, "highlight");
    this["options"] = b2, this["_opacity"] = a$d["defaultValue"](b2["opacity"], 1);
  }
  get ["isTile"]() {
    return ![];
  }
  get ["layerSource"]() {
    return this["_tileset"];
  }
  get ["defaultTilesetOptimizeOptions"]() {
    return { "maximumScreenSpaceError": 64, "cacheBytes": 2147483648, "maximumCacheOverflowBytes": 1073741824, "cullRequestsWhileMovingMultiplier": 100, "skipLevelOfDetail": !![], "immediatelyLoadDesiredLevelOfDetail": !![], "progressiveResolutionHeightFraction": 0.1 };
  }
  get ["tileset"]() {
    return this["_tileset"];
  }
  get ["hasTransform"]() {
    var _a, _b;
    return ((_a = this["_tileset"]) == null ? void 0 : _a["root"]) && ((_b = this["_tileset"]["root"]) == null ? void 0 : _b["transform"]);
  }
  get ["boundingSphere"]() {
    var _a;
    return (_a = this["_tileset"]) == null ? void 0 : _a["boundingSphere"];
  }
  get ["asset"]() {
    var _a;
    return (_a = this["_tileset"]) == null ? void 0 : _a["asset"];
  }
  get ["properties"]() {
    var _a;
    return (_a = this["_tileset"]) == null ? void 0 : _a["properties"];
  }
  get ["totalMemoryUsageInBytes"]() {
    var _a;
    return (_a = this["_tileset"]) == null ? void 0 : _a["totalMemoryUsageInBytes"];
  }
  get ["originCenterPoint"]() {
    return this["_originCenterPoint"];
  }
  get ["originCenterPosition"]() {
    return this["_originCenterPosition"];
  }
  get ["position"]() {
    return this["_center"]["toCartesian"]();
  }
  get ["center"]() {
    return this["_center"];
  }
  get ["height"]() {
    if (this["_center"]) return this["_center"]["alt"];
    return 0;
  }
  set ["height"](b2) {
    this["setHeight"](b2);
  }
  get ["rotation"]() {
    if (this["options"]["rotation"]) return this["options"]["rotation"];
    return this["_originRotation"];
  }
  set ["rotation"](b2) {
    this["setRotation"](b2);
  }
  get ["rotation_x"]() {
    if (this["options"]["rotation"] && a$d["defined"](this["options"]["rotation"]["x"])) return this["options"]["rotation"]["x"];
    return this["_originRotation"]["x"];
  }
  set ["rotation_x"](b2) {
    this["setRotationX"](b2);
  }
  get ["rotation_y"]() {
    if (this["options"]["rotation"] && a$d["defined"](this["options"]["rotation"]["y"])) return this["options"]["rotation"]["y"];
    return this["_originRotation"]["y"];
  }
  set ["rotation_y"](b2) {
    this["setRotationY"](b2);
  }
  get ["rotation_z"]() {
    if (this["options"]["rotation"] && a$d["defined"](this["options"]["rotation"]["z"])) return this["options"]["rotation"]["z"];
    return this["_originRotation"]["z"];
  }
  set ["rotation_z"](b2) {
    this["setRotationZ"](b2);
  }
  get ["axis"]() {
    return this["options"]["axis"];
  }
  set ["axis"](b2) {
    this["setAxis"](b2);
  }
  get ["scale"]() {
    return this["options"]["scale"] || 1;
  }
  set ["scale"](b2) {
    this["setScale"](b2);
  }
  get ["opacity"]() {
    return this["_opacity"];
  }
  set ["opacity"](b2) {
    this["setOpacity"](b2);
  }
  get ["style"]() {
    return this["options"]["style"];
  }
  set ["style"](b2) {
    this["setStyle"](b2);
  }
  get ["customShader"]() {
    return this["options"]["customShader"];
  }
  set ["customShader"](b2) {
    this["setCustomShader"](b2);
  }
  set ["center"](b2) {
    this["setCenter"](b2);
  }
  get ["allowDrillPick"]() {
    return this["options"]["allowDrillPick"];
  }
  set ["allowDrillPick"](b2) {
    this["options"]["allowDrillPick"] = b2;
  }
  async ["_initHooks"]() {
  }
  async ["_addHooks"]() {
    callWithErrorHandling("THROW", "三维模型加载出错，请检查source等构造参数", async () => {
      const b2 = await this["_createCesium3DTileset"]();
      if (!b2) throw new Error("三维模型加载出错，请检查source等构造参数");
      this["_tileset"] = b2, this["_tileset"]["name"] = this["name"], this["_tileset"]["_kbe3d_layerId"] = this["uuid"], this["_earth"] && this["_earth"]["viewer"]["scene"]["primitives"]["add"](this["_tileset"]), this["_tileset"]["initialTilesLoaded"]["addEventListener"]((c2) => {
        this["emit"](EventType["initialTilesLoaded"], c2);
      }), this["_tileset"]["allTilesLoaded"]["addEventListener"]((c2) => {
        this["emit"](EventType["allTilesLoaded"], c2);
      }), this["_tileset"]["show"] = this["show"], this["_init"]();
    });
  }
  ["_removeHooks"]() {
    this["_tileset"] && (this["_destroyHighlight"](), this["_earth"] && (this["_earth"] && (this["_earth"]["viewer"]["scene"]["primitives"]["destroyPrimitives"] = ![]), this["_earth"]["viewer"]["scene"]["primitives"]["remove"](this["_tileset"])));
  }
  ["_destroyHooks"]() {
    var _a;
    (_a = this["_tileset"]) == null ? void 0 : _a["destroy"](), this["_tileset"] = void 0;
  }
  ["_showHooks"](b2) {
  }
  ["_toJsonHooks"](b2) {
  }
  ["_createCesium3DTileset"]() {
    if (typeof this["options"]["source"] == "number") {
      const b2 = this["options"]["source"];
      return a$d["Cesium3DTileset"]["fromIonAssetId"](b2, this["options"]);
    } else {
      const c2 = this["options"]["source"];
      return a$d["Cesium3DTileset"]["fromUrl"](c2, this["options"]);
    }
  }
  ["_bindTileVisibleEvent"]() {
    var _a;
    !this["_isBindTileVisible"] && ((_a = this["_tileset"]) == null ? void 0 : _a["tileVisible"]["addEventListener"](this["_updateTile"], this), this["_isBindTileVisible"] = !![]);
  }
  ["_updateTile"](b2) {
    const c2 = b2["content"];
    for (let d2 = 0; d2 < c2["featuresLength"]; d2++) {
      const e2 = c2["getFeature"](d2);
      if (this["_propertiesCache"]) {
        const f2 = e2["getProperty"](this["_primaryKey"]);
        f2 && this["setFeatureProperties"](e2, this["_propertiesCache"][f2]);
      }
      if (this["_styleCallback"]) {
        const g2 = this["getFeatureProperties"](e2), h2 = this["_styleCallback"]({ "feature": e2, "properties": g2 });
        h2 && (e2["color"] = getCesiumColor(h2));
      }
    }
    this["emit"](EventType["tileVisible"]);
  }
  ["_mergePostion"](b2) {
    b2 && (!this["_center"] && (this["_center"] = new LatLngPoint()), a$d["defined"](b2["lat"]) && (this["_center"]["lat"] = b2["lat"]), a$d["defined"](b2["lng"]) && (this["_center"]["lng"] = b2["lng"]), a$d["defined"](b2["alt"]) && (this["_center"]["alt"] = b2["alt"]));
  }
  ["_initHighlight"]() {
    var _a;
    if (this["highlight"]) return;
    if (!this["_earth"] || !this["_tileset"]) return;
    this["highlight"] = new HighlightTileset({ "viewer": this["_earth"]["viewer"], "tileset": this["_tileset"], "schema": { ...this["options"]["highlight"], "id": this["id"] }, "mergeSchema": !![] });
    const b2 = ((_a = this["options"]["highlight"]) == null ? void 0 : _a["trigger"]) ?? "click";
    this["on"](EventType["click"], (c2) => {
      var _a2, _b, _c, _d, _e, _f, _g, _h;
      if (b2 == "click") {
        if ((_a2 = this["options"]["highlight"]) == null ? void 0 : _a2["filter"]) {
          if (!((_c = (_b = this["options"]["highlight"]) == null ? void 0 : _b["filter"]) == null ? void 0 : _c.call(_b, c2["data"]))) return;
        }
        if (c2["sourceTarget"] instanceof a$d["Cesium3DTileFeature"]) {
          if (this["_tileset"] && ((_d = this["options"]["highlight"]) == null ? void 0 : _d["all"])) {
            const d2 = getCesiumColor((_e = this["options"]["highlight"]) == null ? void 0 : _e["selectedColor"])["toCssColorString"]();
            this["_tileset"]["style"] = new a$d["Cesium3DTileStyle"]({ "color": { "conditions": [["true", d2]] } }), this["_highlightAll"] = !![];
            return;
          }
          (_g = this["highlight"]) == null ? void 0 : _g["openHighlight"](c2["sourceTarget"], this["id"], !((_f = this["options"]["highlight"]) == null ? void 0 : _f["multi"]));
        } else {
          if (this["_tileset"] && this["_highlightAll"]) {
            this["_highlightAll"] = ![], this["_tileset"]["style"] = this["_styleCache"];
            return;
          }
          (_h = this["highlight"]) == null ? void 0 : _h["clearHighlight"](this["id"]);
        }
      }
    }), this["on"](EventType["mouseOver"], (c2) => {
      var _a2, _b, _c, _d, _e, _f, _g;
      if (b2 == "hover") {
        if ((_a2 = this["options"]["highlight"]) == null ? void 0 : _a2["filter"]) {
          if (!((_c = (_b = this["options"]["highlight"]) == null ? void 0 : _b["filter"]) == null ? void 0 : _c.call(_b, c2["data"]))) return;
        }
        if (c2["sourceTarget"] instanceof a$d["Cesium3DTileFeature"]) {
          if (this["_tileset"] && ((_d = this["options"]["highlight"]) == null ? void 0 : _d["all"])) {
            const d2 = getCesiumColor((_e = this["options"]["highlight"]) == null ? void 0 : _e["selectedColor"])["toCssColorString"]();
            this["_tileset"]["style"] = new a$d["Cesium3DTileStyle"]({ "color": { "conditions": [["true", d2]] } }), this["_highlightAll"] = !![];
            return;
          }
          (_g = this["highlight"]) == null ? void 0 : _g["openHighlight"](c2["sourceTarget"], this["id"], !((_f = this["options"]["highlight"]) == null ? void 0 : _f["multi"]));
        }
      }
    }), this["on"](EventType["mouseOut"], (c2) => {
      var _a2, _b;
      if (b2 == "hover") {
        if (this["_tileset"] && this["_highlightAll"]) {
          this["_highlightAll"] = ![], this["_tileset"]["style"] = this["_styleCache"];
          return;
        }
        !((_a2 = this["options"]["highlight"]) == null ? void 0 : _a2["multi"]) && ((_b = this["highlight"]) == null ? void 0 : _b["clearHighlight"](this["id"]));
      }
    });
  }
  ["_destroyHighlight"]() {
    var _a;
    (_a = this["highlight"]) == null ? void 0 : _a["destroy"](), this["highlight"] = void 0;
  }
  ["_init"]() {
    var _a, _b, _c, _d;
    this["_originCenterPosition"] = a$d["clone"]((_a = this["_tileset"]) == null ? void 0 : _a["boundingSphere"]["center"]);
    if (this["hasTransform"]) {
      if (this["_tileset"]) {
        const b2 = this["_tileset"]["root"]["transform"] instanceof a$d["Matrix4"] ? this["_tileset"]["root"]["transform"] : a$d["Matrix4"]["fromArray"](this["_tileset"]["root"]["transform"]);
        this["_originMatrix"] = a$d["Matrix4"]["inverse"](b2, new a$d["Matrix4"]());
        const c2 = a$d["Matrix4"]["getTranslation"](b2, new a$d["Cartesian3"]());
        if (a$d["defined"](c2) && a$d["Cartographic"]["fromCartesian"](c2)) {
          this["_originCenterPosition"] = c2;
          const d2 = a$d["Matrix4"]["getMatrix3"](b2, new a$d["Matrix3"]()), e2 = a$d["Matrix4"]["getMatrix3"](a$d["Transforms"]["eastNorthUpToFixedFrame"](c2), new a$d["Matrix3"]()), f2 = a$d["Matrix3"]["getColumn"](e2, 0, new a$d["Cartesian3"]()), g2 = a$d["Matrix3"]["getColumn"](e2, 1, new a$d["Cartesian3"]()), h2 = a$d["Matrix3"]["getColumn"](e2, 2, new a$d["Cartesian3"]());
          let i2 = a$d["Matrix3"]["getColumn"](d2, 0, new a$d["Cartesian3"]());
          i2 = a$d["Cartesian3"]["cross"](i2, h2, i2), i2 = a$d["Cartesian3"]["cross"](h2, i2, i2), i2 = a$d["Cartesian3"]["normalize"](i2, i2);
          let j2 = a$d["Cartesian3"]["angleBetween"](f2, i2);
          const k2 = a$d["Cartesian3"]["angleBetween"](g2, i2);
          k2 > Math["PI"] * 0.5 && (j2 = 2 * Math["PI"] - j2), this["_originRotation"] = { "x": 0, "y": 0, "z": Number(a$d["Math"]["toDegrees"](j2)["toFixed"](1)) };
        }
      }
    }
    this["_originCenterPoint"] = LatLngPoint["fromCartesian"](this["_originCenterPosition"]), handlerInfo(this["name"] + " 模型中心位置:" + this["_originCenterPoint"]["toString"]());
    a$d["defined"](this["options"]["style"]) && (this["style"] = this["options"]["style"]);
    this["_styleCache"] = (_b = this["tileset"]) == null ? void 0 : _b["style"];
    this["_opacity"] != 1 && this["setOpacity"](this["_opacity"]);
    this["_center"] = this["_originCenterPoint"]["clone"]();
    this["options"]["position"] && (this["_mergePostion"](this["options"]["position"]), handlerInfo(this["name"] + " 设置新的中心点后，模型中心位置:" + this["_center"]["toString"]()));
    if (this["options"]["chinaCRS"]) {
      const l2 = this["_transformCenter"](this["center"]);
      l2 && (this["_mergePostion"](l2), handlerInfo(this["name"] + " 设置" + this["options"]["chinaCRS"] + "坐标系配置后，模型中心位置:" + this["_center"]["toString"]()));
    }
    this["_hasUpdateMater"]() && this["updateMatrix"](), this["options"]["clampToGround"] && this["clampToGround"](), this["options"]["flyTo"] && (a$d["defined"]((_c = this["options"]["homeVision"]) == null ? void 0 : _c["pitch"]) ? this["flyTo"]() : this["flyTo"]({ "minPitch": -45, "maxPitch": 45 })), !((_d = this["options"]["highlight"]) == null ? void 0 : _d["disable"]) && this["_initHighlight"]();
  }
  ["_transformCenter"](b2) {
    if (!this["_earth"]) return;
    const c2 = this["options"]["chinaCRS"], d2 = ChinaCRS["WGS84"];
    if (d2 && c2 && d2 != c2) {
      const e2 = getTransFun(c2, d2);
      if (!e2) return void 0;
      const f2 = e2([b2["lng"], b2["lat"]]);
      return { "lng": f2[0], "lat": f2[1], "alt": b2["alt"] };
    } else return { "lng": b2["lng"], "lat": b2["lat"], "alt": b2["alt"] };
  }
  ["_hasUpdateMater"]() {
    if (!this["center"]["equals"](this["_originCenterPoint"])) return !![];
    if (this["options"]["rotation"]) return !![];
    if (a$d["defined"](this["options"]["scale"]) && this["options"]["scale"] > 0 && this["options"]["scale"] != 1) return !![];
    if (a$d["defined"](this["options"]["axis"])) return !![];
    return ![];
  }
  ["_updateMatrix2"]() {
    if (!this["_tileset"] || !this["_tileset"]["root"]) return;
    const b2 = a$d["Cartographic"]["fromCartesian"](this["_tileset"]["boundingSphere"]["center"]), c2 = a$d["Cartesian3"]["fromRadians"](b2["longitude"], b2["latitude"], 0), d2 = this["position"], e2 = a$d["Cartesian3"]["subtract"](d2, c2, new a$d["Cartesian3"]()), f2 = a$d["Matrix4"]["fromTranslation"](e2);
    return this["_tileset"]["modelMatrix"] = f2, f2;
  }
  ["setOpacity"](b2) {
    this["_opacity"] = b2, this["_tileset"] && (!this["_tileset"]["style"] ? this["_tileset"]["style"] = new a$d["Cesium3DTileStyle"]({ "color": "color('rgba(255, 255, 255, " + b2 + ")')" }) : this["_tileset"]["style"] = new a$d["Cesium3DTileStyle"]({ "color": "color('rgba(255, 255, 255, " + b2 + ")')" }));
  }
  ["setCenter"](b2) {
    this["_center"] = LatLngPoint["parse"](b2), this["updateMatrix"]();
  }
  ["setHeight"](b2) {
    if (!this["_tileset"]) return;
    this["_center"]["alt"] = b2, this["updateMatrix"]();
  }
  ["setRotation"](b2) {
    this["options"]["rotation"] = b2, this["updateMatrix"]();
  }
  ["setRotationX"](b2) {
    this["options"]["rotation"] = this["options"]["rotation"] || { "x": 0, "y": 0, "z": 0 }, this["options"]["rotation"]["x"] = b2, this["updateMatrix"]();
  }
  ["setRotationY"](b2) {
    this["options"]["rotation"] = this["options"]["rotation"] || { "x": 0, "y": 0, "z": 0 }, this["options"]["rotation"]["y"] = b2, this["updateMatrix"]();
  }
  ["setRotationZ"](b2) {
    this["options"]["rotation"] = this["options"]["rotation"] || { "x": 0, "y": 0, "z": 0 }, this["options"]["rotation"]["z"] = b2, this["updateMatrix"]();
  }
  ["setAxis"](b2) {
    this["options"]["axis"] = b2, this["updateMatrix"]();
  }
  ["setScale"](b2) {
    this["options"]["scale"] = b2, this["updateMatrix"]();
  }
  ["setStyle"](b2) {
    this["options"]["style"] = b2, this["_styleCallback"] = void 0;
    if (this["_tileset"]) {
      if (b2 instanceof a$d["Cesium3DTileStyle"]) this["_tileset"]["style"] = b2;
      else typeof b2 == "function" ? (this["_styleCallback"] = b2, this["_bindTileVisibleEvent"]()) : this["_tileset"]["style"] = new a$d["Cesium3DTileStyle"](b2);
      this["_styleCache"] = this["_tileset"]["style"];
    }
  }
  ["setCustomShader"](b2) {
    this["options"]["customShader"] = b2, this["_tileset"] && (this["_tileset"]["customShader"] = b2);
  }
  ["clampToGround"](b2 = 1) {
    this["_earth"] && this["_earth"]["hasTerrain"] ? getSurfaceTerrainHeight(this["_earth"]["viewer"], this["_originCenterPosition"], { "async": !![], "callback": (c2, d2) => {
      if (c2 == null) return;
      this["height"] = c2 - this["_originCenterPoint"]["alt"] + b2;
    } }) : this["height"] = -this["_originCenterPoint"]["alt"] + b2;
  }
  ["setProperties"](b2, c2 = "id") {
    this["_primaryKey"] = c2, this["_propertiesCache"] = {}, b2["forEach"]((d2) => {
      const e2 = d2[c2];
      this["_propertiesCache"][e2] = d2;
    }), this["_bindTileVisibleEvent"]();
  }
  ["getFeatureProperties"](b2) {
    const c2 = {}, d2 = b2["getPropertyIds"]();
    for (let e2 = 0; e2 < d2["length"]; e2++) {
      const f2 = d2[e2];
      if (!b2["hasProperty"](f2)) continue;
      const g2 = b2["getProperty"](f2);
      if (g2 == null) continue;
      c2[f2] = g2;
    }
    return c2;
  }
  ["setFeatureProperties"](b2, c2) {
    if (!b2 || !c2) return;
    for (const d2 in c2) {
      const e2 = c2[d2];
      if (b2["hasProperty"](d2) && b2["getProperty"](d2) === e2) continue;
      b2["setProperty"](d2, e2);
    }
  }
  ["updateMatrix"]() {
    if (!this["_tileset"]) return void 0;
    if (!this["hasTransform"]) return this["_updateMatrix2"]();
    let b2 = a$d["Transforms"]["eastNorthUpToFixedFrame"](this["position"]);
    if (this["options"]["rotation"]) {
      const c2 = a$d["Matrix3"]["fromRotationX"](a$d["Math"]["toRadians"](this["rotation_x"])), d2 = a$d["Matrix3"]["fromRotationY"](a$d["Math"]["toRadians"](this["rotation_y"])), e2 = a$d["Matrix3"]["fromRotationZ"](a$d["Math"]["toRadians"](360 - this["rotation_z"])), f2 = a$d["Matrix4"]["fromRotationTranslation"](c2), g2 = a$d["Matrix4"]["fromRotationTranslation"](d2), h2 = a$d["Matrix4"]["fromRotationTranslation"](e2);
      a$d["Matrix4"]["multiply"](b2, f2, b2), a$d["Matrix4"]["multiply"](b2, g2, b2), a$d["Matrix4"]["multiply"](b2, h2, b2);
    }
    a$d["defined"](this["options"]["scale"]) && this["options"]["scale"] > 0 && this["options"]["scale"] != 1 && a$d["Matrix4"]["multiplyByUniformScale"](b2, this["options"]["scale"], b2);
    if (a$d["defined"](this["options"]["axis"])) {
      let i2;
      isString(this["options"]["axis"]) && (i2 = a$d["Axis"]["fromName"](this["options"]["axis"]["toUpperCase"]())), i2 && (b2 = a$d["Matrix4"]["multiplyTransformation"](b2, i2, b2));
    }
    return this["_tileset"]["root"]["transform"] = b2, b2;
  }
  ["optimize"](b2 = this["defaultTilesetOptimizeOptions"], c2 = !![]) {
    if (c2) for (const d2 in this["defaultTilesetOptimizeOptions"]) {
      b2[d2] ?? (b2[d2] = this["defaultTilesetOptimizeOptions"][d2]);
    }
    if (this["_tileset"]) for (const e2 in b2) {
      this["_tileset"][e2] = b2[e2];
    }
  }
  ["createCustomShader"](b2, c2) {
    let d2;
    switch (b2) {
      case CustomShaderType["DistanceColorChange"]:
        const e2 = c2, f2 = (e2 == null ? void 0 : e2["changedRgbIndex"]) ?? "g", g2 = (e2 == null ? void 0 : e2["far"]) ?? 1e4, h2 = getCesiumColor(e2 == null ? void 0 : e2["baseColor"], a$d["Color"]["BLUE"]);
        d2 = new a$d["CustomShader"]({ "uniforms": { "baseColor": { "type": a$d["UniformType"]["VEC3"], "value": h2 }, "far": { "type": a$d["UniformType"]["FLOAT"], "value": g2 }, "changedR": { "type": a$d["UniformType"]["BOOL"], "value": f2 == "r" }, "changedG": { "type": a$d["UniformType"]["BOOL"], "value": f2 == "g" }, "changedB": { "type": a$d["UniformType"]["BOOL"], "value": f2 == "b" } }, "lightingModel": a$d["LightingModel"]["UNLIT"], "fragmentShaderText": "\n            void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {\n              // 初始纯蓝色\n              material.diffuse = baseColor;\n              // rgb  r:代表red的色值，从fsInput.attributes.positionEC.z（很可能是眼坐标（Eye Coordinates）下的顶点Z位置）中获取一个值，并将其除以1.0e4（即10,000），然后取反，赋值给material.diffuse.g\n              if(changedR){\n                material.diffuse.r = -fsInput.attributes.positionEC.z / far;\n              }\n              if(changedG){\n                material.diffuse.g = -fsInput.attributes.positionEC.z / far;\n              }\n              if(changedB){\n                material.diffuse.b = -fsInput.attributes.positionEC.z / far;\n              }\n            } " });
        break;
      case CustomShaderType["DynamicHalo"]:
        const i2 = c2;
        (i2 == null ? void 0 : i2["onClick"]) && this["on"](EventType["click"], (r2) => {
          var _a;
          (_a = i2 == null ? void 0 : i2["onClick"]) == null ? void 0 : _a.call(i2, this, r2);
        });
        const j2 = getCesiumColor(i2 == null ? void 0 : i2["baseColorBottom"], a$d["Color"]["BLACK"]), k2 = getCesiumColor(i2 == null ? void 0 : i2["baseColorTop"], a$d["Color"]["INDIGO"]), l2 = getCesiumColor(i2 == null ? void 0 : i2["lightColor"], a$d["Color"]["fromCssColorString"]("#ff00ff")), m2 = (i2 == null ? void 0 : i2["baseHeight"]) ?? 0, n2 = (i2 == null ? void 0 : i2["heightRange"]) ?? 400, o2 = (i2 == null ? void 0 : i2["glowRange"]) ?? 400, p2 = (i2 == null ? void 0 : i2["lightRadius"]) ?? 1e3, q2 = LatLngPoint["parse"]((i2 == null ? void 0 : i2["lightPosition"]) ?? [0, 0, 0])["toCartesian"]();
        d2 = new a$d["CustomShader"]({ "uniforms": { "baseColorBottom": { "type": a$d["UniformType"]["VEC3"], "value": j2 }, "baseColorTop": { "type": a$d["UniformType"]["VEC3"], "value": k2 }, "baseHeight": { "type": a$d["UniformType"]["FLOAT"], "value": m2 }, "heightRange": { "type": a$d["UniformType"]["FLOAT"], "value": n2 }, "glowRange": { "type": a$d["UniformType"]["FLOAT"], "value": o2 }, "lightPosition": { "type": a$d["UniformType"]["VEC3"], "value": q2 }, "lightColor": { "type": a$d["UniformType"]["VEC3"], "value": l2 }, "lightRadius": { "type": a$d["UniformType"]["FLOAT"], "value": p2 } }, "lightingModel": a$d["LightingModel"]["UNLIT"], "mode": a$d["CustomShaderMode"]["REPLACE_MATERIAL"], "fragmentShaderText": "\n            #define sat( a ) clamp( a, 0.0, 1.0 )\n            float getDistanceDecay( float lightDistance, float distance,float decay) {\n              if ( distance > 0.0 && decay > 0.0 ) {\n                  return pow( sat( - lightDistance / distance + 1.0 ), decay );\n              }\n              return 1.0;\n            }\n            vec3 addPointLight(vec3 lightPosition, vec3 lightColor, vec3 positionWC , vec3 normal){\n              float distance = lightRadius;\n              float decay = 1.0;\n              float lightDistance = length( lightPosition - positionWC );\n              lightColor *= getDistanceDecay( lightDistance, distance, decay );\n              return lightColor;\n            }\n\n            void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)\n            {\n              vec3 positionMC = fsInput.attributes.positionMC;\n              vec3 normalEC = fsInput.attributes.normalEC;\n              float jzw_height = positionMC.z - baseHeight;\n              vec3 glColor = vec3(0.);\n\n              // 渐变\n              glColor.rgb = mix(baseColorBottom, baseColorTop,clamp(positionMC.z / heightRange, 0.0, 1.0)) ;\n              float diffuseCoefficient = max(0.0, dot(normalEC, vec3(0.5)) * 1.0);\n              glColor.rgb *= min(diffuseCoefficient + 0.1, 1.0);\n\n              // 光圈特效\n              float time = fract(czm_frameNumber / 360.0);\n              time = abs(time - 0.5) * 2.0;\n              float jzw_h = clamp(jzw_height / glowRange, 0.0, 1.0);\n              float jzw_diff = step(0.005, abs(jzw_h - time));\n              glColor.rgb += glColor.rgb * (1.0 - jzw_diff);\n\n              // 点光源\n              glColor.rgb += addPointLight(\n                lightPosition ,\n                lightColor,\n                (czm_model * vec4(positionMC,1.0)).xyz,\n                normalEC);\n\n              material.diffuse = mix(glColor.rgb, material.diffuse, 0.0);\n            } " });
        break;
      default:
        d2 = void 0;
        break;
    }
    return d2;
  }
  ["getRectangle"](b2) {
    if (this["boundingSphere"]) {
      const c2 = a$d["Rectangle"]["fromBoundingSphere"](this["boundingSphere"]);
      return b2 ? formatRectangle(c2) : c2;
    } else return void 0;
  }
  ["setUniforms"](b2) {
    if (!this["customShader"]) return;
    Reflect["ownKeys"](b2)["forEach"]((c2) => {
      this["customShader"]["uniforms"][c2]["value"] = b2[c2];
    });
  }
}
__publicField(TilesetLayer, "EventType", { ...BaseLayer["EventType"], ...pick(EventType, ["initialTilesLoaded", "allTilesLoaded", "tileVisible"]) });
const _WmsLayer = class _WmsLayer extends BaseTileLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "wms");
    __publicField(this, "options");
    __publicField(this, "capabilities");
    this["options"] = b2;
  }
  static ["createImageryProvider"](b2) {
    return b2 = converTileLayerOptions(b2), new a$d["WebMapServiceImageryProvider"]({ ...b2, "rectangle": parseRectangle(b2["rectangle"]) });
  }
  ["_createImageryProvider"](b2) {
    return _WmsLayer["createImageryProvider"](b2);
  }
  async ["_addHooks"]() {
    a$d["defaultValue"](this["options"]["getCapabilities"], !![]) ? (await this["getMetadata"](), await super["_addHooks"]()) : await super["_addHooks"]();
  }
  ["_initByMetaData"](b2) {
    let c2 = this["options"]["layers"];
    c2["includes"](":") && (c2 = c2["split"](":")[1]);
    const d2 = this["_readChildNode"](b2, "Layer"), e2 = d2 == null ? void 0 : d2["getElementsByTagName"]("Layer");
    if (e2 == null ? void 0 : e2["length"]) for (let f2 = 0, g2 = e2["length"]; f2 < g2; f2++) {
      const h2 = e2[f2], j2 = this["_readChildNodeVal"](h2, "Name");
      if (j2 == c2) {
        const k2 = this["_readChildNodeVal"](h2, "CRS");
        !this["options"]["crs"] && k2 && (this["options"]["crs"] = k2);
        const l2 = this["_readChildNode"](h2, "BoundingBox");
        if (!this["options"]["rectangle"] && l2) {
          const m2 = Number(l2["getAttribute"]("minx")), n2 = Number(l2["getAttribute"]("miny")), o2 = Number(l2["getAttribute"]("maxx")), p2 = Number(l2["getAttribute"]("maxy")), q2 = { "xmin": m2, "ymin": n2, "xmax": o2, "ymax": p2 };
          this["options"]["extent"] = q2, this["_rectangle"] = a$d["Rectangle"]["fromDegrees"](q2["xmin"], q2["ymin"], q2["xmax"], q2["ymax"]);
        }
        break;
      }
    }
  }
  ["_readChildNode"](b2, c2) {
    if (!b2 || !c2) return null;
    const d2 = b2["getElementsByTagName"](c2);
    return d2["length"] > 0 ? d2[0] : null;
  }
  ["_readChildNodeVal"](b2, c2) {
    if (!b2 || !c2) return null;
    const d2 = this["_readChildNode"](b2, c2);
    if (d2 == null ? void 0 : d2["innerHTML"]) return d2["innerHTML"];
    else return (d2 == null ? void 0 : d2["getInnerHTML"]) ? d2["getInnerHTML"]() : null;
  }
  ["getMetadata"]() {
    return new Promise((b2, c2) => {
      var _a;
      if (this["capabilities"]) {
        b2(this["capabilities"]);
        return;
      }
      const d2 = { "service": "WMS", "request": "GetCapabilities", "version": "1.3.0" }, e2 = this["options"]["url"];
      (!e2 || typeof e2 != "string") && (handlerError("NOT_THROW", "getMetadata: 请在构造参数中输入url"), b2(void 0)), (_a = a$d["Resource"]["fetchXML"]({ ...this["options"], "url": e2, "queryParameters": d2, "proxy": this["_proxy"] })) == null ? void 0 : _a["then"]((f2) => {
        if (this["state"] == State["DESTROYED"]) return;
        if (f2) {
          this["capabilities"] = f2;
          try {
            this["_initByMetaData"](f2);
          } catch (g2) {
            handlerError("NOT_THROW", "getMetadata: WMS解析GetCapabilities有误", g2);
          }
        }
        b2(f2), this["emit"](EventType["loadMetadata"], { "capabilities": f2 }, !![]);
      })["catch"]((f2) => {
        handlerError("NOT_THROW", "getMetadata: WMS请求出错", f2), b2(void 0);
      });
    });
  }
};
__publicField(_WmsLayer, "EventType", { ...BaseTileLayer["EventType"], ...pick(EventType, ["loadMetadata"]) });
let WmsLayer = _WmsLayer;
const _WmtsLayer = class _WmtsLayer extends BaseTileLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "wmts");
    __publicField(this, "options");
    __publicField(this, "capabilities");
    this["options"] = b2;
  }
  static ["createImageryProvider"](b2) {
    return b2 = converTileLayerOptions(b2), b2["crs"] == CRS["EPSG4490"] && (b2["tileMatrixLabels"] = [...Array["from"]({ "length": 20 })["keys"]()]["map"]((c2) => (c2 + 1)["toString"]())), new a$d["WebMapTileServiceImageryProvider"]({ ...b2, "rectangle": parseRectangle(b2["rectangle"]) });
  }
  ["_createImageryProvider"](b2) {
    return _WmtsLayer["createImageryProvider"](b2);
  }
  async ["_addHooks"]() {
    a$d["defaultValue"](this["options"]["getCapabilities"], !![]) ? (await this["getMetadata"](), await super["_addHooks"]()) : await super["_addHooks"]();
  }
  ["_initByMetaData"](b2) {
    const c2 = this["_readChildNode"](b2, "Contents"), d2 = c2 == null ? void 0 : c2["getElementsByTagName"]("Layer");
    if (d2 == null ? void 0 : d2["length"]) for (let e2 = 0, f2 = d2["length"]; e2 < f2; e2++) {
      const g2 = d2[e2], h2 = this["_readChildNodeVal"](g2, "ows:Identifier");
      if (h2 == this["options"]["layer"] || this["options"]["layer"]["includes"](h2)) {
        const l2 = this["_readChildNode"](g2, "ows:WGS84BoundingBox");
        if (!this["options"]["rectangle"] && l2) {
          let n2 = this["_readChildNodeVal"](l2, "ows:LowerCorner"), o2 = this["_readChildNodeVal"](l2, "ows:UpperCorner");
          if (n2 && o2) {
            n2 = n2["split"](" "), o2 = o2["split"](" ");
            const p2 = Number(n2[0]), q2 = Number(n2[1]), r2 = Number(o2[0]), s2 = Number(o2[1]), t2 = { "xmin": p2, "ymin": q2, "xmax": r2, "ymax": s2 };
            this["options"]["extent"] = t2, this["_rectangle"] = a$d["Rectangle"]["fromDegrees"](t2["xmin"], t2["ymin"], t2["xmax"], t2["ymax"]);
          }
        }
        !a$d["defined"](this["options"]["style"]) && (this["options"]["style"] = this["_readChildNodeVal"](this["_readChildNode"](g2, "Style"), "ows:Identifier"));
        const m2 = g2["getElementsByTagName"]("TileMatrixSetLink");
        for (let u2 = 0, v2 = m2["length"]; u2 < v2; u2++) {
          const w2 = m2[u2], x2 = this["_readChildNodeVal"](w2, "TileMatrixSet");
          !a$d["defined"](this["options"]["tileMatrixSetID"]) && (this["options"]["tileMatrixSetID"] = x2);
          if (x2 == this["options"]["tileMatrixSetID"]) {
            if (!this["options"]["tileMatrixLabels"]) {
              const y2 = this["_readChildNode"](w2, "TileMatrixSetLimits"), z2 = y2 == null ? void 0 : y2["getElementsByTagName"]("TileMatrixLimits"), A5 = [];
              if (z2 == null ? void 0 : z2["length"]) for (let B2 = 0, C2 = z2["length"]; B2 < C2; B2++) {
                const D2 = this["_readChildNodeVal"](z2[B2], "TileMatrix");
                A5["push"](D2);
              }
              this["options"]["tileMatrixLabels"] = A5;
            }
            break;
          }
        }
        break;
      }
    }
  }
  ["_readChildNode"](b2, c2) {
    if (!b2 || !c2) return void 0;
    const d2 = b2["getElementsByTagName"](c2);
    return d2["length"] > 0 ? d2[0] : void 0;
  }
  ["_readChildNodeVal"](b2, c2) {
    if (!b2 || !c2) return void 0;
    const d2 = this["_readChildNode"](b2, c2);
    if (d2 == null ? void 0 : d2["innerHTML"]) return d2["innerHTML"];
    else return (d2 == null ? void 0 : d2["getInnerHTML"]) ? d2["getInnerHTML"]() : void 0;
  }
  ["getMetadata"]() {
    return new Promise((b2, c2) => {
      var _a;
      if (this["capabilities"]) {
        b2(this["capabilities"]);
        return;
      }
      const d2 = { "service": "WMTS", "request": "GetCapabilities", "version": "1.0.0" }, e2 = this["options"]["url"];
      (!e2 || typeof e2 != "string") && (handlerError("NOT_THROW", "getMetadata: 请在构造参数中输入url"), b2(void 0)), (_a = a$d["Resource"]["fetchXML"]({ ...this["options"], "url": e2, "queryParameters": d2, "proxy": this["_proxy"] })) == null ? void 0 : _a["then"]((f2) => {
        if (this["state"] == State["DESTROYED"]) return;
        if (f2) {
          this["capabilities"] = f2;
          try {
            this["_initByMetaData"](f2);
          } catch (g2) {
            handlerError("NOT_THROW", "getMetadata: WMTS解析GetCapabilities有误", g2);
          }
        }
        b2(f2), this["emit"](EventType["loadMetadata"], { "capabilities": f2 }, !![]);
      })["catch"]((f2) => {
        handlerError("NOT_THROW", "getMetadata: WMTS请求出错", f2), b2(void 0);
      });
    });
  }
};
__publicField(_WmtsLayer, "EventType", { ...BaseTileLayer["EventType"], ...pick(EventType, ["loadMetadata"]) });
let WmtsLayer = _WmtsLayer;
class XyzLayer extends BaseTileLayer {
  constructor(b2) {
    super(b2);
    __publicField(this, "_type", "xyz");
    __publicField(this, "options");
    this["options"] = b2;
  }
  static ["createImageryProvider"](b2) {
    return b2 = converTileLayerOptions(b2), b2["customTags"] = b2["customTags"] || {}, b2["customTags"]["host"] = function(c2, d2, e2, f2) {
      return location["host"];
    }, b2["customTags"]["hostname"] = function(c2, d2, e2, f2) {
      return location["hostname"];
    }, b2["customTags"]["z4490"] = function(c2, d2, e2, f2) {
      return f2 + 1;
    }, new a$d["UrlTemplateImageryProvider"]({ ...b2, "rectangle": parseRectangle(b2["rectangle"]) });
  }
  ["_createImageryProvider"](b2) {
    return XyzLayer["createImageryProvider"](b2);
  }
}
const LayerType = { "terrain": TerrainLayer, "wms": WmsLayer, "wmts": WmtsLayer, "image": ImageLayer, "xyz": XyzLayer, "tileset": TilesetLayer, "geojson": GeojsonLayer, "group": GroupLayer, "colorPatternGrid": ColorPatternGridLayer, "colorPatternGradient": ColorPatternGradientLayer, "heat": HeatLayer, "graphic": GraphicLayer };
const LifeCycleState = { "INITED": "inited", "ADDED": "added", "REMOVED": "removed", "DESTROYED": "destroyed" };
const MaterialType = { "Color": a$d["Material"]["ColorType"], "Image": a$d["Material"]["ImageType"], "Grid": a$d["Material"]["GridType"], "Checkerboard": a$d["Material"]["CheckerboardType"], "Stripe": a$d["Material"]["StripeType"], "Image2": "Image2", "Water": a$d["Material"]["WaterType"], "PolylineDash": a$d["Material"]["PolylineDashType"], "PolylineOutline": a$d["Material"]["PolylineOutlineType"], "PolylineArrow": a$d["Material"]["PolylineArrowType"], "PolylineGlow": a$d["Material"]["PolylineGlowType"], "LineFlow": "LineFlow", "LineFlowColor": "LineFlowColor", "ODLine": "ODLine", "LineFlicker": "LineFlicker", "LineTrail": "LineTrail", "WallScroll": "WallScroll", "ScanLine": "ScanLine", "CircleScan": "CircleScan", "CircleWave": "CircleWave", "RadarLine": "RadarLine", "RadarWave": "RadarWave", "Text": "Text", "RectSlide": "RectSlide", "PolyGradient": "PolyGradient", "PolyAsphalt": "PolyAsphalt", "PolyBlob": "PolyBlob", "PolyFacet": "PolyFacet", "PolyGrass": "PolyGrass", "PolyWood": "PolyWood", "EllipsoidElectric": "EllipsoidElectric", "EllipsoidWave": "EllipsoidWave", "CylinderWave": "CylinderWave", "ColorPatternGradient": "ColorPatternGradient", "Heat": "Heat" };
const MoveType = { "ENLARGE": 0, "NARROW": 1, "LEFT_ROTATE": 2, "RIGHT_ROTATE": 3, "TOP_ROTATE": 4, "BOTTOM_ROTATE": 5 };
const TerrainType = { "ELLIPSOID": "ellipsoid", "XYZ": "xyz", "ION": "ion", "VR": "vr", "ARCGIS": "arcgis" };
const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  CRS,
  ChinaCRS,
  ClipType,
  CustomShaderType,
  EffectType,
  EventType,
  LayerType,
  LifeCycleState,
  MaterialType,
  MoveType,
  State,
  TerrainType
}, Symbol.toStringTag, { value: "Module" }));
class LatLngArray {
  static ["toCartesians"](b2, c2) {
    if (!Array["isArray"](b2)) return b2;
    const d2 = [];
    return b2["forEach"]((e2) => {
      if (e2 instanceof a$d["Cartesian3"] && !c2) {
        d2["push"](e2);
        return;
      }
      const f2 = LatLngPoint["parse"](e2);
      if (!f2 || !f2["valid"]()) return;
      d2["push"](f2["toCartesian"]());
    }), d2;
  }
  static ["toPoints"](b2) {
    if (!Array["isArray"](b2)) return b2;
    const c2 = [];
    return b2["forEach"]((d2) => {
      if (d2 instanceof LatLngPoint) {
        c2["push"](d2);
        return;
      }
      const e2 = LatLngPoint["parse"](d2);
      if (!e2 || !e2["valid"]()) return;
      c2["push"](e2);
    }), c2;
  }
  static ["toArray"](b2, c2) {
    if (!Array["isArray"](b2)) return b2;
    const d2 = [];
    return b2["forEach"]((e2) => {
      if (Array["isArray"](e2)) {
        d2["push"](e2);
        return;
      }
      const f2 = LatLngPoint["parse"](e2);
      if (!f2 || !f2["valid"]()) return;
      d2["push"](f2["toArray"](c2));
    }), d2;
  }
}
var geojsonNormalize = normalize, types = { "Point": "geometry", "MultiPoint": "geometry", "LineString": "geometry", "MultiLineString": "geometry", "Polygon": "geometry", "MultiPolygon": "geometry", "GeometryCollection": "geometry", "Feature": "feature", "FeatureCollection": "featurecollection" };
function normalize(b2) {
  if (!b2 || !b2["type"]) return null;
  var c2 = types[b2["type"]];
  if (!c2) return null;
  if (c2 === "geometry") return { "type": "FeatureCollection", "features": [{ "type": "Feature", "properties": {}, "geometry": b2 }] };
  else {
    if (c2 === "feature") return { "type": "FeatureCollection", "features": [b2] };
    else {
      if (c2 === "featurecollection") return b2;
    }
  }
}
const a$b = getDefaultExportFromCjs(geojsonNormalize);
function getColorRampLegend(a2, b2 = "linear") {
  var _a;
  const c2 = document["createElement"]("canvas"), e2 = c2["getContext"]("2d");
  if (!e2) return;
  const f2 = 256 / a2["length"], g2 = "10px serif", h2 = "white";
  let j2 = 256, k2 = 20, l2 = ![];
  const m2 = Math["PI"] / 4;
  a2["sort"]((n2, o2) => {
    return n2["value"] - o2["value"];
  });
  for (let n2 = 0; n2 < a2["length"]; n2++) {
    e2["font"] = g2;
    const o2 = a2[n2]["value"]["toString"](), p2 = e2["measureText"](o2)["width"];
    l2 = p2 > f2;
    if (l2) {
      j2 = 270, k2 = 45;
      break;
    }
  }
  c2["width"] = j2, c2["height"] = k2;
  if (b2 === "linear") {
    const q2 = e2["createLinearGradient"](0, 0, 256, 0), r2 = a2[0]["value"], s2 = ((_a = a2["at"](-1)) == null ? void 0 : _a["value"]) ?? 0;
    a2["forEach"]((t2) => {
      const { value: u2, color: v2 } = t2;
      q2["addColorStop"]((u2 - r2) / (s2 - r2), v2);
    }), e2["fillStyle"] = q2, e2["fillRect"](0, 0, j2, 8);
  }
  for (let t2 = 0; t2 < a2["length"]; t2++) {
    b2 === "block" && (e2["fillStyle"] = a2[t2]["color"], e2["fillRect"](t2 * f2, 0, f2, 8));
    if (t2 < a2["length"]) {
      e2["save"]();
      let u2 = (t2 + 1) * f2 - 10, v2 = 18;
      const w2 = a2[t2]["value"]["toString"]();
      let x2 = 0;
      if (l2) e2["translate"](u2, v2), e2["rotate"](m2), u2 = 0, v2 = 0, x2 = 5;
      else {
        const y2 = e2["measureText"](w2)["width"];
        x2 = y2 / 2;
      }
      a2["length"] > 20 ? t2 % 3 == 0 && (e2["fillStyle"] = h2, e2["font"] = g2, e2["fillText"](w2, u2 - x2, v2)) : (e2["fillStyle"] = h2, e2["font"] = g2, e2["fillText"](w2, u2 - x2, v2)), e2["restore"]();
    }
  }
  return { "ctx": e2, "canvas": c2, "image": c2["toDataURL"]("image/png") };
}
function getRampValueColor(c2, d2, e2, f2) {
  const h2 = c2["getImageData"](Math["floor"](256 * (d2 / (f2 - e2))), 1, 1, 1), i2 = h2["data"], j2 = i2[0], k2 = i2[1], l2 = i2[2];
  let m2 = i2[3] / 255;
  m2 = Math["round"](m2 * 100) / 100;
  let n2 = j2["toString"](16);
  j2 < 16 && (n2 = "0" + n2);
  let o2 = k2["toString"](16);
  k2 < 16 && (o2 = "0" + o2);
  let p2 = l2["toString"](16);
  l2 < 16 && (p2 = "0" + p2);
  const q2 = "rgba(" + j2 + "," + k2 + "," + l2 + "," + m2 + ")", s2 = "rgb(" + j2 + "," + k2 + "," + l2 + ")", t2 = "#" + n2 + o2 + p2;
  return { "rgba": q2, "rgb": s2, "hex": t2, "r": j2, "g": k2, "b": l2, "a": m2 };
}
function a$a(defs2) {
  defs2("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), defs2("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), defs2("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"), defs2["WGS84"] = defs2["EPSG:4326"], defs2["EPSG:3785"] = defs2["EPSG:3857"], defs2["GOOGLE"] = defs2["EPSG:3857"], defs2["EPSG:900913"] = defs2["EPSG:3857"], defs2["EPSG:102113"] = defs2["EPSG:3857"];
}
var PJD_3PARAM = 1;
var PJD_7PARAM = 2;
var PJD_GRIDSHIFT = 3;
var PJD_WGS84 = 4;
var PJD_NODATUM = 5;
var SRS_WGS84_SEMIMAJOR = 6378137;
var SRS_WGS84_SEMIMINOR = 6356752314e-3;
var SRS_WGS84_ESQUARED = 0.0066943799901413165;
var SEC_TO_RAD = 484813681109536e-20;
var HALF_PI = Math["PI"] / 2;
var SIXTH = 0.16666666666666666;
var RA4 = 0.04722222222222222;
var RA6 = 0.022156084656084655;
var EPSLN = 1e-10;
var D2R$1 = 0.017453292519943295;
var R2D = 57.29577951308232;
var FORTPI = Math["PI"] / 4;
var TWO_PI = Math["PI"] * 2;
var SPI = 3.14159265359;
var exports$2 = {};
exports$2["greenwich"] = 0, exports$2["lisbon"] = -9.131906111111, exports$2["paris"] = 2.337229166667, exports$2["bogota"] = -74.080916666667, exports$2["madrid"] = -3.687938888889, exports$2["rome"] = 12.452333333333, exports$2["bern"] = 7.439583333333, exports$2["jakarta"] = 106.807719444444, exports$2["ferro"] = -17.666666666667, exports$2["brussels"] = 4.367975, exports$2["stockholm"] = 18.058277777778, exports$2["athens"] = 23.7163375, exports$2["oslo"] = 10.722916666667;
const b$d = { "ft": { "to_meter": 0.3048 }, "us-ft": { "to_meter": 1200 / 3937 } };
var ignoredChar = /[\s_\-\/\(\)]/g;
function match(a2, b2) {
  if (a2[b2]) return a2[b2];
  var c2 = Object["keys"](a2), d2 = b2["toLowerCase"]()["replace"](ignoredChar, ""), e2 = -1, f2, g2;
  while (++e2 < c2["length"]) {
    f2 = c2[e2], g2 = f2["toLowerCase"]()["replace"](ignoredChar, "");
    if (g2 === d2) return a2[f2];
  }
}
function c$4(defData) {
  var self2 = {}, paramObj = defData["split"]("+")["map"](function(v2) {
    return v2["trim"]();
  })["filter"](function(a2) {
    return a2;
  })["reduce"](function(p2, a2) {
    var split = a2["split"]("=");
    return split["push"](!![]), p2[split[0]["toLowerCase"]()] = split[1], p2;
  }, {}), paramName, paramVal, paramOutname, params2 = { "proj": "projName", "datum": "datumCode", "rf": function(v2) {
    self2["rf"] = parseFloat(v2);
  }, "lat_0": function(v2) {
    self2["lat0"] = v2 * D2R$1;
  }, "lat_1": function(v2) {
    self2["lat1"] = v2 * D2R$1;
  }, "lat_2": function(v2) {
    self2["lat2"] = v2 * D2R$1;
  }, "lat_ts": function(v2) {
    self2["lat_ts"] = v2 * D2R$1;
  }, "lon_0": function(v2) {
    self2["long0"] = v2 * D2R$1;
  }, "lon_1": function(v2) {
    self2["long1"] = v2 * D2R$1;
  }, "lon_2": function(v2) {
    self2["long2"] = v2 * D2R$1;
  }, "alpha": function(v2) {
    self2["alpha"] = parseFloat(v2) * D2R$1;
  }, "gamma": function(v2) {
    self2["rectified_grid_angle"] = parseFloat(v2);
  }, "lonc": function(v2) {
    self2["longc"] = v2 * D2R$1;
  }, "x_0": function(v2) {
    self2["x0"] = parseFloat(v2);
  }, "y_0": function(v2) {
    self2["y0"] = parseFloat(v2);
  }, "k_0": function(v2) {
    self2["k0"] = parseFloat(v2);
  }, "k": function(v2) {
    self2["k0"] = parseFloat(v2);
  }, "a": function(v2) {
    self2["a"] = parseFloat(v2);
  }, "b": function(v2) {
    self2["b"] = parseFloat(v2);
  }, "r": function(v2) {
    self2["a"] = self2["b"] = parseFloat(v2);
  }, "r_a": function() {
    self2["R_A"] = !![];
  }, "zone": function(v2) {
    self2["zone"] = parseInt(v2, 10);
  }, "south": function() {
    self2["utmSouth"] = !![];
  }, "towgs84": function(v2) {
    self2["datum_params"] = v2["split"](",")["map"](function(a2) {
      return parseFloat(a2);
    });
  }, "to_meter": function(v2) {
    self2["to_meter"] = parseFloat(v2);
  }, "units": function(v2) {
    self2["units"] = v2;
    var unit = match(b$d, v2);
    unit && (self2["to_meter"] = unit["to_meter"]);
  }, "from_greenwich": function(v2) {
    self2["from_greenwich"] = v2 * D2R$1;
  }, "pm": function(v2) {
    var pm = match(exports$2, v2);
    self2["from_greenwich"] = (pm ? pm : parseFloat(v2)) * D2R$1;
  }, "nadgrids": function(v2) {
    v2 === "@null" ? self2["datumCode"] = "none" : self2["nadgrids"] = v2;
  }, "axis": function(v2) {
    var legalAxis = "ewnsud";
    v2["length"] === 3 && legalAxis["indexOf"](v2["substr"](0, 1)) !== -1 && legalAxis["indexOf"](v2["substr"](1, 1)) !== -1 && legalAxis["indexOf"](v2["substr"](2, 1)) !== -1 && (self2["axis"] = v2);
  }, "approx": function() {
    self2["approx"] = !![];
  } };
  for (paramName in paramObj) {
    paramVal = paramObj[paramName], paramName in params2 ? (paramOutname = params2[paramName], typeof paramOutname === "function" ? paramOutname(paramVal) : self2[paramOutname] = paramVal) : self2[paramName] = paramVal;
  }
  return typeof self2["datumCode"] === "string" && self2["datumCode"] !== "WGS84" && (self2["datumCode"] = self2["datumCode"]["toLowerCase"]()), self2;
}
var NEUTRAL = 1, KEYWORD = 2, NUMBER = 3, QUOTED = 4, AFTERQUOTE = 5, ENDED = -1, whitespace = /\s/, latin = /[A-Za-z]/, keyword = /[A-Za-z84_]/, endThings = /[,\]]/, digets = /[\d\.E\-\+]/;
function Parser(a2) {
  if (typeof a2 !== "string") throw new Error("not a string");
  this["text"] = a2["trim"](), this["level"] = 0, this["place"] = 0, this["root"] = null, this["stack"] = [], this["currentObject"] = null, this["state"] = NEUTRAL;
}
Parser["prototype"]["readCharicter"] = function() {
  var a2 = this["text"][this["place"]++];
  if (this["state"] !== QUOTED) while (whitespace["test"](a2)) {
    if (this["place"] >= this["text"]["length"]) return;
    a2 = this["text"][this["place"]++];
  }
  switch (this["state"]) {
    case NEUTRAL:
      return this["neutral"](a2);
    case KEYWORD:
      return this["keyword"](a2);
    case QUOTED:
      return this["quoted"](a2);
    case AFTERQUOTE:
      return this["afterquote"](a2);
    case NUMBER:
      return this["number"](a2);
    case ENDED:
      return;
  }
}, Parser["prototype"]["afterquote"] = function(a2) {
  if (a2 === '"') {
    this["word"] += '"', this["state"] = QUOTED;
    return;
  }
  if (endThings["test"](a2)) {
    this["word"] = this["word"]["trim"](), this["afterItem"](a2);
    return;
  }
  throw new Error(`havn't handled "` + a2 + '" in afterquote yet, index ' + this["place"]);
}, Parser["prototype"]["afterItem"] = function(a2) {
  if (a2 === ",") {
    this["word"] !== null && this["currentObject"]["push"](this["word"]);
    this["word"] = null, this["state"] = NEUTRAL;
    return;
  }
  if (a2 === "]") {
    this["level"]--;
    this["word"] !== null && (this["currentObject"]["push"](this["word"]), this["word"] = null);
    this["state"] = NEUTRAL, this["currentObject"] = this["stack"]["pop"]();
    !this["currentObject"] && (this["state"] = ENDED);
    return;
  }
}, Parser["prototype"]["number"] = function(a2) {
  if (digets["test"](a2)) {
    this["word"] += a2;
    return;
  }
  if (endThings["test"](a2)) {
    this["word"] = parseFloat(this["word"]), this["afterItem"](a2);
    return;
  }
  throw new Error(`havn't handled "` + a2 + '" in number yet, index ' + this["place"]);
}, Parser["prototype"]["quoted"] = function(a2) {
  if (a2 === '"') {
    this["state"] = AFTERQUOTE;
    return;
  }
  this["word"] += a2;
  return;
}, Parser["prototype"]["keyword"] = function(a2) {
  if (keyword["test"](a2)) {
    this["word"] += a2;
    return;
  }
  if (a2 === "[") {
    var b2 = [];
    b2["push"](this["word"]), this["level"]++;
    this["root"] === null ? this["root"] = b2 : this["currentObject"]["push"](b2);
    this["stack"]["push"](this["currentObject"]), this["currentObject"] = b2, this["state"] = NEUTRAL;
    return;
  }
  if (endThings["test"](a2)) {
    this["afterItem"](a2);
    return;
  }
  throw new Error(`havn't handled "` + a2 + '" in keyword yet, index ' + this["place"]);
}, Parser["prototype"]["neutral"] = function(a2) {
  if (latin["test"](a2)) {
    this["word"] = a2, this["state"] = KEYWORD;
    return;
  }
  if (a2 === '"') {
    this["word"] = "", this["state"] = QUOTED;
    return;
  }
  if (digets["test"](a2)) {
    this["word"] = a2, this["state"] = NUMBER;
    return;
  }
  if (endThings["test"](a2)) {
    this["afterItem"](a2);
    return;
  }
  throw new Error(`havn't handled "` + a2 + '" in neutral yet, index ' + this["place"]);
}, Parser["prototype"]["output"] = function() {
  while (this["place"] < this["text"]["length"]) {
    this["readCharicter"]();
  }
  if (this["state"] === ENDED) return this["root"];
  throw new Error('unable to parse string "' + this["text"] + '". State is ' + this["state"]);
};
function parseString(a2) {
  var b2 = new Parser(a2);
  return b2["output"]();
}
function mapit(a2, b2, c2) {
  Array["isArray"](b2) && (c2["unshift"](b2), b2 = null);
  var d2 = b2 ? {} : a2, e2 = c2["reduce"](function(f2, g2) {
    return sExpr(g2, f2), f2;
  }, d2);
  b2 && (a2[b2] = e2);
}
function sExpr(a2, b2) {
  if (!Array["isArray"](a2)) {
    b2[a2] = !![];
    return;
  }
  var c2 = a2["shift"]();
  c2 === "PARAMETER" && (c2 = a2["shift"]());
  if (a2["length"] === 1) {
    if (Array["isArray"](a2[0])) {
      b2[c2] = {}, sExpr(a2[0], b2[c2]);
      return;
    }
    b2[c2] = a2[0];
    return;
  }
  if (!a2["length"]) {
    b2[c2] = !![];
    return;
  }
  if (c2 === "TOWGS84") {
    b2[c2] = a2;
    return;
  }
  if (c2 === "AXIS") {
    !(c2 in b2) && (b2[c2] = []);
    b2[c2]["push"](a2);
    return;
  }
  !Array["isArray"](c2) && (b2[c2] = {});
  var d2;
  switch (c2) {
    case "UNIT":
    case "PRIMEM":
    case "VERT_DATUM":
      b2[c2] = { "name": a2[0]["toLowerCase"](), "convert": a2[1] };
      a2["length"] === 3 && sExpr(a2[2], b2[c2]);
      return;
    case "SPHEROID":
    case "ELLIPSOID":
      b2[c2] = { "name": a2[0], "a": a2[1], "rf": a2[2] };
      a2["length"] === 4 && sExpr(a2[3], b2[c2]);
      return;
    case "PROJECTEDCRS":
    case "PROJCRS":
    case "GEOGCS":
    case "GEOCCS":
    case "PROJCS":
    case "LOCAL_CS":
    case "GEODCRS":
    case "GEODETICCRS":
    case "GEODETICDATUM":
    case "EDATUM":
    case "ENGINEERINGDATUM":
    case "VERT_CS":
    case "VERTCRS":
    case "VERTICALCRS":
    case "COMPD_CS":
    case "COMPOUNDCRS":
    case "ENGINEERINGCRS":
    case "ENGCRS":
    case "FITTED_CS":
    case "LOCAL_DATUM":
    case "DATUM":
      a2[0] = ["name", a2[0]], mapit(b2, c2, a2);
      return;
    default:
      d2 = -1;
      while (++d2 < a2["length"]) {
        if (!Array["isArray"](a2[d2])) return sExpr(a2, b2[c2]);
      }
      return mapit(b2, c2, a2);
  }
}
var D2R = 0.017453292519943295;
function rename(b2, c2) {
  var d2 = c2[0], e2 = c2[1];
  !(d2 in b2) && e2 in b2 && (b2[d2] = b2[e2], c2["length"] === 3 && (b2[d2] = c2[2](b2[d2])));
}
function d2r(b2) {
  return b2 * D2R;
}
function cleanWKT(b2) {
  if (b2["type"] === "GEOGCS") b2["projName"] = "longlat";
  else b2["type"] === "LOCAL_CS" ? (b2["projName"] = "identity", b2["local"] = !![]) : typeof b2["PROJECTION"] === "object" ? b2["projName"] = Object["keys"](b2["PROJECTION"])[0] : b2["projName"] = b2["PROJECTION"];
  if (b2["AXIS"]) {
    var c2 = "";
    for (var d2 = 0, e2 = b2["AXIS"]["length"]; d2 < e2; ++d2) {
      var f2 = [b2["AXIS"][d2][0]["toLowerCase"](), b2["AXIS"][d2][1]["toLowerCase"]()];
      if (f2[0]["indexOf"]("north") !== -1 || (f2[0] === "y" || f2[0] === "lat") && f2[1] === "north") c2 += "n";
      else {
        if (f2[0]["indexOf"]("south") !== -1 || (f2[0] === "y" || f2[0] === "lat") && f2[1] === "south") c2 += "s";
        else {
          if (f2[0]["indexOf"]("east") !== -1 || (f2[0] === "x" || f2[0] === "lon") && f2[1] === "east") c2 += "e";
          else (f2[0]["indexOf"]("west") !== -1 || (f2[0] === "x" || f2[0] === "lon") && f2[1] === "west") && (c2 += "w");
        }
      }
    }
    c2["length"] === 2 && (c2 += "u"), c2["length"] === 3 && (b2["axis"] = c2);
  }
  b2["UNIT"] && (b2["units"] = b2["UNIT"]["name"]["toLowerCase"](), b2["units"] === "metre" && (b2["units"] = "meter"), b2["UNIT"]["convert"] && (b2["type"] === "GEOGCS" ? b2["DATUM"] && b2["DATUM"]["SPHEROID"] && (b2["to_meter"] = b2["UNIT"]["convert"] * b2["DATUM"]["SPHEROID"]["a"]) : b2["to_meter"] = b2["UNIT"]["convert"]));
  var g2 = b2["GEOGCS"];
  b2["type"] === "GEOGCS" && (g2 = b2);
  g2 && (g2["DATUM"] ? b2["datumCode"] = g2["DATUM"]["name"]["toLowerCase"]() : b2["datumCode"] = g2["name"]["toLowerCase"](), b2["datumCode"]["slice"](0, 2) === "d_" && (b2["datumCode"] = b2["datumCode"]["slice"](2)), (b2["datumCode"] === "new_zealand_geodetic_datum_1949" || b2["datumCode"] === "new_zealand_1949") && (b2["datumCode"] = "nzgd49"), (b2["datumCode"] === "wgs_1984" || b2["datumCode"] === "world_geodetic_system_1984") && (b2["PROJECTION"] === "Mercator_Auxiliary_Sphere" && (b2["sphere"] = !![]), b2["datumCode"] = "wgs84"), b2["datumCode"]["slice"](-6) === "_ferro" && (b2["datumCode"] = b2["datumCode"]["slice"](0, -6)), b2["datumCode"]["slice"](-8) === "_jakarta" && (b2["datumCode"] = b2["datumCode"]["slice"](0, -8)), ~b2["datumCode"]["indexOf"]("belge") && (b2["datumCode"] = "rnb72"), g2["DATUM"] && g2["DATUM"]["SPHEROID"] && (b2["ellps"] = g2["DATUM"]["SPHEROID"]["name"]["replace"]("_19", "")["replace"](/[Cc]larke\_18/, "clrk"), b2["ellps"]["toLowerCase"]()["slice"](0, 13) === "international" && (b2["ellps"] = "intl"), b2["a"] = g2["DATUM"]["SPHEROID"]["a"], b2["rf"] = parseFloat(g2["DATUM"]["SPHEROID"]["rf"], 10)), g2["DATUM"] && g2["DATUM"]["TOWGS84"] && (b2["datum_params"] = g2["DATUM"]["TOWGS84"]), ~b2["datumCode"]["indexOf"]("osgb_1936") && (b2["datumCode"] = "osgb36"), ~b2["datumCode"]["indexOf"]("osni_1952") && (b2["datumCode"] = "osni52"), (~b2["datumCode"]["indexOf"]("tm65") || ~b2["datumCode"]["indexOf"]("geodetic_datum_of_1965")) && (b2["datumCode"] = "ire65"), b2["datumCode"] === "ch1903+" && (b2["datumCode"] = "ch1903"), ~b2["datumCode"]["indexOf"]("israel") && (b2["datumCode"] = "isr93"));
  b2["b"] && !isFinite(b2["b"]) && (b2["b"] = b2["a"]);
  function h2(l2) {
    var m2 = b2["to_meter"] || 1;
    return l2 * m2;
  }
  var j2 = function(l2) {
    return rename(b2, l2);
  }, k2 = [["standard_parallel_1", "Standard_Parallel_1"], ["standard_parallel_1", "Latitude of 1st standard parallel"], ["standard_parallel_2", "Standard_Parallel_2"], ["standard_parallel_2", "Latitude of 2nd standard parallel"], ["false_easting", "False_Easting"], ["false_easting", "False easting"], ["false-easting", "Easting at false origin"], ["false_northing", "False_Northing"], ["false_northing", "False northing"], ["false_northing", "Northing at false origin"], ["central_meridian", "Central_Meridian"], ["central_meridian", "Longitude of natural origin"], ["central_meridian", "Longitude of false origin"], ["latitude_of_origin", "Latitude_Of_Origin"], ["latitude_of_origin", "Central_Parallel"], ["latitude_of_origin", "Latitude of natural origin"], ["latitude_of_origin", "Latitude of false origin"], ["scale_factor", "Scale_Factor"], ["k0", "scale_factor"], ["latitude_of_center", "Latitude_Of_Center"], ["latitude_of_center", "Latitude_of_center"], ["lat0", "latitude_of_center", d2r], ["longitude_of_center", "Longitude_Of_Center"], ["longitude_of_center", "Longitude_of_center"], ["longc", "longitude_of_center", d2r], ["x0", "false_easting", h2], ["y0", "false_northing", h2], ["long0", "central_meridian", d2r], ["lat0", "latitude_of_origin", d2r], ["lat0", "standard_parallel_1", d2r], ["lat1", "standard_parallel_1", d2r], ["lat2", "standard_parallel_2", d2r], ["azimuth", "Azimuth"], ["alpha", "azimuth", d2r], ["srsCode", "name"]];
  k2["forEach"](j2);
  !b2["long0"] && b2["longc"] && (b2["projName"] === "Albers_Conic_Equal_Area" || b2["projName"] === "Lambert_Azimuthal_Equal_Area") && (b2["long0"] = b2["longc"]);
  if (!b2["lat_ts"] && b2["lat1"] && (b2["projName"] === "Stereographic_South_Pole" || b2["projName"] === "Polar Stereographic (variant B)")) b2["lat0"] = d2r(b2["lat1"] > 0 ? 90 : -90), b2["lat_ts"] = b2["lat1"];
  else !b2["lat_ts"] && b2["lat0"] && b2["projName"] === "Polar_Stereographic" && (b2["lat_ts"] = b2["lat0"], b2["lat0"] = d2r(b2["lat0"] > 0 ? 90 : -90));
}
function b$c(wkt) {
  var lisp = parseString(wkt), type = lisp["shift"](), name = lisp["shift"]();
  lisp["unshift"](["name", name]), lisp["unshift"](["type", type]);
  var obj = {};
  return sExpr(lisp, obj), cleanWKT(obj), obj;
}
function defs(d2) {
  var e2 = this;
  if (arguments["length"] === 2) {
    var f2 = arguments[1];
    typeof f2 === "string" ? f2["charAt"](0) === "+" ? defs[d2] = c$4(arguments[1]) : defs[d2] = b$c(arguments[1]) : defs[d2] = f2;
  } else {
    if (arguments["length"] === 1) {
      if (Array["isArray"](d2)) return d2["map"](function(g2) {
        Array["isArray"](g2) ? defs["apply"](e2, g2) : defs(g2);
      });
      else {
        if (typeof d2 === "string") {
          if (d2 in defs) return defs[d2];
        } else {
          if ("EPSG" in d2) defs["EPSG:" + d2["EPSG"]] = d2;
          else {
            if ("ESRI" in d2) defs["ESRI:" + d2["ESRI"]] = d2;
            else "IAU2000" in d2 ? defs["IAU2000:" + d2["IAU2000"]] = d2 : console["log"](d2);
          }
        }
      }
      return;
    }
  }
}
a$a(defs);
function testObj(e2) {
  return typeof e2 === "string";
}
function testDef(e2) {
  return e2 in defs;
}
var codeWords = ["PROJECTEDCRS", "PROJCRS", "GEOGCS", "GEOCCS", "PROJCS", "LOCAL_CS", "GEODCRS", "GEODETICCRS", "GEODETICDATUM", "ENGCRS", "ENGINEERINGCRS"];
function testWKT(e2) {
  return codeWords["some"](function(f2) {
    return e2["indexOf"](f2) > -1;
  });
}
var codes = ["3857", "900913", "3785", "102113"];
function checkMercator(e2) {
  var f2 = match(e2, "authority");
  if (!f2) return;
  var g2 = match(f2, "epsg");
  return g2 && codes["indexOf"](g2) > -1;
}
function checkProjStr(e2) {
  var f2 = match(e2, "extension");
  if (!f2) return;
  return match(f2, "proj4");
}
function testProj(e2) {
  return e2[0] === "+";
}
function parse(e2) {
  if (testObj(e2)) {
    if (testDef(e2)) return defs[e2];
    if (testWKT(e2)) {
      var f2 = b$c(e2);
      if (checkMercator(f2)) return defs["EPSG:3857"];
      var g2 = checkProjStr(f2);
      if (g2) return c$4(g2);
      return f2;
    }
    if (testProj(e2)) return c$4(e2);
  } else return e2;
}
function b$b(destination, source) {
  destination = destination || {};
  var value, property;
  if (!source) return destination;
  for (property in source) {
    value = source[property], value !== void 0 && (destination[property] = value);
  }
  return destination;
}
function e$6(eccent, sinphi, cosphi) {
  var con = eccent * sinphi;
  return cosphi / Math["sqrt"](1 - con * con);
}
function a$9(x2) {
  return x2 < 0 ? -1 : 1;
}
function b$a(x2) {
  return Math["abs"](x2) <= SPI ? x2 : x2 - a$9(x2) * TWO_PI;
}
function b$9(eccent, phi, sinphi) {
  var con = eccent * sinphi, com = 0.5 * eccent;
  return con = Math["pow"]((1 - con) / (1 + con), com), Math["tan"](0.5 * (HALF_PI - phi)) / con;
}
function e$5(eccent, ts) {
  var eccnth = 0.5 * eccent, con, dphi, phi = HALF_PI - 2 * Math["atan"](ts);
  for (var i2 = 0; i2 <= 15; i2++) {
    con = eccent * Math["sin"](phi), dphi = HALF_PI - 2 * Math["atan"](ts * Math["pow"]((1 - con) / (1 + con), eccnth)) - phi, phi += dphi;
    if (Math["abs"](dphi) <= 1e-10) return phi;
  }
  return -9999;
}
function init$x() {
  var e2 = this["b"] / this["a"];
  this["es"] = 1 - e2 * e2, !("x0" in this) && (this["x0"] = 0), !("y0" in this) && (this["y0"] = 0), this["e"] = Math["sqrt"](this["es"]), this["lat_ts"] ? this["sphere"] ? this["k0"] = Math["cos"](this["lat_ts"]) : this["k0"] = e$6(this["e"], Math["sin"](this["lat_ts"]), Math["cos"](this["lat_ts"])) : !this["k0"] && (this["k"] ? this["k0"] = this["k"] : this["k0"] = 1);
}
function forward$v(e2) {
  var f2 = e2["x"], g2 = e2["y"];
  if (g2 * R2D > 90 && g2 * R2D < -90 && f2 * R2D > 180 && f2 * R2D < -180) return null;
  var h2, i2;
  if (Math["abs"](Math["abs"](g2) - HALF_PI) <= EPSLN) return null;
  else {
    if (this["sphere"]) h2 = this["x0"] + this["a"] * this["k0"] * b$a(f2 - this["long0"]), i2 = this["y0"] + this["a"] * this["k0"] * Math["log"](Math["tan"](FORTPI + 0.5 * g2));
    else {
      var j2 = Math["sin"](g2), k2 = b$9(this["e"], g2, j2);
      h2 = this["x0"] + this["a"] * this["k0"] * b$a(f2 - this["long0"]), i2 = this["y0"] - this["a"] * this["k0"] * Math["log"](k2);
    }
    return e2["x"] = h2, e2["y"] = i2, e2;
  }
}
function inverse$v(e2) {
  var f2 = e2["x"] - this["x0"], g2 = e2["y"] - this["y0"], h2, i2;
  if (this["sphere"]) i2 = HALF_PI - 2 * Math["atan"](Math["exp"](-g2 / (this["a"] * this["k0"])));
  else {
    var j2 = Math["exp"](-g2 / (this["a"] * this["k0"]));
    i2 = e$5(this["e"], j2);
    if (i2 === -9999) return null;
  }
  return h2 = b$a(this["long0"] + f2 / (this["a"] * this["k0"])), e2["x"] = h2, e2["y"] = i2, e2;
}
var names$y = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"];
const a$8 = { "init": init$x, "forward": forward$v, "inverse": inverse$v, "names": names$y };
function init$w() {
}
function identity(a2) {
  return a2;
}
var names$x = ["longlat", "identity"];
const b$8 = { "init": init$w, "forward": identity, "inverse": identity, "names": names$x };
var projs = [a$8, b$8], names$w = {}, projStore = [];
function add(c2, d2) {
  var e2 = projStore["length"];
  if (!c2["names"]) return console["log"](d2), !![];
  return projStore[e2] = c2, c2["names"]["forEach"](function(f2) {
    names$w[f2["toLowerCase"]()] = e2;
  }), this;
}
function get(c2) {
  if (!c2) return ![];
  var d2 = c2["toLowerCase"]();
  if (typeof names$w[d2] !== "undefined" && projStore[names$w[d2]]) return projStore[names$w[d2]];
}
function start() {
  projs["forEach"](add);
}
const c$3 = { "start": start, "add": add, "get": get };
var exports$1 = {};
exports$1["MERIT"] = { "a": 6378137, "rf": 298.257, "ellipseName": "MERIT 1983" }, exports$1["SGS85"] = { "a": 6378136, "rf": 298.257, "ellipseName": "Soviet Geodetic System 85" }, exports$1["GRS80"] = { "a": 6378137, "rf": 298.257222101, "ellipseName": "GRS 1980(IUGG, 1980)" }, exports$1["IAU76"] = { "a": 6378140, "rf": 298.257, "ellipseName": "IAU 1976" }, exports$1["airy"] = { "a": 6377563396e-3, "b": 635625691e-2, "ellipseName": "Airy 1830" }, exports$1["APL4"] = { "a": 6378137, "rf": 298.25, "ellipseName": "Appl. Physics. 1965" }, exports$1["NWL9D"] = { "a": 6378145, "rf": 298.25, "ellipseName": "Naval Weapons Lab., 1965" }, exports$1["mod_airy"] = { "a": 6377340189e-3, "b": 6356034446e-3, "ellipseName": "Modified Airy" }, exports$1["andrae"] = { "a": 637710443e-2, "rf": 300, "ellipseName": "Andrae 1876 (Den., Iclnd.)" }, exports$1["aust_SA"] = { "a": 6378160, "rf": 298.25, "ellipseName": "Australian Natl & S. Amer. 1969" }, exports$1["GRS67"] = { "a": 6378160, "rf": 298.247167427, "ellipseName": "GRS 67(IUGG 1967)" }, exports$1["bessel"] = { "a": 6377397155e-3, "rf": 299.1528128, "ellipseName": "Bessel 1841" }, exports$1["bess_nam"] = { "a": 6377483865e-3, "rf": 299.1528128, "ellipseName": "Bessel 1841 (Namibia)" }, exports$1["clrk66"] = { "a": 63782064e-1, "b": 63565838e-1, "ellipseName": "Clarke 1866" }, exports$1["clrk80"] = { "a": 6378249145e-3, "rf": 293.4663, "ellipseName": "Clarke 1880 mod." }, exports$1["clrk80ign"] = { "a": 63782492e-1, "b": 6356515, "rf": 293.4660213, "ellipseName": "Clarke 1880 (IGN)" }, exports$1["clrk58"] = { "a": 6378293645208759e-9, "rf": 294.2606763692654, "ellipseName": "Clarke 1858" }, exports$1["CPM"] = { "a": 63757387e-1, "rf": 334.29, "ellipseName": "Comm. des Poids et Mesures 1799" }, exports$1["delmbr"] = { "a": 6376428, "rf": 311.5, "ellipseName": "Delambre 1810 (Belgium)" }, exports$1["engelis"] = { "a": 637813605e-2, "rf": 298.2566, "ellipseName": "Engelis 1985" }, exports$1["evrst30"] = { "a": 6377276345e-3, "rf": 300.8017, "ellipseName": "Everest 1830" }, exports$1["evrst48"] = { "a": 6377304063e-3, "rf": 300.8017, "ellipseName": "Everest 1948" }, exports$1["evrst56"] = { "a": 6377301243e-3, "rf": 300.8017, "ellipseName": "Everest 1956" }, exports$1["evrst69"] = { "a": 6377295664e-3, "rf": 300.8017, "ellipseName": "Everest 1969" }, exports$1["evrstSS"] = { "a": 6377298556e-3, "rf": 300.8017, "ellipseName": "Everest (Sabah & Sarawak)" }, exports$1["fschr60"] = { "a": 6378166, "rf": 298.3, "ellipseName": "Fischer (Mercury Datum) 1960" }, exports$1["fschr60m"] = { "a": 6378155, "rf": 298.3, "ellipseName": "Fischer 1960" }, exports$1["fschr68"] = { "a": 6378150, "rf": 298.3, "ellipseName": "Fischer 1968" }, exports$1["helmert"] = { "a": 6378200, "rf": 298.3, "ellipseName": "Helmert 1906" }, exports$1["hough"] = { "a": 6378270, "rf": 297, "ellipseName": "Hough" }, exports$1["intl"] = { "a": 6378388, "rf": 297, "ellipseName": "International 1909 (Hayford)" }, exports$1["kaula"] = { "a": 6378163, "rf": 298.24, "ellipseName": "Kaula 1961" }, exports$1["lerch"] = { "a": 6378139, "rf": 298.257, "ellipseName": "Lerch 1979" }, exports$1["mprts"] = { "a": 6397300, "rf": 191, "ellipseName": "Maupertius 1738" }, exports$1["new_intl"] = { "a": 63781575e-1, "b": 63567722e-1, "ellipseName": "New International 1967" }, exports$1["plessis"] = { "a": 6376523, "rf": 6355863, "ellipseName": "Plessis 1817 (France)" }, exports$1["krass"] = { "a": 6378245, "rf": 298.3, "ellipseName": "Krassovsky, 1942" }, exports$1["SEasia"] = { "a": 6378155, "b": 63567733205e-4, "ellipseName": "Southeast Asia" }, exports$1["walbeck"] = { "a": 6376896, "b": 63558348467e-4, "ellipseName": "Walbeck" }, exports$1["WGS60"] = { "a": 6378165, "rf": 298.3, "ellipseName": "WGS 60" }, exports$1["WGS66"] = { "a": 6378145, "rf": 298.25, "ellipseName": "WGS 66" }, exports$1["WGS7"] = { "a": 6378135, "rf": 298.26, "ellipseName": "WGS 72" };
var WGS84 = exports$1["WGS84"] = { "a": 6378137, "rf": 298.257223563, "ellipseName": "WGS 84" };
exports$1["sphere"] = { "a": 6370997, "b": 6370997, "ellipseName": "Normal Sphere (r=6370997)" };
function eccentricity(c2, d2, f2, g2) {
  var h2 = c2 * c2, i2 = d2 * d2, j2 = (h2 - i2) / h2, k2 = 0;
  g2 ? (c2 *= 1 - j2 * (SIXTH + j2 * (RA4 + j2 * RA6)), h2 = c2 * c2, j2 = 0) : k2 = Math["sqrt"](j2);
  var l2 = (h2 - i2) / i2;
  return { "es": j2, "e": k2, "ep2": l2 };
}
function sphere(c2, d2, e2, f2, g2) {
  if (!c2) {
    var h2 = match(exports$1, f2);
    !h2 && (h2 = WGS84), c2 = h2["a"], d2 = h2["b"], e2 = h2["rf"];
  }
  return e2 && !d2 && (d2 = (1 - 1 / e2) * c2), (e2 === 0 || Math["abs"](c2 - d2) < EPSLN) && (g2 = !![], d2 = c2), { "a": c2, "b": d2, "rf": e2, "sphere": g2 };
}
var exports = {};
exports["wgs84"] = { "towgs84": "0,0,0", "ellipse": "WGS84", "datumName": "WGS84" }, exports["ch1903"] = { "towgs84": "674.374,15.056,405.346", "ellipse": "bessel", "datumName": "swiss" }, exports["ggrs87"] = { "towgs84": "-199.87,74.79,246.62", "ellipse": "GRS80", "datumName": "Greek_Geodetic_Reference_System_1987" }, exports["nad83"] = { "towgs84": "0,0,0", "ellipse": "GRS80", "datumName": "North_American_Datum_1983" }, exports["nad27"] = { "nadgrids": "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat", "ellipse": "clrk66", "datumName": "North_American_Datum_1927" }, exports["potsdam"] = { "towgs84": "598.1,73.7,418.2,0.202,0.045,-2.455,6.7", "ellipse": "bessel", "datumName": "Potsdam Rauenberg 1950 DHDN" }, exports["carthage"] = { "towgs84": "-263.0,6.0,431.0", "ellipse": "clark80", "datumName": "Carthage 1934 Tunisia" }, exports["hermannskogel"] = { "towgs84": "577.326,90.129,463.919,5.137,1.474,5.297,2.4232", "ellipse": "bessel", "datumName": "Hermannskogel" }, exports["militargeographische_institut"] = { "towgs84": "577.326,90.129,463.919,5.137,1.474,5.297,2.4232", "ellipse": "bessel", "datumName": "Militar-Geographische Institut" }, exports["osni52"] = { "towgs84": "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", "ellipse": "airy", "datumName": "Irish National" }, exports["ire65"] = { "towgs84": "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", "ellipse": "mod_airy", "datumName": "Ireland 1965" }, exports["rassadiran"] = { "towgs84": "-133.63,-157.5,-158.62", "ellipse": "intl", "datumName": "Rassadiran" }, exports["nzgd49"] = { "towgs84": "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", "ellipse": "intl", "datumName": "New Zealand Geodetic Datum 1949" }, exports["osgb36"] = { "towgs84": "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", "ellipse": "airy", "datumName": "Airy 1830" }, exports["s_jtsk"] = { "towgs84": "589,76,480", "ellipse": "bessel", "datumName": "S-JTSK (Ferro)" }, exports["beduaram"] = { "towgs84": "-106,-87,188", "ellipse": "clrk80", "datumName": "Beduaram" }, exports["gunung_segara"] = { "towgs84": "-403,684,41", "ellipse": "bessel", "datumName": "Gunung Segara Jakarta" }, exports["rnb72"] = { "towgs84": "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1", "ellipse": "intl", "datumName": "Reseau National Belge 1972" };
function datum(c2, d2, e2, f2, g2, h2, i2) {
  var j2 = {};
  return c2 === void 0 || c2 === "none" ? j2["datum_type"] = PJD_NODATUM : j2["datum_type"] = PJD_WGS84, d2 && (j2["datum_params"] = d2["map"](parseFloat), (j2["datum_params"][0] !== 0 || j2["datum_params"][1] !== 0 || j2["datum_params"][2] !== 0) && (j2["datum_type"] = PJD_3PARAM), j2["datum_params"]["length"] > 3 && ((j2["datum_params"][3] !== 0 || j2["datum_params"][4] !== 0 || j2["datum_params"][5] !== 0 || j2["datum_params"][6] !== 0) && (j2["datum_type"] = PJD_7PARAM, j2["datum_params"][3] *= SEC_TO_RAD, j2["datum_params"][4] *= SEC_TO_RAD, j2["datum_params"][5] *= SEC_TO_RAD, j2["datum_params"][6] = j2["datum_params"][6] / 1e6 + 1))), i2 && (j2["datum_type"] = PJD_GRIDSHIFT, j2["grids"] = i2), j2["a"] = e2, j2["b"] = f2, j2["es"] = g2, j2["ep2"] = h2, j2;
}
var loadedNadgrids = {};
function nadgrid(a2, b2) {
  var c2 = new DataView(b2), d2 = detectLittleEndian(c2), e2 = readHeader(c2, d2), f2 = readSubgrids(c2, e2, d2), g2 = { "header": e2, "subgrids": f2 };
  return loadedNadgrids[a2] = g2, g2;
}
function getNadgrids(a2) {
  if (a2 === void 0) return null;
  var b2 = a2["split"](",");
  return b2["map"](parseNadgridString);
}
function parseNadgridString(a2) {
  if (a2["length"] === 0) return null;
  var b2 = a2[0] === "@";
  b2 && (a2 = a2["slice"](1));
  if (a2 === "null") return { "name": "null", "mandatory": !b2, "grid": null, "isNull": !![] };
  return { "name": a2, "mandatory": !b2, "grid": loadedNadgrids[a2] || null, "isNull": ![] };
}
function secondsToRadians(a2) {
  return a2 / 3600 * Math["PI"] / 180;
}
function detectLittleEndian(a2) {
  var b2 = a2["getInt32"](8, ![]);
  if (b2 === 11) return ![];
  return b2 = a2["getInt32"](8, !![]), b2 !== 11 && console["warn"]("Failed to detect nadgrid endian-ness, defaulting to little-endian"), !![];
}
function readHeader(a2, b2) {
  return { "nFields": a2["getInt32"](8, b2), "nSubgridFields": a2["getInt32"](24, b2), "nSubgrids": a2["getInt32"](40, b2), "shiftType": decodeString(a2, 56, 56 + 8)["trim"](), "fromSemiMajorAxis": a2["getFloat64"](120, b2), "fromSemiMinorAxis": a2["getFloat64"](136, b2), "toSemiMajorAxis": a2["getFloat64"](152, b2), "toSemiMinorAxis": a2["getFloat64"](168, b2) };
}
function decodeString(a2, b2, c2) {
  return String["fromCharCode"]["apply"](null, new Uint8Array(a2["buffer"]["slice"](b2, c2)));
}
function readSubgrids(a2, b2, c2) {
  var d2 = 176, e2 = [];
  for (var f2 = 0; f2 < b2["nSubgrids"]; f2++) {
    var g2 = readGridHeader(a2, d2, c2), h2 = readGridNodes(a2, d2, g2, c2), j2 = Math["round"](1 + (g2["upperLongitude"] - g2["lowerLongitude"]) / g2["longitudeInterval"]), k2 = Math["round"](1 + (g2["upperLatitude"] - g2["lowerLatitude"]) / g2["latitudeInterval"]);
    e2["push"]({ "ll": [secondsToRadians(g2["lowerLongitude"]), secondsToRadians(g2["lowerLatitude"])], "del": [secondsToRadians(g2["longitudeInterval"]), secondsToRadians(g2["latitudeInterval"])], "lim": [j2, k2], "count": g2["gridNodeCount"], "cvs": mapNodes(h2) }), d2 += 176 + g2["gridNodeCount"] * 16;
  }
  return e2;
}
function mapNodes(a2) {
  return a2["map"](function(b2) {
    return [secondsToRadians(b2["longitudeShift"]), secondsToRadians(b2["latitudeShift"])];
  });
}
function readGridHeader(a2, b2, c2) {
  return { "name": decodeString(a2, b2 + 8, b2 + 16)["trim"](), "parent": decodeString(a2, b2 + 24, b2 + 24 + 8)["trim"](), "lowerLatitude": a2["getFloat64"](b2 + 72, c2), "upperLatitude": a2["getFloat64"](b2 + 88, c2), "lowerLongitude": a2["getFloat64"](b2 + 104, c2), "upperLongitude": a2["getFloat64"](b2 + 120, c2), "latitudeInterval": a2["getFloat64"](b2 + 136, c2), "longitudeInterval": a2["getFloat64"](b2 + 152, c2), "gridNodeCount": a2["getInt32"](b2 + 168, c2) };
}
function readGridNodes(a2, b2, c2, d2) {
  var e2 = b2 + 176, f2 = 16, g2 = [];
  for (var h2 = 0; h2 < c2["gridNodeCount"]; h2++) {
    var j2 = { "latitudeShift": a2["getFloat32"](e2 + h2 * f2, d2), "longitudeShift": a2["getFloat32"](e2 + h2 * f2 + 4, d2), "latitudeAccuracy": a2["getFloat32"](e2 + h2 * f2 + 8, d2), "longitudeAccuracy": a2["getFloat32"](e2 + h2 * f2 + 12, d2) };
    g2["push"](j2);
  }
  return g2;
}
function Projection(i2, j2) {
  if (!(this instanceof Projection)) return new Projection(i2);
  j2 = j2 || function(r2) {
    if (r2) throw r2;
  };
  var k2 = parse(i2);
  if (typeof k2 !== "object") {
    j2("Could not parse to valid json: " + i2);
    return;
  }
  var l2 = Projection["projections"]["get"](k2["projName"]);
  if (!l2) {
    j2("Could not get projection name from: " + i2);
    return;
  }
  if (k2["datumCode"] && k2["datumCode"] !== "none") {
    var m2 = match(exports, k2["datumCode"]);
    m2 && (k2["datum_params"] = k2["datum_params"] || (m2["towgs84"] ? m2["towgs84"]["split"](",") : null), k2["ellps"] = m2["ellipse"], k2["datumName"] = m2["datumName"] ? m2["datumName"] : k2["datumCode"]);
  }
  k2["k0"] = k2["k0"] || 1, k2["axis"] = k2["axis"] || "enu", k2["ellps"] = k2["ellps"] || "wgs84", k2["lat1"] = k2["lat1"] || k2["lat0"];
  var n2 = sphere(k2["a"], k2["b"], k2["rf"], k2["ellps"], k2["sphere"]), o2 = eccentricity(n2["a"], n2["b"], n2["rf"], k2["R_A"]), p2 = getNadgrids(k2["nadgrids"]), q2 = k2["datum"] || datum(k2["datumCode"], k2["datum_params"], n2["a"], n2["b"], o2["es"], o2["ep2"], p2);
  b$b(this, k2), b$b(this, l2), this["a"] = n2["a"], this["b"] = n2["b"], this["rf"] = n2["rf"], this["sphere"] = n2["sphere"], this["es"] = o2["es"], this["e"] = o2["e"], this["ep2"] = o2["ep2"], this["datum"] = q2, this["init"](), j2(null, this);
}
Projection["projections"] = c$3, Projection["projections"]["start"]();
function compareDatums(a2, b2) {
  if (a2["datum_type"] !== b2["datum_type"]) return ![];
  else {
    if (a2["a"] !== b2["a"] || Math["abs"](a2["es"] - b2["es"]) > 5e-11) return ![];
    else {
      if (a2["datum_type"] === PJD_3PARAM) return a2["datum_params"][0] === b2["datum_params"][0] && a2["datum_params"][1] === b2["datum_params"][1] && a2["datum_params"][2] === b2["datum_params"][2];
      else return a2["datum_type"] === PJD_7PARAM ? a2["datum_params"][0] === b2["datum_params"][0] && a2["datum_params"][1] === b2["datum_params"][1] && a2["datum_params"][2] === b2["datum_params"][2] && a2["datum_params"][3] === b2["datum_params"][3] && a2["datum_params"][4] === b2["datum_params"][4] && a2["datum_params"][5] === b2["datum_params"][5] && a2["datum_params"][6] === b2["datum_params"][6] : !![];
    }
  }
}
function geodeticToGeocentric(b2, c2, d2) {
  var e2 = b2["x"], f2 = b2["y"], g2 = b2["z"] ? b2["z"] : 0, h2, i2, j2, k2;
  if (f2 < -HALF_PI && f2 > -1.001 * HALF_PI) f2 = -HALF_PI;
  else {
    if (f2 > HALF_PI && f2 < 1.001 * HALF_PI) f2 = HALF_PI;
    else {
      if (f2 < -HALF_PI) return { "x": -Infinity, "y": -Infinity, "z": b2["z"] };
      else {
        if (f2 > HALF_PI) return { "x": Infinity, "y": Infinity, "z": b2["z"] };
      }
    }
  }
  return e2 > Math["PI"] && (e2 -= 2 * Math["PI"]), i2 = Math["sin"](f2), k2 = Math["cos"](f2), j2 = i2 * i2, h2 = d2 / Math["sqrt"](1 - c2 * j2), { "x": (h2 + g2) * k2 * Math["cos"](e2), "y": (h2 + g2) * k2 * Math["sin"](e2), "z": (h2 * (1 - c2) + g2) * i2 };
}
function geocentricToGeodetic(c2, d2, e2, f2) {
  var g2 = 1e-12, h2 = g2 * g2, i2 = 30, j2, k2, l2, m2, n2, o2, q2, r2, s2, t2, u2, v2, w2, x2 = c2["x"], y2 = c2["y"], z2 = c2["z"] ? c2["z"] : 0, A5, B2, C2;
  j2 = Math["sqrt"](x2 * x2 + y2 * y2), k2 = Math["sqrt"](x2 * x2 + y2 * y2 + z2 * z2);
  if (j2 / e2 < g2) {
    A5 = 0;
    if (k2 / e2 < g2) return B2 = HALF_PI, C2 = -f2, { "x": c2["x"], "y": c2["y"], "z": c2["z"] };
  } else A5 = Math["atan2"](y2, x2);
  l2 = z2 / k2, m2 = j2 / k2, n2 = 1 / Math["sqrt"](1 - d2 * (2 - d2) * m2 * m2), r2 = m2 * (1 - d2) * n2, s2 = l2 * n2, w2 = 0;
  do {
    w2++, q2 = e2 / Math["sqrt"](1 - d2 * s2 * s2), C2 = j2 * r2 + z2 * s2 - q2 * (1 - d2 * s2 * s2), o2 = d2 * q2 / (q2 + C2), n2 = 1 / Math["sqrt"](1 - o2 * (2 - o2) * m2 * m2), t2 = m2 * (1 - o2) * n2, u2 = l2 * n2, v2 = u2 * r2 - t2 * s2, r2 = t2, s2 = u2;
  } while (v2 * v2 > h2 && w2 < i2);
  return B2 = Math["atan"](u2 / Math["abs"](t2)), { "x": A5, "y": B2, "z": C2 };
}
function geocentricToWgs84(a2, b2, c2) {
  if (b2 === PJD_3PARAM) return { "x": a2["x"] + c2[0], "y": a2["y"] + c2[1], "z": a2["z"] + c2[2] };
  else {
    if (b2 === PJD_7PARAM) {
      var d2 = c2[0], e2 = c2[1], f2 = c2[2], g2 = c2[3], h2 = c2[4], i2 = c2[5], j2 = c2[6];
      return { "x": j2 * (a2["x"] - i2 * a2["y"] + h2 * a2["z"]) + d2, "y": j2 * (i2 * a2["x"] + a2["y"] - g2 * a2["z"]) + e2, "z": j2 * (-h2 * a2["x"] + g2 * a2["y"] + a2["z"]) + f2 };
    }
  }
}
function geocentricFromWgs84(a2, b2, c2) {
  if (b2 === PJD_3PARAM) return { "x": a2["x"] - c2[0], "y": a2["y"] - c2[1], "z": a2["z"] - c2[2] };
  else {
    if (b2 === PJD_7PARAM) {
      var d2 = c2[0], e2 = c2[1], f2 = c2[2], g2 = c2[3], h2 = c2[4], i2 = c2[5], j2 = c2[6], k2 = (a2["x"] - d2) / j2, l2 = (a2["y"] - e2) / j2, m2 = (a2["z"] - f2) / j2;
      return { "x": k2 + i2 * l2 - h2 * m2, "y": -i2 * k2 + l2 + g2 * m2, "z": h2 * k2 - g2 * l2 + m2 };
    }
  }
}
function checkParams(b2) {
  return b2 === PJD_3PARAM || b2 === PJD_7PARAM;
}
function a$7(source, dest, point) {
  if (compareDatums(source, dest)) return point;
  if (source["datum_type"] === PJD_NODATUM || dest["datum_type"] === PJD_NODATUM) return point;
  var source_a = source["a"], source_es = source["es"];
  if (source["datum_type"] === PJD_GRIDSHIFT) {
    var gridShiftCode = applyGridShift(source, ![], point);
    if (gridShiftCode !== 0) return void 0;
    source_a = SRS_WGS84_SEMIMAJOR, source_es = SRS_WGS84_ESQUARED;
  }
  var dest_a = dest["a"], dest_b = dest["b"], dest_es = dest["es"];
  dest["datum_type"] === PJD_GRIDSHIFT && (dest_a = SRS_WGS84_SEMIMAJOR, dest_b = SRS_WGS84_SEMIMINOR, dest_es = SRS_WGS84_ESQUARED);
  if (source_es === dest_es && source_a === dest_a && !checkParams(source["datum_type"]) && !checkParams(dest["datum_type"])) return point;
  point = geodeticToGeocentric(point, source_es, source_a);
  checkParams(source["datum_type"]) && (point = geocentricToWgs84(point, source["datum_type"], source["datum_params"]));
  checkParams(dest["datum_type"]) && (point = geocentricFromWgs84(point, dest["datum_type"], dest["datum_params"]));
  point = geocentricToGeodetic(point, dest_es, dest_a, dest_b);
  if (dest["datum_type"] === PJD_GRIDSHIFT) {
    var destGridShiftResult = applyGridShift(dest, !![], point);
    if (destGridShiftResult !== 0) return void 0;
  }
  return point;
}
function applyGridShift(b2, c2, d2) {
  if (b2["grids"] === null || b2["grids"]["length"] === 0) return console["log"]("Grid shift grids not found"), -1;
  var e2 = { "x": -d2["x"], "y": d2["y"] }, f2 = { "x": Number["NaN"], "y": Number["NaN"] }, h2 = [];
  v: for (var k2 = 0; k2 < b2["grids"]["length"]; k2++) {
    var l2 = b2["grids"][k2];
    h2["push"](l2["name"]);
    if (l2["isNull"]) {
      f2 = e2;
      break;
    }
    l2["mandatory"];
    if (l2["grid"] === null) {
      if (l2["mandatory"]) return console["log"]("Unable to find mandatory grid '" + l2["name"] + "'"), -1;
      continue;
    }
    var m2 = l2["grid"]["subgrids"];
    for (var n2 = 0, o2 = m2["length"]; n2 < o2; n2++) {
      var p2 = m2[n2], q2 = (Math["abs"](p2["del"][1]) + Math["abs"](p2["del"][0])) / 1e4, r2 = p2["ll"][0] - q2, s2 = p2["ll"][1] - q2, t2 = p2["ll"][0] + (p2["lim"][0] - 1) * p2["del"][0] + q2, u2 = p2["ll"][1] + (p2["lim"][1] - 1) * p2["del"][1] + q2;
      if (s2 > e2["y"] || r2 > e2["x"] || u2 < e2["y"] || t2 < e2["x"]) continue;
      f2 = applySubgridShift(e2, c2, p2);
      if (!isNaN(f2["x"])) break v;
    }
  }
  if (isNaN(f2["x"])) return console["log"]("Failed to find a grid shift table for location '" + -e2["x"] * R2D + " " + e2["y"] * R2D + " tried: '" + h2 + "'"), -1;
  return d2["x"] = -f2["x"], d2["y"] = f2["y"], 0;
}
function applySubgridShift(b2, c2, d2) {
  var e2 = { "x": Number["NaN"], "y": Number["NaN"] };
  if (isNaN(b2["x"])) return e2;
  var f2 = { "x": b2["x"], "y": b2["y"] };
  f2["x"] -= d2["ll"][0], f2["y"] -= d2["ll"][1], f2["x"] = b$a(f2["x"] - Math["PI"]) + Math["PI"];
  var g2 = nadInterpolate(f2, d2);
  if (c2) {
    if (isNaN(g2["x"])) return e2;
    g2["x"] = f2["x"] - g2["x"], g2["y"] = f2["y"] - g2["y"];
    var h2 = 9, j2 = 1e-12, k2, l2;
    do {
      l2 = nadInterpolate(g2, d2);
      if (isNaN(l2["x"])) {
        console["log"]("Inverse grid shift iteration failed, presumably at grid edge.  Using first approximation.");
        break;
      }
      k2 = { "x": f2["x"] - (l2["x"] + g2["x"]), "y": f2["y"] - (l2["y"] + g2["y"]) }, g2["x"] += k2["x"], g2["y"] += k2["y"];
    } while (h2-- && Math["abs"](k2["x"]) > j2 && Math["abs"](k2["y"]) > j2);
    if (h2 < 0) return console["log"]("Inverse grid shift iterator failed to converge."), e2;
    e2["x"] = b$a(g2["x"] + d2["ll"][0]), e2["y"] = g2["y"] + d2["ll"][1];
  } else !isNaN(g2["x"]) && (e2["x"] = b2["x"] + g2["x"], e2["y"] = b2["y"] + g2["y"]);
  return e2;
}
function nadInterpolate(b2, c2) {
  var d2 = { "x": b2["x"] / c2["del"][0], "y": b2["y"] / c2["del"][1] }, e2 = { "x": Math["floor"](d2["x"]), "y": Math["floor"](d2["y"]) }, f2 = { "x": d2["x"] - 1 * e2["x"], "y": d2["y"] - 1 * e2["y"] }, g2 = { "x": Number["NaN"], "y": Number["NaN"] }, h2;
  if (e2["x"] < 0 || e2["x"] >= c2["lim"][0]) return g2;
  if (e2["y"] < 0 || e2["y"] >= c2["lim"][1]) return g2;
  h2 = e2["y"] * c2["lim"][0] + e2["x"];
  var i2 = { "x": c2["cvs"][h2][0], "y": c2["cvs"][h2][1] };
  h2++;
  var j2 = { "x": c2["cvs"][h2][0], "y": c2["cvs"][h2][1] };
  h2 += c2["lim"][0];
  var k2 = { "x": c2["cvs"][h2][0], "y": c2["cvs"][h2][1] };
  h2--;
  var l2 = { "x": c2["cvs"][h2][0], "y": c2["cvs"][h2][1] }, m2 = f2["x"] * f2["y"], n2 = f2["x"] * (1 - f2["y"]), o2 = (1 - f2["x"]) * (1 - f2["y"]), p2 = (1 - f2["x"]) * f2["y"];
  return g2["x"] = o2 * i2["x"] + n2 * j2["x"] + p2 * l2["x"] + m2 * k2["x"], g2["y"] = o2 * i2["y"] + n2 * j2["y"] + p2 * l2["y"] + m2 * k2["y"], g2;
}
function b$7(crs, denorm, point) {
  var xin = point["x"], yin = point["y"], zin = point["z"] || 0, v2, t2, i2, out = {};
  for (i2 = 0; i2 < 3; i2++) {
    if (denorm && i2 === 2 && point["z"] === void 0) continue;
    if (i2 === 0) v2 = xin, "ew"["indexOf"](crs["axis"][i2]) !== -1 ? t2 = "x" : t2 = "y";
    else i2 === 1 ? (v2 = yin, "ns"["indexOf"](crs["axis"][i2]) !== -1 ? t2 = "y" : t2 = "x") : (v2 = zin, t2 = "z");
    switch (crs["axis"][i2]) {
      case "e":
        out[t2] = v2;
        break;
      case "w":
        out[t2] = -v2;
        break;
      case "n":
        out[t2] = v2;
        break;
      case "s":
        out[t2] = -v2;
        break;
      case "u":
        point[t2] !== void 0 && (out["z"] = v2);
        break;
      case "d":
        point[t2] !== void 0 && (out["z"] = -v2);
        break;
      default:
        return null;
    }
  }
  return out;
}
function d$6(array) {
  var out = { "x": array[0], "y": array[1] };
  return array["length"] > 2 && (out["z"] = array[2]), array["length"] > 3 && (out["m"] = array[3]), out;
}
function e$4(point) {
  checkCoord(point["x"]), checkCoord(point["y"]);
}
function checkCoord(a2) {
  if (typeof Number["isFinite"] === "function") {
    if (Number["isFinite"](a2)) return;
    throw new TypeError("coordinates must be finite numbers");
  }
  if (typeof a2 !== "number" || a2 !== a2 || !isFinite(a2)) throw new TypeError("coordinates must be finite numbers");
}
function checkNotWGS(f2, g2) {
  return (f2["datum"]["datum_type"] === PJD_3PARAM || f2["datum"]["datum_type"] === PJD_7PARAM || f2["datum"]["datum_type"] === PJD_GRIDSHIFT) && g2["datumCode"] !== "WGS84" || (g2["datum"]["datum_type"] === PJD_3PARAM || g2["datum"]["datum_type"] === PJD_7PARAM || g2["datum"]["datum_type"] === PJD_GRIDSHIFT) && f2["datumCode"] !== "WGS84";
}
function transform(f2, g2, h2, i2) {
  var j2;
  Array["isArray"](h2) ? h2 = d$6(h2) : h2 = { "x": h2["x"], "y": h2["y"], "z": h2["z"], "m": h2["m"] };
  var k2 = h2["z"] !== void 0;
  e$4(h2);
  f2["datum"] && g2["datum"] && checkNotWGS(f2, g2) && (j2 = new Projection("WGS84"), h2 = transform(f2, j2, h2, i2), f2 = j2);
  i2 && f2["axis"] !== "enu" && (h2 = b$7(f2, ![], h2));
  if (f2["projName"] === "longlat") h2 = { "x": h2["x"] * D2R$1, "y": h2["y"] * D2R$1, "z": h2["z"] || 0 };
  else {
    f2["to_meter"] && (h2 = { "x": h2["x"] * f2["to_meter"], "y": h2["y"] * f2["to_meter"], "z": h2["z"] || 0 });
    h2 = f2["inverse"](h2);
    if (!h2) return;
  }
  f2["from_greenwich"] && (h2["x"] += f2["from_greenwich"]);
  h2 = a$7(f2["datum"], g2["datum"], h2);
  if (!h2) return;
  g2["from_greenwich"] && (h2 = { "x": h2["x"] - g2["from_greenwich"], "y": h2["y"], "z": h2["z"] || 0 });
  g2["projName"] === "longlat" ? h2 = { "x": h2["x"] * R2D, "y": h2["y"] * R2D, "z": h2["z"] || 0 } : (h2 = g2["forward"](h2), g2["to_meter"] && (h2 = { "x": h2["x"] / g2["to_meter"], "y": h2["y"] / g2["to_meter"], "z": h2["z"] || 0 }));
  if (i2 && g2["axis"] !== "enu") return b$7(g2, !![], h2);
  return h2 && !k2 && delete h2["z"], h2;
}
var wgs84 = Projection("WGS84");
function transformer(c2, d2, e2, f2) {
  var g2, h2, i2;
  if (Array["isArray"](e2)) return g2 = transform(c2, d2, e2, f2) || { "x": NaN, "y": NaN }, e2["length"] > 2 ? typeof c2["name"] !== "undefined" && c2["name"] === "geocent" || typeof d2["name"] !== "undefined" && d2["name"] === "geocent" ? typeof g2["z"] === "number" ? [g2["x"], g2["y"], g2["z"]]["concat"](e2["slice"](3)) : [g2["x"], g2["y"], e2[2]]["concat"](e2["slice"](3)) : [g2["x"], g2["y"]]["concat"](e2["slice"](2)) : [g2["x"], g2["y"]];
  else {
    h2 = transform(c2, d2, e2, f2), i2 = Object["keys"](e2);
    if (i2["length"] === 2) return h2;
    return i2["forEach"](function(j2) {
      if (typeof c2["name"] !== "undefined" && c2["name"] === "geocent" || typeof d2["name"] !== "undefined" && d2["name"] === "geocent") {
        if (j2 === "x" || j2 === "y" || j2 === "z") return;
      } else {
        if (j2 === "x" || j2 === "y") return;
      }
      h2[j2] = e2[j2];
    }), h2;
  }
}
function checkProj(c2) {
  if (c2 instanceof Projection) return c2;
  if (c2["oProj"]) return c2["oProj"];
  return Projection(c2);
}
function proj4(c2, d2, e2) {
  c2 = checkProj(c2);
  var f2 = ![], g2;
  if (typeof d2 === "undefined") d2 = c2, c2 = wgs84, f2 = !![];
  else (typeof d2["x"] !== "undefined" || Array["isArray"](d2)) && (e2 = d2, d2 = c2, c2 = wgs84, f2 = !![]);
  return d2 = checkProj(d2), e2 ? transformer(c2, d2, e2) : (g2 = { "forward": function(h2, i2) {
    return transformer(c2, d2, h2, i2);
  }, "inverse": function(h2, i2) {
    return transformer(d2, c2, h2, i2);
  } }, f2 && (g2["oProj"] = d2), g2);
}
var NUM_100K_SETS = 6, SET_ORIGIN_COLUMN_LETTERS = "AJSAJS", SET_ORIGIN_ROW_LETTERS = "AFAFAF", A$1 = 65, I = 73, O = 79, V = 86, Z = 90;
const h$1 = { "forward": forward$u, "inverse": inverse$u, "toPoint": toPoint };
function forward$u(a2, b2) {
  return b2 = b2 || 5, encode(LLtoUTM({ "lat": a2[1], "lon": a2[0] }), b2);
}
function inverse$u(a2) {
  var b2 = UTMtoLL(decode(a2["toUpperCase"]()));
  if (b2["lat"] && b2["lon"]) return [b2["lon"], b2["lat"], b2["lon"], b2["lat"]];
  return [b2["left"], b2["bottom"], b2["right"], b2["top"]];
}
function toPoint(a2) {
  var b2 = UTMtoLL(decode(a2["toUpperCase"]()));
  if (b2["lat"] && b2["lon"]) return [b2["lon"], b2["lat"]];
  return [(b2["left"] + b2["right"]) / 2, (b2["top"] + b2["bottom"]) / 2];
}
function degToRad(a2) {
  return a2 * (Math["PI"] / 180);
}
function radToDeg(a2) {
  return 180 * (a2 / Math["PI"]);
}
function LLtoUTM(b2) {
  var c2 = b2["lat"], d2 = b2["lon"], e2 = 6378137, f2 = 669438e-8, g2 = 0.9996, h2, i2, j2, k2, l2, m2, n2, o2 = degToRad(c2), p2 = degToRad(d2), q2, r2;
  r2 = Math["floor"]((d2 + 180) / 6) + 1;
  d2 === 180 && (r2 = 60);
  c2 >= 56 && c2 < 64 && d2 >= 3 && d2 < 12 && (r2 = 32);
  if (c2 >= 72 && c2 < 84) {
    if (d2 >= 0 && d2 < 9) r2 = 31;
    else {
      if (d2 >= 9 && d2 < 21) r2 = 33;
      else {
        if (d2 >= 21 && d2 < 33) r2 = 35;
        else d2 >= 33 && d2 < 42 && (r2 = 37);
      }
    }
  }
  h2 = (r2 - 1) * 6 - 180 + 3, q2 = degToRad(h2), i2 = f2 / (1 - f2), j2 = e2 / Math["sqrt"](1 - f2 * Math["sin"](o2) * Math["sin"](o2)), k2 = Math["tan"](o2) * Math["tan"](o2), l2 = i2 * Math["cos"](o2) * Math["cos"](o2), m2 = Math["cos"](o2) * (p2 - q2), n2 = e2 * ((1 - f2 / 4 - 3 * f2 * f2 / 64 - 5 * f2 * f2 * f2 / 256) * o2 - (3 * f2 / 8 + 3 * f2 * f2 / 32 + 45 * f2 * f2 * f2 / 1024) * Math["sin"](2 * o2) + (15 * f2 * f2 / 256 + 45 * f2 * f2 * f2 / 1024) * Math["sin"](4 * o2) - 35 * f2 * f2 * f2 / 3072 * Math["sin"](6 * o2));
  var s2 = g2 * j2 * (m2 + (1 - k2 + l2) * m2 * m2 * m2 / 6 + (5 - 18 * k2 + k2 * k2 + 72 * l2 - 58 * i2) * m2 * m2 * m2 * m2 * m2 / 120) + 5e5, t2 = g2 * (n2 + j2 * Math["tan"](o2) * (m2 * m2 / 2 + (5 - k2 + 9 * l2 + 4 * l2 * l2) * m2 * m2 * m2 * m2 / 24 + (61 - 58 * k2 + k2 * k2 + 600 * l2 - 330 * i2) * m2 * m2 * m2 * m2 * m2 * m2 / 720));
  return c2 < 0 && (t2 += 1e7), { "northing": Math["round"](t2), "easting": Math["round"](s2), "zoneNumber": r2, "zoneLetter": getLetterDesignator(c2) };
}
function UTMtoLL(b2) {
  var c2 = b2["northing"], d2 = b2["easting"], e2 = b2["zoneLetter"], f2 = b2["zoneNumber"];
  if (f2 < 0 || f2 > 60) return null;
  var g2 = 0.9996, h2 = 6378137, i2 = 669438e-8, j2, k2 = (1 - Math["sqrt"](1 - i2)) / (1 + Math["sqrt"](1 - i2)), l2, m2, n2, o2, p2, q2, r2, s2, t2, u2 = d2 - 5e5, v2 = c2;
  e2 < "N" && (v2 -= 1e7);
  r2 = (f2 - 1) * 6 - 180 + 3, j2 = i2 / (1 - i2), q2 = v2 / g2, s2 = q2 / (h2 * (1 - i2 / 4 - 3 * i2 * i2 / 64 - 5 * i2 * i2 * i2 / 256)), t2 = s2 + (3 * k2 / 2 - 27 * k2 * k2 * k2 / 32) * Math["sin"](2 * s2) + (21 * k2 * k2 / 16 - 55 * k2 * k2 * k2 * k2 / 32) * Math["sin"](4 * s2) + 151 * k2 * k2 * k2 / 96 * Math["sin"](6 * s2), l2 = h2 / Math["sqrt"](1 - i2 * Math["sin"](t2) * Math["sin"](t2)), m2 = Math["tan"](t2) * Math["tan"](t2), n2 = j2 * Math["cos"](t2) * Math["cos"](t2), o2 = h2 * (1 - i2) / Math["pow"](1 - i2 * Math["sin"](t2) * Math["sin"](t2), 1.5), p2 = u2 / (l2 * g2);
  var w2 = t2 - l2 * Math["tan"](t2) / o2 * (p2 * p2 / 2 - (5 + 3 * m2 + 10 * n2 - 4 * n2 * n2 - 9 * j2) * p2 * p2 * p2 * p2 / 24 + (61 + 90 * m2 + 298 * n2 + 45 * m2 * m2 - 252 * j2 - 3 * n2 * n2) * p2 * p2 * p2 * p2 * p2 * p2 / 720);
  w2 = radToDeg(w2);
  var z2 = (p2 - (1 + 2 * m2 + n2) * p2 * p2 * p2 / 6 + (5 - 2 * n2 + 28 * m2 - 3 * n2 * n2 + 8 * j2 + 24 * m2 * m2) * p2 * p2 * p2 * p2 * p2 / 120) / Math["cos"](t2);
  z2 = r2 + radToDeg(z2);
  var B2;
  if (b2["accuracy"]) {
    var C2 = UTMtoLL({ "northing": b2["northing"] + b2["accuracy"], "easting": b2["easting"] + b2["accuracy"], "zoneLetter": b2["zoneLetter"], "zoneNumber": b2["zoneNumber"] });
    B2 = { "top": C2["lat"], "right": C2["lon"], "bottom": w2, "left": z2 };
  } else B2 = { "lat": w2, "lon": z2 };
  return B2;
}
function getLetterDesignator(a2) {
  var b2 = "Z";
  if (84 >= a2 && a2 >= 72) b2 = "X";
  else {
    if (72 > a2 && a2 >= 64) b2 = "W";
    else {
      if (64 > a2 && a2 >= 56) b2 = "V";
      else {
        if (56 > a2 && a2 >= 48) b2 = "U";
        else {
          if (48 > a2 && a2 >= 40) b2 = "T";
          else {
            if (40 > a2 && a2 >= 32) b2 = "S";
            else {
              if (32 > a2 && a2 >= 24) b2 = "R";
              else {
                if (24 > a2 && a2 >= 16) b2 = "Q";
                else {
                  if (16 > a2 && a2 >= 8) b2 = "P";
                  else {
                    if (8 > a2 && a2 >= 0) b2 = "N";
                    else {
                      if (0 > a2 && a2 >= -8) b2 = "M";
                      else {
                        if (-8 > a2 && a2 >= -16) b2 = "L";
                        else {
                          if (-16 > a2 && a2 >= -24) b2 = "K";
                          else {
                            if (-24 > a2 && a2 >= -32) b2 = "J";
                            else {
                              if (-32 > a2 && a2 >= -40) b2 = "H";
                              else {
                                if (-40 > a2 && a2 >= -48) b2 = "G";
                                else {
                                  if (-48 > a2 && a2 >= -56) b2 = "F";
                                  else {
                                    if (-56 > a2 && a2 >= -64) b2 = "E";
                                    else {
                                      if (-64 > a2 && a2 >= -72) b2 = "D";
                                      else -72 > a2 && a2 >= -80 && (b2 = "C");
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return b2;
}
function encode(a2, b2) {
  var c2 = "00000" + a2["easting"], d2 = "00000" + a2["northing"];
  return a2["zoneNumber"] + a2["zoneLetter"] + get100kID(a2["easting"], a2["northing"], a2["zoneNumber"]) + c2["substr"](c2["length"] - 5, b2) + d2["substr"](d2["length"] - 5, b2);
}
function get100kID(a2, b2, c2) {
  var d2 = get100kSetForZone(c2), e2 = Math["floor"](a2 / 1e5), f2 = Math["floor"](b2 / 1e5) % 20;
  return getLetter100kID(e2, f2, d2);
}
function get100kSetForZone(a2) {
  var b2 = a2 % NUM_100K_SETS;
  return b2 === 0 && (b2 = NUM_100K_SETS), b2;
}
function getLetter100kID(a2, b2, c2) {
  var d2 = c2 - 1, e2 = SET_ORIGIN_COLUMN_LETTERS["charCodeAt"](d2), f2 = SET_ORIGIN_ROW_LETTERS["charCodeAt"](d2), g2 = e2 + a2 - 1, h2 = f2 + b2, i2 = ![];
  g2 > Z && (g2 = g2 - Z + A$1 - 1, i2 = !![]);
  (g2 === I || e2 < I && g2 > I || (g2 > I || e2 < I) && i2) && g2++;
  (g2 === O || e2 < O && g2 > O || (g2 > O || e2 < O) && i2) && (g2++, g2 === I && g2++);
  g2 > Z && (g2 = g2 - Z + A$1 - 1);
  h2 > V ? (h2 = h2 - V + A$1 - 1, i2 = !![]) : i2 = ![];
  (h2 === I || f2 < I && h2 > I || (h2 > I || f2 < I) && i2) && h2++;
  (h2 === O || f2 < O && h2 > O || (h2 > O || f2 < O) && i2) && (h2++, h2 === I && h2++);
  h2 > V && (h2 = h2 - V + A$1 - 1);
  var j2 = String["fromCharCode"](g2) + String["fromCharCode"](h2);
  return j2;
}
function decode(a2) {
  if (a2 && a2["length"] === 0) throw "MGRSPoint coverting from nothing";
  var b2 = a2["length"], c2 = null, d2 = "", e2, f2 = 0;
  while (!/[A-Z]/["test"](e2 = a2["charAt"](f2))) {
    if (f2 >= 2) throw "MGRSPoint bad conversion from: " + a2;
    d2 += e2, f2++;
  }
  var g2 = parseInt(d2, 10);
  if (f2 === 0 || f2 + 3 > b2) throw "MGRSPoint bad conversion from: " + a2;
  var h2 = a2["charAt"](f2++);
  if (h2 <= "A" || h2 === "B" || h2 === "Y" || h2 >= "Z" || h2 === "I" || h2 === "O") throw "MGRSPoint zone letter " + h2 + " not handled: " + a2;
  c2 = a2["substring"](f2, f2 += 2);
  var j2 = get100kSetForZone(g2), k2 = getEastingFromChar(c2["charAt"](0), j2), l2 = getNorthingFromChar(c2["charAt"](1), j2);
  while (l2 < getMinNorthing(h2)) {
    l2 += 2e6;
  }
  var m2 = b2 - f2;
  if (m2 % 2 !== 0) throw "MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + a2;
  var n2 = m2 / 2, o2 = 0, p2 = 0, q2, r2, s2, t2, u2;
  return n2 > 0 && (q2 = 1e5 / Math["pow"](10, n2), r2 = a2["substring"](f2, f2 + n2), o2 = parseFloat(r2) * q2, s2 = a2["substring"](f2 + n2), p2 = parseFloat(s2) * q2), t2 = o2 + k2, u2 = p2 + l2, { "easting": t2, "northing": u2, "zoneLetter": h2, "zoneNumber": g2, "accuracy": q2 };
}
function getEastingFromChar(a2, b2) {
  var c2 = SET_ORIGIN_COLUMN_LETTERS["charCodeAt"](b2 - 1), d2 = 1e5, f2 = ![];
  while (c2 !== a2["charCodeAt"](0)) {
    c2++;
    c2 === I && c2++;
    c2 === O && c2++;
    if (c2 > Z) {
      if (f2) throw "Bad character: " + a2;
      c2 = A$1, f2 = !![];
    }
    d2 += 1e5;
  }
  return d2;
}
function getNorthingFromChar(a2, b2) {
  if (a2 > "V") throw "MGRSPoint given invalid Northing " + a2;
  var c2 = SET_ORIGIN_ROW_LETTERS["charCodeAt"](b2 - 1), d2 = 0, e2 = ![];
  while (c2 !== a2["charCodeAt"](0)) {
    c2++;
    c2 === I && c2++;
    c2 === O && c2++;
    if (c2 > V) {
      if (e2) throw "Bad character: " + a2;
      c2 = A$1, e2 = !![];
    }
    d2 += 1e5;
  }
  return d2;
}
function getMinNorthing(a2) {
  var b2;
  switch (a2) {
    case "C":
      b2 = 11e5;
      break;
    case "D":
      b2 = 2e6;
      break;
    case "E":
      b2 = 28e5;
      break;
    case "F":
      b2 = 37e5;
      break;
    case "G":
      b2 = 46e5;
      break;
    case "H":
      b2 = 55e5;
      break;
    case "J":
      b2 = 64e5;
      break;
    case "K":
      b2 = 73e5;
      break;
    case "L":
      b2 = 82e5;
      break;
    case "M":
      b2 = 91e5;
      break;
    case "N":
      b2 = 0;
      break;
    case "P":
      b2 = 8e5;
      break;
    case "Q":
      b2 = 17e5;
      break;
    case "R":
      b2 = 26e5;
      break;
    case "S":
      b2 = 35e5;
      break;
    case "T":
      b2 = 44e5;
      break;
    case "U":
      b2 = 53e5;
      break;
    case "V":
      b2 = 62e5;
      break;
    case "W":
      b2 = 7e6;
      break;
    case "X":
      b2 = 79e5;
      break;
    default:
      b2 = -1;
  }
  if (b2 >= 0) return b2;
  else throw "Invalid zone letter: " + a2;
}
function Point(a2, b2, c2) {
  if (!(this instanceof Point)) return new Point(a2, b2, c2);
  if (Array["isArray"](a2)) this["x"] = a2[0], this["y"] = a2[1], this["z"] = a2[2] || 0;
  else {
    if (typeof a2 === "object") this["x"] = a2["x"], this["y"] = a2["y"], this["z"] = a2["z"] || 0;
    else {
      if (typeof a2 === "string" && typeof b2 === "undefined") {
        var d2 = a2["split"](",");
        this["x"] = parseFloat(d2[0], 10), this["y"] = parseFloat(d2[1], 10), this["z"] = parseFloat(d2[2], 10) || 0;
      } else this["x"] = a2, this["y"] = b2, this["z"] = c2 || 0;
    }
  }
  console["warn"]("proj4.Point will be removed in version 3, use proj4.toPoint");
}
Point["fromMGRS"] = function(a2) {
  return new Point(toPoint(a2));
}, Point["prototype"]["toMGRS"] = function(a2) {
  return forward$u([this["x"], this["y"]], a2);
};
var C00 = 1, C02 = 0.25, C04 = 0.046875, C06 = 0.01953125, C08 = 0.01068115234375, C22 = 0.75, C44 = 0.46875, C46 = 0.013020833333333334, C48 = 0.007120768229166667, C66 = 0.3645833333333333, C68 = 0.005696614583333333, C88 = 0.3076171875;
function d$5(es) {
  var en = [];
  en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08))), en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
  var t2 = es * es;
  return en[2] = t2 * (C44 - es * (C46 + es * C48)), t2 *= es, en[3] = t2 * (C66 - es * C68), en[4] = t2 * es * C88, en;
}
function f$3(phi, sphi, cphi, en) {
  return cphi *= sphi, sphi *= sphi, en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])));
}
var MAX_ITER$3 = 20;
function e$3(arg, es, en) {
  var k2 = 1 / (1 - es), phi = arg;
  for (var i2 = MAX_ITER$3; i2; --i2) {
    var s2 = Math["sin"](phi), t2 = 1 - es * s2 * s2;
    t2 = (f$3(phi, s2, Math["cos"](phi), en) - arg) * (t2 * Math["sqrt"](t2)) * k2, phi -= t2;
    if (Math["abs"](t2) < EPSLN) return phi;
  }
  return phi;
}
function init$v() {
  this["x0"] = this["x0"] !== void 0 ? this["x0"] : 0, this["y0"] = this["y0"] !== void 0 ? this["y0"] : 0, this["long0"] = this["long0"] !== void 0 ? this["long0"] : 0, this["lat0"] = this["lat0"] !== void 0 ? this["lat0"] : 0, this["es"] && (this["en"] = d$5(this["es"]), this["ml0"] = f$3(this["lat0"], Math["sin"](this["lat0"]), Math["cos"](this["lat0"]), this["en"]));
}
function forward$t(f2) {
  var g2 = f2["x"], h2 = f2["y"], i2 = b$a(g2 - this["long0"]), j2, k2, l2, m2 = Math["sin"](h2), n2 = Math["cos"](h2);
  if (!this["es"]) {
    var o2 = n2 * Math["sin"](i2);
    if (Math["abs"](Math["abs"](o2) - 1) < EPSLN) return 93;
    else {
      k2 = 0.5 * this["a"] * this["k0"] * Math["log"]((1 + o2) / (1 - o2)) + this["x0"], l2 = n2 * Math["cos"](i2) / Math["sqrt"](1 - Math["pow"](o2, 2)), o2 = Math["abs"](l2);
      if (o2 >= 1) {
        if (o2 - 1 > EPSLN) return 93;
        else l2 = 0;
      } else l2 = Math["acos"](l2);
      h2 < 0 && (l2 = -l2), l2 = this["a"] * this["k0"] * (l2 - this["lat0"]) + this["y0"];
    }
  } else {
    var q2 = n2 * i2, r2 = Math["pow"](q2, 2), s2 = this["ep2"] * Math["pow"](n2, 2), u2 = Math["pow"](s2, 2), v2 = Math["abs"](n2) > EPSLN ? Math["tan"](h2) : 0, w2 = Math["pow"](v2, 2), z2 = Math["pow"](w2, 2);
    j2 = 1 - this["es"] * Math["pow"](m2, 2), q2 = q2 / Math["sqrt"](j2);
    var A5 = f$3(h2, m2, n2, this["en"]);
    k2 = this["a"] * (this["k0"] * q2 * (1 + r2 / 6 * (1 - w2 + s2 + r2 / 20 * (5 - 18 * w2 + z2 + 14 * s2 - 58 * w2 * s2 + r2 / 42 * (61 + 179 * z2 - z2 * w2 - 479 * w2))))) + this["x0"], l2 = this["a"] * (this["k0"] * (A5 - this["ml0"] + m2 * i2 * q2 / 2 * (1 + r2 / 12 * (5 - w2 + 9 * s2 + 4 * u2 + r2 / 30 * (61 + z2 - 58 * w2 + 270 * s2 - 330 * w2 * s2 + r2 / 56 * (1385 + 543 * z2 - z2 * w2 - 3111 * w2)))))) + this["y0"];
  }
  return f2["x"] = k2, f2["y"] = l2, f2;
}
function inverse$t(i2) {
  var j2, k2, l2, m2, n2 = (i2["x"] - this["x0"]) * (1 / this["a"]), o2 = (i2["y"] - this["y0"]) * (1 / this["a"]);
  if (!this["es"]) {
    var q2 = Math["exp"](n2 / this["k0"]), r2 = 0.5 * (q2 - 1 / q2), s2 = this["lat0"] + o2 / this["k0"], u2 = Math["cos"](s2);
    j2 = Math["sqrt"]((1 - Math["pow"](u2, 2)) / (1 + Math["pow"](r2, 2))), l2 = Math["asin"](j2), o2 < 0 && (l2 = -l2), r2 === 0 && u2 === 0 ? m2 = 0 : m2 = b$a(Math["atan2"](r2, u2) + this["long0"]);
  } else {
    j2 = this["ml0"] + o2 / this["k0"], k2 = e$3(j2, this["es"], this["en"]);
    if (Math["abs"](k2) < HALF_PI) {
      var v2 = Math["sin"](k2), w2 = Math["cos"](k2), z2 = Math["abs"](w2) > EPSLN ? Math["tan"](k2) : 0, A5 = this["ep2"] * Math["pow"](w2, 2), B2 = Math["pow"](A5, 2), C2 = Math["pow"](z2, 2), D2 = Math["pow"](C2, 2);
      j2 = 1 - this["es"] * Math["pow"](v2, 2);
      var E2 = n2 * Math["sqrt"](j2) / this["k0"], F = Math["pow"](E2, 2);
      j2 = j2 * z2, l2 = k2 - j2 * F / (1 - this["es"]) * 0.5 * (1 - F / 12 * (5 + 3 * C2 - 9 * A5 * C2 + A5 - 4 * B2 - F / 30 * (61 + 90 * C2 - 252 * A5 * C2 + 45 * D2 + 46 * A5 - F / 56 * (1385 + 3633 * C2 + 4095 * D2 + 1574 * D2 * C2)))), m2 = b$a(this["long0"] + E2 * (1 - F / 6 * (1 + 2 * C2 + A5 - F / 20 * (5 + 28 * C2 + 24 * D2 + 8 * A5 * C2 + 6 * A5 - F / 42 * (61 + 662 * C2 + 1320 * D2 + 720 * D2 * C2)))) / w2);
    } else l2 = HALF_PI * a$9(o2), m2 = 0;
  }
  return i2["x"] = m2, i2["y"] = l2, i2;
}
var names$v = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"];
const a$6 = { "init": init$v, "forward": forward$t, "inverse": inverse$t, "names": names$v };
function b$6(x2) {
  var r2 = Math["exp"](x2);
  return r2 = (r2 - 1 / r2) / 2, r2;
}
function c$2(x2, y2) {
  x2 = Math["abs"](x2), y2 = Math["abs"](y2);
  var a2 = Math["max"](x2, y2), b2 = Math["min"](x2, y2) / (a2 ? a2 : 1);
  return a2 * Math["sqrt"](1 + Math["pow"](b2, 2));
}
function b$5(x2) {
  var y2 = 1 + x2, z2 = y2 - 1;
  return z2 === 0 ? x2 : x2 * Math["log"](y2) / z2;
}
function d$4(x2) {
  var y2 = Math["abs"](x2);
  return y2 = b$5(y2 * (1 + y2 / (c$2(1, y2) + 1))), x2 < 0 ? -y2 : y2;
}
function e$2(pp, B2) {
  var cos_2B = 2 * Math["cos"](2 * B2), i2 = pp["length"] - 1, h1 = pp[i2], h2 = 0, h3;
  while (--i2 >= 0) {
    h3 = -h2 + cos_2B * h1 + pp[i2], h2 = h1, h1 = h3;
  }
  return B2 + h3 * Math["sin"](2 * B2);
}
function f$2(pp, arg_r) {
  var r2 = 2 * Math["cos"](arg_r), i2 = pp["length"] - 1, hr1 = pp[i2], hr2 = 0, hr;
  while (--i2 >= 0) {
    hr = -hr2 + r2 * hr1 + pp[i2], hr2 = hr1, hr1 = hr;
  }
  return Math["sin"](arg_r) * hr;
}
function b$4(x2) {
  var r2 = Math["exp"](x2);
  return r2 = (r2 + 1 / r2) / 2, r2;
}
function g$2(pp, arg_r, arg_i) {
  var sin_arg_r = Math["sin"](arg_r), cos_arg_r = Math["cos"](arg_r), sinh_arg_i = b$6(arg_i), cosh_arg_i = b$4(arg_i), r2 = 2 * cos_arg_r * cosh_arg_i, i2 = -2 * sin_arg_r * sinh_arg_i, j2 = pp["length"] - 1, hr = pp[j2], hi1 = 0, hr1 = 0, hi = 0, hr2, hi2;
  while (--j2 >= 0) {
    hr2 = hr1, hi2 = hi1, hr1 = hr, hi1 = hi, hr = -hr2 + r2 * hr1 - i2 * hi1 + pp[j2], hi = -hi2 + i2 * hr1 + r2 * hi1;
  }
  return r2 = sin_arg_r * cosh_arg_i, i2 = cos_arg_r * sinh_arg_i, [r2 * hr - i2 * hi, r2 * hi + i2 * hr];
}
function init$u() {
  if (!this["approx"] && (isNaN(this["es"]) || this["es"] <= 0)) throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
  this["approx"] && (a$6["init"]["apply"](this), this["forward"] = a$6["forward"], this["inverse"] = a$6["inverse"]);
  this["x0"] = this["x0"] !== void 0 ? this["x0"] : 0, this["y0"] = this["y0"] !== void 0 ? this["y0"] : 0, this["long0"] = this["long0"] !== void 0 ? this["long0"] : 0, this["lat0"] = this["lat0"] !== void 0 ? this["lat0"] : 0, this["cgb"] = [], this["cbg"] = [], this["utg"] = [], this["gtu"] = [];
  var i2 = this["es"] / (1 + Math["sqrt"](1 - this["es"])), j2 = i2 / (2 - i2), k2 = j2;
  this["cgb"][0] = j2 * (2 + j2 * (-2 / 3 + j2 * (-2 + j2 * (116 / 45 + j2 * (26 / 45 + j2 * (-2854 / 675)))))), this["cbg"][0] = j2 * (-2 + j2 * (2 / 3 + j2 * (4 / 3 + j2 * (-82 / 45 + j2 * (32 / 45 + j2 * (4642 / 4725)))))), k2 = k2 * j2, this["cgb"][1] = k2 * (7 / 3 + j2 * (-8 / 5 + j2 * (-227 / 45 + j2 * (2704 / 315 + j2 * (2323 / 945))))), this["cbg"][1] = k2 * (5 / 3 + j2 * (-16 / 15 + j2 * (-13 / 9 + j2 * (904 / 315 + j2 * (-1522 / 945))))), k2 = k2 * j2, this["cgb"][2] = k2 * (56 / 15 + j2 * (-136 / 35 + j2 * (-1262 / 105 + j2 * (73814 / 2835)))), this["cbg"][2] = k2 * (-26 / 15 + j2 * (34 / 21 + j2 * (8 / 5 + j2 * (-12686 / 2835)))), k2 = k2 * j2, this["cgb"][3] = k2 * (4279 / 630 + j2 * (-332 / 35 + j2 * (-399572 / 14175))), this["cbg"][3] = k2 * (1237 / 630 + j2 * (-12 / 5 + j2 * (-24832 / 14175))), k2 = k2 * j2, this["cgb"][4] = k2 * (4174 / 315 + j2 * (-144838 / 6237)), this["cbg"][4] = k2 * (-734 / 315 + j2 * (109598 / 31185)), k2 = k2 * j2, this["cgb"][5] = k2 * (601676 / 22275), this["cbg"][5] = k2 * (444337 / 155925), k2 = Math["pow"](j2, 2), this["Qn"] = this["k0"] / (1 + j2) * (1 + k2 * (1 / 4 + k2 * (1 / 64 + k2 / 256))), this["utg"][0] = j2 * (-0.5 + j2 * (2 / 3 + j2 * (-37 / 96 + j2 * (1 / 360 + j2 * (81 / 512 + j2 * (-96199 / 604800)))))), this["gtu"][0] = j2 * (0.5 + j2 * (-2 / 3 + j2 * (5 / 16 + j2 * (41 / 180 + j2 * (-127 / 288 + j2 * (7891 / 37800)))))), this["utg"][1] = k2 * (-1 / 48 + j2 * (-1 / 15 + j2 * (437 / 1440 + j2 * (-46 / 105 + j2 * (1118711 / 3870720))))), this["gtu"][1] = k2 * (13 / 48 + j2 * (-3 / 5 + j2 * (557 / 1440 + j2 * (281 / 630 + j2 * (-1983433 / 1935360))))), k2 = k2 * j2, this["utg"][2] = k2 * (-17 / 480 + j2 * (37 / 840 + j2 * (209 / 4480 + j2 * (-5569 / 90720)))), this["gtu"][2] = k2 * (61 / 240 + j2 * (-103 / 140 + j2 * (15061 / 26880 + j2 * (167603 / 181440)))), k2 = k2 * j2, this["utg"][3] = k2 * (-4397 / 161280 + j2 * (11 / 504 + j2 * (830251 / 7257600))), this["gtu"][3] = k2 * (49561 / 161280 + j2 * (-179 / 168 + j2 * (6601661 / 7257600))), k2 = k2 * j2, this["utg"][4] = k2 * (-4583 / 161280 + j2 * (108847 / 3991680)), this["gtu"][4] = k2 * (34729 / 80640 + j2 * (-3418889 / 1995840)), k2 = k2 * j2, this["utg"][5] = k2 * (-20648693 / 638668800), this["gtu"][5] = k2 * (212378941 / 319334400);
  var l2 = e$2(this["cbg"], this["lat0"]);
  this["Zb"] = -this["Qn"] * (l2 + f$2(this["gtu"], 2 * l2));
}
function forward$s(i2) {
  var j2 = b$a(i2["x"] - this["long0"]), k2 = i2["y"];
  k2 = e$2(this["cbg"], k2);
  var l2 = Math["sin"](k2), m2 = Math["cos"](k2), n2 = Math["sin"](j2), o2 = Math["cos"](j2);
  k2 = Math["atan2"](l2, o2 * m2), j2 = Math["atan2"](n2 * m2, c$2(l2, m2 * o2)), j2 = d$4(Math["tan"](j2));
  var q2 = g$2(this["gtu"], 2 * k2, 2 * j2);
  k2 = k2 + q2[0], j2 = j2 + q2[1];
  var r2, s2;
  return Math["abs"](j2) <= 2.623395162778 ? (r2 = this["a"] * (this["Qn"] * j2) + this["x0"], s2 = this["a"] * (this["Qn"] * k2 + this["Zb"]) + this["y0"]) : (r2 = Infinity, s2 = Infinity), i2["x"] = r2, i2["y"] = s2, i2;
}
function inverse$s(i2) {
  var j2 = (i2["x"] - this["x0"]) * (1 / this["a"]), k2 = (i2["y"] - this["y0"]) * (1 / this["a"]);
  k2 = (k2 - this["Zb"]) / this["Qn"], j2 = j2 / this["Qn"];
  var l2, m2;
  if (Math["abs"](j2) <= 2.623395162778) {
    var n2 = g$2(this["utg"], 2 * k2, 2 * j2);
    k2 = k2 + n2[0], j2 = j2 + n2[1], j2 = Math["atan"](b$6(j2));
    var o2 = Math["sin"](k2), q2 = Math["cos"](k2), r2 = Math["sin"](j2), s2 = Math["cos"](j2);
    k2 = Math["atan2"](o2 * s2, c$2(r2, s2 * q2)), j2 = Math["atan2"](r2, s2 * q2), l2 = b$a(j2 + this["long0"]), m2 = e$2(this["cgb"], k2);
  } else l2 = Infinity, m2 = Infinity;
  return i2["x"] = l2, i2["y"] = m2, i2;
}
var names$u = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "Gauss Kruger", "Gauss_Kruger", "tmerc"];
const b$3 = { "init": init$u, "forward": forward$s, "inverse": inverse$s, "names": names$u };
function a$5(zone, lon) {
  if (zone === void 0) {
    zone = Math["floor"]((b$a(lon) + Math["PI"]) * 30 / Math["PI"]) + 1;
    if (zone < 0) return 0;
    else {
      if (zone > 60) return 60;
    }
  }
  return zone;
}
var dependsOn = "etmerc";
function init$t() {
  var c2 = a$5(this["zone"], this["long0"]);
  if (c2 === void 0) throw new Error("unknown utm zone");
  this["lat0"] = 0, this["long0"] = (6 * Math["abs"](c2) - 183) * D2R$1, this["x0"] = 5e5, this["y0"] = this["utmSouth"] ? 1e7 : 0, this["k0"] = 0.9996, b$3["init"]["apply"](this), this["forward"] = b$3["forward"], this["inverse"] = b$3["inverse"];
}
var names$t = ["Universal Transverse Mercator System", "utm"];
const c$1 = { "init": init$t, "names": names$t, "dependsOn": dependsOn };
function a$4(esinp, exp) {
  return Math["pow"]((1 - esinp) / (1 + esinp), exp);
}
var MAX_ITER$2 = 20;
function init$s() {
  var b2 = Math["sin"](this["lat0"]), c2 = Math["cos"](this["lat0"]);
  c2 *= c2, this["rc"] = Math["sqrt"](1 - this["es"]) / (1 - this["es"] * b2 * b2), this["C"] = Math["sqrt"](1 + this["es"] * c2 * c2 / (1 - this["es"])), this["phic0"] = Math["asin"](b2 / this["C"]), this["ratexp"] = 0.5 * this["C"] * this["e"], this["K"] = Math["tan"](0.5 * this["phic0"] + FORTPI) / (Math["pow"](Math["tan"](0.5 * this["lat0"] + FORTPI), this["C"]) * a$4(this["e"] * b2, this["ratexp"]));
}
function forward$r(b2) {
  var c2 = b2["x"], d2 = b2["y"];
  return b2["y"] = 2 * Math["atan"](this["K"] * Math["pow"](Math["tan"](0.5 * d2 + FORTPI), this["C"]) * a$4(this["e"] * Math["sin"](d2), this["ratexp"])) - HALF_PI, b2["x"] = this["C"] * c2, b2;
}
function inverse$r(b2) {
  var c2 = 1e-14, d2 = b2["x"] / this["C"], e2 = b2["y"], f2 = Math["pow"](Math["tan"](0.5 * e2 + FORTPI) / this["K"], 1 / this["C"]);
  for (var g2 = MAX_ITER$2; g2 > 0; --g2) {
    e2 = 2 * Math["atan"](f2 * a$4(this["e"] * Math["sin"](b2["y"]), -0.5 * this["e"])) - HALF_PI;
    if (Math["abs"](e2 - b2["y"]) < c2) break;
    b2["y"] = e2;
  }
  if (!g2) return null;
  return b2["x"] = d2, b2["y"] = e2, b2;
}
var names$s = ["gauss"];
const a$3 = { "init": init$s, "forward": forward$r, "inverse": inverse$r, "names": names$s };
function init$r() {
  a$3["init"]["apply"](this);
  if (!this["rc"]) return;
  this["sinc0"] = Math["sin"](this["phic0"]), this["cosc0"] = Math["cos"](this["phic0"]), this["R2"] = 2 * this["rc"], !this["title"] && (this["title"] = "Oblique Stereographic Alternative");
}
function forward$q(d2) {
  var e2, f2, g2, h2;
  return d2["x"] = b$a(d2["x"] - this["long0"]), a$3["forward"]["apply"](this, [d2]), e2 = Math["sin"](d2["y"]), f2 = Math["cos"](d2["y"]), g2 = Math["cos"](d2["x"]), h2 = this["k0"] * this["R2"] / (1 + this["sinc0"] * e2 + this["cosc0"] * f2 * g2), d2["x"] = h2 * f2 * Math["sin"](d2["x"]), d2["y"] = h2 * (this["cosc0"] * e2 - this["sinc0"] * f2 * g2), d2["x"] = this["a"] * d2["x"] + this["x0"], d2["y"] = this["a"] * d2["y"] + this["y0"], d2;
}
function inverse$q(d2) {
  var e2, f2, g2, h2, i2;
  d2["x"] = (d2["x"] - this["x0"]) / this["a"], d2["y"] = (d2["y"] - this["y0"]) / this["a"], d2["x"] /= this["k0"], d2["y"] /= this["k0"];
  if (i2 = c$2(d2["x"], d2["y"])) {
    var j2 = 2 * Math["atan2"](i2, this["R2"]);
    e2 = Math["sin"](j2), f2 = Math["cos"](j2), h2 = Math["asin"](f2 * this["sinc0"] + d2["y"] * e2 * this["cosc0"] / i2), g2 = Math["atan2"](d2["x"] * e2, i2 * this["cosc0"] * f2 - d2["y"] * this["sinc0"] * e2);
  } else h2 = this["phic0"], g2 = 0;
  return d2["x"] = g2, d2["y"] = h2, a$3["inverse"]["apply"](this, [d2]), d2["x"] = b$a(d2["x"] + this["long0"]), d2;
}
var names$r = ["Stereographic_North_Pole", "Oblique_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
const d$3 = { "init": init$r, "forward": forward$q, "inverse": inverse$q, "names": names$r };
function ssfn_(f2, g2, h2) {
  return g2 *= h2, Math["tan"](0.5 * (HALF_PI + f2)) * Math["pow"]((1 - g2) / (1 + g2), 0.5 * h2);
}
function init$q() {
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0, this["lat0"] = this["lat0"] || 0, this["long0"] = this["long0"] || 0, this["coslat0"] = Math["cos"](this["lat0"]), this["sinlat0"] = Math["sin"](this["lat0"]), this["sphere"] ? this["k0"] === 1 && !isNaN(this["lat_ts"]) && Math["abs"](this["coslat0"]) <= EPSLN && (this["k0"] = 0.5 * (1 + a$9(this["lat0"]) * Math["sin"](this["lat_ts"]))) : (Math["abs"](this["coslat0"]) <= EPSLN && (this["lat0"] > 0 ? this["con"] = 1 : this["con"] = -1), this["cons"] = Math["sqrt"](Math["pow"](1 + this["e"], 1 + this["e"]) * Math["pow"](1 - this["e"], 1 - this["e"])), this["k0"] === 1 && !isNaN(this["lat_ts"]) && Math["abs"](this["coslat0"]) <= EPSLN && Math["abs"](Math["cos"](this["lat_ts"])) > EPSLN && (this["k0"] = 0.5 * this["cons"] * e$6(this["e"], Math["sin"](this["lat_ts"]), Math["cos"](this["lat_ts"])) / b$9(this["e"], this["con"] * this["lat_ts"], this["con"] * Math["sin"](this["lat_ts"]))), this["ms1"] = e$6(this["e"], this["sinlat0"], this["coslat0"]), this["X0"] = 2 * Math["atan"](this["ssfn_"](this["lat0"], this["sinlat0"], this["e"])) - HALF_PI, this["cosX0"] = Math["cos"](this["X0"]), this["sinX0"] = Math["sin"](this["X0"]));
}
function forward$p(f2) {
  var g2 = f2["x"], h2 = f2["y"], i2 = Math["sin"](h2), j2 = Math["cos"](h2), k2, l2, m2, n2, o2, q2, r2 = b$a(g2 - this["long0"]);
  if (Math["abs"](Math["abs"](g2 - this["long0"]) - Math["PI"]) <= EPSLN && Math["abs"](h2 + this["lat0"]) <= EPSLN) return f2["x"] = NaN, f2["y"] = NaN, f2;
  if (this["sphere"]) return k2 = 2 * this["k0"] / (1 + this["sinlat0"] * i2 + this["coslat0"] * j2 * Math["cos"](r2)), f2["x"] = this["a"] * k2 * j2 * Math["sin"](r2) + this["x0"], f2["y"] = this["a"] * k2 * (this["coslat0"] * i2 - this["sinlat0"] * j2 * Math["cos"](r2)) + this["y0"], f2;
  else {
    l2 = 2 * Math["atan"](this["ssfn_"](h2, i2, this["e"])) - HALF_PI, n2 = Math["cos"](l2), m2 = Math["sin"](l2);
    if (Math["abs"](this["coslat0"]) <= EPSLN) return o2 = b$9(this["e"], h2 * this["con"], this["con"] * i2), q2 = 2 * this["a"] * this["k0"] * o2 / this["cons"], f2["x"] = this["x0"] + q2 * Math["sin"](g2 - this["long0"]), f2["y"] = this["y0"] - this["con"] * q2 * Math["cos"](g2 - this["long0"]), f2;
    else Math["abs"](this["sinlat0"]) < EPSLN ? (k2 = 2 * this["a"] * this["k0"] / (1 + n2 * Math["cos"](r2)), f2["y"] = k2 * m2) : (k2 = 2 * this["a"] * this["k0"] * this["ms1"] / (this["cosX0"] * (1 + this["sinX0"] * m2 + this["cosX0"] * n2 * Math["cos"](r2))), f2["y"] = k2 * (this["cosX0"] * m2 - this["sinX0"] * n2 * Math["cos"](r2)) + this["y0"]);
    f2["x"] = k2 * n2 * Math["sin"](r2) + this["x0"];
  }
  return f2;
}
function inverse$p(f2) {
  f2["x"] -= this["x0"], f2["y"] -= this["y0"];
  var g2, h2, i2, j2, k2, l2 = Math["sqrt"](f2["x"] * f2["x"] + f2["y"] * f2["y"]);
  if (this["sphere"]) {
    var m2 = 2 * Math["atan"](l2 / (2 * this["a"] * this["k0"]));
    g2 = this["long0"], h2 = this["lat0"];
    if (l2 <= EPSLN) return f2["x"] = g2, f2["y"] = h2, f2;
    return h2 = Math["asin"](Math["cos"](m2) * this["sinlat0"] + f2["y"] * Math["sin"](m2) * this["coslat0"] / l2), Math["abs"](this["coslat0"]) < EPSLN ? this["lat0"] > 0 ? g2 = b$a(this["long0"] + Math["atan2"](f2["x"], -1 * f2["y"])) : g2 = b$a(this["long0"] + Math["atan2"](f2["x"], f2["y"])) : g2 = b$a(this["long0"] + Math["atan2"](f2["x"] * Math["sin"](m2), l2 * this["coslat0"] * Math["cos"](m2) - f2["y"] * this["sinlat0"] * Math["sin"](m2))), f2["x"] = g2, f2["y"] = h2, f2;
  } else {
    if (Math["abs"](this["coslat0"]) <= EPSLN) {
      if (l2 <= EPSLN) return h2 = this["lat0"], g2 = this["long0"], f2["x"] = g2, f2["y"] = h2, f2;
      f2["x"] *= this["con"], f2["y"] *= this["con"], i2 = l2 * this["cons"] / (2 * this["a"] * this["k0"]), h2 = this["con"] * e$5(this["e"], i2), g2 = this["con"] * b$a(this["con"] * this["long0"] + Math["atan2"](f2["x"], -1 * f2["y"]));
    } else j2 = 2 * Math["atan"](l2 * this["cosX0"] / (2 * this["a"] * this["k0"] * this["ms1"])), g2 = this["long0"], l2 <= EPSLN ? k2 = this["X0"] : (k2 = Math["asin"](Math["cos"](j2) * this["sinX0"] + f2["y"] * Math["sin"](j2) * this["cosX0"] / l2), g2 = b$a(this["long0"] + Math["atan2"](f2["x"] * Math["sin"](j2), l2 * this["cosX0"] * Math["cos"](j2) - f2["y"] * this["sinX0"] * Math["sin"](j2)))), h2 = -1 * e$5(this["e"], Math["tan"](0.5 * (HALF_PI + k2)));
  }
  return f2["x"] = g2, f2["y"] = h2, f2;
}
var names$q = ["stere", "Stereographic_South_Pole", "Polar Stereographic (variant B)", "Polar_Stereographic"];
const e$1 = { "init": init$q, "forward": forward$p, "inverse": inverse$p, "names": names$q, "ssfn_": ssfn_ };
function init$p() {
  var a2 = this["lat0"];
  this["lambda0"] = this["long0"];
  var b2 = Math["sin"](a2), c2 = this["a"], d2 = this["rf"], f2 = 1 / d2, g2 = 2 * f2 - Math["pow"](f2, 2), h2 = this["e"] = Math["sqrt"](g2);
  this["R"] = this["k0"] * c2 * Math["sqrt"](1 - g2) / (1 - g2 * Math["pow"](b2, 2)), this["alpha"] = Math["sqrt"](1 + g2 / (1 - g2) * Math["pow"](Math["cos"](a2), 4)), this["b0"] = Math["asin"](b2 / this["alpha"]);
  var i2 = Math["log"](Math["tan"](Math["PI"] / 4 + this["b0"] / 2)), j2 = Math["log"](Math["tan"](Math["PI"] / 4 + a2 / 2)), k2 = Math["log"]((1 + h2 * b2) / (1 - h2 * b2));
  this["K"] = i2 - this["alpha"] * j2 + this["alpha"] * h2 / 2 * k2;
}
function forward$o(a2) {
  var c2 = Math["log"](Math["tan"](Math["PI"] / 4 - a2["y"] / 2)), d2 = this["e"] / 2 * Math["log"]((1 + this["e"] * Math["sin"](a2["y"])) / (1 - this["e"] * Math["sin"](a2["y"]))), e2 = -this["alpha"] * (c2 + d2) + this["K"], f2 = 2 * (Math["atan"](Math["exp"](e2)) - Math["PI"] / 4), g2 = this["alpha"] * (a2["x"] - this["lambda0"]), h2 = Math["atan"](Math["sin"](g2) / (Math["sin"](this["b0"]) * Math["tan"](f2) + Math["cos"](this["b0"]) * Math["cos"](g2))), i2 = Math["asin"](Math["cos"](this["b0"]) * Math["sin"](f2) - Math["sin"](this["b0"]) * Math["cos"](f2) * Math["cos"](g2));
  return a2["y"] = this["R"] / 2 * Math["log"]((1 + Math["sin"](i2)) / (1 - Math["sin"](i2))) + this["y0"], a2["x"] = this["R"] * h2 + this["x0"], a2;
}
function inverse$o(a2) {
  var c2 = a2["x"] - this["x0"], d2 = a2["y"] - this["y0"], e2 = c2 / this["R"], f2 = 2 * (Math["atan"](Math["exp"](d2 / this["R"])) - Math["PI"] / 4), g2 = Math["asin"](Math["cos"](this["b0"]) * Math["sin"](f2) + Math["sin"](this["b0"]) * Math["cos"](f2) * Math["cos"](e2)), h2 = Math["atan"](Math["sin"](e2) / (Math["cos"](this["b0"]) * Math["cos"](e2) - Math["sin"](this["b0"]) * Math["tan"](f2))), i2 = this["lambda0"] + h2 / this["alpha"], j2 = 0, k2 = g2, l2 = -1e3, m2 = 0;
  while (Math["abs"](k2 - l2) > 1e-7) {
    if (++m2 > 20) return;
    j2 = 1 / this["alpha"] * (Math["log"](Math["tan"](Math["PI"] / 4 + g2 / 2)) - this["K"]) + this["e"] * Math["log"](Math["tan"](Math["PI"] / 4 + Math["asin"](this["e"] * Math["sin"](k2)) / 2)), l2 = k2, k2 = 2 * Math["atan"](Math["exp"](j2)) - Math["PI"] / 2;
  }
  return a2["x"] = i2, a2["y"] = k2, a2;
}
var names$p = ["somerc"];
const f$1 = { "init": init$p, "forward": forward$o, "inverse": inverse$o, "names": names$p };
var TOL = 1e-7;
function isTypeA(d2) {
  var e2 = ["Hotine_Oblique_Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"], f2 = typeof d2["PROJECTION"] === "object" ? Object["keys"](d2["PROJECTION"])[0] : d2["PROJECTION"];
  return "no_uoff" in d2 || "no_off" in d2 || e2["indexOf"](f2) !== -1;
}
function init$o() {
  var d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2 = 0, o2, q2 = 0, r2 = 0, s2 = 0, t2 = 0, u2 = 0, v2 = 0;
  this["no_off"] = isTypeA(this), this["no_rot"] = "no_rot" in this;
  var x2 = ![];
  "alpha" in this && (x2 = !![]);
  var y2 = ![];
  "rectified_grid_angle" in this && (y2 = !![]);
  x2 && (v2 = this["alpha"]);
  y2 && (n2 = this["rectified_grid_angle"] * D2R$1);
  if (x2 || y2) q2 = this["longc"];
  else {
    r2 = this["long1"], t2 = this["lat1"], s2 = this["long2"], u2 = this["lat2"];
    if (Math["abs"](t2 - u2) <= TOL || (d2 = Math["abs"](t2)) <= TOL || Math["abs"](d2 - HALF_PI) <= TOL || Math["abs"](Math["abs"](this["lat0"]) - HALF_PI) <= TOL || Math["abs"](Math["abs"](u2) - HALF_PI) <= TOL) throw new Error();
  }
  var z2 = 1 - this["es"];
  e2 = Math["sqrt"](z2);
  Math["abs"](this["lat0"]) > EPSLN ? (k2 = Math["sin"](this["lat0"]), f2 = Math["cos"](this["lat0"]), d2 = 1 - this["es"] * k2 * k2, this["B"] = f2 * f2, this["B"] = Math["sqrt"](1 + this["es"] * this["B"] * this["B"] / z2), this["A"] = this["B"] * this["k0"] * e2 / d2, g2 = this["B"] * e2 / (f2 * Math["sqrt"](d2)), h2 = g2 * g2 - 1, h2 <= 0 ? h2 = 0 : (h2 = Math["sqrt"](h2), this["lat0"] < 0 && (h2 = -h2)), this["E"] = h2 += g2, this["E"] *= Math["pow"](b$9(this["e"], this["lat0"], k2), this["B"])) : (this["B"] = 1 / e2, this["A"] = this["k0"], this["E"] = g2 = h2 = 1);
  if (x2 || y2) x2 ? (o2 = Math["asin"](Math["sin"](v2) / g2), !y2 && (n2 = v2)) : (o2 = n2, v2 = Math["asin"](g2 * Math["sin"](o2))), this["lam0"] = q2 - Math["asin"](0.5 * (h2 - 1 / h2) * Math["tan"](o2)) / this["B"];
  else {
    i2 = Math["pow"](b$9(this["e"], t2, Math["sin"](t2)), this["B"]), j2 = Math["pow"](b$9(this["e"], u2, Math["sin"](u2)), this["B"]), h2 = this["E"] / i2, l2 = (j2 - i2) / (j2 + i2), m2 = this["E"] * this["E"], m2 = (m2 - j2 * i2) / (m2 + j2 * i2), d2 = r2 - s2;
    if (d2 < -Math["pi"]) s2 -= TWO_PI;
    else d2 > Math["pi"] && (s2 += TWO_PI);
    this["lam0"] = b$a(0.5 * (r2 + s2) - Math["atan"](m2 * Math["tan"](0.5 * this["B"] * (r2 - s2)) / l2) / this["B"]), o2 = Math["atan"](2 * Math["sin"](this["B"] * b$a(r2 - this["lam0"])) / (h2 - 1 / h2)), n2 = v2 = Math["asin"](g2 * Math["sin"](o2));
  }
  this["singam"] = Math["sin"](o2), this["cosgam"] = Math["cos"](o2), this["sinrot"] = Math["sin"](n2), this["cosrot"] = Math["cos"](n2), this["rB"] = 1 / this["B"], this["ArB"] = this["A"] * this["rB"], this["BrA"] = 1 / this["ArB"], this["A"] * this["B"], this["no_off"] ? this["u_0"] = 0 : (this["u_0"] = Math["abs"](this["ArB"] * Math["atan"](Math["sqrt"](g2 * g2 - 1) / Math["cos"](v2))), this["lat0"] < 0 && (this["u_0"] = -this["u_0"])), h2 = 0.5 * o2, this["v_pole_n"] = this["ArB"] * Math["log"](Math["tan"](FORTPI - h2)), this["v_pole_s"] = this["ArB"] * Math["log"](Math["tan"](FORTPI + h2));
}
function forward$n(d2) {
  var e2 = {}, f2, g2, h2, i2, j2, k2, l2, m2;
  d2["x"] = d2["x"] - this["lam0"];
  if (Math["abs"](Math["abs"](d2["y"]) - HALF_PI) > EPSLN) {
    j2 = this["E"] / Math["pow"](b$9(this["e"], d2["y"], Math["sin"](d2["y"])), this["B"]), k2 = 1 / j2, f2 = 0.5 * (j2 - k2), g2 = 0.5 * (j2 + k2), i2 = Math["sin"](this["B"] * d2["x"]), h2 = (f2 * this["singam"] - i2 * this["cosgam"]) / g2;
    if (Math["abs"](Math["abs"](h2) - 1) < EPSLN) throw new Error();
    m2 = 0.5 * this["ArB"] * Math["log"]((1 - h2) / (1 + h2)), k2 = Math["cos"](this["B"] * d2["x"]), Math["abs"](k2) < TOL ? l2 = this["A"] * d2["x"] : l2 = this["ArB"] * Math["atan2"](f2 * this["cosgam"] + i2 * this["singam"], k2);
  } else m2 = d2["y"] > 0 ? this["v_pole_n"] : this["v_pole_s"], l2 = this["ArB"] * d2["y"];
  return this["no_rot"] ? (e2["x"] = l2, e2["y"] = m2) : (l2 -= this["u_0"], e2["x"] = m2 * this["cosrot"] + l2 * this["sinrot"], e2["y"] = l2 * this["cosrot"] - m2 * this["sinrot"]), e2["x"] = this["a"] * e2["x"] + this["x0"], e2["y"] = this["a"] * e2["y"] + this["y0"], e2;
}
function inverse$n(d2) {
  var e2, f2, g2, h2, i2, j2, k2, l2 = {};
  d2["x"] = (d2["x"] - this["x0"]) * (1 / this["a"]), d2["y"] = (d2["y"] - this["y0"]) * (1 / this["a"]);
  this["no_rot"] ? (f2 = d2["y"], e2 = d2["x"]) : (f2 = d2["x"] * this["cosrot"] - d2["y"] * this["sinrot"], e2 = d2["y"] * this["cosrot"] + d2["x"] * this["sinrot"] + this["u_0"]);
  g2 = Math["exp"](-this["BrA"] * f2), h2 = 0.5 * (g2 - 1 / g2), i2 = 0.5 * (g2 + 1 / g2), j2 = Math["sin"](this["BrA"] * e2), k2 = (j2 * this["cosgam"] + h2 * this["singam"]) / i2;
  if (Math["abs"](Math["abs"](k2) - 1) < EPSLN) l2["x"] = 0, l2["y"] = k2 < 0 ? -HALF_PI : HALF_PI;
  else {
    l2["y"] = this["E"] / Math["sqrt"]((1 + k2) / (1 - k2)), l2["y"] = e$5(this["e"], Math["pow"](l2["y"], 1 / this["B"]));
    if (l2["y"] === Infinity) throw new Error();
    l2["x"] = -this["rB"] * Math["atan2"](h2 * this["cosgam"] - j2 * this["singam"], Math["cos"](this["BrA"] * e2));
  }
  return l2["x"] += this["lam0"], l2;
}
var names$o = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"];
const g$1 = { "init": init$o, "forward": forward$n, "inverse": inverse$n, "names": names$o };
function init$n() {
  !this["lat2"] && (this["lat2"] = this["lat1"]);
  !this["k0"] && (this["k0"] = 1);
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0;
  if (Math["abs"](this["lat1"] + this["lat2"]) < EPSLN) return;
  var f2 = this["b"] / this["a"];
  this["e"] = Math["sqrt"](1 - f2 * f2);
  var g2 = Math["sin"](this["lat1"]), h2 = Math["cos"](this["lat1"]), i2 = e$6(this["e"], g2, h2), j2 = b$9(this["e"], this["lat1"], g2), k2 = Math["sin"](this["lat2"]), l2 = Math["cos"](this["lat2"]), m2 = e$6(this["e"], k2, l2), n2 = b$9(this["e"], this["lat2"], k2), o2 = b$9(this["e"], this["lat0"], Math["sin"](this["lat0"]));
  Math["abs"](this["lat1"] - this["lat2"]) > EPSLN ? this["ns"] = Math["log"](i2 / m2) / Math["log"](j2 / n2) : this["ns"] = g2, isNaN(this["ns"]) && (this["ns"] = g2), this["f0"] = i2 / (this["ns"] * Math["pow"](j2, this["ns"])), this["rh"] = this["a"] * this["f0"] * Math["pow"](o2, this["ns"]), !this["title"] && (this["title"] = "Lambert Conformal Conic");
}
function forward$m(f2) {
  var g2 = f2["x"], h2 = f2["y"];
  Math["abs"](2 * Math["abs"](h2) - Math["PI"]) <= EPSLN && (h2 = a$9(h2) * (HALF_PI - 2 * EPSLN));
  var i2 = Math["abs"](Math["abs"](h2) - HALF_PI), j2, k2;
  if (i2 > EPSLN) j2 = b$9(this["e"], h2, Math["sin"](h2)), k2 = this["a"] * this["f0"] * Math["pow"](j2, this["ns"]);
  else {
    i2 = h2 * this["ns"];
    if (i2 <= 0) return null;
    k2 = 0;
  }
  var l2 = this["ns"] * b$a(g2 - this["long0"]);
  return f2["x"] = this["k0"] * (k2 * Math["sin"](l2)) + this["x0"], f2["y"] = this["k0"] * (this["rh"] - k2 * Math["cos"](l2)) + this["y0"], f2;
}
function inverse$m(f2) {
  var g2, h2, i2, j2, k2, l2 = (f2["x"] - this["x0"]) / this["k0"], m2 = this["rh"] - (f2["y"] - this["y0"]) / this["k0"];
  this["ns"] > 0 ? (g2 = Math["sqrt"](l2 * l2 + m2 * m2), h2 = 1) : (g2 = -Math["sqrt"](l2 * l2 + m2 * m2), h2 = -1);
  var n2 = 0;
  g2 !== 0 && (n2 = Math["atan2"](h2 * l2, h2 * m2));
  if (g2 !== 0 || this["ns"] > 0) {
    h2 = 1 / this["ns"], i2 = Math["pow"](g2 / (this["a"] * this["f0"]), h2), j2 = e$5(this["e"], i2);
    if (j2 === -9999) return null;
  } else j2 = -HALF_PI;
  return k2 = b$a(n2 / this["ns"] + this["long0"]), f2["x"] = k2, f2["y"] = j2, f2;
}
var names$n = ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_1SP", "Lambert_Conformal_Conic_2SP", "lcc", "Lambert Conic Conformal (1SP)", "Lambert Conic Conformal (2SP)"];
const h = { "init": init$n, "forward": forward$m, "inverse": inverse$m, "names": names$n };
function init$m() {
  this["a"] = 6377397155e-3, this["es"] = 0.006674372230614, this["e"] = Math["sqrt"](this["es"]), !this["lat0"] && (this["lat0"] = 0.863937979737193), !this["long0"] && (this["long0"] = 0.7417649320975901 - 0.308341501185665), !this["k0"] && (this["k0"] = 0.9999), this["s45"] = 0.785398163397448, this["s90"] = 2 * this["s45"], this["fi0"] = this["lat0"], this["e2"] = this["es"], this["e"] = Math["sqrt"](this["e2"]), this["alfa"] = Math["sqrt"](1 + this["e2"] * Math["pow"](Math["cos"](this["fi0"]), 4) / (1 - this["e2"])), this["uq"] = 1.04216856380474, this["u0"] = Math["asin"](Math["sin"](this["fi0"]) / this["alfa"]), this["g"] = Math["pow"]((1 + this["e"] * Math["sin"](this["fi0"])) / (1 - this["e"] * Math["sin"](this["fi0"])), this["alfa"] * this["e"] / 2), this["k"] = Math["tan"](this["u0"] / 2 + this["s45"]) / Math["pow"](Math["tan"](this["fi0"] / 2 + this["s45"]), this["alfa"]) * this["g"], this["k1"] = this["k0"], this["n0"] = this["a"] * Math["sqrt"](1 - this["e2"]) / (1 - this["e2"] * Math["pow"](Math["sin"](this["fi0"]), 2)), this["s0"] = 1.37008346281555, this["n"] = Math["sin"](this["s0"]), this["ro0"] = this["k1"] * this["n0"] / Math["tan"](this["s0"]), this["ad"] = this["s90"] - this["uq"];
}
function forward$l(b2) {
  var c2, e2, f2, g2, h2, i2, j2, k2 = b2["x"], l2 = b2["y"], m2 = b$a(k2 - this["long0"]);
  return c2 = Math["pow"]((1 + this["e"] * Math["sin"](l2)) / (1 - this["e"] * Math["sin"](l2)), this["alfa"] * this["e"] / 2), e2 = 2 * (Math["atan"](this["k"] * Math["pow"](Math["tan"](l2 / 2 + this["s45"]), this["alfa"]) / c2) - this["s45"]), f2 = -m2 * this["alfa"], g2 = Math["asin"](Math["cos"](this["ad"]) * Math["sin"](e2) + Math["sin"](this["ad"]) * Math["cos"](e2) * Math["cos"](f2)), h2 = Math["asin"](Math["cos"](e2) * Math["sin"](f2) / Math["cos"](g2)), i2 = this["n"] * h2, j2 = this["ro0"] * Math["pow"](Math["tan"](this["s0"] / 2 + this["s45"]), this["n"]) / Math["pow"](Math["tan"](g2 / 2 + this["s45"]), this["n"]), b2["y"] = j2 * Math["cos"](i2) / 1, b2["x"] = j2 * Math["sin"](i2) / 1, !this["czech"] && (b2["y"] *= -1, b2["x"] *= -1), b2;
}
function inverse$l(b2) {
  var c2, e2, f2, g2, h2, i2, j2, k2, l2 = b2["x"];
  b2["x"] = b2["y"], b2["y"] = l2;
  !this["czech"] && (b2["y"] *= -1, b2["x"] *= -1);
  i2 = Math["sqrt"](b2["x"] * b2["x"] + b2["y"] * b2["y"]), h2 = Math["atan2"](b2["y"], b2["x"]), g2 = h2 / Math["sin"](this["s0"]), f2 = 2 * (Math["atan"](Math["pow"](this["ro0"] / i2, 1 / this["n"]) * Math["tan"](this["s0"] / 2 + this["s45"])) - this["s45"]), c2 = Math["asin"](Math["cos"](this["ad"]) * Math["sin"](f2) - Math["sin"](this["ad"]) * Math["cos"](f2) * Math["cos"](g2)), e2 = Math["asin"](Math["cos"](f2) * Math["sin"](g2) / Math["cos"](c2)), b2["x"] = this["long0"] - e2 / this["alfa"], j2 = c2, k2 = 0;
  var m2 = 0;
  do {
    b2["y"] = 2 * (Math["atan"](Math["pow"](this["k"], -1 / this["alfa"]) * Math["pow"](Math["tan"](c2 / 2 + this["s45"]), 1 / this["alfa"]) * Math["pow"]((1 + this["e"] * Math["sin"](j2)) / (1 - this["e"] * Math["sin"](j2)), this["e"] / 2)) - this["s45"]), Math["abs"](j2 - b2["y"]) < 1e-10 && (k2 = 1), j2 = b2["y"], m2 += 1;
  } while (k2 === 0 && m2 < 15);
  if (m2 >= 15) return null;
  return b2;
}
var names$m = ["Krovak", "krovak"];
const i$2 = { "init": init$m, "forward": forward$l, "inverse": inverse$l, "names": names$m };
function b$2(e0, e1, e2, e3, phi) {
  return e0 * phi - e1 * Math["sin"](2 * phi) + e2 * Math["sin"](4 * phi) - e3 * Math["sin"](6 * phi);
}
function c(x2) {
  return 1 - 0.25 * x2 * (1 + x2 / 16 * (3 + 1.25 * x2));
}
function d$2(x2) {
  return 0.375 * x2 * (1 + 0.25 * x2 * (1 + 0.46875 * x2));
}
function e(x2) {
  return 0.05859375 * x2 * x2 * (1 + 0.75 * x2);
}
function f(x2) {
  return x2 * x2 * x2 * (35 / 3072);
}
function g(a2, e2, sinphi) {
  var temp = e2 * sinphi;
  return a2 / Math["sqrt"](1 - temp * temp);
}
function a$2(x2) {
  return Math["abs"](x2) < HALF_PI ? x2 : x2 - a$9(x2) * Math["PI"];
}
function i$1(ml, e0, e1, e2, e3) {
  var phi, dphi;
  phi = ml / e0;
  for (var i2 = 0; i2 < 15; i2++) {
    dphi = (ml - (e0 * phi - e1 * Math["sin"](2 * phi) + e2 * Math["sin"](4 * phi) - e3 * Math["sin"](6 * phi))) / (e0 - 2 * e1 * Math["cos"](2 * phi) + 4 * e2 * Math["cos"](4 * phi) - 6 * e3 * Math["cos"](6 * phi)), phi += dphi;
    if (Math["abs"](dphi) <= 1e-10) return phi;
  }
  return NaN;
}
function init$l() {
  !this["sphere"] && (this["e0"] = c(this["es"]), this["e1"] = d$2(this["es"]), this["e2"] = e(this["es"]), this["e3"] = f(this["es"]), this["ml0"] = this["a"] * b$2(this["e0"], this["e1"], this["e2"], this["e3"], this["lat0"]));
}
function forward$k(j2) {
  var k2, l2, m2 = j2["x"], n2 = j2["y"];
  m2 = b$a(m2 - this["long0"]);
  if (this["sphere"]) k2 = this["a"] * Math["asin"](Math["cos"](n2) * Math["sin"](m2)), l2 = this["a"] * (Math["atan2"](Math["tan"](n2), Math["cos"](m2)) - this["lat0"]);
  else {
    var o2 = Math["sin"](n2), q2 = Math["cos"](n2), r2 = g(this["a"], this["e"], o2), s2 = Math["tan"](n2) * Math["tan"](n2), t2 = m2 * Math["cos"](n2), u2 = t2 * t2, v2 = this["es"] * q2 * q2 / (1 - this["es"]), w2 = this["a"] * b$2(this["e0"], this["e1"], this["e2"], this["e3"], n2);
    k2 = r2 * t2 * (1 - u2 * s2 * (1 / 6 - (8 - s2 + 8 * v2) * u2 / 120)), l2 = w2 - this["ml0"] + r2 * o2 / q2 * u2 * (0.5 + (5 - s2 + 6 * v2) * u2 / 24);
  }
  return j2["x"] = k2 + this["x0"], j2["y"] = l2 + this["y0"], j2;
}
function inverse$k(j2) {
  j2["x"] -= this["x0"], j2["y"] -= this["y0"];
  var k2 = j2["x"] / this["a"], l2 = j2["y"] / this["a"], m2, n2;
  if (this["sphere"]) {
    var o2 = l2 + this["lat0"];
    m2 = Math["asin"](Math["sin"](o2) * Math["cos"](k2)), n2 = Math["atan2"](Math["tan"](k2), Math["cos"](o2));
  } else {
    var q2 = this["ml0"] / this["a"] + l2, r2 = i$1(q2, this["e0"], this["e1"], this["e2"], this["e3"]);
    if (Math["abs"](Math["abs"](r2) - HALF_PI) <= EPSLN) return j2["x"] = this["long0"], j2["y"] = HALF_PI, l2 < 0 && (j2["y"] *= -1), j2;
    var s2 = g(this["a"], this["e"], Math["sin"](r2)), t2 = s2 * s2 * s2 / this["a"] / this["a"] * (1 - this["es"]), u2 = Math["pow"](Math["tan"](r2), 2), v2 = k2 * this["a"] / s2, w2 = v2 * v2;
    m2 = r2 - s2 * Math["tan"](r2) / t2 * v2 * v2 * (0.5 - (1 + 3 * u2) * v2 * v2 / 24), n2 = v2 * (1 - w2 * (u2 / 3 + (1 + 3 * u2) * u2 * w2 / 15)) / Math["cos"](r2);
  }
  return j2["x"] = b$a(n2 + this["long0"]), j2["y"] = a$2(m2), j2;
}
var names$l = ["Cassini", "Cassini_Soldner", "cass"];
const j = { "init": init$l, "forward": forward$k, "inverse": inverse$k, "names": names$l };
function b$1(eccent, sinphi) {
  var con;
  return eccent > 1e-7 ? (con = eccent * sinphi, (1 - eccent * eccent) * (sinphi / (1 - con * con) - 0.5 / eccent * Math["log"]((1 - con) / (1 + con)))) : 2 * sinphi;
}
var S_POLE = 1;
var N_POLE = 2;
var EQUIT = 3;
var OBLIQ = 4;
function init$k() {
  var c2 = Math["abs"](this["lat0"]);
  if (Math["abs"](c2 - HALF_PI) < EPSLN) this["mode"] = this["lat0"] < 0 ? this["S_POLE"] : this["N_POLE"];
  else Math["abs"](c2) < EPSLN ? this["mode"] = this["EQUIT"] : this["mode"] = this["OBLIQ"];
  if (this["es"] > 0) {
    var d2;
    this["qp"] = b$1(this["e"], 1), this["mmf"] = 0.5 / (1 - this["es"]), this["apa"] = authset(this["es"]);
    switch (this["mode"]) {
      case this["N_POLE"]:
        this["dd"] = 1;
        break;
      case this["S_POLE"]:
        this["dd"] = 1;
        break;
      case this["EQUIT"]:
        this["rq"] = Math["sqrt"](0.5 * this["qp"]), this["dd"] = 1 / this["rq"], this["xmf"] = 1, this["ymf"] = 0.5 * this["qp"];
        break;
      case this["OBLIQ"]:
        this["rq"] = Math["sqrt"](0.5 * this["qp"]), d2 = Math["sin"](this["lat0"]), this["sinb1"] = b$1(this["e"], d2) / this["qp"], this["cosb1"] = Math["sqrt"](1 - this["sinb1"] * this["sinb1"]), this["dd"] = Math["cos"](this["lat0"]) / (Math["sqrt"](1 - this["es"] * d2 * d2) * this["rq"] * this["cosb1"]), this["ymf"] = (this["xmf"] = this["rq"]) / this["dd"], this["xmf"] *= this["dd"];
        break;
    }
  } else this["mode"] === this["OBLIQ"] && (this["sinph0"] = Math["sin"](this["lat0"]), this["cosph0"] = Math["cos"](this["lat0"]));
}
function forward$j(c2) {
  var d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2 = c2["x"], o2 = c2["y"];
  n2 = b$a(n2 - this["long0"]);
  if (this["sphere"]) {
    h2 = Math["sin"](o2), m2 = Math["cos"](o2), f2 = Math["cos"](n2);
    if (this["mode"] === this["OBLIQ"] || this["mode"] === this["EQUIT"]) {
      e2 = this["mode"] === this["EQUIT"] ? 1 + m2 * f2 : 1 + this["sinph0"] * h2 + this["cosph0"] * m2 * f2;
      if (e2 <= EPSLN) return null;
      e2 = Math["sqrt"](2 / e2), d2 = e2 * m2 * Math["sin"](n2), e2 *= this["mode"] === this["EQUIT"] ? h2 : this["cosph0"] * h2 - this["sinph0"] * m2 * f2;
    } else {
      if (this["mode"] === this["N_POLE"] || this["mode"] === this["S_POLE"]) {
        this["mode"] === this["N_POLE"] && (f2 = -f2);
        if (Math["abs"](o2 + this["lat0"]) < EPSLN) return null;
        e2 = FORTPI - o2 * 0.5, e2 = 2 * (this["mode"] === this["S_POLE"] ? Math["cos"](e2) : Math["sin"](e2)), d2 = e2 * Math["sin"](n2), e2 *= f2;
      }
    }
  } else {
    j2 = 0, k2 = 0, l2 = 0, f2 = Math["cos"](n2), g2 = Math["sin"](n2), h2 = Math["sin"](o2), i2 = b$1(this["e"], h2);
    (this["mode"] === this["OBLIQ"] || this["mode"] === this["EQUIT"]) && (j2 = i2 / this["qp"], k2 = Math["sqrt"](1 - j2 * j2));
    switch (this["mode"]) {
      case this["OBLIQ"]:
        l2 = 1 + this["sinb1"] * j2 + this["cosb1"] * k2 * f2;
        break;
      case this["EQUIT"]:
        l2 = 1 + k2 * f2;
        break;
      case this["N_POLE"]:
        l2 = HALF_PI + o2, i2 = this["qp"] - i2;
        break;
      case this["S_POLE"]:
        l2 = o2 - HALF_PI, i2 = this["qp"] + i2;
        break;
    }
    if (Math["abs"](l2) < EPSLN) return null;
    switch (this["mode"]) {
      case this["OBLIQ"]:
      case this["EQUIT"]:
        l2 = Math["sqrt"](2 / l2);
        this["mode"] === this["OBLIQ"] ? e2 = this["ymf"] * l2 * (this["cosb1"] * j2 - this["sinb1"] * k2 * f2) : e2 = (l2 = Math["sqrt"](2 / (1 + k2 * f2))) * j2 * this["ymf"];
        d2 = this["xmf"] * l2 * k2 * g2;
        break;
      case this["N_POLE"]:
      case this["S_POLE"]:
        i2 >= 0 ? (d2 = (l2 = Math["sqrt"](i2)) * g2, e2 = f2 * (this["mode"] === this["S_POLE"] ? l2 : -l2)) : d2 = e2 = 0;
        break;
    }
  }
  return c2["x"] = this["a"] * d2 + this["x0"], c2["y"] = this["a"] * e2 + this["y0"], c2;
}
function inverse$j(c2) {
  c2["x"] -= this["x0"], c2["y"] -= this["y0"];
  var d2 = c2["x"] / this["a"], e2 = c2["y"] / this["a"], f2, g2, h2, i2, j2, k2, l2;
  if (this["sphere"]) {
    var m2 = 0, n2, o2 = 0;
    n2 = Math["sqrt"](d2 * d2 + e2 * e2), g2 = n2 * 0.5;
    if (g2 > 1) return null;
    g2 = 2 * Math["asin"](g2);
    (this["mode"] === this["OBLIQ"] || this["mode"] === this["EQUIT"]) && (o2 = Math["sin"](g2), m2 = Math["cos"](g2));
    switch (this["mode"]) {
      case this["EQUIT"]:
        g2 = Math["abs"](n2) <= EPSLN ? 0 : Math["asin"](e2 * o2 / n2), d2 *= o2, e2 = m2 * n2;
        break;
      case this["OBLIQ"]:
        g2 = Math["abs"](n2) <= EPSLN ? this["lat0"] : Math["asin"](m2 * this["sinph0"] + e2 * o2 * this["cosph0"] / n2), d2 *= o2 * this["cosph0"], e2 = (m2 - Math["sin"](g2) * this["sinph0"]) * n2;
        break;
      case this["N_POLE"]:
        e2 = -e2, g2 = HALF_PI - g2;
        break;
      case this["S_POLE"]:
        g2 -= HALF_PI;
        break;
    }
    f2 = e2 === 0 && (this["mode"] === this["EQUIT"] || this["mode"] === this["OBLIQ"]) ? 0 : Math["atan2"](d2, e2);
  } else {
    l2 = 0;
    if (this["mode"] === this["OBLIQ"] || this["mode"] === this["EQUIT"]) {
      d2 /= this["dd"], e2 *= this["dd"], k2 = Math["sqrt"](d2 * d2 + e2 * e2);
      if (k2 < EPSLN) return c2["x"] = this["long0"], c2["y"] = this["lat0"], c2;
      i2 = 2 * Math["asin"](0.5 * k2 / this["rq"]), h2 = Math["cos"](i2), d2 *= i2 = Math["sin"](i2), this["mode"] === this["OBLIQ"] ? (l2 = h2 * this["sinb1"] + e2 * i2 * this["cosb1"] / k2, j2 = this["qp"] * l2, e2 = k2 * this["cosb1"] * h2 - e2 * this["sinb1"] * i2) : (l2 = e2 * i2 / k2, j2 = this["qp"] * l2, e2 = k2 * h2);
    } else {
      if (this["mode"] === this["N_POLE"] || this["mode"] === this["S_POLE"]) {
        this["mode"] === this["N_POLE"] && (e2 = -e2);
        j2 = d2 * d2 + e2 * e2;
        if (!j2) return c2["x"] = this["long0"], c2["y"] = this["lat0"], c2;
        l2 = 1 - j2 / this["qp"], this["mode"] === this["S_POLE"] && (l2 = -l2);
      }
    }
    f2 = Math["atan2"](d2, e2), g2 = authlat(Math["asin"](l2), this["apa"]);
  }
  return c2["x"] = b$a(this["long0"] + f2), c2["y"] = g2, c2;
}
var P00 = 0.3333333333333333, P01 = 0.17222222222222222, P02 = 0.10257936507936508, P10 = 0.06388888888888888, P11 = 0.0664021164021164, P20 = 0.016415012942191543;
function authset(c2) {
  var d2, e2 = [];
  return e2[0] = c2 * P00, d2 = c2 * c2, e2[0] += d2 * P01, e2[1] = d2 * P10, d2 *= c2, e2[0] += d2 * P02, e2[1] += d2 * P11, e2[2] = d2 * P20, e2;
}
function authlat(c2, d2) {
  var e2 = c2 + c2;
  return c2 + d2[0] * Math["sin"](e2) + d2[1] * Math["sin"](e2 + e2) + d2[2] * Math["sin"](e2 + e2 + e2);
}
var names$k = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
const k = { "init": init$k, "forward": forward$j, "inverse": inverse$j, "names": names$k, "S_POLE": S_POLE, "N_POLE": N_POLE, "EQUIT": EQUIT, "OBLIQ": OBLIQ };
function b(x2) {
  return Math["abs"](x2) > 1 && (x2 = x2 > 1 ? 1 : -1), Math["asin"](x2);
}
function init$j() {
  if (Math["abs"](this["lat1"] + this["lat2"]) < EPSLN) return;
  this["temp"] = this["b"] / this["a"], this["es"] = 1 - Math["pow"](this["temp"], 2), this["e3"] = Math["sqrt"](this["es"]), this["sin_po"] = Math["sin"](this["lat1"]), this["cos_po"] = Math["cos"](this["lat1"]), this["t1"] = this["sin_po"], this["con"] = this["sin_po"], this["ms1"] = e$6(this["e3"], this["sin_po"], this["cos_po"]), this["qs1"] = b$1(this["e3"], this["sin_po"]), this["sin_po"] = Math["sin"](this["lat2"]), this["cos_po"] = Math["cos"](this["lat2"]), this["t2"] = this["sin_po"], this["ms2"] = e$6(this["e3"], this["sin_po"], this["cos_po"]), this["qs2"] = b$1(this["e3"], this["sin_po"]), this["sin_po"] = Math["sin"](this["lat0"]), this["cos_po"] = Math["cos"](this["lat0"]), this["t3"] = this["sin_po"], this["qs0"] = b$1(this["e3"], this["sin_po"]), Math["abs"](this["lat1"] - this["lat2"]) > EPSLN ? this["ns0"] = (this["ms1"] * this["ms1"] - this["ms2"] * this["ms2"]) / (this["qs2"] - this["qs1"]) : this["ns0"] = this["con"], this["c"] = this["ms1"] * this["ms1"] + this["ns0"] * this["qs1"], this["rh"] = this["a"] * Math["sqrt"](this["c"] - this["ns0"] * this["qs0"]) / this["ns0"];
}
function forward$i(e2) {
  var f2 = e2["x"], g2 = e2["y"];
  this["sin_phi"] = Math["sin"](g2), this["cos_phi"] = Math["cos"](g2);
  var h2 = b$1(this["e3"], this["sin_phi"]), i2 = this["a"] * Math["sqrt"](this["c"] - this["ns0"] * h2) / this["ns0"], j2 = this["ns0"] * b$a(f2 - this["long0"]), k2 = i2 * Math["sin"](j2) + this["x0"], l2 = this["rh"] - i2 * Math["cos"](j2) + this["y0"];
  return e2["x"] = k2, e2["y"] = l2, e2;
}
function inverse$i(e2) {
  var f2, g2, h2, i2, j2, k2;
  return e2["x"] -= this["x0"], e2["y"] = this["rh"] - e2["y"] + this["y0"], this["ns0"] >= 0 ? (f2 = Math["sqrt"](e2["x"] * e2["x"] + e2["y"] * e2["y"]), h2 = 1) : (f2 = -Math["sqrt"](e2["x"] * e2["x"] + e2["y"] * e2["y"]), h2 = -1), i2 = 0, f2 !== 0 && (i2 = Math["atan2"](h2 * e2["x"], h2 * e2["y"])), h2 = f2 * this["ns0"] / this["a"], this["sphere"] ? k2 = Math["asin"]((this["c"] - h2 * h2) / (2 * this["ns0"])) : (g2 = (this["c"] - h2 * h2) / this["ns0"], k2 = this["phi1z"](this["e3"], g2)), j2 = b$a(i2 / this["ns0"] + this["long0"]), e2["x"] = j2, e2["y"] = k2, e2;
}
function phi1z(e2, f2) {
  var g2, h2, j2, k2, l2, m2 = b(0.5 * f2);
  if (e2 < EPSLN) return m2;
  var n2 = e2 * e2;
  for (var o2 = 1; o2 <= 25; o2++) {
    g2 = Math["sin"](m2), h2 = Math["cos"](m2), j2 = e2 * g2, k2 = 1 - j2 * j2, l2 = 0.5 * k2 * k2 / h2 * (f2 / (1 - n2) - g2 / k2 + 0.5 / e2 * Math["log"]((1 - j2) / (1 + j2))), m2 = m2 + l2;
    if (Math["abs"](l2) <= 1e-7) return m2;
  }
  return null;
}
var names$j = ["Albers_Conic_Equal_Area", "Albers", "aea"];
const l = { "init": init$j, "forward": forward$i, "inverse": inverse$i, "names": names$j, "phi1z": phi1z };
function init$i() {
  this["sin_p14"] = Math["sin"](this["lat0"]), this["cos_p14"] = Math["cos"](this["lat0"]), this["infinity_dist"] = 1e3 * this["a"], this["rc"] = 1;
}
function forward$h(c2) {
  var d2, e2, f2, h2, i2, j2, k2, l2, m2 = c2["x"], n2 = c2["y"];
  return f2 = b$a(m2 - this["long0"]), d2 = Math["sin"](n2), e2 = Math["cos"](n2), h2 = Math["cos"](f2), j2 = this["sin_p14"] * d2 + this["cos_p14"] * e2 * h2, i2 = 1, j2 > 0 || Math["abs"](j2) <= EPSLN ? (k2 = this["x0"] + this["a"] * i2 * e2 * Math["sin"](f2) / j2, l2 = this["y0"] + this["a"] * i2 * (this["cos_p14"] * d2 - this["sin_p14"] * e2 * h2) / j2) : (k2 = this["x0"] + this["infinity_dist"] * e2 * Math["sin"](f2), l2 = this["y0"] + this["infinity_dist"] * (this["cos_p14"] * d2 - this["sin_p14"] * e2 * h2)), c2["x"] = k2, c2["y"] = l2, c2;
}
function inverse$h(d2) {
  var e2, f2, g2, h2, i2, j2;
  return d2["x"] = (d2["x"] - this["x0"]) / this["a"], d2["y"] = (d2["y"] - this["y0"]) / this["a"], d2["x"] /= this["k0"], d2["y"] /= this["k0"], (e2 = Math["sqrt"](d2["x"] * d2["x"] + d2["y"] * d2["y"])) ? (h2 = Math["atan2"](e2, this["rc"]), f2 = Math["sin"](h2), g2 = Math["cos"](h2), j2 = b(g2 * this["sin_p14"] + d2["y"] * f2 * this["cos_p14"] / e2), i2 = Math["atan2"](d2["x"] * f2, e2 * this["cos_p14"] * g2 - d2["y"] * this["sin_p14"] * f2), i2 = b$a(this["long0"] + i2)) : (j2 = this["phic0"], i2 = 0), d2["x"] = i2, d2["y"] = j2, d2;
}
var names$i = ["gnom"];
const m = { "init": init$i, "forward": forward$h, "inverse": inverse$h, "names": names$i };
function d$1(eccent, q2) {
  var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math["log"]((1 - eccent) / (1 + eccent));
  if (Math["abs"](Math["abs"](q2) - temp) < 1e-6) return q2 < 0 ? -1 * HALF_PI : HALF_PI;
  var phi = Math["asin"](0.5 * q2), dphi, sin_phi, cos_phi, con;
  for (var i2 = 0; i2 < 30; i2++) {
    sin_phi = Math["sin"](phi), cos_phi = Math["cos"](phi), con = eccent * sin_phi, dphi = Math["pow"](1 - con * con, 2) / (2 * cos_phi) * (q2 / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math["log"]((1 - con) / (1 + con))), phi += dphi;
    if (Math["abs"](dphi) <= 1e-10) return phi;
  }
  return NaN;
}
function init$h() {
  !this["sphere"] && (this["k0"] = e$6(this["e"], Math["sin"](this["lat_ts"]), Math["cos"](this["lat_ts"])));
}
function forward$g(e2) {
  var f2 = e2["x"], g2 = e2["y"], h2, i2, j2 = b$a(f2 - this["long0"]);
  if (this["sphere"]) h2 = this["x0"] + this["a"] * j2 * Math["cos"](this["lat_ts"]), i2 = this["y0"] + this["a"] * Math["sin"](g2) / Math["cos"](this["lat_ts"]);
  else {
    var k2 = b$1(this["e"], Math["sin"](g2));
    h2 = this["x0"] + this["a"] * this["k0"] * j2, i2 = this["y0"] + this["a"] * k2 * 0.5 / this["k0"];
  }
  return e2["x"] = h2, e2["y"] = i2, e2;
}
function inverse$g(e2) {
  e2["x"] -= this["x0"], e2["y"] -= this["y0"];
  var f2, g2;
  return this["sphere"] ? (f2 = b$a(this["long0"] + e2["x"] / this["a"] / Math["cos"](this["lat_ts"])), g2 = Math["asin"](e2["y"] / this["a"] * Math["cos"](this["lat_ts"]))) : (g2 = d$1(this["e"], 2 * e2["y"] * this["k0"] / this["a"]), f2 = b$a(this["long0"] + e2["x"] / (this["a"] * this["k0"]))), e2["x"] = f2, e2["y"] = g2, e2;
}
var names$h = ["cea"];
const n = { "init": init$h, "forward": forward$g, "inverse": inverse$g, "names": names$h };
function init$g() {
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0, this["lat0"] = this["lat0"] || 0, this["long0"] = this["long0"] || 0, this["lat_ts"] = this["lat_ts"] || 0, this["title"] = this["title"] || "Equidistant Cylindrical (Plate Carre)", this["rc"] = Math["cos"](this["lat_ts"]);
}
function forward$f(c2) {
  var d2 = c2["x"], e2 = c2["y"], f2 = b$a(d2 - this["long0"]), g2 = a$2(e2 - this["lat0"]);
  return c2["x"] = this["x0"] + this["a"] * f2 * this["rc"], c2["y"] = this["y0"] + this["a"] * g2, c2;
}
function inverse$f(c2) {
  var d2 = c2["x"], e2 = c2["y"];
  return c2["x"] = b$a(this["long0"] + (d2 - this["x0"]) / (this["a"] * this["rc"])), c2["y"] = a$2(this["lat0"] + (e2 - this["y0"]) / this["a"]), c2;
}
var names$g = ["Equirectangular", "Equidistant_Cylindrical", "eqc"];
const o = { "init": init$g, "forward": forward$f, "inverse": inverse$f, "names": names$g };
var MAX_ITER$1 = 20;
function init$f() {
  this["temp"] = this["b"] / this["a"], this["es"] = 1 - Math["pow"](this["temp"], 2), this["e"] = Math["sqrt"](this["es"]), this["e0"] = c(this["es"]), this["e1"] = d$2(this["es"]), this["e2"] = e(this["es"]), this["e3"] = f(this["es"]), this["ml0"] = this["a"] * b$2(this["e0"], this["e1"], this["e2"], this["e3"], this["lat0"]);
}
function forward$e(i2) {
  var j2 = i2["x"], k2 = i2["y"], l2, m2, n2, o2 = b$a(j2 - this["long0"]);
  n2 = o2 * Math["sin"](k2);
  if (this["sphere"]) Math["abs"](k2) <= EPSLN ? (l2 = this["a"] * o2, m2 = -1 * this["a"] * this["lat0"]) : (l2 = this["a"] * Math["sin"](n2) / Math["tan"](k2), m2 = this["a"] * (a$2(k2 - this["lat0"]) + (1 - Math["cos"](n2)) / Math["tan"](k2)));
  else {
    if (Math["abs"](k2) <= EPSLN) l2 = this["a"] * o2, m2 = -1 * this["ml0"];
    else {
      var q2 = g(this["a"], this["e"], Math["sin"](k2)) / Math["tan"](k2);
      l2 = q2 * Math["sin"](n2), m2 = this["a"] * b$2(this["e0"], this["e1"], this["e2"], this["e3"], k2) - this["ml0"] + q2 * (1 - Math["cos"](n2));
    }
  }
  return i2["x"] = l2 + this["x0"], i2["y"] = m2 + this["y0"], i2;
}
function inverse$e(j2) {
  var k2, l2, m2, n2, o2, q2, r2, s2, t2;
  m2 = j2["x"] - this["x0"], n2 = j2["y"] - this["y0"];
  if (this["sphere"]) {
    if (Math["abs"](n2 + this["a"] * this["lat0"]) <= EPSLN) k2 = b$a(m2 / this["a"] + this["long0"]), l2 = 0;
    else {
      q2 = this["lat0"] + n2 / this["a"], r2 = m2 * m2 / this["a"] / this["a"] + q2 * q2, s2 = q2;
      var u2;
      for (o2 = MAX_ITER$1; o2; --o2) {
        u2 = Math["tan"](s2), t2 = -1 * (q2 * (s2 * u2 + 1) - s2 - 0.5 * (s2 * s2 + r2) * u2) / ((s2 - q2) / u2 - 1), s2 += t2;
        if (Math["abs"](t2) <= EPSLN) {
          l2 = s2;
          break;
        }
      }
      k2 = b$a(this["long0"] + Math["asin"](m2 * Math["tan"](s2) / this["a"]) / Math["sin"](l2));
    }
  } else {
    if (Math["abs"](n2 + this["ml0"]) <= EPSLN) l2 = 0, k2 = b$a(this["long0"] + m2 / this["a"]);
    else {
      q2 = (this["ml0"] + n2) / this["a"], r2 = m2 * m2 / this["a"] / this["a"] + q2 * q2, s2 = q2;
      var v2, w2, z2, A5, B2;
      for (o2 = MAX_ITER$1; o2; --o2) {
        B2 = this["e"] * Math["sin"](s2), v2 = Math["sqrt"](1 - B2 * B2) * Math["tan"](s2), w2 = this["a"] * b$2(this["e0"], this["e1"], this["e2"], this["e3"], s2), z2 = this["e0"] - 2 * this["e1"] * Math["cos"](2 * s2) + 4 * this["e2"] * Math["cos"](4 * s2) - 6 * this["e3"] * Math["cos"](6 * s2), A5 = w2 / this["a"], t2 = (q2 * (v2 * A5 + 1) - A5 - 0.5 * v2 * (A5 * A5 + r2)) / (this["es"] * Math["sin"](2 * s2) * (A5 * A5 + r2 - 2 * q2 * A5) / (4 * v2) + (q2 - A5) * (v2 * z2 - 2 / Math["sin"](2 * s2)) - z2), s2 -= t2;
        if (Math["abs"](t2) <= EPSLN) {
          l2 = s2;
          break;
        }
      }
      v2 = Math["sqrt"](1 - this["es"] * Math["pow"](Math["sin"](l2), 2)) * Math["tan"](l2), k2 = b$a(this["long0"] + Math["asin"](m2 * v2 / this["a"]) / Math["sin"](l2));
    }
  }
  return j2["x"] = k2, j2["y"] = l2, j2;
}
var names$f = ["Polyconic", "poly"];
const p = { "init": init$f, "forward": forward$e, "inverse": inverse$e, "names": names$f };
function init$e() {
  this["A"] = [], this["A"][1] = 0.6399175073, this["A"][2] = -0.1358797613, this["A"][3] = 0.063294409, this["A"][4] = -0.02526853, this["A"][5] = 0.0117879, this["A"][6] = -55161e-7, this["A"][7] = 26906e-7, this["A"][8] = -1333e-6, this["A"][9] = 67e-5, this["A"][10] = -34e-5, this["B_re"] = [], this["B_im"] = [], this["B_re"][1] = 0.7557853228, this["B_im"][1] = 0, this["B_re"][2] = 0.249204646, this["B_im"][2] = 3371507e-9, this["B_re"][3] = -1541739e-9, this["B_im"][3] = 0.04105856, this["B_re"][4] = -0.10162907, this["B_im"][4] = 0.01727609, this["B_re"][5] = -0.26623489, this["B_im"][5] = -0.36249218, this["B_re"][6] = -0.6870983, this["B_im"][6] = -1.1651967, this["C_re"] = [], this["C_im"] = [], this["C_re"][1] = 1.3231270439, this["C_im"][1] = 0, this["C_re"][2] = -0.577245789, this["C_im"][2] = -7809598e-9, this["C_re"][3] = 0.508307513, this["C_im"][3] = -0.112208952, this["C_re"][4] = -0.15094762, this["C_im"][4] = 0.18200602, this["C_re"][5] = 1.01418179, this["C_im"][5] = 1.64497696, this["C_re"][6] = 1.9660549, this["C_im"][6] = 2.5127645, this["D"] = [], this["D"][1] = 1.5627014243, this["D"][2] = 0.5185406398, this["D"][3] = -0.03333098, this["D"][4] = -0.1052906, this["D"][5] = -0.0368594, this["D"][6] = 7317e-6, this["D"][7] = 0.0122, this["D"][8] = 394e-5, this["D"][9] = -13e-4;
}
function forward$d(a2) {
  var b2, c2 = a2["x"], d2 = a2["y"], e2 = d2 - this["lat0"], f2 = c2 - this["long0"], g2 = e2 / SEC_TO_RAD * 1e-5, h2 = f2, i2 = 1, j2 = 0;
  for (b2 = 1; b2 <= 10; b2++) {
    i2 = i2 * g2, j2 = j2 + this["A"][b2] * i2;
  }
  var k2 = j2, l2 = h2, m2 = 1, o2 = 0, q2, r2, s2 = 0, t2 = 0;
  for (b2 = 1; b2 <= 6; b2++) {
    q2 = m2 * k2 - o2 * l2, r2 = o2 * k2 + m2 * l2, m2 = q2, o2 = r2, s2 = s2 + this["B_re"][b2] * m2 - this["B_im"][b2] * o2, t2 = t2 + this["B_im"][b2] * m2 + this["B_re"][b2] * o2;
  }
  return a2["x"] = t2 * this["a"] + this["x0"], a2["y"] = s2 * this["a"] + this["y0"], a2;
}
function inverse$d(a2) {
  var b2, c2 = a2["x"], d2 = a2["y"], e2 = c2 - this["x0"], f2 = d2 - this["y0"], g2 = f2 / this["a"], h2 = e2 / this["a"], j2 = 1, k2 = 0, l2, m2, o2 = 0, q2 = 0;
  for (b2 = 1; b2 <= 6; b2++) {
    l2 = j2 * g2 - k2 * h2, m2 = k2 * g2 + j2 * h2, j2 = l2, k2 = m2, o2 = o2 + this["C_re"][b2] * j2 - this["C_im"][b2] * k2, q2 = q2 + this["C_im"][b2] * j2 + this["C_re"][b2] * k2;
  }
  for (var r2 = 0; r2 < this["iterations"]; r2++) {
    var s2 = o2, t2 = q2, u2, v2, w2 = g2, z2 = h2;
    for (b2 = 2; b2 <= 6; b2++) {
      u2 = s2 * o2 - t2 * q2, v2 = t2 * o2 + s2 * q2, s2 = u2, t2 = v2, w2 = w2 + (b2 - 1) * (this["B_re"][b2] * s2 - this["B_im"][b2] * t2), z2 = z2 + (b2 - 1) * (this["B_im"][b2] * s2 + this["B_re"][b2] * t2);
    }
    s2 = 1, t2 = 0;
    var A5 = this["B_re"][1], B2 = this["B_im"][1];
    for (b2 = 2; b2 <= 6; b2++) {
      u2 = s2 * o2 - t2 * q2, v2 = t2 * o2 + s2 * q2, s2 = u2, t2 = v2, A5 = A5 + b2 * (this["B_re"][b2] * s2 - this["B_im"][b2] * t2), B2 = B2 + b2 * (this["B_im"][b2] * s2 + this["B_re"][b2] * t2);
    }
    var C2 = A5 * A5 + B2 * B2;
    o2 = (w2 * A5 + z2 * B2) / C2, q2 = (z2 * A5 - w2 * B2) / C2;
  }
  var D2 = o2, E2 = q2, F = 1, G = 0;
  for (b2 = 1; b2 <= 9; b2++) {
    F = F * D2, G = G + this["D"][b2] * F;
  }
  var H = this["lat0"] + G * SEC_TO_RAD * 1e5, I2 = this["long0"] + E2;
  return a2["x"] = I2, a2["y"] = H, a2;
}
var names$e = ["New_Zealand_Map_Grid", "nzmg"];
const q = { "init": init$e, "forward": forward$d, "inverse": inverse$d, "names": names$e };
function init$d() {
}
function forward$c(b2) {
  var c2 = b2["x"], d2 = b2["y"], e2 = b$a(c2 - this["long0"]), f2 = this["x0"] + this["a"] * e2, g2 = this["y0"] + this["a"] * Math["log"](Math["tan"](Math["PI"] / 4 + d2 / 2.5)) * 1.25;
  return b2["x"] = f2, b2["y"] = g2, b2;
}
function inverse$c(b2) {
  b2["x"] -= this["x0"], b2["y"] -= this["y0"];
  var c2 = b$a(this["long0"] + b2["x"] / this["a"]), d2 = 2.5 * (Math["atan"](Math["exp"](0.8 * b2["y"] / this["a"])) - Math["PI"] / 4);
  return b2["x"] = c2, b2["y"] = d2, b2;
}
var names$d = ["Miller_Cylindrical", "mill"];
const r = { "init": init$d, "forward": forward$c, "inverse": inverse$c, "names": names$d };
var MAX_ITER = 20;
function init$c() {
  !this["sphere"] ? this["en"] = d$5(this["es"]) : (this["n"] = 1, this["m"] = 0, this["es"] = 0, this["C_y"] = Math["sqrt"]((this["m"] + 1) / this["n"]), this["C_x"] = this["C_y"] / (this["m"] + 1));
}
function forward$b(g2) {
  var h2, j2, l2 = g2["x"], m2 = g2["y"];
  l2 = b$a(l2 - this["long0"]);
  if (this["sphere"]) {
    if (!this["m"]) m2 = this["n"] !== 1 ? Math["asin"](this["n"] * Math["sin"](m2)) : m2;
    else {
      var n2 = this["n"] * Math["sin"](m2);
      for (var o2 = MAX_ITER; o2; --o2) {
        var q2 = (this["m"] * m2 + Math["sin"](m2) - n2) / (this["m"] + Math["cos"](m2));
        m2 -= q2;
        if (Math["abs"](q2) < EPSLN) break;
      }
    }
    h2 = this["a"] * this["C_x"] * l2 * (this["m"] + Math["cos"](m2)), j2 = this["a"] * this["C_y"] * m2;
  } else {
    var r2 = Math["sin"](m2), t2 = Math["cos"](m2);
    j2 = this["a"] * f$3(m2, r2, t2, this["en"]), h2 = this["a"] * l2 * t2 / Math["sqrt"](1 - this["es"] * r2 * r2);
  }
  return g2["x"] = h2, g2["y"] = j2, g2;
}
function inverse$b(g2) {
  var h2, i2, j2, k2;
  g2["x"] -= this["x0"], j2 = g2["x"] / this["a"], g2["y"] -= this["y0"], h2 = g2["y"] / this["a"];
  if (this["sphere"]) {
    h2 /= this["C_y"], j2 = j2 / (this["C_x"] * (this["m"] + Math["cos"](h2)));
    if (this["m"]) h2 = b((this["m"] * h2 + Math["sin"](h2)) / this["n"]);
    else this["n"] !== 1 && (h2 = b(Math["sin"](h2) / this["n"]));
    j2 = b$a(j2 + this["long0"]), h2 = a$2(h2);
  } else {
    h2 = e$3(g2["y"] / this["a"], this["es"], this["en"]), k2 = Math["abs"](h2);
    if (k2 < HALF_PI) k2 = Math["sin"](h2), i2 = this["long0"] + g2["x"] * Math["sqrt"](1 - this["es"] * k2 * k2) / (this["a"] * Math["cos"](h2)), j2 = b$a(i2);
    else k2 - EPSLN < HALF_PI && (j2 = this["long0"]);
  }
  return g2["x"] = j2, g2["y"] = h2, g2;
}
var names$c = ["Sinusoidal", "sinu"];
const s = { "init": init$c, "forward": forward$b, "inverse": inverse$b, "names": names$c };
function init$b() {
}
function forward$a(b2) {
  var c2 = b2["x"], d2 = b2["y"], e2 = b$a(c2 - this["long0"]), f2 = d2, g2 = Math["PI"] * Math["sin"](d2);
  while (!![]) {
    var h2 = -(f2 + Math["sin"](f2) - g2) / (1 + Math["cos"](f2));
    f2 += h2;
    if (Math["abs"](h2) < EPSLN) break;
  }
  f2 /= 2;
  Math["PI"] / 2 - Math["abs"](d2) < EPSLN && (e2 = 0);
  var i2 = 0.900316316158 * this["a"] * e2 * Math["cos"](f2) + this["x0"], j2 = 1.4142135623731 * this["a"] * Math["sin"](f2) + this["y0"];
  return b2["x"] = i2, b2["y"] = j2, b2;
}
function inverse$a(b2) {
  var c2, d2;
  b2["x"] -= this["x0"], b2["y"] -= this["y0"], d2 = b2["y"] / (1.4142135623731 * this["a"]);
  Math["abs"](d2) > 0.999999999999 && (d2 = 0.999999999999);
  c2 = Math["asin"](d2);
  var e2 = b$a(this["long0"] + b2["x"] / (0.900316316158 * this["a"] * Math["cos"](c2)));
  e2 < -Math["PI"] && (e2 = -Math["PI"]);
  e2 > Math["PI"] && (e2 = Math["PI"]);
  d2 = (2 * c2 + Math["sin"](2 * c2)) / Math["PI"];
  Math["abs"](d2) > 1 && (d2 = 1);
  var f2 = Math["asin"](d2);
  return b2["x"] = e2, b2["y"] = f2, b2;
}
var names$b = ["Mollweide", "moll"];
const t = { "init": init$b, "forward": forward$a, "inverse": inverse$a, "names": names$b };
function init$a() {
  if (Math["abs"](this["lat1"] + this["lat2"]) < EPSLN) return;
  this["lat2"] = this["lat2"] || this["lat1"], this["temp"] = this["b"] / this["a"], this["es"] = 1 - Math["pow"](this["temp"], 2), this["e"] = Math["sqrt"](this["es"]), this["e0"] = c(this["es"]), this["e1"] = d$2(this["es"]), this["e2"] = e(this["es"]), this["e3"] = f(this["es"]), this["sinphi"] = Math["sin"](this["lat1"]), this["cosphi"] = Math["cos"](this["lat1"]), this["ms1"] = e$6(this["e"], this["sinphi"], this["cosphi"]), this["ml1"] = b$2(this["e0"], this["e1"], this["e2"], this["e3"], this["lat1"]), Math["abs"](this["lat1"] - this["lat2"]) < EPSLN ? this["ns"] = this["sinphi"] : (this["sinphi"] = Math["sin"](this["lat2"]), this["cosphi"] = Math["cos"](this["lat2"]), this["ms2"] = e$6(this["e"], this["sinphi"], this["cosphi"]), this["ml2"] = b$2(this["e0"], this["e1"], this["e2"], this["e3"], this["lat2"]), this["ns"] = (this["ms1"] - this["ms2"]) / (this["ml2"] - this["ml1"])), this["g"] = this["ml1"] + this["ms1"] / this["ns"], this["ml0"] = b$2(this["e0"], this["e1"], this["e2"], this["e3"], this["lat0"]), this["rh"] = this["a"] * (this["g"] - this["ml0"]);
}
function forward$9(j2) {
  var k2 = j2["x"], l2 = j2["y"], m2;
  if (this["sphere"]) m2 = this["a"] * (this["g"] - l2);
  else {
    var n2 = b$2(this["e0"], this["e1"], this["e2"], this["e3"], l2);
    m2 = this["a"] * (this["g"] - n2);
  }
  var o2 = this["ns"] * b$a(k2 - this["long0"]), q2 = this["x0"] + m2 * Math["sin"](o2), r2 = this["y0"] + this["rh"] - m2 * Math["cos"](o2);
  return j2["x"] = q2, j2["y"] = r2, j2;
}
function inverse$9(j2) {
  j2["x"] -= this["x0"], j2["y"] = this["rh"] - j2["y"] + this["y0"];
  var k2, l2, m2, n2;
  this["ns"] >= 0 ? (l2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), k2 = 1) : (l2 = -Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), k2 = -1);
  var o2 = 0;
  l2 !== 0 && (o2 = Math["atan2"](k2 * j2["x"], k2 * j2["y"]));
  if (this["sphere"]) return n2 = b$a(this["long0"] + o2 / this["ns"]), m2 = a$2(this["g"] - l2 / this["a"]), j2["x"] = n2, j2["y"] = m2, j2;
  else {
    var q2 = this["g"] - l2 / this["a"];
    return m2 = i$1(q2, this["e0"], this["e1"], this["e2"], this["e3"]), n2 = b$a(this["long0"] + o2 / this["ns"]), j2["x"] = n2, j2["y"] = m2, j2;
  }
}
var names$a = ["Equidistant_Conic", "eqdc"];
const u = { "init": init$a, "forward": forward$9, "inverse": inverse$9, "names": names$a };
function init$9() {
  this["R"] = this["a"];
}
function forward$8(c2) {
  var d2 = c2["x"], e2 = c2["y"], f2 = b$a(d2 - this["long0"]), h2, i2;
  Math["abs"](e2) <= EPSLN && (h2 = this["x0"] + this["R"] * f2, i2 = this["y0"]);
  var j2 = b(2 * Math["abs"](e2 / Math["PI"]));
  (Math["abs"](f2) <= EPSLN || Math["abs"](Math["abs"](e2) - HALF_PI) <= EPSLN) && (h2 = this["x0"], e2 >= 0 ? i2 = this["y0"] + Math["PI"] * this["R"] * Math["tan"](0.5 * j2) : i2 = this["y0"] + Math["PI"] * this["R"] * -Math["tan"](0.5 * j2));
  var k2 = 0.5 * Math["abs"](Math["PI"] / f2 - f2 / Math["PI"]), l2 = k2 * k2, n2 = Math["sin"](j2), o2 = Math["cos"](j2), r2 = o2 / (n2 + o2 - 1), s2 = r2 * r2, t2 = r2 * (2 / n2 - 1), u2 = t2 * t2, v2 = Math["PI"] * this["R"] * (k2 * (r2 - u2) + Math["sqrt"](l2 * (r2 - u2) * (r2 - u2) - (u2 + l2) * (s2 - u2))) / (u2 + l2);
  f2 < 0 && (v2 = -v2);
  h2 = this["x0"] + v2;
  var w2 = l2 + r2;
  return v2 = Math["PI"] * this["R"] * (t2 * w2 - k2 * Math["sqrt"]((u2 + l2) * (l2 + 1) - w2 * w2)) / (u2 + l2), e2 >= 0 ? i2 = this["y0"] + v2 : i2 = this["y0"] - v2, c2["x"] = h2, c2["y"] = i2, c2;
}
function inverse$8(c2) {
  var e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, q2, r2;
  return c2["x"] -= this["x0"], c2["y"] -= this["y0"], o2 = Math["PI"] * this["R"], g2 = c2["x"] / o2, h2 = c2["y"] / o2, i2 = g2 * g2 + h2 * h2, j2 = -Math["abs"](h2) * (1 + i2), k2 = j2 - 2 * h2 * h2 + g2 * g2, l2 = -2 * j2 + 1 + 2 * h2 * h2 + i2 * i2, r2 = h2 * h2 / l2 + (2 * k2 * k2 * k2 / l2 / l2 / l2 - 9 * j2 * k2 / l2 / l2) / 27, m2 = (j2 - k2 * k2 / 3 / l2) / l2, n2 = 2 * Math["sqrt"](-m2 / 3), o2 = 3 * r2 / m2 / n2, Math["abs"](o2) > 1 && (o2 >= 0 ? o2 = 1 : o2 = -1), q2 = Math["acos"](o2) / 3, c2["y"] >= 0 ? f2 = (-n2 * Math["cos"](q2 + Math["PI"] / 3) - k2 / 3 / l2) * Math["PI"] : f2 = -(-n2 * Math["cos"](q2 + Math["PI"] / 3) - k2 / 3 / l2) * Math["PI"], Math["abs"](g2) < EPSLN ? e2 = this["long0"] : e2 = b$a(this["long0"] + Math["PI"] * (i2 - 1 + Math["sqrt"](1 + 2 * (g2 * g2 - h2 * h2) + i2 * i2)) / 2 / g2), c2["x"] = e2, c2["y"] = f2, c2;
}
var names$9 = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
const v = { "init": init$9, "forward": forward$8, "inverse": inverse$8, "names": names$9 };
function init$8() {
  this["sin_p12"] = Math["sin"](this["lat0"]), this["cos_p12"] = Math["cos"](this["lat0"]);
}
function forward$7(j2) {
  var k2 = j2["x"], l2 = j2["y"], m2 = Math["sin"](j2["y"]), n2 = Math["cos"](j2["y"]), o2 = b$a(k2 - this["long0"]), q2, r2, t2, u2, v2, w2, x2, y2, z2, A5, B2, C2, D2, E2, F, I2, J, K, L, M2, N, O2, P;
  if (this["sphere"]) {
    if (Math["abs"](this["sin_p12"] - 1) <= EPSLN) return j2["x"] = this["x0"] + this["a"] * (HALF_PI - l2) * Math["sin"](o2), j2["y"] = this["y0"] - this["a"] * (HALF_PI - l2) * Math["cos"](o2), j2;
    else return Math["abs"](this["sin_p12"] + 1) <= EPSLN ? (j2["x"] = this["x0"] + this["a"] * (HALF_PI + l2) * Math["sin"](o2), j2["y"] = this["y0"] + this["a"] * (HALF_PI + l2) * Math["cos"](o2), j2) : (K = this["sin_p12"] * m2 + this["cos_p12"] * n2 * Math["cos"](o2), I2 = Math["acos"](K), J = I2 ? I2 / Math["sin"](I2) : 1, j2["x"] = this["x0"] + this["a"] * J * n2 * Math["sin"](o2), j2["y"] = this["y0"] + this["a"] * J * (this["cos_p12"] * m2 - this["sin_p12"] * n2 * Math["cos"](o2)), j2);
  } else {
    q2 = c(this["es"]), r2 = d$2(this["es"]), t2 = e(this["es"]), u2 = f(this["es"]);
    if (Math["abs"](this["sin_p12"] - 1) <= EPSLN) return v2 = this["a"] * b$2(q2, r2, t2, u2, HALF_PI), w2 = this["a"] * b$2(q2, r2, t2, u2, l2), j2["x"] = this["x0"] + (v2 - w2) * Math["sin"](o2), j2["y"] = this["y0"] - (v2 - w2) * Math["cos"](o2), j2;
    else {
      if (Math["abs"](this["sin_p12"] + 1) <= EPSLN) return v2 = this["a"] * b$2(q2, r2, t2, u2, HALF_PI), w2 = this["a"] * b$2(q2, r2, t2, u2, l2), j2["x"] = this["x0"] + (v2 + w2) * Math["sin"](o2), j2["y"] = this["y0"] + (v2 + w2) * Math["cos"](o2), j2;
      else {
        x2 = m2 / n2, y2 = g(this["a"], this["e"], this["sin_p12"]), z2 = g(this["a"], this["e"], m2), A5 = Math["atan"]((1 - this["es"]) * x2 + this["es"] * y2 * this["sin_p12"] / (z2 * n2)), B2 = Math["atan2"](Math["sin"](o2), this["cos_p12"] * Math["tan"](A5) - this["sin_p12"] * Math["cos"](o2));
        if (B2 === 0) L = Math["asin"](this["cos_p12"] * Math["sin"](A5) - this["sin_p12"] * Math["cos"](A5));
        else Math["abs"](Math["abs"](B2) - Math["PI"]) <= EPSLN ? L = -Math["asin"](this["cos_p12"] * Math["sin"](A5) - this["sin_p12"] * Math["cos"](A5)) : L = Math["asin"](Math["sin"](o2) * Math["cos"](A5) / Math["sin"](B2));
        return C2 = this["e"] * this["sin_p12"] / Math["sqrt"](1 - this["es"]), D2 = this["e"] * this["cos_p12"] * Math["cos"](B2) / Math["sqrt"](1 - this["es"]), E2 = C2 * D2, F = D2 * D2, M2 = L * L, N = M2 * L, O2 = N * L, P = O2 * L, I2 = y2 * L * (1 - M2 * F * (1 - F) / 6 + N / 8 * E2 * (1 - 2 * F) + O2 / 120 * (F * (4 - 7 * F) - 3 * C2 * C2 * (1 - 7 * F)) - P / 48 * E2), j2["x"] = this["x0"] + I2 * Math["sin"](B2), j2["y"] = this["y0"] + I2 * Math["cos"](B2), j2;
      }
    }
  }
}
function inverse$7(j2) {
  j2["x"] -= this["x0"], j2["y"] -= this["y0"];
  var k2, l2, m2, n2, o2, q2, r2, s2, t2, u2, v2, w2, x2, y2, C2, E2, G, H, I2, J, K, L, N, O2;
  if (this["sphere"]) {
    k2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]);
    if (k2 > 2 * HALF_PI * this["a"]) return;
    return l2 = k2 / this["a"], m2 = Math["sin"](l2), n2 = Math["cos"](l2), o2 = this["long0"], Math["abs"](k2) <= EPSLN ? q2 = this["lat0"] : (q2 = b(n2 * this["sin_p12"] + j2["y"] * m2 * this["cos_p12"] / k2), r2 = Math["abs"](this["lat0"]) - HALF_PI, Math["abs"](r2) <= EPSLN ? this["lat0"] >= 0 ? o2 = b$a(this["long0"] + Math["atan2"](j2["x"], -j2["y"])) : o2 = b$a(this["long0"] - Math["atan2"](-j2["x"], j2["y"])) : o2 = b$a(this["long0"] + Math["atan2"](j2["x"] * m2, k2 * this["cos_p12"] * n2 - j2["y"] * this["sin_p12"] * m2))), j2["x"] = o2, j2["y"] = q2, j2;
  } else {
    s2 = c(this["es"]), t2 = d$2(this["es"]), u2 = e(this["es"]), v2 = f(this["es"]);
    if (Math["abs"](this["sin_p12"] - 1) <= EPSLN) return w2 = this["a"] * b$2(s2, t2, u2, v2, HALF_PI), k2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), x2 = w2 - k2, q2 = i$1(x2 / this["a"], s2, t2, u2, v2), o2 = b$a(this["long0"] + Math["atan2"](j2["x"], -1 * j2["y"])), j2["x"] = o2, j2["y"] = q2, j2;
    else return Math["abs"](this["sin_p12"] + 1) <= EPSLN ? (w2 = this["a"] * b$2(s2, t2, u2, v2, HALF_PI), k2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), x2 = k2 - w2, q2 = i$1(x2 / this["a"], s2, t2, u2, v2), o2 = b$a(this["long0"] + Math["atan2"](j2["x"], j2["y"])), j2["x"] = o2, j2["y"] = q2, j2) : (k2 = Math["sqrt"](j2["x"] * j2["x"] + j2["y"] * j2["y"]), E2 = Math["atan2"](j2["x"], j2["y"]), y2 = g(this["a"], this["e"], this["sin_p12"]), G = Math["cos"](E2), H = this["e"] * this["cos_p12"] * G, I2 = -H * H / (1 - this["es"]), J = 3 * this["es"] * (1 - I2) * this["sin_p12"] * this["cos_p12"] * G / (1 - this["es"]), K = k2 / y2, L = K - I2 * (1 + I2) * Math["pow"](K, 3) / 6 - J * (1 + 3 * I2) * Math["pow"](K, 4) / 24, N = 1 - I2 * L * L / 2 - K * L * L * L / 6, C2 = Math["asin"](this["sin_p12"] * Math["cos"](L) + this["cos_p12"] * Math["sin"](L) * G), o2 = b$a(this["long0"] + Math["asin"](Math["sin"](E2) * Math["sin"](L) / Math["cos"](C2))), O2 = Math["sin"](C2), q2 = Math["atan2"]((O2 - this["es"] * N * this["sin_p12"]) * Math["tan"](C2), O2 * (1 - this["es"])), j2["x"] = o2, j2["y"] = q2, j2);
  }
}
var names$8 = ["Azimuthal_Equidistant", "aeqd"];
const w = { "init": init$8, "forward": forward$7, "inverse": inverse$7, "names": names$8 };
function init$7() {
  this["sin_p14"] = Math["sin"](this["lat0"]), this["cos_p14"] = Math["cos"](this["lat0"]);
}
function forward$6(c2) {
  var d2, e2, f2, h2, i2, j2, k2, l2, m2 = c2["x"], n2 = c2["y"];
  return f2 = b$a(m2 - this["long0"]), d2 = Math["sin"](n2), e2 = Math["cos"](n2), h2 = Math["cos"](f2), j2 = this["sin_p14"] * d2 + this["cos_p14"] * e2 * h2, i2 = 1, (j2 > 0 || Math["abs"](j2) <= EPSLN) && (k2 = this["a"] * i2 * e2 * Math["sin"](f2), l2 = this["y0"] + this["a"] * i2 * (this["cos_p14"] * d2 - this["sin_p14"] * e2 * h2)), c2["x"] = k2, c2["y"] = l2, c2;
}
function inverse$6(c2) {
  var d2, e2, f2, g2, h2, i2, j2;
  c2["x"] -= this["x0"], c2["y"] -= this["y0"], d2 = Math["sqrt"](c2["x"] * c2["x"] + c2["y"] * c2["y"]), e2 = b(d2 / this["a"]), f2 = Math["sin"](e2), g2 = Math["cos"](e2), i2 = this["long0"];
  if (Math["abs"](d2) <= EPSLN) return j2 = this["lat0"], c2["x"] = i2, c2["y"] = j2, c2;
  j2 = b(g2 * this["sin_p14"] + c2["y"] * f2 * this["cos_p14"] / d2), h2 = Math["abs"](this["lat0"]) - HALF_PI;
  if (Math["abs"](h2) <= EPSLN) return this["lat0"] >= 0 ? i2 = b$a(this["long0"] + Math["atan2"](c2["x"], -c2["y"])) : i2 = b$a(this["long0"] - Math["atan2"](-c2["x"], c2["y"])), c2["x"] = i2, c2["y"] = j2, c2;
  return i2 = b$a(this["long0"] + Math["atan2"](c2["x"] * f2, d2 * this["cos_p14"] * g2 - c2["y"] * this["sin_p14"] * f2)), c2["x"] = i2, c2["y"] = j2, c2;
}
var names$7 = ["ortho"];
const x = { "init": init$7, "forward": forward$6, "inverse": inverse$6, "names": names$7 };
var FACE_ENUM = { "FRONT": 1, "RIGHT": 2, "BACK": 3, "LEFT": 4, "TOP": 5, "BOTTOM": 6 }, AREA_ENUM = { "AREA_0": 1, "AREA_1": 2, "AREA_2": 3, "AREA_3": 4 };
function init$6() {
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0, this["lat0"] = this["lat0"] || 0, this["long0"] = this["long0"] || 0, this["lat_ts"] = this["lat_ts"] || 0, this["title"] = this["title"] || "Quadrilateralized Spherical Cube";
  if (this["lat0"] >= HALF_PI - FORTPI / 2) this["face"] = FACE_ENUM["TOP"];
  else {
    if (this["lat0"] <= -(HALF_PI - FORTPI / 2)) this["face"] = FACE_ENUM["BOTTOM"];
    else {
      if (Math["abs"](this["long0"]) <= FORTPI) this["face"] = FACE_ENUM["FRONT"];
      else Math["abs"](this["long0"]) <= HALF_PI + FORTPI ? this["face"] = this["long0"] > 0 ? FACE_ENUM["RIGHT"] : FACE_ENUM["LEFT"] : this["face"] = FACE_ENUM["BACK"];
    }
  }
  this["es"] !== 0 && (this["one_minus_f"] = 1 - (this["a"] - this["b"]) / this["a"], this["one_minus_f_squared"] = this["one_minus_f"] * this["one_minus_f"]);
}
function forward$5(a2) {
  var b2 = { "x": 0, "y": 0 }, c2, d2, e2, f2, g2, h2, i2 = { "value": 0 };
  a2["x"] -= this["long0"];
  this["es"] !== 0 ? c2 = Math["atan"](this["one_minus_f_squared"] * Math["tan"](a2["y"])) : c2 = a2["y"];
  d2 = a2["x"];
  if (this["face"] === FACE_ENUM["TOP"]) {
    f2 = HALF_PI - c2;
    if (d2 >= FORTPI && d2 <= HALF_PI + FORTPI) i2["value"] = AREA_ENUM["AREA_0"], e2 = d2 - HALF_PI;
    else {
      if (d2 > HALF_PI + FORTPI || d2 <= -(HALF_PI + FORTPI)) i2["value"] = AREA_ENUM["AREA_1"], e2 = d2 > 0 ? d2 - SPI : d2 + SPI;
      else d2 > -(HALF_PI + FORTPI) && d2 <= -FORTPI ? (i2["value"] = AREA_ENUM["AREA_2"], e2 = d2 + HALF_PI) : (i2["value"] = AREA_ENUM["AREA_3"], e2 = d2);
    }
  } else {
    if (this["face"] === FACE_ENUM["BOTTOM"]) {
      f2 = HALF_PI + c2;
      if (d2 >= FORTPI && d2 <= HALF_PI + FORTPI) i2["value"] = AREA_ENUM["AREA_0"], e2 = -d2 + HALF_PI;
      else {
        if (d2 < FORTPI && d2 >= -FORTPI) i2["value"] = AREA_ENUM["AREA_1"], e2 = -d2;
        else d2 < -FORTPI && d2 >= -(HALF_PI + FORTPI) ? (i2["value"] = AREA_ENUM["AREA_2"], e2 = -d2 - HALF_PI) : (i2["value"] = AREA_ENUM["AREA_3"], e2 = d2 > 0 ? -d2 + SPI : -d2 - SPI);
      }
    } else {
      var j2, k2, l2, m2, n2, o2, u2;
      if (this["face"] === FACE_ENUM["RIGHT"]) d2 = qsc_shift_lon_origin(d2, +HALF_PI);
      else {
        if (this["face"] === FACE_ENUM["BACK"]) d2 = qsc_shift_lon_origin(d2, +SPI);
        else this["face"] === FACE_ENUM["LEFT"] && (d2 = qsc_shift_lon_origin(d2, -HALF_PI));
      }
      m2 = Math["sin"](c2), n2 = Math["cos"](c2), o2 = Math["sin"](d2), u2 = Math["cos"](d2), j2 = n2 * u2, k2 = n2 * o2, l2 = m2;
      if (this["face"] === FACE_ENUM["FRONT"]) f2 = Math["acos"](j2), e2 = qsc_fwd_equat_face_theta(f2, l2, k2, i2);
      else {
        if (this["face"] === FACE_ENUM["RIGHT"]) f2 = Math["acos"](k2), e2 = qsc_fwd_equat_face_theta(f2, l2, -j2, i2);
        else {
          if (this["face"] === FACE_ENUM["BACK"]) f2 = Math["acos"](-j2), e2 = qsc_fwd_equat_face_theta(f2, l2, -k2, i2);
          else this["face"] === FACE_ENUM["LEFT"] ? (f2 = Math["acos"](-k2), e2 = qsc_fwd_equat_face_theta(f2, l2, j2, i2)) : (f2 = e2 = 0, i2["value"] = AREA_ENUM["AREA_0"]);
        }
      }
    }
  }
  h2 = Math["atan"](12 / SPI * (e2 + Math["acos"](Math["sin"](e2) * Math["cos"](FORTPI)) - HALF_PI)), g2 = Math["sqrt"]((1 - Math["cos"](f2)) / (Math["cos"](h2) * Math["cos"](h2)) / (1 - Math["cos"](Math["atan"](1 / Math["cos"](e2)))));
  if (i2["value"] === AREA_ENUM["AREA_1"]) h2 += HALF_PI;
  else {
    if (i2["value"] === AREA_ENUM["AREA_2"]) h2 += SPI;
    else i2["value"] === AREA_ENUM["AREA_3"] && (h2 += 1.5 * SPI);
  }
  return b2["x"] = g2 * Math["cos"](h2), b2["y"] = g2 * Math["sin"](h2), b2["x"] = b2["x"] * this["a"] + this["x0"], b2["y"] = b2["y"] * this["a"] + this["y0"], a2["x"] = b2["x"], a2["y"] = b2["y"], a2;
}
function inverse$5(a2) {
  var b2 = { "lam": 0, "phi": 0 }, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2 = { "value": 0 };
  a2["x"] = (a2["x"] - this["x0"]) / this["a"], a2["y"] = (a2["y"] - this["y0"]) / this["a"], d2 = Math["atan"](Math["sqrt"](a2["x"] * a2["x"] + a2["y"] * a2["y"])), c2 = Math["atan2"](a2["y"], a2["x"]);
  if (a2["x"] >= 0 && a2["x"] >= Math["abs"](a2["y"])) l2["value"] = AREA_ENUM["AREA_0"];
  else {
    if (a2["y"] >= 0 && a2["y"] >= Math["abs"](a2["x"])) l2["value"] = AREA_ENUM["AREA_1"], c2 -= HALF_PI;
    else a2["x"] < 0 && -a2["x"] >= Math["abs"](a2["y"]) ? (l2["value"] = AREA_ENUM["AREA_2"], c2 = c2 < 0 ? c2 + SPI : c2 - SPI) : (l2["value"] = AREA_ENUM["AREA_3"], c2 += HALF_PI);
  }
  k2 = SPI / 12 * Math["tan"](c2), g2 = Math["sin"](k2) / (Math["cos"](k2) - 1 / Math["sqrt"](2)), h2 = Math["atan"](g2), e2 = Math["cos"](c2), f2 = Math["tan"](d2), i2 = 1 - e2 * e2 * f2 * f2 * (1 - Math["cos"](Math["atan"](1 / Math["cos"](h2))));
  if (i2 < -1) i2 = -1;
  else i2 > 1 && (i2 = 1);
  if (this["face"] === FACE_ENUM["TOP"]) {
    j2 = Math["acos"](i2), b2["phi"] = HALF_PI - j2;
    if (l2["value"] === AREA_ENUM["AREA_0"]) b2["lam"] = h2 + HALF_PI;
    else {
      if (l2["value"] === AREA_ENUM["AREA_1"]) b2["lam"] = h2 < 0 ? h2 + SPI : h2 - SPI;
      else l2["value"] === AREA_ENUM["AREA_2"] ? b2["lam"] = h2 - HALF_PI : b2["lam"] = h2;
    }
  } else {
    if (this["face"] === FACE_ENUM["BOTTOM"]) {
      j2 = Math["acos"](i2), b2["phi"] = j2 - HALF_PI;
      if (l2["value"] === AREA_ENUM["AREA_0"]) b2["lam"] = -h2 + HALF_PI;
      else {
        if (l2["value"] === AREA_ENUM["AREA_1"]) b2["lam"] = -h2;
        else l2["value"] === AREA_ENUM["AREA_2"] ? b2["lam"] = -h2 - HALF_PI : b2["lam"] = h2 < 0 ? -h2 - SPI : -h2 + SPI;
      }
    } else {
      var m2, n2, o2;
      m2 = i2, k2 = m2 * m2;
      k2 >= 1 ? o2 = 0 : o2 = Math["sqrt"](1 - k2) * Math["sin"](h2);
      k2 += o2 * o2;
      k2 >= 1 ? n2 = 0 : n2 = Math["sqrt"](1 - k2);
      if (l2["value"] === AREA_ENUM["AREA_1"]) k2 = n2, n2 = -o2, o2 = k2;
      else {
        if (l2["value"] === AREA_ENUM["AREA_2"]) n2 = -n2, o2 = -o2;
        else l2["value"] === AREA_ENUM["AREA_3"] && (k2 = n2, n2 = o2, o2 = -k2);
      }
      if (this["face"] === FACE_ENUM["RIGHT"]) k2 = m2, m2 = -n2, n2 = k2;
      else {
        if (this["face"] === FACE_ENUM["BACK"]) m2 = -m2, n2 = -n2;
        else this["face"] === FACE_ENUM["LEFT"] && (k2 = m2, m2 = n2, n2 = -k2);
      }
      b2["phi"] = Math["acos"](-o2) - HALF_PI, b2["lam"] = Math["atan2"](n2, m2);
      if (this["face"] === FACE_ENUM["RIGHT"]) b2["lam"] = qsc_shift_lon_origin(b2["lam"], -HALF_PI);
      else {
        if (this["face"] === FACE_ENUM["BACK"]) b2["lam"] = qsc_shift_lon_origin(b2["lam"], -SPI);
        else this["face"] === FACE_ENUM["LEFT"] && (b2["lam"] = qsc_shift_lon_origin(b2["lam"], +HALF_PI));
      }
    }
  }
  if (this["es"] !== 0) {
    var u2, v2, w2;
    u2 = b2["phi"] < 0 ? 1 : 0, v2 = Math["tan"](b2["phi"]), w2 = this["b"] / Math["sqrt"](v2 * v2 + this["one_minus_f_squared"]), b2["phi"] = Math["atan"](Math["sqrt"](this["a"] * this["a"] - w2 * w2) / (this["one_minus_f"] * w2)), u2 && (b2["phi"] = -b2["phi"]);
  }
  return b2["lam"] += this["long0"], a2["x"] = b2["lam"], a2["y"] = b2["phi"], a2;
}
function qsc_fwd_equat_face_theta(a2, b2, c2, d2) {
  var e2;
  if (a2 < EPSLN) d2["value"] = AREA_ENUM["AREA_0"], e2 = 0;
  else {
    e2 = Math["atan2"](b2, c2);
    if (Math["abs"](e2) <= FORTPI) d2["value"] = AREA_ENUM["AREA_0"];
    else {
      if (e2 > FORTPI && e2 <= HALF_PI + FORTPI) d2["value"] = AREA_ENUM["AREA_1"], e2 -= HALF_PI;
      else e2 > HALF_PI + FORTPI || e2 <= -(HALF_PI + FORTPI) ? (d2["value"] = AREA_ENUM["AREA_2"], e2 = e2 >= 0 ? e2 - SPI : e2 + SPI) : (d2["value"] = AREA_ENUM["AREA_3"], e2 += HALF_PI);
    }
  }
  return e2;
}
function qsc_shift_lon_origin(a2, b2) {
  var c2 = a2 + b2;
  if (c2 < -SPI) c2 += TWO_PI;
  else c2 > +SPI && (c2 -= TWO_PI);
  return c2;
}
var names$6 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
const y = { "init": init$6, "forward": forward$5, "inverse": inverse$5, "names": names$6 };
var COEFS_X = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], COEFS_Y = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], FXC = 0.8487, FYC = 1.3523, C1 = R2D / 5, RC1 = 1 / C1, NODES = 18, poly3_val = function(b2, c2) {
  return b2[0] + c2 * (b2[1] + c2 * (b2[2] + c2 * b2[3]));
}, poly3_der = function(b2, c2) {
  return b2[1] + c2 * (2 * b2[2] + c2 * 3 * b2[3]);
};
function newton_rapshon(b2, c2, d2, e2) {
  var f2 = c2;
  for (; e2; --e2) {
    var g2 = b2(f2);
    f2 -= g2;
    if (Math["abs"](g2) < d2) break;
  }
  return f2;
}
function init$5() {
  this["x0"] = this["x0"] || 0, this["y0"] = this["y0"] || 0, this["long0"] = this["long0"] || 0, this["es"] = 0, this["title"] = this["title"] || "Robinson";
}
function forward$4(b2) {
  var c2 = b$a(b2["x"] - this["long0"]), d2 = Math["abs"](b2["y"]), e2 = Math["floor"](d2 * C1);
  if (e2 < 0) e2 = 0;
  else e2 >= NODES && (e2 = NODES - 1);
  d2 = R2D * (d2 - RC1 * e2);
  var f2 = { "x": poly3_val(COEFS_X[e2], d2) * c2, "y": poly3_val(COEFS_Y[e2], d2) };
  return b2["y"] < 0 && (f2["y"] = -f2["y"]), f2["x"] = f2["x"] * this["a"] * FXC + this["x0"], f2["y"] = f2["y"] * this["a"] * FYC + this["y0"], f2;
}
function inverse$4(b2) {
  var c2 = { "x": (b2["x"] - this["x0"]) / (this["a"] * FXC), "y": Math["abs"](b2["y"] - this["y0"]) / (this["a"] * FYC) };
  if (c2["y"] >= 1) c2["x"] /= COEFS_X[NODES][0], c2["y"] = b2["y"] < 0 ? -HALF_PI : HALF_PI;
  else {
    var d2 = Math["floor"](c2["y"] * NODES);
    if (d2 < 0) d2 = 0;
    else d2 >= NODES && (d2 = NODES - 1);
    for (; ; ) {
      if (COEFS_Y[d2][0] > c2["y"]) --d2;
      else {
        if (COEFS_Y[d2 + 1][0] <= c2["y"]) ++d2;
        else break;
      }
    }
    var e2 = COEFS_Y[d2], f2 = 5 * (c2["y"] - e2[0]) / (COEFS_Y[d2 + 1][0] - e2[0]);
    f2 = newton_rapshon(function(g2) {
      return (poly3_val(e2, g2) - c2["y"]) / poly3_der(e2, g2);
    }, f2, EPSLN, 100), c2["x"] /= poly3_val(COEFS_X[d2], f2), c2["y"] = (5 * d2 + f2) * D2R$1, b2["y"] < 0 && (c2["y"] = -c2["y"]);
  }
  return c2["x"] = b$a(c2["x"] + this["long0"]), c2;
}
var names$5 = ["Robinson", "robin"];
const z = { "init": init$5, "forward": forward$4, "inverse": inverse$4, "names": names$5 };
function init$4() {
  this["name"] = "geocent";
}
function forward$3(a2) {
  var b2 = geodeticToGeocentric(a2, this["es"], this["a"]);
  return b2;
}
function inverse$3(a2) {
  var b2 = geocentricToGeodetic(a2, this["es"], this["a"], this["b"]);
  return b2;
}
var names$4 = ["Geocentric", "geocentric", "geocent", "Geocent"];
const A = { "init": init$4, "forward": forward$3, "inverse": inverse$3, "names": names$4 };
var mode = { "N_POLE": 0, "S_POLE": 1, "EQUIT": 2, "OBLIQ": 3 };
var params = { "h": { "def": 1e5, "num": !![] }, "azi": { "def": 0, "num": !![], "degrees": !![] }, "tilt": { "def": 0, "num": !![], "degrees": !![] }, "long0": { "def": 0, "num": !![] }, "lat0": { "def": 0, "num": !![] } };
function init$3() {
  Object["keys"](params)["forEach"]((function(d2) {
    if (typeof this[d2] === "undefined") this[d2] = params[d2]["def"];
    else {
      if (params[d2]["num"] && isNaN(this[d2])) throw new Error("Invalid parameter value, must be numeric " + d2 + " = " + this[d2]);
      else params[d2]["num"] && (this[d2] = parseFloat(this[d2]));
    }
    params[d2]["degrees"] && (this[d2] = this[d2] * D2R$1);
  })["bind"](this));
  if (Math["abs"](Math["abs"](this["lat0"]) - HALF_PI) < EPSLN) this["mode"] = this["lat0"] < 0 ? mode["S_POLE"] : mode["N_POLE"];
  else Math["abs"](this["lat0"]) < EPSLN ? this["mode"] = mode["EQUIT"] : (this["mode"] = mode["OBLIQ"], this["sinph0"] = Math["sin"](this["lat0"]), this["cosph0"] = Math["cos"](this["lat0"]));
  this["pn1"] = this["h"] / this["a"];
  if (this["pn1"] <= 0 || this["pn1"] > 1e10) throw new Error("Invalid height");
  this["p"] = 1 + this["pn1"], this["rp"] = 1 / this["p"], this["h1"] = 1 / this["pn1"], this["pfact"] = (this["p"] + 1) * this["h1"], this["es"] = 0;
  var b2 = this["tilt"], c2 = this["azi"];
  this["cg"] = Math["cos"](c2), this["sg"] = Math["sin"](c2), this["cw"] = Math["cos"](b2), this["sw"] = Math["sin"](b2);
}
function forward$2(b2) {
  b2["x"] -= this["long0"];
  var c2 = Math["sin"](b2["y"]), d2 = Math["cos"](b2["y"]), e2 = Math["cos"](b2["x"]), f2, g2;
  switch (this["mode"]) {
    case mode["OBLIQ"]:
      g2 = this["sinph0"] * c2 + this["cosph0"] * d2 * e2;
      break;
    case mode["EQUIT"]:
      g2 = d2 * e2;
      break;
    case mode["S_POLE"]:
      g2 = -c2;
      break;
    case mode["N_POLE"]:
      g2 = c2;
      break;
  }
  g2 = this["pn1"] / (this["p"] - g2), f2 = g2 * d2 * Math["sin"](b2["x"]);
  switch (this["mode"]) {
    case mode["OBLIQ"]:
      g2 *= this["cosph0"] * c2 - this["sinph0"] * d2 * e2;
      break;
    case mode["EQUIT"]:
      g2 *= c2;
      break;
    case mode["N_POLE"]:
      g2 *= -(d2 * e2);
      break;
    case mode["S_POLE"]:
      g2 *= d2 * e2;
      break;
  }
  var h2, i2;
  return h2 = g2 * this["cg"] + f2 * this["sg"], i2 = 1 / (h2 * this["sw"] * this["h1"] + this["cw"]), f2 = (f2 * this["cg"] - g2 * this["sg"]) * this["cw"] * i2, g2 = h2 * i2, b2["x"] = f2 * this["a"], b2["y"] = g2 * this["a"], b2;
}
function inverse$2(b2) {
  b2["x"] /= this["a"], b2["y"] /= this["a"];
  var c2 = { "x": b2["x"], "y": b2["y"] }, d2, e2, f2;
  f2 = 1 / (this["pn1"] - b2["y"] * this["sw"]), d2 = this["pn1"] * b2["x"] * f2, e2 = this["pn1"] * b2["y"] * this["cw"] * f2, b2["x"] = d2 * this["cg"] + e2 * this["sg"], b2["y"] = e2 * this["cg"] - d2 * this["sg"];
  var g2 = c$2(b2["x"], b2["y"]);
  if (Math["abs"](g2) < EPSLN) c2["x"] = 0, c2["y"] = b2["y"];
  else {
    var h2, i2;
    i2 = 1 - g2 * g2 * this["pfact"], i2 = (this["p"] - Math["sqrt"](i2)) / (this["pn1"] / g2 + g2 / this["pn1"]), h2 = Math["sqrt"](1 - i2 * i2);
    switch (this["mode"]) {
      case mode["OBLIQ"]:
        c2["y"] = Math["asin"](h2 * this["sinph0"] + b2["y"] * i2 * this["cosph0"] / g2), b2["y"] = (h2 - this["sinph0"] * Math["sin"](c2["y"])) * g2, b2["x"] *= i2 * this["cosph0"];
        break;
      case mode["EQUIT"]:
        c2["y"] = Math["asin"](b2["y"] * i2 / g2), b2["y"] = h2 * g2, b2["x"] *= i2;
        break;
      case mode["N_POLE"]:
        c2["y"] = Math["asin"](h2), b2["y"] = -b2["y"];
        break;
      case mode["S_POLE"]:
        c2["y"] = -Math["asin"](h2);
        break;
    }
    c2["x"] = Math["atan2"](b2["x"], b2["y"]);
  }
  return b2["x"] = c2["x"] + this["long0"], b2["y"] = c2["y"], b2;
}
var names$3 = ["Tilted_Perspective", "tpers"];
const B = { "init": init$3, "forward": forward$2, "inverse": inverse$2, "names": names$3 };
function init$2() {
  this["flip_axis"] = this["sweep"] === "x" ? 1 : 0, this["h"] = Number(this["h"]), this["radius_g_1"] = this["h"] / this["a"];
  if (this["radius_g_1"] <= 0 || this["radius_g_1"] > 1e10) throw new Error();
  this["radius_g"] = 1 + this["radius_g_1"], this["C"] = this["radius_g"] * this["radius_g"] - 1;
  if (this["es"] !== 0) {
    var b2 = 1 - this["es"], c2 = 1 / b2;
    this["radius_p"] = Math["sqrt"](b2), this["radius_p2"] = b2, this["radius_p_inv2"] = c2, this["shape"] = "ellipse";
  } else this["radius_p"] = 1, this["radius_p2"] = 1, this["radius_p_inv2"] = 1, this["shape"] = "sphere";
  !this["title"] && (this["title"] = "Geostationary Satellite View");
}
function forward$1(b2) {
  var c2 = b2["x"], d2 = b2["y"], e2, f2, g2, h2;
  c2 = c2 - this["long0"];
  if (this["shape"] === "ellipse") {
    d2 = Math["atan"](this["radius_p2"] * Math["tan"](d2));
    var i2 = this["radius_p"] / c$2(this["radius_p"] * Math["cos"](d2), Math["sin"](d2));
    f2 = i2 * Math["cos"](c2) * Math["cos"](d2), g2 = i2 * Math["sin"](c2) * Math["cos"](d2), h2 = i2 * Math["sin"](d2);
    if ((this["radius_g"] - f2) * f2 - g2 * g2 - h2 * h2 * this["radius_p_inv2"] < 0) return b2["x"] = Number["NaN"], b2["y"] = Number["NaN"], b2;
    e2 = this["radius_g"] - f2, this["flip_axis"] ? (b2["x"] = this["radius_g_1"] * Math["atan"](g2 / c$2(h2, e2)), b2["y"] = this["radius_g_1"] * Math["atan"](h2 / e2)) : (b2["x"] = this["radius_g_1"] * Math["atan"](g2 / e2), b2["y"] = this["radius_g_1"] * Math["atan"](h2 / c$2(g2, e2)));
  } else this["shape"] === "sphere" && (e2 = Math["cos"](d2), f2 = Math["cos"](c2) * e2, g2 = Math["sin"](c2) * e2, h2 = Math["sin"](d2), e2 = this["radius_g"] - f2, this["flip_axis"] ? (b2["x"] = this["radius_g_1"] * Math["atan"](g2 / c$2(h2, e2)), b2["y"] = this["radius_g_1"] * Math["atan"](h2 / e2)) : (b2["x"] = this["radius_g_1"] * Math["atan"](g2 / e2), b2["y"] = this["radius_g_1"] * Math["atan"](h2 / c$2(g2, e2))));
  return b2["x"] = b2["x"] * this["a"], b2["y"] = b2["y"] * this["a"], b2;
}
function inverse$1(c2) {
  var d2 = -1, e2 = 0, f2 = 0, g2, h2, i2, j2;
  c2["x"] = c2["x"] / this["a"], c2["y"] = c2["y"] / this["a"];
  if (this["shape"] === "ellipse") {
    this["flip_axis"] ? (f2 = Math["tan"](c2["y"] / this["radius_g_1"]), e2 = Math["tan"](c2["x"] / this["radius_g_1"]) * c$2(1, f2)) : (e2 = Math["tan"](c2["x"] / this["radius_g_1"]), f2 = Math["tan"](c2["y"] / this["radius_g_1"]) * c$2(1, e2));
    var l2 = f2 / this["radius_p"];
    g2 = e2 * e2 + l2 * l2 + d2 * d2, h2 = 2 * this["radius_g"] * d2, i2 = h2 * h2 - 4 * g2 * this["C"];
    if (i2 < 0) return c2["x"] = Number["NaN"], c2["y"] = Number["NaN"], c2;
    j2 = (-h2 - Math["sqrt"](i2)) / (2 * g2), d2 = this["radius_g"] + j2 * d2, e2 *= j2, f2 *= j2, c2["x"] = Math["atan2"](e2, d2), c2["y"] = Math["atan"](f2 * Math["cos"](c2["x"]) / d2), c2["y"] = Math["atan"](this["radius_p_inv2"] * Math["tan"](c2["y"]));
  } else {
    if (this["shape"] === "sphere") {
      this["flip_axis"] ? (f2 = Math["tan"](c2["y"] / this["radius_g_1"]), e2 = Math["tan"](c2["x"] / this["radius_g_1"]) * Math["sqrt"](1 + f2 * f2)) : (e2 = Math["tan"](c2["x"] / this["radius_g_1"]), f2 = Math["tan"](c2["y"] / this["radius_g_1"]) * Math["sqrt"](1 + e2 * e2));
      g2 = e2 * e2 + f2 * f2 + d2 * d2, h2 = 2 * this["radius_g"] * d2, i2 = h2 * h2 - 4 * g2 * this["C"];
      if (i2 < 0) return c2["x"] = Number["NaN"], c2["y"] = Number["NaN"], c2;
      j2 = (-h2 - Math["sqrt"](i2)) / (2 * g2), d2 = this["radius_g"] + j2 * d2, e2 *= j2, f2 *= j2, c2["x"] = Math["atan2"](e2, d2), c2["y"] = Math["atan"](f2 * Math["cos"](c2["x"]) / d2);
    }
  }
  return c2["x"] = c2["x"] + this["long0"], c2;
}
var names$2 = ["Geostationary Satellite View", "Geostationary_Satellite", "geos"];
const C = { "init": init$2, "forward": forward$1, "inverse": inverse$1, "names": names$2 };
var A1 = 1.340264, A2 = -0.081106, A3 = 893e-6, A4 = 3796e-6, M = Math["sqrt"](3) / 2;
function init$1() {
  this["es"] = 0, this["long0"] = this["long0"] !== void 0 ? this["long0"] : 0;
}
function forward(b2) {
  var c2 = b$a(b2["x"] - this["long0"]), d2 = b2["y"], e2 = Math["asin"](M * Math["sin"](d2)), f2 = e2 * e2, g2 = f2 * f2 * f2;
  return b2["x"] = c2 * Math["cos"](e2) / (M * (A1 + 3 * A2 * f2 + g2 * (7 * A3 + 9 * A4 * f2))), b2["y"] = e2 * (A1 + A2 * f2 + g2 * (A3 + A4 * f2)), b2["x"] = this["a"] * b2["x"] + this["x0"], b2["y"] = this["a"] * b2["y"] + this["y0"], b2;
}
function inverse(b2) {
  b2["x"] = (b2["x"] - this["x0"]) / this["a"], b2["y"] = (b2["y"] - this["y0"]) / this["a"];
  var c2 = 1e-9, d2 = 12, e2 = b2["y"], f2, g2, h2, j2, k2, l2;
  for (l2 = 0; l2 < d2; ++l2) {
    f2 = e2 * e2, g2 = f2 * f2 * f2, h2 = e2 * (A1 + A2 * f2 + g2 * (A3 + A4 * f2)) - b2["y"], j2 = A1 + 3 * A2 * f2 + g2 * (7 * A3 + 9 * A4 * f2), e2 -= k2 = h2 / j2;
    if (Math["abs"](k2) < c2) break;
  }
  return f2 = e2 * e2, g2 = f2 * f2 * f2, b2["x"] = M * b2["x"] * (A1 + 3 * A2 * f2 + g2 * (7 * A3 + 9 * A4 * f2)) / Math["cos"](e2), b2["y"] = Math["asin"](Math["sin"](e2) / M), b2["x"] = b$a(b2["x"] + this["long0"]), b2;
}
var names$1 = ["eqearth", "Equal Earth", "Equal_Earth"];
const D = { "init": init$1, "forward": forward, "inverse": inverse, "names": names$1 };
var EPS10 = 1e-10;
function init() {
  var g2;
  this["phi1"] = this["lat1"];
  if (Math["abs"](this["phi1"]) < EPS10) throw new Error();
  this["es"] ? (this["en"] = d$5(this["es"]), this["m1"] = f$3(this["phi1"], this["am1"] = Math["sin"](this["phi1"]), g2 = Math["cos"](this["phi1"]), this["en"]), this["am1"] = g2 / (Math["sqrt"](1 - this["es"] * this["am1"] * this["am1"]) * this["am1"]), this["inverse"] = e_inv, this["forward"] = e_fwd) : (Math["abs"](this["phi1"]) + EPS10 >= HALF_PI ? this["cphi1"] = 0 : this["cphi1"] = 1 / Math["tan"](this["phi1"]), this["inverse"] = s_inv, this["forward"] = s_fwd);
}
function e_fwd(g2) {
  var h2 = b$a(g2["x"] - (this["long0"] || 0)), i2 = g2["y"], j2, k2, l2;
  return j2 = this["am1"] + this["m1"] - f$3(i2, k2 = Math["sin"](i2), l2 = Math["cos"](i2), this["en"]), k2 = l2 * h2 / (j2 * Math["sqrt"](1 - this["es"] * k2 * k2)), g2["x"] = j2 * Math["sin"](k2), g2["y"] = this["am1"] - j2 * Math["cos"](k2), g2["x"] = this["a"] * g2["x"] + (this["x0"] || 0), g2["y"] = this["a"] * g2["y"] + (this["y0"] || 0), g2;
}
function e_inv(g2) {
  g2["x"] = (g2["x"] - (this["x0"] || 0)) / this["a"], g2["y"] = (g2["y"] - (this["y0"] || 0)) / this["a"];
  var h2, i2, j2, k2;
  i2 = c$2(g2["x"], g2["y"] = this["am1"] - g2["y"]), k2 = e$3(this["am1"] + this["m1"] - i2, this["es"], this["en"]);
  if ((h2 = Math["abs"](k2)) < HALF_PI) h2 = Math["sin"](k2), j2 = i2 * Math["atan2"](g2["x"], g2["y"]) * Math["sqrt"](1 - this["es"] * h2 * h2) / Math["cos"](k2);
  else {
    if (Math["abs"](h2 - HALF_PI) <= EPS10) j2 = 0;
    else throw new Error();
  }
  return g2["x"] = b$a(j2 + (this["long0"] || 0)), g2["y"] = a$2(k2), g2;
}
function s_fwd(g2) {
  var h2 = b$a(g2["x"] - (this["long0"] || 0)), i2 = g2["y"], j2, k2;
  return k2 = this["cphi1"] + this["phi1"] - i2, Math["abs"](k2) > EPS10 ? (g2["x"] = k2 * Math["sin"](j2 = h2 * Math["cos"](i2) / k2), g2["y"] = this["cphi1"] - k2 * Math["cos"](j2)) : g2["x"] = g2["y"] = 0, g2["x"] = this["a"] * g2["x"] + (this["x0"] || 0), g2["y"] = this["a"] * g2["y"] + (this["y0"] || 0), g2;
}
function s_inv(g2) {
  g2["x"] = (g2["x"] - (this["x0"] || 0)) / this["a"], g2["y"] = (g2["y"] - (this["y0"] || 0)) / this["a"];
  var h2, i2, j2 = c$2(g2["x"], g2["y"] = this["cphi1"] - g2["y"]);
  i2 = this["cphi1"] + this["phi1"] - j2;
  if (Math["abs"](i2) > HALF_PI) throw new Error();
  return Math["abs"](Math["abs"](i2) - HALF_PI) <= EPS10 ? h2 = 0 : h2 = j2 * Math["atan2"](g2["x"], g2["y"]) / Math["cos"](i2), g2["x"] = b$a(h2 + (this["long0"] || 0)), g2["y"] = a$2(i2), g2;
}
var names = ["bonne", "Bonne (Werner lat_1=90)"];
const E = { "init": init, "names": names };
function i(proj42) {
  proj42["Proj"]["projections"]["add"](a$6), proj42["Proj"]["projections"]["add"](b$3), proj42["Proj"]["projections"]["add"](c$1), proj42["Proj"]["projections"]["add"](d$3), proj42["Proj"]["projections"]["add"](e$1), proj42["Proj"]["projections"]["add"](f$1), proj42["Proj"]["projections"]["add"](g$1), proj42["Proj"]["projections"]["add"](h), proj42["Proj"]["projections"]["add"](i$2), proj42["Proj"]["projections"]["add"](j), proj42["Proj"]["projections"]["add"](k), proj42["Proj"]["projections"]["add"](l), proj42["Proj"]["projections"]["add"](m), proj42["Proj"]["projections"]["add"](n), proj42["Proj"]["projections"]["add"](o), proj42["Proj"]["projections"]["add"](p), proj42["Proj"]["projections"]["add"](q), proj42["Proj"]["projections"]["add"](r), proj42["Proj"]["projections"]["add"](s), proj42["Proj"]["projections"]["add"](t), proj42["Proj"]["projections"]["add"](u), proj42["Proj"]["projections"]["add"](v), proj42["Proj"]["projections"]["add"](w), proj42["Proj"]["projections"]["add"](x), proj42["Proj"]["projections"]["add"](y), proj42["Proj"]["projections"]["add"](z), proj42["Proj"]["projections"]["add"](A), proj42["Proj"]["projections"]["add"](B), proj42["Proj"]["projections"]["add"](C), proj42["Proj"]["projections"]["add"](D), proj42["Proj"]["projections"]["add"](E);
}
proj4["defaultDatum"] = "WGS84", proj4["Proj"] = Projection, proj4["WGS84"] = new proj4["Proj"]("WGS84"), proj4["Point"] = Point, proj4["toPoint"] = d$6, proj4["defs"] = defs, proj4["nadgrid"] = nadgrid, proj4["transform"] = transform, proj4["mgrs"] = h$1, proj4["version"] = "__VERSION__", i(proj4);
function degree2dms(d2) {
  d2 = Math["abs"](d2);
  const e2 = Math["floor"](d2), f2 = Math["floor"]((d2 - e2) * 60), g2 = Math["round"]((d2 - e2) * 3600 % 60);
  return { "degree": e2, "minute": f2, "second": g2, "str": e2 + "° " + f2 + "'  " + g2 + '"' };
}
function dms2degree(d2, e2, f2) {
  const g2 = Math["abs"](d2) + e2 / 60 + f2 / 3600;
  return g2;
}
function getCGCS2000EPSGByLng(d2, e2, f2 = !![]) {
  let g2;
  if (e2) {
    const h2 = Math["floor"](d2 / 6) + 1;
    if (h2 < 13 || h2 > 23) return void 0;
    f2 ? g2 = h2 + 4478 : g2 = h2 + 4489;
  } else {
    const i2 = Math["floor"]((d2 - 1.5) / 3) + 1;
    if (i2 < 25 || i2 > 45) return void 0;
    f2 ? g2 = i2 + 4488 : g2 = i2 + 4509;
  }
  return "EPSG:" + g2;
}
function getCGCS2000EPSGByX(d2) {
  const e2 = Number["parseInt"](d2["toString"]()["slice"](0, 2));
  if (e2 >= 13 && e2 <= 23) return "EPSG:" + (e2 + 4478);
  else return e2 >= 25 && e2 <= 45 ? "EPSG:" + (e2 + 4488) : void 0;
}
function cartesian2lonlat(d2, e2 = ![]) {
  const f2 = a$d["Cartographic"]["fromCartesian"](d2);
  if (!f2) return null;
  const g2 = LatLngPoint["FormatLength"], h2 = LatLngPoint["FormatAltLength"], i2 = a$d["Math"]["toDegrees"](f2["longitude"])["toFixed"](g2), j2 = a$d["Math"]["toDegrees"](f2["latitude"])["toFixed"](g2);
  if (e2) return [Number["parseFloat"](i2), Number["parseFloat"](j2)];
  else {
    const k2 = f2["height"]["toFixed"](h2);
    return [Number["parseFloat"](i2), Number["parseFloat"](j2), Number["parseFloat"](k2)];
  }
}
function cartesians2lonlats(d2, e2 = ![]) {
  const f2 = [];
  for (let g2 = 0, h2 = d2["length"]; g2 < h2; g2++) {
    const j2 = cartesian2lonlat(d2[g2], e2);
    j2 && f2["push"](j2);
  }
  return f2;
}
function cartesian2mercator(d2) {
  if (!d2) return null;
  const e2 = cartesian2lonlat(d2);
  if (!e2) return null;
  return lonlat2mercator(e2);
}
function cartesians2mercators(d2) {
  const e2 = [];
  for (let f2 = 0, g2 = d2["length"]; f2 < g2; f2++) {
    const h2 = cartesian2mercator(d2[f2]);
    h2 && e2["push"](h2);
  }
  return e2["length"] > 0 ? e2 : null;
}
function lonlat2cartesian(d2, e2 = 0) {
  if (!d2 || d2["length"] < 2) return null;
  return a$d["Cartesian3"]["fromDegrees"](d2[0], d2[1], d2[2] || e2);
}
function lonlats2cartesians(d2, e2) {
  const f2 = [];
  for (let g2 = 0, h2 = d2["length"]; g2 < h2; g2++) {
    const j2 = d2[g2];
    if (Array["isArray"](j2[0])) {
      const k2 = lonlats2cartesians(j2, e2);
      k2 && k2["length"] > 0 && f2["push"](k2);
    } else {
      const l2 = lonlat2cartesian(j2, e2);
      l2 && f2["push"](l2);
    }
  }
  return f2;
}
function lonlat2mercator(d2) {
  return jwd2mct(d2);
}
function lonlats2mercators(d2) {
  const e2 = [];
  for (let f2 = 0, g2 = d2["length"]; f2 < g2; f2++) {
    const h2 = lonlat2mercator(d2[f2]);
    h2 && e2["push"](h2);
  }
  return e2;
}
function mercator2cartesian(d2, e2) {
  if (Number["isNaN"](d2[0]) || Number["isNaN"](d2[1])) return null;
  const f2 = mercator2lonlat(d2);
  return a$d["defined"](e2) && (f2[2] = e2), lonlat2cartesian(f2);
}
function mercators2cartesians(d2, e2) {
  const f2 = [];
  for (let g2 = 0, h2 = d2["length"]; g2 < h2; g2++) {
    const j2 = mercator2cartesian(d2[g2], e2);
    j2 && f2["push"](j2);
  }
  return f2;
}
function mercator2lonlat(d2) {
  return mct2jwd(d2);
}
function mercators2lonlats(d2) {
  const e2 = [];
  for (let f2 = 0, g2 = d2["length"]; f2 < g2; f2++) {
    const h2 = mercator2lonlat(d2[f2]);
    h2 && e2["push"](h2);
  }
  return e2;
}
function getMercatorBounds(d2) {
  const e2 = lonlat2mercator([d2["xmin"], d2["ymin"]]), f2 = lonlat2mercator([d2["xmax"], d2["ymax"]]);
  return { "xmin": e2[0], "ymin": e2[1], "xmax": f2[0], "ymax": f2[1] };
}
function geLatLngBounds(d2) {
  const e2 = mercator2lonlat([d2["xmin"], d2["ymin"]]), f2 = mercator2lonlat([d2["xmax"], d2["ymax"]]);
  return { "xmin": e2[0], "ymin": e2[1], "xmax": f2[0], "ymax": f2[1] };
}
const x_PI = 3.141592653589793 * 3e3 / 180, PI = 3.141592653589793, a$1 = 6378245, ee = 0.006693421622965943;
function transformlng(d2, e2) {
  let f2 = 300 + d2 + 2 * e2 + 0.1 * d2 * d2 + 0.1 * d2 * e2 + 0.1 * Math["sqrt"](Math["abs"](d2));
  return f2 += (20 * Math["sin"](6 * d2 * Math["PI"]) + 20 * Math["sin"](2 * d2 * Math["PI"])) * 2 / 3, f2 += (20 * Math["sin"](d2 * Math["PI"]) + 40 * Math["sin"](d2 / 3 * Math["PI"])) * 2 / 3, f2 += (150 * Math["sin"](d2 / 12 * Math["PI"]) + 300 * Math["sin"](d2 / 30 * Math["PI"])) * 2 / 3, f2;
}
function transformlat(d2, e2) {
  let f2 = -100 + 2 * d2 + 3 * e2 + 0.2 * e2 * e2 + 0.1 * d2 * e2 + 0.2 * Math["sqrt"](Math["abs"](d2));
  return f2 += (20 * Math["sin"](6 * d2 * Math["PI"]) + 20 * Math["sin"](2 * d2 * Math["PI"])) * 2 / 3, f2 += (20 * Math["sin"](e2 * Math["PI"]) + 40 * Math["sin"](e2 / 3 * Math["PI"])) * 2 / 3, f2 += (160 * Math["sin"](e2 / 12 * Math["PI"]) + 320 * Math["sin"](e2 * Math["PI"] / 30)) * 2 / 3, f2;
}
function out_of_china(d2, e2) {
  return d2 < 72.004 || d2 > 137.8347 || e2 < 0.8293 || e2 > 55.8271;
}
function bd2gcj(d2) {
  const e2 = d2[0], f2 = d2[1], g2 = e2 - 65e-4, h2 = f2 - 6e-3, i2 = Math["sqrt"](g2 * g2 + h2 * h2) - 2e-5 * Math["sin"](h2 * x_PI), j2 = Math["atan2"](h2, g2) - 3e-6 * Math["cos"](g2 * x_PI);
  let k2 = i2 * Math["cos"](j2), l2 = i2 * Math["sin"](j2);
  return k2 = Number(k2["toFixed"](6)), l2 = Number(l2["toFixed"](6)), [k2, l2];
}
function gcj2bd(d2) {
  const e2 = d2[0], f2 = d2[1], g2 = Math["sqrt"](e2 * e2 + f2 * f2) + 2e-5 * Math["sin"](f2 * x_PI), h2 = Math["atan2"](f2, e2) + 3e-6 * Math["cos"](e2 * x_PI);
  let i2 = g2 * Math["cos"](h2) + 65e-4, j2 = g2 * Math["sin"](h2) + 6e-3;
  return i2 = Number(i2["toFixed"](6)), j2 = Number(j2["toFixed"](6)), [i2, j2];
}
function wgs2gcj(d2) {
  const e2 = d2[0], f2 = d2[1];
  if (out_of_china(e2, f2)) return [e2, f2];
  else {
    let g2 = transformlat(e2 - 105, f2 - 35), h2 = transformlng(e2 - 105, f2 - 35);
    const i2 = f2 / 180 * PI;
    let j2 = Math["sin"](i2);
    j2 = 1 - ee * j2 * j2;
    const k2 = Math["sqrt"](j2);
    g2 = g2 * 180 / (a$1 * (1 - ee) / (j2 * k2) * PI), h2 = h2 * 180 / (a$1 / k2 * Math["cos"](i2) * PI);
    let l2 = f2 + g2, m2 = e2 + h2;
    return m2 = Number(m2["toFixed"](6)), l2 = Number(l2["toFixed"](6)), [m2, l2];
  }
}
function gcj2wgs(d2) {
  const e2 = d2[0], f2 = d2[1];
  if (out_of_china(e2, f2)) return [e2, f2];
  else {
    let g2 = transformlat(e2 - 105, f2 - 35), h2 = transformlng(e2 - 105, f2 - 35);
    const i2 = f2 / 180 * PI;
    let j2 = Math["sin"](i2);
    j2 = 1 - ee * j2 * j2;
    const k2 = Math["sqrt"](j2);
    g2 = g2 * 180 / (a$1 * (1 - ee) / (j2 * k2) * PI), h2 = h2 * 180 / (a$1 / k2 * Math["cos"](i2) * PI);
    const l2 = f2 + g2, m2 = e2 + h2;
    let n2 = e2 * 2 - m2, o2 = f2 * 2 - l2;
    return n2 = Number(n2["toFixed"](6)), o2 = Number(o2["toFixed"](6)), [n2, o2];
  }
}
function bd2wgs(d2) {
  return gcj2wgs(bd2gcj(d2));
}
function wgs2bd(d2) {
  return gcj2bd(wgs2gcj(d2));
}
function jwd2mct(d2) {
  const e2 = Number(d2[0]), f2 = Number(d2[1]);
  let g2 = e2 * 2003750834e-2 / 180, h2 = Math["log"](Math["tan"]((90 + f2) * Math["PI"] / 360)) / (Math["PI"] / 180);
  return h2 = h2 * 2003750834e-2 / 180, g2 = Number(g2["toFixed"](2)), h2 = Number(h2["toFixed"](2)), [g2, h2, d2[2] || 0];
}
function mct2jwd(d2) {
  const e2 = Number(d2[0]), f2 = Number(d2[1]);
  let g2 = e2 / 2003750834e-2 * 180, h2 = f2 / 2003750834e-2 * 180;
  return h2 = 180 / Math["PI"] * (2 * Math["atan"](Math["exp"](h2 * Math["PI"] / 180)) - Math["PI"] / 2), g2 = Number(g2["toFixed"](6)), h2 = Number(h2["toFixed"](6)), [g2, h2, d2[2] || 0];
}
function proj4Trans(d2, f2, g2 = "EPSG:4326") {
  if (!f2 || !g2 || f2 == g2) return d2;
  try {
    (f2 == CRS["CGCS2000_GK_Zone_3"] || f2 == CRS["CGCS2000_GK_Zone_6"]) && (f2 = getCGCS2000EPSGByX(d2[0]));
    if (g2 == CRS["CGCS2000_GK_Zone_3"]) g2 = getCGCS2000EPSGByLng(d2[0], ![], !![]);
    else {
      if (g2 == CRS["CGCS2000_GK_Zone_6"]) g2 = getCGCS2000EPSGByLng(d2[0], !![], !![]);
      else {
        if (g2 == CRS["CGCS2000_GK_CM_3"]) g2 = getCGCS2000EPSGByLng(d2[0], ![], ![]);
        else g2 == CRS["CGCS2000_GK_CM_6"] && (g2 = getCGCS2000EPSGByLng(d2[0], !![], ![]));
      }
    }
    if (!f2 || !g2 || f2 == g2) return d2;
    const h2 = proj4(f2, g2, d2);
    if (a$d["defined"](h2) && h2["length"] > 1 && !Number["isNaN"](h2[0]) && h2[0] != Infinity) return h2;
  } catch (i2) {
  }
  return d2;
}
function proj4TransArr(d2, e2, f2 = "EPSG:4326") {
  if (!e2 || e2 == f2) return d2;
  const g2 = [];
  for (let h2 = 0, j2 = d2["length"]; h2 < j2; h2++) {
    const k2 = d2[h2];
    if (Array["isArray"](k2[0])) {
      const l2 = proj4TransArr(k2, e2, f2);
      l2 && l2["length"] > 0 && g2["push"](l2);
    } else {
      const m2 = proj4Trans(k2, e2, f2);
      m2 && g2["push"](m2);
    }
  }
  return g2;
}
const d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  bd2gcj,
  bd2wgs,
  cartesian2lonlat,
  cartesian2mercator,
  cartesians2lonlats,
  cartesians2mercators,
  degree2dms,
  dms2degree,
  gcj2bd,
  gcj2wgs,
  geLatLngBounds,
  getCGCS2000EPSGByLng,
  getCGCS2000EPSGByX,
  getMercatorBounds,
  jwd2mct,
  lonlat2cartesian,
  lonlat2mercator,
  lonlats2cartesians,
  lonlats2mercators,
  mct2jwd,
  mercator2cartesian,
  mercator2lonlat,
  mercators2cartesians,
  mercators2lonlats,
  proj4Trans,
  proj4TransArr,
  wgs2bd,
  wgs2gcj
}, Symbol.toStringTag, { value: "Module" }));
function setRenderErrorHandler(e2, f2) {
  e2["cesiumWidget"]["showErrorPanel"] = f2;
}
function getSurfaceHeight(e2, f2, g2 = {}) {
  if (!f2) return f2;
  const h2 = a$d["defaultValue"](g2["has3dtiles"], a$d["defined"](get3DTilesetByPosition(e2, f2)));
  return h2 ? getSurface3DTilesHeight(e2, f2, g2) : getSurfaceTerrainHeight(e2, f2, g2);
}
function getZoomLevelByAltitude(e2) {
  const f2 = 40487.57, g2 = 7096758e-11, h2 = 91610.74, i2 = -40467.74;
  return Math["round"](i2 + (f2 - i2) / (1 + (e2 / h2) ** g2));
}
function get3DTilesetByPosition(e2, f2) {
  if (!f2) return null;
  f2 instanceof a$d["Cartesian3"] && (f2 = [f2]);
  for (let g2 = 0, h2 = f2["length"]; g2 < h2; ++g2) {
    const j2 = f2[g2], k2 = a$d["SceneTransforms"]["worldToWindowCoordinates"] ? a$d["SceneTransforms"]["worldToWindowCoordinates"](e2["scene"], j2) : a$d["SceneTransforms"]["wgs84ToWindowCoordinates"](e2["scene"], j2);
    if (!a$d["defined"](k2)) continue;
    const l2 = e2["scene"]["pick"](k2, 10, 10);
    if (a$d["defined"](l2) && a$d["defined"](l2["primitive"]) && l2["primitive"] instanceof a$d["Cesium3DTileset"]) return l2["primitive"];
  }
  return null;
}
function getSurface3DTilesHeight(e2, f2, g2 = {}) {
  g2["cartographic"] = g2["cartographic"] || a$d["Cartographic"]["fromCartesian"](f2);
  const { cartographic: h2, callback: i2 } = g2;
  if (g2["async"]) e2["scene"]["clampToHeightMostDetailed"]([f2], g2["objectsToExclude"], 0.2)["then"]((j2) => {
    const k2 = j2[0];
    if (a$d["defined"](k2)) {
      const l2 = a$d["Cartographic"]["fromCartesian"](k2), m2 = l2["height"];
      if (a$d["defined"](m2) && m2 > -1e3) {
        i2 && i2(m2, l2);
        return;
      }
    }
    getSurfaceTerrainHeight(e2, f2, g2);
  });
  else {
    const j2 = e2["scene"]["sampleHeight"](h2, g2["objectsToExclude"], 0.2);
    if (a$d["defined"](j2) && j2 > -1e3) return i2 && i2(j2, h2), j2;
  }
  return 0;
}
function getSurfaceTerrainHeight(e2, f2, g2 = {}) {
  var _a;
  const h2 = g2["cartographic"] || a$d["Cartographic"]["fromCartesian"](f2), { callback: i2 } = g2, j2 = Boolean((_a = e2["scene"]["terrainProvider"]) == null ? void 0 : _a["_layers"]);
  if (!j2) return i2 && i2(0, h2), 0;
  if (g2["async"]) Promise["all"]([a$d["sampleTerrainMostDetailed"](e2["scene"]["terrainProvider"], [h2])])["then"]((k2) => {
    const l2 = k2[0];
    let m2;
    a$d["defined"](l2) && a$d["defined"](l2["height"]) ? m2 = l2["height"] : m2 = e2["scene"]["globe"]["getHeight"](h2), i2 && i2(m2, h2);
  });
  else {
    const k2 = e2["scene"]["globe"]["getHeight"](h2);
    return k2 && k2 > -1e3 ? (i2 && i2(k2, h2), k2) : h2["height"];
  }
  return 0;
}
function getCanvasCenterCoords(e2) {
  const f2 = e2["scene"]["canvas"], g2 = new a$d["Cartesian2"](f2["clientWidth"] / 2, f2["clientHeight"] / 2), h2 = e2["scene"]["camera"]["getPickRay"](g2);
  if (h2) {
    let i2 = e2["scene"]["globe"]["pick"](h2, e2["scene"]);
    !i2 && (i2 = e2["scene"]["camera"]["pickEllipsoid"](g2));
    if (i2) {
      const j2 = LatLngPoint["fromCartesian"](i2);
      return j2;
    }
  }
}
function getCurrentMousePosition(f2, g2, h2) {
  const i2 = f2["scene"];
  let j2, k2;
  try {
    k2 = i2["pick"](g2, 5, 5);
  } catch (l2) {
    handlerError("NOT_THROW", "getCurrentMousePosition: scene.pick 拾取时异常", l2);
  }
  if (i2["pickPositionSupported"] && a$d["defined"](k2)) {
    const m2 = hasPickedModel(k2, h2 == null ? void 0 : h2["noPickEntity"]);
    if (m2) {
      if (m2["billboard"] || m2["point"] || m2["label"]) return getPositionValue(m2["position"]);
      if (m2["show"]) {
        m2["show"] = ![], i2["requestRender"](), j2 = getCurrentMousePosition(f2, g2, h2), m2["show"] = !![];
        if (j2) return j2;
      }
      if ((h2 == null ? void 0 : h2["onlyPickModelPosition"]) || !i2["globe"]["show"]) return i2["pickPosition"](g2);
    } else {
      if (a$d["defined"](k2 == null ? void 0 : k2["id"])) {
        const n2 = k2 == null ? void 0 : k2["id"];
        if ((n2["billboard"] || n2["point"] || n2["label"]) && !n2["model"]) return getPositionValue(n2["position"]);
      }
      j2 = i2["pickPosition"](g2);
      if (a$d["defined"](j2)) {
        const o2 = a$d["Cartographic"]["fromCartesian"](j2);
        if (o2["height"] >= 0) return j2;
        if (!a$d["defined"](k2 == null ? void 0 : k2["id"]) && o2["height"] >= -5e3) return j2;
      }
    }
  }
  if (h2 == null ? void 0 : h2["onlyPickModelPosition"]) return j2;
  if (i2["mode"] === a$d["SceneMode"]["SCENE3D"]) {
    const p2 = i2["camera"]["getPickRay"](g2);
    p2 && (j2 = i2["globe"]["pick"](p2, i2), !j2 && (j2 = i2["camera"]["pickEllipsoid"](g2, i2["globe"]["ellipsoid"])));
  } else j2 = i2["camera"]["pickEllipsoid"](g2, i2["globe"]["ellipsoid"]);
  if (a$d["defined"](j2) && i2["camera"]["positionCartographic"]["height"] < 1e4) {
    const q2 = a$d["Cartographic"]["fromCartesian"](j2);
    if (q2["height"] < -5e3) return void 0;
  }
  return j2;
}
function getCanvasXY(e2, f2) {
  const g2 = LatLngPoint["toCartesian"](f2);
  return a$d["SceneTransforms"]["worldToWindowCoordinates"] ? a$d["SceneTransforms"]["worldToWindowCoordinates"](e2["scene"], g2) : a$d["SceneTransforms"]["wgs84ToWindowCoordinates"](e2["scene"], g2);
}
function getRectangle(e2, f2 = ![]) {
  for (let j2 = e2["length"] - 1; j2 >= 0; j2--) {
    !a$d["defined"](e2[j2]) && e2["splice"](j2, 1);
  }
  const g2 = LatLngArray["toCartesians"](e2), h2 = a$d["Rectangle"]["fromCartesianArray"](g2);
  return f2 ? formatRectangle(h2) : h2;
}
function getTransFun(e2, f2) {
  if (!e2 || !f2) return ![];
  const g2 = crsName2FunName(e2), h2 = crsName2FunName(f2);
  if (g2 == h2) return ![];
  const i2 = g2 + "2" + h2;
  if (!d[i2]) return ![];
  return d[i2];
}
function getCesiumColor(e2, f2, g2) {
  if (e2) {
    if (typeof e2 === "string") return a$d["Color"]["fromCssColorString"](e2);
    else {
      if (typeof e2 === "function") return getCesiumColor(e2(g2), f2);
      else return e2 instanceof a$d["Property"] ? getCesiumColor(e2["getValue"](a$d["JulianDate"]["now"]()), f2) : e2;
    }
  } else return f2 || a$d["Color"]["WHITE"];
}
function getCesiumValue(e2, f2, g2 = a$d["JulianDate"]["now"]()) {
  if (!e2) return e2;
  if (f2) {
    if (e2 instanceof f2) return e2;
    else {
      if (e2["_value"] && e2["_value"] instanceof f2) return e2["_value"];
    }
  }
  if (isFunction(e2)) return e2["getValue"](g2);
  return e2;
}
function getAttrVal(f2, g2) {
  if (!f2) return f2;
  try {
    f2["getValue"] && (f2 = f2["getValue"](a$d["JulianDate"]["now"]()));
    const h2 = {};
    if (f2["_propertyNames"] && f2["_propertyNames"]["length"] > 0) for (const i2 of f2["_propertyNames"]) {
      const j2 = getOneAttrValue(i2, f2[i2], g2);
      if (j2 == null) continue;
      h2[i2] = j2;
    }
    else for (const k2 in f2) {
      const l2 = getOneAttrValue(k2, f2[k2], g2);
      if (l2 == null) continue;
      h2[k2] = l2;
    }
    return h2;
  } catch (m2) {
    handlerError("NOT_THROW", "getAttrVal: 出错了", m2);
  }
  return f2;
}
function getColorByStyle(e2, f2 = a$d["Color"]["YELLOW"]) {
  let g2;
  if (e2["color"]) {
    if (isString(e2["color"])) g2 = a$d["Color"]["fromCssColorString"](e2["color"]);
    else isFunction(e2["color"]) ? g2 = e2["color"](e2) : g2 = e2["color"];
  } else e2["randomColor"] ? g2 = a$d["Color"]["fromRandom"]({ "minimumRed": a$d["defaultValue"](e2["minimumRed"], 0), "maximumRed": a$d["defaultValue"](e2["maximumRed"], 0.75), "minimumGreen": a$d["defaultValue"](e2["minimumGreen"], 0), "maximumGreen": a$d["defaultValue"](e2["maximumGreen"], 0.75), "minimumBlue": a$d["defaultValue"](e2["minimumBlue"], 0), "maximumBlue": a$d["defaultValue"](e2["maximumBlue"], 0.75) }) : g2 = f2;
  if (!a$d["defined"](g2)) return g2;
  return a$d["defined"](e2["opacity"]) && (e2["opacity"] = Math["min"](Math["max"](e2["opacity"], 0), 1), g2 = g2["withAlpha"](Number(e2["opacity"]))), g2;
}
function getTextImage(e2, f2 = {}) {
  const g2 = a$d["writeTextToCanvas"](e2, f2);
  if (g2) {
    if (f2["outlineWidth"]) {
      const h2 = g2["width"], i2 = g2["height"], j2 = g2["getContext"]("2d");
      let k2;
      if (f2["outlineColor"]) k2 = f2["outlineColor"]["toCssColorString"]();
      else f2["fillColor"] ? k2 = f2["fillColor"]["toCssColorString"]() : k2 = "#ffffff";
      const l2 = f2["outlineWidth"];
      if (!j2) return null;
      j2["strokeStyle"] = k2, j2["lineWidth"] = l2, j2["strokeRect"](l2 / 2, l2 / 2, h2 - l2, i2 - l2);
    }
    return g2;
  } else return null;
}
function getPositionValue(e2, f2) {
  if (!e2) return void 0;
  let g2;
  if (e2 instanceof a$d["Cartesian3"]) g2 = e2;
  else {
    if (e2["_value"] instanceof a$d["Cartesian3"]) g2 = e2["_value"];
    else typeof e2["getValue"] === "function" && (g2 = e2["getValue"](f2 || a$d["JulianDate"]["now"]()));
  }
  return g2;
}
function getPolygonPositions(e2) {
  let f2 = getCesiumValue(e2["hierarchy"], a$d["PolygonHierarchy"]);
  return f2 && f2 instanceof a$d["PolygonHierarchy"] && (f2 = f2["positions"]), f2;
}
function getMaxHeight(e2, f2 = 0) {
  if (e2 == null || e2["length"] == 0) return f2;
  let g2 = f2;
  for (let h2 = 0; h2 < e2["length"]; h2++) {
    const j2 = a$d["Cartographic"]["fromCartesian"](e2[h2]);
    h2 == 0 && (g2 = j2["height"]), j2["height"] > g2 && (g2 = j2["height"]);
  }
  return formatNum(g2, LatLngPoint["FormatAltLength"]);
}
function getCenterFromTwoCart3(e2, f2) {
  const g2 = LatLngPoint["toCartographic"](e2), h2 = LatLngPoint["toCartographic"](f2), i2 = (g2["height"] + h2["height"]) / 2, j2 = new a$d["EllipsoidGeodesic"](g2, h2)["interpolateUsingFraction"](0.5);
  return a$d["Cartesian3"]["fromRadians"](j2["longitude"], j2["latitude"], i2);
}
function getCenterFromParserArr(f2, g2) {
  if (!f2 || f2["length"] == 0) return;
  const h2 = LatLngArray["toCartesians"](f2);
  try {
    if (h2["length"] == 1) return h2[0];
    else {
      if (h2["length"] == 2) return getCenterFromTwoCart3(h2[0], h2[1]);
    }
    g2 == null && (g2 = getMaxHeight(h2));
    const i2 = a$d["BoundingSphere"]["fromPoints"](h2), j2 = setPositionsHeight(i2["center"], g2);
    return j2;
  } catch (k2) {
    return h2[Math["floor"](h2["length"] / 2)];
  }
}
function getParabolaCurve(e2, f2, g2 = 1e4, h2 = 50) {
  const j2 = [], k2 = LatLngPoint["toCartesian"](e2), l2 = LatLngPoint["toCartesian"](f2), m2 = a$d["Cartographic"]["fromCartesian"](k2), n2 = a$d["Cartographic"]["fromCartesian"](l2), o2 = m2["longitude"] * 180 / Math["PI"], p2 = m2["latitude"] * 180 / Math["PI"], q2 = n2["longitude"] * 180 / Math["PI"], r2 = n2["latitude"] * 180 / Math["PI"], s2 = Math["sqrt"]((o2 - q2) * (o2 - q2) + (p2 - r2) * (p2 - r2)), u2 = s2 * g2, v2 = a$d["Cartesian3"]["clone"](k2), w2 = a$d["Cartesian3"]["clone"](l2), z2 = a$d["Cartesian3"]["distance"](v2, a$d["Cartesian3"]["ZERO"]), A5 = a$d["Cartesian3"]["distance"](w2, a$d["Cartesian3"]["ZERO"]);
  a$d["Cartesian3"]["normalize"](v2, v2), a$d["Cartesian3"]["normalize"](w2, w2);
  if (a$d["Cartesian3"]["distance"](v2, w2) == 0) return j2;
  const B2 = a$d["Cartesian3"]["angleBetween"](v2, w2);
  j2["push"](k2);
  for (let C2 = 1; C2 < h2 - 1; C2++) {
    const D2 = C2 * 1 / (h2 - 1), E2 = 1 - D2, F = Math["sin"](E2 * B2) / Math["sin"](B2), G = Math["sin"](D2 * B2) / Math["sin"](B2), H = a$d["Cartesian3"]["multiplyByScalar"](v2, F, new a$d["Cartesian3"]()), I2 = a$d["Cartesian3"]["multiplyByScalar"](w2, G, new a$d["Cartesian3"]());
    let J = a$d["Cartesian3"]["add"](H, I2, new a$d["Cartesian3"]());
    const K = D2 * Math["PI"], L = z2 * E2 + A5 * D2 + Math["sin"](K) * u2;
    J = a$d["Cartesian3"]["multiplyByScalar"](J, L, J), j2["push"](J);
  }
  return j2["push"](l2), j2;
}
function getBezierCurve(e2, f2 = ![]) {
  if (!e2 || e2["length"] < 3) return e2;
  const g2 = LatLngArray["toArray"](e2);
  f2 && g2["push"](g2[0]);
  const h2 = g2[g2["length"] - 1][2], i2 = b$e["bezierSpline"]({ "type": "Feature", "geometry": { "type": "LineString", "coordinates": g2 }, "properties": {} }), j2 = lonlats2cartesians(i2["geometry"]["coordinates"], h2);
  return f2 && j2["push"](j2[0]), j2;
}
function formatRectangle(e2, f2 = LatLngPoint["FormatLength"]) {
  let g2 = formatNum(a$d["Math"]["toDegrees"](e2["west"]), f2), h2 = formatNum(a$d["Math"]["toDegrees"](e2["east"]), f2), i2 = formatNum(a$d["Math"]["toDegrees"](e2["north"]), f2), j2 = formatNum(a$d["Math"]["toDegrees"](e2["south"]), f2);
  return g2 > h2 && ([g2, h2] = [h2, g2]), j2 > i2 && ([j2, i2] = [i2, j2]), { "xmin": g2, "xmax": h2, "ymin": j2, "ymax": i2 };
}
function parseRectangle(e2) {
  if (e2 instanceof a$d["Rectangle"]) return e2;
  else {
    if (isArray(e2)) return a$d["Rectangle"]["fromDegrees"](e2[0], e2[1], e2[2], e2[3]);
    else {
      if (isString(e2)) {
        const f2 = e2["split"](",")["map"](Number["parseFloat"]);
        return a$d["Rectangle"]["fromDegrees"](f2[0], f2[1], f2[2], f2[3]);
      } else return a$d["defined"](e2) && a$d["defined"](e2["xmin"]) && a$d["defined"](e2["xmax"]) && a$d["defined"](e2["ymin"]) && a$d["defined"](e2["ymax"]) ? a$d["Rectangle"]["fromDegrees"](e2["xmin"], e2["ymin"], e2["xmax"], e2["ymax"]) : void 0;
    }
  }
}
function addPositionsHeight(e2, f2 = 0) {
  f2 = Number(f2);
  if (Number["isNaN"](f2) || f2 == 0) return e2;
  if (Array["isArray"](e2)) {
    const g2 = [];
    for (let h2 = 0, j2 = e2["length"]; h2 < j2; h2++) {
      const k2 = a$d["Cartographic"]["fromCartesian"](e2[h2]), l2 = a$d["Cartesian3"]["fromRadians"](k2["longitude"], k2["latitude"], k2["height"] + f2);
      g2["push"](l2);
    }
    return g2;
  } else {
    const m2 = a$d["Cartographic"]["fromCartesian"](e2);
    return a$d["Cartesian3"]["fromRadians"](m2["longitude"], m2["latitude"], m2["height"] + f2);
  }
}
function setPositionsHeight(e2, f2 = 0) {
  if (!e2) return e2;
  if (Array["isArray"](e2)) {
    const g2 = [];
    for (let h2 = 0, j2 = e2["length"]; h2 < j2; h2++) {
      const k2 = a$d["Cartographic"]["fromCartesian"](e2[h2]), l2 = a$d["Cartesian3"]["fromRadians"](k2["longitude"], k2["latitude"], f2);
      g2["push"](l2);
    }
    return g2;
  } else {
    const m2 = a$d["Cartographic"]["fromCartesian"](e2);
    return a$d["Cartesian3"]["fromRadians"](m2["longitude"], m2["latitude"], f2);
  }
}
function mergeGeojson(e2) {
  const f2 = { "type": "FeatureCollection", "features": [] };
  for (let g2 = 0; g2 < e2["length"]; g2++) {
    const h2 = a$b(e2[g2]);
    for (let k2 = 0; k2 < h2["features"]["length"]; k2++) {
      f2["features"]["push"](h2["features"][k2]);
    }
  }
  return f2;
}
const defaultAstarOptions = { "boxScale": 3, "maxSlope": 20, "gridSize": 30, "splitGrid": 10, "colorRamp": [{ "color": "#00FF00", "value": 0 }, { "color": "#FFFB00FF", "value": 20 }, { "color": "#FFB300FF", "value": 30 }, { "color": "#FF0000FF", "value": 40 }, { "color": "#240144", "value": 90 }] };
async function astarElevationPathfinding(e2, f2, h2, j2 = {}) {
  var _a;
  const k2 = Object["assign"](defaultAstarOptions, j2), l2 = { "roadPath": [], "gridList": [], "colorRampLegend": void 0, "gridGroundPrimitive": void 0, "message": "" }, m2 = Boolean((_a = e2["scene"]["terrainProvider"]) == null ? void 0 : _a["_layers"]);
  if (!m2) return l2["message"] = "未开启地形，请开启地形后再试", l2;
  const n2 = LatLngPoint["parse"](f2)["toArray"](![]), o2 = LatLngPoint["parse"](h2)["toArray"](![]), { boxScale: p2, maxSlope: q2, gridSize: r2, splitGrid: s2, colorRamp: t2 } = k2;
  t2["sort"]((T, U) => {
    return T["value"] - U["value"];
  });
  const u2 = Math["min"](n2[0], o2[0]), v2 = Math["max"](n2[0], o2[0]), w2 = Math["max"](n2[1], o2[1]), z2 = Math["min"](n2[1], o2[1]), A5 = b$e["polygon"]([[[u2, z2], [u2, w2], [v2, w2], [v2, z2], [u2, z2]]]), B2 = b$e["transformScale"](A5, p2), C2 = b$e["envelope"](B2)["bbox"], D2 = b$e["square"](C2), E2 = b$e["squareGrid"](D2, r2 / 1e3), F = [], G = b$e["lineString"](E2["features"][0]["geometry"]["coordinates"][0]), H = b$e["length"](G);
  E2["features"]["forEach"]((T, U) => {
    const V2 = T["geometry"]["coordinates"][0], W = b$e["lineString"](V2);
    for (let X = 1; X <= s2; X++) {
      const Y = b$e["along"](W, H * (X / s2))["geometry"]["coordinates"];
      F["push"](a$d["Cartographic"]["fromDegrees"](...Y));
    }
  });
  let I2 = [], J = [];
  const K = await a$d["sampleTerrainMostDetailed"](e2["scene"]["terrainProvider"], F), L = Math["floor"](b$e["distance"](b$e["point"]([D2[0], D2[1]]), b$e["point"]([D2[0], D2[3]])) / (r2 / 1e3));
  let M2 = 0;
  for (let T = 0; T < K["length"]; T += s2) {
    const U = K["slice"](T, T + s2), V2 = U["sort"]((a7, a8) => a7["height"] - a8["height"]), [W, X] = [V2["at"](0), V2["at"](-1)], Y = E2["features"][M2], Z2 = b$e["centroid"](Y), a0 = b$e["lineString"]([[a$d["Math"]["toDegrees"](X["longitude"]), a$d["Math"]["toDegrees"](X["latitude"])], [a$d["Math"]["toDegrees"](W["longitude"]), a$d["Math"]["toDegrees"](W["latitude"])]]), a1 = b$e["length"](a0), a2 = (X["height"] - W["height"]) / 1e3, a3 = a$d["Math"]["toDegrees"](Math["atan"](a2 / a1)), a4 = Math["floor"](M2 / L), a5 = (a4 + 1) * L - M2 - 1, a6 = E2["features"][M2];
    a6["properties"] = { "slope": a3, "center": Z2["geometry"]["coordinates"], "id": a4 + "-" + a5, "x": a4, "y": a5 }, !I2["length"] && b$e["booleanPointInPolygon"](b$e["point"](n2), Y) && (I2 = { "x": a4, "y": a5 }), !J["length"] && b$e["booleanPointInPolygon"](b$e["point"](o2), Y) && (J = { "x": a4, "y": a5 }), M2 += 1;
  }
  const N = [], O2 = [];
  E2["features"]["forEach"](({ geometry: { coordinates: a7 }, properties: a8 }) => {
    const a9 = { "x": a8["x"], "y": a8["y"], "id": a8["id"], "center": a8["center"], "slope": a8["slope"], "h": Math["sqrt"]((a8["x"] - J["x"]) ** 2 + (a8["y"] - J["y"]) ** 2), "g": null, "f": null, "parentId": null, "coordinates": a7[0]["map"]((aa) => [aa[0], aa[1]]) };
    a8["slope"] > q2 ? a9["isInCloseList"] = 1 : a9["isInOpenList"] = 0, N["push"](a9);
  }), l2["gridList"] = N;
  const P = getColorRampLegend(t2, "linear");
  l2["colorRampLegend"] = P;
  const Q = [];
  N["forEach"]((a7) => {
    const a8 = new a$d["PolygonGeometry"]({ "polygonHierarchy": new a$d["PolygonHierarchy"](a$d["Cartesian3"]["fromDegreesArray"](a7["coordinates"]["flat"]())) }), a9 = getRampValueColor(P == null ? void 0 : P["ctx"], a7["slope"], 0, 90), aa = new a$d["GeometryInstance"]({ "geometry": a8, "attributes": { "color": a$d["ColorGeometryInstanceAttribute"]["fromColor"](a$d["Color"]["fromBytes"](a9["r"], a9["g"], a9["b"], 125)) }, "id": { ...a7 } });
    Q["push"](aa);
  }), l2["gridGroundPrimitive"] = new a$d["GroundPrimitive"]({ "geometryInstances": Q, "appearance": new a$d["PerInstanceColorAppearance"]({ "flat": !![], "translucent": !![] }) });
  const R = N["find"]((a7) => a7["x"] == I2["x"] && a7["y"] == I2["y"]);
  R["g"] = 0, R["isInOpenList"] = 1, O2["push"](R);
  let S = {};
  while (O2["length"]) {
    const a7 = O2["sort"]((ag, ah) => ag["f"] - ah["f"]), a8 = a7["filter"]((ag) => ag["f"] == a7[0]["f"]), a9 = a8["sort"]((ag, ah) => ag["g"] - ah["g"])[0], aa = N["find"]((ag) => ag["x"] == a9["x"] && ag["y"] == a9["y"] - 1), ab = N["find"]((ag) => ag["x"] == a9["x"] + 1 && ag["y"] == a9["y"]), ac = N["find"]((ag) => ag["x"] == a9["x"] && ag["y"] == a9["y"] + 1), ad = N["find"]((ag) => ag["x"] == a9["x"] - 1 && ag["y"] == a9["y"]), ae = [aa, ab, ac, ad];
    if (!(aa == null ? void 0 : aa["isInCloseList"]) || !(ad == null ? void 0 : ad["isInCloseList"])) {
      const ag = N["find"]((ah) => ah["x"] == a9["x"] - 1 && ah["y"] == a9["y"] - 1);
      ae["push"](ag);
    }
    if (!(aa == null ? void 0 : aa["isInCloseList"]) || !(ab == null ? void 0 : ab["isInCloseList"])) {
      const ah = N["find"]((ai) => ai["x"] == a9["x"] + 1 && ai["y"] == a9["y"] - 1);
      ae["push"](ah);
    }
    if (!(ac == null ? void 0 : ac["isInCloseList"]) || !(ab == null ? void 0 : ab["isInCloseList"])) {
      const ai = N["find"]((aj) => aj["x"] == a9["x"] + 1 && aj["y"] == a9["y"] + 1);
      ae["push"](ai);
    }
    if (!(ac == null ? void 0 : ac["isInCloseList"]) || !(ad == null ? void 0 : ad["isInCloseList"])) {
      const aj = N["find"]((ak) => ak["x"] == a9["x"] - 1 && ak["y"] == a9["y"] + 1);
      ae["push"](aj);
    }
    for (let ak = 0; ak < ae["length"]; ak++) {
      const al = ae[ak];
      if (!al || al["isInCloseList"] == 1) continue;
      const am = Math["sqrt"]((a9["x"] - al["x"]) ** 2 + (a9["y"] - al["y"]) ** 2);
      if (al["isInOpenList"] == 0) al["parentId"] = a9["id"], al["g"] = a9["g"] + am, al["h"] = Math["sqrt"]((al["x"] - J["x"]) ** 2 + (al["y"] - J["y"]) ** 2), al["f"] = al["g"] + al["h"], al["isInOpenList"] = 1, O2["push"](al);
      else {
        if (al["isInOpenList"] == 1) {
          const an = a9["g"] + am;
          an < al["g"] && (al["g"] = an, al["f"] = al["g"] + al["h"], al["parentId"] = a9["id"]);
        }
      }
      if (al["x"] == J["x"] && al["y"] == J["y"]) {
        S = al;
        let ao = S;
        l2["roadPath"] = [];
        while (ao) {
          l2["roadPath"]["push"](ao["center"]), ao = N["find"](({ id: ap }) => ap == ao["parentId"]);
        }
        l2["message"] = "路径计算成功";
        break;
      }
    }
    if (S["id"]) break;
    const af = O2["findIndex"](({ x: ap, y: aq }) => ap == a9["x"] && aq == a9["y"]);
    O2[af]["isInCloseList"] = 1, O2["splice"](af, 1);
  }
  return !O2["length"] && !S["id"] && (l2["roadPath"] = [], l2["message"] = "当前参数未找到路径，请重新设置参数"), l2;
}
function getOneAttrValue(e2, f2, g2) {
  if (f2 == null || f2 === "" || f2 === "Null" || f2 === "Unknown") return void 0;
  f2["getValue"] && typeof f2["getValue"] == "function" && e2 != "material" && (f2 = f2["getValue"](a$d["JulianDate"]["now"]()));
  if (isFunction(f2)) return void 0;
  if (g2) {
    if (f2 instanceof a$d["Color"]) return f2["toCssColorString"]();
    if (!isSimpleType(f2)) return void 0;
  }
  return f2;
}
function crsName2FunName(e2) {
  switch (e2) {
    case ChinaCRS["WGS84"]:
      return "wgs";
    case ChinaCRS["GCJ02"]:
      return "gcj";
    case ChinaCRS["BD09"]:
      return "bd";
  }
}
function hasPickedModel(e2, f2) {
  if (a$d["defined"](e2["id"])) {
    const g2 = e2["id"];
    if (g2["_noMousePick"]) return g2;
    if (f2 && g2 === f2) return g2;
  }
  if (a$d["defined"](e2["primitive"])) {
    const h2 = e2["primitive"];
    if (h2["_noMousePick"]) return h2;
    if (f2 && h2 === f2) return h2;
  }
  if (a$d["defined"](e2["tileset"])) {
    const i2 = e2["tileset"];
    if (i2["_noMousePick"]) return i2;
    if (f2 && i2 === f2) return i2;
  }
  return void 0;
}
const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  addPositionsHeight,
  astarElevationPathfinding,
  bd2gcj,
  bd2wgs,
  cartesian2lonlat,
  cartesian2mercator,
  cartesians2lonlats,
  cartesians2mercators,
  degree2dms,
  dms2degree,
  formatRectangle,
  gcj2bd,
  gcj2wgs,
  geLatLngBounds,
  get3DTilesetByPosition,
  getAttrVal,
  getBezierCurve,
  getCGCS2000EPSGByLng,
  getCGCS2000EPSGByX,
  getCanvasCenterCoords,
  getCanvasXY,
  getCenterFromParserArr,
  getCenterFromTwoCart3,
  getCesiumColor,
  getCesiumValue,
  getColorByStyle,
  getCurrentMousePosition,
  getMaxHeight,
  getMercatorBounds,
  getParabolaCurve,
  getPolygonPositions,
  getPositionValue,
  getRectangle,
  getSurface3DTilesHeight,
  getSurfaceHeight,
  getSurfaceTerrainHeight,
  getTextImage,
  getTransFun,
  getZoomLevelByAltitude,
  jwd2mct,
  lonlat2cartesian,
  lonlat2mercator,
  lonlats2cartesians,
  lonlats2mercators,
  mct2jwd,
  mercator2cartesian,
  mercator2lonlat,
  mercators2cartesians,
  mercators2lonlats,
  mergeGeojson,
  parseRectangle,
  proj4Trans,
  proj4TransArr,
  setPositionsHeight,
  setRenderErrorHandler,
  wgs2bd,
  wgs2gcj
}, Symbol.toStringTag, { value: "Module" }));
const rayScratch = new a$d["Ray"](), cartesian3Scratch = new a$d["Cartesian3"]();
function isCenter(b2) {
  return b2["alt"] !== void 0 && b2["lat"] !== void 0 && b2["lng"] !== void 0;
}
function isExtent(b2) {
  return b2["xmax"] !== void 0 && b2["xmin"] !== void 0 && b2["ymin"] !== void 0 && b2["ymax"] !== void 0;
}
function cancelFlyTo(b2) {
  b2["camera"]["cancelFlight"]();
}
function flyTo(b2, c2) {
  const d2 = isCenter(c2) ? "LAT_LNG_ALT" : isExtent(c2) ? "EXTENT" : 0, e2 = d2 === "LAT_LNG_ALT" ? a$d["Cartesian3"]["fromDegrees"](c2["lng"] ?? 0, c2["lat"] ?? 0, c2["alt"]) : d2 === "EXTENT" ? a$d["Rectangle"]["fromDegrees"](c2["xmin"], c2["ymin"], c2["xmax"], c2["ymax"]) : void 0;
  if (!e2) {
    handlerError("NOT_THROW", "flyTo: 方法参数传递有误，请检查");
    return;
  }
  const f2 = { "heading": a$d["Math"]["toRadians"](c2["heading"] ?? 0), "pitch": a$d["Math"]["toRadians"](c2["pitch"] ?? -90), "roll": a$d["Math"]["toRadians"](c2["roll"] ?? 0) };
  b2["camera"]["flyTo"]({ "destination": e2, "orientation": f2, ...c2 });
}
function flyToPoint(b2, c2, d2 = {}) {
  const e2 = LatLngPoint["parse"](c2), f2 = e2["toCartesian"]();
  if (d2["clampToGround"]) {
    getSurfaceHeight(b2, f2, { "async": !![], "has3dtiles": !![], "callback": (m2, n2) => {
      e2["alt"] = m2, delete d2["clampToGround"], flyToPoint(b2, e2, d2);
    } });
    return;
  }
  let g2 = d2["radius"] || getCameraDistance(b2) || 1e3;
  a$d["defined"](d2["scale"]) && d2["scale"] > 0 && (g2 *= d2["scale"]);
  a$d["defined"](d2["minHeight"]) && g2 < d2["minHeight"] && (g2 = d2["minHeight"]);
  a$d["defined"](d2["maxHeight"]) && g2 > d2["maxHeight"] && (g2 = d2["maxHeight"]);
  let h2 = a$d["defined"](d2["pitch"]) ? a$d["Math"]["toRadians"](d2["pitch"]) : b2["camera"]["pitch"];
  const i2 = a$d["Math"]["toDegrees"](h2);
  a$d["defined"](d2["minPitch"]) && i2 < d2["minPitch"] && (h2 = a$d["Math"]["toRadians"](d2["minPitch"]));
  a$d["defined"](d2["maxPitch"]) && i2 > d2["maxPitch"] && (h2 = a$d["Math"]["toRadians"](d2["maxPitch"]));
  const j2 = a$d["defined"](d2["heading"]) ? a$d["Math"]["toRadians"](d2["heading"]) : b2["camera"]["heading"], k2 = new a$d["HeadingPitchRange"](j2, h2, g2), l2 = new a$d["BoundingSphere"](f2, 0);
  d2["duration"] === 0 ? (b2["camera"]["lookAt"](f2, k2), d2["complete"] && d2["complete"]()) : b2["camera"]["flyToBoundingSphere"](l2, { ...d2, "offset": k2 });
}
function flyToExtent(b2, c2, d2 = {}) {
  const e2 = c2["xmin"] ?? 0, f2 = c2["xmax"] ?? 0, g2 = c2["ymin"] ?? 0, h2 = c2["ymax"] ?? 0, i2 = (e2 + f2) / 2 || defaultViewCenter[0], j2 = (g2 + h2) / 2 || defaultViewCenter[1], k2 = a$d["Rectangle"]["fromDegrees"](e2, g2, f2, h2), l2 = Math["min"](Math["PI"], Math["max"](k2["height"], k2["width"])), m2 = { ...d2 };
  l2 > 0 && (m2["radius"] = a$d["defaultValue"](m2["radius"], 0) + a$d["Math"]["chordLength"](l2, b2["scene"]["globe"]["ellipsoid"]["maximumRadius"]));
  let n2 = a$d["defaultValue"](c2["height"], 0);
  n2 == 0 && (n2 = getSurfaceHeight(b2, a$d["Cartesian3"]["fromDegrees"](i2, j2))), flyToPoint(b2, new LatLngPoint(i2, j2, n2), m2);
}
function flyToPositions(b2, c2, d2 = {}) {
  if (c2["length"] == 1) {
    flyToPoint(b2, c2[0], d2);
    return;
  }
  const e2 = getRectangle(c2, !![]);
  e2["height"] = getMaxHeight(c2);
  if (!e2) return;
  e2["xmin"] == e2["xmax"] || e2["ymin"] == e2["ymax"] || e2["xmax"] - e2["xmin"] > 200 ? flyToPoint(b2, [e2["xmin"], e2["ymin"], e2["height"] ?? 0], d2) : flyToExtent(b2, e2, d2);
}
function getCameraDistance(b2) {
  const c2 = getCanvasCenterCoords(b2);
  if (c2) {
    const d2 = a$d["Cartesian3"]["distance"](c2["toCartesian"](), b2["camera"]["positionWC"]);
    return d2;
  } else return 0;
}
function getCameraVision(b2, c2) {
  const d2 = b2["camera"]["positionCartographic"], e2 = {}, { FormatLength: f2, FormatAltLength: g2 } = LatLngPoint;
  return e2["lat"] = formatNum(a$d["Math"]["toDegrees"](d2["latitude"]), f2), e2["lng"] = formatNum(a$d["Math"]["toDegrees"](d2["longitude"]), f2), c2 ? (e2["alt"] = formatNum(d2["height"], 0), e2["heading"] = formatNum(a$d["Math"]["toDegrees"](b2["camera"]["heading"] || 0) % 360, 0), e2["pitch"] = formatNum(a$d["Math"]["toDegrees"](b2["camera"]["pitch"] || 0) % 360, 0), e2["roll"] = formatNum(a$d["Math"]["toDegrees"](b2["camera"]["roll"] || 0) % 360, 0)) : (e2["alt"] = formatNum(d2["height"], g2), e2["heading"] = formatNum(a$d["Math"]["toDegrees"](b2["camera"]["heading"] || 0) % 360, 1), e2["pitch"] = formatNum(a$d["Math"]["toDegrees"](b2["camera"]["pitch"] || 0) % 360, 1), e2["roll"] = formatNum(a$d["Math"]["toDegrees"](b2["camera"]["roll"] || 0) % 360, 1)), e2;
}
function getExtent(b2, c2 = LatLngPoint["FormatLength"]) {
  const d2 = formatRectangle(a$d["Camera"]["DEFAULT_VIEW_RECTANGLE"]), e2 = b2["scene"]["globe"]["ellipsoid"], f2 = b2["scene"]["canvas"], g2 = b2["camera"]["pickEllipsoid"](new a$d["Cartesian2"](0, 0), e2);
  if (g2) {
    const i2 = e2["cartesianToCartographic"](g2);
    d2["xmin"] = a$d["Math"]["toDegrees"](i2["longitude"]), d2["ymax"] = a$d["Math"]["toDegrees"](i2["latitude"]);
  } else {
    const j2 = f2["width"] / 2, k2 = f2["height"] / 2;
    for (let l2 = 0; l2 <= j2; l2 += 10) {
      const m2 = b2["camera"]["pickEllipsoid"](new a$d["Cartesian2"](l2, k2), e2);
      if (m2) {
        const n2 = e2["cartesianToCartographic"](m2);
        d2["xmin"] = a$d["Math"]["toDegrees"](n2["longitude"]);
        break;
      }
    }
    for (let o2 = 0; o2 <= k2; o2 += 10) {
      const p2 = b2["camera"]["pickEllipsoid"](new a$d["Cartesian2"](j2, o2), e2);
      if (p2) {
        const q2 = e2["cartesianToCartographic"](p2);
        d2["ymax"] = a$d["Math"]["toDegrees"](q2["latitude"]);
        break;
      }
    }
  }
  const h2 = b2["camera"]["pickEllipsoid"](new a$d["Cartesian2"](f2["width"], f2["height"]), e2);
  if (h2) {
    const r2 = e2["cartesianToCartographic"](h2);
    d2["xmax"] = a$d["Math"]["toDegrees"](r2["longitude"]), d2["ymin"] = a$d["Math"]["toDegrees"](r2["latitude"]);
  } else {
    const s2 = f2["width"] / 2, t2 = f2["height"] / 2;
    for (let u2 = f2["width"]; u2 >= s2; u2 -= 10) {
      const v2 = b2["camera"]["pickEllipsoid"](new a$d["Cartesian2"](u2, t2), e2);
      if (v2) {
        const w2 = e2["cartesianToCartographic"](v2);
        d2["xmax"] = a$d["Math"]["toDegrees"](w2["longitude"]);
        break;
      }
    }
    for (let x2 = f2["height"]; x2 >= t2; x2 -= 10) {
      const y2 = b2["camera"]["pickEllipsoid"](new a$d["Cartesian2"](s2, x2), e2);
      if (y2) {
        const z2 = e2["cartesianToCartographic"](y2);
        d2["ymin"] = a$d["Math"]["toDegrees"](z2["latitude"]);
        break;
      }
    }
  }
  if (d2["xmax"] < d2["xmin"]) {
    const A5 = d2["xmax"];
    d2["xmax"] = d2["xmin"], d2["xmin"] = A5;
  }
  if (d2["ymax"] < d2["ymin"]) {
    const B2 = d2["ymax"];
    d2["ymax"] = d2["ymin"], d2["ymin"] = B2;
  }
  return formatRectangle(a$d["Rectangle"]["fromDegrees"](d2["xmin"], d2["ymin"], d2["xmax"], d2["ymax"]), c2);
}
function zoomIn(b2, c2 = 1.5) {
  return c2 = 1 / c2, zoom(b2, c2);
}
function zoomOut(b2, c2 = 1.5) {
  return zoom(b2, c2);
}
function getCameraAltitude(b2) {
  return Math["abs"](b2["camera"]["positionCartographic"]["height"]);
}
function getZoomLevelByCameraAltitude(b2) {
  const c2 = getCameraAltitude(b2), d2 = getZoomLevelByAltitude(c2);
  return d2;
}
function zoom(b2, c2) {
  const d2 = b2["scene"], e2 = d2["screenSpaceCameraController"];
  if (!e2["enableInputs"] || !e2["enableZoom"]) return ![];
  const f2 = d2["camera"];
  let g2;
  switch (d2["mode"]) {
    case a$d["SceneMode"]["MORPHING"]:
      return ![];
    case a$d["SceneMode"]["SCENE2D"]:
      f2["zoomIn"](f2["positionCartographic"]["height"] * (1 - c2));
      return !![];
    default: {
      let h2;
      a$d["defined"](b2["trackedEntity"]) ? h2 = new a$d["Cartesian3"]() : (rayScratch["origin"] = f2["positionWC"], rayScratch["direction"] = f2["directionWC"], h2 = d2["globe"]["pick"](rayScratch, d2, new a$d["Cartesian3"]()), a$d["defined"](h2) && (h2 = f2["worldToCameraCoordinatesPoint"](h2, h2)));
      if (!a$d["defined"](h2)) {
        const o2 = new a$d["Ray"](f2["worldToCameraCoordinatesPoint"](d2["globe"]["ellipsoid"]["cartographicToCartesian"](f2["positionCartographic"])), f2["directionWC"]);
        h2 = a$d["IntersectionTests"]["grazingAltitudeLocation"](o2, d2["globe"]["ellipsoid"]);
        if (!a$d["defined"](h2)) return ![];
        g2 = { "heading": f2["heading"], "pitch": f2["pitch"], "roll": f2["roll"] };
      } else g2 = { "direction": f2["direction"], "up": f2["up"] };
      const i2 = a$d["Cartesian3"]["subtract"](f2["position"], h2, cartesian3Scratch), j2 = a$d["Cartesian3"]["multiplyByScalar"](i2, c2, i2), k2 = a$d["Cartesian3"]["add"](h2, j2, h2);
      if (!a$d["defined"](k2)) return ![];
      const l2 = e2["minimumZoomDistance"], m2 = e2["maximumZoomDistance"], n2 = a$d["Cartographic"]["fromCartesian"](k2)["height"];
      if (n2 < l2) return ![];
      if (n2 < e2["minimumCollisionTerrainHeight"]) {
        const p2 = e2["_scene"]["globeHeight"];
        if (a$d["defined"](p2) && n2 <= p2 + l2) return ![];
      }
      if (m2 && n2 > m2) return ![];
      return a$d["defined"](b2["trackedEntity"]) || d2["mode"] == a$d["SceneMode"]["COLUMBUS_VIEW"] ? f2["position"] = k2 : f2["flyTo"]({ "destination": k2, "orientation": g2, "duration": 0.5, "convert": ![] }), !![];
    }
  }
}
const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  cancelFlyTo,
  flyTo,
  flyToExtent,
  flyToPoint,
  flyToPositions,
  getCameraAltitude,
  getCameraDistance,
  getCameraVision,
  getExtent,
  getZoomLevelByCameraAltitude,
  isCenter,
  isExtent,
  zoomIn,
  zoomOut
}, Symbol.toStringTag, { value: "Module" }));
function createEffect(a2) {
  const b2 = EffectType[a2["type"]];
  if (b2) {
    const c2 = new b2(a2);
    return c2;
  } else return handlerError("NOT_THROW", ["createEffect: 无法获得" + a2["type"] + "类型的特效，请检查type参数是否正确", a2]), void 0;
}
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  createEffect
}, Symbol.toStringTag, { value: "Module" }));
function addButton(a2, b2, c2) {
  let d2;
  !isArray(b2) ? d2 = [b2] : d2 = b2;
  let e2;
  d2["forEach"]((f2) => {
    const g2 = createDom("button", "cesium-button cesium-toolbar-button " + f2["uuid"]);
    g2["id"] = "button_" + f2["uuid"], g2["style"]["display"] = "inline-block", g2["setAttribute"]("title", f2["title"]);
    const h2 = parseDom(f2["icon"], ![])[0];
    h2["classList"]["add"]("cesium-svgPath-svg"), g2["appendChild"](h2), g2["addEventListener"]("click", (j2) => {
      var _a;
      (_a = f2["onClick"]) == null ? void 0 : _a.call(f2, a2);
    });
    let i2 = document["getElementsByClassName"]("cesium-viewer-toolbar")[0];
    (c2 == null ? void 0 : c2["customContainer"]) && (i2 = c2 == null ? void 0 : c2["customContainer"]);
    if (isNumber(c2 == null ? void 0 : c2["insertIndex"])) {
      const j2 = i2["childNodes"];
      j2["length"] < c2["insertIndex"] && (c2["insertIndex"] = 0), e2 ? i2["insertBefore"](g2, e2) : (i2["insertBefore"](g2, j2[c2["insertIndex"]]), e2 = g2);
    } else i2["appendChild"](g2);
  });
}
function removeButton(a2) {
  var _a;
  (_a = document["querySelector"]("." + a2)) == null ? void 0 : _a["remove"]();
}
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  addButton,
  removeButton
}, Symbol.toStringTag, { value: "Module" }));
function loopArrayCallback(a2, b2) {
  if (!a2) return;
  if (Array["isArray"](a2)) {
    const c2 = [];
    for (let d2 = 0, e2 = a2["length"]; d2 < e2; d2++) {
      c2["push"](b2(a2[d2]));
    }
    return c2;
  } else return b2(a2);
}
class FlickerEntity {
  constructor() {
    __publicField(this, "entitys");
    __publicField(this, "color");
    __publicField(this, "maxAlpha");
    __publicField(this, "time");
    __publicField(this, "onEnd");
    __publicField(this, "interval");
    __publicField(this, "timeEndVal");
    this["color"] = a$d["Color"]["YELLOW"]["withAlpha"](0);
  }
  ["_updateClr"]() {
    const b2 = this;
    this["entitys"] && loopArrayCallback(this["entitys"], (c2) => {
      c2["point"] && (c2["point"]["color"] = b2["color"]), c2["billboard"] && (c2["billboard"]["color"] = b2["color"]), c2["model"] && (c2["model"]["color"] = b2["color"]), c2["label"] && (c2["label"]["fillColor"] = b2["color"]);
    });
  }
  ["_startTime"]() {
    const b2 = this["maxAlpha"] ?? 0.3, c2 = 30, d2 = b2 / c2;
    let e2 = 0;
    this["interval"] = setInterval(() => {
      var _a;
      e2 += d2, e2 > b2 && (e2 = 0), this["color"] = (_a = this["color"]) == null ? void 0 : _a["withAlpha"](e2), this["_updateClr"]();
    }, c2), this["time"] && (this["timeEndVal"] = setTimeout(() => {
      this["stopFlicker"]();
    }, this["time"] * 1e3));
  }
  ["_stopTime"]() {
    this["interval"] && (clearInterval(this["interval"]), this["interval"] = void 0), this["timeEndVal"] && (clearTimeout(this["timeEndVal"]), this["timeEndVal"] = void 0);
  }
  ["startFlicker"](b2, c2 = {}) {
    const d2 = this;
    return this["stopFlicker"](), this["entitys"] = b2, this["maxAlpha"] = a$d["defaultValue"](c2["maxAlpha"], 0.3), this["time"] = c2["time"], this["color"] = getCesiumColor(c2["color"], a$d["Color"]["YELLOW"]), this["color"] = this["color"]["withAlpha"](this["maxAlpha"]), this["onEnd"] = c2["onEnd"], this["_startTime"](), loopArrayCallback(b2, (e2) => {
      return e2["polygon"] && (e2["polygon"]["material_bak"] = e2["polygon"]["material"], e2["polygon"]["material"] = new a$d["ColorMaterialProperty"](new a$d["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["polyline"] && (e2["polyline"]["material_bak"] = e2["polyline"]["material"], e2["polyline"]["material"] = new a$d["ColorMaterialProperty"](new a$d["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["ellipse"] && (e2["ellipse"]["material_bak"] = e2["ellipse"]["material"], e2["ellipse"]["material"] = new a$d["ColorMaterialProperty"](new a$d["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["rectangle"] && (e2["rectangle"]["material_bak"] = e2["rectangle"]["material"], e2["rectangle"]["material"] = new a$d["ColorMaterialProperty"](new a$d["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["wall"] && (e2["wall"]["material_bak"] = e2["wall"]["material"], e2["wall"]["material"] = new a$d["ColorMaterialProperty"](new a$d["CallbackProperty"]((f2) => {
        return d2["color"];
      }, ![]))), e2["point"] && (e2["point"]["color_bak"] = e2["point"]["color"], e2["point"]["color"] = d2["color"]), e2["billboard"] && (e2["billboard"]["color_bak"] = e2["billboard"]["color"], e2["billboard"]["color"] = d2["color"]), e2["model"] && (e2["model"]["color_bak"] = e2["model"]["color"], e2["model"]["color"] = d2["color"]), e2["label"] && (e2["label"]["fillColor_bak"] = e2["label"]["fillColor"], e2["label"]["fillColor"] = d2["color"]), e2;
    }), this;
  }
  ["stopFlicker"]() {
    this["_stopTime"](), this["entitys"] && (loopArrayCallback(this["entitys"], (b2) => {
      b2["polygon"] && (b2["polygon"]["material_bak"] && (b2["polygon"]["material"] = b2["polygon"]["material_bak"])), b2["polyline"] && (b2["polyline"]["material_bak"] && (b2["polyline"]["material"] = b2["polyline"]["material_bak"])), b2["ellipse"] && (b2["ellipse"]["material_bak"] && (b2["ellipse"]["material"] = b2["ellipse"]["material_bak"])), b2["rectangle"] && (b2["rectangle"]["material_bak"] && (b2["rectangle"]["material"] = b2["rectangle"]["material_bak"])), b2["wall"] && (b2["wall"]["material_bak"] && (b2["wall"]["material"] = b2["wall"]["material_bak"])), b2["point"] && (b2["point"]["color_bak"] && (b2["point"]["color"] = b2["point"]["color_bak"])), b2["billboard"] && (b2["billboard"]["color_bak"] ? b2["billboard"]["color"] = b2["billboard"]["color_bak"] : b2["billboard"]["color"] = void 0), b2["model"] && (b2["model"]["color_bak"] ? b2["model"]["color"] = b2["model"]["color_bak"] : b2["model"]["color"] = void 0), b2["label"] && (b2["label"]["fillColor_bak"] && (b2["label"]["fillColor"] = b2["label"]["fillColor_bak"]));
    }), this["onEnd"] && this["onEnd"](this["entitys"]), this["entitys"] = void 0);
  }
}
class MouseTooltip extends Popup {
  constructor(b2, c2 = {}) {
    super(b2, { ...c2, "direction": c2["direction"] ?? "right" });
    __publicField(this, "_handler");
    __publicField(this, "options");
    __publicField(this, "enable");
    this["options"] = c2, this["enable"] = a$d["defaultValue"](c2["enable"], ![]), this["_handler"] = new a$d["ScreenSpaceEventHandler"](this["_viewer"]["canvas"]), this["_handler"]["setInputAction"]((d2) => {
      this["enable"] && d2["endPosition"] && (this["currentWindowPosition"] = d2["endPosition"]);
    }, a$d["ScreenSpaceEventType"]["MOUSE_MOVE"]);
  }
  ["_render"]() {
    return ![];
  }
  ["_initContainer"]() {
    var _a, _b;
    super["_initContainer"](), (_a = this["_container"]) == null ? void 0 : _a["classList"]["add"]("kbe3d-mouse-tooltip"), (_b = this["_containerCloseSvg"]) == null ? void 0 : _b["remove"]();
  }
  ["open"](b2, c2) {
    super["open"](b2, c2), this["enable"] = !![];
  }
  ["close"]() {
    super["close"](), this["enable"] = ![];
  }
  ["show"]() {
    super["show"](), this["enable"] = !![];
  }
  ["hide"]() {
    super["hide"](), this["enable"] = ![];
  }
  ["destroy"]() {
    var _a;
    (_a = this["_handler"]) == null ? void 0 : _a["destroy"](), super["destroy"]();
  }
}
function guid(a2 = 2) {
  const b2 = (Date["now"]() * 3)["toString"](16), c2 = (/* @__PURE__ */ new Date())["getTimezoneOffset"](), d2 = Number((c2 < 0 ? "7" : "6") + Math["abs"](c2))["toString"](16), e2 = a2 * 9 + 3 + 15;
  let f2 = "";
  for (let g2 = 0; g2 < a2; g2++) f2 += randomBlock() + "-";
  f2 += d2, f2 += b2;
  while (f2["length"] < e2) f2 += randomBlock();
  return f2["substring"](0, e2);
}
function isGuid(a2, b2 = 2) {
  const c2 = a2["split"]("-"), d2 = isNumber(c2[c2["length"] - 1]);
  if (c2["length"] - 1 !== b2) return "Invalid guid, invalid number of blocks";
  const e2 = c2["concat"]()["slice"](0, -1)["reduce"]((f2, g2) => {
    return f2 && g2["length"] === 8 && !g2["includes"](" ");
  }, !![]);
  if (!e2) return "Invalid guid, one or more random blocks are invalid";
  if (!d2 && c2[c2["length"] - 1]["length"] !== 18) return "Invalid guid, last date block has invalid size";
  return !![];
}
function shortGuid() {
  return guid(1)["replace"]("-", "");
}
function isShortGuid(a2) {
  const b2 = /^[a-z0-9]+$/i;
  if (a2["length"] !== 26) return "Should be 26 characters long";
  if (!b2["test"](a2)) return "Should be only alphanumeric";
  return "";
}
function randomBlock() {
  return Number(Math["random"]()["toString"]()["substring"](2))["toString"](16)["substring"](0, 8);
}
function deepMerge(a2, b2, c2) {
  const d2 = Array["isArray"](b2);
  return d2 ? Array["isArray"](a2) ? defaultArrayMerge(a2, b2, c2) : cloneIfNecessary(b2, c2) : mergeObject(a2, b2, c2);
}
function deepMergeAll(a2, b2) {
  if (!Array["isArray"](a2) || a2["length"] < 2) throw new Error("first argument should be an array with at least two elements");
  return a2["reduce"]((c2, d2) => {
    return deepMerge(c2, d2, b2);
  });
}
function emptyTarget(a2) {
  return Array["isArray"](a2) ? [] : {};
}
function cloneIfNecessary(a2, b2) {
  const c2 = b2 && b2["clone"] === !![];
  return c2 && isMergeableObject(a2) ? deepMerge(emptyTarget(a2), a2, b2) : a2;
}
function defaultArrayMerge(a2, b2, c2) {
  const d2 = a2["slice"]();
  return b2["forEach"]((f2, g2) => {
    if (typeof d2[g2] === "undefined") d2[g2] = cloneIfNecessary(f2, c2);
    else {
      if (isMergeableObject(f2)) d2["push"](cloneIfNecessary(f2, c2));
      else !a2["includes"](f2) && d2["push"](cloneIfNecessary(f2, c2));
    }
  }), d2;
}
function mergeObject(a2, b2, c2) {
  const d2 = {};
  return isMergeableObject(a2) && Object["keys"](a2)["forEach"]((e2) => {
    d2[e2] = cloneIfNecessary(a2[e2], c2);
  }), Object["keys"](b2)["forEach"]((e2) => {
    !isMergeableObject(b2[e2]) || !a2[e2] ? d2[e2] = cloneIfNecessary(b2[e2], c2) : d2[e2] = deepMerge(a2[e2], b2[e2], c2);
  }), d2;
}
const DEFAULT_CONFIG = { "id": "id", "children": "children", "pid": "pid" };
function listToTree(a2, b2 = {}) {
  const c2 = getConfig(b2), d2 = /* @__PURE__ */ new Map(), e2 = [], { id: f2, children: g2, pid: h2 } = c2;
  for (const i2 of a2) {
    i2[g2] = i2[g2] || [], d2["set"](i2[f2], i2);
  }
  for (const j2 of a2) {
    const k2 = d2["get"](j2[h2]);
    (k2 ? k2["children"] : e2)["push"](j2);
  }
  return e2;
}
function treeToList(a2, b2 = {}) {
  b2 = getConfig(b2);
  const { children: c2 } = b2, d2 = [], e2 = (f2) => {
    for (const g2 of f2) {
      d2["push"](g2);
      if (g2[c2]) e2(g2[c2]);
    }
  };
  return e2(a2), d2;
}
function findNode(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const { children: d2 } = c2, e2 = [...a2];
  for (const f2 of e2) {
    if (b2(f2)) return f2;
    f2[d2] && e2["push"](...f2[d2]);
  }
}
function findNodeAll(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const { children: d2 } = c2, e2 = [...a2], f2 = [];
  for (const g2 of e2) {
    b2(g2) && f2["push"](g2), g2[d2] && e2["push"](...g2[d2]);
  }
  return f2;
}
function findPath(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const d2 = [], e2 = [...a2], f2 = /* @__PURE__ */ new Set(), { children: g2 } = c2;
  while (e2["length"]) {
    const h2 = e2[0];
    if (f2["has"](h2)) d2["pop"](), e2["shift"]();
    else {
      f2["add"](h2), h2[g2] && e2["unshift"](...h2[g2]), d2["push"](h2);
      if (b2(h2)) return d2;
    }
  }
  return null;
}
function findPathAll(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const d2 = [], e2 = [...a2], f2 = [], g2 = /* @__PURE__ */ new Set(), { children: h2 } = c2;
  while (e2["length"]) {
    const i2 = e2[0];
    g2["has"](i2) ? (d2["pop"](), e2["shift"]()) : (g2["add"](i2), i2[h2] && e2["unshift"](...i2[h2]), d2["push"](i2), b2(i2) && f2["push"]([...d2]));
  }
  return f2;
}
function filterTree(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const d2 = c2["children"];
  function e2(f2) {
    return f2["map"]((g2) => ({ ...g2 }))["filter"]((g2) => {
      return g2[d2] = g2[d2] && e2(g2[d2]), b2(g2) || g2[d2] && g2[d2]["length"];
    });
  }
  return e2(a2);
}
function forEachTree(a2, b2, c2 = {}) {
  c2 = getConfig(c2);
  const d2 = [...a2], { children: e2 } = c2;
  for (let f2 = 0; f2 < d2["length"]; f2++) {
    if (b2(d2[f2])) return;
    e2 && d2[f2][e2] && d2["splice"](f2 + 1, 0, ...d2[f2][e2]);
  }
}
function treeMap(a2, b2) {
  return a2["map"]((c2) => treeMapEach(c2, b2));
}
function getConfig(a2) {
  return Object["assign"]({}, DEFAULT_CONFIG, a2);
}
function treeMapEach(a2, { children = "children", conversion: b2 }) {
  const c2 = Array["isArray"](a2[children]) && a2[children]["length"] > 0, d2 = b2(a2) || {};
  return c2 ? { ...d2, [children]: a2[children]["map"]((e2) => treeMapEach(e2, { "children": children, "conversion": b2 })) } : { ...d2 };
}
var domToImageMore_min = { exports: {} };
(function(c2, d2) {
  ((j2) => {
    let k2 = /* @__PURE__ */ (() => {
      let R = 0;
      return { "escape": function(X) {
        return X["replace"](/([.*+?^${}()|[\]/\\])/g, "\\$1");
      }, "isDataUrl": function(X) {
        return -1 !== X["search"](/^(data:)/);
      }, "canvasToBlob": function(X) {
        if (X["toBlob"]) return new Promise(function(Y) {
          X["toBlob"](Y);
        });
        return ((Y) => new Promise(function(Z2) {
          var a0 = H(Y["toDataURL"]()["split"](",")[1]), a1 = a0["length"], a2 = new Uint8Array(a1);
          for (let a3 = 0; a3 < a1; a3++) a2[a3] = a0["charCodeAt"](a3);
          Z2(new Blob([a2], { "type": "image/png" }));
        }))(X);
      }, "resolveUrl": function(X, Y) {
        var Z2 = document["implementation"]["createHTMLDocument"](), a0 = Z2["createElement"]("base"), a1 = (Z2["head"]["appendChild"](a0), Z2["createElement"]("a"));
        return Z2["body"]["appendChild"](a1), a0["href"] = Y, a1["href"] = X, a1["href"];
      }, "getAndEncode": function(X) {
        let Y = D2["impl"]["urlCache"]["find"](function(Z2) {
          return Z2["url"] === X;
        });
        return Y || (Y = { "url": X, "promise": null }, D2["impl"]["urlCache"]["push"](Y)), null === Y["promise"] && (D2["impl"]["options"]["cacheBust"] && (X += (/\?/["test"](X) ? "&" : "?") + (/* @__PURE__ */ new Date())["getTime"]()), Y["promise"] = new Promise(function(Z2) {
          let a0 = D2["impl"]["options"]["httpTimeout"], a1 = new XMLHttpRequest();
          if (a1["onreadystatechange"] = function() {
            if (4 === a1["readyState"]) {
              if (300 <= a1["status"]) a3 ? Z2(a3) : a4("cannot fetch resource: " + X + ", status: " + a1["status"]);
              else {
                let a5 = new FileReader();
                a5["onloadend"] = function() {
                  Z2(a5["result"]);
                }, a5["readAsDataURL"](a1["response"]);
              }
            }
          }, a1["ontimeout"] = function() {
            a3 ? Z2(a3) : a4("timeout of " + a0 + "ms occured while fetching resource: " + X);
          }, a1["responseType"] = "blob", a1["timeout"] = a0, 0 < D2["impl"]["options"]["useCredentialsFilters"]["length"] && (D2["impl"]["options"]["useCredentials"] = 0 < D2["impl"]["options"]["useCredentialsFilters"]["filter"]((a5) => 0 <= X["search"](a5))["length"]), D2["impl"]["options"]["useCredentials"] && (a1["withCredentials"] = true), D2["impl"]["options"]["corsImg"] && 0 === X["indexOf"]("http") && -1 === X["indexOf"](window["location"]["origin"])) {
            var a2 = "POST" === (D2["impl"]["options"]["corsImg"]["method"] || "GET")["toUpperCase"]() ? "POST" : "GET";
            a1["open"](a2, (D2["impl"]["options"]["corsImg"]["url"] || "")["replace"]("#{cors}", X), true);
            let a5 = false, a6 = D2["impl"]["options"]["corsImg"]["headers"] || {}, a7 = (Object["keys"](a6)["forEach"](function(a8) {
              -1 !== a6[a8]["indexOf"]("application/json") && (a5 = true), a1["setRequestHeader"](a8, a6[a8]);
            }), ((a8) => {
              try {
                return JSON["parse"](JSON["stringify"](a8));
              } catch (a9) {
                a4("corsImg.data is missing or invalid:" + a9["toString"]());
              }
            })(D2["impl"]["options"]["corsImg"]["data"] || ""));
            Object["keys"](a7)["forEach"](function(a8) {
              "string" == typeof a7[a8] && (a7[a8] = a7[a8]["replace"]("#{cors}", X));
            }), a1["send"](a5 ? JSON["stringify"](a7) : a7);
          } else a1["open"]("GET", X, true), a1["send"]();
          let a3;
          function a4(a8) {
            console["error"](a8), Z2("");
          }
          D2["impl"]["options"]["imagePlaceholder"] && (a2 = D2["impl"]["options"]["imagePlaceholder"]["split"](/,/)) && a2[1] && (a3 = a2[1]);
        })), Y["promise"];
      }, "uid": function() {
        return "u" + ("0000" + (Math["random"]() * Math["pow"](36, 4) << 0)["toString"](36))["slice"](-4) + R++;
      }, "delay": function(X) {
        return function(Y) {
          return new Promise(function(Z2) {
            setTimeout(function() {
              Z2(Y);
            }, X);
          });
        };
      }, "asArray": function(X) {
        var Y = [], Z2 = X["length"];
        for (let a0 = 0; a0 < Z2; a0++) Y["push"](X[a0]);
        return Y;
      }, "escapeXhtml": function(X) {
        return X["replace"](/%/g, "%25")["replace"](/#/g, "%23")["replace"](/\n/g, "%0A");
      }, "makeImage": function(X) {
        return "data:," !== X ? new Promise(function(Y, Z2) {
          let a0 = document["createElementNS"]("http://www.w3.org/2000/svg", "svg"), a1 = new Image();
          D2["impl"]["options"]["useCredentials"] && (a1["crossOrigin"] = "use-credentials"), a1["onload"] = function() {
            document["body"]["removeChild"](a0), window && window["requestAnimationFrame"] ? window["requestAnimationFrame"](function() {
              Y(a1);
            }) : Y(a1);
          }, a1["onerror"] = (a2) => {
            document["body"]["removeChild"](a0), Z2(a2);
          }, a0["appendChild"](a1), a1["src"] = X, document["body"]["appendChild"](a0);
        }) : Promise["resolve"]();
      }, "width": function(X) {
        var Y = W(X, "width");
        if (!isNaN(Y)) return Y;
        var Y = W(X, "border-left-width"), Z2 = W(X, "border-right-width");
        return X["scrollWidth"] + Y + Z2;
      }, "height": function(X) {
        var Y = W(X, "height");
        if (!isNaN(Y)) return Y;
        var Y = W(X, "border-top-width"), Z2 = W(X, "border-bottom-width");
        return X["scrollHeight"] + Y + Z2;
      }, "getWindow": S, "isElement": V2, "isElementHostForOpenShadowRoot": function(X) {
        return V2(X) && null !== X["shadowRoot"];
      }, "isShadowRoot": T, "isInShadowRoot": U, "isHTMLElement": function(X) {
        return X instanceof S(X)["HTMLElement"];
      }, "isHTMLCanvasElement": function(X) {
        return X instanceof S(X)["HTMLCanvasElement"];
      }, "isHTMLInputElement": function(X) {
        return X instanceof S(X)["HTMLInputElement"];
      }, "isHTMLImageElement": function(X) {
        return X instanceof S(X)["HTMLImageElement"];
      }, "isHTMLLinkElement": function(X) {
        return X instanceof S(X)["HTMLLinkElement"];
      }, "isHTMLScriptElement": function(X) {
        return X instanceof S(X)["HTMLScriptElement"];
      }, "isHTMLStyleElement": function(X) {
        return X instanceof S(X)["HTMLStyleElement"];
      }, "isHTMLTextAreaElement": function(X) {
        return X instanceof S(X)["HTMLTextAreaElement"];
      }, "isShadowSlotElement": function(X) {
        return U(X) && X instanceof S(X)["HTMLSlotElement"];
      }, "isSVGElement": function(X) {
        return X instanceof S(X)["SVGElement"];
      }, "isSVGRectElement": function(X) {
        return X instanceof S(X)["SVGRectElement"];
      }, "isDimensionMissing": function(X) {
        return isNaN(X) || X <= 0;
      } };
      function S(X) {
        return X = X ? X["ownerDocument"] : void 0, (X ? X["defaultView"] : void 0) || window || j2;
      }
      function T(X) {
        return X instanceof S(X)["ShadowRoot"];
      }
      function U(X) {
        return null != X && void 0 !== X["getRootNode"] && T(X["getRootNode"]());
      }
      function V2(X) {
        return X instanceof S(X)["Element"];
      }
      function W(X, Y) {
        if (X["nodeType"] === F) {
          let Z2 = G(X)["getPropertyValue"](Y);
          if ("px" === Z2["slice"](-2)) return Z2 = Z2["slice"](0, -2), parseFloat(Z2);
        }
        return NaN;
      }
    })(), q2 = /* @__PURE__ */ (() => {
      let R = /url\(['"]?([^'"]+?)['"]?\)/g;
      return { "inlineAll": function(V2, W, X) {
        if (!S(V2)) return Promise["resolve"](V2);
        return Promise["resolve"](V2)["then"](T)["then"](function(Y) {
          let Z2 = Promise["resolve"](V2);
          return Y["forEach"](function(a0) {
            Z2 = Z2["then"](function(a1) {
              return U(a1, a0, W, X);
            });
          }), Z2;
        });
      }, "shouldProcess": S, "impl": { "readUrls": T, "inline": U } };
      function S(V2) {
        return -1 !== V2["search"](R);
      }
      function T(V2) {
        for (var W, X = []; null !== (W = R["exec"](V2)); ) X["push"](W[1]);
        return X["filter"](function(Y) {
          return !k2["isDataUrl"](Y);
        });
      }
      function U(V2, W, X, Y) {
        return Promise["resolve"](W)["then"](function(Z2) {
          return X ? k2["resolveUrl"](Z2, X) : Z2;
        })["then"](Y || k2["getAndEncode"])["then"](function(Z2) {
          return V2["replace"]((a0 = W, new RegExp(`(url\\(['"]?)(` + k2["escape"](a0) + `)(['"]?\\))`, "g")), "$1" + Z2 + "$3");
          var a0;
        });
      }
    })(), x2 = { "resolveAll": function() {
      return z2()["then"](function(R) {
        return Promise["all"](R["map"](function(S) {
          return S["resolve"]();
        }));
      })["then"](function(R) {
        return R["join"]("\n");
      });
    }, "impl": { "readAll": z2 } };
    function z2() {
      return Promise["resolve"](k2["asArray"](document["styleSheets"]))["then"](function(S) {
        let T = [];
        return S["forEach"](function(U) {
          var V2 = Object["getPrototypeOf"](U);
          if (Object["prototype"]["hasOwnProperty"]["call"](V2, "cssRules")) try {
            k2["asArray"](U["cssRules"] || [])["forEach"](T["push"]["bind"](T));
          } catch (W) {
            console["error"]("domtoimage: Error while reading CSS rules from " + U["href"], W["toString"]());
          }
        }), T;
      })["then"](function(S) {
        return S["filter"](function(T) {
          return T["type"] === CSSRule["FONT_FACE_RULE"];
        })["filter"](function(T) {
          return q2["shouldProcess"](T["style"]["getPropertyValue"]("src"));
        });
      })["then"](function(S) {
        return S["map"](R);
      });
      function R(S) {
        return { "resolve": function() {
          var T = (S["parentStyleSheet"] || {})["href"];
          return q2["inlineAll"](S["cssText"], T);
        }, "src": function() {
          return S["style"]["getPropertyValue"]("src");
        } };
      }
    }
    let A5 = { "inlineAll": function R(S) {
      if (!k2["isElement"](S)) return Promise["resolve"](S);
      return T(S)["then"](function() {
        return k2["isHTMLImageElement"](S) ? B2(S)["inline"]() : Promise["all"](k2["asArray"](S["childNodes"])["map"](function(U) {
          return R(U);
        }));
      });
      function T(U) {
        let V2 = ["background", "background-image"], W = V2["map"](function(X) {
          let Y = U["style"]["getPropertyValue"](X), Z2 = U["style"]["getPropertyPriority"](X);
          return Y ? q2["inlineAll"](Y)["then"](function(a0) {
            U["style"]["setProperty"](X, a0, Z2);
          }) : Promise["resolve"]();
        });
        return Promise["all"](W)["then"](function() {
          return U;
        });
      }
    }, "impl": { "newImage": B2 } };
    function B2(S) {
      return { "inline": function(T) {
        if (k2["isDataUrl"](S["src"])) return Promise["resolve"]();
        return Promise["resolve"](S["src"])["then"](T || k2["getAndEncode"])["then"](function(U) {
          return new Promise(function(V2) {
            S["onload"] = V2, S["onerror"] = V2, S["src"] = U;
          });
        });
      } };
    }
    let C2 = { "copyDefaultStyles": true, "imagePlaceholder": void 0, "cacheBust": false, "useCredentials": false, "useCredentialsFilters": [], "httpTimeout": 3e4, "styleCaching": "strict", "corsImg": void 0, "adjustClonedNode": void 0 }, D2 = { "toSvg": I2, "toPng": function(S, T) {
      return J(S, T)["then"](function(U) {
        return U["toDataURL"]();
      });
    }, "toJpeg": function(S, T) {
      return J(S, T)["then"](function(U) {
        return U["toDataURL"]("image/jpeg", (T ? T["quality"] : void 0) || 1);
      });
    }, "toBlob": function(S, T) {
      return J(S, T)["then"](k2["canvasToBlob"]);
    }, "toPixelData": function(S, T) {
      return J(S, T)["then"](function(U) {
        return U["getContext"]("2d")["getImageData"](0, 0, k2["width"](S), k2["height"](S))["data"];
      });
    }, "toCanvas": J, "impl": { "fontFaces": x2, "images": A5, "util": k2, "inliner": q2, "urlCache": [], "options": {} } }, F = (c2["exports"] = D2, ("undefined" != typeof Node ? Node["ELEMENT_NODE"] : void 0) || 1), G = (void 0 !== j2 ? j2["getComputedStyle"] : void 0) || ("undefined" != typeof window ? window["getComputedStyle"] : void 0) || globalThis["getComputedStyle"], H = (void 0 !== j2 ? j2["atob"] : void 0) || ("undefined" != typeof window ? window["atob"] : void 0) || globalThis["atob"];
    function I2(S, T) {
      D2["impl"]["util"]["getWindow"](S);
      var V2 = T = T || {};
      void 0 === V2["copyDefaultStyles"] ? D2["impl"]["options"]["copyDefaultStyles"] = C2["copyDefaultStyles"] : D2["impl"]["options"]["copyDefaultStyles"] = V2["copyDefaultStyles"], D2["impl"]["options"]["imagePlaceholder"] = (void 0 === V2["imagePlaceholder"] ? C2 : V2)["imagePlaceholder"], D2["impl"]["options"]["cacheBust"] = (void 0 === V2["cacheBust"] ? C2 : V2)["cacheBust"], D2["impl"]["options"]["corsImg"] = (void 0 === V2["corsImg"] ? C2 : V2)["corsImg"], D2["impl"]["options"]["useCredentials"] = (void 0 === V2["useCredentials"] ? C2 : V2)["useCredentials"], D2["impl"]["options"]["useCredentialsFilters"] = (void 0 === V2["useCredentialsFilters"] ? C2 : V2)["useCredentialsFilters"], D2["impl"]["options"]["httpTimeout"] = (void 0 === V2["httpTimeout"] ? C2 : V2)["httpTimeout"], D2["impl"]["options"]["styleCaching"] = (void 0 === V2["styleCaching"] ? C2 : V2)["styleCaching"];
      let W = [];
      return Promise["resolve"](S)["then"](function(X) {
        if (X["nodeType"] === F) return X;
        var Y = X, Z2 = X["parentNode"], a0 = document["createElement"]("span");
        return Z2["replaceChild"](a0, Y), a0["append"](X), W["push"]({ "parent": Z2, "child": Y, "wrapper": a0 }), a0;
      })["then"](function(X) {
        return function Y(Z2, a0, a1, a2) {
          let a3 = a0["filter"];
          if (Z2 === K || k2["isHTMLScriptElement"](Z2) || k2["isHTMLStyleElement"](Z2) || k2["isHTMLLinkElement"](Z2) || null !== a1 && a3 && !a3(Z2)) return Promise["resolve"]();
          return Promise["resolve"](Z2)["then"](a4)["then"](a5)["then"](function(aa) {
            return a8(aa, a7(Z2));
          })["then"](a6)["then"](function(aa) {
            return a9(aa, Z2);
          });
          function a4(aa) {
            return k2["isHTMLCanvasElement"](aa) ? k2["makeImage"](aa["toDataURL"]()) : aa["cloneNode"](false);
          }
          function a5(aa) {
            return a0["adjustClonedNode"] && a0["adjustClonedNode"](Z2, aa, false), Promise["resolve"](aa);
          }
          function a6(aa) {
            return a0["adjustClonedNode"] && a0["adjustClonedNode"](Z2, aa, true), Promise["resolve"](aa);
          }
          function a7(aa) {
            return k2["isElementHostForOpenShadowRoot"](aa) ? aa["shadowRoot"] : aa;
          }
          function a8(aa, ab) {
            let ac = af(ab), ad = Promise["resolve"]();
            if (0 !== ac["length"]) {
              let ag = G(ae(ab));
              k2["asArray"](ac)["forEach"](function(ah) {
                ad = ad["then"](function() {
                  return Y(ah, a0, ag)["then"](function(ai) {
                    ai && aa["appendChild"](ai);
                  });
                });
              });
            }
            return ad["then"](function() {
              return aa;
            });
            function ae(ah) {
              return k2["isShadowRoot"](ah) ? ah["host"] : ah;
            }
            function af(ah) {
              if (k2["isShadowSlotElement"](ah)) {
                let ai = ah["assignedNodes"]();
                if (ai && 0 < ai["length"]) return ai;
              }
              return ah["childNodes"];
            }
          }
          function a9(aa, ab) {
            return !k2["isElement"](aa) || k2["isShadowSlotElement"](ab) ? Promise["resolve"](aa) : Promise["resolve"]()["then"](ac)["then"](ad)["then"](ae)["then"](af)["then"](function() {
              return aa;
            });
            function ac() {
              function ag(ai, aj) {
                aj["font"] = ai["font"], aj["fontFamily"] = ai["fontFamily"], aj["fontFeatureSettings"] = ai["fontFeatureSettings"], aj["fontKerning"] = ai["fontKerning"], aj["fontSize"] = ai["fontSize"], aj["fontStretch"] = ai["fontStretch"], aj["fontStyle"] = ai["fontStyle"], aj["fontVariant"] = ai["fontVariant"], aj["fontVariantCaps"] = ai["fontVariantCaps"], aj["fontVariantEastAsian"] = ai["fontVariantEastAsian"], aj["fontVariantLigatures"] = ai["fontVariantLigatures"], aj["fontVariantNumeric"] = ai["fontVariantNumeric"], aj["fontVariationSettings"] = ai["fontVariationSettings"], aj["fontWeight"] = ai["fontWeight"];
              }
              function ah(ai, aj) {
                let ak = G(ai);
                ak["cssText"] ? (aj["style"]["cssText"] = ak["cssText"], ag(ak, aj["style"])) : (N(a0, ai, ak, a1, aj), null === a1 && (["inset-block", "inset-block-start", "inset-block-end"]["forEach"]((al) => aj["style"]["removeProperty"](al)), ["left", "right", "top", "bottom"]["forEach"]((al) => {
                  aj["style"]["getPropertyValue"](al) && aj["style"]["setProperty"](al, "0px");
                })));
              }
              ah(ab, aa);
            }
            function ad() {
              let ag = k2["uid"]();
              function ah(ai) {
                let aj = G(ab, ai), ak = aj["getPropertyValue"]("content");
                if ("" !== ak && "none" !== ak) {
                  let an = function() {
                    let ao = "." + ag + ":" + ai, ap = (aj["cssText"] ? aq : ar)();
                    return document["createTextNode"](ao + ("{" + ap + "}"));
                    function aq() {
                      return aj["cssText"] + " content: " + ak + ";";
                    }
                    function ar() {
                      let as = k2["asArray"](aj)["map"](at)["join"]("; ");
                      return as + ";";
                      function at(au) {
                        let av = aj["getPropertyValue"](au), aw = aj["getPropertyPriority"](au) ? " !important" : "";
                        return au + ": " + av + aw;
                      }
                    }
                  };
                  let al = aa["getAttribute"]("class") || "", am = (aa["setAttribute"]("class", al + " " + ag), document["createElement"]("style"));
                  am["appendChild"](an()), aa["appendChild"](am);
                }
              }
              [":before", ":after"]["forEach"](function(ai) {
                ah(ai);
              });
            }
            function ae() {
              k2["isHTMLTextAreaElement"](ab) && (aa["innerHTML"] = ab["value"]), k2["isHTMLInputElement"](ab) && aa["setAttribute"]("value", ab["value"]);
            }
            function af() {
              k2["isSVGElement"](aa) && (aa["setAttribute"]("xmlns", "http://www.w3.org/2000/svg"), k2["isSVGRectElement"](aa)) && ["width", "height"]["forEach"](function(ag) {
                let ah = aa["getAttribute"](ag);
                ah && aa["style"]["setProperty"](ag, ah);
              });
            }
          }
        }(X, T, null);
      })["then"](T["disableEmbedFonts"] ? Promise["resolve"](S) : L)["then"](M2)["then"](function(X) {
        T["bgcolor"] && (X["style"]["backgroundColor"] = T["bgcolor"]), T["width"] && (X["style"]["width"] = T["width"] + "px"), T["height"] && (X["style"]["height"] = T["height"] + "px"), T["style"] && Object["keys"](T["style"])["forEach"](function(Z2) {
          X["style"][Z2] = T["style"][Z2];
        });
        let Y = null;
        return "function" == typeof T["onclone"] && (Y = T["onclone"](X)), Promise["resolve"](Y)["then"](function() {
          return X;
        });
      })["then"](function(X) {
        let Y = T["width"] || k2["width"](X), Z2 = T["height"] || k2["height"](X);
        return Promise["resolve"](X)["then"](function(a0) {
          return a0["setAttribute"]("xmlns", "http://www.w3.org/1999/xhtml"), new XMLSerializer()["serializeToString"](a0);
        })["then"](k2["escapeXhtml"])["then"](function(a0) {
          var a1 = (k2["isDimensionMissing"](Y) ? ' width="100%"' : ' width="' + Y + '"') + (k2["isDimensionMissing"](Z2) ? ' height="100%"' : ' height="' + Z2 + '"');
          return '<svg xmlns="http://www.w3.org/2000/svg"' + ((k2["isDimensionMissing"](Y) ? "" : ' width="' + Y + '"') + (k2["isDimensionMissing"](Z2) ? "" : ' height="' + Z2 + '"')) + "><foreignObject" + a1 + ">" + a0 + "</foreignObject></svg>";
        })["then"](function(a0) {
          return "data:image/svg+xml;charset=utf-8," + a0;
        });
      })["then"](function(X) {
        for (; 0 < W["length"]; ) {
          var Y = W["pop"]();
          Y["parent"]["replaceChild"](Y["child"], Y["wrapper"]);
        }
        return X;
      })["then"](function(X) {
        return D2["impl"]["urlCache"] = [], (() => {
          K && (document["body"]["removeChild"](K), K = null), O2 && clearTimeout(O2), O2 = setTimeout(() => {
            O2 = null, P = {};
          }, 2e4);
        })(), X;
      });
    }
    function J(S, T) {
      return I2(S, T = T || {})["then"](k2["makeImage"])["then"](function(U) {
        var V2 = "number" != typeof T["scale"] ? 1 : T["scale"], W = ((Y, Z2) => {
          let a0 = T["width"] || k2["width"](Y), a1 = T["height"] || k2["height"](Y);
          return k2["isDimensionMissing"](a0) && (a0 = k2["isDimensionMissing"](a1) ? 300 : 2 * a1), k2["isDimensionMissing"](a1) && (a1 = a0 / 2), (Y = document["createElement"]("canvas"))["width"] = a0 * Z2, Y["height"] = a1 * Z2, T["bgcolor"] && ((Z2 = Y["getContext"]("2d"))["fillStyle"] = T["bgcolor"], Z2["fillRect"](0, 0, Y["width"], Y["height"])), Y;
        })(S, V2), X = W["getContext"]("2d");
        return X["msImageSmoothingEnabled"] = false, X["imageSmoothingEnabled"] = false, U && (X["scale"](V2, V2), X["drawImage"](U, 0, 0)), W;
      });
    }
    let K = null;
    function L(S) {
      return x2["resolveAll"]()["then"](function(T) {
        var U;
        return "" !== T && (U = document["createElement"]("style"), S["appendChild"](U), U["appendChild"](document["createTextNode"](T))), S;
      });
    }
    function M2(S) {
      return A5["inlineAll"](S)["then"](function() {
        return S;
      });
    }
    function N(S, T, U, V2, W) {
      let X = D2["impl"]["options"]["copyDefaultStyles"] ? ((Z2, a0) => {
        var a1, a2 = ((a5) => ("relaxed" !== Z2["styleCaching"] ? a5 : a5["filter"]((a6, a7, a8) => 0 === a7 || a7 === a8["length"] - 1))["join"](">"))(a0 = ((a5) => {
          var a6 = [];
          do {
            if (a5["nodeType"] === F) {
              var a7 = a5["tagName"];
              if (a6["push"](a7), Q["includes"](a7)) break;
            }
          } while (a5 = a5["parentNode"]);
          return a6;
        })(a0));
        {
          if (P[a2]) return P[a2];
          a0 = ((a5, a6) => {
            let a7 = a5["body"];
            do {
              var a8 = a6["pop"](), a8 = a5["createElement"](a8);
              a7["appendChild"](a8), a7 = a8;
            } while (0 < a6["length"]);
            return a7["textContent"] = "​", a7;
          })((a1 = (() => {
            if (K) return K["contentWindow"];
            a6 = document["characterSet"] || "UTF-8", a5 = (a5 = document["doctype"]) ? ("<!DOCTYPE " + ac(a5["name"]) + " " + ac(a5["publicId"]) + " " + ac(a5["systemId"]))["trim"]() + ">" : "", (K = document["createElement"]("iframe"))["id"] = "domtoimage-sandbox-" + k2["uid"](), K["style"]["visibility"] = "hidden", K["style"]["position"] = "fixed", document["body"]["appendChild"](K);
            var a5, a6, a7 = K, a8 = "domtoimage-sandbox";
            try {
              return a7["contentWindow"]["document"]["write"](a5 + ("<html><head><meta charset='" + a6 + "'><title>" + a8 + "</title></head><body></body></html>")), a7["contentWindow"];
            } catch (ad) {
            }
            var a9 = document["createElement"]("meta");
            a9["setAttribute"]("charset", a6);
            try {
              var aa = document["implementation"]["createHTMLDocument"](a8), ab = (aa["head"]["appendChild"](a9), a5 + aa["documentElement"]["outerHTML"]);
              return a7["setAttribute"]("srcdoc", ab), a7["contentWindow"];
            } catch (ae) {
            }
            return a7["contentDocument"]["head"]["appendChild"](a9), a7["contentDocument"]["title"] = a8, a7["contentWindow"];
            function ac(af) {
              var ag;
              return af ? ((ag = document["createElement"]("div"))["innerText"] = af, ag["innerHTML"]) : "";
            }
          })())["document"], a0), a1 = ((a5, a6) => {
            let a7 = {}, a8 = a5["getComputedStyle"](a6);
            return k2["asArray"](a8)["forEach"](function(a9) {
              a7[a9] = "width" === a9 || "height" === a9 ? "auto" : a8["getPropertyValue"](a9);
            }), a7;
          })(a1, a0);
          var a3 = a0;
          do {
            var a4 = a3["parentElement"];
            null !== a4 && a4["removeChild"](a3), a3 = a4;
          } while (a3 && "BODY" !== a3["tagName"]);
          return P[a2] = a1;
        }
      })(S, T) : {}, Y = W["style"];
      k2["asArray"](U)["forEach"](function(Z2) {
        var a0, a1 = U["getPropertyValue"](Z2), a2 = X[Z2], a3 = V2 ? V2["getPropertyValue"](Z2) : void 0;
        Y["getPropertyValue"](Z2) || (a1 !== a2 || V2 && a1 !== a3) && (a2 = U["getPropertyPriority"](Z2), a3 = Y, a1 = a1, a2 = a2, a0 = 0 <= ["background-clip"]["indexOf"](Z2 = Z2), a2 ? (a3["setProperty"](Z2, a1, a2), a0 && a3["setProperty"]("-webkit-" + Z2, a1, a2)) : (a3["setProperty"](Z2, a1), a0 && a3["setProperty"]("-webkit-" + Z2, a1)));
      });
    }
    let O2 = null, P = {}, Q = ["ADDRESS", "ARTICLE", "ASIDE", "BLOCKQUOTE", "DETAILS", "DIALOG", "DD", "DIV", "DL", "DT", "FIELDSET", "FIGCAPTION", "FIGURE", "FOOTER", "FORM", "H1", "H2", "H3", "H4", "H5", "H6", "HEADER", "HGROUP", "HR", "LI", "MAIN", "NAV", "OL", "P", "PRE", "SECTION", "SVG", "TABLE", "UL", "math", "svg", "BODY", "HEAD", "HTML"];
  })(commonjsGlobal);
})(domToImageMore_min);
var domToImageMore_minExports = domToImageMore_min["exports"];
const a = getDefaultExportFromCjs(domToImageMore_minExports);
function dom2Base64(b2, c2) {
  return a["toPng"](b2, { ...c2 });
}
function image2Base64(b2) {
  const c2 = document["createElement"]("canvas");
  c2["width"] = b2["width"], c2["height"] = b2["height"];
  const d2 = c2["getContext"]("2d");
  d2 == null ? void 0 : d2["drawImage"](b2, 0, 0, b2["width"], b2["height"]);
  const e2 = c2["toDataURL"]("image/png");
  return e2;
}
function getImgBase64(b2) {
  return new Promise((c2, d2) => {
    let e2 = "";
    const f2 = new Image();
    f2["src"] = b2, f2["onload"] = function() {
      e2 = image2Base64(f2), c2(e2);
    };
  });
}
function mergeImage(b2, c2, d2, e2) {
  return new Promise((f2, g2) => {
    const h2 = document["createElement"]("canvas");
    h2["width"] = d2, h2["height"] = e2;
    const i2 = h2["getContext"]("2d"), j2 = new Image();
    j2["crossOrigin"] = "Anonymous", j2["onload"] = () => {
      i2 == null ? void 0 : i2["drawImage"](j2, 0, 0, d2, e2);
      const k2 = new Image();
      k2["crossOrigin"] = "Anonymous", k2["onload"] = () => {
        i2 == null ? void 0 : i2["drawImage"](k2, 0, 0, d2, e2);
        const l2 = h2["toDataURL"]("image/png");
        f2(l2);
      }, k2["src"] = c2;
    }, j2["src"] = b2;
  });
}
const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseClass,
  FlickerEntity,
  HighlightTileset,
  LatLngArray,
  LatLngPoint,
  MouseTooltip,
  Popup,
  addClass,
  camera: index$6,
  createDom,
  createSvg,
  createVideo,
  deepClone,
  deepMerge,
  deepMergeAll,
  dom2Base64,
  effects: index$5,
  empty,
  enterFullscreen,
  exitFullscreen,
  filterTree,
  findNode,
  findNodeAll,
  findPath,
  findPathAll,
  forEachTree,
  formatNum,
  get: get$1,
  getClass,
  getColorRampLegend,
  getImgBase64,
  getRampValueColor,
  getStyle,
  guid,
  hasClass,
  image2Base64,
  isArray,
  isBoolean,
  isDark,
  isDate,
  isDef,
  isElement,
  isEmpty,
  isFunction,
  isGuid,
  isImgPath,
  isMap,
  isMergeableObject,
  isNumber,
  isObject,
  isPromise,
  isRegExp,
  isShortGuid,
  isSimpleType,
  isString,
  isUnDef,
  isUrl,
  isWindow,
  layer: index$9,
  listToTree,
  loopArrayCallback,
  map: index$7,
  material: index$a,
  mergeImage,
  parseDom,
  remove,
  removeClass,
  setClass,
  shortGuid,
  template,
  treeMap,
  treeToList,
  widget: index$4
}, Symbol.toStringTag, { value: "Module" }));
function callWithErrorHandling(a2, b2, c2, ...d2) {
  try {
    return d2 ? c2(...d2) : c2();
  } catch (e2) {
    handlerError(a2, b2, e2);
  }
}
function handlerError(a2, b2, c2) {
  const d2 = isArray(b2) ? b2[0] : b2, e2 = isArray(b2) ? b2["slice"](1) : [], f2 = ["[KBE3D warn]: “" + d2 + "”.", ...e2, c2 == null ? void 0 : c2["message"]];
  console["warn"](...f2);
  if (a2 === "THROW" && c2) throw c2;
}
function handlerInfo(a2) {
  const b2 = isArray(a2) ? a2[0] : a2, c2 = isArray(a2) ? a2["slice"](1) : [], d2 = ["[KBE3D Info]: “" + b2 + "”.", ...c2];
  console["log"](...d2);
}
const DEF_OPTIONS = { "disableMouseEvent": ![], "moveDelay": 30, "pickWidth": 4, "pickHeight": 4, "pickLimit": 9 };
class MouseEvent {
  constructor(b2, c2 = {}) {
    __publicField(this, "earth");
    __publicField(this, "viewer");
    __publicField(this, "options");
    __publicField(this, "handler");
    __publicField(this, "_disableMouseEvent");
    __publicField(this, "_lastPickedInfo");
    __publicField(this, "_moveDelayTik");
    __publicField(this, "_lastMouseOverItem");
    c2 = { ...DEF_OPTIONS, ...c2 }, this["earth"] = b2, this["viewer"] = b2["viewer"], this["options"] = c2, this["_disableMouseEvent"] = Boolean(this["options"]["disableMouseEvent"]), this["_setInputAction"]();
  }
  get ["disableMouseEvent"]() {
    return this["_disableMouseEvent"];
  }
  set ["disableMouseEvent"](b2) {
    this["_disableMouseEvent"] = b2, this["_moveDelayTik"] && (clearTimeout(this["_moveDelayTik"]), this["_moveDelayTik"] = void 0);
  }
  ["_setInputAction"]() {
    this["handler"] = new a$d["ScreenSpaceEventHandler"](this["viewer"]["canvas"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_clickHandler"](b2);
    }, a$d["ScreenSpaceEventType"]["LEFT_CLICK"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["earth"]["emit"](EventType["dblClick"], b2);
    }, a$d["ScreenSpaceEventType"]["LEFT_DOUBLE_CLICK"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_globeMouseHandler"](b2, [EventType["leftDown"], EventType["mouseDown"]]);
    }, a$d["ScreenSpaceEventType"]["LEFT_DOWN"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_globeMouseHandler"](b2, [EventType["leftUp"], EventType["mouseUp"]]);
    }, a$d["ScreenSpaceEventType"]["LEFT_UP"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      const c2 = getCurrentMousePosition(this["viewer"], b2["endPosition"]);
      b2["cartesian"] = c2, this["_moveDelayTik"] && (clearTimeout(this["_moveDelayTik"]), this["_moveDelayTik"] = void 0), this["options"]["moveDelay"] !== void 0 && this["options"]["moveDelay"] > 0 ? this["_moveDelayTik"] = setTimeout((d2) => {
        this["_moveDelayTik"] = void 0, this["_mouseMoveHandler"](b2);
      }, this["options"]["moveDelay"]) : this["_mouseMoveHandler"](b2), this["earth"]["emit"](EventType["mouseMove"], { ...b2, "cartesian": c2, "windowPosition": b2["endPosition"] });
    }, a$d["ScreenSpaceEventType"]["MOUSE_MOVE"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["earth"]["emit"](EventType["wheel"], b2);
    }, a$d["ScreenSpaceEventType"]["WHEEL"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_globeMouseHandler"](b2, EventType["rightClick"]);
    }, a$d["ScreenSpaceEventType"]["RIGHT_CLICK"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_globeMouseHandler"](b2, [EventType["rightDown"], EventType["mouseDown"]]);
    }, a$d["ScreenSpaceEventType"]["RIGHT_DOWN"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_globeMouseHandler"](b2, [EventType["rightUp"], EventType["mouseUp"]]);
    }, a$d["ScreenSpaceEventType"]["RIGHT_UP"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_globeMouseHandler"](b2, EventType["middleClick"]);
    }, a$d["ScreenSpaceEventType"]["MIDDLE_CLICK"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_globeMouseHandler"](b2, [EventType["middleDown"], EventType["mouseDown"]]);
    }, a$d["ScreenSpaceEventType"]["MIDDLE_DOWN"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["_globeMouseHandler"](b2, [EventType["middleUp"], EventType["mouseUp"]]);
    }, a$d["ScreenSpaceEventType"]["MIDDLE_UP"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["earth"]["emit"](EventType["pinchStart"], b2);
    }, a$d["ScreenSpaceEventType"]["PINCH_START"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["earth"]["emit"](EventType["pinchEnd"], b2);
    }, a$d["ScreenSpaceEventType"]["PINCH_END"]), this["handler"]["setInputAction"]((b2) => {
      if (this["_disableMouseEvent"]) return;
      this["earth"]["emit"](EventType["pinchMove"], b2);
    }, a$d["ScreenSpaceEventType"]["PINCH_MOVE"]), this["viewer"]["canvas"]["addEventListener"]("keydown", this["_onKeyDown"]["bind"](this)), this["viewer"]["canvas"]["addEventListener"]("keyup", this["_onKeyUp"]["bind"](this));
  }
  ["_onKeyDown"](b2) {
    this["earth"]["emit"](EventType["keydown"], { "ctrlKey": b2["ctrlKey"], "altKey": b2["altKey"], "metaKey": b2["metaKey"], "shiftKey": b2["shiftKey"], "code": b2["code"], "key": b2["key"], "keyCode": b2["keyCode"] });
  }
  ["_onKeyUp"](b2) {
    this["earth"]["emit"](EventType["keyup"], { "ctrlKey": b2["ctrlKey"], "altKey": b2["altKey"], "metaKey": b2["metaKey"], "shiftKey": b2["shiftKey"], "code": b2["code"], "key": b2["key"], "keyCode": b2["keyCode"] });
  }
  ["_clickHandler"](b2) {
    if (!b2 || !b2["position"]) return ![];
    const c2 = b2["position"], d2 = this["_getPickTarget"](c2, b2);
    d2["sourceTarget"] ? (this["_fireTargetEvent"](EventType["click"], d2), this["earth"]["emit"](EventType["clickGraphic"], d2)) : (this["earth"]["emit"](EventType["click"], d2), this["earth"]["emit"](EventType["clickMap"], d2), this["_getPickImageryLayerFeatures"](c2, d2));
  }
  ["_globeMouseHandler"](b2, c2) {
    if (!b2 || !b2["position"]) return ![];
    const d2 = b2["position"], e2 = this["_getPickTarget"](d2, b2);
    Array["isArray"](c2) ? c2["forEach"]((f2) => {
      e2["sourceTarget"] ? this["_fireTargetEvent"](f2, e2) : this["earth"]["emit"](f2, e2);
    }) : e2["sourceTarget"] ? this["_fireTargetEvent"](c2, e2) : this["earth"]["emit"](c2, e2);
  }
  ["_mouseMoveHandler"](b2) {
    if (!b2 || !b2["endPosition"]) return ![];
    const c2 = this["_getPickTarget"](b2["endPosition"], b2), d2 = c2["sourceTarget"];
    d2 && !d2["noMouseMove"] ? this["_activateMouseOver"](c2) : this["_activateMouseOut"](), this["earth"]["emit"](EventType["mouseMoveTarget"], { ...b2, ...c2 });
  }
  ["_getPickTarget"](b2, c2) {
    let d2;
    try {
      d2 = this["viewer"]["scene"]["pick"](b2, this["options"]["pickWidth"], this["options"]["pickHeight"]);
    } catch (h2) {
    }
    let f2 = c2 == null ? void 0 : c2["cartesian"];
    !f2 && (f2 = getCurrentMousePosition(this["viewer"], b2));
    if (this["_lastPickedInfo"] && d2 && this["_lastPickedInfo"]["scenePicked"] === d2) return { ...c2, ...this["_lastPickedInfo"], "cartesian": f2, "windowPosition": b2 };
    let g2 = this["_getTargetInfo"](d2);
    if (d2 && this["_allowDrillPick"](g2)) {
      const i2 = this["viewer"]["scene"]["drillPick"](b2, this["options"]["pickLimit"], this["options"]["pickWidth"], this["options"]["pickHeight"]);
      if (i2 && i2["length"] > 0) for (let j2 = 0; j2 < i2["length"]; j2++) {
        const k2 = i2[j2];
        if (d2 === k2) continue;
        const l2 = this["_getTargetInfo"](k2);
        if (this["_allowDrillPick"](l2)) continue;
        else {
          g2 = l2;
          break;
        }
      }
    }
    return this["_lastPickedInfo"] = g2, { ...c2, ...g2, "cartesian": f2, "windowPosition": b2 };
  }
  ["_getTargetInfo"](b2) {
    if (!a$d["defined"](b2)) return {};
    let c2, d2, e2;
    if (a$d["defined"](b2["id"]) && b2["id"] instanceof a$d["Entity"]) c2 = b2["id"];
    else {
      if (b2 instanceof a$d["Cesium3DTileFeature"]) {
        c2 = b2;
        const f2 = b2["tileset"];
        d2 = this["earth"]["getLayerById"](f2["_kbe3d_layerId"]);
        const g2 = {}, h2 = b2["getPropertyIds"]();
        for (let j2 = 0; j2 < h2["length"]; j2++) {
          const k2 = h2[j2];
          if (!b2["hasProperty"](k2)) continue;
          const l2 = b2["getProperty"](k2);
          if (l2 == null) continue;
          g2[k2] = l2;
        }
        e2 = { "attr": g2, "feature": b2 };
      } else a$d["defined"](b2["primitive"]) ? c2 = b2["primitive"] : console["log"]("_getPickTarget: 拾取到了对象，请确认是否要做处理", b2);
    }
    return c2 && (d2 = d2 || this["earth"]["getLayerById"](c2["_kbe3d_layerId"])), { "scenePicked": b2, "sourceTarget": c2, "layer": d2, "picked3DTileFeature": e2 };
  }
  ["_getPickImageryLayerFeatures"](b2, c2) {
    const d2 = this["viewer"]["scene"], e2 = d2["camera"]["getPickRay"](b2);
    if (!e2) return;
    const f2 = d2["imageryLayers"]["pickImageryLayerFeatures"](e2, d2);
    if (!a$d["defined"](f2)) return;
    Promise["resolve"](f2)["then"]((g2) => {
      this["_clickTileGraphicHandler"](g2, b2, c2);
    })["catch"]((g2) => {
      handlerError("NOT_THROW", "pickImageryLayerFeatures:出错了");
    });
  }
  ["_clickTileGraphicHandler"](b2, c2, d2) {
    if (!a$d["defined"](b2) || b2["length"] == 0) return;
    const e2 = b2[0], f2 = e2["imageryLayer"], g2 = this["earth"]["getLayerById"](f2["_kbe3d_layerId"]), h2 = { "layer": g2, "pickedImageryLayerFeatureInfo": e2, "pickedImageryLayerFeatureInfos": b2, "cartesian": d2 == null ? void 0 : d2["cartesian"], "windowPosition": c2 };
    g2 && g2["emit"](EventType["click"], h2, ![]), this["earth"]["emit"](EventType["clickTileGraphic"], h2);
  }
  ["_allowDrillPick"](b2) {
    var _a;
    const c2 = (_a = b2["layer"]) == null ? void 0 : _a["allowDrillPick"];
    if (c2) return isFunction(c2) ? c2(b2) : !![];
    return ![];
  }
  ["_activateMouseOver"](b2) {
    if (this["_lastMouseOverItem"] && b2["id"] && b2["id"] == this["_lastMouseOverItem"]["id"]) return;
    this["_activateMouseOut"](), this["_fireTargetEvent"](EventType["mouseOver"], b2), this["_lastMouseOverItem"] = b2;
  }
  ["_activateMouseOut"]() {
    if (this["_lastMouseOverItem"] == null) return;
    this["_fireTargetEvent"](EventType["mouseOut"], this["_lastMouseOverItem"]), this["_lastMouseOverItem"] = null;
  }
  ["_fireTargetEvent"](b2, c2) {
    var _a;
    const d2 = c2["sourceTarget"][b2];
    if (d2 && typeof d2 == "function") d2(c2);
    else ((_a = c2["layer"]) == null ? void 0 : _a["emit"]) ? c2["layer"]["emit"](b2, c2, !![]) : this["earth"]["emit"](b2, c2);
  }
  ["destroy"]() {
    var _a;
    (_a = this["handler"]) == null ? void 0 : _a["destroy"](), delete this["handler"], this["viewer"]["canvas"]["removeEventListener"]("keydown", this["_onKeyDown"]), this["viewer"]["canvas"]["removeEventListener"]("keyup", this["_onKeyUp"]);
  }
}
class SceneEvent {
  constructor(a2) {
    __publicField(this, "viewer");
    this["viewer"] = a2;
  }
  ["on"](a2, b2, c2) {
    if (!b2) return;
    let d2;
    switch (a2) {
      case EventType["cameraMoveStart"]:
        d2 = this["viewer"]["camera"]["moveStart"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["cameraMoveEnd"]:
        d2 = this["viewer"]["camera"]["moveEnd"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["cameraChanged"]:
        d2 = this["viewer"]["camera"]["changed"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["preUpdate"]:
        d2 = this["viewer"]["scene"]["preUpdate"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["postUpdate"]:
        d2 = this["viewer"]["scene"]["postUpdate"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["preRender"]:
        d2 = this["viewer"]["scene"]["preRender"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["postRender"]:
        d2 = this["viewer"]["scene"]["postRender"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["renderError"]:
        d2 = this["viewer"]["scene"]["renderError"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["morphStart"]:
        d2 = this["viewer"]["scene"]["morphStart"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["morphComplete"]:
        d2 = this["viewer"]["scene"]["morphComplete"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["clockTick"]:
        d2 = this["viewer"]["clock"]["onTick"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["terrainChange"]:
        d2 = this["viewer"]["scene"]["globe"]["terrainProviderChanged"]["addEventListener"](b2, c2 || this);
        break;
      case EventType["tileLoadProgress"]:
        d2 = this["viewer"]["scene"]["globe"]["tileLoadProgressEvent"]["addEventListener"](b2, c2 || this);
        break;
    }
    return d2;
  }
  ["off"](a2, b2, c2) {
    let d2 = ![];
    switch (a2) {
      case EventType["cameraMoveStart"]:
        d2 = this["viewer"]["camera"]["moveStart"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["cameraMoveEnd"]:
        d2 = this["viewer"]["camera"]["moveEnd"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["cameraChanged"]:
        d2 = this["viewer"]["camera"]["changed"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["preUpdate"]:
        d2 = this["viewer"]["scene"]["preUpdate"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["postUpdate"]:
        d2 = this["viewer"]["scene"]["postUpdate"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["preRender"]:
        d2 = this["viewer"]["scene"]["preRender"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["postRender"]:
        d2 = this["viewer"]["scene"]["postRender"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["renderError"]:
        d2 = this["viewer"]["scene"]["renderError"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["morphStart"]:
        d2 = this["viewer"]["scene"]["morphStart"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["morphComplete"]:
        d2 = this["viewer"]["scene"]["morphComplete"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["clockTick"]:
        d2 = this["viewer"]["clock"]["onTick"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["terrainChange"]:
        d2 = this["viewer"]["scene"]["globe"]["terrainProviderChanged"]["removeEventListener"](b2, c2 || this);
        break;
      case EventType["tileLoadProgress"]:
        d2 = this["viewer"]["scene"]["globe"]["tileLoadProgressEvent"]["removeEventListener"](b2, c2 || this);
        break;
    }
    return d2;
  }
}
const fogEffectControl = [{ "uuid": "cesium-fogEffect-button", "title": "雾", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 32 32">\n      <g fill="none"><path fill="#636363" d="M20.554 2H5.67C6.5 6 7.566 7.987 10 9c7.806-2.23 11.546-.324 10.554-7"/><path fill="#9b9b9b" d="M12.179 8.451A13.07 13.07 0 0 0 6.91 2H5.67C3.64 2 2 3.64 2 5.67V26a4 4 0 0 0 4 4h20a4 4 0 0 0 4-4V5.67C30 3.65 28.36 2 26.33 2h-5.776v.003a12.53 12.53 0 0 0-5.472 5.901c-.87.145-1.84.313-2.904.547"/><path fill="#bebebe" d="M17.5 29C23.851 29 29 23.851 29 17.5S23.851 6 17.5 6S6 11.149 6 17.5S11.149 29 17.5 29"/><path fill="#d3d3d3" d="M26.33 29A2.666 2.666 0 0 0 29 26.33v-9.268A8 8 0 0 0 22 25zm-10.94-5c.39-1.1.61-2.27.61-3.5C16 14.7 11.3 10 5.5 10c-.864 0-1.699.109-2.5.308V26.33A2.666 2.666 0 0 0 5.67 29z"/><path fill="#e6e6e6" d="M5.051 28.928q.299.071.62.072h20.66q.32 0 .618-.072A10.995 10.995 0 0 0 16 19c-5.709 0-10.411 4.354-10.949 9.928"/></g>\n    </svg>', "onClick": (a2) => {
  var _a;
  if (a2["effects"]["fog"]) a2["effects"]["fog"]["enable"] = !a2["effects"]["fog"]["enable"];
  else {
    const b2 = new FogEffect(((_a = a2["earthOptions"]["effects"]) == null ? void 0 : _a["find"]((c2) => c2["type"] == "fog")) ?? {});
    a2["addEffect"](b2), b2["enable"] = !![];
  }
} }];
const lightningEffectControl = [{ "uuid": "cesium-lightningEffect-button", "title": "闪电", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n      <path fill="currentColor" d="M6 16a5 5 0 0 1-5-5a5 5 0 0 1 5-5c1-2.35 3.3-4 6-4c3.43 0 6.24 2.66 6.5 6.03L19 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4h-1a1 1 0 0 1-1-1a1 1 0 0 1 1-1h1a2 2 0 0 0 2-2a2 2 0 0 0-2-2h-2V9a5 5 0 0 0-5-5C9.5 4 7.45 5.82 7.06 8.19C6.73 8.07 6.37 8 6 8a3 3 0 0 0-3 3a3 3 0 0 0 3 3h1a1 1 0 0 1 1 1a1 1 0 0 1-1 1zm6-5h3l-2 4h2l-3.75 7l.75-5H9.5z"/>\n    </svg>', "onClick": (a2) => {
  var _a;
  if (a2["effects"]["lightning"]) a2["effects"]["lightning"]["enable"] = !a2["effects"]["lightning"]["enable"];
  else {
    const b2 = new LightningEffect(((_a = a2["earthOptions"]["effects"]) == null ? void 0 : _a["find"]((c2) => c2["type"] == "lightning")) ?? {});
    a2["addEffect"](b2), b2["enable"] = !![];
  }
} }];
const rainEffectControl = [{ "uuid": "cesium-rainEffect-button", "title": "雨", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24">\n      <path fill="currentColor" d="M11 2a6 6 0 0 0-5.986 6.41a5 5 0 0 0-1.322 8.34a1 1 0 1 0 1.324-1.5a3.002 3.002 0 0 1 1.324-5.178a1 1 0 0 0 .757-1.193A4 4 0 1 1 14.92 7.2a1 1 0 0 0 .999.8H16a4 4 0 0 1 2.4 7.2a1 1 0 0 0 1.201 1.6a6 6 0 0 0-2.93-10.762A6 6 0 0 0 11 2m1.949 13.316a1 1 0 0 0-1.898-.632l-2 6a1 1 0 0 0 1.898.632zm3.367-2.265a1 1 0 0 1 .633 1.265l-2 6a1 1 0 0 1-1.898-.632l2-6a1 1 0 0 1 1.265-.633M9.45 14.316a1 1 0 0 0-1.898-.632l-2 6a1 1 0 0 0 1.898.632z"/>\n    </svg>', "onClick": (a2) => {
  var _a;
  if (a2["effects"]["rain"]) a2["effects"]["rain"]["enable"] = !a2["effects"]["rain"]["enable"];
  else {
    const b2 = new RainEffect(((_a = a2["earthOptions"]["effects"]) == null ? void 0 : _a["find"]((c2) => c2["type"] == "rain")) ?? {});
    a2["addEffect"](b2), b2["enable"] = !![];
  }
} }];
const snowEffectControl = [{ "uuid": "cesium-snowEffect-button", "title": "雪", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n    <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 19V5M9.953 3L12 5l2.047-2M9.953 21L12 19l2.047 2m-8.251-5.5l12.408-7m.749-2.732L18.204 8.5L21 9.232M3 14.768l2.796.732l-.75 2.732m.75-9.732l12.408 7M21 14.768l-2.796.732l.75 2.732M5.047 5.768L5.796 8.5L3 9.232"/>\n    </svg>', "onClick": (a2) => {
  var _a;
  if (a2["effects"]["snow"]) a2["effects"]["snow"]["enable"] = !a2["effects"]["snow"]["enable"];
  else {
    const b2 = new SnowEffect(((_a = a2["earthOptions"]["effects"]) == null ? void 0 : _a["find"]((c2) => c2["type"] == "snow")) ?? {});
    a2["addEffect"](b2), b2["enable"] = !![];
  }
} }];
const snowCoverEffectControl = [{ "uuid": "cesium-snowCoverEffect-button", "title": "积雪覆盖模型", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 32 32">\n      <path fill="currentColor" d="M13.07 4.215a4.13 4.13 0 0 1 5.85 0l4.168 4.168l.012.002l6.9 6.9V29H2V15.285zm4.183 4.316l.557-.279a8.9 8.9 0 0 1 2.847-.886l-2.444-2.444a3.13 3.13 0 0 0-4.436 0l-3.434 3.434l.428.211a7 7 0 0 0 3.079.718h.24c1.096 0 2.18-.254 3.157-.751zM29 22.989l-1.003.448a19.4 19.4 0 0 1-7.91 1.695a19.3 19.3 0 0 1-6.35-1.072l-3.813-1.327A13.1 13.1 0 0 0 5.621 22q-1.327.002-2.621.27V28h26z"/>\n    </svg>', "onClick": (a2) => {
  var _a;
  if (a2["effects"]["snowCover"]) a2["effects"]["snowCover"]["enable"] = !a2["effects"]["snowCover"]["enable"];
  else {
    const b2 = new SnowCoverEffect(((_a = a2["earthOptions"]["effects"]) == null ? void 0 : _a["find"]((c2) => c2["type"] == "snowCover")) ?? {});
    a2["addEffect"](b2), b2["enable"] = !![];
  }
} }];
const zoomControl = [{ "uuid": "cesium-zoomout-button", "title": "缩小", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M19 13H5v-2h14z"/></svg>', "onClick": (a2) => zoomOut(a2["viewer"]) }, { "uuid": "cesium-zoomin-button", "title": "放大", "icon": '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"/></svg>', "onClick": (a2) => zoomIn(a2["viewer"]) }];
a$d["Ion"]["defaultAccessToken"] = defaultToken["ion"], a$d["Camera"]["DEFAULT_VIEW_RECTANGLE"] = a$d["Rectangle"]["fromDegrees"](...defaultViewRectangle);
const _Earth = class _Earth extends BaseClass {
  constructor(c2, d2 = {}, e2 = {}) {
    var _a, _b, _c, _d, _e;
    super({ "viewerOptions": d2, "earthOptions": e2, "uuid": e2["uuid"] });
    __publicField(this, "viewerOptions");
    __publicField(this, "earthOptions");
    __publicField(this, "viewer");
    __publicField(this, "_layerIdx", 0);
    __publicField(this, "_arrLayerIdx", []);
    __publicField(this, "_layerCache", {});
    __publicField(this, "_effectCache", {});
    __publicField(this, "_sceneEvent");
    __publicField(this, "_mouseEvent");
    __publicField(this, "_popup");
    __publicField(this, "_disableMouseEvent");
    __publicField(this, "mouseTooltip");
    __publicField(this, "disableDefaultContextMenu");
    this["viewerOptions"] = { ...d2 }, this["earthOptions"] = { ...e2 }, this["disableDefaultContextMenu"] = a$d["defaultValue"]((_a = this["earthOptions"]) == null ? void 0 : _a["disableDefaultContextMenu"], !![]), this["_disableMouseEvent"] = a$d["defaultValue"]((_c = (_b = this["earthOptions"]) == null ? void 0 : _b["mouseMove"]) == null ? void 0 : _c["disableMouseEvent"], ![]), this["setToken"](e2 == null ? void 0 : e2["token"]), this["viewer"] = this["_createViewer"](c2), this["_mouseEvent"] = new MouseEvent(this, { ...(_d = this["earthOptions"]) == null ? void 0 : _d["mouseMove"], "disableMouseEvent": this["_disableMouseEvent"] }), this["_sceneEvent"] = new SceneEvent(this["viewer"]), this["_initLayers"](), this["_initEffects"](), this["_initWidgets"](), this["_popup"] = new Popup(this["viewer"]), this["mouseTooltip"] = new MouseTooltip(this["viewer"]), (e2 == null ? void 0 : e2["homeVision"]) && flyTo(this["viewer"], e2["homeVision"]), ((_e = this["earthOptions"]) == null ? void 0 : _e["debugLog"]) && this["on"](EventType["click"], (f2) => {
      console["log"]("当前视角信息：", JSON["stringify"](this["getCameraVision"]()));
    }), _Earth["EarthCache"]["set"](this["uuid"], this);
  }
  static async ["getInstance"](c2, d2 = 5e3) {
    return new Promise((e2, f2) => {
      const g2 = _Earth["EarthCache"]["get"](c2);
      if (g2) e2(g2);
      else {
        let h2 = 0;
        const j2 = setInterval(() => {
          h2 += 200;
          const k2 = _Earth["EarthCache"]["get"](c2);
          k2 && (clearInterval(j2), e2(k2)), h2 > d2 && (clearInterval(j2), e2(void 0));
        }, 200);
      }
    });
  }
  get ["imageryLayers"]() {
    return this["viewer"]["imageryLayers"];
  }
  get ["imageryLayersArr"]() {
    const c2 = Array["from"]({ "length": this["viewer"]["imageryLayers"]["length"] ?? 0 })["map"]((d2, e2) => {
      return this["viewer"]["imageryLayers"]["get"](e2);
    });
    return c2;
  }
  get ["dataSources"]() {
    return this["viewer"]["dataSources"];
  }
  get ["entities"]() {
    return this["viewer"]["entities"];
  }
  get ["hasTerrain"]() {
    return !(this["viewer"]["terrainProvider"] instanceof a$d["EllipsoidTerrainProvider"]);
  }
  get ["container"]() {
    return this["viewer"]["container"];
  }
  get ["effects"]() {
    return this["_effectCache"];
  }
  get ["popup"]() {
    return this["_popup"];
  }
  get ["disableMouseEvent"]() {
    return this["_disableMouseEvent"];
  }
  set ["disableMouseEvent"](c2) {
    this["setDisableMouseEvent"](c2);
  }
  ["_createViewer"](c2) {
    return callWithErrorHandling("THROW", "Earth.constructor", () => {
      let d2;
      if (isString(c2)) {
        const e2 = c2["replace"](/^#/, ""), f2 = document["getElementById"](e2);
        if (f2) c2 = f2;
        else throw new TypeError('Element with id "' + c2 + '" does not exist in the document.');
      }
      if (isElement(c2) || c2 instanceof a$d["Viewer"]) return isElement(c2) ? d2 = new a$d["Viewer"](c2, this["viewerOptions"]) : d2 = c2, d2["container"]["classList"]["add"]("kbe3d-cesium-container"), d2["scene"]["canvas"]["oncontextmenu"] = () => {
        return !this["disableDefaultContextMenu"];
      }, d2;
      else throw new TypeError("the view param is not in 【string | Element | Cesium.Viewer】");
    });
  }
  ["_initWidgets"]() {
    var _a, _b, _c, _d, _e, _f;
    ((_a = this["earthOptions"]) == null ? void 0 : _a["fogButton"]) && addButton(this, fogEffectControl), ((_b = this["earthOptions"]) == null ? void 0 : _b["lightningButton"]) && addButton(this, lightningEffectControl), ((_c = this["earthOptions"]) == null ? void 0 : _c["rainButton"]) && addButton(this, rainEffectControl), ((_d = this["earthOptions"]) == null ? void 0 : _d["snowButton"]) && addButton(this, snowEffectControl), ((_e = this["earthOptions"]) == null ? void 0 : _e["snowCoverButton"]) && addButton(this, snowCoverEffectControl), ((_f = this["earthOptions"]) == null ? void 0 : _f["zoomButton"]) && addButton(this, zoomControl);
  }
  ["setRenderErrorHandler"](c2) {
    setRenderErrorHandler(this["viewer"], c2);
  }
  ["setToken"](c2) {
    a$d["Ion"]["defaultAccessToken"] = (c2 == null ? void 0 : c2["ion"]) ?? defaultToken["ion"];
  }
  ["setDisableMouseEvent"](c2) {
    this["_disableMouseEvent"] = Boolean(c2), this["_mouseEvent"]["disableMouseEvent"] = Boolean(c2);
  }
  ["setDisableDefaultContextMenu"](c2) {
    this["disableDefaultContextMenu"] = c2;
  }
  ["destroy"]() {
    _Earth["EarthCache"]["delete"](this["uuid"]);
    try {
      this["viewer"]["destroy"]();
    } catch (c2) {
      handlerError("NOT_THROW", "Earth.destroy: viewer已经被销毁", c2);
    }
    super["destroy"]();
  }
  ["cancelFlyTo"]() {
    cancelFlyTo(this["viewer"]);
  }
  ["flyHome"](c2) {
    var _a, _b;
    ((_a = this["earthOptions"]) == null ? void 0 : _a["homeVision"]) && flyTo(this["viewer"], { ...(_b = this["earthOptions"]) == null ? void 0 : _b["homeVision"], ...c2 });
  }
  ["flyTo"](c2) {
    flyTo(this["viewer"], c2);
  }
  ["flyToPoint"](c2, d2 = {}) {
    flyToPoint(this["viewer"], c2, d2);
  }
  ["flyToExtent"](c2, d2 = {}) {
    flyToExtent(this["viewer"], c2, d2);
  }
  ["flyToPositions"](c2, d2 = {}) {
    flyToPositions(this["viewer"], c2, d2);
  }
  ["getCameraVision"](c2) {
    return getCameraVision(this["viewer"], c2);
  }
  ["getExtent"](c2 = LatLngPoint["FormatLength"]) {
    return getExtent(this["viewer"], c2);
  }
  ["_initLayers"]() {
    var _a, _b, _c;
    this["_layerIdx"] = 1, this["_arrLayerIdx"] = [];
    const c2 = (_a = this["earthOptions"]) == null ? void 0 : _a["layers"], d2 = [];
    c2 == null ? void 0 : c2["forEach"]((e2, f2) => {
      e2["id"] !== void 0 ? this["_arrLayerIdx"]["push"](e2["id"]) : e2["id"] = this["_getNextLayerId"]();
      const g2 = createLayer(e2);
      if (!g2) return;
      e2["show"] && this["addLayer"](g2);
      d2["push"](e2);
      if (g2["hasChildLayer"] && e2["layers"]) for (let h2 = 0; h2 < e2["layers"]["length"]; h2++) {
        const j2 = e2["layers"][h2];
        j2["pid"] = e2["id"], j2["parent"] = g2, !j2["id"] && (j2["id"] = this["_getNextLayerId"]()), d2["push"](j2);
      }
    });
    for (let e2 = 0; e2 < d2["length"]; e2++) {
      const f2 = d2[e2];
      let g2 = Number(f2["zIndex"]);
      Number["isNaN"](g2) && (g2 = e2), f2["zIndex"] = g2, this["_layerCache"][f2["id"]] && Reflect["has"](this["_layerCache"][f2["id"]], "setZIndex") && ((_c = (_b = this["_layerCache"][f2["id"]])["setZIndex"]) == null ? void 0 : _c.call(_b, g2));
    }
  }
  ["_getNextLayerId"]() {
    while (this["_arrLayerIdx"]["includes"](this["_layerIdx"])) {
      this["_layerIdx"]++;
    }
    return this["_arrLayerIdx"]["push"](this["_layerIdx"]), this["_layerIdx"];
  }
  ["getLayerById"](c2) {
    if (a$d["defined"](this["_layerCache"][c2])) return this["_layerCache"][c2];
    const d2 = this["getLayers"]();
    for (let e2 = 0, f2 = d2["length"]; e2 < f2; e2++) {
      const g2 = d2[e2];
      if (g2["uuid"] == c2 || g2["id"] == c2) return g2;
      if (g2["hasChildLayer"] && g2["arrLayer"]) for (let h2 = 0; h2 < g2["arrLayer"]["length"]; h2++) {
        const j2 = g2["arrLayer"][h2];
        if (j2["uuid"] == c2 || j2["id"] == c2) return j2;
      }
    }
    return void 0;
  }
  ["getLayerByAttr"](c2, d2 = "id") {
    if (a$d["defined"](this["_layerCache"][c2])) return this["_layerCache"][c2];
    const e2 = this["getLayers"]();
    for (let f2 = 0, g2 = e2["length"]; f2 < g2; f2++) {
      const h2 = e2[f2];
      if (h2["options"][d2] == c2) return h2;
    }
    return void 0;
  }
  ["getLayers"]() {
    const c2 = [];
    return Object["keys"](this["_layerCache"])["forEach"]((d2) => {
      const e2 = this["_layerCache"][d2];
      if (e2["options"]["isInternal"]) return;
      c2["push"](e2);
    }), c2;
  }
  ["getTileLayers"]() {
    const c2 = [];
    return Object["keys"](this["_layerCache"])["forEach"]((d2) => {
      const e2 = this["_layerCache"][d2];
      e2["isTile"] && !e2["options"]["isInternal"] && c2["push"](e2);
    }), c2;
  }
  ["eachLayer"](c2, d2) {
    Object["keys"](this["_layerCache"])["forEach"]((e2, f2) => {
      const g2 = this["_layerCache"][e2];
      c2["call"](d2, g2, f2);
    });
  }
  ["addLayer"](c2, d2) {
    if (!c2) return;
    a$d["defined"](d2) && (c2["show"] = d2);
    if (c2["state"] === State["ADDED"]) return;
    c2["_onAdd"](this), c2["id"] && this["_layerCache"][c2["id"]] && this["_layerCache"][c2["id"]] !== c2 && (c2["options"]["id"] = this["_getNextLayerId"](), handlerError("NOT_THROW", ["addLayer: 图层id存在冲突，已重新赋值id", c2])), c2["id"] && (this["_layerCache"][c2["id"]] = c2);
  }
  ["removeLayer"](c2, d2 = ![]) {
    if (isString(c2) || isNumber(c2)) {
      c2 = this["_layerCache"][c2];
      if (!c2) return;
    }
    if (c2["state"] !== State["ADDED"]) return;
    c2["id"] && delete this["_layerCache"][c2["id"]], c2["_onRemove"](), d2 && c2["destroy"]();
  }
  ["_initEffects"]() {
    var _a;
    const c2 = (_a = this["earthOptions"]) == null ? void 0 : _a["effects"];
    c2 == null ? void 0 : c2["forEach"]((d2) => {
      const e2 = createEffect(d2);
      e2 && this["addEffect"](e2);
    });
  }
  ["addEffect"](c2, d2) {
    if (!c2) return;
    a$d["defined"](d2) && (c2["enable"] = d2);
    if (c2["state"] === State["ADDED"]) return;
    if (this["_effectCache"][c2["type"]]) {
      handlerInfo("地球上已有" + c2["type"] + "特效,请直接使用 earth.effects." + c2["type"] + " 对象 ");
      return;
    }
    c2["_onAdd"](this), this["_effectCache"][c2["type"]] = c2;
  }
  ["removeEffect"](c2, d2 = ![]) {
    if (isString(c2)) {
      c2 = this["_effectCache"][c2];
      if (!c2) return;
    }
    if (c2["state"] !== State["ADDED"]) return;
    c2["type"] && delete this["_effectCache"][c2["type"]], c2["_onRemove"](), d2 && c2["destroy"]();
  }
  ["bindPopup"](c2 = {}) {
    var _a;
    (_a = this["_popup"]) == null ? void 0 : _a["destroy"](), this["_popup"] = new Popup(this["viewer"], c2), this["_popup"]["addEventParent"](this), this && this["_popup"]["addEventParent"](this);
  }
  ["unbindPopup"]() {
    var _a;
    (_a = this["_popup"]) == null ? void 0 : _a["destroy"](), this["_popup"] = void 0;
  }
  ["downLoadScreenShot"](c2) {
    this["getScreenShotBase64"](c2)["then"]((d2) => {
      if (d2) {
        const e2 = document["createElement"]("a");
        e2["style"]["display"] = "none", e2["href"] = d2, e2["download"] = ((c2 == null ? void 0 : c2["fileName"]) || "screenshot") + ".png", document["body"]["appendChild"](e2), e2["click"](), document["body"]["removeChild"](e2);
      }
    });
  }
  async ["getScreenShotBase64"](c2) {
    const d2 = document["getElementsByClassName"]("cesium-viewer-cesiumWidgetContainer");
    if (c2 == null ? void 0 : c2["screenSelector"]) {
      const e2 = document["querySelector"](c2 == null ? void 0 : c2["screenSelector"]), f2 = await dom2Base64(e2, { "filter": (i2) => {
        if (c2 == null ? void 0 : c2["nodeFilter"]) return i2 !== d2[0] && c2["nodeFilter"](i2);
        return i2 !== d2[0];
      } });
      this["viewer"]["render"]();
      const g2 = this["viewer"]["canvas"]["toDataURL"]("image/jpeg", 1), h2 = await mergeImage(g2, f2, this["viewer"]["canvas"]["width"], this["viewer"]["canvas"]["height"]);
      return h2;
    } else {
      this["viewer"]["render"]();
      const i2 = this["viewer"]["canvas"]["toDataURL"]("image/jpeg", 1);
      return i2;
    }
  }
  ["on"](c2, d2, e2) {
    let f2;
    return typeof c2 == "string" && (f2 = this["_sceneEvent"]["on"](c2, d2, e2 || this)), !f2 && super["on"](c2, d2, e2), this;
  }
  ["off"](c2, d2, e2) {
    const f2 = this["_sceneEvent"]["off"](c2, d2, e2 || this);
    return !f2 && super["off"](c2, d2, e2), this;
  }
};
__publicField(_Earth, "EventType", { ...omit(EventType, ["tileVisible", "initialTilesLoaded", "allTilesLoaded", "loadMetadata"]) });
__publicField(_Earth, "EarthCache", /* @__PURE__ */ new Map());
let Earth = _Earth;
class BaseOptsConver {
  constructor(b2 = {}) {
    __publicField(this, "options");
    this["options"] = b2;
  }
  static ["getColorByStyle"](b2) {
    return new BaseOptsConver()["getColorByStyle"](b2);
  }
  get ["excludedKeys"]() {
    return [];
  }
  get ["exportKeys"]() {
    return ["label", "outlineStyle", "highlight"];
  }
  ["_toCesiumValBefore"](b2, c2) {
  }
  ["_toCesiumValEnd"](b2, c2) {
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      default:
        e2[b2] = c2;
        break;
    }
  }
  ["_toOneJson"](b2, c2, d2) {
  }
  ["toCesiumVal"](b2, c2 = {}) {
    this["_toCesiumValBefore"](b2, c2);
    for (const d2 in b2) {
      const e2 = b2[d2];
      if (!isSimpleType(e2)) {
        c2[d2] = e2;
        continue;
      }
      if (this["excludedKeys"] && this["excludedKeys"]["includes"](d2)) continue;
      const f2 = this["_toOneCesiumVal"](d2, e2, b2, c2);
      if (f2 == null) continue;
      c2[d2] = f2;
    }
    return this["_toCesiumValEnd"](b2, c2), c2;
  }
  ["toJSON"](b2, c2 = {}) {
    b2 = getAttrVal(b2);
    for (const d2 in b2) {
      const e2 = b2[d2];
      if (isSimpleType(e2)) c2[d2] = e2;
      else this["exportKeys"] && this["exportKeys"]["includes"](d2) ? c2[d2] = getAttrVal(e2) : this["_toOneJson"](d2, b2[d2], c2);
    }
    return c2;
  }
  ["getColorByStyle"](b2) {
    return getColorByStyle(b2, this["options"]["color"]);
  }
  ["getOutlineColorByStyle"](b2) {
    let c2;
    b2["outlineColor"] ? isString(b2["outlineColor"]) ? c2 = a$d["Color"]["fromCssColorString"](b2["outlineColor"]) : c2 = b2["outlineColor"] : c2 = this["options"]["outlineColor"];
    if (!c2) return c2;
    if (a$d["defined"](b2["outlineOpacity"])) c2 = c2["withAlpha"](Number(b2["outlineOpacity"]));
    else a$d["defined"](b2["opacity"]) && (c2 = c2["withAlpha"](Number(b2["opacity"])));
    return c2;
  }
}
class BaseMaterialConver extends BaseOptsConver {
  static ["toCesiumVal"](b2, c2 = {}) {
    return !this["baseMaterialConver"] && (this["baseMaterialConver"] = new BaseMaterialConver()), this["baseMaterialConver"]["toCesiumVal"](b2, c2);
  }
  static ["toJSON"](b2, c2 = {}) {
    return new BaseMaterialConver()["toJSON"](b2, c2);
  }
  get ["excludedKeys"]() {
    const b2 = ["label"];
    return b2["concat"](this["_getExcludedStyle"]());
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      case "color":
      case "randomColor":
        e2["color"] = this["getColorByStyle"](d2);
        break;
      case "color2":
      case "evenColor":
      case "outlineColor":
      case "oddColor":
      case "baseWaterColor":
      case "blendColor":
      case "gapColor":
      case "strokeColor":
      case "backgroundColor":
      case "asphaltColor":
      case "lightColor":
      case "darkColor":
      case "grassColor":
      case "dirtColor":
      case "lightWoodColor":
      case "darkWoodColor":
        e2[b2] = getCesiumColor(c2);
        break;
      case "repeat_x":
      case "repeat_y": {
        const f2 = a$d["defaultValue"](d2["repeat_x"], 1), g2 = a$d["defaultValue"](d2["repeat_y"], 1);
        e2["repeat"] = new a$d["Cartesian2"](f2, g2);
        break;
      }
      case "repeat": {
        d2["materialType"] == MaterialType["Stripe"] || d2["materialType"] == MaterialType["CylinderWave"] ? e2[b2] = c2 : e2[b2] = new a$d["Cartesian2"](d2["repeat_x"] || c2, d2["repeat_y"] || c2);
        break;
      }
      case "lineCount":
      case "lineThickness":
      case "lineOffset":
      case "noiseScale": {
        e2[b2] = new a$d["Cartesian2"](c2, c2);
        break;
      }
      default:
        e2[b2] = c2;
        break;
    }
  }
  ["_toOneJson"](b2, c2, d2) {
    if (c2 instanceof a$d["Color"]) {
      d2[b2] = c2["toCssColorString"]();
      return;
    }
    switch (b2) {
      case "label":
        break;
      case "color":
      case "evenColor":
      case "outlineColor":
      case "oddColor":
      case "baseWaterColor":
      case "blendColor":
      case "gapColor":
      case "strokeColor":
      case "backgroundColor":
      case "asphaltColor":
      case "lightColor":
      case "darkColor":
      case "grassColor":
      case "dirtColor":
      case "lightWoodColor":
      case "darkWoodColor": {
        const e2 = getCesiumValue(c2, a$d["Color"]);
        e2 && (d2[b2] = e2["toCssColorString"]());
        break;
      }
      case "repeat": {
        c2 instanceof a$d["Cartesian2"] ? c2["x"] != c2["y"] ? (d2[b2 + "_x"] = c2["x"], d2[b2 + "_y"] = c2["y"]) : d2[b2] = c2["x"] : d2[b2] = c2;
        break;
      }
      case "lineCount":
      case "lineThickness":
      case "lineOffset":
      case "noiseScale": {
        d2[b2 + "_x"] = c2["x"], d2[b2 + "_y"] = c2["y"];
        break;
      }
      default:
        console["log"]("未处理的属性", b2, c2);
        break;
    }
  }
  ["_getExcludedStyle"]() {
    return [];
  }
  ["toJSON"](b2, c2 = {}) {
    if (b2["options"]) {
      const d2 = b2["options"];
      for (const e2 in d2) {
        a$d["defined"](b2[e2]) && (d2[e2] = b2[e2]);
      }
      b2 = d2;
    }
    return super["toJSON"](b2, c2);
  }
}
class BaseStyleConver extends BaseOptsConver {
  constructor() {
    super(...arguments);
    __publicField(this, "isEntity");
  }
  get ["excludedKeys"]() {
    const c2 = ["label", "outlineOpacity", "outlineStyle", "lineCount", "lineThickness", "cellAlpha", "oddcolor", "speed", "axisY", "image2", "color2", "scaleByDistance_near", "scaleByDistance_nearValue", "scaleByDistance_far", "scaleByDistance_farValue", "distanceDisplayCondition_far", "distanceDisplayCondition_near"];
    return c2["concat"](this["_getExcludedStyle"]());
  }
  ["_toCesiumValBefore"](c2, d2) {
    if (!c2["material"] && !c2["materialType"]) {
      if (c2["color"] || c2["randomColor"]) c2["materialType"] = MaterialType["Color"];
      else c2["image"] && (c2["materialType"] = MaterialType["Image"]);
    }
  }
  ["_getExcludedStyle"]() {
    return [];
  }
  ["_toOneCesiumVal_Point"](c2, d2, e2, f2) {
    switch (c2) {
      case "clampToGround":
        d2 ? f2["heightReference"] = a$d["HeightReference"]["CLAMP_TO_GROUND"] : f2["heightReference"] = a$d["HeightReference"]["NONE"];
        break;
      case "visibleDepth":
        d2 ? f2["disableDepthTestDistance"] = 0 : f2["disableDepthTestDistance"] = Number["POSITIVE_INFINITY"];
        break;
      case "scaleByDistance":
        d2 ? f2["scaleByDistance"] = new a$d["NearFarScalar"](Number(a$d["defaultValue"](e2["scaleByDistance_near"], 1e3)), Number(a$d["defaultValue"](e2["scaleByDistance_nearValue"], 1)), Number(a$d["defaultValue"](e2["scaleByDistance_far"], 1e6)), Number(a$d["defaultValue"](e2["scaleByDistance_farValue"], 0.1))) : f2["scaleByDistance"] = void 0;
        break;
      case "distanceDisplayCondition":
        d2 ? f2["distanceDisplayCondition"] = new a$d["DistanceDisplayCondition"](Number(a$d["defaultValue"](e2["distanceDisplayCondition_near"], 0)), Number(a$d["defaultValue"](e2["distanceDisplayCondition_far"], 1e5))) : f2["distanceDisplayCondition"] = void 0;
        break;
      default:
        f2[c2] = d2;
        break;
    }
  }
  ["_toOneCesiumVal_Poly"](c2, d2, e2, f2) {
    switch (c2) {
      case "materialType": {
        this["isEntity"] ? f2["material"] = createMaterialProperty(e2["materialType"], e2) : f2["material"] = createMaterial(e2["materialType"], e2);
        break;
      }
      case "color":
      case "randomColor": {
        f2["color"] = this["getColorByStyle"](e2);
        break;
      }
      case "outlineColor": {
        f2["outlineColor"] = this["getOutlineColorByStyle"](e2);
        break;
      }
      case "hasShadows":
        d2 ? f2["shadows"] = a$d["ShadowMode"]["ENABLED"] : f2["shadows"] = a$d["ShadowMode"]["DISABLED"];
        break;
      case "distanceDisplayCondition":
        d2 ? this["isEntity"] ? f2["distanceDisplayCondition"] = new a$d["DistanceDisplayCondition"](Number(a$d["defaultValue"](e2["distanceDisplayCondition_near"], 0)), Number(a$d["defaultValue"](e2["distanceDisplayCondition_far"], 1e5))) : f2["distanceDisplayCondition"] = new a$d["DistanceDisplayConditionGeometryInstanceAttribute"](Number(a$d["defaultValue"](e2["distanceDisplayCondition_near"], 0)), Number(a$d["defaultValue"](e2["distanceDisplayCondition_far"], 1e5))) : f2["distanceDisplayCondition"] = void 0;
        break;
      default:
        if (f2[c2] instanceof a$d["CallbackProperty"]) ;
        else f2[c2] = d2;
        break;
    }
  }
  ["_toOneJson_Poly"](c2, d2, e2) {
    switch (c2) {
      case "label":
        break;
      case "material": {
        toJSON(d2, e2);
        break;
      }
      case "color": {
        const f2 = getCesiumValue(d2, a$d["Color"]);
        f2 && (e2[c2] = f2["toCssColorString"]());
        break;
      }
      case "outlineColor": {
        const g2 = getCesiumValue(d2, a$d["Color"]);
        g2 && (e2[c2] = g2["toCssColorString"]());
        break;
      }
      case "shadows": {
        d2 == a$d["ShadowMode"]["ENABLED"] ? e2["shadows"] = !![] : e2[c2] = d2;
        break;
      }
      case "distanceDisplayCondition": {
        e2["distanceDisplayCondition_near"] = d2["near"], e2["distanceDisplayCondition_far"] = d2["far"];
        break;
      }
      default:
        console["log"]("未处理的属性", d2);
        break;
    }
  }
  ["_toOneJson_Point"](c2, d2, e2) {
    switch (c2) {
      case "label":
        break;
      case "color": {
        const f2 = getCesiumValue(d2, a$d["Color"]);
        f2 && (e2["color"] = f2["toCssColorString"]());
        break;
      }
      case "heightReference": {
        d2 == a$d["HeightReference"]["CLAMP_TO_GROUND"] && (e2["clampToGround"] = !![]);
        break;
      }
      case "disableDepthTestDistance": {
        d2 === Number["POSITIVE_INFINITY"] ? e2["visibleDepth"] = ![] : e2["disableDepthTestDistance"] = d2;
        break;
      }
      case "scaleByDistance": {
        e2["scaleByDistance"] = !![], e2["scaleByDistance_near"] = d2["near"], e2["scaleByDistance_nearValue"] = d2["nearValue"], e2["scaleByDistance_far"] = d2["far"], e2["scaleByDistance_farValue"] = d2["farValue"];
        break;
      }
      case "distanceDisplayCondition": {
        e2["distanceDisplayCondition"] = !![], e2["distanceDisplayCondition_near"] = d2["near"], e2["distanceDisplayCondition_far"] = d2["far"];
        break;
      }
      default:
        console["log"]("未处理的属性", d2);
        break;
    }
  }
}
class ColorOptsConver extends BaseMaterialConver {
  static ["toCesiumVal"](b2, c2 = {}, d2) {
    if (b2 instanceof a$d["Color"]) return b2;
    return !this["colorOptsConver"] && (this["colorOptsConver"] = new ColorOptsConver()), this["colorOptsConver"]["isProperty"] = d2, this["colorOptsConver"]["toCesiumVal"](b2, c2);
  }
  static ["toJSON"](b2, c2, d2) {
    return !this["colorOptsConver"] && (this["colorOptsConver"] = new ColorOptsConver()), this["colorOptsConver"]["isProperty"] = d2, this["colorOptsConver"]["toJSON"](b2, c2);
  }
  ["toCesiumVal"](b2) {
    return this["isProperty"] ? this["getColorByStyle"](b2) : { "color": this["getColorByStyle"](b2) };
  }
  ["toJSON"](b2, c2 = {}) {
    let d2 = getCesiumValue(b2, a$d["Color"]);
    return d2["color"] && (d2 = d2["color"]), c2["color"] = d2["toCssColorString"](), c2;
  }
}
class ImageOptsConver extends BaseMaterialConver {
  get ["excludedKeys"]() {
    return ["repeat_y"];
  }
  static ["toCesiumVal"](b2, c2 = {}) {
    return !this["imageOptsConver"] && (this["imageOptsConver"] = new ImageOptsConver()), this["imageOptsConver"]["toCesiumVal"](b2, c2);
  }
  static ["toJSON"](b2, c2) {
    return !this["imageOptsConver"] && (this["imageOptsConver"] = new ImageOptsConver()), this["imageOptsConver"]["toJSON"](b2, c2);
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      case "repeat_x": {
        const f2 = a$d["defaultValue"](d2["repeat_x"], 1), g2 = a$d["defaultValue"](d2["repeat_y"], 1);
        e2["repeat"] = new a$d["Cartesian2"](f2, g2);
        break;
      }
      case "repeat": {
        e2[b2] = new a$d["Cartesian2"](d2["repeat_x"] || c2, d2["repeat_y"] || c2);
        break;
      }
      case "color":
        break;
      case "opacity":
        e2["color"] = a$d["Color"]["WHITE"]["withAlpha"](d2["opacity"]);
        break;
      default:
        e2[b2] = c2;
        break;
    }
  }
  ["_toCesiumValEnd"](b2, c2) {
    c2["transparent"] = a$d["defaultValue"](c2["transparent"], !![]);
  }
  ["_toOneJson"](b2, c2, d2) {
    var _a;
    switch (b2) {
      case "repeat": {
        d2["repeat_x"] = c2["x"], d2["repeat_y"] = c2["y"];
        break;
      }
      case "color": {
        d2["opacity"] = ((_a = getCesiumValue(c2, a$d["Color"])) == null ? void 0 : _a["alpha"]) ?? 1;
        break;
      }
      default:
        console["log"]("未处理的属性", b2, c2);
        break;
    }
  }
}
class LabelStyleConver extends BaseStyleConver {
  static ["toCesiumVal"](b2, c2 = {}, d2) {
    return !this["labelStyleConver"] && (this["labelStyleConver"] = new LabelStyleConver()), this["labelStyleConver"]["attr"] = d2, c2 = this["labelStyleConver"]["toCesiumVal"](b2, c2), c2;
  }
  static ["toJSON"](b2, c2) {
    return new LabelStyleConver()["toJSON"](b2, c2);
  }
  ["_toCesiumValBefore"](b2, c2) {
    c2["horizontalOrigin"] = a$d["defaultValue"](c2["horizontalOrigin"], a$d["HorizontalOrigin"]["CENTER"]), c2["verticalOrigin"] = a$d["defaultValue"](c2["verticalOrigin"], a$d["VerticalOrigin"]["BOTTOM"]);
  }
  ["_toCesiumValEnd"](b2, c2) {
    if (!a$d["defined"](b2["font"])) {
      const d2 = b2["font_size"] || 18;
      c2["font"] = (b2["font_style"] || "normal") + " small-caps " + (b2["font_weight"] || "normal") + " " + d2 + "px " + (b2["font_family"] || "楷体");
    }
    !a$d["defined"](b2["style"]) && a$d["defaultValue"](b2["fill"], !![]) && (b2["outline"] ? c2["style"] = a$d["LabelStyle"]["FILL_AND_OUTLINE"] : c2["style"] = a$d["LabelStyle"]["FILL"]);
  }
  ["_getExcludedStyle"]() {
    return ["font_style", "font_weight", "font_size", "font_family", "backgroundOpacity", "fill", "outline"];
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      case "text": {
        this["attr"] && (c2 = template(c2, this["attr"], !![]));
        e2["text"] = c2["replace"](new RegExp("<br />", "g"), "\n");
        break;
      }
      case "color": {
        e2["fillColor"] = this["getColorByStyle"](d2);
        break;
      }
      case "outlineColor": {
        e2["outlineColor"] = this["getOutlineColorByStyle"](d2);
        break;
      }
      case "strokeColor":
      case "fillColor": {
        e2[b2] = getCesiumColor(c2);
        break;
      }
      case "background":
        e2["showBackground"] = c2;
        break;
      case "backgroundColor": {
        let f2 = a$d["Color"]["fromCssColorString"](c2 || "#000000");
        if (a$d["defined"](d2["backgroundOpacity"])) f2 = f2["withAlpha"](Number(d2["backgroundOpacity"]));
        else a$d["defined"](d2["opacity"]) && (f2 = f2["withAlpha"](Number(d2["opacity"])));
        e2["backgroundColor"] = f2;
        break;
      }
      case "backgroundPadding":
        e2["backgroundPadding"] = new a$d["Cartesian2"](c2 * 1.2, c2);
        break;
      case "hasPixelOffset":
        !c2 && (e2["pixelOffset"] = new a$d["Cartesian2"](0, 0));
        break;
      case "pixelOffsetX":
      case "pixelOffsetY":
        e2["pixelOffset"] = new a$d["Cartesian2"](d2["pixelOffsetX"] || 0, d2["pixelOffsetY"] || 0);
        break;
      case "pixelOffset":
        a$d["defined"](c2[0]) && a$d["defined"](c2[1]) ? e2["pixelOffset"] = new a$d["Cartesian2"](c2[0], c2[1]) : e2["pixelOffset"] = c2;
        break;
      default:
        this["_toOneCesiumVal_Point"](b2, c2, d2, e2);
        break;
    }
  }
  ["_toOneJson"](b2, c2, d2) {
    switch (b2) {
      case "pixelOffset": {
        d2["pixelOffsetX"] = c2["x"], d2["pixelOffsetY"] = c2["y"];
        break;
      }
      case "disableDepthTestDistance": {
        c2 === Number["POSITIVE_INFINITY"] ? d2["visibleDepth"] = ![] : d2["disableDepthTestDistance"] = c2;
        break;
      }
      default:
        this["_toOneJson_Point"](b2, c2, d2);
        break;
    }
  }
}
class PolylineStyleConver extends BaseStyleConver {
  static ["toCesiumVal"](b2, c2, d2) {
    return !this["polylineStyleConver"] && (this["polylineStyleConver"] = new PolylineStyleConver()), this["polylineStyleConver"]["isEntity"] = d2, this["polylineStyleConver"]["toCesiumVal"](b2, c2);
  }
  static ["toJSON"](b2, c2, d2) {
    return !this["polylineStyleConver"] && (this["polylineStyleConver"] = new PolylineStyleConver()), this["polylineStyleConver"]["isEntity"] = d2, this["polylineStyleConver"]["toJSON"](b2, c2);
  }
  ["_toCesiumValBefore"](b2, c2) {
    super["_toCesiumValBefore"](b2, c2), b2["clampToGround"] && (c2["arcType"] = a$d["ArcType"]["GEODESIC"]), b2["materialType"] == MaterialType["Color"] && b2["outline"] && b2["outlineColor"] && (b2["materialType"] = MaterialType["PolylineOutline"]);
  }
  ["_toOneCesiumVal"](b2, c2, d2, e2) {
    switch (b2) {
      case "depthFail":
        c2 ? (e2["depthFailMaterial"] = a$d["Color"]["fromCssColorString"](d2["depthFailColor"] || "#FFFF00")["withAlpha"](Number(a$d["defaultValue"](d2["depthFailOpacity"], a$d["defaultValue"](d2["opacity"], 0.9)))), d2["opacity"] == 1 && (d2["opacity"] = 0.9)) : e2["depthFailMaterial"] = void 0;
        break;
      case "closure":
        !this["isEntity"] && (e2["loop"] = c2);
        break;
      default:
        this["_toOneCesiumVal_Poly"](b2, c2, d2, e2);
        break;
    }
  }
  ["_toOneJson"](b2, c2, d2) {
    switch (b2) {
      case "loop":
        d2["closure"] = c2;
        break;
      default:
        this["_toOneJson_Poly"](b2, c2, d2);
        break;
    }
  }
}
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseMaterialConver,
  BaseOptsConver,
  BaseStyleConver,
  ColorOptsConver,
  ImageOptsConver,
  LabelStyleConver,
  PolylineStyleConver
}, Symbol.toStringTag, { value: "Module" }));
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseGraphicLayer,
  BaseLayer,
  BaseTileLayer,
  ColorPatternGradientLayer,
  ColorPatternGridLayer,
  GeojsonLayer,
  GraphicLayer,
  GroupLayer,
  HeatLayer,
  ImageLayer,
  TerrainLayer,
  TilesetLayer,
  WmsLayer,
  WmtsLayer,
  XyzLayer
}, Symbol.toStringTag, { value: "Module" }));
proj4["defs"]("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs"), proj4["defs"]("EPSG:4491", "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4492", "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4493", "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4494", "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4495", "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4496", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4497", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4498", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4499", "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4500", "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4501", "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4513", "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4514", "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4515", "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4516", "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4517", "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4518", "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4519", "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4520", "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4521", "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4522", "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4523", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4524", "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4525", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4526", "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4527", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4528", "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4529", "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4530", "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4531", "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4532", "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4533", "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4502", "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4503", "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4504", "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4505", "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4506", "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4507", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4508", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4509", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4510", "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4511", "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4512", "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4534", "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4535", "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4536", "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4537", "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4538", "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4539", "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4540", "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4541", "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4542", "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4543", "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4544", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4545", "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4546", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4547", "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4548", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4549", "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4550", "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4551", "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4552", "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4553", "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"), proj4["defs"]("EPSG:4554", "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs");
registerOptsConver("default", BaseMaterialConver), registerOptsConver(MaterialType["Color"], ColorOptsConver), registerOptsConver(MaterialType["PolylineArrow"], ColorOptsConver), registerOptsConver(MaterialType["Image"], ImageOptsConver);
var cellular_default = `vec3 _czm_permute289(vec3 x)\r
{\r
    return mod((34.0 * x + 1.0) * x, 289.0);\r
}

/**\r
 * DOC_TBA\r
 *\r
 * Implemented by Stefan Gustavson, and distributed under the MIT License.  {@link http:
 *\r
 * @name czm_cellular\r
 * @glslFunction\r
 *\r
 * @see Stefan Gustavson's chapter, <i>Procedural Textures in GLSL</i>, in <a href="http:
 */\r
vec2 czm_cellular(vec2 P)

{\r
#define K 0.142857142857 
#define Ko 0.428571428571 
#define jitter 1.0 
    vec2 Pi = mod(floor(P), 289.0);\r
    vec2 Pf = fract(P);\r
    vec3 oi = vec3(-1.0, 0.0, 1.0);\r
    vec3 of = vec3(-0.5, 0.5, 1.5);\r
    vec3 px = _czm_permute289(Pi.x + oi);\r
    vec3 p = _czm_permute289(px.x + Pi.y + oi); 
    vec3 ox = fract(p*K) - Ko;\r
    vec3 oy = mod(floor(p*K),7.0)*K - Ko;\r
    vec3 dx = Pf.x + 0.5 + jitter*ox;\r
    vec3 dy = Pf.y - of + jitter*oy;\r
    vec3 d1 = dx * dx + dy * dy; 
    p = _czm_permute289(px.y + Pi.y + oi); 
    ox = fract(p*K) - Ko;\r
    oy = mod(floor(p*K),7.0)*K - Ko;\r
    dx = Pf.x - 0.5 + jitter*ox;\r
    dy = Pf.y - of + jitter*oy;\r
    vec3 d2 = dx * dx + dy * dy; 
    p = _czm_permute289(px.z + Pi.y + oi); 
    ox = fract(p*K) - Ko;\r
    oy = mod(floor(p*K),7.0)*K - Ko;\r
    dx = Pf.x - 1.5 + jitter*ox;\r
    dy = Pf.y - of + jitter*oy;\r
    vec3 d3 = dx * dx + dy * dy; 
    
    vec3 d1a = min(d1, d2);\r
    d2 = max(d1, d2); 
    d2 = min(d2, d3); 
    d1 = min(d1a, d2); 
    d2 = max(d1a, d2); 
    d1.xy = (d1.x < d1.y) ? d1.xy : d1.yx; 
    d1.xz = (d1.x < d1.z) ? d1.xz : d1.zx; 
    d1.yz = min(d1.yz, d2.yz); 
    d1.y = min(d1.y, d1.z); 
    d1.y = min(d1.y, d2.x); 
    return sqrt(d1.xy);\r
}`;
var snoise_default = `vec4 _czm_mod289(vec4 x)\r
{\r
  return x - floor(x * (1.0 / 289.0)) * 289.0;\r
}

vec3 _czm_mod289(vec3 x)\r
{\r
    return x - floor(x * (1.0 / 289.0)) * 289.0;\r
}

vec2 _czm_mod289(vec2 x)\r
{\r
    return x - floor(x * (1.0 / 289.0)) * 289.0;\r
}

float _czm_mod289(float x)\r
{\r
    return x - floor(x * (1.0 / 289.0)) * 289.0;\r
}

vec4 _czm_permute(vec4 x)\r
{\r
    return _czm_mod289(((x*34.0)+1.0)*x);\r
}

vec3 _czm_permute(vec3 x)\r
{\r
    return _czm_mod289(((x*34.0)+1.0)*x);\r
}

float _czm_permute(float x)\r
{\r
    return _czm_mod289(((x*34.0)+1.0)*x);\r
}

vec4 _czm_taylorInvSqrt(vec4 r)\r
{\r
    return 1.79284291400159 - 0.85373472095314 * r;\r
}

float _czm_taylorInvSqrt(float r)\r
{\r
    return 1.79284291400159 - 0.85373472095314 * r;\r
}

vec4 _czm_grad4(float j, vec4 ip)\r
{\r
    const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\r
    vec4 p,s;

    p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\r
    p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\r
    s = vec4(lessThan(p, vec4(0.0)));\r
    p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;

    return p;\r
}

/**\r
 * DOC_TBA\r
 *\r
 * Implemented by Ian McEwan, Ashima Arts, and distributed under the MIT License.  {@link https:
 *\r
 * @name czm_snoise\r
 * @glslFunction\r
 *\r
 * @see <a href="https:
 * @see Stefan Gustavson's paper <a href="http:
 */\r
float czm_snoise(vec2 v)\r
{\r
    const vec4 C = vec4(0.211324865405187,  
                        0.366025403784439,  
                       -0.577350269189626,  
                        0.024390243902439); 
    
    vec2 i  = floor(v + dot(v, C.yy) );\r
    vec2 x0 = v -   i + dot(i, C.xx);

    
    vec2 i1;\r
    
    
    i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\r
    
    
    
    vec4 x12 = x0.xyxy + C.xxzz;\r
    x12.xy -= i1;

    
    i = _czm_mod289(i); 
    vec3 p = _czm_permute( _czm_permute( i.y + vec3(0.0, i1.y, 1.0 )) + i.x + vec3(0.0, i1.x, 1.0 ));

    vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\r
    m = m*m ;\r
    m = m*m ;

    
    
    vec3 x = 2.0 * fract(p * C.www) - 1.0;\r
    vec3 h = abs(x) - 0.5;\r
    vec3 ox = floor(x + 0.5);\r
    vec3 a0 = x - ox;

    
    
    m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );

    
    vec3 g;\r
    g.x  = a0.x  * x0.x  + h.x  * x0.y;\r
    g.yz = a0.yz * x12.xz + h.yz * x12.yw;\r
    return 130.0 * dot(m, g);\r
}

float czm_snoise(vec3 v)\r
{\r
    const vec2  C = vec2(1.0/6.0, 1.0/3.0) ;\r
    const vec4  D = vec4(0.0, 0.5, 1.0, 2.0);

    
    vec3 i  = floor(v + dot(v, C.yyy) );\r
    vec3 x0 =   v - i + dot(i, C.xxx) ;

    
    vec3 g = step(x0.yzx, x0.xyz);\r
    vec3 l = 1.0 - g;\r
    vec3 i1 = min( g.xyz, l.zxy );\r
    vec3 i2 = max( g.xyz, l.zxy );

    
    
    
    
    vec3 x1 = x0 - i1 + C.xxx;\r
    vec3 x2 = x0 - i2 + C.yyy; 
    vec3 x3 = x0 - D.yyy;      

    
    i = _czm_mod289(i);\r
    vec4 p = _czm_permute( _czm_permute( _czm_permute(\r
                i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\r
              + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\r
              + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));

    
    
    float n_ = 0.142857142857; 
    vec3  ns = n_ * D.wyz - D.xzx;

    vec4 j = p - 49.0 * floor(p * ns.z * ns.z);  

    vec4 x_ = floor(j * ns.z);\r
    vec4 y_ = floor(j - 7.0 * x_ );    

    vec4 x = x_ *ns.x + ns.yyyy;\r
    vec4 y = y_ *ns.x + ns.yyyy;\r
    vec4 h = 1.0 - abs(x) - abs(y);

    vec4 b0 = vec4( x.xy, y.xy );\r
    vec4 b1 = vec4( x.zw, y.zw );

    
    
    vec4 s0 = floor(b0)*2.0 + 1.0;\r
    vec4 s1 = floor(b1)*2.0 + 1.0;\r
    vec4 sh = -step(h, vec4(0.0));

    vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\r
    vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;

    vec3 p0 = vec3(a0.xy,h.x);\r
    vec3 p1 = vec3(a0.zw,h.y);\r
    vec3 p2 = vec3(a1.xy,h.z);\r
    vec3 p3 = vec3(a1.zw,h.w);

    
    vec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\r
    p0 *= norm.x;\r
    p1 *= norm.y;\r
    p2 *= norm.z;\r
    p3 *= norm.w;

    
    vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\r
    m = m * m;\r
    return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\r
                                dot(p2,x2), dot(p3,x3) ) );\r
}

float czm_snoise(vec4 v)\r
{\r
    const vec4  C = vec4( 0.138196601125011,  
                          0.276393202250021,  
                          0.414589803375032,  
                         -0.447213595499958); 

    
    #define F4 0.309016994374947451

    
    vec4 i  = floor(v + dot(v, vec4(F4)) );\r
    vec4 x0 = v -   i + dot(i, C.xxxx);

    

    
    vec4 i0;\r
    vec3 isX = step( x0.yzw, x0.xxx );\r
    vec3 isYZ = step( x0.zww, x0.yyz );\r
    
    i0.x = isX.x + isX.y + isX.z;\r
    i0.yzw = 1.0 - isX;\r
    
    i0.y += isYZ.x + isYZ.y;\r
    i0.zw += 1.0 - isYZ.xy;\r
    i0.z += isYZ.z;\r
    i0.w += 1.0 - isYZ.z;

    
    vec4 i3 = clamp( i0, 0.0, 1.0 );\r
    vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\r
    vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );

    
    
    
    
    
    vec4 x1 = x0 - i1 + C.xxxx;\r
    vec4 x2 = x0 - i2 + C.yyyy;\r
    vec4 x3 = x0 - i3 + C.zzzz;\r
    vec4 x4 = x0 + C.wwww;

    
    i = _czm_mod289(i);\r
    float j0 = _czm_permute( _czm_permute( _czm_permute( _czm_permute(i.w) + i.z) + i.y) + i.x);\r
    vec4 j1 = _czm_permute( _czm_permute( _czm_permute( _czm_permute (\r
               i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\r
             + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\r
             + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\r
             + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));

    
    
    vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;

    vec4 p0 = _czm_grad4(j0,   ip);\r
    vec4 p1 = _czm_grad4(j1.x, ip);\r
    vec4 p2 = _czm_grad4(j1.y, ip);\r
    vec4 p3 = _czm_grad4(j1.z, ip);\r
    vec4 p4 = _czm_grad4(j1.w, ip);

    
    vec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\r
    p0 *= norm.x;\r
    p1 *= norm.y;\r
    p2 *= norm.z;\r
    p3 *= norm.w;\r
    p4 *= _czm_taylorInvSqrt(dot(p4,p4));

    
    vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\r
    vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4)            ), 0.0);\r
    m0 = m0 * m0;\r
    m1 = m1 * m1;\r
    return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\r
                  + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\r
}`;
registerProperty(MaterialType["Color"], a$d["ColorMaterialProperty"]), registerProperty(MaterialType["Image"], a$d["ImageMaterialProperty"]), registerProperty(MaterialType["PolylineArrow"], a$d["PolylineArrowMaterialProperty"]), registerProperty(MaterialType["PolylineOutline"], a$d["PolylineOutlineMaterialProperty"]), registerProperty(MaterialType["PolylineDash"], a$d["PolylineDashMaterialProperty"]), registerProperty(MaterialType["PolylineGlow"], a$d["PolylineGlowMaterialProperty"]), registerProperty(MaterialType["Grid"], a$d["GridMaterialProperty"]), registerProperty(MaterialType["Checkerboard"], a$d["CheckerboardMaterialProperty"]), registerProperty(MaterialType["Stripe"], a$d["StripeMaterialProperty"]);
var ColorPatternGradientMaterial_default = "uniform float u_minValue;\r\nuniform float u_maxValue;\r\nuniform vec2 u_resultSize;\r\nfloat val;\r\nfloat calcTexture(sampler2D tex, const vec2 uv) {\r\n    return texture(tex, uv).r;\r\n  }\n\n  float bilinear(sampler2D tex, const vec2 uv) {\r\n    vec2 px = 1.0 / u_resultSize;\r\n    vec2 vc = (floor(uv * u_resultSize)) * px;\r\n    vec2 f = fract(uv * u_resultSize);\r\n    float tl = calcTexture(tex, vc);\r\n    float tr = calcTexture(tex, vc + vec2(px.x, 0));\r\n    float bl = calcTexture(tex, vc + vec2(0, px.y));\r\n    float br = calcTexture(tex, vc + px);\r\n    return mix(mix(tl, tr, f.x), mix(bl, br, f.x), f.y);\r\n  }\n\n  float getValue(sampler2D tex, const vec2 uv) {\r\n    float r = bilinear(tex, uv);\r\n    return r * (u_maxValue - u_minValue) + u_minValue;\r\n  }\r\nczm_material czm_getMaterial(czm_materialInput materialInput) {\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec4 color1 = texture(u_image, st);\n\n  float value = getValue(u_image, materialInput.st);\r\n  val = value;\r\n  float value_t = (value - u_minValue) / (u_maxValue - u_minValue);\n\n  vec4 color = texture(u_colorImage, vec2(value_t, 0.5));\n\n  color = czm_gammaCorrect(color);\r\n  float mixVal = 0.0;\r\n  float maxVal = 255.0;\r\n  if(color1.r < (mixVal / 255.0)) {\r\n    color.a = 0.0;\r\n  }\r\n  if(color1.r > (maxVal / 255.0)) {\r\n    color.a = 0.0;\r\n  }\n\n  material.diffuse = color.rgb;\r\n  material.alpha = min(u_alpha, color.a);\r\n  return material;\r\n}";
var HeatMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec4 colorImage = texture(u_image,st);\r\n  if(colorImage.rgb == vec3(1.0) || colorImage.rgb == vec3(0.0)){\r\n    discard;\r\n  }\r\n  material.diffuse = colorImage.rgb;\r\n  material.alpha = colorImage.a;\r\n  return material;\r\n}";
a$d["Material"]["ColorPatternGradientType"] = MaterialType["ColorPatternGradient"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["ColorPatternGradientType"], { "fabric": { "type": a$d["Material"]["ColorPatternGradientType"], "uniforms": { "u_image": a$d["Material"]["DefaultImageId"], "u_colorImage": a$d["Material"]["DefaultImageId"], "u_alpha": 0.8, "u_minValue": 0, "u_maxValue": 50, "u_resultSize": new a$d["Cartesian2"](2880, 1440) }, "source": ColorPatternGradientMaterial_default }, "translucent": !![] }), a$d["Material"]["HeatType"] = MaterialType["Heat"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["HeatType"], { "fabric": { "type": a$d["Material"]["HeatType"], "uniforms": { "u_image": a$d["Material"]["DefaultImageId"] }, "source": HeatMaterial_default }, "translucent": !![] });
var CylinderWaveMaterial_default = "uniform vec4 color;\r\nuniform float repeat;\r\nuniform float offset;\r\nuniform float thickness;\r\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    float sp = 1.0/repeat;\r\n    vec2 st = materialInput.st;\r\n    float dis = distance(st, vec2(0.5));\r\n    float m = mod(dis + offset, sp);\r\n    float a = step(sp*(1.0-thickness), m);\r\n    material.diffuse = color.rgb;\r\n    material.alpha = a * color.a;\r\n    return material;\r\n}";
class CylinderWaveMaterial extends a$d["Material"] {
  constructor(c2 = {}) {
    super(conventOptions$1(c2));
    __publicField(this, "frameTime");
    __publicField(this, "animateFrame");
    this["frameTime"] = 1e3 / (c2["frameRate"] || 60);
    const d2 = this;
    let e2 = Date["now"]();
    (function f2() {
      d2["animateFrame"] = window["requestAnimationFrame"](f2);
      const g2 = Date["now"](), h2 = g2 - e2;
      h2 > d2["frameTime"] && (e2 = g2 - h2 % d2["frameTime"], d2["_updateOffset"]());
    })();
  }
  ["_updateOffset"]() {
    let c2 = this["uniforms"]["offset"];
    c2 -= 1e-3, c2 > 1 && (c2 = 0), this["uniforms"]["offset"] = c2;
  }
  ["destroy"]() {
    a$d["defined"](this["animateFrame"]) && (window["cancelAnimationFrame"](this["animateFrame"]), delete this["animateFrame"]), super["destroy"]();
  }
}
function conventOptions$1(c2 = {}) {
  return { "fabric": { "uniforms": { "color": getCesiumColor(c2["color"], new a$d["Color"](2, 1, 0, 0.8)), "repeat": a$d["defaultValue"](c2["repeat"], 30), "thickness": a$d["defaultValue"](c2["thickness"], 0.3), "offset": 0 }, "source": CylinderWaveMaterial_default }, "translucent"(d2) {
    return d2["uniforms"]["color"]["alpha"] < 1;
  } };
}
registerMaterial(MaterialType["CylinderWave"], CylinderWaveMaterial);
var ImageMaterial_default = "uniform sampler2D image;\r\nuniform float opacity;\r\nuniform vec4 color;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec4 colorImage = texture(image,st);\r\n  if(colorImage.rgb == vec3(1.0)){\r\n    discard;\r\n  }\r\n  material.alpha = colorImage.a * opacity * color.a;\r\n  material.diffuse = colorImage.rgb * color.rgb;\r\n  return material;\r\n}";
class TextMaterial extends a$d["Material"] {
  constructor(c2 = {}) {
    super(conventOptions(c2));
  }
}
function conventOptions(c2 = {}) {
  const d2 = c2["text"];
  c2["font_size"] = c2["font_size"] || 70;
  const e2 = LabelStyleConver["toCesiumVal"](c2, { "fill": !![], "fillColor": new a$d["Color"](1, 1, 0, 1), "textBaseline": "middle", "padding": 10 });
  let f2;
  if (d2) {
    const g2 = getTextImage(d2, e2);
    g2 && (f2 = g2["toDataURL"]("image/png"));
  }
  return { "fabric": { "uniforms": { "image": f2, "opacity": 1, "color": a$d["Color"]["WHITE"] }, "source": ImageMaterial_default }, "translucent": !![] };
}
registerMaterial(MaterialType["Text"], TextMaterial);
class BaseMaterialProperty {
  constructor(b2 = {}) {
    __publicField(this, "_definitionChanged");
    __publicField(this, "_color");
    __publicField(this, "_colorSubscription");
    __publicField(this, "_speed");
    __publicField(this, "_speedSubscription");
    __publicField(this, "options");
    this["options"] = b2, this["_definitionChanged"] = new a$d["Event"](), this["_color"] = void 0, this["_colorSubscription"] = void 0, this["_speed"] = void 0, this["_speedSubscription"] = void 0;
  }
  get ["isConstant"]() {
    return !![];
  }
  get ["definitionChanged"]() {
    return this["_definitionChanged"];
  }
}
var CircleScanMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    vec2 st = materialInput.st;\r\n    vec4 imgC = texture(image,st);\r\n    if(imgC.a>.0){\r\n        material.diffuse = color.rgb;\r\n    }\r\n    material.alpha = imgC.a * color.a;\r\n    return material;\r\n}";
class CircleScanMaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    this["_image"] = c2["image"], this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](1, 0, 0, 0.5));
  }
  ["getType"](c2) {
    return MaterialType["CircleScan"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["image"] = this["_image"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof CircleScanMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_image"] == c2["_image"];
  }
}
registerProperty(MaterialType["CircleScan"], CircleScanMaterialProperty), a$d["Material"]["CircleScanType"] = MaterialType["CircleScan"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["CircleScanType"], { "fabric": { "type": a$d["Material"]["CircleScanType"], "uniforms": { "color": new a$d["Color"](1, 0, 0, 1), "image": a$d["Material"]["DefaultImageId"] }, "source": CircleScanMaterial_default }, "translucent": !![] });
var CircleWaveMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    material.diffuse = 1.5 * color.rgb;\r\n    vec2 st = materialInput.st;\n\n    float dis = distance(st, vec2(0.5, 0.5));\r\n    float per = fract(speed*czm_frameNumber/1000.0);\r\n    if(count==1.0){\r\n        if(dis > per * 0.5){ \r\n            discard;\r\n        }else {\r\n            material.alpha = color.a  * dis / per / 2.0;\r\n        }\r\n    }\r\n    else{\r\n        vec3 str = materialInput.str;\r\n        if(abs(str.z)>0.001){\r\n            discard;\r\n        }\r\n        if(dis >0.5){\r\n            discard;\r\n        }\r\n        else {\r\n            float perDis = 0.5/count;\r\n            float disNum;\r\n            float bl = 0.0;\r\n            for(int i=0;i<=999;i++){\r\n                if(float(i)<=count){\r\n                    disNum = perDis*float(i) - dis + per/count;\r\n                    if(disNum>0.0){\r\n                        if(disNum<perDis){\r\n                            bl = 1.0-disNum/perDis;\r\n                        }\r\n                        else if(disNum-perDis<perDis){\r\n                            bl = 1.0 - abs(1.0-disNum/perDis);\r\n                        }\r\n                        material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient)));\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    } \r\n    return material;\r\n}";
class CircleWaveMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_count");
    __publicField(this, "_gradient");
    this["_color"] = getCesiumColor(c2["color"], a$d["Color"]["YELLOW"]), this["_speed"] = a$d["defaultValue"](c2["speed"], 10), this["_count"] = a$d["defaultValue"](c2["count"], 1), this["_gradient"] = a$d["defaultValue"](c2["gradient"], 0.1), this["_count"] <= 0 && (this["_count"] = 1), this["_gradient"] < 0 && (this["_gradient"] = 0), this["_gradient"] > 1 && (this["_gradient"] = 1);
  }
  ["getType"](c2) {
    return MaterialType["CircleWave"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2["count"] = this["_count"], d2["gradient"] = this["_gradient"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof CircleWaveMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_count"] == c2["_count"] && this["_speed"] == c2["_speed"] && this["_gradient"] == c2["_gradient"];
  }
}
registerProperty(MaterialType["CircleWave"], CircleWaveMaterialProperty), a$d["Material"]["CircleWaveType"] = MaterialType["CircleWave"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["CircleWaveType"], { "fabric": { "type": a$d["Material"]["CircleWaveType"], "uniforms": { "color": new a$d["Color"](1, 1, 0, 1), "speed": 10, "count": 1, "gradient": 0.1 }, "source": CircleWaveMaterial_default }, "translucent": !![] });
class CylinderWaveMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_repeat");
    __publicField(this, "_thickness");
    __publicField(this, "_offset");
    this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](2, 1, 0, 0.8)), this["_repeat"] = a$d["defaultValue"](c2["repeat"], 30), this["_thickness"] = a$d["defaultValue"](c2["thickness"], 0.3), this["_offset"] = 0;
  }
  ["getType"](c2) {
    return MaterialType["CylinderWave"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), this["_offset"] -= 1e-3, this["_offset"] > 1 && (this["_offset"] = 0), d2["color"] = this["_color"], d2["repeat"] = this["_repeat"], d2["offset"] = this["_offset"], d2["thickness"] = this["_thickness"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof CylinderWaveMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_repeat"] == c2["_repeat"] && this["_offset"] == c2["_offset"] && this["_thickness"] == c2["_thickness"];
  }
}
registerProperty(MaterialType["CylinderWave"], CylinderWaveMaterialProperty), a$d["Material"]["CylinderWaveType"] = MaterialType["CylinderWave"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["CylinderWaveType"], { "fabric": { "type": a$d["Material"]["CylinderWave"], "uniforms": { "color": new a$d["Color"](2, 1, 0, 0.8), "repeat": 30, "thickness": 0.3, "offset": 0 }, "source": CylinderWaveMaterial_default }, "translucent": !![] });
var EllipsoidElectricMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\n#define pi 3.1415926535\r\n#define PI2RAD 0.01745329252\r\n#define TWO_PI (2. * PI)\n\nfloat rands(float p){\r\n  return fract(sin(p) * 10000.0);\r\n}\n\nfloat noise(vec2 p){\r\n  float time = fract( czm_frameNumber * speed / 1000.0);\r\n  float t = time / 20000.0;\r\n  if(t > 1.0) t -= floor(t);\r\n  return rands(p.x * 14. + p.y * sin(t) * 0.5);\r\n}\n\nvec2 sw(vec2 p){\r\n  return vec2(floor(p.x), floor(p.y));\r\n}\n\nvec2 se(vec2 p){\r\n  return vec2(ceil(p.x), floor(p.y));\r\n}\n\nvec2 nw(vec2 p){\r\n  return vec2(floor(p.x), ceil(p.y));\r\n}\n\nvec2 ne(vec2 p){\r\n  return vec2(ceil(p.x), ceil(p.y));\r\n}\n\nfloat smoothNoise(vec2 p){\r\n  vec2 inter = smoothstep(0.0, 1.0, fract(p));\r\n  float s = mix(noise(sw(p)), noise(se(p)), inter.x);\r\n  float n = mix(noise(nw(p)), noise(ne(p)), inter.x);\r\n  return mix(s, n, inter.y);\r\n}\n\nfloat fbm(vec2 p){\r\n  float z = 2.0;\r\n  float rz = 0.0;\r\n  vec2 bp = p;\r\n  for(float i = 1.0; i < 6.0; i++){\r\n    rz += abs((smoothNoise(p) - 0.5)* 2.0) / z;\r\n    z *= 2.0;\r\n    p *= 2.0;\r\n  }\r\n  return rz;\r\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec2 st2 = materialInput.st;\r\n  float time = fract( czm_frameNumber * speed / 1000.0);\r\n  if (st.t < 0.5) {\r\n    discard;\r\n  }\r\n  st *= 4.;\r\n  float rz = fbm(st);\r\n  st /= exp(mod( time * 2.0, pi));\r\n  rz *= pow(15., 0.9);\r\n  vec4 temp = vec4(0);\r\n  temp = mix( color / rz, vec4(color.rgb, 0.1), 0.2);\r\n  if (st2.s < 0.05) {\r\n    temp = mix(vec4(color.rgb, 0.1), temp, st2.s / 0.05);\r\n  }\r\n  if (st2.s > 0.95){\r\n    temp = mix(temp, vec4(color.rgb, 0.1), (st2.s - 0.95) / 0.05);\r\n  }\r\n  material.diffuse = temp.rgb;\r\n  material.alpha = temp.a * 2.0;\r\n  return material;\r\n}";
class EllipsoidElectricMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](0, 0, 0, 0)), this["_speed"] = a$d["defaultValue"](c2["speed"], 5);
  }
  ["getType"](c2) {
    return MaterialType["EllipsoidElectric"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof EllipsoidElectricMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["EllipsoidElectric"], EllipsoidElectricMaterialProperty), a$d["Material"]["EllipsoidElectricType"] = MaterialType["EllipsoidElectric"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["EllipsoidElectricType"], { "fabric": { "type": a$d["Material"]["EllipsoidElectricType"], "uniforms": { "color": new a$d["Color"](0, 1, 1, 0.7), "speed": 5 }, "source": EllipsoidElectricMaterial_default }, "translucent": !![] });
var EllipsoidWaveMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  float time = fract(czm_frameNumber * speed / 1000.0);\r\n  float alpha = abs(smoothstep(0.5,1.,fract( -st.t - time)));\r\n  alpha += .1;\r\n  material.alpha = alpha;\r\n  material.diffuse = color.rgb;\r\n  return material;\r\n}";
class EllipsoidWaveMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](0, 0, 0, 0)), this["_speed"] = a$d["defaultValue"](c2["speed"], 5);
  }
  ["getType"](c2) {
    return MaterialType["EllipsoidWave"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof EllipsoidWaveMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["EllipsoidWave"], EllipsoidWaveMaterialProperty), a$d["Material"]["EllipsoidWaveType"] = MaterialType["EllipsoidWave"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["EllipsoidWaveType"], { "fabric": { "type": a$d["Material"]["EllipsoidWaveType"], "uniforms": { "color": new a$d["Color"](0, 1, 1, 0.7), "speed": 5 }, "source": EllipsoidWaveMaterial_default }, "translucent": !![] });
class Image2MaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    __publicField(this, "_opacity");
    this["_image"] = c2["image"], this["_opacity"] = a$d["defaultValue"](c2["opacity"], 1), this["_color"] = a$d["defaultValue"](c2["color"], a$d["Color"]["WHITE"]);
  }
  ["getType"](c2) {
    return MaterialType["Image2"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["image"] = this["_image"], d2["color"] = this["_color"], d2["opacity"] = this["_opacity"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof Image2MaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_opacity"] == c2["_opacity"] && this["_image"] == c2["_image"];
  }
}
registerProperty(MaterialType["Image2"], Image2MaterialProperty), a$d["Material"]["Image2Type"] = MaterialType["Image2"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["Image2Type"], { "fabric": { "type": a$d["Material"]["Image2Type"], "uniforms": { "image": a$d["Material"]["DefaultImageId"], "color": a$d["Color"]["WHITE"], "opacity": 1 }, "source": ImageMaterial_default }, "translucent": !![] });
var LineFlickerMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  float time = fract( czm_frameNumber  *  speed / 1000.0);\r\n  vec2 st = materialInput.st;\r\n  float scalar = smoothstep(0.0,1.0,time);\r\n  material.diffuse = color.rgb * scalar;\r\n  material.alpha = color.a * scalar ;\r\n  return material;\r\n}";
class LineFlickerMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](1, 0, 0, 1)), this["_speed"] = a$d["defaultValue"](c2["speed"], 2);
  }
  ["getType"](c2) {
    return MaterialType["LineFlicker"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = getCesiumColor(this["_color"], new a$d["Color"](1, 0, 0, 1), c2), d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof LineFlickerMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["LineFlicker"], LineFlickerMaterialProperty), a$d["Material"]["LineFlickerType"] = MaterialType["LineFlicker"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["LineFlickerType"], { "fabric": { "type": a$d["Material"]["LineFlickerType"], "uniforms": { "color": new a$d["Color"](1, 0, 0, 0.7), "speed": 10 }, "source": LineFlickerMaterial_default }, "translucent": !![] });
var LineFlowColorMaterial_default = "uniform vec4 color;\r\nuniform float speed;\r\nuniform float startTime;\r\nuniform float percent;\r\nuniform float alpha;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  float t =fract(startTime +czm_frameNumber * speed / 1000.0);\r\n  t *= (1.0 + percent);\r\n  float alpha1 = smoothstep(t- percent, t, st.s) * step(-t, -st.s);\r\n  alpha1 += alpha;\r\n  material.diffuse = color.rgb;\r\n  material.alpha = alpha1;\r\n  return material;\r\n}";
class LineFlowColorMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_percent");
    __publicField(this, "_alpha");
    __publicField(this, "_startTime");
    this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](0, 0, 0, 0)), this["_speed"] = a$d["defaultValue"](c2["speed"], 2), this["_percent"] = a$d["defaultValue"](c2["percent"], 0.04), this["_alpha"] = a$d["defaultValue"](c2["alpha"], 0.1), this["_startTime"] = a$d["defaultValue"](c2["startTime"], 0);
  }
  ["getType"](c2) {
    return MaterialType["LineFlowColor"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = getCesiumValue(this["_color"], a$d["Color"], c2), d2["speed"] = this["_speed"], d2["percent"] = this["_percent"], d2["alpha"] = this["_alpha"], d2["startTime"] = this["_startTime"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof LineFlowColorMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"] && this["_percent"] == c2["_percent"] && this["_startTime"] == c2["_startTime"] && this["_alpha"] == c2["_alpha"];
  }
}
registerProperty(MaterialType["LineFlowColor"], LineFlowColorMaterialProperty), a$d["Material"]["LineFlowColorType"] = MaterialType["LineFlowColor"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["LineFlowColorType"], { "fabric": { "type": a$d["Material"]["LineFlowColorType"], "uniforms": { "color": new a$d["Color"](1, 0, 0, 0.7), "startTime": 0, "speed": 2, "percent": 0.04, "alpha": 0.1 }, "source": LineFlowColorMaterial_default }, "translucent": !![] });
var LineFlowMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    vec2 st = repeat * materialInput.st;\n\n    float currTime;\r\n    if(time < 0.0){\r\n     currTime = speed*czm_frameNumber/1000.0;\r\n    }\r\n    else{\r\n     currTime = time;\r\n    }\n\n    vec4 colorImage = texture(image, vec2(fract((axisY?st.t:st.s) - currTime), st.t));\r\n    if(color.a == 0.0) {\r\n       if(colorImage.rgb == vec3(1.0)){\r\n          discard;\r\n        }\r\n        material.alpha = colorImage.a;\r\n        material.diffuse = colorImage.rgb;\r\n    }\r\n    else {\r\n        material.alpha = colorImage.a * color.a;\r\n        material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\r\n    }\n\n    if(hasImage2)  {\r\n        vec4 colorBG = texture(image2,materialInput.st);\r\n        if(colorBG.a>0.5){\r\n            material.diffuse = color2.rgb;\r\n        }\r\n    }\r\n    return material;\r\n}";
class LineFlowMaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    __publicField(this, "_axisY");
    __publicField(this, "_duration");
    __publicField(this, "_repeat");
    __publicField(this, "_image2");
    __publicField(this, "_color2");
    __publicField(this, "_hasImage2");
    __publicField(this, "_time");
    this["_image"] = c2["image"], this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](0, 0, 0, 0)), this["_axisY"] = a$d["defaultValue"](c2["axisY"], ![]), this["_speed"] = a$d["defaultValue"](c2["speed"], 10), this["_duration"] = c2["duration"], this["_repeat"] = a$d["defaultValue"](c2["repeat"], new a$d["Cartesian2"](1, 1)), this["_image2"] = c2["image2"], this["_color2"] = getCesiumColor(c2["color2"], new a$d["Color"](1, 1, 1)), this["_hasImage2"] = a$d["defined"](this["_image2"]);
  }
  ["getType"](c2) {
    return MaterialType["LineFlow"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["image"] = this["_image"], d2["color"] = getCesiumValue(this["_color"], a$d["Color"], c2), d2["repeat"] = getCesiumValue(this["_repeat"], a$d["Cartesian2"], c2), d2["axisY"] = this["_axisY"], d2["speed"] = getCesiumValue(this["_speed"], Number, c2), this["_duration"] ? (this["_time"] === void 0 && (this["_time"] = (/* @__PURE__ */ new Date())["getTime"]()), d2["time"] = ((/* @__PURE__ */ new Date())["getTime"]() - this["_time"]) / (this["_duration"] * 1e3)) : d2["time"] = -1, d2["hasImage2"] = this["_hasImage2"], d2["image2"] = this["_image2"], d2["color2"] = getCesiumValue(this["_color2"], a$d["Color"], c2), d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof LineFlowMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && a$d["Property"]["equals"](this["_repeat"], c2["_repeat"]) && this["_image"] == c2["_image"] && this["_axisY"] == c2["_axisY"] && this["_speed"] == c2["_speed"] && this["_hasImage2"] == c2["_hasImage2"] && this["_image2"] == c2["_image2"] && a$d["Property"]["equals"](this["_color2"], c2["_color2"]);
  }
}
registerProperty(MaterialType["LineFlow"], LineFlowMaterialProperty), a$d["Material"]["LineFlowType"] = MaterialType["LineFlow"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["LineFlowType"], { "fabric": { "type": a$d["Material"]["LineFlowType"], "uniforms": { "image": a$d["Material"]["DefaultImageId"], "color": new a$d["Color"](1, 0, 0, 1), "repeat": new a$d["Cartesian2"](1, 1), "axisY": ![], "speed": 10, "time": -1, "hasImage2": ![], "image2": a$d["Material"]["DefaultImageId"], "color2": new a$d["Color"](1, 1, 1) }, "source": LineFlowMaterial_default }, "translucent": !![] });
var LineTrailMaterial_default = "uniform vec4 bgColor;\r\nuniform vec4 color;\r\nuniform float speed;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  float time = fract(czm_frameNumber * speed / 1000.0);\n\n  vec3 fragColor = color.rgb;\r\n  if(st.t > 0.45 && st.t < 0.55 ) {\r\n    fragColor = vec3(1.0);\r\n  }\r\n  material.alpha =  color.a * 1.5 * smoothstep(.0,1., fract(st.s - time));\r\n  material.diffuse = max(fragColor.rgb * material.alpha , fragColor.rgb);\n\n  if(material.alpha < bgColor.a){\r\n    material.alpha = bgColor.a;\r\n    material.diffuse = bgColor.rgb;\r\n  }\n\n  return material;\r\n}";
class LineTrailMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_bgColor");
    this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](1, 0, 0, 1)), this["_bgColor"] = getCesiumColor(c2["bgColor"], this["_color"]["withAlpha"](0.1)), this["_speed"] = a$d["defaultValue"](c2["speed"], 2);
  }
  ["getType"](c2) {
    return MaterialType["LineTrail"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["bgColor"] = this["_bgColor"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof LineTrailMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && a$d["Property"]["equals"](this["_bgColor"], c2["_bgColor"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["LineTrail"], LineTrailMaterialProperty), a$d["Material"]["LineTrailType"] = MaterialType["LineTrail"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["LineTrailType"], { "fabric": { "type": a$d["Material"]["LineTrailType"], "uniforms": { "color": new a$d["Color"](1, 0, 0, 0.7), "bgColor": new a$d["Color"](0, 0, 0, 0), "speed": 5 }, "source": LineTrailMaterial_default }, "translucent": !![] });
var ODLineMaterial_default = "uniform vec4 color;\r\nuniform vec4 bgColor;\r\nuniform float speed;\r\nuniform float startTime;\r\nuniform float bidirectional;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    vec2 st = materialInput.st;\r\n    float t = fract(startTime + czm_frameNumber * speed / 1000.0);\n\n    t *= 1.03;\r\n    float alpha0 = smoothstep(t - 0.03, t, st.s) * step(st.s, t);\r\n    float mt = 1. - t;\r\n    float alpha1 = smoothstep(mt + 0.03, mt, st.s) * step(mt, st.s);\n\n    float a0 = step(abs(bidirectional - 0.0) - 0.001, 0.);\r\n    float a1 = step(abs(bidirectional - 1.0) - 0.001, 0.);\r\n    float db = step(abs(bidirectional - 2.0) - 0.001, 0.);\r\n    float alpha = alpha0 * (a0 + db) + alpha1 * (a1 + db);\r\n    alpha = clamp(alpha, 0., 1.);\n\n    material.diffuse = color.rgb * alpha + bgColor.rgb * (1. - alpha);\r\n    material.alpha = color.a * alpha + bgColor.a * (1. - alpha);\n\n    \n    \n    \n    \n    \n    \n\n    return material;\r\n}";
class ODLineMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_bgColor");
    __publicField(this, "_startTime");
    __publicField(this, "_bidirectional");
    this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](Math["random"]() * 0.5 + 0.5, Math["random"]() * 0.8 + 0.2, 0, 1)), this["_bgColor"] = getCesiumColor(c2["bgColor"], this["_color"]["withAlpha"](0.1)), this["_speed"] = a$d["defaultValue"](c2["speed"], 20 + 10 * Math["random"]()), this["_startTime"] = a$d["defaultValue"](c2["startTime"], Math["random"]()), this["_bidirectional"] = a$d["defaultValue"](c2["bidirectional"], 0);
  }
  ["getType"](c2) {
    return MaterialType["ODLine"];
  }
  ["getValue"](c2, d2) {
    return !d2 && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2["startTime"] = this["_startTime"], d2["bgColor"] = this["_bgColor"], d2["bidirectional"] = this["_bidirectional"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof ODLineMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && a$d["Property"]["equals"](this["_bgColor"], c2["_bgColor"]) && this["_speed"] == c2["_speed"] && this["_startTime"] == c2["_startTime"] && this["_bidirectional"] == c2["_bidirectional"];
  }
}
registerProperty(MaterialType["ODLine"], ODLineMaterialProperty), a$d["Material"]["ODLineType"] = MaterialType["ODLine"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["ODLineType"], { "fabric": { "type": a$d["Material"]["ODLineType"], "uniforms": { "color": new a$d["Color"](1, 1, 0, 0.7), "startTime": 0, "speed": 20, "bgColor": new a$d["Color"](1, 1, 0, 0.1), "bidirectional": 0 }, "source": ODLineMaterial_default }, "translucent": !![] });
var PolyAsphaltMaterial_default = "uniform vec4 asphaltColor;\r\nuniform float bumpSize;\r\nuniform float roughness;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  \n  \n  vec4 color = asphaltColor;\r\n  vec2 st = materialInput.st;\r\n  vec2 F = czm_cellular(st / bumpSize);\r\n  color.rgb -= (F.x / F.y) * 0.1;\n\n  \n  float noise = czm_snoise(st / bumpSize);\r\n  noise = pow(noise, 5.0) * roughness;\r\n  color.rgb += noise;\n\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyAsphaltMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_bumpSize");
    __publicField(this, "_roughness");
    this["_color"] = getCesiumColor(c2["asphaltColor"], a$d["Color"]["ORANGE"]), this["_bumpSize"] = a$d["defaultValue"](c2["bumpSize"], 0.02), this["_roughness"] = a$d["defaultValue"](c2["roughness"], 0.2);
  }
  ["getType"](c2) {
    return MaterialType["PolyAsphalt"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["asphaltColor"] = this["_color"], d2["bumpSize"] = this["_bumpSize"], d2["roughness"] = this["_roughness"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyAsphaltMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_bumpSize"] == c2["_bumpSize"] && this["_roughness"] == c2["_roughness"];
  }
}
registerProperty(MaterialType["PolyAsphalt"], PolyAsphaltMaterialProperty), a$d["Material"]["PolyAsphaltType"] = MaterialType["PolyAsphalt"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["PolyAsphaltType"], { "fabric": { "type": a$d["Material"]["PolyAsphaltType"], "uniforms": { "asphaltColor": a$d["Color"]["ORANGE"], "bumpSize": 0.02, "roughness": 0.2 }, "source": PolyAsphaltMaterial_default }, "translucent"(c2) {
  return c2["uniforms"]["asphaltColor"]["alpha"] < 1;
} });
var PolyBlobMaterial_default = "uniform vec4 lightColor;\r\nuniform vec4 darkColor;\r\nuniform float frequency;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  \n  vec2 F = czm_cellular(materialInput.st * frequency);\r\n  float t = 1.0 - F.x * F.x;\n\n  vec4 color = mix(lightColor, darkColor, t);\r\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyBlobMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_lightColor");
    __publicField(this, "_darkColor");
    __publicField(this, "_frequency");
    this["_lightColor"] = getCesiumColor(c2["lightColor"], new a$d["Color"](1, 1, 1, 0.5)), this["_darkColor"] = getCesiumColor(c2["darkColor"], new a$d["Color"](0, 0, 1, 0.5)), this["_frequency"] = a$d["defaultValue"](c2["frequency"], 10);
  }
  ["getType"](c2) {
    return MaterialType["PolyBlob"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["lightColor"] = this["_lightColor"], d2["darkColor"] = this["_darkColor"], d2["frequency"] = this["_frequency"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyBlobMaterialProperty && a$d["Property"]["equals"](this["_lightColor"], c2["_lightColor"]) && a$d["Property"]["equals"](this["_darkColor"], c2["_darkColor"]) && this["_frequency"] == c2["_frequency"];
  }
}
registerProperty(MaterialType["PolyBlob"], PolyBlobMaterialProperty), a$d["Material"]["PolyBlobType"] = MaterialType["PolyBlob"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["PolyBlobType"], { "fabric": { "type": a$d["Material"]["PolyBlobType"], "uniforms": { "lightColor": new a$d["Color"](1, 1, 1, 0.5), "darkColor": new a$d["Color"](0, 0, 1, 0.5), "frequency": 10 }, "source": PolyBlobMaterial_default }, "translucent"(c2) {
  const d2 = c2["uniforms"];
  return d2["lightColor"]["alpha"] < 1 || d2["darkColor"]["alpha"] < 0;
} });
var PolyFacetMaterial_default = "uniform vec4 lightColor;\r\nuniform vec4 darkColor;\r\nuniform float frequency;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  \n  vec2 F = czm_cellular(materialInput.st * frequency);\r\n  float t = 0.1 + (F.y - F.x);\n\n  vec4 color = mix(lightColor, darkColor, t);\r\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyFacetMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_lightColor");
    __publicField(this, "_darkColor");
    __publicField(this, "_frequency");
    this["_lightColor"] = getCesiumColor(c2["lightColor"], new a$d["Color"](0.25, 0.25, 0.25, 0.75)), this["_darkColor"] = getCesiumColor(c2["darkColor"], new a$d["Color"](0.25, 0.25, 0.25, 0.75)), this["_frequency"] = a$d["defaultValue"](c2["frequency"], 10);
  }
  ["getType"](c2) {
    return MaterialType["PolyFacet"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["lightColor"] = this["_lightColor"], d2["darkColor"] = this["_darkColor"], d2["frequency"] = this["_frequency"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyFacetMaterialProperty && a$d["Property"]["equals"](this["_lightColor"], c2["_lightColor"]) && a$d["Property"]["equals"](this["_darkColor"], c2["_darkColor"]) && this["_frequency"] == c2["_frequency"];
  }
}
registerProperty(MaterialType["PolyFacet"], PolyFacetMaterialProperty), a$d["Material"]["PolyFacetType"] = MaterialType["PolyFacet"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["PolyFacetType"], { "fabric": { "type": a$d["Material"]["PolyFacetType"], "uniforms": { "lightColor": new a$d["Color"](0.25, 0.25, 0.25, 0.75), "darkColor": new a$d["Color"](0.75, 0.75, 0.75, 0.75), "frequency": 10 }, "source": PolyFacetMaterial_default }, "translucent"(c2) {
  const d2 = c2["uniforms"];
  return d2["lightColor"]["alpha"] < 1 || d2["darkColor"]["alpha"] < 0;
} });
var PolyGradientMaterial_default = "uniform vec4 color;\r\nuniform float diffusePower;\r\nuniform float alphaPower;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  float alpha = distance(st,vec2(0.5, 0.5));\r\n  material.alpha = color.a  * alpha  * alphaPower;\r\n  material.diffuse = color.rgb * diffusePower;\r\n  return material;\r\n}";
class PolyGradientMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_diffusePower");
    this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](1, 1, 0, 0.5)), this["_diffusePower"] = a$d["defaultValue"](c2["diffusePower"], 1.6);
  }
  ["getType"](c2) {
    return MaterialType["PolyGradient"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["diffusePower"] = this["_diffusePower"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyGradientMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_diffusePower"] == c2["_diffusePower"];
  }
}
registerProperty(MaterialType["PolyGradient"], PolyGradientMaterialProperty), a$d["Material"]["PolyGradientType"] = MaterialType["PolyGradient"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["PolyGradientType"], { "fabric": { "type": a$d["Material"]["PolyGradientType"], "uniforms": { "color": new a$d["Color"](1, 1, 0, 0.5), "diffusePower": 1.6, "alphaPower": 1.5 }, "source": PolyGradientMaterial_default }, "translucent": !![] });
var PolyGrassMaterial_default = "uniform vec4 grassColor;\r\nuniform vec4 dirtColor;\r\nuniform float frequency;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  vec2 st = materialInput.st;\r\n  float noise1 = (czm_snoise(st * frequency * 1.0)) * 1.0;\r\n  float noise2 = (czm_snoise(st * frequency * 2.0)) * 0.5;\r\n  float noise3 = (czm_snoise(st * frequency * 4.0)) * 0.25;\r\n  float noise = sin(noise1 + noise2 + noise3) * 0.1;\n\n  vec4 color = mix(grassColor, dirtColor, noise);\n\n  \n  float verticalNoise = czm_snoise(vec2(st.x * 100.0, st.y * 20.0)) * 0.02;\r\n  float horizontalNoise = czm_snoise(vec2(st.x * 20.0, st.y * 100.0)) * 0.02;\r\n  float stripeNoise = min(verticalNoise, horizontalNoise);\n\n  color.rgb += stripeNoise;\n\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyGrassMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_grassColor");
    __publicField(this, "_dirtColor");
    __publicField(this, "_frequency");
    this["_grassColor"] = getCesiumColor(c2["grassColor"], new a$d["Color"](0.25, 0.4, 0.1, 1)), this["_dirtColor"] = getCesiumColor(c2["dirtColor"], new a$d["Color"](0.1, 0.1, 0.1, 1)), this["_frequency"] = a$d["defaultValue"](c2["frequency"], 10);
  }
  ["getType"](c2) {
    return MaterialType["PolyGrass"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["grassColor"] = this["_grassColor"], d2["dirtColor"] = this["_dirtColor"], d2["frequency"] = this["_frequency"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyGrassMaterialProperty && a$d["Property"]["equals"](this["_grassColor"], c2["_grassColor"]) && a$d["Property"]["equals"](this["_dirtColor"], c2["_dirtColor"]) && this["_frequency"] == c2["_frequency"];
  }
}
registerProperty(MaterialType["PolyGrass"], PolyGrassMaterialProperty), a$d["Material"]["PolyGrassType"] = MaterialType["PolyGrass"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["PolyGrassType"], { "fabric": { "type": a$d["Material"]["PolyGrassType"], "uniforms": { "grassColor": new a$d["Color"](0.25, 0.4, 0.1, 1), "dirtColor": new a$d["Color"](0.1, 0.1, 0.1, 1), "frequency": 1.5 }, "source": PolyGrassMaterial_default }, "translucent"(c2) {
  const d2 = c2["uniforms"];
  return d2["grassColor"]["alpha"] < 1 || d2["dirtColor"]["alpha"] < 1;
} });
var PolyWoodMaterial_default = "uniform vec4 lightWoodColor;\r\nuniform vec4 darkWoodColor;\r\nuniform float frequency;\r\nuniform vec2 noiseScale;\r\nuniform float grainFrequency;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\n\n  \n  vec2 st = materialInput.st;\n\n  vec2 noisevec;\r\n  noisevec.x = czm_snoise(st * noiseScale.x);\r\n  noisevec.y = czm_snoise(st * noiseScale.y);\n\n  vec2 location = st + noisevec;\r\n  float dist = sqrt(location.x * location.x + location.y * location.y);\r\n  dist *= frequency;\n\n  float r = fract(dist + noisevec[0] + noisevec[1]) * 2.0;\r\n  if(r > 1.0)\r\n      r = 2.0 - r;\n\n  vec4 color = mix(lightWoodColor, darkWoodColor, r);\n\n  \n  r = abs(czm_snoise(vec2(st.x * grainFrequency, st.y * grainFrequency * 0.02))) * 0.2;\r\n  color.rgb += lightWoodColor.rgb * r;\n\n  material.diffuse = color.rgb;\r\n  material.alpha = color.a;\n\n  return material;\r\n}";
class PolyWoodMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2);
    __publicField(this, "_lightWoodColor");
    __publicField(this, "_darkWoodColor");
    __publicField(this, "_frequency");
    __publicField(this, "_noiseScale");
    __publicField(this, "_grainFrequency");
    this["_lightWoodColor"] = getCesiumColor(c2["lightWoodColor"], new a$d["Color"](1, 1, 1, 0.5)), this["_darkWoodColor"] = getCesiumColor(c2["darkWoodColor"], new a$d["Color"](0, 0, 1, 0.5)), this["_frequency"] = a$d["defaultValue"](c2["frequency"], 3), this["_noiseScale"] = a$d["defaultValue"](c2["noiseScale"], new a$d["Cartesian2"](0.7, 0.5)), this["_grainFrequency"] = a$d["defaultValue"](c2["grainFrequency"], 27);
  }
  ["getType"](c2) {
    return MaterialType["PolyWood"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["lightWoodColor"] = this["_lightWoodColor"], d2["darkWoodColor"] = this["_darkWoodColor"], d2["frequency"] = this["_frequency"], d2["noiseScale"] = this["_noiseScale"], d2["grainFrequency"] = this["_grainFrequency"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof PolyWoodMaterialProperty && a$d["Property"]["equals"](this["_lightWoodColor"], c2["_lightWoodColor"]) && a$d["Property"]["equals"](this["_darkWoodColor"], c2["_darkWoodColor"]) && a$d["Property"]["equals"](this["_noiseScale"], c2["_noiseScale"]) && this["_frequency"] == c2["_frequency"] && this["_grainFrequency"] == c2["_grainFrequency"];
  }
}
registerProperty(MaterialType["PolyWood"], PolyWoodMaterialProperty), a$d["Material"]["PolyWoodType"] = MaterialType["PolyWood"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["PolyWoodType"], { "fabric": { "type": a$d["Material"]["PolyWoodType"], "uniforms": { "lightWoodColor": new a$d["Color"](0.6, 0.3, 0.1, 1), "darkWoodColor": new a$d["Color"](0.4, 0.2, 0.07, 1), "frequency": 3, "noiseScale": new a$d["Cartesian2"](0.7, 0.5), "grainFrequency": 27 }, "source": PolyWoodMaterial_default }, "translucent"(c2) {
  const d2 = c2["uniforms"];
  return d2["lightWoodColor"]["alpha"] < 1 || d2["darkWoodColor"]["alpha"] < 1;
} });
var RadarLineMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st * 2.0 - 1.0;\r\n  float t = czm_frameNumber * speed / 1000.0 ;\r\n  vec3 col = vec3(0.0);\r\n  vec2 p = vec2(sin(t), cos(t));\r\n  float d = length(st - dot(p, st) * p);\r\n  if (dot(st, p) < 0.) {\r\n    d = length(st);\r\n  }\n\n  col = .006 / d * color.rgb;\n\n  if(distance(st,vec2(0)) >  0.99 ){\r\n    col =color.rgb;\r\n  }\n\n  material.alpha  = pow(length(col),2.0);\r\n  material.diffuse = col * 3.0 ;\r\n  return material;\r\n}";
class RadarLineMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](0, 0, 0, 0)), this["_speed"] = a$d["defaultValue"](c2["speed"], 5);
  }
  ["getType"](c2) {
    return MaterialType["RadarLine"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof RadarLineMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["RadarLine"], RadarLineMaterialProperty), a$d["Material"]["RadarLineType"] = MaterialType["RadarLine"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["RadarLineType"], { "fabric": { "type": a$d["Material"]["RadarLineType"], "uniforms": { "color": new a$d["Color"](0, 1, 1, 0.7), "speed": 5 }, "source": RadarLineMaterial_default }, "translucent": !![] });
var RadarWaveMaterial_default = "uniform vec4 color;\r\nuniform float speed;\n\n#define PI 3.14159265359\n\nfloat rand(vec2 co){\r\n  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\r\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  vec2 st = materialInput.st;\r\n  vec2 pos = st - vec2(0.5);\r\n  float time = czm_frameNumber * speed / 1000.0 ;\r\n  float r = length(pos);\r\n  float t = atan(pos.y, pos.x) - time * 2.5;\r\n  float a = (atan(sin(t), cos(t)) + PI)/(2.0*PI);\r\n  float ta = 0.5;\r\n  float v = smoothstep(ta-0.05,ta+0.05,a) * smoothstep(ta+0.05,ta-0.05,a);\r\n  vec3 flagColor = color.rgb * v;\r\n  float blink = pow(sin(time*1.5)*0.5+0.5, 0.8);\r\n  flagColor = color.rgb *  pow(a, 8.0*(.2+blink))*(sin(r*500.0)*.5+.5) ;\r\n  flagColor = flagColor * pow(r, 0.4);\r\n  material.alpha = length(flagColor) * 1.3;\r\n  material.diffuse = flagColor * 3.0;\r\n  return material;\r\n}";
class RadarWaveMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](0, 0, 0, 0)), this["_speed"] = a$d["defaultValue"](c2["speed"], 5);
  }
  ["getType"](c2) {
    return MaterialType["RadarWave"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof RadarWaveMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["RadarWave"], RadarWaveMaterialProperty), a$d["Material"]["RadarWaveType"] = MaterialType["RadarWave"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["RadarWaveType"], { "fabric": { "type": a$d["Material"]["RadarWaveType"], "uniforms": { "color": new a$d["Color"](0, 1, 1, 0.7), "speed": 5 }, "source": RadarWaveMaterial_default }, "translucent": !![] });
var RectSlideMaterial_default = "czm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n     czm_material material = czm_getDefaultMaterial(materialInput);\r\n     vec2 st = materialInput.st;\r\n     vec4 colorImage = texture(image, vec2(fract(st.s + czm_frameNumber * speed / 1000.0),fract(st.t)));\n\n    material.alpha = colorImage.a * color.a;\r\n    if(pure) {\r\n        material.diffuse = diffusePower * color.rgb;\r\n    }\r\n    else {\r\n        material.diffuse = colorImage.rgb;\r\n    }\r\n    return material;\r\n }";
class RectSlideMaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    __publicField(this, "_pure");
    this["_image"] = c2["image"], this["_color"] = getCesiumColor(c2["color"], new a$d["Color"](1, 1, 1, 0.9)), this["_speed"] = a$d["defaultValue"](c2["speed"], 1), this["_pure"] = !!c2["pure"];
  }
  ["getType"](c2) {
    return MaterialType["RectSlide"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["image"] = this["_image"], d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2["pure"] = this["_pure"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof RectSlideMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_image"] == c2["_image"] && this["_pure"] == c2["_pure"] && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["RectSlide"], RectSlideMaterialProperty), a$d["Material"]["RectSlideType"] = MaterialType["RectSlide"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["RectSlideType"], { "fabric": { "type": a$d["Material"]["RectSlideType"], "uniforms": { "image": a$d["Material"]["DefaultImageId"], "color": a$d["Color"]["WHITE"], "speed": 10, "pure": ![], "diffusePower": 1.3 }, "source": RectSlideMaterial_default }, "translucent": !![] });
var ScanLineMaterial_default = "float circle(vec2 uv, float r, float blur) {\r\n    float d = length(uv) * 2.0;\r\n    float c = smoothstep(r+blur, r, d);\r\n    return c;\r\n}\n\nuniform vec4 color;\r\nczm_material czm_getMaterial(czm_materialInput materialInput)\r\n{\r\n    czm_material material = czm_getDefaultMaterial(materialInput);\r\n    vec2 st = materialInput.st - .5;\r\n    material.diffuse = color.rgb;\r\n    material.emission = vec3(0);\n\n    float t =fract(czm_frameNumber * speed / 1000.0);\r\n    float s = 0.3;\r\n    float radius1 = smoothstep(.0, s, t) * 0.5;\r\n    float alpha1 = circle(st, radius1, 0.01) * circle(st, radius1, -0.01);\r\n    float alpha2 = circle(st, radius1, 0.01 - radius1) * circle(st, radius1, 0.01);\r\n    float radius2 = 0.5 + smoothstep(s, 1.0, t) * 0.5;\r\n    float alpha3 = circle(st, radius1, radius2 + 0.01 - radius1) * circle(st, radius1, -0.01);\n\n    material.alpha = smoothstep(1.0, s, t) * (alpha1 + alpha2*0.1 + alpha3*0.1);\r\n    material.alpha *= color.a;\n\n    return material;\r\n}";
class ScanLineMaterialProperty extends BaseMaterialProperty {
  constructor(c2 = {}) {
    super(c2), this["_color"] = getCesiumColor(c2["color"], a$d["Color"]["YELLOW"]), this["_speed"] = a$d["defaultValue"](c2["speed"], 10);
  }
  ["getType"](c2) {
    return MaterialType["ScanLine"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof ScanLineMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["ScanLine"], ScanLineMaterialProperty), a$d["Material"]["ScanLineType"] = MaterialType["ScanLine"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["ScanLineType"], { "fabric": { "type": a$d["Material"]["ScanLineType"], "uniforms": { "color": new a$d["Color"](1, 1, 0, 1), "speed": 10 }, "source": ScanLineMaterial_default }, "translucent": !![] });
class TextMaterialProperty extends Image2MaterialProperty {
  constructor(b2) {
    super({ ...b2, "image": "" });
    __publicField(this, "transparent");
    __publicField(this, "_textStyles");
    __publicField(this, "_canvas");
    this["transparent"] = !![], this["options"]["text"] = b2["text"], b2["font_size"] = b2["font_size"] || 70, this["_textStyles"] = LabelStyleConver["toCesiumVal"](b2, { "fill": !![], "fillColor": new a$d["Color"](1, 1, 0, 1), "textBaseline": "middle", "padding": 10 }), this["_updateImage"]();
  }
  get ["text"]() {
    return this["options"]["text"];
  }
  set ["text"](b2) {
    this["options"]["text"] = b2, this["_updateImage"]();
  }
  get ["textStyles"]() {
    return this["_textStyles"];
  }
  set ["textStyles"](b2) {
    this["_textStyles"] = LabelStyleConver["toCesiumVal"](b2, this["_textStyles"]), this["_updateImage"]();
  }
  ["_updateImage"]() {
    var _a;
    this["_canvas"] = getTextImage(this["options"]["text"], this["_textStyles"]);
    if (this["_canvas"]) {
      this["_image"] = this["_canvas"]["toDataURL"]("image/png");
      if ((_a = this["options"]) == null ? void 0 : _a["onCustomCanvas"]) {
        const b2 = this["options"]["onCustomCanvas"](this["_canvas"], this);
        (b2 == null ? void 0 : b2["then"]) && b2["then"]((c2) => {
          this["_image"] = c2["toDataURL"]("image/png");
        });
      }
    }
  }
}
registerProperty(MaterialType["Text"], TextMaterialProperty);
var WallScrollMaterial_default = "uniform sampler2D image;\r\nuniform float speed;\r\nuniform vec4 color;\r\nuniform float count;\n\nczm_material czm_getMaterial(czm_materialInput materialInput){\r\n  czm_material material = czm_getDefaultMaterial(materialInput);\r\n  float perDis = 1.0 / count / 3.0  ;\r\n  vec2 st = materialInput.st * vec2(1.0,count);\r\n  float time = fract(czm_frameNumber * speed / 1000.0);\r\n  vec4 colorImage = texture(image, vec2(fract(st.t - time),st.t));\r\n  material.alpha =  colorImage.a * smoothstep(.2 ,1. ,distance(st.t * perDis ,1. + perDis ));\r\n  material.diffuse = max(color.rgb * material.alpha * 1.5, color.rgb);\r\n  material.emission = max(color.rgb * material.alpha * 1.5, color.rgb);\r\n  return material;\r\n}";
class WallScrollMaterialProperty extends BaseMaterialProperty {
  constructor(c2) {
    super(c2);
    __publicField(this, "_image");
    __publicField(this, "_count");
    this["_image"] = c2["image"], this["_color"] = getCesiumColor(c2["color"], a$d["Color"]["RED"]), this["_speed"] = a$d["defaultValue"](c2["speed"], 10), this["_count"] = a$d["defaultValue"](c2["count"], 1);
  }
  ["getType"](c2) {
    return MaterialType["WallScroll"];
  }
  ["getValue"](c2, d2) {
    return !a$d["defined"](d2) && (d2 = {}), d2["image"] = this["_image"], d2["color"] = this["_color"], d2["speed"] = this["_speed"], d2["count"] = this["_count"], d2;
  }
  ["equals"](c2) {
    return this == c2 || c2 instanceof WallScrollMaterialProperty && a$d["Property"]["equals"](this["_color"], c2["_color"]) && this["_image"] == c2["_image"] && this["_count"] == c2["_count"] && this["_speed"] == c2["_speed"];
  }
}
registerProperty(MaterialType["WallScroll"], WallScrollMaterialProperty), a$d["Material"]["WallScrollType"] = MaterialType["WallScroll"], a$d["Material"]["_materialCache"]["addMaterial"](a$d["Material"]["WallScrollType"], { "fabric": { "type": a$d["Material"]["WallScrollType"], "uniforms": { "color": new a$d["Color"](1, 0, 0, 0.7), "image": a$d["Material"]["DefaultImageId"], "count": 1, "speed": 5 }, "source": WallScrollMaterial_default }, "translucent": !![] });
class WaterMaterialProperty extends BaseMaterialProperty {
  constructor(b2 = {}) {
    super(b2);
    __publicField(this, "baseWaterColor");
    __publicField(this, "blendColor");
    __publicField(this, "specularMap");
    __publicField(this, "normalMap");
    __publicField(this, "frequency");
    __publicField(this, "animationSpeed");
    __publicField(this, "amplitude");
    __publicField(this, "specularIntensity");
    __publicField(this, "fadeFactor");
    this["baseWaterColor"] = getCesiumColor(b2["baseWaterColor"], new a$d["Color"](0.2, 0.3, 0.6, 1)), this["blendColor"] = getCesiumColor(b2["blendColor"], new a$d["Color"](0, 1, 0.699, 1)), this["specularMap"] = b2["specularMap"] || a$d["Material"]["DefaultImageId"], this["normalMap"] = b2["normalMap"] || a$d["Material"]["DefaultImageId"], this["frequency"] = a$d["defaultValue"](b2["frequency"], 1e3), this["animationSpeed"] = a$d["defaultValue"](b2["animationSpeed"], 0.01), this["amplitude"] = a$d["defaultValue"](b2["amplitude"], 10), this["specularIntensity"] = a$d["defaultValue"](b2["specularIntensity"], 0.5), this["fadeFactor"] = a$d["defaultValue"](b2["fadeFactor"], 1);
  }
  ["getType"](b2) {
    return MaterialType["Water"];
  }
  ["getValue"](b2, c2) {
    return !c2 && (c2 = {}), c2["baseWaterColor"] = a$d["Property"]["getValueOrUndefined"](this["baseWaterColor"], b2), c2["blendColor"] = a$d["Property"]["getValueOrUndefined"](this["blendColor"], b2), c2["specularMap"] = a$d["Property"]["getValueOrUndefined"](this["specularMap"], b2), c2["normalMap"] = a$d["Property"]["getValueOrUndefined"](this["normalMap"], b2), c2["frequency"] = this["frequency"], c2["animationSpeed"] = this["animationSpeed"], c2["amplitude"] = this["amplitude"], c2["specularIntensity"] = this["specularIntensity"], c2["fadeFactor"] = this["fadeFactor"], c2;
  }
  ["equals"](b2) {
    return this == b2 || b2 instanceof WaterMaterialProperty && a$d["Property"]["equals"](this["baseWaterColor"], b2["baseWaterColor"]) && a$d["Property"]["equals"](this["blendColor"], b2["blendColor"]) && a$d["Property"]["equals"](this["specularMap"], b2["specularMap"]) && a$d["Property"]["equals"](this["normalMap"], b2["normalMap"]) && this["frequency"] == b2["frequency"] && this["animationSpeed"] == b2["animationSpeed"] && this["amplitude"] == b2["amplitude"] && this["specularIntensity"] == b2["specularIntensity"] && this["fadeFactor"] == b2["fadeFactor"];
  }
}
Object["defineProperties"](WaterMaterialProperty["prototype"], { "baseWaterColor": a$d["createPropertyDescriptor"]("baseWaterColor"), "blendColor": a$d["createPropertyDescriptor"]("blendColor"), "specularMap": a$d["createPropertyDescriptor"]("specularMap"), "normalMap": a$d["createPropertyDescriptor"]("normalMap") }), registerProperty(MaterialType["Water"], WaterMaterialProperty);
a$d["ShaderSource"]["_czmBuiltinsAndUniforms"]["czm_cellular"] = cellular_default, a$d["ShaderSource"]["_czmBuiltinsAndUniforms"]["czm_snoise"] = snoise_default;
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseMaterialProperty,
  CircleScanMaterialProperty,
  CircleWaveMaterialProperty,
  CylinderWaveMaterial,
  CylinderWaveMaterialProperty,
  EllipsoidElectricMaterialProperty,
  EllipsoidWaveMaterialProperty,
  Image2MaterialProperty,
  LineFlickerMaterialProperty,
  LineFlowColorMaterialProperty,
  LineFlowMaterialProperty,
  LineTrailMaterialProperty,
  ODLineMaterialProperty,
  PolyAsphaltMaterialProperty,
  PolyBlobMaterialProperty,
  PolyFacetMaterialProperty,
  PolyGradientMaterialProperty,
  PolyGrassMaterialProperty,
  PolyWoodMaterialProperty,
  RadarLineMaterialProperty,
  RadarWaveMaterialProperty,
  RectSlideMaterialProperty,
  ScanLineMaterialProperty,
  TextMaterial,
  TextMaterialProperty,
  WallScrollMaterialProperty,
  WaterMaterialProperty
}, Symbol.toStringTag, { value: "Module" }));
export {
  a$d as Cesium,
  Earth,
  index$2 as convers,
  index$b as effects,
  index$8 as enums,
  index$1 as layers,
  index as materials,
  b$e as turf,
  index$3 as utils
};
