resium
Version:
React component library for Cesium
1,589 lines (1,587 loc) • 84 kB
JavaScript
var ni = Object.defineProperty;
var ti = (i, e, n) => e in i ? ni(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
var Y = (i, e, n) => ti(i, typeof e != "symbol" ? e + "" : e, n);
import oi, { createContext as ri, useContext as si, useRef as L, useEffect as me, useState as Xe, useCallback as ve, useLayoutEffect as ai, useImperativeHandle as ci, forwardRef as Qe, useMemo as li } from "react";
import { ScreenSpaceEventType as E, ScreenSpaceEventHandler as ei, Event as Ve, BillboardCollection as ui, BillboardGraphics as di, BoxGraphics as mi, Cesium3DTileset as fi, Cesium3DTilesetGraphics as hi, CesiumWidget as yi, ClassificationPrimitive as gi, CloudCollection as pi, CorridorGraphics as vi, CustomDataSource as Ci, CylinderGraphics as Pi, CzmlDataSource as Ei, EllipseGraphics as wi, EllipsoidGraphics as Si, Entity as bi, Fog as Ie, GeoJsonDataSource as Di, GroundPolylinePrimitive as Ri, GroundPrimitive as Mi, ImageryLayer as Ti, KmlDataSource as $i, LabelCollection as ki, LabelGraphics as Li, Model as Oi, ModelGraphics as Ai, Moon as je, ParticleSystem as _i, PathGraphics as Bi, PlaneGraphics as Gi, PointGraphics as Wi, PointPrimitiveCollection as Fi, PolygonGraphics as Ui, PolylineCollection as Vi, PolylineGraphics as Ii, PolylineVolumeGraphics as ji, PostProcessStage as Ni, PostProcessStageLibrary as J, PostProcessStageComposite as Hi, Primitive as zi, RectangleGraphics as xi, SceneMode as Me, Sun as Ne, TimeDynamicPointCloud as qi, Viewer as Yi, WallGraphics as Ki } from "cesium";
import { createPortal as Ji } from "react-dom";
const ke = ri({}), { Provider: Do, Consumer: Zi } = ke, we = () => si(ke) || {}, Se = (i, e) => {
const n = (o) => {
const r = we(), s = L(void 0), u = L(!1);
return me(() => () => {
r.camera && o.cancelFlightOnUnmount && r.camera.cancelFlight();
}, [r.camera, o.cancelFlightOnUnmount]), me(() => {
r.camera && r.scene && !r.scene.isDestroyed() && (!o.once || !u.current) && (r.camera.cancelFlight(), e(r.camera, o, s.current), u.current = !0), s.current = o;
}), null;
};
return n.displayName = i, n;
};
var Ce = { exports: {} }, he = {};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var He;
function Xi() {
if (He) return he;
He = 1;
var i = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
function n(o, r, s) {
var u = null;
if (s !== void 0 && (u = "" + s), r.key !== void 0 && (u = "" + r.key), "key" in r) {
s = {};
for (var f in r)
f !== "key" && (s[f] = r[f]);
} else s = r;
return r = s.ref, {
$$typeof: i,
type: o,
key: u,
ref: r !== void 0 ? r : null,
props: s
};
}
return he.Fragment = e, he.jsx = n, he.jsxs = n, he;
}
var ye = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ze;
function Qi() {
return ze || (ze = 1, process.env.NODE_ENV !== "production" && function() {
function i(t) {
if (t == null) return null;
if (typeof t == "function")
return t.$$typeof === $ ? null : t.displayName || t.name || null;
if (typeof t == "string") return t;
switch (t) {
case X:
return "Fragment";
case ae:
return "Portal";
case ce:
return "Profiler";
case Q:
return "StrictMode";
case ie:
return "Suspense";
case ne:
return "SuspenseList";
}
if (typeof t == "object")
switch (typeof t.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), t.$$typeof) {
case H:
return (t.displayName || "Context") + ".Provider";
case W:
return (t._context.displayName || "Context") + ".Consumer";
case ee:
var c = t.render;
return t = t.displayName, t || (t = c.displayName || c.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
case te:
return c = t.displayName || null, c !== null ? c : i(t.type) || "Memo";
case P:
c = t._payload, t = t._init;
try {
return i(t(c));
} catch {
}
}
return null;
}
function e(t) {
return "" + t;
}
function n(t) {
try {
e(t);
var c = !1;
} catch {
c = !0;
}
if (c) {
c = console;
var l = c.error, h = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
return l.call(
c,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
h
), e(t);
}
}
function o() {
}
function r() {
if (I === 0) {
z = console.log, le = console.info, x = console.warn, Le = console.error, Oe = console.group, Ae = console.groupCollapsed, _e = console.groupEnd;
var t = {
configurable: !0,
enumerable: !0,
value: o,
writable: !0
};
Object.defineProperties(console, {
info: t,
log: t,
warn: t,
error: t,
group: t,
groupCollapsed: t,
groupEnd: t
});
}
I++;
}
function s() {
if (I--, I === 0) {
var t = { configurable: !0, enumerable: !0, writable: !0 };
Object.defineProperties(console, {
log: k({}, t, { value: z }),
info: k({}, t, { value: le }),
warn: k({}, t, { value: x }),
error: k({}, t, { value: Le }),
group: k({}, t, { value: Oe }),
groupCollapsed: k({}, t, { value: Ae }),
groupEnd: k({}, t, { value: _e })
});
}
0 > I && console.error(
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
);
}
function u(t) {
if (be === void 0)
try {
throw Error();
} catch (l) {
var c = l.stack.trim().match(/\n( *(at )?)/);
be = c && c[1] || "", Be = -1 < l.stack.indexOf(`
at`) ? " (<anonymous>)" : -1 < l.stack.indexOf("@") ? "@unknown:0:0" : "";
}
return `
` + be + t + Be;
}
function f(t, c) {
if (!t || De) return "";
var l = Re.get(t);
if (l !== void 0) return l;
De = !0, l = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
var h = null;
h = D.H, D.H = null, r();
try {
var R = {
DetermineComponentFrameRoot: function() {
try {
if (c) {
var q = function() {
throw Error();
};
if (Object.defineProperty(q.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(q, []);
} catch (N) {
var pe = N;
}
Reflect.construct(t, [], q);
} else {
try {
q.call();
} catch (N) {
pe = N;
}
t.call(q.prototype);
}
} else {
try {
throw Error();
} catch (N) {
pe = N;
}
(q = t()) && typeof q.catch == "function" && q.catch(function() {
});
}
} catch (N) {
if (N && pe && typeof N.stack == "string")
return [N.stack, pe.stack];
}
return [null, null];
}
};
R.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
var v = Object.getOwnPropertyDescriptor(
R.DetermineComponentFrameRoot,
"name"
);
v && v.configurable && Object.defineProperty(
R.DetermineComponentFrameRoot,
"name",
{ value: "DetermineComponentFrameRoot" }
);
var d = R.DetermineComponentFrameRoot(), j = d[0], ue = d[1];
if (j && ue) {
var T = j.split(`
`), re = ue.split(`
`);
for (d = v = 0; v < T.length && !T[v].includes(
"DetermineComponentFrameRoot"
); )
v++;
for (; d < re.length && !re[d].includes(
"DetermineComponentFrameRoot"
); )
d++;
if (v === T.length || d === re.length)
for (v = T.length - 1, d = re.length - 1; 1 <= v && 0 <= d && T[v] !== re[d]; )
d--;
for (; 1 <= v && 0 <= d; v--, d--)
if (T[v] !== re[d]) {
if (v !== 1 || d !== 1)
do
if (v--, d--, 0 > d || T[v] !== re[d]) {
var fe = `
` + T[v].replace(
" at new ",
" at "
);
return t.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", t.displayName)), typeof t == "function" && Re.set(t, fe), fe;
}
while (1 <= v && 0 <= d);
break;
}
}
} finally {
De = !1, D.H = h, s(), Error.prepareStackTrace = l;
}
return T = (T = t ? t.displayName || t.name : "") ? u(T) : "", typeof t == "function" && Re.set(t, T), T;
}
function m(t) {
if (t == null) return "";
if (typeof t == "function") {
var c = t.prototype;
return f(
t,
!(!c || !c.isReactComponent)
);
}
if (typeof t == "string") return u(t);
switch (t) {
case ie:
return u("Suspense");
case ne:
return u("SuspenseList");
}
if (typeof t == "object")
switch (t.$$typeof) {
case ee:
return t = f(t.render, !1), t;
case te:
return m(t.type);
case P:
c = t._payload, t = t._init;
try {
return m(t(c));
} catch {
}
}
return "";
}
function p() {
var t = D.A;
return t === null ? null : t.getOwner();
}
function C(t) {
if (M.call(t, "key")) {
var c = Object.getOwnPropertyDescriptor(t, "key").get;
if (c && c.isReactWarning) return !1;
}
return t.key !== void 0;
}
function O(t, c) {
function l() {
Ge || (Ge = !0, console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
c
));
}
l.isReactWarning = !0, Object.defineProperty(t, "key", {
get: l,
configurable: !0
});
}
function B() {
var t = i(this.type);
return We[t] || (We[t] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), t = this.props.ref, t !== void 0 ? t : null;
}
function y(t, c, l, h, R, v) {
return l = v.ref, t = {
$$typeof: se,
type: t,
key: c,
props: v,
_owner: R
}, (l !== void 0 ? l : null) !== null ? Object.defineProperty(t, "ref", {
enumerable: !1,
get: B
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(t, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
}
function S(t, c, l, h, R, v) {
if (typeof t == "string" || typeof t == "function" || t === X || t === ce || t === Q || t === ie || t === ne || t === w || typeof t == "object" && t !== null && (t.$$typeof === P || t.$$typeof === te || t.$$typeof === H || t.$$typeof === W || t.$$typeof === ee || t.$$typeof === oe || t.getModuleId !== void 0)) {
var d = c.children;
if (d !== void 0)
if (h)
if (g(d)) {
for (h = 0; h < d.length; h++)
U(d[h], t);
Object.freeze && Object.freeze(d);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else U(d, t);
} else
d = "", (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (d += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), t === null ? h = "null" : g(t) ? h = "array" : t !== void 0 && t.$$typeof === se ? (h = "<" + (i(t.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : h = typeof t, console.error(
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
h,
d
);
if (M.call(c, "key")) {
d = i(t);
var j = Object.keys(c).filter(function(T) {
return T !== "key";
});
h = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", Fe[d + h] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,
h,
d,
j,
d
), Fe[d + h] = !0);
}
if (d = null, l !== void 0 && (n(l), d = "" + l), C(c) && (n(c.key), d = "" + c.key), "key" in c) {
l = {};
for (var ue in c)
ue !== "key" && (l[ue] = c[ue]);
} else l = c;
return d && O(
l,
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
), y(t, d, v, R, p(), l);
}
function U(t, c) {
if (typeof t == "object" && t && t.$$typeof !== ii) {
if (g(t))
for (var l = 0; l < t.length; l++) {
var h = t[l];
V(h) && A(h, c);
}
else if (V(t))
t._store && (t._store.validated = 1);
else if (t === null || typeof t != "object" ? l = null : (l = b && t[b] || t["@@iterator"], l = typeof l == "function" ? l : null), typeof l == "function" && l !== t.entries && (l = l.call(t), l !== t))
for (; !(t = l.next()).done; )
V(t.value) && A(t.value, c);
}
}
function V(t) {
return typeof t == "object" && t !== null && t.$$typeof === se;
}
function A(t, c) {
if (t._store && !t._store.validated && t.key == null && (t._store.validated = 1, c = G(c), !Ue[c])) {
Ue[c] = !0;
var l = "";
t && t._owner != null && t._owner !== p() && (l = null, typeof t._owner.tag == "number" ? l = i(t._owner.type) : typeof t._owner.name == "string" && (l = t._owner.name), l = " It was passed a child from " + l + ".");
var h = D.getCurrentStack;
D.getCurrentStack = function() {
var R = m(t.type);
return h && (R += h() || ""), R;
}, console.error(
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
c,
l
), D.getCurrentStack = h;
}
}
function G(t) {
var c = "", l = p();
return l && (l = i(l.type)) && (c = `
Check the render method of \`` + l + "`."), c || (t = i(t)) && (c = `
Check the top-level render call using <` + t + ">."), c;
}
var Z = oi, se = Symbol.for("react.transitional.element"), ae = Symbol.for("react.portal"), X = Symbol.for("react.fragment"), Q = Symbol.for("react.strict_mode"), ce = Symbol.for("react.profiler"), W = Symbol.for("react.consumer"), H = Symbol.for("react.context"), ee = Symbol.for("react.forward_ref"), ie = Symbol.for("react.suspense"), ne = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), b = Symbol.iterator, $ = Symbol.for("react.client.reference"), D = Z.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, k = Object.assign, oe = Symbol.for("react.client.reference"), g = Array.isArray, I = 0, z, le, x, Le, Oe, Ae, _e;
o.__reactDisabledLog = !0;
var be, Be, De = !1, Re = new (typeof WeakMap == "function" ? WeakMap : Map)(), ii = Symbol.for("react.client.reference"), Ge, We = {}, Fe = {}, Ue = {};
ye.Fragment = X, ye.jsx = function(t, c, l, h, R) {
return S(t, c, l, !1, h, R);
}, ye.jsxs = function(t, c, l, h, R) {
return S(t, c, l, !0, h, R);
};
}()), ye;
}
var xe;
function en() {
return xe || (xe = 1, process.env.NODE_ENV === "production" ? Ce.exports = Xi() : Ce.exports = Qi()), Ce.exports;
}
var F = en();
function nn(i, e) {
return e ? Te(i).reduce(
(n, [o, r]) => (ge(e, o) && (n[o] = r), n),
{}
) : {};
}
function Te(i) {
return Object.keys(i).map((e) => [e, i[e]]);
}
function ge(i, e) {
return !!i && i.indexOf(e) !== -1;
}
function tn(i, e) {
return !!i && !!e && [...Object.keys(i), ...Object.keys(e)].every((n) => i[n] === e[n]);
}
function on(i) {
return i && typeof i.isDestroyed == "function" && typeof i.destroy == "function";
}
function rn(i) {
return on(i) && i.isDestroyed();
}
function K(i) {
return i && typeof i == "object" && "then" in i && typeof i.then == "function";
}
const de = "__RESIUM_EVENT_MANAGER", $e = [
"onClick",
"onDoubleClick",
"onMouseDown",
"onMouseUp",
"onMiddleClick",
"onMiddleDown",
"onMiddleUp",
"onMouseMove",
"onPinchEnd",
"onPinchMove",
"onPinchStart",
"onRightClick",
"onRightDown",
"onRightUp",
"onWheel",
"onMouseEnter",
"onMouseLeave"
], Ee = class Ee {
constructor(e) {
Y(this, "scene");
Y(this, "sshe");
Y(this, "events", {
onClick: /* @__PURE__ */ new Map(),
onDoubleClick: /* @__PURE__ */ new Map(),
onMouseDown: /* @__PURE__ */ new Map(),
onMouseUp: /* @__PURE__ */ new Map(),
onMiddleClick: /* @__PURE__ */ new Map(),
onMiddleDown: /* @__PURE__ */ new Map(),
onMiddleUp: /* @__PURE__ */ new Map(),
onMouseMove: /* @__PURE__ */ new Map(),
onPinchEnd: /* @__PURE__ */ new Map(),
onPinchMove: /* @__PURE__ */ new Map(),
onPinchStart: /* @__PURE__ */ new Map(),
onRightClick: /* @__PURE__ */ new Map(),
onRightDown: /* @__PURE__ */ new Map(),
onRightUp: /* @__PURE__ */ new Map(),
onWheel: /* @__PURE__ */ new Map(),
onMouseEnter: /* @__PURE__ */ new Map(),
onMouseLeave: /* @__PURE__ */ new Map()
});
Y(this, "hovered");
Y(this, "onMouseMove", (e) => {
var o, r, s, u, f, m;
const n = this.pick(e.endPosition);
this.hovered !== n && (this.hovered && ((o = this.getEventCallback("onMouseLeave", this.hovered)) == null || o(e, this.hovered), (r = this.getEventCallback("onMouseLeave", null)) == null || r(e, this.hovered)), n && ((s = this.getEventCallback("onMouseEnter", n)) == null || s(e, n), (u = this.getEventCallback("onMouseEnter", null)) == null || u(e, n))), n && ((f = this.getEventCallback("onMouseMove", n)) == null || f(e, n)), (m = this.getEventCallback("onMouseMove", null)) == null || m(e, n), this.hovered = n;
});
Y(this, "eventCallback", (e) => (n) => {
var r, s;
const o = this.pick(n == null ? void 0 : n.position);
o && ((r = this.getEventCallback(e, o)) == null || r(n, o)), (s = this.getEventCallback(e, null)) == null || s(n, o);
});
this.scene = e, this.sshe = new ei(e == null ? void 0 : e.canvas);
}
destroy() {
this.hovered = void 0, this.sshe.isDestroyed() || this.sshe.destroy();
}
isDestroyed() {
return this.sshe.isDestroyed();
}
on(e, n, o) {
e && n === "onWheel" || this.events[n].set(e, o);
}
off(e, n) {
this.events[n].delete(e), this.hovered === e && (this.hovered = void 0);
}
setEvents(e, n) {
Te(n).forEach(([o, r]) => {
const s = o;
ge($e, s) && (r ? this.on(e, s, r) : this.off(e, s));
}), this.commit();
}
clearEvents(e) {
this.hovered = void 0, $e.forEach((n) => {
this.off(e, n);
}), this.commit();
}
commit() {
const e = this.sshe, n = this.sshe.isDestroyed();
n || (this.events.onMouseEnter.size === 0 && this.events.onMouseLeave.size === 0 && this.events.onMouseMove.size === 0 ? this.sshe.removeInputAction(E.MOUSE_MOVE) : this.sshe.getInputAction(E.MOUSE_MOVE) || this.sshe.setInputAction(this.onMouseMove, E.MOUSE_MOVE)), Te(this.events).forEach(([o, r]) => {
if (o === "onMouseEnter" || o === "onMouseLeave" || o === "onMouseMove")
return;
const s = Ee.eventTypeMap[o];
n || (r.size === 0 ? e.removeInputAction(s) : e.getInputAction(s) || e.setInputAction(this.eventCallback(o), s));
});
}
getScreenSpaceEventHandler() {
return this.sshe;
}
getEventCallback(e, n) {
var o, r;
return n === null ? this.events[e].get(null) : this.events[e].get(n.id) || // Entity
this.events[e].get((r = (o = n.id) == null ? void 0 : o.entityCollection) == null ? void 0 : r.owner) || // Entity in DataSource
this.events[e].get(n.primitive) || // Primitive
this.events[e].get(n.tileset);
}
pick(e) {
var n;
if (e)
return (n = this.scene) == null ? void 0 : n.pick(e);
}
};
Y(Ee, "eventTypeMap", {
onClick: E.LEFT_CLICK,
onDoubleClick: E.LEFT_DOUBLE_CLICK,
onMouseDown: E.LEFT_DOWN,
onMouseUp: E.LEFT_UP,
onMiddleClick: E.MIDDLE_CLICK,
onMiddleDown: E.MIDDLE_DOWN,
onMiddleUp: E.MIDDLE_UP,
onMouseMove: E.MOUSE_MOVE,
onPinchEnd: E.PINCH_END,
onPinchMove: E.PINCH_MOVE,
onPinchStart: E.PINCH_START,
onRightClick: E.RIGHT_CLICK,
onRightDown: E.RIGHT_DOWN,
onRightUp: E.RIGHT_UP,
onWheel: E.WHEEL,
onMouseEnter: E.MOUSE_MOVE,
onMouseLeave: E.MOUSE_MOVE
});
let Pe = Ee;
const sn = ({
name: i,
create: e,
destroy: n,
provide: o,
update: r,
cesiumReadonlyProps: s,
cesiumEventProps: u,
otherProps: f,
setCesiumPropsAfterCreate: m,
useCommonEvent: p,
useRootEvent: C
}, O, B) => {
const y = L(void 0), S = we(), U = L(o ? {} : void 0), V = L({}), A = L(qe(O)), G = L({}), [Z, se] = Xe(!1), ae = L(!1), X = L(null), Q = L(void 0), ce = S == null ? void 0 : S[de], W = L(void 0), H = L(void 0), ee = ve(
async (P) => {
var oe;
if (!y.current) return;
const w = y.current, b = Object.keys(P), $ = Object.keys(u || []), D = b.concat(
Object.keys(G.current).filter((g) => !b.includes(g))
).filter((g) => G.current[g] !== P[g]).map((g) => [g, G.current[g], P[g]]), M = [];
for (const [g, I, z] of D)
if (s != null && s.includes(g))
M.push(g);
else if (ge($, g)) {
const le = u == null ? void 0 : u[g], x = w[le];
x instanceof Ve && (typeof I > "u" ? (x.addEventListener(z), V.current[le] = z) : typeof z > "u" ? (x.removeEventListener(I), delete V.current[le]) : (x.removeEventListener(I), x.addEventListener(z)));
} else g !== "children" && !$e.includes(g) && !(f != null && f.includes(g)) && (w[g] = z);
const k = C ? (oe = U.current) == null ? void 0 : oe[de] : ce;
if (p && k && y.current && k.setEvents(C ? null : y.current, P), r && ae.current) {
const g = r(y.current, P, G.current, S);
K(g) && await g;
}
G.current = P, A.current = P, ae.current && M.length > 0 && (process.env.NODE_ENV !== "production" && console.warn(
`Warning: <${i}> is recreated because following read-only props have been updated: ${M.join(
", "
)}`
), ne(), await te(), W.current = ie());
},
[]
// eslint-disable-line react-hooks/exhaustive-deps
), ie = ve(async () => {
var $;
await new Promise((D) => queueMicrotask(() => D(void 0)));
const P = e == null ? void 0 : e(S, A.current, X.current);
let w;
if (K(P) ? w = await P : w = P, Array.isArray(w) ? (y.current = w[0], Q.current = w[1]) : y.current = w, m)
await ee(A.current);
else {
if (y.current && u) {
const D = y.current;
for (const M of Object.keys(A.current)) {
const k = u[M];
if (k) {
const oe = A.current[M], g = D[k];
oe && g instanceof Ve && g.addEventListener(oe);
}
}
}
G.current = A.current;
}
o && y.current && (U.current = {
...S,
...o(y.current, S, O, Q.current)
});
const b = C ? ($ = U.current) == null ? void 0 : $[de] : ce;
p && b && y.current && b.setEvents(C ? null : y.current, A.current), H.current || se(!0);
}, []), ne = ve(() => {
se(!1), ae.current = !1;
}, []), te = ve(async () => {
var w, b;
await new Promise(($) => queueMicrotask(() => $(void 0))), W.current && (await W.current, W.current = void 0), y.current && n && n(y.current, S, X.current, Q.current);
const P = C ? (w = U.current) == null ? void 0 : w[de] : ce;
if (p && P && y.current && P.clearEvents(C ? null : y.current), y.current && !rn(y.current)) {
const $ = Object.keys(V.current);
for (const D of $) {
const M = y.current[D];
(b = M == null ? void 0 : M.removeEventListener) == null || b.call(M, V.current[D]);
}
}
V.current = {}, U.current = void 0, Q.current = void 0, y.current = void 0;
}, []);
return ai(() => ((async () => {
H.current && (await H.current, H.current = void 0), W.current = ie();
})(), () => {
ne(), H.current = te();
}), [ie, te, ne]), me(() => {
(async () => {
var b, $;
W.current && await W.current;
const w = qe(O);
Z ? tn(w, G.current) || (await ee(w), ($ = (b = S.__$internal) == null ? void 0 : b.onUpdate) == null || $.call(b)) : (G.current = w, A.current = w, ae.current = !0);
})();
}, [S.__$internal, Z, O, ee]), ci(
B,
() => ({
cesiumElement: Z ? y.current : null
}),
[Z]
), [U.current, Z, X];
};
function qe(i) {
const { children: e, ...n } = i;
return n;
}
const a = ({
renderContainer: i,
noChildren: e,
containerProps: n,
defaultProps: o,
...r
}) => {
const s = (u, f) => {
const m = {
...o,
...u
}, [p, C, O] = sn(
r,
m,
f
);
if (e) return null;
const B = C && "children" in m ? m.children : null, y = i ? /* @__PURE__ */ F.jsx(
"div",
{
"data-testid": "resium-container",
ref: O,
...typeof n == "function" ? n(m) : nn(m, n),
children: B
}
) : B ? /* @__PURE__ */ F.jsx(F.Fragment, { children: B }) : null;
return p ? /* @__PURE__ */ F.jsx(ke.Provider, { value: p, children: y }) : y;
};
return s.displayName = r.name, Qe(s);
}, an = ["enabled", "selected"], _ = (i) => a({
name: i.name,
create(e, n) {
if (!e.scene) return;
const o = i.create(n, e.scene.postProcessStages);
return typeof n.enabled == "boolean" && (o.enabled = n.enabled), n.selected && "selected" in o && (o.selected = n.selected), i.props.forEach((r) => {
!ge(i.readonlyProps, r) && typeof n[r] < "u" && (o.uniforms[r] = n[r]);
}), !i.noMount && e.scene && !e.scene.isDestroyed() && e.scene.postProcessStages.add(o), o;
},
destroy(e, n) {
i.noMount ? e.enabled = !1 : (n.scene && !n.scene.isDestroyed() && n.scene.postProcessStages.remove(e), e.isDestroyed() || e.destroy());
},
update(e, n, o) {
i.props.forEach((r) => {
!ge(i.readonlyProps, r) && n[r] !== o[r] && (e.uniforms[r] = n[r]);
});
},
cesiumProps: an,
cesiumReadonlyProps: i.readonlyProps,
defaultProps: {
enabled: !0
}
}), Ro = (i) => (
// supports both functional components and class components
// eslint-disable-next-line react/display-name
Qe((e, n) => /* @__PURE__ */ F.jsx(Zi, { children: (o) => /* @__PURE__ */ F.jsx(i, { ...e, ref: n, cesium: o }) }))
), cn = [
"alignedAxis",
"color",
"disableDepthTestDistance",
"distanceDisplayCondition",
"eyeOffset",
"height",
"heightReference",
"horizontalOrigin",
"image",
"pixelOffset",
"splitDirection",
"pixelOffsetScaleByDistance",
"position",
"rotation",
"scale",
"scaleByDistance",
"show",
"sizeInMeters",
"translucencyByDistance",
"verticalOrigin",
"width",
"id"
], Mo = a({
name: "Billboard",
create(i, e) {
var n;
return (n = i.billboardCollection) == null ? void 0 : n.add(e);
},
destroy(i, e) {
e.billboardCollection && !e.billboardCollection.isDestroyed() && e.billboardCollection.remove(i);
},
cesiumProps: cn,
useCommonEvent: !0
}), ln = [
"blendOption",
"debugShowBoundingVolume",
"debugShowTextureAtlas",
"modelMatrix",
"show"
], To = a({
name: "BillboardCollection",
create(i, e) {
if (!i.primitiveCollection) return;
const n = new ui({
modelMatrix: e.modelMatrix,
debugShowBoundingVolume: e.debugShowBoundingVolume,
scene: i.scene,
blendOption: e.blendOption
});
return i.primitiveCollection.add(n), n;
},
destroy(i, e) {
e.primitiveCollection && !e.primitiveCollection.isDestroyed() && e.primitiveCollection.remove(i), i.isDestroyed() || i.destroy();
},
provide(i) {
return {
billboardCollection: i
};
},
cesiumProps: ln
}), un = [
"image",
"show",
"scale",
"horizontalOrigin",
"verticalOrigin",
"eyeOffset",
"pixelOffset",
"rotation",
"alignedAxis",
"splitDirection",
"width",
"height",
"color",
"scaleByDistance",
"translucencyByDistance",
"pixelOffsetScaleByDistance",
"imageSubRegion",
"sizeInMeters",
"heightReference",
"distanceDisplayCondition",
"disableDepthTestDistance"
], dn = {
onDefinitionChange: "definitionChanged"
}, $o = a({
name: "BillboardGraphics",
create(i, e) {
if (!i.entity) return;
const n = new di(e);
return i.entity.billboard = n, n;
},
destroy(i, e) {
e.entity && (e.entity.billboard = void 0);
},
cesiumProps: un,
cesiumEventProps: dn
}), mn = [
"heightReference",
"dimensions",
"show",
"fill",
"material",
"outline",
"outlineColor",
"outlineWidth",
"shadows",
"distanceDisplayCondition"
], fn = {
onDefinitionChange: "definitionChanged"
}, ko = a({
name: "BoxGraphics",
create(i, e) {
if (!i.entity) return;
const n = new mi(e);
return i.entity.box = n, n;
},
destroy(i, e) {
e.entity && (e.entity.box = void 0);
},
cesiumProps: mn,
cesiumEventProps: fn
}), hn = [
"position",
"direction",
"up",
"right",
"frustum",
"defaultMoveAmount",
"defaultLookAmount",
"defaultRotateAmount",
"defaultZoomAmount",
"constrainedAxis",
"maximumZoomFactor",
"percentageChanged"
], yn = {
onChange: "changed",
onMoveEnd: "moveEnd",
onMoveStart: "moveStart"
}, Lo = a({
name: "Camera",
create: (i) => {
var e;
return (e = i.scene) == null ? void 0 : e.camera;
},
cesiumProps: hn,
cesiumEventProps: yn,
setCesiumPropsAfterCreate: !0
}), Oo = Se(
"CameraFlyHome",
(i, { duration: e }) => {
i.flyHome(e);
}
), Ao = Se(
"CameraFlyTo",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(i, { onComplete: e, onCancel: n, ...o }) => {
i.flyTo({ ...o, complete: e, cancel: n });
}
), _o = Se(
"CameraLookAt",
(i, { target: e, offset: n }) => {
i.lookAt(e, n);
}
), Bo = Se(
"CameraFlyToBoundingSphere",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(i, { boundingSphere: e, onComplete: n, onCancel: o, ...r }) => {
i.flyToBoundingSphere(e, {
...r,
complete: n,
cancel: o
});
}
), gn = [
"show",
"modelMatrix",
"shadows",
"maximumScreenSpaceError",
"cullRequestsWhileMoving",
"cullRequestsWhileMovingMultiplier",
"preloadWhenHidden",
"preloadFlightDestinations",
"preferLeaves",
"progressiveResolutionHeightFraction",
"foveatedScreenSpaceError",
"foveatedConeSize",
"foveatedMinimumScreenSpaceErrorRelaxation",
"foveatedInterpolationCallback",
"foveatedTimeDelay",
"dynamicScreenSpaceError",
"dynamicScreenSpaceErrorDensity",
"dynamicScreenSpaceErrorFactor",
"dynamicScreenSpaceErrorHeightFalloff",
"skipLevelOfDetail",
"baseScreenSpaceError",
"skipScreenSpaceErrorFactor",
"skipLevels",
"immediatelyLoadDesiredLevelOfDetail",
"loadSiblings",
"clippingPlanes",
"clippingPolygons",
"classificationType",
"ellipsoid",
"lightColor",
"colorBlendAmount",
"colorBlendMode",
"debugFreezeFrame",
"debugColorizeTiles",
"debugWireframe",
"debugShowBoundingVolume",
"debugShowContentBoundingVolume",
"debugShowViewerRequestVolume",
"debugShowGeometricError",
"debugShowRenderingStatistics",
"debugShowMemoryUsage",
"debugShowUrl",
"style",
"backFaceCulling",
"vectorClassificationOnly",
"vectorKeepDecodedPositions",
"splitDirection",
"customShader",
"imageBasedLighting",
"showCreditsOnScreen",
"featureIdLabel",
"instanceFeatureIdLabel",
"imageBasedLighting",
"outlineColor",
"cacheBytes",
"maximumCacheOverflowBytes",
"enableCollision"
], pn = [
"showOutline",
"cullWithChildrenBounds",
"debugHeatmapTilePropertyName",
"enableDebugWireframe",
"environmentMapOptions",
"modelUpAxis",
"modelForwardAxis",
"projectTo2D",
"enableShowOutline",
"enablePick"
], vn = {
onAllTilesLoad: "allTilesLoaded",
onInitialTilesLoad: "initialTilesLoaded",
onLoadProgress: "loadProgress",
onTileFailed: "tileFailed",
onTileLoad: "tileLoad",
onTileUnload: "tileUnload",
onTileVisible: "tileVisible"
}, Cn = ["onReady", "onError", "url"], Go = a({
name: "Cesium3DTileset",
async create(i, e) {
var s, u;
if (!i.primitiveCollection) return;
const n = e.url;
let o;
K(n) ? o = await n : o = n;
let r;
try {
r = await fi.fromUrl(o, e), (s = e.onReady) == null || s.call(e, r);
} catch (f) {
(u = e.onError) == null || u.call(e, f);
return;
}
return e.colorBlendAmount && (r.colorBlendAmount = e.colorBlendAmount), e.colorBlendMode && (r.colorBlendMode = e.colorBlendMode), e.style && (r.style = e.style), i.primitiveCollection.add(r), r;
},
destroy(i, e) {
e.primitiveCollection && !e.primitiveCollection.isDestroyed() && e.primitiveCollection.remove(i), i.isDestroyed() || i.destroy();
},
cesiumProps: gn,
cesiumReadonlyProps: pn,
cesiumEventProps: vn,
otherProps: Cn,
useCommonEvent: !0
}), Pn = ["show", "uri", "maximumScreenSpaceError"], En = {
onDefinitionChange: "definitionChanged"
}, Wo = a({
name: "Cesium3DTilesetGraphics",
create(i, e) {
if (!i.entity) return;
const n = new hi(e);
return i.entity.tileset = n, n;
},
destroy(i, e) {
e.entity && (e.entity.tileset = void 0);
},
cesiumProps: Pn,
cesiumEventProps: En
}), wn = [
"resolutionScale",
"useDefaultRenderLoop",
"targetFrameRate",
"useBrowserRecommendedResolution",
"creditDisplay"
], Sn = [
"clock",
"baseLayer",
"terrainProvider",
"skyBox",
"skyAtmosphere",
"sceneMode",
"scene3DOnly",
"orderIndependentTranslucency",
"mapMode2D",
"mapProjection",
"globe",
"showRenderLoopErrors",
"contextOptions",
"creditContainer",
"creditViewport",
"shadows",
"terrainShadows",
"ellipsoid",
"dataSources",
"allowDataSourcesToSuspendAnimation",
"trackedEntity",
"trackedEntityChanged",
"clockTrackedDataSource",
"shouldAnimate",
"automaticallyTrackDataSourceClocks",
"terrain",
"requestRenderMode",
"maximumRenderTimeChange",
"msaaSamples",
"blurActiveElementOnCanvasFocus"
], bn = ["className", "id", "style", "full", "containerProps"], Fo = a({
name: "CesiumWidget",
create(i, e, n) {
if (!n) return;
const o = new yi(n, e);
if (!o) return;
typeof e.resolutionScale == "number" && (o.resolutionScale = e.resolutionScale);
const r = new Pe(o.scene);
return [o, r];
},
destroy(i, e, n, o) {
o && !o.isDestroyed() && o.destroy(), i.isDestroyed() || i.destroy();
},
provide(i, e, n, o) {
return {
cesiumWidget: i,
scene: i.scene,
camera: i.scene.camera,
imageryLayerCollection: i.scene.globe.imageryLayers,
primitiveCollection: i.scene.primitives,
globe: i.scene.globe,
__$internal: {
onUpdate: n == null ? void 0 : n.onUpdate
},
[de]: o
};
},
containerProps: ({ id: i, className: e, style: n, full: o, containerProps: r }) => ({
className: e,
id: i,
style: {
...o ? {
position: "absolute",
bottom: "0",
left: "0",
right: "0",
top: "0"
} : {},
...n
},
...r
}),
cesiumProps: wn,
cesiumReadonlyProps: Sn,
otherProps: bn,
renderContainer: !0,
useCommonEvent: !0,
useRootEvent: !0
}), Dn = [
"classificationType",
"debugShowBoundingVolume",
"debugShowShadowVolume",
"show"
], Rn = [
"allowPicking",
"asynchronous",
"compressVertices",
"geometryInstances",
"interleave",
"releaseGeometryInstances",
"vertexCacheOptimize",
"appearance"
], Mn = ["onReady"], Uo = a({
name: "ClassificationPrimitive",
async create(i, e) {
var o;
if (!i.primitiveCollection) return;
const n = new gi(e);
if (e.onReady) {
const r = () => {
var s, u;
n.ready && ((s = e.onReady) == null || s.call(e, n), (u = i.scene) == null || u.postRender.removeEventListener(r));
};
(o = i.scene) == null || o.postRender.addEventListener(r);
}
return i.primitiveCollection.add(n), n;
},
destroy(i, e) {
e.primitiveCollection && !e.primitiveCollection.isDestroyed() && e.primitiveCollection.remove(i), i.isDestroyed() || i.destroy();
},
cesiumProps: Dn,
cesiumReadonlyProps: Rn,
otherProps: Mn,
useCommonEvent: !0
}), Tn = {
onStop: "onStop",
onTick: "onTick"
}, $n = [
"canAnimate",
"clockRange",
"clockStep",
"currentTime",
"multiplier",
"shouldAnimate",
"startTime",
"stopTime"
], Vo = a({
name: "Clock",
create: (i) => {
var e;
return (e = i.cesiumWidget) == null ? void 0 : e.clock;
},
cesiumProps: $n,
cesiumEventProps: Tn,
setCesiumPropsAfterCreate: !0
}), kn = [
"noiseDetail",
"noiseOffset",
"show",
"debugBillboards",
"debugEllipsoids"
], Io = a({
name: "CloudCollection",
create: (i) => {
if (!i.primitiveCollection) return;
const e = new pi();
return i.primitiveCollection.add(e), e;
},
destroy(i, e) {
e.primitiveCollection && !e.primitiveCollection.isDestroyed() && e.primitiveCollection.remove(i), i.isDestroyed() || i.destroy();
},
provide: (i) => ({
cloudCollection: i
}),
cesiumProps: kn,
setCesiumPropsAfterCreate: !0
}), Ln = [
"positions",
"width",
"cornerType",
"height",
"heightReference",
"extrudedHeight",
"extrudedHeightReference",
"show",
"fill",
"material",
"outline",
"outlineColor",
"outlineWidth",
"granularity",
"shadows",
"distanceDisplayCondition",
"zIndex",
"classificationType"
], On = {
onDefinitionChange: "definitionChanged"
}, jo = a({
name: "CorridorGraphics",
create(i, e) {
if (!i.entity) return;
const n = new vi(e);
return e.classificationType && (n.classificationType = e.classificationType), i.entity.corridor = n, n;
},
destroy(i, e) {
e.entity && (e.entity.corridor = void 0);
},
cesiumProps: Ln,
cesiumEventProps: On
}), An = [
"show",
"position",
"scale",
"maximumSize",
"slice",
"brightness",
"color"
], No = a({
name: "CumulusCloud",
create: (i, e) => {
var n;
return (n = i.cloudCollection) == null ? void 0 : n.add(e);
},
destroy(i, e) {
e.cloudCollection && !e.cloudCollection.isDestroyed() && e.cloudCollection.remove(i);
},
cesiumProps: An
}), _n = ["clustering", "name", "show", "clock", "isLoading"], Bn = {
onChange: "changedEvent",
onError: "errorEvent",
onLoading: "loadingEvent"
}, Ho = a({
name: "CustomDataSource",
create(i, e) {
if (!i.dataSourceCollection) return;
const n = new Ci(e.name);
return e.clustering && (n.clustering = e.clustering), typeof e.show == "boolean" && (n.show = e.show), typeof e.clock < "u" && (n.clock = e.clock), i.dataSourceCollection.add(n), n;
},
destroy(i, e) {
e.dataSourceCollection && !e.dataSourceCollection.isDestroyed() && e.dataSourceCollection.remove(i);
},
provide(i) {
return {
entityCollection: i.entities,
dataSource: i
};
},
cesiumProps: _n,
cesiumEventProps: Bn,
useCommonEvent: !0
}), Gn = [
"heightReference",
"length",
"topRadius",
"bottomRadius",
"show",
"fill",
"material",
"outline",
"outlineColor",
"outlineWidth",
"numberOfVerticalLines",
"slices",
"distanceDisplayCondition",
"shadows"
], Wn = {
onDefinitionChange: "definitionChanged"
}, zo = a({
name: "CylinderGraphics",
create(i, e) {
if (!i.entity) return;
const n = new Pi(e);
return i.entity.cylinder = n, n;
},
destroy(i, e) {
e.entity && (e.entity.cylinder = void 0);
},
cesiumProps: Gn,
cesiumEventProps: Wn
}), Fn = ["clustering", "show"], Un = ["name", "sourceUri", "credit"], Vn = {
onChange: "changedEvent",
onError: "errorEvent",
onLoading: "loadingEvent"
}, In = ["onLoad", "data"], Ye = (i, { data: e, onLoad: n, ...o }) => {
e && i.load(e, o).then((r) => {
n && n(r);
});
}, xo = a({
name: "CzmlDataSource",
create(i, e) {
if (!i.dataSourceCollection) return;
const n = new Ei(e.name);
return e.clustering && (n.clustering = e.clustering), typeof e.show == "boolean" && (n.show = e.show), i.dataSourceCollection.add(n), e.data && Ye(n, e), n;
},
update(i, e, n) {
e.data ? n.show !== e.show && (i.show = typeof e.show == "boolean" ? e.show : !0) : i.show = !1, e.data && (n.data !== e.data || n.sourceUri !== e.sourceUri || n.credit !== e.credit) && Ye(i, e);
},
destroy(i, e) {
e.dataSourceCollection && !e.dataSourceCollection.isDestroyed() && e.dataSourceCollection.remove(i);
},
provide(i) {
return {
dataSource: i
};
},
cesiumProps: Fn,
cesiumReadonlyProps: Un,
cesiumEventProps: Vn,
otherProps: In,
useCommonEvent: !0
}), jn = [
"semiMajorAxis",
"semiMinorAxis",
"height",
"heightReference",
"extrudedHeight",
"show",
"fill",
"material",
"outline",
"outlineColor",
"outlineWidth",
"numberOfVerticalLines",
"rotation",
"stRotation",
"granularity",
"shadows",
"distanceDisplayCondition",
"zIndex",
"classificationType",
"extrudedHeightReference"
], Nn = {
onDefinitionChange: "definitionChanged"
}, qo = a({
name: "EllipseGraphics",
create(i, e) {
if (!i.entity) return;
const n = new wi(e);
return i.entity.ellipse = n, n;
},
destroy(i, e) {
e.entity && (e.entity.ellipse = void 0);
},
cesiumProps: jn,
cesiumEventProps: Nn
}), Hn = [
"heightReference",
"radii",
"show",
"fill",
"innerRadii",
"material",
"maximumClock",
"maximumCone",
"minimumClock",
"minimumCone",
"outline",
"outlineColor",
"outlineWidth",
"subdivisions",
"stackPartitions",
"slicePartitions",
"shadows",
"distanceDisplayCondition"
], zn = {
onDefinitionChange: "definitionChanged"
}, Yo = a({
name: "EllipsoidGraphics",
create(i, e) {
if (!i.entity) return;
const n = new Si(e);
return i.entity.ellipsoid = n, n;
},
destroy(i, e) {
e.entity && (e.entity.ellipsoid = void 0);
},
cesiumProps: Hn,
cesiumEventProps: zn
}), xn = [
"availability",
"billboard",
"box",
"corridor",
"cylinder",
"description",
"ellipse",
"ellipsoid",
"entityCollection",
"label",
"model",
"name",
"trackingReferenceFrame",
"orientation",
"path",
"plane",
"parent",
"point",
"polygon",
"polyline",
"polylineVolume",
"position",
"properties",
"rectangle",
"show",
"tileset",
"viewFrom",
"wall"
], qn = ["id"], Yn = {
onDefinitionChange: "definitionChanged"
}, Kn = ["selected", "tracked"], Ko = a({
name: "Entity",
create(i, e) {
if (!i.entityCollection) return;
const n = new bi(e);
return i.viewer && e.selected && (i.viewer.selectedEntity = n), i.viewer && e.tracked && (i.viewer.trackedEntity = n), i.entityCollection.add(n), n;
},
destroy(i, e) {
e.entityCollection && e.entityCollection.remove(i);
},
update(i, e, n, o) {
o.viewer && (e.selected !== n.selected && (e.selected ? o.viewer.selectedEntity = i : o.viewer.selectedEntity === i && (o.viewer.selectedEntity = void 0)), e.tracked !== n.tracked && (e.tracked ? o.viewer.trackedEntity = i : o.viewer.trackedEntity === i && (o.viewer.trackedEntity = void 0)));
},
provide(i, e, n) {
return {
entity: i,
__$internal: {
onUpdate: n == null ? void 0 : n.onUpdate
}
};
},
cesiumProps: xn,
cesiumReadonlyProps: qn,
cesiumEventProps: Yn,
otherProps: Kn,
useCommonEvent: !0
}), Jo = ({
children: i,
container: e,
resizeInfoBox: n = !0
}) => {
const { viewer: o, entity: r } = we(), [s, u] = Xe(!1), f = li(
() => {
var m;
return e ?? ((m = o == null ? void 0 : o.infoBox.frame.contentDocument) == null ? void 0 : m.createElement("div"));
},
[e, o == null ? void 0 : o.infoBox.frame.contentDocument]
);
return me(() => {
if (!o || !r) return;
const m = (p) => {
u(!!p && p.id === r.id);
};
return o.selectedEntityChanged.addEventListener(m), () => {
o.selectedEntityChanged.removeEventListener(m);
};
}, [r, o]), me(() => {
var O, B;
if (e || !f || !o) return;
const m = (O = o.infoBox) == null ? void 0 : O.frame, p = (B = m == null ? void 0 : m.contentDocument) == null ? void 0 : B.querySelector(".cesium-infoBox-description");
if (!m || !p) return;
let C;
if (s) {
if (n) {
const y = p.getBoundingClientRect().height;
m.style.height = y + "px", C = window.setInterval(() => {
const S = o.infoBox.container.querySelector(
".cesium-infoBox.cesium-infoBox-visible"
);
S && (clearInterval(C), C = void 0, p.appendChild(f), S.classList.remove("cesium-infoBox-bodyless"), m.style.height = p.getBoundingClientRect().height + "px");
}, 10);
}
} else f.parentElement === p && p.removeChild(f);
return C ? () => clearTimeout(C) : void 0;
}, [f, e, n, s, o]), f ? /* @__PURE__ */ F.jsx(F.Fragment, { children: Ji(/* @__PURE__ */ F.jsx(F.Fragment, { children: !e || s ? i : null }), f) }) : null;
}, Jn = [
"density",
"enabled",
"minimumBrightness",
"screenSpaceErrorFactor",
"heightScalar",
"maxHeight",
"visualDensityScalar",
"heightFalloff",
"renderable"
], Zo = a({
name: "Fog",
create(i) {
if (!i.scene) return;
const e = new Ie();
return i.scene.fog = e, e;
},
destroy(i, e) {
e.scene && !e.scene.isDestroyed() && (e.scene.fog = new Ie());
},
cesiumProps: Jn,
setCesiumPropsAfterCreate: !0
}), Zn = ["clustering", "name", "show"], Xn = [
"clampToGround",
"sourceUri",
"credit",
"markerSize",
"markerSymbol",
"markerColor",
"stroke",
"strokeWidth",
"fill",
"describe"
], Qn = {
onChange: "changedEvent",
onError: "errorEvent",
onLoading: "loadingEvent"
}, et = ["onLoad", "data"], Ke = (i, { data: e, onLoad: n, ...o }) => {
e && i.load(e, o).then((r) => {
n && n(r);
});
}, Xo = a({
name: "GeoJsonDataSource",
create(i, e) {
if (!i.dataSourceCollection) return;
const n = new Di(e.name);
return e.clustering && (n.clustering = e.clustering), typeof e.show == "boolean" && (n.show = e.show), i.dataSourceCollection.add(n), e.data && Ke(n, e), n;
},
update(i, e, n) {
e.data ? n.show !== e.show && (i.show = typeof e.show == "boolean" ? e.show : !0) : i.show = !1, e.data && (n.data !== e.data || n.clampToGround !== e.clampToGround || n.sourceUri !== e.sourceUri || n.credit !== e.credit || n.markerSize !== e.markerSize || n.markerSymbol !== e.markerSymbol || n.markerColor !== e.markerColor || n.stroke !== e.stroke || n.strokeWidth !== e.strokeWidth || n.fill !== e.fill) && Ke(i, e);
},
destroy(i, e) {
e.dataSourceCollection && !e.dataSourceCollection.isDestroyed() && e.dataSourceCollection.remove(i);
},
provide(i) {
return {
dataSource: i
};
},
cesiumProps: Zn,
cesiumReadonlyProps: Xn,
cesiumEventProps: Qn,
otherProps: et,
useCommonEvent: !0
}), it = {
onImageryLayersUpdate: "imageryLayersUpdatedEvent",
onTerrainProviderChange: "terrainProviderChanged",
onTileLoadProgress: "tileLoadProgressEvent"
}, nt = [
"atmosphereBrightnessShift",
"atmosphereHueShift",
"atmosphereSaturationShift",
"backFaceCulling",
"baseColor",
"clippingPlan