@eyeon/map 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/assets/MapViewer.css +1 -1
  2. package/dist/assets/index.css +1 -1
  3. package/dist/chunks/MapViewer.js +1332 -1091
  4. package/dist/chunks/MapViewer.js.map +1 -1
  5. package/dist/chunks/graph-tools.js +246 -0
  6. package/dist/chunks/graph-tools.js.map +1 -0
  7. package/dist/chunks/stacking.js +885 -780
  8. package/dist/chunks/stacking.js.map +1 -1
  9. package/dist/core/filletPolygon.d.ts +10 -0
  10. package/dist/core/filletPolygon.d.ts.map +1 -0
  11. package/dist/core/import/index.d.ts +4 -0
  12. package/dist/core/import/index.d.ts.map +1 -1
  13. package/dist/core/index.d.ts +3 -0
  14. package/dist/core/index.d.ts.map +1 -1
  15. package/dist/core/index.js +89 -220
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/core/layerStyles.d.ts +16 -0
  18. package/dist/core/layerStyles.d.ts.map +1 -1
  19. package/dist/core/mediaUrl.d.ts +3 -0
  20. package/dist/core/mediaUrl.d.ts.map +1 -0
  21. package/dist/core/outdoorDecoration.d.ts +16 -0
  22. package/dist/core/outdoorDecoration.d.ts.map +1 -0
  23. package/dist/core/routing/graph-tools.d.ts +23 -1
  24. package/dist/core/routing/graph-tools.d.ts.map +1 -1
  25. package/dist/core/routing/pathfinding.d.ts.map +1 -1
  26. package/dist/core/types.d.ts +5 -1
  27. package/dist/core/types.d.ts.map +1 -1
  28. package/dist/editor/MapEditor.d.ts +1 -1
  29. package/dist/editor/MapEditor.d.ts.map +1 -1
  30. package/dist/editor/canvas/EditorCanvas.d.ts +45 -7
  31. package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
  32. package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts +7 -0
  33. package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts.map +1 -0
  34. package/dist/editor/canvas/coords.d.ts +30 -0
  35. package/dist/editor/canvas/coords.d.ts.map +1 -1
  36. package/dist/editor/canvas/editorFill.d.ts +10 -0
  37. package/dist/editor/canvas/editorFill.d.ts.map +1 -0
  38. package/dist/editor/canvas/editorHover.d.ts +14 -0
  39. package/dist/editor/canvas/editorHover.d.ts.map +1 -0
  40. package/dist/editor/canvas/underlayHint.d.ts +5 -0
  41. package/dist/editor/canvas/underlayHint.d.ts.map +1 -0
  42. package/dist/editor/connectorAssignments.d.ts +64 -0
  43. package/dist/editor/connectorAssignments.d.ts.map +1 -0
  44. package/dist/editor/draftOps.d.ts +4 -1
  45. package/dist/editor/draftOps.d.ts.map +1 -1
  46. package/dist/editor/editorSectionReturn.d.ts +12 -0
  47. package/dist/editor/editorSectionReturn.d.ts.map +1 -0
  48. package/dist/editor/floorsListReturn.d.ts +5 -0
  49. package/dist/editor/floorsListReturn.d.ts.map +1 -0
  50. package/dist/editor/geometryEdit.d.ts +23 -3
  51. package/dist/editor/geometryEdit.d.ts.map +1 -1
  52. package/dist/editor/hexColor.d.ts +4 -0
  53. package/dist/editor/hexColor.d.ts.map +1 -0
  54. package/dist/editor/history.d.ts +31 -0
  55. package/dist/editor/history.d.ts.map +1 -0
  56. package/dist/editor/index.css +270 -52
  57. package/dist/editor/index.d.ts +4 -4
  58. package/dist/editor/index.d.ts.map +1 -1
  59. package/dist/editor/index.js +5746 -1678
  60. package/dist/editor/index.js.map +1 -1
  61. package/dist/editor/labelText.d.ts +15 -0
  62. package/dist/editor/labelText.d.ts.map +1 -0
  63. package/dist/editor/panels/ConnectorAssign.d.ts +12 -0
  64. package/dist/editor/panels/ConnectorAssign.d.ts.map +1 -0
  65. package/dist/editor/panels/FloorsPanel.d.ts +4 -0
  66. package/dist/editor/panels/FloorsPanel.d.ts.map +1 -1
  67. package/dist/editor/panels/ImportReviewPanel.d.ts.map +1 -1
  68. package/dist/editor/panels/Inspector.d.ts +3 -2
  69. package/dist/editor/panels/Inspector.d.ts.map +1 -1
  70. package/dist/editor/panels/LeftRail.d.ts +9 -7
  71. package/dist/editor/panels/LeftRail.d.ts.map +1 -1
  72. package/dist/editor/pathRings.d.ts +79 -0
  73. package/dist/editor/pathRings.d.ts.map +1 -0
  74. package/dist/editor/portalSurface.d.ts +29 -3
  75. package/dist/editor/portalSurface.d.ts.map +1 -1
  76. package/dist/editor/railAssignments.d.ts +22 -0
  77. package/dist/editor/railAssignments.d.ts.map +1 -0
  78. package/dist/editor/routeStubs.d.ts +103 -0
  79. package/dist/editor/routeStubs.d.ts.map +1 -0
  80. package/dist/editor/snapPoint.d.ts +5 -0
  81. package/dist/editor/snapPoint.d.ts.map +1 -0
  82. package/dist/editor/splitJoin.d.ts +78 -0
  83. package/dist/editor/splitJoin.d.ts.map +1 -0
  84. package/dist/editor/tools.d.ts +35 -6
  85. package/dist/editor/tools.d.ts.map +1 -1
  86. package/dist/test-maps/shops-at-south-town/BASE - Shops At South Town.ai +6326 -6407
  87. package/dist/test-maps/shops-at-south-town/LF - Shops At South Town.ai +458 -484
  88. package/dist/test-maps/shops-at-south-town/SVG/BASE - Shops At South Town.svg +6 -6
  89. package/dist/test-maps/shops-at-south-town/SVG/LF - Shops At South Town.svg +52 -52
  90. package/dist/test-maps/shops-at-south-town/SVG/UF - Shops At South Town.svg +74 -74
  91. package/dist/test-maps/shops-at-south-town/UF - Shops At South Town.ai +341 -436
  92. package/dist/ui/ModernSelect.d.ts +14 -0
  93. package/dist/ui/ModernSelect.d.ts.map +1 -0
  94. package/dist/ui/selectSearch.d.ts +9 -0
  95. package/dist/ui/selectSearch.d.ts.map +1 -0
  96. package/dist/viewer/camera.d.ts +3 -0
  97. package/dist/viewer/camera.d.ts.map +1 -1
  98. package/dist/viewer/components/CameraRig.d.ts.map +1 -1
  99. package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
  100. package/dist/viewer/components/MapScene.d.ts.map +1 -1
  101. package/dist/viewer/components/SvgVectorLayer.d.ts +2 -2
  102. package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -1
  103. package/dist/viewer/index.css +115 -5
  104. package/dist/viewer/index.d.ts +1 -1
  105. package/dist/viewer/index.d.ts.map +1 -1
  106. package/dist/viewer/index.js +3 -3
  107. package/dist/viewer/ui/MapControls.d.ts +11 -3
  108. package/dist/viewer/ui/MapControls.d.ts.map +1 -1
  109. package/dist/viewer/ui/RuntimeChrome.d.ts.map +1 -1
  110. package/package.json +1 -1
@@ -1,124 +1,371 @@
1
- import { jsx as _, jsxs as ne, Fragment as We } from "react/jsx-runtime";
2
- import { useMemo as ie, useState as ue, useEffect as me, useRef as Ae, useCallback as _e, useImperativeHandle as qe, Suspense as Xe } from "react";
3
- import { f as Ye, N as $e, Q as Oe, V as ve, a7 as Ze, ae as Qe, r as Ke, U as Me, H as Je, a8 as et, a0 as Ge, z as De, v as Te, y as tt, X as nt, E as ot } from "./stacking.js";
4
- import { useThree as rt, Canvas as st } from "@react-three/fiber";
5
- import { OrthographicCamera as it, OrbitControls as at } from "@react-three/drei";
6
- import * as fe from "three";
7
- import { Loader as ct, FileLoader as lt, Matrix3 as ye, Vector2 as Q, Vector3 as ke, Box2 as ut, ShapeUtils as ft, Shape as ht, Path as Ne, BufferGeometry as mt, Float32BufferAttribute as Ee, SRGBColorSpace as dt, ShapePath as pe } from "three";
8
- function pt(u, a, A) {
9
- if (A) return A;
10
- switch (u) {
1
+ import { jsx as R, jsxs as te, Fragment as Ye } from "react/jsx-runtime";
2
+ import { useRef as he, useState as ae, useMemo as re, useCallback as be, useEffect as le, useImperativeHandle as $e, Suspense as Ze } from "react";
3
+ import { B as Qe, ad as Ke, d as Je, ac as We, x as et, E as tt, W as nt, J as ot, T as rt, R as st, M as Oe, U as _e, ab as it, am as at, l as ct, Q as Ne, af as lt, a2 as Be, t as De, al as Te, s as ut, Y as ft, z as mt } from "./stacking.js";
4
+ import { useThree as ht, Canvas as dt } from "@react-three/fiber";
5
+ import { Text as pt, OrthographicCamera as yt, OrbitControls as gt } from "@react-three/drei";
6
+ import * as ue from "three";
7
+ import { Loader as bt, FileLoader as xt, Matrix3 as ge, Vector2 as Q, Vector3 as Ae, Box2 as wt, ShapeUtils as kt, Shape as At, Path as Ee, BufferGeometry as Mt, Float32BufferAttribute as Ce, SRGBColorSpace as It, ShapePath as ye } from "three";
8
+ import { createPortal as Nt } from "react-dom";
9
+ function Tt({
10
+ levels: l,
11
+ activeLevelId: i,
12
+ onActiveLevelChange: M,
13
+ onZoomIn: I,
14
+ onZoomOut: N,
15
+ onReset: h,
16
+ showFloors: B = !0,
17
+ showZoomReset: W = !0,
18
+ floorOptions: p,
19
+ alwaysShowFloors: k = !1
20
+ }) {
21
+ const z = p ?? Qe(l), O = B && (k ? z.length > 0 : Ke(l));
22
+ return !O && !W ? null : /* @__PURE__ */ R("div", { className: "eyeon-map-controls", children: /* @__PURE__ */ te("div", { className: "eyeon-map-controls__stack", children: [
23
+ O && /* @__PURE__ */ R("div", { className: "eyeon-map-controls__floors", role: "tablist", "aria-label": "Floors", children: z.map((C) => {
24
+ const V = C.id === i;
25
+ return /* @__PURE__ */ R(
26
+ "button",
27
+ {
28
+ type: "button",
29
+ role: "tab",
30
+ "aria-selected": V,
31
+ className: V ? "eyeon-map-controls__floor is-active" : "eyeon-map-controls__floor",
32
+ onClick: () => M(C.id),
33
+ children: C.name
34
+ },
35
+ C.id
36
+ );
37
+ }) }),
38
+ W && /* @__PURE__ */ te(Ye, { children: [
39
+ /* @__PURE__ */ R(
40
+ "button",
41
+ {
42
+ type: "button",
43
+ className: "eyeon-map-controls__reset",
44
+ onClick: h,
45
+ "aria-label": "Reset map",
46
+ children: "Reset"
47
+ }
48
+ ),
49
+ /* @__PURE__ */ te("div", { className: "eyeon-map-controls__zoom", children: [
50
+ /* @__PURE__ */ R(
51
+ "button",
52
+ {
53
+ type: "button",
54
+ className: "eyeon-map-controls__zoom-btn",
55
+ onClick: N,
56
+ "aria-label": "Zoom out",
57
+ children: "−"
58
+ }
59
+ ),
60
+ /* @__PURE__ */ R(
61
+ "button",
62
+ {
63
+ type: "button",
64
+ className: "eyeon-map-controls__zoom-btn",
65
+ onClick: I,
66
+ "aria-label": "Zoom in",
67
+ children: "+"
68
+ }
69
+ )
70
+ ] })
71
+ ] })
72
+ ] }) });
73
+ }
74
+ const Et = 8;
75
+ function Ct(l, i) {
76
+ const M = i.trim().toLowerCase();
77
+ return M ? l.filter((I) => I.label.toLowerCase().includes(M)) : l;
78
+ }
79
+ function St(l, i) {
80
+ return i ?? l >= Et;
81
+ }
82
+ function Ge({
83
+ value: l,
84
+ options: i,
85
+ onChange: M,
86
+ disabled: I = !1,
87
+ placeholder: N = "Select…",
88
+ searchable: h,
89
+ ariaLabel: B
90
+ }) {
91
+ const W = he(null), p = he(null), k = he(null), z = he(null), [O, C] = ae(!1), [V, P] = ae(""), [g, u] = ae(null), E = St(i.length, h), y = i.find((w) => w.value === l), m = re(
92
+ () => Ct(i, V),
93
+ [i, V]
94
+ ), v = be(() => {
95
+ C(!1), P("");
96
+ }, []), U = be(() => {
97
+ const w = p.current;
98
+ if (!w) return;
99
+ const T = w.getBoundingClientRect(), _ = window.innerHeight - T.bottom - 8, q = T.top - 8, Y = Math.min(280, Math.max(_, q, 120)), G = _ < 160 && q > _;
100
+ u({
101
+ top: G ? Math.max(8, T.top - Y - 4) : T.bottom + 4,
102
+ left: T.left,
103
+ width: Math.max(T.width, 160),
104
+ maxHeight: Y
105
+ });
106
+ }, []);
107
+ le(() => {
108
+ if (!O) {
109
+ u(null);
110
+ return;
111
+ }
112
+ U();
113
+ const w = (q) => {
114
+ var G, K;
115
+ const Y = q.target;
116
+ (G = W.current) != null && G.contains(Y) || (K = k.current) != null && K.contains(Y) || v();
117
+ }, T = (q) => {
118
+ q.key === "Escape" && v();
119
+ }, _ = () => U();
120
+ return document.addEventListener("mousedown", w), document.addEventListener("keydown", T), window.addEventListener("resize", _), window.addEventListener("scroll", _, !0), () => {
121
+ document.removeEventListener("mousedown", w), document.removeEventListener("keydown", T), window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
122
+ };
123
+ }, [O, v, U]), le(() => {
124
+ !O || !E || requestAnimationFrame(() => {
125
+ var w;
126
+ return (w = z.current) == null ? void 0 : w.focus();
127
+ });
128
+ }, [O, E]);
129
+ const d = O && g && !I ? Nt(
130
+ /* @__PURE__ */ te(
131
+ "div",
132
+ {
133
+ ref: k,
134
+ className: "eyeon-map-select__menu",
135
+ role: "listbox",
136
+ "aria-label": B,
137
+ style: {
138
+ top: g.top,
139
+ left: g.left,
140
+ width: g.width,
141
+ maxHeight: g.maxHeight
142
+ },
143
+ children: [
144
+ E ? /* @__PURE__ */ R(
145
+ "input",
146
+ {
147
+ ref: z,
148
+ className: "eyeon-map-select__search",
149
+ type: "search",
150
+ placeholder: "Search…",
151
+ value: V,
152
+ "aria-label": "Search options",
153
+ onChange: (w) => P(w.target.value),
154
+ onKeyDown: (w) => w.stopPropagation()
155
+ }
156
+ ) : null,
157
+ /* @__PURE__ */ R("ul", { className: "eyeon-map-select__list", children: m.length === 0 ? /* @__PURE__ */ R("li", { className: "eyeon-map-select__empty", children: "No matches" }) : m.map((w) => {
158
+ const T = w.value === l;
159
+ return /* @__PURE__ */ R("li", { role: "option", "aria-selected": T, children: /* @__PURE__ */ R(
160
+ "button",
161
+ {
162
+ type: "button",
163
+ className: T ? "eyeon-map-select__option is-active" : "eyeon-map-select__option",
164
+ onMouseDown: (_) => _.preventDefault(),
165
+ onClick: () => {
166
+ M(w.value), v();
167
+ },
168
+ children: w.label
169
+ }
170
+ ) }, w.value);
171
+ }) })
172
+ ]
173
+ }
174
+ ),
175
+ document.body
176
+ ) : null;
177
+ return /* @__PURE__ */ te("div", { ref: W, className: "eyeon-map-select", children: [
178
+ /* @__PURE__ */ te(
179
+ "button",
180
+ {
181
+ ref: p,
182
+ type: "button",
183
+ className: "eyeon-map-select__trigger",
184
+ "aria-label": B,
185
+ "aria-expanded": O,
186
+ "aria-haspopup": "listbox",
187
+ disabled: I,
188
+ onClick: () => {
189
+ I || C((w) => !w);
190
+ },
191
+ children: [
192
+ /* @__PURE__ */ R("span", { className: y ? void 0 : "eyeon-map-select__placeholder", children: (y == null ? void 0 : y.label) ?? N }),
193
+ /* @__PURE__ */ R(
194
+ "svg",
195
+ {
196
+ className: "eyeon-map-select__chevron",
197
+ width: "12",
198
+ height: "12",
199
+ viewBox: "0 0 12 12",
200
+ "aria-hidden": !0,
201
+ children: /* @__PURE__ */ R(
202
+ "path",
203
+ {
204
+ d: "M2.5 4.5 6 8l3.5-3.5",
205
+ fill: "none",
206
+ stroke: "currentColor",
207
+ strokeWidth: "1.5",
208
+ strokeLinecap: "round",
209
+ strokeLinejoin: "round"
210
+ }
211
+ )
212
+ }
213
+ )
214
+ ]
215
+ }
216
+ ),
217
+ d
218
+ ] });
219
+ }
220
+ function vt(l, i, M) {
221
+ if (l === "walkable") return nt;
222
+ if (M) return M;
223
+ switch (l) {
11
224
  case "unit":
12
- return a.STORE_DEFAULT_COLOR;
13
- case "walkable":
14
- return a.WALKABLE_COLOR;
225
+ return i.STORE_DEFAULT_COLOR;
15
226
  case "wall":
16
227
  case "boundary":
17
- return a.WALL_COLOR;
228
+ return i.WALL_COLOR;
18
229
  case "parking_zone":
19
- return a.PARKING_ZONE_COLOR;
230
+ return i.PARKING_ZONE_COLOR;
20
231
  case "green_area":
21
- return a.GREEN_AREA_COLOR;
232
+ return i.GREEN_AREA_COLOR;
22
233
  case "water":
23
- return a.WATER_COLOR;
234
+ return i.WATER_COLOR;
24
235
  case "floorplate":
25
- return a.BASE_COLOR;
236
+ return i.BASE_COLOR;
26
237
  case "void":
27
238
  return "#00000000";
28
239
  default:
29
240
  return "#e2e8f0";
30
241
  }
31
242
  }
32
- function yt(u) {
33
- if (u.length < 3) return null;
34
- const a = new fe.Shape();
35
- a.moveTo(u[0].x, u[0].y);
36
- for (let A = 1; A < u.length; A++)
37
- a.lineTo(u[A].x, u[A].y);
38
- return a.closePath(), a;
243
+ function Ot(l) {
244
+ if (l.length < 3) return null;
245
+ const i = new ue.Shape();
246
+ i.moveTo(l[0].x, l[0].y);
247
+ for (let M = 1; M < l.length; M++)
248
+ i.lineTo(l[M].x, l[M].y);
249
+ return i.closePath(), i;
39
250
  }
40
- function gt({
41
- level: u,
42
- theme: a,
43
- is3d: A,
44
- selectedRetailerId: M,
45
- onSelectShape: I,
251
+ function _t({
252
+ level: l,
253
+ theme: i,
254
+ is3d: M,
255
+ selectedRetailerId: I,
256
+ onSelectShape: N,
46
257
  interactiveOnly: h = !1
47
258
  }) {
48
- const v = ie(() => u.shapes.filter((x) => x.kind !== "void").filter((x) => !h || Ye.includes(x.kind)).filter((x) => !x.orphanedAt).map((x) => {
49
- var W;
50
- const T = x.geometry.polygons.map(yt).filter((N) => N != null);
51
- if (T.length === 0) return null;
52
- const H = M != null && ((W = x.assignment) == null ? void 0 : W.retailerId) === M, G = H ? a.ACCENT_COLOR : pt(x.kind, a, x.style.fill), E = A && (x.kind === "unit" || x.kind === "wall") ? x.style.extrudeHeight ?? (x.kind === "unit" ? a.STORE_HEIGHT : 2) : 0;
53
- return { shape: x, threeShapes: T, color: G, extrude: E, selected: H };
54
- }).filter(Boolean), [u, a, A, M, h]);
55
- return /* @__PURE__ */ _("group", { children: v.map(({ shape: x, threeShapes: q, color: T, extrude: H, selected: G }) => /* @__PURE__ */ _("group", { children: q.map((E, W) => /* @__PURE__ */ ne(
56
- "mesh",
57
- {
58
- position: [0, 0, x.zIndex * 0.01],
59
- onClick: (N) => {
60
- N.stopPropagation(), (x.kind === "unit" || x.kind === "amenity" || x.kind === "kiosk_screen" || x.kind === "entrance" || x.kind === "parking_zone") && (I == null || I(x.id));
61
- },
62
- children: [
63
- H > 0 ? /* @__PURE__ */ _(
64
- "extrudeGeometry",
65
- {
66
- args: [
67
- E,
68
- { depth: H, bevelEnabled: !1 }
69
- ]
70
- }
71
- ) : /* @__PURE__ */ _("shapeGeometry", { args: [E] }),
72
- /* @__PURE__ */ _(
73
- "meshBasicMaterial",
74
- {
75
- color: T,
76
- transparent: x.style.transparent || x.kind === "amenity",
77
- opacity: x.style.opacity ?? (x.kind === "amenity" ? 0.01 : 1),
78
- side: fe.DoubleSide
79
- }
80
- ),
81
- G && /* @__PURE__ */ ne("lineSegments", { children: [
82
- /* @__PURE__ */ _(
83
- "edgesGeometry",
259
+ const B = re(() => l.shapes.filter((p) => p.kind !== "void").filter((p) => {
260
+ var k, z;
261
+ return !(p.kind === "label" && ((z = (k = p.label) == null ? void 0 : k.text) != null && z.trim()));
262
+ }).filter(
263
+ (p) => {
264
+ var k, z;
265
+ return !h || Je.includes(p.kind) || p.kind === "label" && !!((z = (k = p.label) == null ? void 0 : k.text) != null && z.trim()) || p.kind === "walkable" && !We(p.sourceSvgId);
266
+ }
267
+ ).filter((p) => !p.orphanedAt).map((p) => {
268
+ var g;
269
+ const k = p.kind === "unit" ? i.STORE_RADIUS : 0, O = p.geometry.polygons.map(
270
+ (u) => k > 0 ? et(u, k) : u
271
+ ).map(Ot).filter((u) => u != null);
272
+ if (O.length === 0) return null;
273
+ const C = I != null && ((g = p.assignment) == null ? void 0 : g.retailerId) === I, V = C ? i.ACCENT_COLOR : vt(p.kind, i, p.style.fill), P = M && (p.kind === "unit" || p.kind === "wall") ? p.style.extrudeHeight ?? (p.kind === "unit" ? i.STORE_HEIGHT : 2) : 0;
274
+ return { shape: p, threeShapes: O, color: V, extrude: P, selected: C };
275
+ }).filter(Boolean), [l, i, M, I, h]), W = re(
276
+ () => l.shapes.filter(
277
+ (p) => {
278
+ var k, z;
279
+ return !p.orphanedAt && p.kind === "label" && !!((z = (k = p.label) == null ? void 0 : k.text) != null && z.trim());
280
+ }
281
+ ),
282
+ [l.shapes]
283
+ );
284
+ return /* @__PURE__ */ te("group", { children: [
285
+ W.map((p) => {
286
+ const k = tt(p.geometry);
287
+ return /* @__PURE__ */ R(
288
+ pt,
289
+ {
290
+ position: [k.minX, k.maxY, 0.15],
291
+ fontSize: p.label.size ?? 24,
292
+ color: p.label.color ?? i.STORE_TEXT_COLOR,
293
+ anchorX: "left",
294
+ anchorY: "bottom",
295
+ scale: [1, -1, 1],
296
+ children: p.label.text
297
+ },
298
+ `label-${p.id}`
299
+ );
300
+ }),
301
+ B.map(({ shape: p, threeShapes: k, color: z, extrude: O, selected: C }) => /* @__PURE__ */ R("group", { children: k.map((V, P) => /* @__PURE__ */ te(
302
+ "mesh",
303
+ {
304
+ position: [0, 0, p.zIndex * 0.01],
305
+ onClick: (g) => {
306
+ g.stopPropagation(), (p.kind === "unit" || p.kind === "amenity" || p.kind === "kiosk_screen" || p.kind === "entrance" || p.kind === "parking_zone") && (N == null || N(p.id));
307
+ },
308
+ children: [
309
+ O > 0 ? /* @__PURE__ */ R(
310
+ "extrudeGeometry",
84
311
  {
85
312
  args: [
86
- H > 0 ? new fe.ExtrudeGeometry(E, {
87
- depth: H,
88
- bevelEnabled: !1
89
- }) : new fe.ShapeGeometry(E)
313
+ V,
314
+ { depth: O, bevelEnabled: !1 }
90
315
  ]
91
316
  }
317
+ ) : /* @__PURE__ */ R("shapeGeometry", { args: [V] }),
318
+ /* @__PURE__ */ R(
319
+ "meshBasicMaterial",
320
+ {
321
+ color: z,
322
+ transparent: p.style.transparent || p.kind === "amenity",
323
+ opacity: p.style.opacity ?? (p.kind === "amenity" ? 0.01 : 1),
324
+ side: ue.DoubleSide
325
+ }
92
326
  ),
93
- /* @__PURE__ */ _("lineBasicMaterial", { color: a.ACCENT_COLOR })
94
- ] })
95
- ]
96
- },
97
- `${x.id}-${W}`
98
- )) }, x.id)) });
327
+ C && /* @__PURE__ */ te("lineSegments", { children: [
328
+ /* @__PURE__ */ R(
329
+ "edgesGeometry",
330
+ {
331
+ args: [
332
+ O > 0 ? new ue.ExtrudeGeometry(V, {
333
+ depth: O,
334
+ bevelEnabled: !1
335
+ }) : new ue.ShapeGeometry(V)
336
+ ]
337
+ }
338
+ ),
339
+ /* @__PURE__ */ R("lineBasicMaterial", { color: i.ACCENT_COLOR })
340
+ ] })
341
+ ]
342
+ },
343
+ `${p.id}-${P}`
344
+ )) }, p.id))
345
+ ] });
99
346
  }
100
- function bt({
101
- route: u,
102
- activeLevelId: a,
103
- color: A
347
+ function Pt({
348
+ route: l,
349
+ activeLevelId: i,
350
+ color: M
104
351
  }) {
105
- const M = ie(() => u.points.filter((h) => a == null || h.levelId === a).map((h) => new fe.Vector3(h.x, h.y, 2)), [u, a]);
106
- if (M.length < 2) return null;
107
- const I = new fe.CatmullRomCurve3(M);
108
- return /* @__PURE__ */ ne("mesh", { children: [
109
- /* @__PURE__ */ _("tubeGeometry", { args: [I, Math.max(M.length * 4, 8), 1.5, 8, !1] }),
110
- /* @__PURE__ */ _("meshBasicMaterial", { color: A })
352
+ const I = re(() => l.points.filter((h) => i == null || h.levelId === i).map((h) => new ue.Vector3(h.x, h.y, 2)), [l, i]);
353
+ if (I.length < 2) return null;
354
+ const N = new ue.CatmullRomCurve3(I);
355
+ return /* @__PURE__ */ te("mesh", { children: [
356
+ /* @__PURE__ */ R("tubeGeometry", { args: [N, Math.max(I.length * 4, 8), 1.5, 8, !1] }),
357
+ /* @__PURE__ */ R("meshBasicMaterial", { color: M })
111
358
  ] });
112
359
  }
113
- const xt = dt;
114
- class Ie extends ct {
360
+ const Rt = It;
361
+ class Me extends bt {
115
362
  /**
116
363
  * Constructs a new SVG loader.
117
364
  *
118
365
  * @param {LoadingManager} [manager] - The loading manager.
119
366
  */
120
- constructor(a) {
121
- super(a), this.defaultDPI = 90, this.defaultUnit = "px";
367
+ constructor(i) {
368
+ super(i), this.defaultDPI = 90, this.defaultUnit = "px";
122
369
  }
123
370
  /**
124
371
  * Starts loading from the given URL and passes the loaded SVG asset
@@ -129,15 +376,15 @@ class Ie extends ct {
129
376
  * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
130
377
  * @param {onErrorCallback} onError - Executed when errors occur.
131
378
  */
132
- load(a, A, M, I) {
133
- const h = this, v = new lt(h.manager);
134
- v.setPath(h.path), v.setRequestHeader(h.requestHeader), v.setWithCredentials(h.withCredentials), v.load(a, function(x) {
379
+ load(i, M, I, N) {
380
+ const h = this, B = new xt(h.manager);
381
+ B.setPath(h.path), B.setRequestHeader(h.requestHeader), B.setWithCredentials(h.withCredentials), B.load(i, function(W) {
135
382
  try {
136
- A(h.parse(x));
137
- } catch (q) {
138
- I ? I(q) : console.error(q), h.manager.itemError(a);
383
+ M(h.parse(W));
384
+ } catch (p) {
385
+ N ? N(p) : console.error(p), h.manager.itemError(i);
139
386
  }
140
- }, M, I);
387
+ }, I, N);
141
388
  }
142
389
  /**
143
390
  * Parses the given SVG data and returns the resulting data.
@@ -146,94 +393,94 @@ class Ie extends ct {
146
393
  * @return {{paths:Array<ShapePath>,xml:string}} An object holding an array of shape paths and the
147
394
  * SVG XML document.
148
395
  */
149
- parse(a) {
150
- const A = this;
151
- function M(r, o) {
396
+ parse(i) {
397
+ const M = this;
398
+ function I(r, o) {
152
399
  if (r.nodeType !== 1) return;
153
- const t = S(r);
400
+ const t = v(r);
154
401
  let e = !1, c = null;
155
402
  switch (r.nodeName) {
156
403
  case "svg":
157
- o = N(r, o);
404
+ o = P(r, o);
158
405
  break;
159
406
  case "style":
160
407
  h(r);
161
408
  break;
162
409
  case "g":
163
- o = N(r, o);
410
+ o = P(r, o);
164
411
  break;
165
412
  case "path":
166
- o = N(r, o), r.hasAttribute("d") && (c = I(r));
413
+ o = P(r, o), r.hasAttribute("d") && (c = N(r));
167
414
  break;
168
415
  case "rect":
169
- o = N(r, o), c = q(r);
416
+ o = P(r, o), c = p(r);
170
417
  break;
171
418
  case "polygon":
172
- o = N(r, o), c = T(r);
419
+ o = P(r, o), c = k(r);
173
420
  break;
174
421
  case "polyline":
175
- o = N(r, o), c = H(r);
422
+ o = P(r, o), c = z(r);
176
423
  break;
177
424
  case "circle":
178
- o = N(r, o), c = G(r);
425
+ o = P(r, o), c = O(r);
179
426
  break;
180
427
  case "ellipse":
181
- o = N(r, o), c = E(r);
428
+ o = P(r, o), c = C(r);
182
429
  break;
183
430
  case "line":
184
- o = N(r, o), c = W(r);
431
+ o = P(r, o), c = V(r);
185
432
  break;
186
433
  case "defs":
187
434
  e = !0;
188
435
  break;
189
436
  case "use":
190
- o = N(r, o);
191
- const w = (r.getAttributeNS("http://www.w3.org/1999/xlink", "href") || "").substring(1), C = r.viewportElement.getElementById(w);
192
- C ? M(C, o) : console.warn("SVGLoader: 'use node' references non-existent node id: " + w);
437
+ o = P(r, o);
438
+ const S = (r.getAttributeNS("http://www.w3.org/1999/xlink", "href") || "").substring(1), L = r.viewportElement.getElementById(S);
439
+ L ? I(L, o) : console.warn("SVGLoader: 'use node' references non-existent node id: " + S);
193
440
  break;
194
441
  }
195
- c && (o.fill !== void 0 && o.fill !== "none" && c.color.setStyle(o.fill, xt), m(c, se), V.push(c), c.userData = { node: r, style: o });
196
- const y = r.childNodes;
197
- for (let i = 0; i < y.length; i++) {
198
- const w = y[i];
199
- e && w.nodeName !== "style" && w.nodeName !== "defs" || M(w, o);
442
+ c && (o.fill !== void 0 && o.fill !== "none" && c.color.setStyle(o.fill, Rt), d(c, ie), G.push(c), c.userData = { node: r, style: o });
443
+ const b = r.childNodes;
444
+ for (let a = 0; a < b.length; a++) {
445
+ const S = b[a];
446
+ e && S.nodeName !== "style" && S.nodeName !== "defs" || I(S, o);
200
447
  }
201
- t && ($.pop(), $.length > 0 ? se.copy($[$.length - 1]) : se.identity());
448
+ t && (Z.pop(), Z.length > 0 ? ie.copy(Z[Z.length - 1]) : ie.identity());
202
449
  }
203
- function I(r) {
204
- const o = new pe(), t = new Q(), e = new Q(), c = new Q();
205
- let y = !0, i = !1;
206
- const w = r.getAttribute("d");
207
- if (w === "" || w === "none") return null;
208
- const C = w.match(/[a-df-z][^a-df-z]*/ig);
209
- for (let O = 0, l = C.length; O < l; O++) {
210
- const b = C[O], L = b.charAt(0), D = b.slice(1).trim();
211
- y === !0 && (i = !0, y = !1);
450
+ function N(r) {
451
+ const o = new ye(), t = new Q(), e = new Q(), c = new Q();
452
+ let b = !0, a = !1;
453
+ const S = r.getAttribute("d");
454
+ if (S === "" || S === "none") return null;
455
+ const L = S.match(/[a-df-z][^a-df-z]*/ig);
456
+ for (let D = 0, f = L.length; D < f; D++) {
457
+ const A = L[D], F = A.charAt(0), j = A.slice(1).trim();
458
+ b === !0 && (a = !0, b = !1);
212
459
  let s;
213
- switch (L) {
460
+ switch (F) {
214
461
  case "M":
215
- s = f(D);
216
- for (let n = 0, B = s.length; n < B; n += 2)
462
+ s = u(j);
463
+ for (let n = 0, H = s.length; n < H; n += 2)
217
464
  t.x = s[n + 0], t.y = s[n + 1], e.x = t.x, e.y = t.y, n === 0 ? o.moveTo(t.x, t.y) : o.lineTo(t.x, t.y), n === 0 && c.copy(t);
218
465
  break;
219
466
  case "H":
220
- s = f(D);
221
- for (let n = 0, B = s.length; n < B; n++)
222
- t.x = s[n], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && i === !0 && c.copy(t);
467
+ s = u(j);
468
+ for (let n = 0, H = s.length; n < H; n++)
469
+ t.x = s[n], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && a === !0 && c.copy(t);
223
470
  break;
224
471
  case "V":
225
- s = f(D);
226
- for (let n = 0, B = s.length; n < B; n++)
227
- t.y = s[n], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && i === !0 && c.copy(t);
472
+ s = u(j);
473
+ for (let n = 0, H = s.length; n < H; n++)
474
+ t.y = s[n], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && a === !0 && c.copy(t);
228
475
  break;
229
476
  case "L":
230
- s = f(D);
231
- for (let n = 0, B = s.length; n < B; n += 2)
232
- t.x = s[n + 0], t.y = s[n + 1], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && i === !0 && c.copy(t);
477
+ s = u(j);
478
+ for (let n = 0, H = s.length; n < H; n += 2)
479
+ t.x = s[n + 0], t.y = s[n + 1], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && a === !0 && c.copy(t);
233
480
  break;
234
481
  case "C":
235
- s = f(D);
236
- for (let n = 0, B = s.length; n < B; n += 6)
482
+ s = u(j);
483
+ for (let n = 0, H = s.length; n < H; n += 6)
237
484
  o.bezierCurveTo(
238
485
  s[n + 0],
239
486
  s[n + 1],
@@ -241,82 +488,82 @@ class Ie extends ct {
241
488
  s[n + 3],
242
489
  s[n + 4],
243
490
  s[n + 5]
244
- ), e.x = s[n + 2], e.y = s[n + 3], t.x = s[n + 4], t.y = s[n + 5], n === 0 && i === !0 && c.copy(t);
491
+ ), e.x = s[n + 2], e.y = s[n + 3], t.x = s[n + 4], t.y = s[n + 5], n === 0 && a === !0 && c.copy(t);
245
492
  break;
246
493
  case "S":
247
- s = f(D);
248
- for (let n = 0, B = s.length; n < B; n += 4)
494
+ s = u(j);
495
+ for (let n = 0, H = s.length; n < H; n += 4)
249
496
  o.bezierCurveTo(
250
- k(t.x, e.x),
251
- k(t.y, e.y),
497
+ g(t.x, e.x),
498
+ g(t.y, e.y),
252
499
  s[n + 0],
253
500
  s[n + 1],
254
501
  s[n + 2],
255
502
  s[n + 3]
256
- ), e.x = s[n + 0], e.y = s[n + 1], t.x = s[n + 2], t.y = s[n + 3], n === 0 && i === !0 && c.copy(t);
503
+ ), e.x = s[n + 0], e.y = s[n + 1], t.x = s[n + 2], t.y = s[n + 3], n === 0 && a === !0 && c.copy(t);
257
504
  break;
258
505
  case "Q":
259
- s = f(D);
260
- for (let n = 0, B = s.length; n < B; n += 4)
506
+ s = u(j);
507
+ for (let n = 0, H = s.length; n < H; n += 4)
261
508
  o.quadraticCurveTo(
262
509
  s[n + 0],
263
510
  s[n + 1],
264
511
  s[n + 2],
265
512
  s[n + 3]
266
- ), e.x = s[n + 0], e.y = s[n + 1], t.x = s[n + 2], t.y = s[n + 3], n === 0 && i === !0 && c.copy(t);
513
+ ), e.x = s[n + 0], e.y = s[n + 1], t.x = s[n + 2], t.y = s[n + 3], n === 0 && a === !0 && c.copy(t);
267
514
  break;
268
515
  case "T":
269
- s = f(D);
270
- for (let n = 0, B = s.length; n < B; n += 2) {
271
- const Y = k(t.x, e.x), ae = k(t.y, e.y);
516
+ s = u(j);
517
+ for (let n = 0, H = s.length; n < H; n += 2) {
518
+ const $ = g(t.x, e.x), ce = g(t.y, e.y);
272
519
  o.quadraticCurveTo(
273
- Y,
274
- ae,
520
+ $,
521
+ ce,
275
522
  s[n + 0],
276
523
  s[n + 1]
277
- ), e.x = Y, e.y = ae, t.x = s[n + 0], t.y = s[n + 1], n === 0 && i === !0 && c.copy(t);
524
+ ), e.x = $, e.y = ce, t.x = s[n + 0], t.y = s[n + 1], n === 0 && a === !0 && c.copy(t);
278
525
  }
279
526
  break;
280
527
  case "A":
281
- s = f(D, [3, 4], 7);
282
- for (let n = 0, B = s.length; n < B; n += 7) {
528
+ s = u(j, [3, 4], 7);
529
+ for (let n = 0, H = s.length; n < H; n += 7) {
283
530
  if (s[n + 5] == t.x && s[n + 6] == t.y) continue;
284
- const Y = t.clone();
285
- t.x = s[n + 5], t.y = s[n + 6], e.x = t.x, e.y = t.y, v(
531
+ const $ = t.clone();
532
+ t.x = s[n + 5], t.y = s[n + 6], e.x = t.x, e.y = t.y, B(
286
533
  o,
287
534
  s[n],
288
535
  s[n + 1],
289
536
  s[n + 2],
290
537
  s[n + 3],
291
538
  s[n + 4],
292
- Y,
539
+ $,
293
540
  t
294
- ), n === 0 && i === !0 && c.copy(t);
541
+ ), n === 0 && a === !0 && c.copy(t);
295
542
  }
296
543
  break;
297
544
  case "m":
298
- s = f(D);
299
- for (let n = 0, B = s.length; n < B; n += 2)
545
+ s = u(j);
546
+ for (let n = 0, H = s.length; n < H; n += 2)
300
547
  t.x += s[n + 0], t.y += s[n + 1], e.x = t.x, e.y = t.y, n === 0 ? o.moveTo(t.x, t.y) : o.lineTo(t.x, t.y), n === 0 && c.copy(t);
301
548
  break;
302
549
  case "h":
303
- s = f(D);
304
- for (let n = 0, B = s.length; n < B; n++)
305
- t.x += s[n], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && i === !0 && c.copy(t);
550
+ s = u(j);
551
+ for (let n = 0, H = s.length; n < H; n++)
552
+ t.x += s[n], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && a === !0 && c.copy(t);
306
553
  break;
307
554
  case "v":
308
- s = f(D);
309
- for (let n = 0, B = s.length; n < B; n++)
310
- t.y += s[n], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && i === !0 && c.copy(t);
555
+ s = u(j);
556
+ for (let n = 0, H = s.length; n < H; n++)
557
+ t.y += s[n], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && a === !0 && c.copy(t);
311
558
  break;
312
559
  case "l":
313
- s = f(D);
314
- for (let n = 0, B = s.length; n < B; n += 2)
315
- t.x += s[n + 0], t.y += s[n + 1], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && i === !0 && c.copy(t);
560
+ s = u(j);
561
+ for (let n = 0, H = s.length; n < H; n += 2)
562
+ t.x += s[n + 0], t.y += s[n + 1], e.x = t.x, e.y = t.y, o.lineTo(t.x, t.y), n === 0 && a === !0 && c.copy(t);
316
563
  break;
317
564
  case "c":
318
- s = f(D);
319
- for (let n = 0, B = s.length; n < B; n += 6)
565
+ s = u(j);
566
+ for (let n = 0, H = s.length; n < H; n += 6)
320
567
  o.bezierCurveTo(
321
568
  t.x + s[n + 0],
322
569
  t.y + s[n + 1],
@@ -324,67 +571,67 @@ class Ie extends ct {
324
571
  t.y + s[n + 3],
325
572
  t.x + s[n + 4],
326
573
  t.y + s[n + 5]
327
- ), e.x = t.x + s[n + 2], e.y = t.y + s[n + 3], t.x += s[n + 4], t.y += s[n + 5], n === 0 && i === !0 && c.copy(t);
574
+ ), e.x = t.x + s[n + 2], e.y = t.y + s[n + 3], t.x += s[n + 4], t.y += s[n + 5], n === 0 && a === !0 && c.copy(t);
328
575
  break;
329
576
  case "s":
330
- s = f(D);
331
- for (let n = 0, B = s.length; n < B; n += 4)
577
+ s = u(j);
578
+ for (let n = 0, H = s.length; n < H; n += 4)
332
579
  o.bezierCurveTo(
333
- k(t.x, e.x),
334
- k(t.y, e.y),
580
+ g(t.x, e.x),
581
+ g(t.y, e.y),
335
582
  t.x + s[n + 0],
336
583
  t.y + s[n + 1],
337
584
  t.x + s[n + 2],
338
585
  t.y + s[n + 3]
339
- ), e.x = t.x + s[n + 0], e.y = t.y + s[n + 1], t.x += s[n + 2], t.y += s[n + 3], n === 0 && i === !0 && c.copy(t);
586
+ ), e.x = t.x + s[n + 0], e.y = t.y + s[n + 1], t.x += s[n + 2], t.y += s[n + 3], n === 0 && a === !0 && c.copy(t);
340
587
  break;
341
588
  case "q":
342
- s = f(D);
343
- for (let n = 0, B = s.length; n < B; n += 4)
589
+ s = u(j);
590
+ for (let n = 0, H = s.length; n < H; n += 4)
344
591
  o.quadraticCurveTo(
345
592
  t.x + s[n + 0],
346
593
  t.y + s[n + 1],
347
594
  t.x + s[n + 2],
348
595
  t.y + s[n + 3]
349
- ), e.x = t.x + s[n + 0], e.y = t.y + s[n + 1], t.x += s[n + 2], t.y += s[n + 3], n === 0 && i === !0 && c.copy(t);
596
+ ), e.x = t.x + s[n + 0], e.y = t.y + s[n + 1], t.x += s[n + 2], t.y += s[n + 3], n === 0 && a === !0 && c.copy(t);
350
597
  break;
351
598
  case "t":
352
- s = f(D);
353
- for (let n = 0, B = s.length; n < B; n += 2) {
354
- const Y = k(t.x, e.x), ae = k(t.y, e.y);
599
+ s = u(j);
600
+ for (let n = 0, H = s.length; n < H; n += 2) {
601
+ const $ = g(t.x, e.x), ce = g(t.y, e.y);
355
602
  o.quadraticCurveTo(
356
- Y,
357
- ae,
603
+ $,
604
+ ce,
358
605
  t.x + s[n + 0],
359
606
  t.y + s[n + 1]
360
- ), e.x = Y, e.y = ae, t.x = t.x + s[n + 0], t.y = t.y + s[n + 1], n === 0 && i === !0 && c.copy(t);
607
+ ), e.x = $, e.y = ce, t.x = t.x + s[n + 0], t.y = t.y + s[n + 1], n === 0 && a === !0 && c.copy(t);
361
608
  }
362
609
  break;
363
610
  case "a":
364
- s = f(D, [3, 4], 7);
365
- for (let n = 0, B = s.length; n < B; n += 7) {
611
+ s = u(j, [3, 4], 7);
612
+ for (let n = 0, H = s.length; n < H; n += 7) {
366
613
  if (s[n + 5] == 0 && s[n + 6] == 0) continue;
367
- const Y = t.clone();
368
- t.x += s[n + 5], t.y += s[n + 6], e.x = t.x, e.y = t.y, v(
614
+ const $ = t.clone();
615
+ t.x += s[n + 5], t.y += s[n + 6], e.x = t.x, e.y = t.y, B(
369
616
  o,
370
617
  s[n],
371
618
  s[n + 1],
372
619
  s[n + 2],
373
620
  s[n + 3],
374
621
  s[n + 4],
375
- Y,
622
+ $,
376
623
  t
377
- ), n === 0 && i === !0 && c.copy(t);
624
+ ), n === 0 && a === !0 && c.copy(t);
378
625
  }
379
626
  break;
380
627
  case "Z":
381
628
  case "z":
382
- o.currentPath.autoClose = !0, o.currentPath.curves.length > 0 && (t.copy(c), o.currentPath.currentPoint.copy(t), y = !0);
629
+ o.currentPath.autoClose = !0, o.currentPath.curves.length > 0 && (t.copy(c), o.currentPath.currentPoint.copy(t), b = !0);
383
630
  break;
384
631
  default:
385
- console.warn(b);
632
+ console.warn(A);
386
633
  }
387
- i = !1;
634
+ a = !1;
388
635
  }
389
636
  return o;
390
637
  }
@@ -395,125 +642,125 @@ class Ie extends ct {
395
642
  if (t.type !== 1) continue;
396
643
  const e = t.selectorText.split(/,/gm).filter(Boolean).map((c) => c.trim());
397
644
  for (let c = 0; c < e.length; c++) {
398
- const y = Object.fromEntries(
399
- Object.entries(t.style).filter(([, i]) => i !== "")
645
+ const b = Object.fromEntries(
646
+ Object.entries(t.style).filter(([, a]) => a !== "")
400
647
  );
401
648
  K[e[c]] = Object.assign(
402
649
  K[e[c]] || {},
403
- y
650
+ b
404
651
  );
405
652
  }
406
653
  }
407
654
  }
408
- function v(r, o, t, e, c, y, i, w) {
655
+ function B(r, o, t, e, c, b, a, S) {
409
656
  if (o == 0 || t == 0) {
410
- r.lineTo(w.x, w.y);
657
+ r.lineTo(S.x, S.y);
411
658
  return;
412
659
  }
413
660
  e = e * Math.PI / 180, o = Math.abs(o), t = Math.abs(t);
414
- const C = (i.x - w.x) / 2, O = (i.y - w.y) / 2, l = Math.cos(e) * C + Math.sin(e) * O, b = -Math.sin(e) * C + Math.cos(e) * O;
415
- let L = o * o, D = t * t;
416
- const s = l * l, n = b * b, B = s / L + n / D;
417
- if (B > 1) {
418
- const xe = Math.sqrt(B);
419
- o = xe * o, t = xe * t, L = o * o, D = t * t;
661
+ const L = (a.x - S.x) / 2, D = (a.y - S.y) / 2, f = Math.cos(e) * L + Math.sin(e) * D, A = -Math.sin(e) * L + Math.cos(e) * D;
662
+ let F = o * o, j = t * t;
663
+ const s = f * f, n = A * A, H = s / F + n / j;
664
+ if (H > 1) {
665
+ const ke = Math.sqrt(H);
666
+ o = ke * o, t = ke * t, F = o * o, j = t * t;
420
667
  }
421
- const Y = L * n + D * s, ae = (L * D - Y) / Y;
422
- let le = Math.sqrt(Math.max(0, ae));
423
- c === y && (le = -le);
424
- const re = le * o * b / t, de = -le * t * l / o, ge = Math.cos(e) * re - Math.sin(e) * de + (i.x + w.x) / 2, Pe = Math.sin(e) * re + Math.cos(e) * de + (i.y + w.y) / 2, be = x(1, 0, (l - re) / o, (b - de) / t), we = x((l - re) / o, (b - de) / t, (-l - re) / o, (-b - de) / t) % (Math.PI * 2);
425
- r.currentPath.absellipse(ge, Pe, o, t, be, be + we, y === 0, e);
668
+ const $ = F * n + j * s, ce = (F * j - $) / $;
669
+ let me = Math.sqrt(Math.max(0, ce));
670
+ c === b && (me = -me);
671
+ const se = me * o * A / t, pe = -me * t * f / o, xe = Math.cos(e) * se - Math.sin(e) * pe + (a.x + S.x) / 2, Pe = Math.sin(e) * se + Math.cos(e) * pe + (a.y + S.y) / 2, we = W(1, 0, (f - se) / o, (A - pe) / t), Ie = W((f - se) / o, (A - pe) / t, (-f - se) / o, (-A - pe) / t) % (Math.PI * 2);
672
+ r.currentPath.absellipse(xe, Pe, o, t, we, we + Ie, b === 0, e);
426
673
  }
427
- function x(r, o, t, e) {
428
- const c = r * t + o * e, y = Math.sqrt(r * r + o * o) * Math.sqrt(t * t + e * e);
429
- let i = Math.acos(Math.max(-1, Math.min(1, c / y)));
430
- return r * e - o * t < 0 && (i = -i), i;
674
+ function W(r, o, t, e) {
675
+ const c = r * t + o * e, b = Math.sqrt(r * r + o * o) * Math.sqrt(t * t + e * e);
676
+ let a = Math.acos(Math.max(-1, Math.min(1, c / b)));
677
+ return r * e - o * t < 0 && (a = -a), a;
431
678
  }
432
- function q(r) {
433
- const o = p(r.getAttribute("x") || 0), t = p(r.getAttribute("y") || 0), e = p(r.getAttribute("rx") || r.getAttribute("ry") || 0), c = p(r.getAttribute("ry") || r.getAttribute("rx") || 0), y = p(r.getAttribute("width")), i = p(r.getAttribute("height")), w = 1 - 0.551915024494, C = new pe();
434
- return C.moveTo(o + e, t), C.lineTo(o + y - e, t), (e !== 0 || c !== 0) && C.bezierCurveTo(
435
- o + y - e * w,
679
+ function p(r) {
680
+ const o = m(r.getAttribute("x") || 0), t = m(r.getAttribute("y") || 0), e = m(r.getAttribute("rx") || r.getAttribute("ry") || 0), c = m(r.getAttribute("ry") || r.getAttribute("rx") || 0), b = m(r.getAttribute("width")), a = m(r.getAttribute("height")), S = 1 - 0.551915024494, L = new ye();
681
+ return L.moveTo(o + e, t), L.lineTo(o + b - e, t), (e !== 0 || c !== 0) && L.bezierCurveTo(
682
+ o + b - e * S,
436
683
  t,
437
- o + y,
438
- t + c * w,
439
- o + y,
684
+ o + b,
685
+ t + c * S,
686
+ o + b,
440
687
  t + c
441
- ), C.lineTo(o + y, t + i - c), (e !== 0 || c !== 0) && C.bezierCurveTo(
442
- o + y,
443
- t + i - c * w,
444
- o + y - e * w,
445
- t + i,
446
- o + y - e,
447
- t + i
448
- ), C.lineTo(o + e, t + i), (e !== 0 || c !== 0) && C.bezierCurveTo(
449
- o + e * w,
450
- t + i,
688
+ ), L.lineTo(o + b, t + a - c), (e !== 0 || c !== 0) && L.bezierCurveTo(
689
+ o + b,
690
+ t + a - c * S,
691
+ o + b - e * S,
692
+ t + a,
693
+ o + b - e,
694
+ t + a
695
+ ), L.lineTo(o + e, t + a), (e !== 0 || c !== 0) && L.bezierCurveTo(
696
+ o + e * S,
697
+ t + a,
451
698
  o,
452
- t + i - c * w,
699
+ t + a - c * S,
453
700
  o,
454
- t + i - c
455
- ), C.lineTo(o, t + c), (e !== 0 || c !== 0) && C.bezierCurveTo(o, t + c * w, o + e * w, t, o + e, t), C;
701
+ t + a - c
702
+ ), L.lineTo(o, t + c), (e !== 0 || c !== 0) && L.bezierCurveTo(o, t + c * S, o + e * S, t, o + e, t), L;
456
703
  }
457
- function T(r) {
458
- function o(y, i, w) {
459
- const C = p(i), O = p(w);
460
- c === 0 ? e.moveTo(C, O) : e.lineTo(C, O), c++;
704
+ function k(r) {
705
+ function o(b, a, S) {
706
+ const L = m(a), D = m(S);
707
+ c === 0 ? e.moveTo(L, D) : e.lineTo(L, D), c++;
461
708
  }
462
- const t = /([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g, e = new pe();
709
+ const t = /([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g, e = new ye();
463
710
  let c = 0;
464
711
  return r.getAttribute("points").replace(t, o), e.currentPath.autoClose = !0, e;
465
712
  }
466
- function H(r) {
467
- function o(y, i, w) {
468
- const C = p(i), O = p(w);
469
- c === 0 ? e.moveTo(C, O) : e.lineTo(C, O), c++;
713
+ function z(r) {
714
+ function o(b, a, S) {
715
+ const L = m(a), D = m(S);
716
+ c === 0 ? e.moveTo(L, D) : e.lineTo(L, D), c++;
470
717
  }
471
- const t = /([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g, e = new pe();
718
+ const t = /([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g, e = new ye();
472
719
  let c = 0;
473
720
  return r.getAttribute("points").replace(t, o), e.currentPath.autoClose = !1, e;
474
721
  }
475
- function G(r) {
476
- const o = p(r.getAttribute("cx") || 0), t = p(r.getAttribute("cy") || 0), e = p(r.getAttribute("r") || 0), c = new Ne();
722
+ function O(r) {
723
+ const o = m(r.getAttribute("cx") || 0), t = m(r.getAttribute("cy") || 0), e = m(r.getAttribute("r") || 0), c = new Ee();
477
724
  c.absarc(o, t, e, 0, Math.PI * 2);
478
- const y = new pe();
479
- return y.subPaths.push(c), y;
725
+ const b = new ye();
726
+ return b.subPaths.push(c), b;
480
727
  }
481
- function E(r) {
482
- const o = p(r.getAttribute("cx") || 0), t = p(r.getAttribute("cy") || 0), e = p(r.getAttribute("rx") || 0), c = p(r.getAttribute("ry") || 0), y = new Ne();
483
- y.absellipse(o, t, e, c, 0, Math.PI * 2);
484
- const i = new pe();
485
- return i.subPaths.push(y), i;
728
+ function C(r) {
729
+ const o = m(r.getAttribute("cx") || 0), t = m(r.getAttribute("cy") || 0), e = m(r.getAttribute("rx") || 0), c = m(r.getAttribute("ry") || 0), b = new Ee();
730
+ b.absellipse(o, t, e, c, 0, Math.PI * 2);
731
+ const a = new ye();
732
+ return a.subPaths.push(b), a;
486
733
  }
487
- function W(r) {
488
- const o = p(r.getAttribute("x1") || 0), t = p(r.getAttribute("y1") || 0), e = p(r.getAttribute("x2") || 0), c = p(r.getAttribute("y2") || 0), y = new pe();
489
- return y.moveTo(o, t), y.lineTo(e, c), y.currentPath.autoClose = !1, y;
734
+ function V(r) {
735
+ const o = m(r.getAttribute("x1") || 0), t = m(r.getAttribute("y1") || 0), e = m(r.getAttribute("x2") || 0), c = m(r.getAttribute("y2") || 0), b = new ye();
736
+ return b.moveTo(o, t), b.lineTo(e, c), b.currentPath.autoClose = !1, b;
490
737
  }
491
- function N(r, o) {
738
+ function P(r, o) {
492
739
  o = Object.assign({}, o);
493
740
  let t = {};
494
741
  if (r.hasAttribute("class")) {
495
- const i = r.getAttribute("class").split(/\s/).filter(Boolean).map((w) => w.trim());
496
- for (let w = 0; w < i.length; w++)
497
- t = Object.assign(t, K["." + i[w]]);
742
+ const a = r.getAttribute("class").split(/\s/).filter(Boolean).map((S) => S.trim());
743
+ for (let S = 0; S < a.length; S++)
744
+ t = Object.assign(t, K["." + a[S]]);
498
745
  }
499
746
  r.hasAttribute("id") && (t = Object.assign(t, K["#" + r.getAttribute("id")]));
500
- function e(i, w, C) {
501
- C === void 0 && (C = function(l) {
502
- return l.startsWith("url") && console.warn("SVGLoader: url access in attributes is not implemented."), l;
503
- }), r.hasAttribute(i) && (o[w] = C(r.getAttribute(i))), t[i] && (o[w] = C(t[i])), r.style && r.style[i] !== "" && (o[w] = C(r.style[i]));
747
+ function e(a, S, L) {
748
+ L === void 0 && (L = function(f) {
749
+ return f.startsWith("url") && console.warn("SVGLoader: url access in attributes is not implemented."), f;
750
+ }), r.hasAttribute(a) && (o[S] = L(r.getAttribute(a))), t[a] && (o[S] = L(t[a])), r.style && r.style[a] !== "" && (o[S] = L(r.style[a]));
504
751
  }
505
- function c(i) {
506
- return Math.max(0, Math.min(1, p(i)));
752
+ function c(a) {
753
+ return Math.max(0, Math.min(1, m(a)));
507
754
  }
508
- function y(i) {
509
- return Math.max(0, p(i));
755
+ function b(a) {
756
+ return Math.max(0, m(a));
510
757
  }
511
- return e("fill", "fill"), e("fill-opacity", "fillOpacity", c), e("fill-rule", "fillRule"), e("opacity", "opacity", c), e("stroke", "stroke"), e("stroke-opacity", "strokeOpacity", c), e("stroke-width", "strokeWidth", y), e("stroke-linejoin", "strokeLineJoin"), e("stroke-linecap", "strokeLineCap"), e("stroke-miterlimit", "strokeMiterLimit", y), e("visibility", "visibility"), o;
758
+ return e("fill", "fill"), e("fill-opacity", "fillOpacity", c), e("fill-rule", "fillRule"), e("opacity", "opacity", c), e("stroke", "stroke"), e("stroke-opacity", "strokeOpacity", c), e("stroke-width", "strokeWidth", b), e("stroke-linejoin", "strokeLineJoin"), e("stroke-linecap", "strokeLineCap"), e("stroke-miterlimit", "strokeMiterLimit", b), e("visibility", "visibility"), o;
512
759
  }
513
- function k(r, o) {
760
+ function g(r, o) {
514
761
  return r - (o - r);
515
762
  }
516
- function f(r, o, t) {
763
+ function u(r, o, t) {
517
764
  if (typeof r != "string")
518
765
  throw new TypeError("Invalid input: " + typeof r);
519
766
  const e = {
@@ -524,80 +771,80 @@ class Ie extends ct {
524
771
  COMMA: /,/,
525
772
  EXP: /e/i,
526
773
  FLAGS: /[01]/
527
- }, c = 0, y = 1, i = 2, w = 3;
528
- let C = c, O = !0, l = "", b = "";
529
- const L = [];
530
- function D(Y, ae, le) {
531
- const re = new SyntaxError('Unexpected character "' + Y + '" at index ' + ae + ".");
532
- throw re.partial = le, re;
774
+ }, c = 0, b = 1, a = 2, S = 3;
775
+ let L = c, D = !0, f = "", A = "";
776
+ const F = [];
777
+ function j($, ce, me) {
778
+ const se = new SyntaxError('Unexpected character "' + $ + '" at index ' + ce + ".");
779
+ throw se.partial = me, se;
533
780
  }
534
781
  function s() {
535
- l !== "" && (b === "" ? L.push(Number(l)) : L.push(Number(l) * Math.pow(10, Number(b)))), l = "", b = "";
782
+ f !== "" && (A === "" ? F.push(Number(f)) : F.push(Number(f) * Math.pow(10, Number(A)))), f = "", A = "";
536
783
  }
537
784
  let n;
538
- const B = r.length;
539
- for (let Y = 0; Y < B; Y++) {
540
- if (n = r[Y], Array.isArray(o) && o.includes(L.length % t) && e.FLAGS.test(n)) {
541
- C = y, l = n, s();
785
+ const H = r.length;
786
+ for (let $ = 0; $ < H; $++) {
787
+ if (n = r[$], Array.isArray(o) && o.includes(F.length % t) && e.FLAGS.test(n)) {
788
+ L = b, f = n, s();
542
789
  continue;
543
790
  }
544
- if (C === c) {
791
+ if (L === c) {
545
792
  if (e.WHITESPACE.test(n))
546
793
  continue;
547
794
  if (e.DIGIT.test(n) || e.SIGN.test(n)) {
548
- C = y, l = n;
795
+ L = b, f = n;
549
796
  continue;
550
797
  }
551
798
  if (e.POINT.test(n)) {
552
- C = i, l = n;
799
+ L = a, f = n;
553
800
  continue;
554
801
  }
555
- e.COMMA.test(n) && (O && D(n, Y, L), O = !0);
802
+ e.COMMA.test(n) && (D && j(n, $, F), D = !0);
556
803
  }
557
- if (C === y) {
804
+ if (L === b) {
558
805
  if (e.DIGIT.test(n)) {
559
- l += n;
806
+ f += n;
560
807
  continue;
561
808
  }
562
809
  if (e.POINT.test(n)) {
563
- l += n, C = i;
810
+ f += n, L = a;
564
811
  continue;
565
812
  }
566
813
  if (e.EXP.test(n)) {
567
- C = w;
814
+ L = S;
568
815
  continue;
569
816
  }
570
- e.SIGN.test(n) && l.length === 1 && e.SIGN.test(l[0]) && D(n, Y, L);
817
+ e.SIGN.test(n) && f.length === 1 && e.SIGN.test(f[0]) && j(n, $, F);
571
818
  }
572
- if (C === i) {
819
+ if (L === a) {
573
820
  if (e.DIGIT.test(n)) {
574
- l += n;
821
+ f += n;
575
822
  continue;
576
823
  }
577
824
  if (e.EXP.test(n)) {
578
- C = w;
825
+ L = S;
579
826
  continue;
580
827
  }
581
- e.POINT.test(n) && l[l.length - 1] === "." && D(n, Y, L);
828
+ e.POINT.test(n) && f[f.length - 1] === "." && j(n, $, F);
582
829
  }
583
- if (C === w) {
830
+ if (L === S) {
584
831
  if (e.DIGIT.test(n)) {
585
- b += n;
832
+ A += n;
586
833
  continue;
587
834
  }
588
835
  if (e.SIGN.test(n)) {
589
- if (b === "") {
590
- b += n;
836
+ if (A === "") {
837
+ A += n;
591
838
  continue;
592
839
  }
593
- b.length === 1 && e.SIGN.test(b) && D(n, Y, L);
840
+ A.length === 1 && e.SIGN.test(A) && j(n, $, F);
594
841
  }
595
842
  }
596
- e.WHITESPACE.test(n) ? (s(), C = c, O = !1) : e.COMMA.test(n) ? (s(), C = c, O = !0) : e.SIGN.test(n) ? (s(), C = y, l = n) : e.POINT.test(n) ? (s(), C = i, l = n) : D(n, Y, L);
843
+ e.WHITESPACE.test(n) ? (s(), L = c, D = !1) : e.COMMA.test(n) ? (s(), L = c, D = !0) : e.SIGN.test(n) ? (s(), L = b, f = n) : e.POINT.test(n) ? (s(), L = a, f = n) : j(n, $, F);
597
844
  }
598
- return s(), L;
845
+ return s(), F;
599
846
  }
600
- const P = ["mm", "cm", "in", "pt", "pc", "px"], d = {
847
+ const E = ["mm", "cm", "in", "pt", "pc", "px"], y = {
601
848
  mm: {
602
849
  mm: 1,
603
850
  cm: 0.1,
@@ -642,64 +889,64 @@ class Ie extends ct {
642
889
  px: 1
643
890
  }
644
891
  };
645
- function p(r) {
892
+ function m(r) {
646
893
  let o = "px";
647
894
  if (typeof r == "string" || r instanceof String)
648
- for (let e = 0, c = P.length; e < c; e++) {
649
- const y = P[e];
650
- if (r.endsWith(y)) {
651
- o = y, r = r.substring(0, r.length - y.length);
895
+ for (let e = 0, c = E.length; e < c; e++) {
896
+ const b = E[e];
897
+ if (r.endsWith(b)) {
898
+ o = b, r = r.substring(0, r.length - b.length);
652
899
  break;
653
900
  }
654
901
  }
655
902
  let t;
656
- return o === "px" && A.defaultUnit !== "px" ? t = d.in[A.defaultUnit] / A.defaultDPI : (t = d[o][A.defaultUnit], t < 0 && (t = d[o].in * A.defaultDPI)), t * parseFloat(r);
903
+ return o === "px" && M.defaultUnit !== "px" ? t = y.in[M.defaultUnit] / M.defaultDPI : (t = y[o][M.defaultUnit], t < 0 && (t = y[o].in * M.defaultDPI)), t * parseFloat(r);
657
904
  }
658
- function S(r) {
905
+ function v(r) {
659
906
  if (!(r.hasAttribute("transform") || r.nodeName === "use" && (r.hasAttribute("x") || r.hasAttribute("y"))))
660
907
  return null;
661
- const o = j(r);
662
- return $.length > 0 && o.premultiply($[$.length - 1]), se.copy(o), $.push(o), o;
908
+ const o = U(r);
909
+ return Z.length > 0 && o.premultiply(Z[Z.length - 1]), ie.copy(o), Z.push(o), o;
663
910
  }
664
- function j(r) {
665
- const o = new ye(), t = oe;
911
+ function U(r) {
912
+ const o = new ge(), t = oe;
666
913
  if (r.nodeName === "use" && (r.hasAttribute("x") || r.hasAttribute("y"))) {
667
- const e = p(r.getAttribute("x")), c = p(r.getAttribute("y"));
914
+ const e = m(r.getAttribute("x")), c = m(r.getAttribute("y"));
668
915
  o.translate(e, c);
669
916
  }
670
917
  if (r.hasAttribute("transform")) {
671
918
  const e = r.getAttribute("transform").split(")");
672
919
  for (let c = e.length - 1; c >= 0; c--) {
673
- const y = e[c].trim();
674
- if (y === "") continue;
675
- const i = y.indexOf("("), w = y.length;
676
- if (i > 0 && i < w) {
677
- const C = y.slice(0, i), O = f(y.slice(i + 1));
678
- switch (t.identity(), C) {
920
+ const b = e[c].trim();
921
+ if (b === "") continue;
922
+ const a = b.indexOf("("), S = b.length;
923
+ if (a > 0 && a < S) {
924
+ const L = b.slice(0, a), D = u(b.slice(a + 1));
925
+ switch (t.identity(), L) {
679
926
  case "translate":
680
- if (O.length >= 1) {
681
- const l = O[0];
682
- let b = 0;
683
- O.length >= 2 && (b = O[1]), t.translate(l, b);
927
+ if (D.length >= 1) {
928
+ const f = D[0];
929
+ let A = 0;
930
+ D.length >= 2 && (A = D[1]), t.translate(f, A);
684
931
  }
685
932
  break;
686
933
  case "rotate":
687
- if (O.length >= 1) {
688
- let l = 0, b = 0, L = 0;
689
- l = O[0] * Math.PI / 180, O.length >= 3 && (b = O[1], L = O[2]), J.makeTranslation(-b, -L), U.makeRotation(l), g.multiplyMatrices(U, J), J.makeTranslation(b, L), t.multiplyMatrices(J, g);
934
+ if (D.length >= 1) {
935
+ let f = 0, A = 0, F = 0;
936
+ f = D[0] * Math.PI / 180, D.length >= 3 && (A = D[1], F = D[2]), J.makeTranslation(-A, -F), X.makeRotation(f), x.multiplyMatrices(X, J), J.makeTranslation(A, F), t.multiplyMatrices(J, x);
690
937
  }
691
938
  break;
692
939
  case "scale":
693
- if (O.length >= 1) {
694
- const l = O[0];
695
- let b = l;
696
- O.length >= 2 && (b = O[1]), t.scale(l, b);
940
+ if (D.length >= 1) {
941
+ const f = D[0];
942
+ let A = f;
943
+ D.length >= 2 && (A = D[1]), t.scale(f, A);
697
944
  }
698
945
  break;
699
946
  case "skewX":
700
- O.length === 1 && t.set(
947
+ D.length === 1 && t.set(
701
948
  1,
702
- Math.tan(O[0] * Math.PI / 180),
949
+ Math.tan(D[0] * Math.PI / 180),
703
950
  0,
704
951
  0,
705
952
  1,
@@ -710,11 +957,11 @@ class Ie extends ct {
710
957
  );
711
958
  break;
712
959
  case "skewY":
713
- O.length === 1 && t.set(
960
+ D.length === 1 && t.set(
714
961
  1,
715
962
  0,
716
963
  0,
717
- Math.tan(O[0] * Math.PI / 180),
964
+ Math.tan(D[0] * Math.PI / 180),
718
965
  1,
719
966
  0,
720
967
  0,
@@ -723,13 +970,13 @@ class Ie extends ct {
723
970
  );
724
971
  break;
725
972
  case "matrix":
726
- O.length === 6 && t.set(
727
- O[0],
728
- O[2],
729
- O[4],
730
- O[1],
731
- O[3],
732
- O[5],
973
+ D.length === 6 && t.set(
974
+ D[0],
975
+ D[2],
976
+ D[4],
977
+ D[1],
978
+ D[3],
979
+ D[5],
733
980
  0,
734
981
  0,
735
982
  1
@@ -742,90 +989,90 @@ class Ie extends ct {
742
989
  }
743
990
  return o;
744
991
  }
745
- function m(r, o) {
746
- function t(i) {
747
- ee.set(i.x, i.y, 1).applyMatrix3(o), i.set(ee.x, ee.y);
992
+ function d(r, o) {
993
+ function t(a) {
994
+ ee.set(a.x, a.y, 1).applyMatrix3(o), a.set(ee.x, ee.y);
748
995
  }
749
- function e(i) {
750
- const w = i.xRadius, C = i.yRadius, O = Math.cos(i.aRotation), l = Math.sin(i.aRotation), b = new ke(w * O, w * l, 0), L = new ke(-C * l, C * O, 0), D = b.applyMatrix3(o), s = L.applyMatrix3(o), n = oe.set(
751
- D.x,
996
+ function e(a) {
997
+ const S = a.xRadius, L = a.yRadius, D = Math.cos(a.aRotation), f = Math.sin(a.aRotation), A = new Ae(S * D, S * f, 0), F = new Ae(-L * f, L * D, 0), j = A.applyMatrix3(o), s = F.applyMatrix3(o), n = oe.set(
998
+ j.x,
752
999
  s.x,
753
1000
  0,
754
- D.y,
1001
+ j.y,
755
1002
  s.y,
756
1003
  0,
757
1004
  0,
758
1005
  0,
759
1006
  1
760
- ), B = J.copy(n).invert(), le = U.copy(B).transpose().multiply(B).elements, re = Z(le[0], le[1], le[4]), de = Math.sqrt(re.rt1), ge = Math.sqrt(re.rt2);
761
- if (i.xRadius = 1 / de, i.yRadius = 1 / ge, i.aRotation = Math.atan2(re.sn, re.cs), !((i.aEndAngle - i.aStartAngle) % (2 * Math.PI) < Number.EPSILON)) {
762
- const be = J.set(
763
- de,
1007
+ ), H = J.copy(n).invert(), me = X.copy(H).transpose().multiply(H).elements, se = Y(me[0], me[1], me[4]), pe = Math.sqrt(se.rt1), xe = Math.sqrt(se.rt2);
1008
+ if (a.xRadius = 1 / pe, a.yRadius = 1 / xe, a.aRotation = Math.atan2(se.sn, se.cs), !((a.aEndAngle - a.aStartAngle) % (2 * Math.PI) < Number.EPSILON)) {
1009
+ const we = J.set(
1010
+ pe,
764
1011
  0,
765
1012
  0,
766
1013
  0,
767
- ge,
1014
+ xe,
768
1015
  0,
769
1016
  0,
770
1017
  0,
771
1018
  1
772
- ), we = U.set(
773
- re.cs,
774
- re.sn,
1019
+ ), Ie = X.set(
1020
+ se.cs,
1021
+ se.sn,
775
1022
  0,
776
- -re.sn,
777
- re.cs,
1023
+ -se.sn,
1024
+ se.cs,
778
1025
  0,
779
1026
  0,
780
1027
  0,
781
1028
  1
782
- ), xe = be.multiply(we).multiply(n), Re = (Le) => {
783
- const { x: He, y: Ue } = new ke(Math.cos(Le), Math.sin(Le), 0).applyMatrix3(xe);
784
- return Math.atan2(Ue, He);
1029
+ ), ke = we.multiply(Ie).multiply(n), Re = (Le) => {
1030
+ const { x: qe, y: Xe } = new Ae(Math.cos(Le), Math.sin(Le), 0).applyMatrix3(ke);
1031
+ return Math.atan2(Xe, qe);
785
1032
  };
786
- i.aStartAngle = Re(i.aStartAngle), i.aEndAngle = Re(i.aEndAngle), z(o) && (i.aClockwise = !i.aClockwise);
1033
+ a.aStartAngle = Re(a.aStartAngle), a.aEndAngle = Re(a.aEndAngle), w(o) && (a.aClockwise = !a.aClockwise);
787
1034
  }
788
1035
  }
789
- function c(i) {
790
- const w = F(o), C = X(o);
791
- i.xRadius *= w, i.yRadius *= C;
792
- const O = w > Number.EPSILON ? Math.atan2(o.elements[1], o.elements[0]) : Math.atan2(-o.elements[3], o.elements[4]);
793
- i.aRotation += O, z(o) && (i.aStartAngle *= -1, i.aEndAngle *= -1, i.aClockwise = !i.aClockwise);
1036
+ function c(a) {
1037
+ const S = _(o), L = q(o);
1038
+ a.xRadius *= S, a.yRadius *= L;
1039
+ const D = S > Number.EPSILON ? Math.atan2(o.elements[1], o.elements[0]) : Math.atan2(-o.elements[3], o.elements[4]);
1040
+ a.aRotation += D, w(o) && (a.aStartAngle *= -1, a.aEndAngle *= -1, a.aClockwise = !a.aClockwise);
794
1041
  }
795
- const y = r.subPaths;
796
- for (let i = 0, w = y.length; i < w; i++) {
797
- const O = y[i].curves;
798
- for (let l = 0; l < O.length; l++) {
799
- const b = O[l];
800
- b.isLineCurve ? (t(b.v1), t(b.v2)) : b.isCubicBezierCurve ? (t(b.v0), t(b.v1), t(b.v2), t(b.v3)) : b.isQuadraticBezierCurve ? (t(b.v0), t(b.v1), t(b.v2)) : b.isEllipseCurve && (te.set(b.aX, b.aY), t(te), b.aX = te.x, b.aY = te.y, R(o) ? e(b) : c(b));
1042
+ const b = r.subPaths;
1043
+ for (let a = 0, S = b.length; a < S; a++) {
1044
+ const D = b[a].curves;
1045
+ for (let f = 0; f < D.length; f++) {
1046
+ const A = D[f];
1047
+ A.isLineCurve ? (t(A.v1), t(A.v2)) : A.isCubicBezierCurve ? (t(A.v0), t(A.v1), t(A.v2), t(A.v3)) : A.isQuadraticBezierCurve ? (t(A.v0), t(A.v1), t(A.v2)) : A.isEllipseCurve && (ne.set(A.aX, A.aY), t(ne), A.aX = ne.x, A.aY = ne.y, T(o) ? e(A) : c(A));
801
1048
  }
802
1049
  }
803
1050
  }
804
- function z(r) {
1051
+ function w(r) {
805
1052
  const o = r.elements;
806
1053
  return o[0] * o[4] - o[1] * o[3] < 0;
807
1054
  }
808
- function R(r) {
1055
+ function T(r) {
809
1056
  const o = r.elements, t = o[0] * o[3] + o[1] * o[4];
810
1057
  if (t === 0) return !1;
811
- const e = F(r), c = X(r);
1058
+ const e = _(r), c = q(r);
812
1059
  return Math.abs(t / (e * c)) > Number.EPSILON;
813
1060
  }
814
- function F(r) {
1061
+ function _(r) {
815
1062
  const o = r.elements;
816
1063
  return Math.sqrt(o[0] * o[0] + o[1] * o[1]);
817
1064
  }
818
- function X(r) {
1065
+ function q(r) {
819
1066
  const o = r.elements;
820
1067
  return Math.sqrt(o[3] * o[3] + o[4] * o[4]);
821
1068
  }
822
- function Z(r, o, t) {
823
- let e, c, y, i, w;
824
- const C = r + t, O = r - t, l = Math.sqrt(O * O + 4 * o * o);
825
- return C > 0 ? (e = 0.5 * (C + l), w = 1 / e, c = r * w * t - o * w * o) : C < 0 ? c = 0.5 * (C - l) : (e = 0.5 * l, c = -0.5 * l), O > 0 ? y = O + l : y = O - l, Math.abs(y) > 2 * Math.abs(o) ? (w = -2 * o / y, i = 1 / Math.sqrt(1 + w * w), y = w * i) : Math.abs(o) === 0 ? (y = 1, i = 0) : (w = -0.5 * y / o, y = 1 / Math.sqrt(1 + w * w), i = w * y), O > 0 && (w = y, y = -i, i = w), { rt1: e, rt2: c, cs: y, sn: i };
1069
+ function Y(r, o, t) {
1070
+ let e, c, b, a, S;
1071
+ const L = r + t, D = r - t, f = Math.sqrt(D * D + 4 * o * o);
1072
+ return L > 0 ? (e = 0.5 * (L + f), S = 1 / e, c = r * S * t - o * S * o) : L < 0 ? c = 0.5 * (L - f) : (e = 0.5 * f, c = -0.5 * f), D > 0 ? b = D + f : b = D - f, Math.abs(b) > 2 * Math.abs(o) ? (S = -2 * o / b, a = 1 / Math.sqrt(1 + S * S), b = S * a) : Math.abs(o) === 0 ? (b = 1, a = 0) : (S = -0.5 * b / o, b = 1 / Math.sqrt(1 + S * S), a = S * b), D > 0 && (S = b, b = -a, a = S), { rt1: e, rt2: c, cs: b, sn: a };
826
1073
  }
827
- const V = [], K = {}, $ = [], oe = new ye(), J = new ye(), U = new ye(), g = new ye(), te = new Q(), ee = new ke(), se = new ye(), he = new DOMParser().parseFromString(a, "image/svg+xml");
828
- return M(he.documentElement, {
1074
+ const G = [], K = {}, Z = [], oe = new ge(), J = new ge(), X = new ge(), x = new ge(), ne = new Q(), ee = new Ae(), ie = new ge(), de = new DOMParser().parseFromString(i, "image/svg+xml");
1075
+ return I(de.documentElement, {
829
1076
  fill: "#000",
830
1077
  fillOpacity: 1,
831
1078
  strokeOpacity: 1,
@@ -833,7 +1080,7 @@ class Ie extends ct {
833
1080
  strokeLineJoin: "miter",
834
1081
  strokeLineCap: "butt",
835
1082
  strokeMiterLimit: 4
836
- }), { paths: V, xml: he.documentElement };
1083
+ }), { paths: G, xml: de.documentElement };
837
1084
  }
838
1085
  /**
839
1086
  * Creates from the given shape path and array of shapes.
@@ -841,8 +1088,8 @@ class Ie extends ct {
841
1088
  * @param {ShapePath} shapePath - The shape path.
842
1089
  * @return {Array<Shape>} An array of shapes.
843
1090
  */
844
- static createShapes(a) {
845
- const M = {
1091
+ static createShapes(i) {
1092
+ const I = {
846
1093
  ORIGIN: 0,
847
1094
  DESTINATION: 1,
848
1095
  BETWEEN: 2,
@@ -850,133 +1097,133 @@ class Ie extends ct {
850
1097
  RIGHT: 4,
851
1098
  BEHIND: 5,
852
1099
  BEYOND: 6
853
- }, I = {
854
- loc: M.ORIGIN,
1100
+ }, N = {
1101
+ loc: I.ORIGIN,
855
1102
  t: 0
856
1103
  };
857
- function h(k, f, P, d) {
858
- const p = k.x, S = f.x, j = P.x, m = d.x, z = k.y, R = f.y, F = P.y, X = d.y, Z = (m - j) * (z - F) - (X - F) * (p - j), V = (S - p) * (z - F) - (R - z) * (p - j), K = (X - F) * (S - p) - (m - j) * (R - z), $ = Z / K, oe = V / K;
859
- if (K === 0 && Z !== 0 || $ <= 0 || $ >= 1 || oe < 0 || oe > 1)
1104
+ function h(g, u, E, y) {
1105
+ const m = g.x, v = u.x, U = E.x, d = y.x, w = g.y, T = u.y, _ = E.y, q = y.y, Y = (d - U) * (w - _) - (q - _) * (m - U), G = (v - m) * (w - _) - (T - w) * (m - U), K = (q - _) * (v - m) - (d - U) * (T - w), Z = Y / K, oe = G / K;
1106
+ if (K === 0 && Y !== 0 || Z <= 0 || Z >= 1 || oe < 0 || oe > 1)
860
1107
  return null;
861
- if (Z === 0 && K === 0) {
1108
+ if (Y === 0 && K === 0) {
862
1109
  for (let J = 0; J < 2; J++)
863
- if (v(J === 0 ? P : d, k, f), I.loc == M.ORIGIN) {
864
- const U = J === 0 ? P : d;
865
- return { x: U.x, y: U.y, t: I.t };
866
- } else if (I.loc == M.BETWEEN) {
867
- const U = +(p + I.t * (S - p)).toPrecision(10), g = +(z + I.t * (R - z)).toPrecision(10);
868
- return { x: U, y: g, t: I.t };
1110
+ if (B(J === 0 ? E : y, g, u), N.loc == I.ORIGIN) {
1111
+ const X = J === 0 ? E : y;
1112
+ return { x: X.x, y: X.y, t: N.t };
1113
+ } else if (N.loc == I.BETWEEN) {
1114
+ const X = +(m + N.t * (v - m)).toPrecision(10), x = +(w + N.t * (T - w)).toPrecision(10);
1115
+ return { x: X, y: x, t: N.t };
869
1116
  }
870
1117
  return null;
871
1118
  } else {
872
- for (let g = 0; g < 2; g++)
873
- if (v(g === 0 ? P : d, k, f), I.loc == M.ORIGIN) {
874
- const te = g === 0 ? P : d;
875
- return { x: te.x, y: te.y, t: I.t };
1119
+ for (let x = 0; x < 2; x++)
1120
+ if (B(x === 0 ? E : y, g, u), N.loc == I.ORIGIN) {
1121
+ const ne = x === 0 ? E : y;
1122
+ return { x: ne.x, y: ne.y, t: N.t };
876
1123
  }
877
- const J = +(p + $ * (S - p)).toPrecision(10), U = +(z + $ * (R - z)).toPrecision(10);
878
- return { x: J, y: U, t: $ };
1124
+ const J = +(m + Z * (v - m)).toPrecision(10), X = +(w + Z * (T - w)).toPrecision(10);
1125
+ return { x: J, y: X, t: Z };
879
1126
  }
880
1127
  }
881
- function v(k, f, P) {
882
- const d = P.x - f.x, p = P.y - f.y, S = k.x - f.x, j = k.y - f.y, m = d * j - S * p;
883
- if (k.x === f.x && k.y === f.y) {
884
- I.loc = M.ORIGIN, I.t = 0;
1128
+ function B(g, u, E) {
1129
+ const y = E.x - u.x, m = E.y - u.y, v = g.x - u.x, U = g.y - u.y, d = y * U - v * m;
1130
+ if (g.x === u.x && g.y === u.y) {
1131
+ N.loc = I.ORIGIN, N.t = 0;
885
1132
  return;
886
1133
  }
887
- if (k.x === P.x && k.y === P.y) {
888
- I.loc = M.DESTINATION, I.t = 1;
1134
+ if (g.x === E.x && g.y === E.y) {
1135
+ N.loc = I.DESTINATION, N.t = 1;
889
1136
  return;
890
1137
  }
891
- if (m < -Number.EPSILON) {
892
- I.loc = M.LEFT;
1138
+ if (d < -Number.EPSILON) {
1139
+ N.loc = I.LEFT;
893
1140
  return;
894
1141
  }
895
- if (m > Number.EPSILON) {
896
- I.loc = M.RIGHT;
1142
+ if (d > Number.EPSILON) {
1143
+ N.loc = I.RIGHT;
897
1144
  return;
898
1145
  }
899
- if (d * S < 0 || p * j < 0) {
900
- I.loc = M.BEHIND;
1146
+ if (y * v < 0 || m * U < 0) {
1147
+ N.loc = I.BEHIND;
901
1148
  return;
902
1149
  }
903
- if (Math.sqrt(d * d + p * p) < Math.sqrt(S * S + j * j)) {
904
- I.loc = M.BEYOND;
1150
+ if (Math.sqrt(y * y + m * m) < Math.sqrt(v * v + U * U)) {
1151
+ N.loc = I.BEYOND;
905
1152
  return;
906
1153
  }
907
- let z;
908
- d !== 0 ? z = S / d : z = j / p, I.loc = M.BETWEEN, I.t = z;
1154
+ let w;
1155
+ y !== 0 ? w = v / y : w = U / m, N.loc = I.BETWEEN, N.t = w;
909
1156
  }
910
- function x(k, f) {
911
- const P = [], d = [];
912
- for (let p = 1; p < k.length; p++) {
913
- const S = k[p - 1], j = k[p];
914
- for (let m = 1; m < f.length; m++) {
915
- const z = f[m - 1], R = f[m], F = h(S, j, z, R);
916
- F !== null && P.find((X) => X.t <= F.t + Number.EPSILON && X.t >= F.t - Number.EPSILON) === void 0 && (P.push(F), d.push(new Q(F.x, F.y)));
1157
+ function W(g, u) {
1158
+ const E = [], y = [];
1159
+ for (let m = 1; m < g.length; m++) {
1160
+ const v = g[m - 1], U = g[m];
1161
+ for (let d = 1; d < u.length; d++) {
1162
+ const w = u[d - 1], T = u[d], _ = h(v, U, w, T);
1163
+ _ !== null && E.find((q) => q.t <= _.t + Number.EPSILON && q.t >= _.t - Number.EPSILON) === void 0 && (E.push(_), y.push(new Q(_.x, _.y)));
917
1164
  }
918
1165
  }
919
- return d;
1166
+ return y;
920
1167
  }
921
- function q(k, f, P) {
922
- const d = new Q();
923
- f.getCenter(d);
924
- const p = [];
925
- return P.forEach((S) => {
926
- S.boundingBox.containsPoint(d) && x(k, S.points).forEach((m) => {
927
- p.push({ identifier: S.identifier, isCW: S.isCW, point: m });
1168
+ function p(g, u, E) {
1169
+ const y = new Q();
1170
+ u.getCenter(y);
1171
+ const m = [];
1172
+ return E.forEach((v) => {
1173
+ v.boundingBox.containsPoint(y) && W(g, v.points).forEach((d) => {
1174
+ m.push({ identifier: v.identifier, isCW: v.isCW, point: d });
928
1175
  });
929
- }), p.sort((S, j) => S.point.x - j.point.x), p;
1176
+ }), m.sort((v, U) => v.point.x - U.point.x), m;
930
1177
  }
931
- function T(k, f, P, d, p) {
932
- (p == null || p === "") && (p = "nonzero");
933
- const S = new Q();
934
- k.boundingBox.getCenter(S);
935
- const j = [new Q(P, S.y), new Q(d, S.y)], m = q(j, k.boundingBox, f);
936
- m.sort((V, K) => V.point.x - K.point.x);
937
- const z = [], R = [];
938
- m.forEach((V) => {
939
- V.identifier === k.identifier ? z.push(V) : R.push(V);
1178
+ function k(g, u, E, y, m) {
1179
+ (m == null || m === "") && (m = "nonzero");
1180
+ const v = new Q();
1181
+ g.boundingBox.getCenter(v);
1182
+ const U = [new Q(E, v.y), new Q(y, v.y)], d = p(U, g.boundingBox, u);
1183
+ d.sort((G, K) => G.point.x - K.point.x);
1184
+ const w = [], T = [];
1185
+ d.forEach((G) => {
1186
+ G.identifier === g.identifier ? w.push(G) : T.push(G);
940
1187
  });
941
- const F = z[0].point.x, X = [];
942
- let Z = 0;
943
- for (; Z < R.length && R[Z].point.x < F; )
944
- X.length > 0 && X[X.length - 1] === R[Z].identifier ? X.pop() : X.push(R[Z].identifier), Z++;
945
- if (X.push(k.identifier), p === "evenodd") {
946
- const V = X.length % 2 === 0, K = X[X.length - 2];
947
- return { identifier: k.identifier, isHole: V, for: K };
948
- } else if (p === "nonzero") {
949
- let V = !0, K = null, $ = null;
950
- for (let oe = 0; oe < X.length; oe++) {
951
- const J = X[oe];
952
- V ? ($ = f[J].isCW, V = !1, K = J) : $ !== f[J].isCW && ($ = f[J].isCW, V = !0);
1188
+ const _ = w[0].point.x, q = [];
1189
+ let Y = 0;
1190
+ for (; Y < T.length && T[Y].point.x < _; )
1191
+ q.length > 0 && q[q.length - 1] === T[Y].identifier ? q.pop() : q.push(T[Y].identifier), Y++;
1192
+ if (q.push(g.identifier), m === "evenodd") {
1193
+ const G = q.length % 2 === 0, K = q[q.length - 2];
1194
+ return { identifier: g.identifier, isHole: G, for: K };
1195
+ } else if (m === "nonzero") {
1196
+ let G = !0, K = null, Z = null;
1197
+ for (let oe = 0; oe < q.length; oe++) {
1198
+ const J = q[oe];
1199
+ G ? (Z = u[J].isCW, G = !1, K = J) : Z !== u[J].isCW && (Z = u[J].isCW, G = !0);
953
1200
  }
954
- return { identifier: k.identifier, isHole: V, for: K };
1201
+ return { identifier: g.identifier, isHole: G, for: K };
955
1202
  } else
956
- console.warn('fill-rule: "' + p + '" is currently not implemented.');
1203
+ console.warn('fill-rule: "' + m + '" is currently not implemented.');
957
1204
  }
958
- let H = 999999999, G = -999999999, E = a.subPaths.map((k) => {
959
- const f = k.getPoints();
960
- let P = -999999999, d = 999999999, p = -999999999, S = 999999999;
961
- for (let j = 0; j < f.length; j++) {
962
- const m = f[j];
963
- m.y > P && (P = m.y), m.y < d && (d = m.y), m.x > p && (p = m.x), m.x < S && (S = m.x);
1205
+ let z = 999999999, O = -999999999, C = i.subPaths.map((g) => {
1206
+ const u = g.getPoints();
1207
+ let E = -999999999, y = 999999999, m = -999999999, v = 999999999;
1208
+ for (let U = 0; U < u.length; U++) {
1209
+ const d = u[U];
1210
+ d.y > E && (E = d.y), d.y < y && (y = d.y), d.x > m && (m = d.x), d.x < v && (v = d.x);
964
1211
  }
965
- return G <= p && (G = p + 1), H >= S && (H = S - 1), { curves: k.curves, points: f, isCW: ft.isClockWise(f), identifier: -1, boundingBox: new ut(new Q(S, d), new Q(p, P)) };
1212
+ return O <= m && (O = m + 1), z >= v && (z = v - 1), { curves: g.curves, points: u, isCW: kt.isClockWise(u), identifier: -1, boundingBox: new wt(new Q(v, y), new Q(m, E)) };
966
1213
  });
967
- E = E.filter((k) => k.points.length > 1);
968
- for (let k = 0; k < E.length; k++)
969
- E[k].identifier = k;
970
- const W = E.map((k) => T(k, E, H, G, a.userData ? a.userData.style.fillRule : void 0)), N = [];
971
- return E.forEach((k) => {
972
- if (!W[k.identifier].isHole) {
973
- const P = new ht();
974
- P.curves = k.curves, W.filter((p) => p.isHole && p.for === k.identifier).forEach((p) => {
975
- const S = E[p.identifier], j = new Ne();
976
- j.curves = S.curves, P.holes.push(j);
977
- }), N.push(P);
1214
+ C = C.filter((g) => g.points.length > 1);
1215
+ for (let g = 0; g < C.length; g++)
1216
+ C[g].identifier = g;
1217
+ const V = C.map((g) => k(g, C, z, O, i.userData ? i.userData.style.fillRule : void 0)), P = [];
1218
+ return C.forEach((g) => {
1219
+ if (!V[g.identifier].isHole) {
1220
+ const E = new At();
1221
+ E.curves = g.curves, V.filter((m) => m.isHole && m.for === g.identifier).forEach((m) => {
1222
+ const v = C[m.identifier], U = new Ee();
1223
+ U.curves = v.curves, E.holes.push(U);
1224
+ }), P.push(E);
978
1225
  }
979
- }), N;
1226
+ }), P;
980
1227
  }
981
1228
  /**
982
1229
  * Returns a stroke style object from the given parameters.
@@ -988,12 +1235,12 @@ class Ie extends ct {
988
1235
  * @param {number} [miterLimit=4] - Maximum join length, in multiples of the `width` parameter (join is truncated if it exceeds that distance).
989
1236
  * @return {Object} The style object.
990
1237
  */
991
- static getStrokeStyle(a, A, M, I, h) {
992
- return a = a !== void 0 ? a : 1, A = A !== void 0 ? A : "#000", M = M !== void 0 ? M : "miter", I = I !== void 0 ? I : "butt", h = h !== void 0 ? h : 4, {
993
- strokeColor: A,
994
- strokeWidth: a,
995
- strokeLineJoin: M,
996
- strokeLineCap: I,
1238
+ static getStrokeStyle(i, M, I, N, h) {
1239
+ return i = i !== void 0 ? i : 1, M = M !== void 0 ? M : "#000", I = I !== void 0 ? I : "miter", N = N !== void 0 ? N : "butt", h = h !== void 0 ? h : 4, {
1240
+ strokeColor: M,
1241
+ strokeWidth: i,
1242
+ strokeLineJoin: I,
1243
+ strokeLineCap: N,
997
1244
  strokeMiterLimit: h
998
1245
  };
999
1246
  }
@@ -1007,12 +1254,12 @@ class Ie extends ct {
1007
1254
  * @return {?BufferGeometry} The stroke geometry. UV coordinates are generated ('u' along path. 'v' across it, from left to right).
1008
1255
  * Returns `null` if not geometry was generated.
1009
1256
  */
1010
- static pointsToStroke(a, A, M, I) {
1011
- const h = [], v = [], x = [];
1012
- if (Ie.pointsToStrokeWithBuffers(a, A, M, I, h, v, x) === 0)
1257
+ static pointsToStroke(i, M, I, N) {
1258
+ const h = [], B = [], W = [];
1259
+ if (Me.pointsToStrokeWithBuffers(i, M, I, N, h, B, W) === 0)
1013
1260
  return null;
1014
- const q = new mt();
1015
- return q.setAttribute("position", new Ee(h, 3)), q.setAttribute("normal", new Ee(v, 3)), q.setAttribute("uv", new Ee(x, 2)), q;
1261
+ const p = new Mt();
1262
+ return p.setAttribute("position", new Ce(h, 3)), p.setAttribute("normal", new Ce(B, 3)), p.setAttribute("uv", new Ce(W, 2)), p;
1016
1263
  }
1017
1264
  /**
1018
1265
  * Creates a stroke from an array of points.
@@ -1027,435 +1274,485 @@ class Ie extends ct {
1027
1274
  * @param {number} [vertexOffset=0] - The vertex offset.
1028
1275
  * @return {number} The number of vertices.
1029
1276
  */
1030
- static pointsToStrokeWithBuffers(a, A, M, I, h, v, x, q) {
1031
- const T = new Q(), H = new Q(), G = new Q(), E = new Q(), W = new Q(), N = new Q(), k = new Q(), f = new Q(), P = new Q(), d = new Q(), p = new Q(), S = new Q(), j = new Q(), m = new Q(), z = new Q(), R = new Q(), F = new Q();
1032
- M = M !== void 0 ? M : 12, I = I !== void 0 ? I : 1e-3, q = q !== void 0 ? q : 0, a = O(a);
1033
- const X = a.length;
1034
- if (X < 2) return 0;
1035
- const Z = a[0].equals(a[X - 1]);
1036
- let V, K = a[0], $;
1037
- const oe = A.strokeWidth / 2, J = 1 / (X - 1);
1038
- let U = 0, g, te, ee, se, he = !1, ce = 0, r = q * 3, o = q * 2;
1039
- t(a[0], a[1], T).multiplyScalar(oe), f.copy(a[0]).sub(T), P.copy(a[0]).add(T), d.copy(f), p.copy(P);
1040
- for (let l = 1; l < X; l++) {
1041
- V = a[l], l === X - 1 ? Z ? $ = a[1] : $ = void 0 : $ = a[l + 1];
1042
- const b = T;
1043
- if (t(K, V, b), G.copy(b).multiplyScalar(oe), S.copy(V).sub(G), j.copy(V).add(G), g = U + J, te = !1, $ !== void 0) {
1044
- t(V, $, H), G.copy(H).multiplyScalar(oe), m.copy(V).sub(G), z.copy(V).add(G), ee = !0, G.subVectors($, K), b.dot(G) < 0 && (ee = !1), l === 1 && (he = ee), G.subVectors($, V), G.normalize();
1045
- const L = Math.abs(b.dot(G));
1046
- if (L > Number.EPSILON) {
1047
- const D = oe / L;
1048
- G.multiplyScalar(-D), E.subVectors(V, K), W.copy(E).setLength(D).add(G), R.copy(W).negate();
1049
- const s = W.length(), n = E.length();
1050
- E.divideScalar(n), N.subVectors($, V);
1051
- const B = N.length();
1052
- switch (N.divideScalar(B), E.dot(R) < n && N.dot(R) < B && (te = !0), F.copy(W).add(V), R.add(V), se = !1, te ? ee ? (z.copy(R), j.copy(R)) : (m.copy(R), S.copy(R)) : y(), A.strokeLineJoin) {
1277
+ static pointsToStrokeWithBuffers(i, M, I, N, h, B, W, p) {
1278
+ const k = new Q(), z = new Q(), O = new Q(), C = new Q(), V = new Q(), P = new Q(), g = new Q(), u = new Q(), E = new Q(), y = new Q(), m = new Q(), v = new Q(), U = new Q(), d = new Q(), w = new Q(), T = new Q(), _ = new Q();
1279
+ I = I !== void 0 ? I : 12, N = N !== void 0 ? N : 1e-3, p = p !== void 0 ? p : 0, i = D(i);
1280
+ const q = i.length;
1281
+ if (q < 2) return 0;
1282
+ const Y = i[0].equals(i[q - 1]);
1283
+ let G, K = i[0], Z;
1284
+ const oe = M.strokeWidth / 2, J = 1 / (q - 1);
1285
+ let X = 0, x, ne, ee, ie, de = !1, fe = 0, r = p * 3, o = p * 2;
1286
+ t(i[0], i[1], k).multiplyScalar(oe), u.copy(i[0]).sub(k), E.copy(i[0]).add(k), y.copy(u), m.copy(E);
1287
+ for (let f = 1; f < q; f++) {
1288
+ G = i[f], f === q - 1 ? Y ? Z = i[1] : Z = void 0 : Z = i[f + 1];
1289
+ const A = k;
1290
+ if (t(K, G, A), O.copy(A).multiplyScalar(oe), v.copy(G).sub(O), U.copy(G).add(O), x = X + J, ne = !1, Z !== void 0) {
1291
+ t(G, Z, z), O.copy(z).multiplyScalar(oe), d.copy(G).sub(O), w.copy(G).add(O), ee = !0, O.subVectors(Z, K), A.dot(O) < 0 && (ee = !1), f === 1 && (de = ee), O.subVectors(Z, G), O.normalize();
1292
+ const F = Math.abs(A.dot(O));
1293
+ if (F > Number.EPSILON) {
1294
+ const j = oe / F;
1295
+ O.multiplyScalar(-j), C.subVectors(G, K), V.copy(C).setLength(j).add(O), T.copy(V).negate();
1296
+ const s = V.length(), n = C.length();
1297
+ C.divideScalar(n), P.subVectors(Z, G);
1298
+ const H = P.length();
1299
+ switch (P.divideScalar(H), C.dot(T) < n && P.dot(T) < H && (ne = !0), _.copy(V).add(G), T.add(G), ie = !1, ne ? ee ? (w.copy(T), U.copy(T)) : (d.copy(T), v.copy(T)) : b(), M.strokeLineJoin) {
1053
1300
  case "bevel":
1054
- i(ee, te, g);
1301
+ a(ee, ne, x);
1055
1302
  break;
1056
1303
  case "round":
1057
- w(ee, te), ee ? c(V, S, m, g, 0) : c(V, z, j, g, 1);
1304
+ S(ee, ne), ee ? c(G, v, d, x, 0) : c(G, w, U, x, 1);
1058
1305
  break;
1059
1306
  case "miter":
1060
1307
  case "miter-clip":
1061
1308
  default:
1062
- const Y = oe * A.strokeMiterLimit / s;
1063
- if (Y < 1)
1064
- if (A.strokeLineJoin !== "miter-clip") {
1065
- i(ee, te, g);
1309
+ const $ = oe * M.strokeMiterLimit / s;
1310
+ if ($ < 1)
1311
+ if (M.strokeLineJoin !== "miter-clip") {
1312
+ a(ee, ne, x);
1066
1313
  break;
1067
1314
  } else
1068
- w(ee, te), ee ? (N.subVectors(F, S).multiplyScalar(Y).add(S), k.subVectors(F, m).multiplyScalar(Y).add(m), e(S, g, 0), e(N, g, 0), e(V, g, 0.5), e(V, g, 0.5), e(N, g, 0), e(k, g, 0), e(V, g, 0.5), e(k, g, 0), e(m, g, 0)) : (N.subVectors(F, j).multiplyScalar(Y).add(j), k.subVectors(F, z).multiplyScalar(Y).add(z), e(j, g, 1), e(N, g, 1), e(V, g, 0.5), e(V, g, 0.5), e(N, g, 1), e(k, g, 1), e(V, g, 0.5), e(k, g, 1), e(z, g, 1));
1315
+ S(ee, ne), ee ? (P.subVectors(_, v).multiplyScalar($).add(v), g.subVectors(_, d).multiplyScalar($).add(d), e(v, x, 0), e(P, x, 0), e(G, x, 0.5), e(G, x, 0.5), e(P, x, 0), e(g, x, 0), e(G, x, 0.5), e(g, x, 0), e(d, x, 0)) : (P.subVectors(_, U).multiplyScalar($).add(U), g.subVectors(_, w).multiplyScalar($).add(w), e(U, x, 1), e(P, x, 1), e(G, x, 0.5), e(G, x, 0.5), e(P, x, 1), e(g, x, 1), e(G, x, 0.5), e(g, x, 1), e(w, x, 1));
1069
1316
  else
1070
- te ? (ee ? (e(P, U, 1), e(f, U, 0), e(F, g, 0), e(P, U, 1), e(F, g, 0), e(R, g, 1)) : (e(P, U, 1), e(f, U, 0), e(F, g, 1), e(f, U, 0), e(R, g, 0), e(F, g, 1)), ee ? m.copy(F) : z.copy(F)) : ee ? (e(S, g, 0), e(F, g, 0), e(V, g, 0.5), e(V, g, 0.5), e(F, g, 0), e(m, g, 0)) : (e(j, g, 1), e(F, g, 1), e(V, g, 0.5), e(V, g, 0.5), e(F, g, 1), e(z, g, 1)), se = !0;
1317
+ ne ? (ee ? (e(E, X, 1), e(u, X, 0), e(_, x, 0), e(E, X, 1), e(_, x, 0), e(T, x, 1)) : (e(E, X, 1), e(u, X, 0), e(_, x, 1), e(u, X, 0), e(T, x, 0), e(_, x, 1)), ee ? d.copy(_) : w.copy(_)) : ee ? (e(v, x, 0), e(_, x, 0), e(G, x, 0.5), e(G, x, 0.5), e(_, x, 0), e(d, x, 0)) : (e(U, x, 1), e(_, x, 1), e(G, x, 0.5), e(G, x, 0.5), e(_, x, 1), e(w, x, 1)), ie = !0;
1071
1318
  break;
1072
1319
  }
1073
1320
  } else
1074
- y();
1321
+ b();
1075
1322
  } else
1076
- y();
1077
- !Z && l === X - 1 && C(a[0], d, p, ee, !0, U), U = g, K = V, f.copy(m), P.copy(z);
1323
+ b();
1324
+ !Y && f === q - 1 && L(i[0], y, m, ee, !0, X), X = x, K = G, u.copy(d), E.copy(w);
1078
1325
  }
1079
- if (!Z)
1080
- C(V, S, j, ee, !1, g);
1081
- else if (te && h) {
1082
- let l = F, b = R;
1083
- he !== ee && (l = R, b = F), ee ? (se || he) && (b.toArray(h, 0 * 3), b.toArray(h, 3 * 3), se && l.toArray(h, 1 * 3)) : (se || !he) && (b.toArray(h, 1 * 3), b.toArray(h, 3 * 3), se && l.toArray(h, 0 * 3));
1326
+ if (!Y)
1327
+ L(G, v, U, ee, !1, x);
1328
+ else if (ne && h) {
1329
+ let f = _, A = T;
1330
+ de !== ee && (f = T, A = _), ee ? (ie || de) && (A.toArray(h, 0 * 3), A.toArray(h, 3 * 3), ie && f.toArray(h, 1 * 3)) : (ie || !de) && (A.toArray(h, 1 * 3), A.toArray(h, 3 * 3), ie && f.toArray(h, 0 * 3));
1084
1331
  }
1085
- return ce;
1086
- function t(l, b, L) {
1087
- return L.subVectors(b, l), L.set(-L.y, L.x).normalize();
1332
+ return fe;
1333
+ function t(f, A, F) {
1334
+ return F.subVectors(A, f), F.set(-F.y, F.x).normalize();
1088
1335
  }
1089
- function e(l, b, L) {
1090
- h && (h[r] = l.x, h[r + 1] = l.y, h[r + 2] = 0, v && (v[r] = 0, v[r + 1] = 0, v[r + 2] = 1), r += 3, x && (x[o] = b, x[o + 1] = L, o += 2)), ce += 3;
1336
+ function e(f, A, F) {
1337
+ h && (h[r] = f.x, h[r + 1] = f.y, h[r + 2] = 0, B && (B[r] = 0, B[r + 1] = 0, B[r + 2] = 1), r += 3, W && (W[o] = A, W[o + 1] = F, o += 2)), fe += 3;
1091
1338
  }
1092
- function c(l, b, L, D, s) {
1093
- T.copy(b).sub(l).normalize(), H.copy(L).sub(l).normalize();
1339
+ function c(f, A, F, j, s) {
1340
+ k.copy(A).sub(f).normalize(), z.copy(F).sub(f).normalize();
1094
1341
  let n = Math.PI;
1095
- const B = T.dot(H);
1096
- Math.abs(B) < 1 && (n = Math.abs(Math.acos(B))), n /= M, G.copy(b);
1097
- for (let Y = 0, ae = M - 1; Y < ae; Y++)
1098
- E.copy(G).rotateAround(l, n), e(G, D, s), e(E, D, s), e(l, D, 0.5), G.copy(E);
1099
- e(E, D, s), e(L, D, s), e(l, D, 0.5);
1342
+ const H = k.dot(z);
1343
+ Math.abs(H) < 1 && (n = Math.abs(Math.acos(H))), n /= I, O.copy(A);
1344
+ for (let $ = 0, ce = I - 1; $ < ce; $++)
1345
+ C.copy(O).rotateAround(f, n), e(O, j, s), e(C, j, s), e(f, j, 0.5), O.copy(C);
1346
+ e(C, j, s), e(F, j, s), e(f, j, 0.5);
1100
1347
  }
1101
- function y() {
1102
- e(P, U, 1), e(f, U, 0), e(S, g, 0), e(P, U, 1), e(S, g, 0), e(j, g, 1);
1348
+ function b() {
1349
+ e(E, X, 1), e(u, X, 0), e(v, x, 0), e(E, X, 1), e(v, x, 0), e(U, x, 1);
1103
1350
  }
1104
- function i(l, b, L) {
1105
- b ? l ? (e(P, U, 1), e(f, U, 0), e(S, g, 0), e(P, U, 1), e(S, g, 0), e(R, g, 1), e(S, L, 0), e(m, L, 0), e(R, L, 0.5)) : (e(P, U, 1), e(f, U, 0), e(j, g, 1), e(f, U, 0), e(R, g, 0), e(j, g, 1), e(j, L, 1), e(R, L, 0), e(z, L, 1)) : l ? (e(S, L, 0), e(m, L, 0), e(V, L, 0.5)) : (e(j, L, 1), e(z, L, 0), e(V, L, 0.5));
1351
+ function a(f, A, F) {
1352
+ A ? f ? (e(E, X, 1), e(u, X, 0), e(v, x, 0), e(E, X, 1), e(v, x, 0), e(T, x, 1), e(v, F, 0), e(d, F, 0), e(T, F, 0.5)) : (e(E, X, 1), e(u, X, 0), e(U, x, 1), e(u, X, 0), e(T, x, 0), e(U, x, 1), e(U, F, 1), e(T, F, 0), e(w, F, 1)) : f ? (e(v, F, 0), e(d, F, 0), e(G, F, 0.5)) : (e(U, F, 1), e(w, F, 0), e(G, F, 0.5));
1106
1353
  }
1107
- function w(l, b) {
1108
- b && (l ? (e(P, U, 1), e(f, U, 0), e(S, g, 0), e(P, U, 1), e(S, g, 0), e(R, g, 1), e(S, U, 0), e(V, g, 0.5), e(R, g, 1), e(V, g, 0.5), e(m, U, 0), e(R, g, 1)) : (e(P, U, 1), e(f, U, 0), e(j, g, 1), e(f, U, 0), e(R, g, 0), e(j, g, 1), e(j, U, 1), e(R, g, 0), e(V, g, 0.5), e(V, g, 0.5), e(R, g, 0), e(z, U, 1)));
1354
+ function S(f, A) {
1355
+ A && (f ? (e(E, X, 1), e(u, X, 0), e(v, x, 0), e(E, X, 1), e(v, x, 0), e(T, x, 1), e(v, X, 0), e(G, x, 0.5), e(T, x, 1), e(G, x, 0.5), e(d, X, 0), e(T, x, 1)) : (e(E, X, 1), e(u, X, 0), e(U, x, 1), e(u, X, 0), e(T, x, 0), e(U, x, 1), e(U, X, 1), e(T, x, 0), e(G, x, 0.5), e(G, x, 0.5), e(T, x, 0), e(w, X, 1)));
1109
1356
  }
1110
- function C(l, b, L, D, s, n) {
1111
- switch (A.strokeLineCap) {
1357
+ function L(f, A, F, j, s, n) {
1358
+ switch (M.strokeLineCap) {
1112
1359
  case "round":
1113
- s ? c(l, L, b, n, 0.5) : c(l, b, L, n, 0.5);
1360
+ s ? c(f, F, A, n, 0.5) : c(f, A, F, n, 0.5);
1114
1361
  break;
1115
1362
  case "square":
1116
1363
  if (s)
1117
- T.subVectors(b, l), H.set(T.y, -T.x), G.addVectors(T, H).add(l), E.subVectors(H, T).add(l), D ? (G.toArray(h, 1 * 3), E.toArray(h, 0 * 3), E.toArray(h, 3 * 3)) : (G.toArray(h, 1 * 3), x[3 * 2 + 1] === 1 ? E.toArray(h, 3 * 3) : G.toArray(h, 3 * 3), E.toArray(h, 0 * 3));
1364
+ k.subVectors(A, f), z.set(k.y, -k.x), O.addVectors(k, z).add(f), C.subVectors(z, k).add(f), j ? (O.toArray(h, 1 * 3), C.toArray(h, 0 * 3), C.toArray(h, 3 * 3)) : (O.toArray(h, 1 * 3), W[3 * 2 + 1] === 1 ? C.toArray(h, 3 * 3) : O.toArray(h, 3 * 3), C.toArray(h, 0 * 3));
1118
1365
  else {
1119
- T.subVectors(L, l), H.set(T.y, -T.x), G.addVectors(T, H).add(l), E.subVectors(H, T).add(l);
1120
- const B = h.length;
1121
- D ? (G.toArray(h, B - 1 * 3), E.toArray(h, B - 2 * 3), E.toArray(h, B - 4 * 3)) : (E.toArray(h, B - 2 * 3), G.toArray(h, B - 1 * 3), E.toArray(h, B - 4 * 3));
1366
+ k.subVectors(F, f), z.set(k.y, -k.x), O.addVectors(k, z).add(f), C.subVectors(z, k).add(f);
1367
+ const H = h.length;
1368
+ j ? (O.toArray(h, H - 1 * 3), C.toArray(h, H - 2 * 3), C.toArray(h, H - 4 * 3)) : (C.toArray(h, H - 2 * 3), O.toArray(h, H - 1 * 3), C.toArray(h, H - 4 * 3));
1122
1369
  }
1123
1370
  break;
1124
1371
  }
1125
1372
  }
1126
- function O(l) {
1127
- let b = !1;
1128
- for (let D = 1, s = l.length - 1; D < s; D++)
1129
- if (l[D].distanceTo(l[D + 1]) < I) {
1130
- b = !0;
1373
+ function D(f) {
1374
+ let A = !1;
1375
+ for (let j = 1, s = f.length - 1; j < s; j++)
1376
+ if (f[j].distanceTo(f[j + 1]) < N) {
1377
+ A = !0;
1131
1378
  break;
1132
1379
  }
1133
- if (!b) return l;
1134
- const L = [];
1135
- L.push(l[0]);
1136
- for (let D = 1, s = l.length - 1; D < s; D++)
1137
- l[D].distanceTo(l[D + 1]) >= I && L.push(l[D]);
1138
- return L.push(l[l.length - 1]), L;
1380
+ if (!A) return f;
1381
+ const F = [];
1382
+ F.push(f[0]);
1383
+ for (let j = 1, s = f.length - 1; j < s; j++)
1384
+ f[j].distanceTo(f[j + 1]) >= N && F.push(f[j]);
1385
+ return F.push(f[f.length - 1]), F;
1139
1386
  }
1140
1387
  }
1141
1388
  }
1142
- const kt = -2;
1143
- function At(u) {
1144
- if (!u || u.nodeType !== 1) return;
1145
- let a = u;
1146
- for (; a; ) {
1147
- const A = a.getAttribute("id");
1148
- if (A) return A;
1149
- a = a.parentElement;
1389
+ const Lt = -2;
1390
+ function Bt(l) {
1391
+ if (!l || l.nodeType !== 1) return;
1392
+ let i = l;
1393
+ for (; i; ) {
1394
+ const M = i.getAttribute("id");
1395
+ if (M) return M;
1396
+ i = i.parentElement;
1150
1397
  }
1151
1398
  }
1152
- function Ce(u) {
1153
- if (!u) return !1;
1154
- let a = u;
1155
- for (; a; ) {
1156
- const A = a.getAttribute("id") ?? "", M = a.getAttribute("data-name") ?? "";
1157
- if (Oe(A) || Oe(M) || ve(A) || ve(M)) return !0;
1158
- a = a.parentElement;
1399
+ function Se(l) {
1400
+ if (!l) return !1;
1401
+ let i = l;
1402
+ for (; i; ) {
1403
+ const M = i.getAttribute("id") ?? "", I = i.getAttribute("data-name") ?? "";
1404
+ if (Oe(M) || Oe(I) || _e(M) || _e(I)) return !0;
1405
+ i = i.parentElement;
1159
1406
  }
1160
1407
  return !1;
1161
1408
  }
1162
- function It(u, a) {
1163
- return a ? a + encodeURIComponent(u) : u;
1164
- }
1165
- function wt({
1166
- url: u,
1167
- suppressIds: a,
1168
- imageProxyUrl: A,
1169
- is3d: M = !1
1409
+ function Dt({
1410
+ url: l,
1411
+ suppressIds: i,
1412
+ imageProxyUrl: M,
1413
+ is3d: I = !1
1170
1414
  }) {
1171
- const [I, h] = ue(null);
1172
- me(() => {
1173
- let x = !1;
1174
- const q = It(u, A);
1175
- return fetch(q).then((T) => {
1176
- if (!T.ok) throw new Error(`SVG fetch ${T.status}`);
1177
- return T.text();
1178
- }).then((T) => {
1179
- if (x) return;
1180
- const H = $e(T), G = new Ie();
1181
- h(G.parse(H));
1182
- }).catch((T) => {
1183
- x || (h(null), console.warn(
1184
- `[eyeon-map] Outdoor SVG failed to load from ${q}. If this is a cross-origin error, pass \`imageProxyUrl\` to MapViewer.`,
1185
- T
1415
+ const [N, h] = ae(null);
1416
+ le(() => {
1417
+ let W = !1;
1418
+ const p = it(l, M);
1419
+ return fetch(p).then((k) => {
1420
+ if (!k.ok) throw new Error(`SVG fetch ${k.status}`);
1421
+ return k.text();
1422
+ }).then((k) => {
1423
+ if (W) return;
1424
+ const z = ot(k), O = new Me();
1425
+ h(O.parse(z));
1426
+ }).catch((k) => {
1427
+ W || (h(null), console.warn(
1428
+ `[eyeon-map] Outdoor SVG failed to load from ${p}. If this is a cross-origin error, pass \`imageProxyUrl\` to MapViewer.`,
1429
+ k
1186
1430
  ));
1187
1431
  }), () => {
1188
- x = !0;
1432
+ W = !0;
1189
1433
  };
1190
- }, [u, A]);
1191
- const v = ie(() => {
1192
- var T, H, G;
1193
- if (!I) return [];
1194
- const x = [];
1195
- let q = 0;
1196
- for (const E of I.paths) {
1197
- const W = (T = E.userData) == null ? void 0 : T.node, N = At(W);
1198
- if (N != null && N.toLowerCase().startsWith("route-path") || N && (a != null && a.has(N)) || Ce(W) && !N || N && (Oe(N) || ve(N)) || W && Ce(W) && N && (a != null && a.has(N)) || W && Ce(W)) continue;
1199
- const k = Ie.createShapes(E);
1200
- if (k.length === 0) continue;
1201
- const f = Ze(N), P = new fe.Color();
1202
- f != null && f.fill ? P.set(f.fill) : E.color ? P.copy(E.color) : P.set("#cccccc"), f != null && f.stroke && !f.fill && P.set(f.stroke);
1203
- const d = typeof ((G = (H = E.userData) == null ? void 0 : H.style) == null ? void 0 : G.opacity) == "number" ? E.userData.style.opacity : 1, p = M && (f == null ? void 0 : f.extrudeHeight) != null ? f.extrudeHeight : 0;
1204
- x.push({
1205
- key: `${N ?? "path"}-${q++}`,
1206
- shapes: k,
1207
- color: P,
1208
- opacity: d,
1209
- extrude: p,
1210
- renderOrder: (f == null ? void 0 : f.renderOrder) ?? 2
1434
+ }, [l, M]);
1435
+ const B = re(() => {
1436
+ var k, z, O;
1437
+ if (!N) return [];
1438
+ const W = [];
1439
+ let p = 0;
1440
+ for (const C of N.paths) {
1441
+ const V = (k = C.userData) == null ? void 0 : k.node, P = Bt(V);
1442
+ if (P != null && P.toLowerCase().startsWith("route-path") || P && (rt(P) || st(P)) || P && (i != null && i.has(P)) || Se(V) && !P || P && (Oe(P) || _e(P)) || V && Se(V) && P && (i != null && i.has(P)) || V && Se(V)) continue;
1443
+ const g = Me.createShapes(C);
1444
+ if (g.length === 0) continue;
1445
+ const u = We(P), E = new ue.Color();
1446
+ u != null && u.fill ? E.set(u.fill) : C.color ? E.copy(C.color) : E.set("#cccccc"), u != null && u.stroke && !u.fill && E.set(u.stroke);
1447
+ const y = typeof ((O = (z = C.userData) == null ? void 0 : z.style) == null ? void 0 : O.opacity) == "number" ? C.userData.style.opacity : 1, m = I && (u == null ? void 0 : u.extrudeHeight) != null ? u.extrudeHeight : 0;
1448
+ W.push({
1449
+ key: `${P ?? "path"}-${p++}`,
1450
+ shapes: g,
1451
+ color: E,
1452
+ opacity: y,
1453
+ extrude: m,
1454
+ renderOrder: (u == null ? void 0 : u.renderOrder) ?? 2
1211
1455
  });
1212
1456
  }
1213
- return x;
1214
- }, [I, a, M]);
1215
- return !I || v.length === 0 ? null : /* @__PURE__ */ _("group", { position: [0, 0, kt], renderOrder: -20, children: v.map(
1216
- (x) => x.shapes.map((q, T) => /* @__PURE__ */ ne("mesh", { renderOrder: x.renderOrder, children: [
1217
- x.extrude > 0 ? /* @__PURE__ */ _(
1457
+ return W;
1458
+ }, [N, i, I]);
1459
+ return !N || B.length === 0 ? null : /* @__PURE__ */ R("group", { position: [0, 0, Lt], renderOrder: -20, children: B.map(
1460
+ (W) => W.shapes.map((p, k) => /* @__PURE__ */ te("mesh", { renderOrder: W.renderOrder, children: [
1461
+ W.extrude > 0 ? /* @__PURE__ */ R(
1218
1462
  "extrudeGeometry",
1219
1463
  {
1220
- args: [q, { depth: x.extrude, bevelEnabled: !1 }]
1464
+ args: [p, { depth: W.extrude, bevelEnabled: !1 }]
1221
1465
  }
1222
- ) : /* @__PURE__ */ _("shapeGeometry", { args: [q] }),
1223
- /* @__PURE__ */ _(
1466
+ ) : /* @__PURE__ */ R("shapeGeometry", { args: [p] }),
1467
+ /* @__PURE__ */ R(
1224
1468
  "meshBasicMaterial",
1225
1469
  {
1226
- color: x.color,
1227
- transparent: x.opacity < 1,
1228
- opacity: x.opacity,
1470
+ color: W.color,
1471
+ transparent: W.opacity < 1,
1472
+ opacity: W.opacity,
1229
1473
  depthWrite: !1,
1230
1474
  toneMapped: !1,
1231
- side: fe.DoubleSide
1475
+ side: ue.DoubleSide
1232
1476
  }
1233
1477
  )
1234
- ] }, `${x.key}-${T}`))
1478
+ ] }, `${W.key}-${k}`))
1235
1479
  ) });
1236
1480
  }
1237
- const Mt = [1, -1, 1];
1238
- function Tt(u) {
1481
+ const Gt = [1, -1, 1];
1482
+ function zt(l) {
1239
1483
  return {
1240
- ...u,
1241
- minY: -u.maxY,
1242
- maxY: -u.minY,
1243
- cy: -u.cy
1484
+ ...l,
1485
+ minY: -l.maxY,
1486
+ maxY: -l.minY,
1487
+ cy: -l.cy
1244
1488
  };
1245
1489
  }
1246
- function Be(u, a, A, M) {
1247
- const I = Math.max(u, 1) / Math.max(A, 1), h = Math.max(a, 1) / Math.max(M, 1);
1248
- return Math.min(I, h);
1490
+ function ze(l, i, M, I) {
1491
+ const N = Math.max(l, 1) / Math.max(M, 1), h = Math.max(i, 1) / Math.max(I, 1);
1492
+ return Math.min(N, h);
1249
1493
  }
1250
- function Ve(u) {
1494
+ function Ve(l) {
1251
1495
  return {
1252
- width: Math.max(u.maxX - u.minX, 1),
1253
- height: Math.max(u.maxY - u.minY, 1)
1496
+ width: Math.max(l.maxX - l.minX, 1),
1497
+ height: Math.max(l.maxY - l.minY, 1)
1254
1498
  };
1255
1499
  }
1256
- function Nt(u, a, A, M, I) {
1257
- const h = 1 + Math.min(Math.max(A, 0.15), 1) * 0.5, v = a > 0 ? u * h : u / h;
1258
- return Math.min(I, Math.max(M, v));
1500
+ const Vt = 240;
1501
+ function Ft(l) {
1502
+ return 1 - (1 - Math.min(1, Math.max(0, l))) ** 3;
1259
1503
  }
1260
- const Et = 0, je = 1, Se = 2, Ct = 0, St = 1, ze = 2;
1261
- function Ot(u) {
1262
- return u ? { LEFT: Et, MIDDLE: je, RIGHT: Se } : { LEFT: Se, MIDDLE: je, RIGHT: Se };
1504
+ function jt(l, i, M) {
1505
+ return l + (i - l) * M;
1263
1506
  }
1264
- function vt(u) {
1265
- return u ? { ONE: Ct, TWO: ze } : { ONE: St, TWO: ze };
1507
+ function Ht(l, i, M, I, N) {
1508
+ const h = 1 + Math.min(Math.max(M, 0.15), 1) * 0.5, B = i > 0 ? l * h : l / h;
1509
+ return Math.min(N, Math.max(I, B));
1266
1510
  }
1267
- function Pt({
1268
- bounds: u,
1269
- theme: a,
1270
- is3d: A,
1271
- controlsRef: M,
1272
- cameraRef: I
1511
+ const Ut = 0, Fe = 1, ve = 2, Wt = 0, qt = 1, je = 2;
1512
+ function Xt(l) {
1513
+ return l ? { LEFT: Ut, MIDDLE: Fe, RIGHT: ve } : { LEFT: ve, MIDDLE: Fe, RIGHT: ve };
1514
+ }
1515
+ function Yt(l) {
1516
+ return l ? { ONE: Wt, TWO: je } : { ONE: qt, TWO: je };
1517
+ }
1518
+ function $t({
1519
+ bounds: l,
1520
+ theme: i,
1521
+ is3d: M,
1522
+ controlsRef: I,
1523
+ cameraRef: N
1273
1524
  }) {
1274
- const { camera: h, size: v, invalidate: x } = rt(), q = Ae(!1), T = _e(() => {
1275
- const G = M.current, { width: E, height: W } = Ve(u);
1276
- if (h.up.set(0, 1, 0), h instanceof fe.OrthographicCamera && !A) {
1277
- const N = Be(v.width, v.height, E, W);
1278
- h.position.set(u.cx, u.cy, 500), h.zoom = N, h.updateProjectionMatrix();
1525
+ const { camera: h, size: B, invalidate: W } = ht(), p = he(!1), k = he(null), z = be(() => {
1526
+ k.current != null && (cancelAnimationFrame(k.current), k.current = null);
1527
+ }, []), O = be(
1528
+ (g) => {
1529
+ if (!(h instanceof ue.OrthographicCamera)) return;
1530
+ z();
1531
+ const u = h.zoom;
1532
+ if (u === g) return;
1533
+ const E = performance.now(), y = (m) => {
1534
+ if (!(h instanceof ue.OrthographicCamera)) return;
1535
+ const v = Math.min(1, (m - E) / Vt);
1536
+ if (h.zoom = jt(u, g, Ft(v)), h.updateProjectionMatrix(), W(), v < 1) {
1537
+ k.current = requestAnimationFrame(y);
1538
+ return;
1539
+ }
1540
+ k.current = null;
1541
+ };
1542
+ k.current = requestAnimationFrame(y);
1543
+ },
1544
+ [h, z, W]
1545
+ ), C = be(() => {
1546
+ z();
1547
+ const g = I.current, { width: u, height: E } = Ve(l);
1548
+ if (h.up.set(0, 1, 0), h instanceof ue.OrthographicCamera && !M) {
1549
+ const y = ze(B.width, B.height, u, E);
1550
+ h.position.set(l.cx, l.cy, 500), h.zoom = y, h.updateProjectionMatrix();
1279
1551
  } else
1280
- h.position.set(u.cx, u.cy - u.size * 0.35, u.size * 0.85), h.lookAt(u.cx, u.cy, 0);
1281
- G && (G.target.set(u.cx, u.cy, 0), G.update()), x();
1552
+ h.position.set(l.cx, l.cy - l.size * 0.35, l.size * 0.85), h.lookAt(l.cx, l.cy, 0);
1553
+ g && (g.target.set(l.cx, l.cy, 0), g.update()), W();
1282
1554
  }, [
1283
- u,
1555
+ l.cx,
1556
+ l.cy,
1557
+ l.maxX,
1558
+ l.maxY,
1559
+ l.minX,
1560
+ l.minY,
1561
+ l.size,
1284
1562
  h,
1563
+ I,
1564
+ W,
1285
1565
  M,
1286
- x,
1287
- A,
1288
- v.height,
1289
- v.width
1290
- ]), H = _e(
1291
- (G) => {
1292
- q.current = !0;
1293
- const E = M.current;
1294
- if (h instanceof fe.OrthographicCamera && !A) {
1295
- const { width: W, height: N } = Ve(u), k = Be(v.width, v.height, W, N);
1296
- h.zoom = Nt(
1297
- h.zoom,
1298
- G,
1299
- a.ZOOM_STEP,
1300
- k * 0.2,
1301
- k * 10
1302
- ), h.updateProjectionMatrix();
1303
- } else if (E) {
1304
- const W = h.position.clone().sub(E.target), N = 1 + Math.min(Math.max(a.ZOOM_STEP, 0.15), 1) * 0.5, k = G > 0 ? W.length() / N : W.length() * N;
1305
- W.setLength(
1306
- Math.min(a.CAMERA_MAX_DISTANCE, Math.max(a.CAMERA_MIN_DISTANCE, k))
1307
- ), h.position.copy(E.target).add(W);
1566
+ B.height,
1567
+ B.width,
1568
+ z
1569
+ ]), V = he(C);
1570
+ V.current = C;
1571
+ const P = be(
1572
+ (g) => {
1573
+ p.current = !0;
1574
+ const u = I.current;
1575
+ if (h instanceof ue.OrthographicCamera && !M) {
1576
+ const { width: E, height: y } = Ve(l), m = ze(B.width, B.height, E, y);
1577
+ O(
1578
+ Ht(
1579
+ h.zoom,
1580
+ g,
1581
+ i.ZOOM_STEP,
1582
+ m * 0.2,
1583
+ m * 10
1584
+ )
1585
+ );
1586
+ } else if (u) {
1587
+ const E = h.position.clone().sub(u.target), y = 1 + Math.min(Math.max(i.ZOOM_STEP, 0.15), 1) * 0.5, m = g > 0 ? E.length() / y : E.length() * y;
1588
+ E.setLength(
1589
+ Math.min(i.CAMERA_MAX_DISTANCE, Math.max(i.CAMERA_MIN_DISTANCE, m))
1590
+ ), h.position.copy(u.target).add(E);
1308
1591
  }
1309
- E == null || E.update(), x();
1592
+ u == null || u.update(), W();
1310
1593
  },
1311
- [u, h, M, x, A, v.height, v.width, a]
1594
+ [O, l, h, I, W, M, B.height, B.width, i]
1312
1595
  );
1313
- return qe(
1314
- I,
1596
+ return le(() => () => z(), [z]), $e(
1597
+ N,
1315
1598
  () => ({
1316
- zoomIn: () => H(1),
1317
- zoomOut: () => H(-1),
1599
+ zoomIn: () => P(1),
1600
+ zoomOut: () => P(-1),
1318
1601
  reset: () => {
1319
- q.current = !1, T();
1602
+ p.current = !1, C();
1320
1603
  }
1321
1604
  }),
1322
- [T, H]
1323
- ), me(() => {
1324
- v.width < 2 || v.height < 2 || (q.current = !1, T());
1325
- }, [T, u.cx, u.cy, u.maxX, u.maxY, u.minX, u.minY]), me(() => {
1326
- v.width < 2 || v.height < 2 || q.current || T();
1327
- }, [T, v.height, v.width]), null;
1605
+ [C, P]
1606
+ ), le(() => {
1607
+ B.width < 2 || B.height < 2 || (p.current = !1, V.current());
1608
+ }, [l.cx, l.cy, l.maxX, l.maxY, l.minX, l.minY, M]), le(() => {
1609
+ B.width < 2 || B.height < 2 || p.current || V.current();
1610
+ }, [B.height, B.width]), null;
1328
1611
  }
1329
- const Rt = -1;
1330
- function Lt({
1331
- doc: u,
1332
- theme: a,
1333
- activeLevelId: A,
1334
- route: M,
1335
- selectedRetailerId: I,
1612
+ const Zt = -1, He = [0, 1, 0], Qt = [1, 2], Kt = { antialias: !0 };
1613
+ function Jt({
1614
+ doc: l,
1615
+ theme: i,
1616
+ activeLevelId: M,
1617
+ route: I,
1618
+ selectedRetailerId: N,
1336
1619
  cameraRef: h,
1337
- onSelectShape: v,
1338
- imageProxyUrl: x,
1339
- eventSource: q
1620
+ onSelectShape: B,
1621
+ imageProxyUrl: W,
1622
+ eventSource: p
1340
1623
  }) {
1341
- const T = a.MAP_STYLE === "3D", H = Ae(null), G = ie(
1342
- () => Qe(u.levels, A),
1343
- [u.levels, A]
1344
- ), E = ie(
1345
- () => Ke(u.levels, A, u.baseViewbox),
1346
- [u.levels, u.baseViewbox, A]
1347
- ), W = ie(() => Tt(E), [E]), N = ie(
1348
- () => u.levels.find((d) => Me(d)) ?? null,
1349
- [u.levels]
1350
- ), k = (N == null ? void 0 : N.sourceSvgUrl) ?? u.baseSvgUrl ?? null, f = ie(() => {
1351
- const d = /* @__PURE__ */ new Set();
1352
- if (!N) return d;
1353
- for (const p of N.shapes)
1354
- p.sourceSvgId && d.add(p.sourceSvgId);
1355
- return d;
1356
- }, [N]), P = G.some((d) => Me(d));
1357
- return /* @__PURE__ */ ne(
1358
- st,
1624
+ const k = i.MAP_STYLE === "3D", z = he(null), O = re(
1625
+ () => at(l.levels, M),
1626
+ [l.levels, M]
1627
+ ), C = re(
1628
+ () => ct(l.levels, M, l.baseViewbox),
1629
+ [l.levels, l.baseViewbox, M]
1630
+ ), V = re(
1631
+ () => zt(C),
1632
+ [
1633
+ C.cx,
1634
+ C.cy,
1635
+ C.maxX,
1636
+ C.maxY,
1637
+ C.minX,
1638
+ C.minY,
1639
+ C.size
1640
+ ]
1641
+ ), P = re(
1642
+ () => [V.cx, V.cy, 500],
1643
+ [V.cx, V.cy]
1644
+ ), g = re(
1645
+ () => [V.cx, V.cy, 0],
1646
+ [V.cx, V.cy]
1647
+ ), u = re(
1648
+ () => [V.cx, V.cy - V.size * 0.35, V.size * 0.85],
1649
+ [V.cx, V.cy, V.size]
1650
+ ), E = re(() => Xt(k), [k]), y = re(() => Yt(k), [k]), m = re(
1651
+ () => l.levels.find((w) => Ne(w)) ?? null,
1652
+ [l.levels]
1653
+ ), v = (m == null ? void 0 : m.sourceSvgUrl) ?? l.baseSvgUrl ?? null, U = re(() => m ? lt(m.shapes, { omitStaticLayers: !0 }) : /* @__PURE__ */ new Set(), [m]), d = O.some((w) => Ne(w));
1654
+ return /* @__PURE__ */ te(
1655
+ dt,
1359
1656
  {
1360
- style: { width: "100%", height: "100%", background: a.MAP_BACKGROUND_COLOR },
1361
- eventSource: q ?? void 0,
1657
+ style: { width: "100%", height: "100%", background: i.MAP_BACKGROUND_COLOR },
1658
+ eventSource: p ?? void 0,
1362
1659
  eventPrefix: "offset",
1363
- orthographic: !T,
1364
- dpr: [1, 2],
1660
+ orthographic: !k,
1661
+ dpr: Qt,
1365
1662
  flat: !0,
1366
- gl: { antialias: !0 },
1367
- camera: T ? {
1368
- position: [W.cx, W.cy - W.size * 0.35, W.size * 0.85],
1663
+ gl: Kt,
1664
+ camera: k ? {
1665
+ position: u,
1369
1666
  fov: 50,
1370
1667
  near: 1,
1371
1668
  far: 1e4,
1372
- up: [0, 1, 0]
1669
+ up: He
1373
1670
  } : void 0,
1374
1671
  children: [
1375
- !T && /* @__PURE__ */ _(
1376
- it,
1672
+ !k && /* @__PURE__ */ R(
1673
+ yt,
1377
1674
  {
1378
1675
  makeDefault: !0,
1379
- position: [W.cx, W.cy, 500],
1380
- up: [0, 1, 0],
1676
+ position: P,
1677
+ up: He,
1381
1678
  near: 0.1,
1382
1679
  far: 5e3
1383
1680
  }
1384
1681
  ),
1385
- /* @__PURE__ */ _("color", { attach: "background", args: [a.MAP_BACKGROUND_COLOR] }),
1386
- /* @__PURE__ */ _("ambientLight", { intensity: 4, color: "#c4c4c4" }),
1387
- /* @__PURE__ */ _("directionalLight", { position: [0, 400, 0], color: "#ffffff", intensity: 0.3 }),
1388
- /* @__PURE__ */ _("directionalLight", { position: [0, 0, 400], color: "#c4c4c4", intensity: 0.2 }),
1389
- /* @__PURE__ */ _("directionalLight", { position: [0, 0, -400], color: "#c4c4c4", intensity: 0.2 }),
1390
- /* @__PURE__ */ ne("group", { scale: Mt, children: [
1391
- P && k ? /* @__PURE__ */ _(
1392
- wt,
1682
+ /* @__PURE__ */ R("color", { attach: "background", args: [i.MAP_BACKGROUND_COLOR] }),
1683
+ /* @__PURE__ */ R("ambientLight", { intensity: 4, color: "#c4c4c4" }),
1684
+ /* @__PURE__ */ R("directionalLight", { position: [0, 400, 0], color: "#ffffff", intensity: 0.3 }),
1685
+ /* @__PURE__ */ R("directionalLight", { position: [0, 0, 400], color: "#c4c4c4", intensity: 0.2 }),
1686
+ /* @__PURE__ */ R("directionalLight", { position: [0, 0, -400], color: "#c4c4c4", intensity: 0.2 }),
1687
+ /* @__PURE__ */ te("group", { scale: Gt, children: [
1688
+ d && v ? /* @__PURE__ */ R(
1689
+ Dt,
1393
1690
  {
1394
- url: k,
1395
- suppressIds: f,
1396
- imageProxyUrl: x,
1397
- is3d: T
1691
+ url: v,
1692
+ suppressIds: U,
1693
+ imageProxyUrl: W,
1694
+ is3d: k
1398
1695
  }
1399
1696
  ) : null,
1400
- G.map((d) => {
1401
- const p = Me(d), S = d.transform;
1402
- return /* @__PURE__ */ _(
1697
+ O.map((w) => {
1698
+ const T = Ne(w), _ = w.transform;
1699
+ return /* @__PURE__ */ R(
1403
1700
  "group",
1404
1701
  {
1405
1702
  position: [
1406
- S.translateX,
1407
- S.translateY,
1408
- p ? Rt : 0
1703
+ _.translateX,
1704
+ _.translateY,
1705
+ T ? Zt : 0
1409
1706
  ],
1410
- rotation: [0, 0, S.rotate * Math.PI / 180],
1411
- scale: S.scale || 1,
1412
- children: /* @__PURE__ */ _(
1413
- gt,
1707
+ rotation: [0, 0, _.rotate * Math.PI / 180],
1708
+ scale: _.scale || 1,
1709
+ children: /* @__PURE__ */ R(
1710
+ _t,
1414
1711
  {
1415
- level: d,
1416
- theme: a,
1417
- is3d: T,
1418
- selectedRetailerId: I,
1419
- interactiveOnly: p && !!k,
1420
- onSelectShape: (j) => v == null ? void 0 : v(j, d.id)
1712
+ level: w,
1713
+ theme: i,
1714
+ is3d: k,
1715
+ selectedRetailerId: N,
1716
+ interactiveOnly: T && !!v,
1717
+ onSelectShape: (q) => B == null ? void 0 : B(q, w.id)
1421
1718
  }
1422
1719
  )
1423
1720
  },
1424
- d.id
1721
+ w.id
1425
1722
  );
1426
1723
  }),
1427
- M && /* @__PURE__ */ _(
1428
- bt,
1724
+ I && /* @__PURE__ */ R(
1725
+ Pt,
1429
1726
  {
1430
- route: M,
1431
- activeLevelId: A,
1432
- color: a.ACCENT_COLOR
1727
+ route: I,
1728
+ activeLevelId: M,
1729
+ color: i.ACCENT_COLOR
1433
1730
  }
1434
1731
  )
1435
1732
  ] }),
1436
- /* @__PURE__ */ _(
1437
- at,
1733
+ /* @__PURE__ */ R(
1734
+ gt,
1438
1735
  {
1439
- ref: H,
1736
+ ref: z,
1440
1737
  makeDefault: !0,
1441
1738
  enableDamping: !1,
1442
- enableRotate: T,
1739
+ enableRotate: k,
1443
1740
  enablePan: !0,
1444
1741
  screenSpacePanning: !0,
1445
- mouseButtons: Ot(T),
1446
- touches: vt(T),
1447
- target: [W.cx, W.cy, 0],
1448
- maxDistance: a.CAMERA_MAX_DISTANCE,
1449
- minDistance: a.CAMERA_MIN_DISTANCE
1742
+ mouseButtons: E,
1743
+ touches: y,
1744
+ target: g,
1745
+ maxDistance: i.CAMERA_MAX_DISTANCE,
1746
+ minDistance: i.CAMERA_MIN_DISTANCE
1450
1747
  }
1451
1748
  ),
1452
- /* @__PURE__ */ _(
1453
- Pt,
1749
+ /* @__PURE__ */ R(
1750
+ $t,
1454
1751
  {
1455
- bounds: W,
1456
- theme: a,
1457
- is3d: T,
1458
- controlsRef: H,
1752
+ bounds: V,
1753
+ theme: i,
1754
+ is3d: k,
1755
+ controlsRef: z,
1459
1756
  cameraRef: h
1460
1757
  }
1461
1758
  )
@@ -1463,305 +1760,248 @@ function Lt({
1463
1760
  }
1464
1761
  );
1465
1762
  }
1466
- function Fe(u, a) {
1467
- var A, M;
1468
- return ((A = u.assignment) == null ? void 0 : A.customLabel) || a || u.label.text || ((M = u.assignment) == null ? void 0 : M.unitNumber) || u.key;
1763
+ function Ue(l, i) {
1764
+ var M, I;
1765
+ return ((M = l.assignment) == null ? void 0 : M.customLabel) || i || l.label.text || ((I = l.assignment) == null ? void 0 : I.unitNumber) || l.key;
1469
1766
  }
1470
- function _t({
1471
- doc: u,
1472
- amenities: a,
1473
- onActiveLevelChange: A,
1474
- fromAnchorId: M,
1475
- toAnchorId: I,
1767
+ function en({
1768
+ doc: l,
1769
+ amenities: i,
1770
+ onActiveLevelChange: M,
1771
+ fromAnchorId: I,
1772
+ toAnchorId: N,
1476
1773
  onFromChange: h,
1477
- onToChange: v,
1478
- accessibleOnly: x,
1479
- onAccessibleOnlyChange: q,
1480
- route: T,
1481
- showSearch: H = !0,
1482
- showAmenities: G = !0
1774
+ onToChange: B,
1775
+ accessibleOnly: W,
1776
+ onAccessibleOnlyChange: p,
1777
+ route: k,
1778
+ showSearch: z = !0,
1779
+ showAmenities: O = !0
1483
1780
  }) {
1484
- const [E, W] = ue(""), [N, k] = ue(null), f = ie(() => {
1485
- var z;
1486
- const m = [];
1487
- for (const R of u.levels)
1488
- for (const F of R.shapes) {
1489
- const X = R.anchors.find((Z) => Z.shapeId === F.id) ?? null;
1490
- if (F.kind === "unit" && m.push({
1491
- id: `store-${F.id}`,
1492
- label: Fe(F),
1493
- group: R.name,
1494
- anchorId: (X == null ? void 0 : X.id) ?? null,
1495
- levelId: R.id,
1781
+ const [C, V] = ae(""), [P, g] = ae(null), u = re(() => {
1782
+ var w;
1783
+ const d = [];
1784
+ for (const T of l.levels)
1785
+ for (const _ of T.shapes) {
1786
+ const q = T.anchors.find((Y) => Y.shapeId === _.id) ?? null;
1787
+ if (_.kind === "unit" && d.push({
1788
+ id: `store-${_.id}`,
1789
+ label: Ue(_),
1790
+ group: T.name,
1791
+ anchorId: (q == null ? void 0 : q.id) ?? null,
1792
+ levelId: T.id,
1496
1793
  kind: "store",
1497
1794
  amenityId: null
1498
- }), F.kind === "amenity" && ((z = F.assignment) != null && z.amenityId)) {
1499
- const Z = a.find((V) => V.id === F.assignment.amenityId);
1500
- m.push({
1501
- id: `amenity-${F.id}`,
1502
- label: Fe(F, Z == null ? void 0 : Z.name),
1795
+ }), _.kind === "amenity" && ((w = _.assignment) != null && w.amenityId)) {
1796
+ const Y = i.find((G) => G.id === _.assignment.amenityId);
1797
+ d.push({
1798
+ id: `amenity-${_.id}`,
1799
+ label: Ue(_, Y == null ? void 0 : Y.name),
1503
1800
  group: "Amenities",
1504
- anchorId: (X == null ? void 0 : X.id) ?? null,
1505
- levelId: R.id,
1801
+ anchorId: (q == null ? void 0 : q.id) ?? null,
1802
+ levelId: T.id,
1506
1803
  kind: "amenity",
1507
- amenityId: (Z == null ? void 0 : Z.id) ?? F.assignment.amenityId
1804
+ amenityId: (Y == null ? void 0 : Y.id) ?? _.assignment.amenityId
1508
1805
  });
1509
1806
  }
1510
1807
  }
1511
- return m;
1512
- }, [u, a]), P = ie(() => {
1513
- const m = E.trim().toLowerCase();
1514
- return m ? f.filter((z) => z.label.toLowerCase().includes(m)) : f;
1515
- }, [f, E]), d = ie(() => {
1516
- const m = /* @__PURE__ */ new Map();
1517
- for (const z of P) {
1518
- const R = m.get(z.group) ?? [];
1519
- R.push(z), m.set(z.group, R);
1808
+ return d;
1809
+ }, [l, i]), E = re(() => {
1810
+ const d = C.trim().toLowerCase();
1811
+ return d ? u.filter((w) => w.label.toLowerCase().includes(d)) : u;
1812
+ }, [u, C]), y = re(() => {
1813
+ const d = /* @__PURE__ */ new Map();
1814
+ for (const w of E) {
1815
+ const T = d.get(w.group) ?? [];
1816
+ T.push(w), d.set(w.group, T);
1520
1817
  }
1521
- return Array.from(m.entries());
1522
- }, [P]), p = f.filter((m) => m.anchorId != null), S = E.trim().length > 0, j = (m) => {
1523
- k(m), m.anchorId != null && (v(m.anchorId), A(m.levelId));
1818
+ return Array.from(d.entries());
1819
+ }, [E]), m = u.filter((d) => d.anchorId != null), v = C.trim().length > 0, U = (d) => {
1820
+ g(d), d.anchorId != null && (B(d.anchorId), M(d.levelId));
1524
1821
  };
1525
- return !H && !(G && a.length > 0) ? null : /* @__PURE__ */ ne("div", { className: "eyeon-map-chrome", children: [
1526
- /* @__PURE__ */ ne("div", { className: "eyeon-map-chrome__top", children: [
1527
- H && /* @__PURE__ */ _(
1822
+ return !z && !(O && i.length > 0) ? null : /* @__PURE__ */ te("div", { className: "eyeon-map-chrome", children: [
1823
+ /* @__PURE__ */ te("div", { className: "eyeon-map-chrome__top", children: [
1824
+ z && /* @__PURE__ */ R(
1528
1825
  "input",
1529
1826
  {
1530
1827
  type: "search",
1531
1828
  className: "eyeon-map-chrome__search-input",
1532
1829
  placeholder: "Search...",
1533
1830
  "aria-label": "Search...",
1534
- value: E,
1535
- onChange: (m) => W(m.target.value)
1831
+ value: C,
1832
+ onChange: (d) => V(d.target.value)
1536
1833
  }
1537
1834
  ),
1538
- G && a.length > 0 && /* @__PURE__ */ _("div", { className: "eyeon-map-chrome__amenities", children: a.map((m) => /* @__PURE__ */ _(
1835
+ O && i.length > 0 && /* @__PURE__ */ R("div", { className: "eyeon-map-chrome__amenities", children: i.map((d) => /* @__PURE__ */ R(
1539
1836
  "button",
1540
1837
  {
1541
1838
  type: "button",
1542
1839
  className: "eyeon-map-chrome__amenity",
1543
- "aria-label": m.name,
1840
+ "aria-label": d.name,
1544
1841
  onClick: () => {
1545
- const z = f.find(
1546
- (R) => R.kind === "amenity" && R.amenityId === m.id && R.anchorId != null
1842
+ const w = u.find(
1843
+ (T) => T.kind === "amenity" && T.amenityId === d.id && T.anchorId != null
1547
1844
  );
1548
- z && j(z);
1845
+ w && U(w);
1549
1846
  },
1550
- children: m.builtinIcon ? /* @__PURE__ */ _("span", { className: "eyeon-map-chrome__amenity-icon", children: m.builtinIcon }) : /* @__PURE__ */ _("span", { className: "eyeon-map-chrome__amenity-label", children: m.name.slice(0, 2) })
1847
+ children: d.builtinIcon ? /* @__PURE__ */ R("span", { className: "eyeon-map-chrome__amenity-icon", children: d.builtinIcon }) : /* @__PURE__ */ R("span", { className: "eyeon-map-chrome__amenity-label", children: d.name.slice(0, 2) })
1551
1848
  },
1552
- m.id
1849
+ d.id
1553
1850
  )) })
1554
1851
  ] }),
1555
- H && S && /* @__PURE__ */ ne("div", { className: "eyeon-map-chrome__panel", children: [
1556
- /* @__PURE__ */ _("div", { className: "eyeon-map-chrome__groups", children: d.length === 0 ? /* @__PURE__ */ _("div", { className: "eyeon-map-chrome__empty", children: "No matching stores" }) : d.map(([m, z]) => /* @__PURE__ */ ne("div", { className: "eyeon-map-chrome__group", children: [
1557
- /* @__PURE__ */ _("div", { className: "eyeon-map-chrome__group-title", children: m }),
1558
- z.map((R) => /* @__PURE__ */ _(
1852
+ z && v && /* @__PURE__ */ te("div", { className: "eyeon-map-chrome__panel", children: [
1853
+ /* @__PURE__ */ R("div", { className: "eyeon-map-chrome__groups", children: y.length === 0 ? /* @__PURE__ */ R("div", { className: "eyeon-map-chrome__empty", children: "No matching stores" }) : y.map(([d, w]) => /* @__PURE__ */ te("div", { className: "eyeon-map-chrome__group", children: [
1854
+ /* @__PURE__ */ R("div", { className: "eyeon-map-chrome__group-title", children: d }),
1855
+ w.map((T) => /* @__PURE__ */ R(
1559
1856
  "button",
1560
1857
  {
1561
1858
  type: "button",
1562
- className: (N == null ? void 0 : N.id) === R.id ? "eyeon-map-chrome__item is-selected" : "eyeon-map-chrome__item",
1563
- onClick: () => j(R),
1564
- children: R.label
1859
+ className: (P == null ? void 0 : P.id) === T.id ? "eyeon-map-chrome__item is-selected" : "eyeon-map-chrome__item",
1860
+ onClick: () => U(T),
1861
+ children: T.label
1565
1862
  },
1566
- R.id
1863
+ T.id
1567
1864
  ))
1568
- ] }, m)) }),
1569
- N && /* @__PURE__ */ ne("div", { className: "eyeon-map-chrome__detail", children: [
1570
- /* @__PURE__ */ _("div", { className: "eyeon-map-chrome__detail-title", children: N.label }),
1571
- /* @__PURE__ */ _("div", { className: "eyeon-map-chrome__detail-meta", children: N.group })
1865
+ ] }, d)) }),
1866
+ P && /* @__PURE__ */ te("div", { className: "eyeon-map-chrome__detail", children: [
1867
+ /* @__PURE__ */ R("div", { className: "eyeon-map-chrome__detail-title", children: P.label }),
1868
+ /* @__PURE__ */ R("div", { className: "eyeon-map-chrome__detail-meta", children: P.group })
1572
1869
  ] }),
1573
- /* @__PURE__ */ ne("div", { className: "eyeon-map-chrome__route", children: [
1574
- /* @__PURE__ */ ne("label", { children: [
1870
+ /* @__PURE__ */ te("div", { className: "eyeon-map-chrome__route", children: [
1871
+ /* @__PURE__ */ te("label", { children: [
1575
1872
  "From",
1576
- /* @__PURE__ */ ne(
1577
- "select",
1873
+ /* @__PURE__ */ R(
1874
+ Ge,
1578
1875
  {
1579
- value: M ?? "",
1580
- onChange: (m) => h(m.target.value ? Number(m.target.value) : null),
1581
- children: [
1582
- /* @__PURE__ */ _("option", { value: "", children: "Select start" }),
1583
- p.map((m) => /* @__PURE__ */ _("option", { value: m.anchorId, children: m.label }, m.id))
1584
- ]
1876
+ ariaLabel: "From",
1877
+ value: I != null ? String(I) : "",
1878
+ placeholder: "Select start",
1879
+ searchable: !0,
1880
+ options: m.map((d) => ({
1881
+ value: String(d.anchorId),
1882
+ label: `${d.label} · ${d.group}`
1883
+ })),
1884
+ onChange: (d) => h(d ? Number(d) : null)
1585
1885
  }
1586
1886
  )
1587
1887
  ] }),
1588
- /* @__PURE__ */ ne("label", { children: [
1888
+ /* @__PURE__ */ te("label", { children: [
1589
1889
  "To",
1590
- /* @__PURE__ */ ne(
1591
- "select",
1890
+ /* @__PURE__ */ R(
1891
+ Ge,
1592
1892
  {
1593
- value: I ?? "",
1594
- onChange: (m) => v(m.target.value ? Number(m.target.value) : null),
1595
- children: [
1596
- /* @__PURE__ */ _("option", { value: "", children: "Select destination" }),
1597
- p.map((m) => /* @__PURE__ */ _("option", { value: m.anchorId, children: m.label }, m.id))
1598
- ]
1893
+ ariaLabel: "To",
1894
+ value: N != null ? String(N) : "",
1895
+ placeholder: "Select destination",
1896
+ searchable: !0,
1897
+ options: m.map((d) => ({
1898
+ value: String(d.anchorId),
1899
+ label: `${d.label} · ${d.group}`
1900
+ })),
1901
+ onChange: (d) => B(d ? Number(d) : null)
1599
1902
  }
1600
1903
  )
1601
1904
  ] }),
1602
- /* @__PURE__ */ ne("label", { className: "eyeon-map-chrome__accessible", children: [
1603
- /* @__PURE__ */ _(
1905
+ /* @__PURE__ */ te("label", { className: "eyeon-map-chrome__accessible", children: [
1906
+ /* @__PURE__ */ R(
1604
1907
  "input",
1605
1908
  {
1606
1909
  type: "checkbox",
1607
- checked: x,
1608
- onChange: (m) => q(m.target.checked)
1910
+ checked: W,
1911
+ onChange: (d) => p(d.target.checked)
1609
1912
  }
1610
1913
  ),
1611
1914
  "Accessible route"
1612
1915
  ] }),
1613
- T && /* @__PURE__ */ _("div", { className: "eyeon-map-chrome__route-meta", children: T.levelChanges.length > 0 ? `${T.levelChanges.length} level change(s)` : "Same level" })
1916
+ k && /* @__PURE__ */ R("div", { className: "eyeon-map-chrome__route-meta", children: k.levelChanges.length > 0 ? `${k.levelChanges.length} level change(s)` : "Same level" })
1614
1917
  ] })
1615
1918
  ] })
1616
1919
  ] });
1617
1920
  }
1618
- function Gt({
1619
- levels: u,
1620
- activeLevelId: a,
1621
- onActiveLevelChange: A,
1622
- onZoomIn: M,
1623
- onZoomOut: I,
1624
- onReset: h,
1625
- showFloors: v = !0,
1626
- showZoomReset: x = !0
1627
- }) {
1628
- const q = Je(u);
1629
- return !v && !x ? null : /* @__PURE__ */ _("div", { className: "eyeon-map-controls", children: /* @__PURE__ */ ne("div", { className: "eyeon-map-controls__stack", children: [
1630
- v && et(u) && /* @__PURE__ */ _("div", { className: "eyeon-map-controls__floors", role: "tablist", "aria-label": "Floors", children: q.map((T) => {
1631
- const H = T.id === a;
1632
- return /* @__PURE__ */ _(
1633
- "button",
1634
- {
1635
- type: "button",
1636
- role: "tab",
1637
- "aria-selected": H,
1638
- className: H ? "eyeon-map-controls__floor is-active" : "eyeon-map-controls__floor",
1639
- onClick: () => A(T.id),
1640
- children: T.name
1641
- },
1642
- T.id
1643
- );
1644
- }) }),
1645
- x && /* @__PURE__ */ ne(We, { children: [
1646
- /* @__PURE__ */ _(
1647
- "button",
1648
- {
1649
- type: "button",
1650
- className: "eyeon-map-controls__reset",
1651
- onClick: h,
1652
- "aria-label": "Reset map",
1653
- children: "Reset"
1654
- }
1655
- ),
1656
- /* @__PURE__ */ ne("div", { className: "eyeon-map-controls__zoom", children: [
1657
- /* @__PURE__ */ _(
1658
- "button",
1659
- {
1660
- type: "button",
1661
- className: "eyeon-map-controls__zoom-btn",
1662
- onClick: I,
1663
- "aria-label": "Zoom out",
1664
- children: "−"
1665
- }
1666
- ),
1667
- /* @__PURE__ */ _(
1668
- "button",
1669
- {
1670
- type: "button",
1671
- className: "eyeon-map-controls__zoom-btn",
1672
- onClick: M,
1673
- "aria-label": "Zoom in",
1674
- children: "+"
1675
- }
1676
- )
1677
- ] })
1678
- ] })
1679
- ] }) });
1680
- }
1681
- async function Dt(u, a, A) {
1682
- const M = u.replace(/\/$/, ""), I = new URLSearchParams();
1683
- a != null && a > 0 && I.set("center_id", String(a)), A && I.set("draft", "1");
1684
- const h = I.toString(), v = await fetch(`${M}/v1/map/document${h ? `?${h}` : ""}`, {
1921
+ async function tn(l, i, M) {
1922
+ const I = l.replace(/\/$/, ""), N = new URLSearchParams();
1923
+ i != null && i > 0 && N.set("center_id", String(i)), M && N.set("draft", "1");
1924
+ const h = N.toString(), B = await fetch(`${I}/v1/map/document${h ? `?${h}` : ""}`, {
1685
1925
  credentials: "include"
1686
1926
  });
1687
- if (!v.ok)
1688
- throw new Error(`Failed to load map document (${v.status})`);
1689
- return v.json();
1927
+ if (!B.ok)
1928
+ throw new Error(`Failed to load map document (${B.status})`);
1929
+ return B.json();
1690
1930
  }
1691
- function Ut(u) {
1931
+ function un(l) {
1692
1932
  const {
1693
- document: a,
1694
- webApiURI: A,
1695
- centerId: M,
1696
- host: I = "WEBSITE",
1933
+ document: i,
1934
+ webApiURI: M,
1935
+ centerId: I,
1936
+ host: N = "WEBSITE",
1697
1937
  kioskId: h = null,
1698
- selectedRetailerId: v = null,
1699
- themeOverrides: x,
1700
- onExtractedAmenities: q,
1701
- createRouteRef: T,
1702
- className: H,
1703
- style: G,
1704
- activeLevelId: E,
1705
- onActiveLevelChange: W,
1706
- routeOnSelect: N = !0,
1707
- imageProxyUrl: k
1708
- } = u, [f, P] = ue(a ?? null), d = ie(
1709
- () => f ? Ge(f) : null,
1710
- [f]
1711
- ), [p, S] = ue(null), [j, m] = ue(null), [z, R] = ue(null), [F, X] = ue(null), [Z, V] = ue(!1), [K, $] = ue(() => a ? De(Ge(a).levels) : null), oe = Ae(null), J = Ae(null), U = E ?? K, g = (r) => {
1712
- $(r), r != null && (W == null || W(r));
1938
+ selectedRetailerId: B = null,
1939
+ themeOverrides: W,
1940
+ onExtractedAmenities: p,
1941
+ createRouteRef: k,
1942
+ className: z,
1943
+ style: O,
1944
+ activeLevelId: C,
1945
+ onActiveLevelChange: V,
1946
+ routeOnSelect: P = !0,
1947
+ imageProxyUrl: g
1948
+ } = l, [u, E] = ae(i ?? null), y = re(
1949
+ () => u ? Be(u) : null,
1950
+ [u]
1951
+ ), [m, v] = ae(null), [U, d] = ae(null), [w, T] = ae(null), [_, q] = ae(null), [Y, G] = ae(!1), [K, Z] = ae(() => i ? De(Be(i).levels) : null), oe = he(null), J = he(null), X = C ?? K, x = (r) => {
1952
+ Z(r), r != null && (V == null || V(r));
1713
1953
  };
1714
- me(() => {
1715
- if (a) {
1716
- P(a);
1954
+ le(() => {
1955
+ if (i) {
1956
+ E(i);
1717
1957
  return;
1718
1958
  }
1719
- if (!A) return;
1959
+ if (!M) return;
1720
1960
  let r = !1;
1721
- const o = Te(I).fetchDraft;
1722
- return Dt(A, M, o).then((t) => {
1723
- r || P(t);
1961
+ const o = Te(N).fetchDraft;
1962
+ return tn(M, I, o).then((t) => {
1963
+ r || E(t);
1724
1964
  }).catch((t) => {
1725
- r || S(t instanceof Error ? t.message : String(t));
1965
+ r || v(t instanceof Error ? t.message : String(t));
1726
1966
  }), () => {
1727
1967
  r = !0;
1728
1968
  };
1729
- }, [a, A, M, I]), me(() => {
1969
+ }, [i, M, I, N]), le(() => {
1730
1970
  var t;
1731
- if (!d) return;
1732
- const r = new Set(d.levels.map((e) => e.id));
1733
- (U == null || !r.has(U)) && g(De(d.levels));
1971
+ if (!y) return;
1972
+ const r = new Set(y.levels.map((e) => e.id));
1973
+ (X == null || !r.has(X)) && x(De(y.levels));
1734
1974
  const o = /* @__PURE__ */ new Set();
1735
- for (const e of d.levels)
1975
+ for (const e of y.levels)
1736
1976
  for (const c of e.shapes)
1737
1977
  if (c.kind === "amenity" && ((t = c.assignment) == null ? void 0 : t.amenityId) != null) {
1738
- const y = d.amenities.find((i) => i.id === c.assignment.amenityId);
1739
- y && o.add(y.code);
1978
+ const b = y.amenities.find((a) => a.id === c.assignment.amenityId);
1979
+ b && o.add(b.code);
1740
1980
  }
1741
- q == null || q(Array.from(o));
1742
- }, [d, U, q]), me(() => {
1981
+ p == null || p(Array.from(o));
1982
+ }, [y, X, p]), le(() => {
1743
1983
  var r;
1744
- if (!(!d || v == null)) {
1745
- for (const o of d.levels)
1984
+ if (!(!y || B == null)) {
1985
+ for (const o of y.levels)
1746
1986
  for (const t of o.shapes)
1747
- if (((r = t.assignment) == null ? void 0 : r.retailerId) === v) {
1748
- g(o.id);
1987
+ if (((r = t.assignment) == null ? void 0 : r.retailerId) === B) {
1988
+ x(o.id);
1749
1989
  return;
1750
1990
  }
1751
1991
  }
1752
- }, [d, v]), me(() => {
1992
+ }, [y, B]), le(() => {
1753
1993
  var r;
1754
- if (!(!d || !Te(I).kioskOrigin || h == null)) {
1755
- for (const o of d.levels)
1994
+ if (!(!y || !Te(N).kioskOrigin || h == null)) {
1995
+ for (const o of y.levels)
1756
1996
  for (const t of o.shapes)
1757
1997
  if (t.kind === "kiosk_screen" && ((r = t.assignment) == null ? void 0 : r.kioskId) === h) {
1758
1998
  const e = o.anchors.find((c) => c.shapeId === t.id);
1759
- e && R(e.id);
1999
+ e && T(e.id);
1760
2000
  }
1761
2001
  }
1762
- }, [d, I, h]);
1763
- const te = ie(() => d ? tt(
1764
- d.graph.nodes.map((r) => ({
2002
+ }, [y, N, h]);
2003
+ const ne = re(() => y ? ut(
2004
+ y.graph.nodes.map((r) => ({
1765
2005
  id: r.id,
1766
2006
  levelId: r.levelId,
1767
2007
  shapeId: r.shapeId,
@@ -1770,9 +2010,9 @@ function Ut(u) {
1770
2010
  y: r.y,
1771
2011
  connectorId: r.connectorId
1772
2012
  })),
1773
- d.graph.edges.map((r) => ({
2013
+ y.graph.edges.map((r) => ({
1774
2014
  id: r.id,
1775
- mapId: d.mapId,
2015
+ mapId: y.mapId,
1776
2016
  fromAnchorId: r.from,
1777
2017
  toAnchorId: r.to,
1778
2018
  weight: r.weight,
@@ -1780,95 +2020,95 @@ function Ut(u) {
1780
2020
  accessible: r.accessible,
1781
2021
  kind: r.kind
1782
2022
  })),
1783
- d.connectors
1784
- ) : null, [d]), ee = (r, o) => {
1785
- if (!te || r == null || o == null) {
1786
- m(null);
2023
+ y.connectors
2024
+ ) : null, [y]), ee = (r, o) => {
2025
+ if (!ne || r == null || o == null) {
2026
+ d(null);
1787
2027
  return;
1788
2028
  }
1789
- const t = ot(te, r, o, { accessibleOnly: Z });
1790
- m(t);
2029
+ const t = mt(ne, r, o, { accessibleOnly: Y });
2030
+ d(t);
1791
2031
  };
1792
- me(() => {
1793
- ee(z, F);
1794
- }, [z, F, Z, te]), me(() => {
1795
- !T || !d || (T.current = {
2032
+ le(() => {
2033
+ ee(w, _);
2034
+ }, [w, _, Y, ne]), le(() => {
2035
+ !k || !y || (k.current = {
1796
2036
  createRouteToStore(r) {
1797
2037
  var o;
1798
- for (const t of d.levels)
2038
+ for (const t of y.levels)
1799
2039
  for (const e of t.shapes)
1800
2040
  if (((o = e.assignment) == null ? void 0 : o.retailerId) === r) {
1801
- const c = t.anchors.find((y) => y.shapeId === e.id);
1802
- c && (X(c.id), g(t.id));
2041
+ const c = t.anchors.find((b) => b.shapeId === e.id);
2042
+ c && (q(c.id), x(t.id));
1803
2043
  }
1804
2044
  },
1805
2045
  createRouteToAmenity(r) {
1806
2046
  var t;
1807
- const o = d.amenities.find((e) => e.code === r);
2047
+ const o = y.amenities.find((e) => e.code === r);
1808
2048
  if (o) {
1809
- for (const e of d.levels)
2049
+ for (const e of y.levels)
1810
2050
  for (const c of e.shapes)
1811
2051
  if (((t = c.assignment) == null ? void 0 : t.amenityId) === o.id) {
1812
- const y = e.anchors.find((i) => i.shapeId === c.id);
1813
- if (y) {
1814
- X(y.id), g(e.id);
2052
+ const b = e.anchors.find((a) => a.shapeId === c.id);
2053
+ if (b) {
2054
+ q(b.id), x(e.id);
1815
2055
  return;
1816
2056
  }
1817
2057
  }
1818
2058
  }
1819
2059
  },
1820
2060
  clearRoute() {
1821
- X(null), m(null);
2061
+ q(null), d(null);
1822
2062
  }
1823
2063
  });
1824
- }, [T, d]);
1825
- const se = nt(d == null ? void 0 : d.theme, x);
1826
- if (p)
1827
- return /* @__PURE__ */ _("div", { className: `eyeon-map-viewer eyeon-map-viewer--error ${H ?? ""}`, style: G, children: /* @__PURE__ */ _("div", { className: "eyeon-map-viewer__error", children: p }) });
1828
- if (!d)
1829
- return /* @__PURE__ */ _("div", { className: `eyeon-map-viewer eyeon-map-viewer--loading ${H ?? ""}`, style: G, children: /* @__PURE__ */ _("div", { className: "eyeon-map-viewer__loading", children: "Loading map…" }) });
1830
- const he = d.amenities.filter(
1831
- (r) => d.levels.some(
2064
+ }, [k, y]);
2065
+ const ie = ft(y == null ? void 0 : y.theme, W);
2066
+ if (m)
2067
+ return /* @__PURE__ */ R("div", { className: `eyeon-map-viewer eyeon-map-viewer--error ${z ?? ""}`, style: O, children: /* @__PURE__ */ R("div", { className: "eyeon-map-viewer__error", children: m }) });
2068
+ if (!y)
2069
+ return /* @__PURE__ */ R("div", { className: `eyeon-map-viewer eyeon-map-viewer--loading ${z ?? ""}`, style: O, children: /* @__PURE__ */ R("div", { className: "eyeon-map-viewer__loading", children: "Loading map…" }) });
2070
+ const de = y.amenities.filter(
2071
+ (r) => y.levels.some(
1832
2072
  (o) => o.shapes.some((t) => {
1833
2073
  var e;
1834
2074
  return ((e = t.assignment) == null ? void 0 : e.amenityId) === r.id;
1835
2075
  })
1836
2076
  )
1837
- ), ce = Te(I);
1838
- return /* @__PURE__ */ ne(
2077
+ ), fe = Te(N);
2078
+ return /* @__PURE__ */ te(
1839
2079
  "div",
1840
2080
  {
1841
- className: `eyeon-map-viewer eyeon-map-viewer--${I} ${H ?? ""}`,
2081
+ className: `eyeon-map-viewer eyeon-map-viewer--${N} ${z ?? ""}`,
1842
2082
  style: {
1843
- ...G,
1844
- "--map-accent": se.ACCENT_COLOR,
1845
- "--map-bg": se.MAP_BACKGROUND_COLOR
2083
+ ...O,
2084
+ "--map-accent": ie.ACCENT_COLOR,
2085
+ "--map-bg": ie.MAP_BACKGROUND_COLOR
1846
2086
  },
1847
2087
  children: [
1848
- (ce.search || ce.amenities) && /* @__PURE__ */ _(
1849
- _t,
2088
+ (fe.search || fe.amenities) && /* @__PURE__ */ R(
2089
+ en,
1850
2090
  {
1851
- doc: d,
1852
- amenities: he,
1853
- activeLevelId: U,
1854
- onActiveLevelChange: g,
1855
- fromAnchorId: z,
1856
- toAnchorId: F,
1857
- onFromChange: R,
1858
- onToChange: X,
1859
- accessibleOnly: Z,
1860
- onAccessibleOnlyChange: V,
1861
- route: j,
1862
- showSearch: ce.search,
1863
- showAmenities: ce.amenities
2091
+ doc: y,
2092
+ amenities: de,
2093
+ activeLevelId: X,
2094
+ onActiveLevelChange: x,
2095
+ fromAnchorId: w,
2096
+ toAnchorId: _,
2097
+ onFromChange: T,
2098
+ onToChange: q,
2099
+ accessibleOnly: Y,
2100
+ onAccessibleOnlyChange: G,
2101
+ route: U,
2102
+ showSearch: fe.search,
2103
+ showAmenities: fe.amenities
1864
2104
  }
1865
2105
  ),
1866
- /* @__PURE__ */ _(
1867
- Gt,
2106
+ /* @__PURE__ */ R(
2107
+ Tt,
1868
2108
  {
1869
- levels: d.levels,
1870
- activeLevelId: U,
1871
- onActiveLevelChange: g,
2109
+ levels: y.levels,
2110
+ activeLevelId: X,
2111
+ onActiveLevelChange: x,
1872
2112
  onZoomIn: () => {
1873
2113
  var r;
1874
2114
  return (r = oe.current) == null ? void 0 : r.zoomIn();
@@ -1881,28 +2121,28 @@ function Ut(u) {
1881
2121
  var r;
1882
2122
  return (r = oe.current) == null ? void 0 : r.reset();
1883
2123
  },
1884
- showFloors: ce.floors,
1885
- showZoomReset: ce.zoomReset
2124
+ showFloors: fe.floors,
2125
+ showZoomReset: fe.zoomReset
1886
2126
  }
1887
2127
  ),
1888
- /* @__PURE__ */ _("div", { ref: J, className: "eyeon-map-viewer__canvas", children: /* @__PURE__ */ _(Xe, { fallback: null, children: /* @__PURE__ */ _(
1889
- Lt,
2128
+ /* @__PURE__ */ R("div", { ref: J, className: "eyeon-map-viewer__canvas", children: /* @__PURE__ */ R(Ze, { fallback: null, children: /* @__PURE__ */ R(
2129
+ Jt,
1890
2130
  {
1891
- doc: d,
1892
- theme: se,
1893
- activeLevelId: U,
1894
- route: j,
1895
- selectedRetailerId: v,
2131
+ doc: y,
2132
+ theme: ie,
2133
+ activeLevelId: X,
2134
+ route: U,
2135
+ selectedRetailerId: B,
1896
2136
  cameraRef: oe,
1897
2137
  eventSource: J,
1898
- imageProxyUrl: k,
2138
+ imageProxyUrl: g,
1899
2139
  onSelectShape: (r, o) => {
1900
2140
  var t;
1901
- if (g(o), N) {
1902
- const e = d.levels.find((y) => y.id === o), c = e == null ? void 0 : e.anchors.find((y) => y.shapeId === r);
1903
- c && X(c.id);
2141
+ if (x(o), P) {
2142
+ const e = y.levels.find((b) => b.id === o), c = e == null ? void 0 : e.anchors.find((b) => b.shapeId === r);
2143
+ c && q(c.id);
1904
2144
  }
1905
- (t = u.onSelectShape) == null || t.call(u, r);
2145
+ (t = l.onSelectShape) == null || t.call(l, r);
1906
2146
  }
1907
2147
  }
1908
2148
  ) }) })
@@ -1911,9 +2151,10 @@ function Ut(u) {
1911
2151
  );
1912
2152
  }
1913
2153
  export {
1914
- Gt as M,
1915
- _t as R,
1916
- Lt as a,
1917
- Ut as b
2154
+ Tt as M,
2155
+ en as R,
2156
+ Jt as a,
2157
+ un as b,
2158
+ Ge as c
1918
2159
  };
1919
2160
  //# sourceMappingURL=MapViewer.js.map