@eyeon/map 2.0.3 → 2.0.5

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 (149) hide show
  1. package/dist/assets/MapViewer.css +1 -1
  2. package/dist/assets/index.css +1 -1
  3. package/dist/chunks/MapViewer.js +2558 -1431
  4. package/dist/chunks/MapViewer.js.map +1 -1
  5. package/dist/chunks/stacking.js +1262 -745
  6. package/dist/chunks/stacking.js.map +1 -1
  7. package/dist/chunks/wheelZoom.js +259 -0
  8. package/dist/chunks/wheelZoom.js.map +1 -0
  9. package/dist/core/assignment.d.ts +107 -0
  10. package/dist/core/assignment.d.ts.map +1 -0
  11. package/dist/core/color.d.ts +5 -0
  12. package/dist/core/color.d.ts.map +1 -0
  13. package/dist/core/entranceIcon.d.ts +12 -0
  14. package/dist/core/entranceIcon.d.ts.map +1 -0
  15. package/dist/core/hostChrome.d.ts +2 -4
  16. package/dist/core/hostChrome.d.ts.map +1 -1
  17. package/dist/core/index.d.ts +6 -0
  18. package/dist/core/index.d.ts.map +1 -1
  19. package/dist/core/index.js +161 -89
  20. package/dist/core/labelAlign.d.ts +7 -0
  21. package/dist/core/labelAlign.d.ts.map +1 -0
  22. package/dist/core/layerStyles.d.ts +41 -7
  23. package/dist/core/layerStyles.d.ts.map +1 -1
  24. package/dist/core/outdoorDecoration.d.ts +2 -1
  25. package/dist/core/outdoorDecoration.d.ts.map +1 -1
  26. package/dist/core/publish/index.d.ts +6 -4
  27. package/dist/core/publish/index.d.ts.map +1 -1
  28. package/dist/core/stacking.d.ts +50 -3
  29. package/dist/core/stacking.d.ts.map +1 -1
  30. package/dist/core/types.d.ts +29 -1
  31. package/dist/core/types.d.ts.map +1 -1
  32. package/dist/core/voids.d.ts +41 -0
  33. package/dist/core/voids.d.ts.map +1 -0
  34. package/dist/core/wheelZoom.d.ts +30 -0
  35. package/dist/core/wheelZoom.d.ts.map +1 -0
  36. package/dist/editor/FieldResetButton.d.ts +7 -0
  37. package/dist/editor/FieldResetButton.d.ts.map +1 -0
  38. package/dist/editor/MapEditor.d.ts +12 -2
  39. package/dist/editor/MapEditor.d.ts.map +1 -1
  40. package/dist/editor/canvas/EditorCanvas.d.ts +6 -2
  41. package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
  42. package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts +3 -1
  43. package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts.map +1 -1
  44. package/dist/editor/canvas/coords.d.ts +26 -3
  45. package/dist/editor/canvas/coords.d.ts.map +1 -1
  46. package/dist/editor/canvas/editorFill.d.ts +3 -1
  47. package/dist/editor/canvas/editorFill.d.ts.map +1 -1
  48. package/dist/editor/canvas/editorHover.d.ts +4 -0
  49. package/dist/editor/canvas/editorHover.d.ts.map +1 -1
  50. package/dist/editor/canvas/underlayHint.d.ts +8 -0
  51. package/dist/editor/canvas/underlayHint.d.ts.map +1 -1
  52. package/dist/editor/connectorAssignments.d.ts +61 -0
  53. package/dist/editor/connectorAssignments.d.ts.map +1 -1
  54. package/dist/editor/draftOps.d.ts +8 -0
  55. package/dist/editor/draftOps.d.ts.map +1 -1
  56. package/dist/editor/editorSectionReturn.d.ts.map +1 -1
  57. package/dist/editor/ellipseDraw.d.ts +12 -0
  58. package/dist/editor/ellipseDraw.d.ts.map +1 -0
  59. package/dist/editor/entranceIcon.d.ts +15 -0
  60. package/dist/editor/entranceIcon.d.ts.map +1 -0
  61. package/dist/editor/hexColor.d.ts +2 -0
  62. package/dist/editor/hexColor.d.ts.map +1 -1
  63. package/dist/editor/index.css +824 -72
  64. package/dist/editor/index.d.ts +2 -0
  65. package/dist/editor/index.d.ts.map +1 -1
  66. package/dist/editor/index.js +6711 -4161
  67. package/dist/editor/index.js.map +1 -1
  68. package/dist/editor/labelText.d.ts +12 -2
  69. package/dist/editor/labelText.d.ts.map +1 -1
  70. package/dist/editor/labels.d.ts +8 -0
  71. package/dist/editor/labels.d.ts.map +1 -1
  72. package/dist/editor/panels/AssignForm.d.ts +17 -0
  73. package/dist/editor/panels/AssignForm.d.ts.map +1 -0
  74. package/dist/editor/panels/AssignmentStyleFields.d.ts +14 -0
  75. package/dist/editor/panels/AssignmentStyleFields.d.ts.map +1 -0
  76. package/dist/editor/panels/BulkAssignForm.d.ts +11 -0
  77. package/dist/editor/panels/BulkAssignForm.d.ts.map +1 -0
  78. package/dist/editor/panels/CatalogKioskForm.d.ts +18 -0
  79. package/dist/editor/panels/CatalogKioskForm.d.ts.map +1 -0
  80. package/dist/editor/panels/ConnectorAssign.d.ts +6 -2
  81. package/dist/editor/panels/ConnectorAssign.d.ts.map +1 -1
  82. package/dist/editor/panels/CopyToLevelButton.d.ts +10 -0
  83. package/dist/editor/panels/CopyToLevelButton.d.ts.map +1 -0
  84. package/dist/editor/panels/EntranceIconForm.d.ts +11 -0
  85. package/dist/editor/panels/EntranceIconForm.d.ts.map +1 -0
  86. package/dist/editor/panels/Inspector.d.ts +24 -3
  87. package/dist/editor/panels/Inspector.d.ts.map +1 -1
  88. package/dist/editor/panels/LeftRail.d.ts +17 -6
  89. package/dist/editor/panels/LeftRail.d.ts.map +1 -1
  90. package/dist/editor/panels/PreviewOverlay.d.ts +9 -3
  91. package/dist/editor/panels/PreviewOverlay.d.ts.map +1 -1
  92. package/dist/editor/panels/TextLabelForm.d.ts +11 -0
  93. package/dist/editor/panels/TextLabelForm.d.ts.map +1 -0
  94. package/dist/editor/panels/formRows.d.ts +41 -0
  95. package/dist/editor/panels/formRows.d.ts.map +1 -0
  96. package/dist/editor/portalSurface.d.ts +10 -2
  97. package/dist/editor/portalSurface.d.ts.map +1 -1
  98. package/dist/editor/previewDocument.d.ts +2 -1
  99. package/dist/editor/previewDocument.d.ts.map +1 -1
  100. package/dist/editor/railAssignments.d.ts +9 -2
  101. package/dist/editor/railAssignments.d.ts.map +1 -1
  102. package/dist/editor/railKiosks.d.ts +27 -0
  103. package/dist/editor/railKiosks.d.ts.map +1 -0
  104. package/dist/editor/railListCopy.d.ts +31 -0
  105. package/dist/editor/railListCopy.d.ts.map +1 -0
  106. package/dist/editor/routeStubs.d.ts +1 -1
  107. package/dist/editor/routeStubs.d.ts.map +1 -1
  108. package/dist/editor/shapeCopy.d.ts +40 -0
  109. package/dist/editor/shapeCopy.d.ts.map +1 -0
  110. package/dist/editor/shapeSelection.d.ts +6 -0
  111. package/dist/editor/shapeSelection.d.ts.map +1 -0
  112. package/dist/editor/tools.d.ts +12 -2
  113. package/dist/editor/tools.d.ts.map +1 -1
  114. package/dist/fonts/assets.d.ts +4 -0
  115. package/dist/fonts/mapFont.d.ts +5 -0
  116. package/dist/fonts/mapFont.d.ts.map +1 -0
  117. package/dist/fonts/mapFontUrl.d.ts +8 -0
  118. package/dist/fonts/mapFontUrl.d.ts.map +1 -0
  119. package/dist/specialIcons.d.ts +39 -0
  120. package/dist/specialIcons.d.ts.map +1 -0
  121. package/dist/ui/ModernSelect.d.ts.map +1 -1
  122. package/dist/ui/selectSearch.d.ts +3 -0
  123. package/dist/ui/selectSearch.d.ts.map +1 -1
  124. package/dist/viewer/MapViewer.d.ts +14 -1
  125. package/dist/viewer/MapViewer.d.ts.map +1 -1
  126. package/dist/viewer/camera.d.ts +82 -1
  127. package/dist/viewer/camera.d.ts.map +1 -1
  128. package/dist/viewer/components/CameraRig.d.ts +18 -1
  129. package/dist/viewer/components/CameraRig.d.ts.map +1 -1
  130. package/dist/viewer/components/LevelMeshes.d.ts +15 -4
  131. package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
  132. package/dist/viewer/components/MapScene.d.ts +10 -4
  133. package/dist/viewer/components/MapScene.d.ts.map +1 -1
  134. package/dist/viewer/components/OpeningWell.d.ts +7 -0
  135. package/dist/viewer/components/OpeningWell.d.ts.map +1 -0
  136. package/dist/viewer/components/RouteLine.d.ts.map +1 -1
  137. package/dist/viewer/components/SvgVectorLayer.d.ts +3 -1
  138. package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -1
  139. package/dist/viewer/components/openingGeometry.d.ts +7 -0
  140. package/dist/viewer/components/openingGeometry.d.ts.map +1 -0
  141. package/dist/viewer/index.css +151 -19
  142. package/dist/viewer/index.js +3 -3
  143. package/dist/viewer/pointer.d.ts +26 -0
  144. package/dist/viewer/pointer.d.ts.map +1 -0
  145. package/dist/viewer/ui/MapControls.d.ts.map +1 -1
  146. package/dist/viewer/ui/RuntimeChrome.d.ts.map +1 -1
  147. package/package.json +4 -2
  148. package/dist/chunks/graph-tools.js +0 -246
  149. package/dist/chunks/graph-tools.js.map +0 -1
@@ -1,6 +1,24 @@
1
- import Ot from "ngraph.graph";
2
- import Rt from "ngraph.path";
3
- const st = "#E9F7FC", X = {
1
+ import Ut from "ngraph.graph";
2
+ import Ht from "ngraph.path";
3
+ const Vt = "transparent";
4
+ function ht(t) {
5
+ const e = (t ?? "").trim().toLowerCase();
6
+ return e === Vt || e === "none";
7
+ }
8
+ const vt = "#E9F7FC", Zt = [
9
+ "green-area",
10
+ "water-area",
11
+ "parking-lane",
12
+ "parking-line",
13
+ "parking-icon",
14
+ "walking-path"
15
+ ], jt = {
16
+ "green-area": "GREEN_AREA_COLOR",
17
+ "water-area": "WATER_COLOR",
18
+ "parking-lane": "PARKING_LANE_COLOR",
19
+ "parking-icon": "PARKING_ICON_COLOR",
20
+ "walking-path": "WALKABLE_COLOR"
21
+ }, Nt = {
4
22
  "green-area": {
5
23
  fill: "#C4DDAB",
6
24
  renderOrder: 2,
@@ -28,38 +46,69 @@ const st = "#E9F7FC", X = {
28
46
  extrudeHeight: 1
29
47
  },
30
48
  "walking-path": {
31
- fill: st,
49
+ fill: vt,
32
50
  renderOrder: 2,
33
51
  extrudeHeight: 1
34
52
  }
35
53
  };
36
- function at(t) {
54
+ function z(t) {
55
+ const e = Nt[t];
56
+ return e.fill ?? e.stroke ?? "";
57
+ }
58
+ function qt() {
59
+ return {
60
+ GREEN_AREA_COLOR: z("green-area"),
61
+ WATER_COLOR: z("water-area"),
62
+ PARKING_LANE_COLOR: z("parking-lane"),
63
+ PARKING_ICON_COLOR: z("parking-icon"),
64
+ WALKABLE_COLOR: z("walking-path")
65
+ };
66
+ }
67
+ function Tt(t) {
37
68
  return t.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
38
69
  }
39
- function ot(t) {
70
+ function Qt(t, e) {
71
+ const n = Tt(e);
72
+ return !!(t === n || t.startsWith(`${n} `) || t === `${n}s` || t.startsWith(`${n}s `));
73
+ }
74
+ function Jt(t) {
40
75
  if (!t) return null;
41
- const e = at(t);
76
+ const e = Tt(t);
42
77
  if (!e) return null;
43
- const n = Object.keys(X).sort((s, o) => o.length - s.length);
44
- for (const s of n) {
45
- const o = at(s);
46
- if (e === o || e.startsWith(`${o} `) || e === `${o}s` || e.startsWith(`${o}s `)) return X[s];
47
- }
78
+ const n = [...Zt].sort((o, r) => r.length - o.length);
79
+ for (const o of n)
80
+ if (Qt(e, o)) return o;
48
81
  return null;
49
82
  }
50
- function Re(t, e) {
51
- const n = (e == null ? void 0 : e.omitStaticLayers) === !0, s = /* @__PURE__ */ new Set();
52
- for (const o of t) {
53
- const i = o.sourceSvgId;
54
- i && (n && ot(i) || s.add(i));
83
+ function te(t, e, n) {
84
+ const o = jt[e];
85
+ if (!o) return t;
86
+ const r = n == null ? void 0 : n[o];
87
+ return typeof r != "string" ? t : ht(r) ? t.fill ? { ...t, fill: "transparent" } : t.stroke ? { ...t, stroke: "transparent" } : t : r.trim() ? t.fill ? { ...t, fill: r } : t.stroke ? { ...t, stroke: r } : t : t;
88
+ }
89
+ function yt(t, e) {
90
+ const n = Jt(t);
91
+ return n ? te(Nt[n], n, e) : null;
92
+ }
93
+ function ee(t, e) {
94
+ const n = (e == null ? void 0 : e.omitStaticLayers) === !0, o = /* @__PURE__ */ new Set();
95
+ for (const r of t) {
96
+ const s = r.sourceSvgId;
97
+ s && (n && yt(s) || o.add(s));
55
98
  }
56
- return s;
99
+ return o;
57
100
  }
58
- const lt = {
101
+ function Rn(t) {
102
+ return ee(
103
+ t.flatMap((e) => [...e.shapes]),
104
+ { omitStaticLayers: !0 }
105
+ );
106
+ }
107
+ const W = {
59
108
  MAP_STYLE: "2D",
60
109
  MAP_BACKGROUND_COLOR: "#FFFFFF",
61
110
  ACCENT_COLOR: "#2563eb",
62
- STORE_DEFAULT_COLOR: "#e2e8f0",
111
+ STORE_DEFAULT_COLOR: "#b6babe",
63
112
  STORE_TEXT_COLOR: "#1e293b",
64
113
  STORE_HEIGHT: 4,
65
114
  STORE_RADIUS: 0,
@@ -71,87 +120,368 @@ const lt = {
71
120
  OVERLAY_COLOR: "#000000",
72
121
  OVERLAY_OPACITY: 0.15,
73
122
  PARKING_ZONE_COLOR: "#cbd5e1",
74
- GREEN_AREA_COLOR: "#86efac",
75
- WATER_COLOR: "#7dd3fc",
76
- WALKABLE_COLOR: st,
123
+ ...qt(),
77
124
  KIOSK_SIZE: 12,
78
125
  ZOOM_STEP: 0.5,
79
126
  CAMERA_MAX_DISTANCE: 2e3,
80
127
  CAMERA_MIN_DISTANCE: 50
81
- }, Nt = "#f5f5f5", _t = /* @__PURE__ */ new Set(["#f8fafc", "#f1efea"]), Et = 500;
82
- function It(t) {
128
+ }, ne = "#f5f5f5", oe = /* @__PURE__ */ new Set(["#f8fafc", "#f1efea"]), re = "#86efac", ie = "#7dd3fc", se = "#e2e8f0", ce = 500;
129
+ function wt(t) {
83
130
  const e = typeof t == "number" ? t : Number(t);
84
- return !Number.isFinite(e) || e <= 0 ? 0 : Math.min(e, Et);
131
+ return !Number.isFinite(e) || e <= 0 ? 0 : Math.min(e, ce);
85
132
  }
86
- function Pt(...t) {
87
- const e = Object.assign({}, lt, ...t.filter(Boolean));
88
- return e.MAP_BACKGROUND_COLOR.toLowerCase() === Nt && (e.MAP_BACKGROUND_COLOR = lt.MAP_BACKGROUND_COLOR), _t.has(e.WALKABLE_COLOR.toLowerCase()) && (e.WALKABLE_COLOR = st), e.STORE_RADIUS = It(e.STORE_RADIUS), e;
133
+ function ae(...t) {
134
+ const e = Object.assign({}, W, ...t.filter(Boolean));
135
+ return e.MAP_BACKGROUND_COLOR.toLowerCase() === ne && (e.MAP_BACKGROUND_COLOR = W.MAP_BACKGROUND_COLOR), oe.has(e.WALKABLE_COLOR.toLowerCase()) && (e.WALKABLE_COLOR = vt), e.GREEN_AREA_COLOR.toLowerCase() === re && (e.GREEN_AREA_COLOR = W.GREEN_AREA_COLOR), e.WATER_COLOR.toLowerCase() === ie && (e.WATER_COLOR = W.WATER_COLOR), e.STORE_DEFAULT_COLOR.toLowerCase() === se && (e.STORE_DEFAULT_COLOR = W.STORE_DEFAULT_COLOR), e.STORE_RADIUS = wt(e.STORE_RADIUS), e;
89
136
  }
90
- const Tt = [
137
+ const le = [
91
138
  "unit",
92
139
  "amenity",
93
140
  "kiosk_screen",
94
141
  "connector",
95
142
  "entrance",
96
143
  "parking_zone"
97
- ], tt = 1e4, Ne = 2.5;
98
- function _e(t) {
144
+ ], ut = 1e4, vn = 2.5, ue = "entrance", Nn = 36, fe = 8;
145
+ function Tn(t) {
146
+ var e;
147
+ return t.kind === "entrance" && ((e = t.label) == null ? void 0 : e.imageKey) === ue;
148
+ }
149
+ function wn(t) {
150
+ return Math.max(fe, t);
151
+ }
152
+ const Pn = ["left", "center", "right"], de = "center";
153
+ function Fn(t) {
154
+ return t === "left" || t === "right" ? t : de;
155
+ }
156
+ function Yn(t, e) {
157
+ return e === "left" ? t.minX : e === "right" ? t.maxX : (t.minX + t.maxX) / 2;
158
+ }
159
+ function Dn(t) {
160
+ return t === "left" ? "start" : t === "right" ? "end" : "middle";
161
+ }
162
+ const J = 12, he = J, ye = 4, xe = [
163
+ "retail_name",
164
+ "retail_logo",
165
+ "retail_text",
166
+ "kiosk",
167
+ "amenity",
168
+ "connector",
169
+ "custom_text",
170
+ "custom_image"
171
+ ], pe = new Set(xe);
172
+ function U(t, e) {
173
+ const n = typeof t == "number" ? t : Number(t);
174
+ return Number.isFinite(n) ? n : e;
175
+ }
176
+ const me = /^(?:|[+\-]|[+\-]?\.(?:0*)?)$/;
177
+ function ge(t) {
178
+ const e = t.trim();
179
+ if (me.test(e))
180
+ return { render: 0, complete: !1 };
181
+ const n = Number(e);
182
+ return Number.isFinite(n) ? { render: n, complete: !0 } : { render: 0, complete: !1 };
183
+ }
184
+ function Bn(t) {
185
+ const e = ge(t);
186
+ return e.complete ? { display: String(e.render), render: e.render } : { display: "0", render: 0 };
187
+ }
188
+ function B(t) {
189
+ if (t == null) return null;
190
+ const e = String(t).trim();
191
+ return e || null;
192
+ }
193
+ function be(t) {
194
+ if (t == null) return null;
195
+ const e = String(t);
196
+ return e === "" ? null : e;
197
+ }
198
+ function nt(t) {
199
+ if (t == null || t === "") return null;
200
+ const e = Number(t);
201
+ return Number.isFinite(e) ? e : null;
202
+ }
203
+ function ke(t) {
204
+ return typeof t == "string" && pe.has(t);
205
+ }
206
+ function Pt(t) {
207
+ return t === "amenity" ? "amenity" : t === "kiosk_screen" ? "kiosk" : t === "connector" ? "connector" : "retail_name";
208
+ }
209
+ function Xn(t) {
210
+ return t === "amenity" ? "amenity" : t === "kiosk_screen" ? "kiosk" : t === "unit" || t === "parking_zone" ? "retailer" : "none";
211
+ }
212
+ function Gn(t, e) {
213
+ return {
214
+ shapeId: t,
215
+ targetType: "none",
216
+ retailerId: null,
217
+ amenityId: null,
218
+ kioskId: null,
219
+ unitStatus: "vacant",
220
+ unitNumber: null,
221
+ customLabel: null,
222
+ customImageKey: null,
223
+ layerType: Pt(e),
224
+ size: J,
225
+ rotate: 0,
226
+ offsetX: 0,
227
+ offsetY: 0,
228
+ bgColor: null,
229
+ textColor: null
230
+ };
231
+ }
232
+ function Kn(t, e = "unit") {
233
+ const n = t.layerType ?? t.layer_type, o = t.unitStatus ?? t.unit_status ?? "vacant";
234
+ return {
235
+ shapeId: U(
236
+ t.shapeId ?? t.shape_id,
237
+ 0
238
+ ),
239
+ targetType: t.targetType ?? t.target_type ?? "none",
240
+ retailerId: nt(
241
+ t.retailerId ?? t.retailer_id
242
+ ),
243
+ amenityId: nt(
244
+ t.amenityId ?? t.amenity_id
245
+ ),
246
+ kioskId: nt(
247
+ t.kioskId ?? t.kiosk_id
248
+ ),
249
+ unitStatus: o || "vacant",
250
+ unitNumber: B(
251
+ t.unitNumber ?? t.unit_number
252
+ ),
253
+ customLabel: be(
254
+ t.customLabel ?? t.custom_label
255
+ ),
256
+ customImageKey: B(
257
+ t.customImageKey ?? t.custom_image_key
258
+ ),
259
+ layerType: ke(n) ? n : Pt(e),
260
+ size: U(t.size, J),
261
+ rotate: U(t.rotate, 0),
262
+ offsetX: U(
263
+ t.offsetX ?? t.offset_x,
264
+ 0
265
+ ),
266
+ offsetY: U(
267
+ t.offsetY ?? t.offset_y,
268
+ 0
269
+ ),
270
+ bgColor: B(
271
+ t.bgColor ?? t.bg_color
272
+ ),
273
+ textColor: B(
274
+ t.textColor ?? t.text_color
275
+ ),
276
+ align: Ie(t.align)
277
+ };
278
+ }
279
+ function Ie(t) {
280
+ if (t === "left" || t === "right" || t === "center") return t;
281
+ }
282
+ function $n(t, e) {
283
+ const n = (t.location ?? "").trim();
284
+ return e && n && n !== "-" ? `${t.name} (${n})` : t.name;
285
+ }
286
+ function zn(t, e) {
287
+ var o;
288
+ const n = (o = t == null ? void 0 : t.bgColor) == null ? void 0 : o.trim();
289
+ return ht(n) ? "transparent" : n || e;
290
+ }
291
+ function Wn(t, e) {
292
+ var o;
293
+ const n = (o = t == null ? void 0 : t.textColor) == null ? void 0 : o.trim();
294
+ return ht(n) ? "transparent" : n || e;
295
+ }
296
+ function Un(t) {
297
+ const e = t.trim();
298
+ if (!e || !/^\d+$/.test(e)) return null;
299
+ const n = Number(e);
300
+ return Number.isSafeInteger(n) && n > 0 ? n : null;
301
+ }
302
+ function Hn(t, e) {
303
+ var r;
304
+ const n = e == null ? void 0 : e.trim();
305
+ if (n) return n;
306
+ const o = (r = t == null ? void 0 : t.customLabel) == null ? void 0 : r.trim();
307
+ return o || ((t == null ? void 0 : t.amenityId) != null ? `Amenity ${t.amenityId}` : null);
308
+ }
309
+ function Vn(t, e) {
310
+ var r;
311
+ const n = (r = t == null ? void 0 : t.customLabel) == null ? void 0 : r.trim();
312
+ if (n) return n;
313
+ const o = e == null ? void 0 : e.trim();
314
+ return o || ((t == null ? void 0 : t.kioskId) != null ? `Kiosk ${t.kioskId}` : null);
315
+ }
316
+ function X(t) {
317
+ var e, n;
318
+ return t ? t.targetType === "retailer" ? t.retailerId != null : t.targetType === "amenity" ? t.amenityId != null || !!((e = t.customLabel) != null && e.trim()) : t.targetType === "kiosk" ? t.kioskId != null || !!((n = t.customLabel) != null && n.trim()) : !1 : !1;
319
+ }
320
+ const _e = /* @__PURE__ */ new Set([
321
+ "unit",
322
+ "parking_zone",
323
+ "amenity",
324
+ "kiosk_screen"
325
+ ]);
326
+ function Ft(t, e, n) {
327
+ var o, r;
328
+ return t.kind === "label" || t.kind === "entrance" ? t.label : t.kind === "connector" || (e == null ? void 0 : e.layerType) === "connector" ? e ? gt(
329
+ { style: t.style ?? {}, label: t.label },
330
+ e,
331
+ n
332
+ ).label : t.label : _e.has(t.kind) ? !X(e) || !e ? !((o = t.label) != null && o.text) && !((r = t.label) != null && r.imageKey) ? t.label : {
333
+ ...t.label,
334
+ text: void 0,
335
+ imageKey: void 0
336
+ } : gt(
337
+ { style: t.style ?? {}, label: t.label },
338
+ e,
339
+ n
340
+ ).label : t.label;
341
+ }
342
+ function Ce(t, e) {
343
+ if (X(t)) {
344
+ if (t.layerType === "retail_text" || t.layerType === "custom_text")
345
+ return t.customLabel ?? void 0;
346
+ if (t.layerType === "retail_name")
347
+ return (e == null ? void 0 : e.name) ?? t.customLabel ?? void 0;
348
+ }
349
+ }
350
+ function Yt(t, e, n) {
351
+ if (!(!X(t) || !t) && !(t.layerType !== "retail_logo" && t.layerType !== "custom_image"))
352
+ return Se(t, e) ?? B(n == null ? void 0 : n.imageKey) ?? void 0;
353
+ }
354
+ function Zn(t, e) {
355
+ var n, o;
356
+ if (!(!X(t) || !t)) {
357
+ if (t.layerType === "kiosk") return "kiosk";
358
+ if (t.layerType === "amenity")
359
+ return ((n = e == null ? void 0 : e.find((r) => r.id === t.amenityId)) == null ? void 0 : n.code) ?? ((o = t.customLabel) == null ? void 0 : o.trim()) ?? void 0;
360
+ }
361
+ }
362
+ function Ae(t, e) {
363
+ const n = Number.isFinite(t) && t > 0 ? t : J;
364
+ return (e == null ? void 0 : e.layerType) === "retail_logo" ? n * ye : n;
365
+ }
366
+ function jn(t) {
367
+ const e = t.assignment, n = t.label;
368
+ return {
369
+ size: Ae(
370
+ (e == null ? void 0 : e.size) ?? (n == null ? void 0 : n.size) ?? he
371
+ ),
372
+ rotate: (e == null ? void 0 : e.rotate) ?? (n == null ? void 0 : n.rotate) ?? 0,
373
+ offsetX: (e == null ? void 0 : e.offsetX) ?? (n == null ? void 0 : n.offsetX) ?? 0,
374
+ offsetY: (e == null ? void 0 : e.offsetY) ?? (n == null ? void 0 : n.offsetY) ?? 0,
375
+ iconColor: (e == null ? void 0 : e.textColor) ?? (n == null ? void 0 : n.color) ?? null
376
+ };
377
+ }
378
+ function qn(t, e) {
379
+ var n;
380
+ return X(t) ? (t == null ? void 0 : t.layerType) === "kiosk" || (t == null ? void 0 : t.layerType) === "amenity" || Yt(t, null, e) ? !0 : !!((n = e == null ? void 0 : e.text) != null && n.trim()) : !1;
381
+ }
382
+ function Se(t, e) {
383
+ if (X(t)) {
384
+ if (t.layerType === "retail_logo")
385
+ return B(e == null ? void 0 : e.logoUrl) ?? B(t.customImageKey) ?? void 0;
386
+ if (t.layerType === "custom_image")
387
+ return B(t.customImageKey) ?? void 0;
388
+ }
389
+ }
390
+ function ot(t) {
391
+ if (t.length === 0) return "";
392
+ const e = t[0];
393
+ return t.every((n) => n === e) ? e : "";
394
+ }
395
+ function mt(t) {
396
+ if (t.length === 0) return !1;
397
+ const e = t[0];
398
+ return t.some((n) => n !== e);
399
+ }
400
+ function Qn(t) {
401
+ const e = t.map((o) => o.bgColor ?? ""), n = t.map((o) => o.textColor ?? "");
402
+ return {
403
+ size: ot(t.map((o) => o.size)),
404
+ bgColor: ot(e),
405
+ textColor: ot(n),
406
+ bgColorMixed: mt(e),
407
+ textColorMixed: mt(n)
408
+ };
409
+ }
410
+ function Jn(t, e) {
411
+ return {
412
+ ...t,
413
+ ...e.size != null ? { size: e.size } : {},
414
+ ...e.bgColor !== void 0 ? { bgColor: e.bgColor } : {},
415
+ ...e.textColor !== void 0 ? { textColor: e.textColor } : {}
416
+ };
417
+ }
418
+ function gt(t, e, n) {
419
+ const o = Yt(e, n, t.label), r = X(e) ? o ? void 0 : Ce(e, n) ?? t.label.text : void 0;
420
+ return {
421
+ style: {
422
+ ...t.style,
423
+ fill: e.bgColor ?? void 0
424
+ },
425
+ label: {
426
+ ...t.label,
427
+ text: r,
428
+ imageKey: o,
429
+ size: Number.isFinite(e.size) ? e.size : 0,
430
+ rotate: Number.isFinite(e.rotate) ? e.rotate : 0,
431
+ offsetX: Number.isFinite(e.offsetX) ? e.offsetX : 0,
432
+ offsetY: Number.isFinite(e.offsetY) ? e.offsetY : 0,
433
+ color: e.textColor ?? void 0,
434
+ ...e.align ? { align: e.align } : {}
435
+ }
436
+ };
437
+ }
438
+ function to(t) {
99
439
  return t === "PORTAL" ? "editor" : "viewer";
100
440
  }
101
- const Dt = {
102
- search: !0,
103
- amenities: !0,
441
+ const rt = {
442
+ search: !1,
443
+ amenities: !1,
104
444
  floors: !0,
105
445
  zoomReset: !0,
106
446
  kioskOrigin: !1,
107
447
  fetchDraft: !1
108
- }, Ft = {
109
- WEBSITE: Dt,
448
+ }, Le = {
449
+ /** v1 WP_SITE / MapBox HOST WEBSITE. */
450
+ WEBSITE: rt,
110
451
  /** Assign mode: click shapes, no public directory chrome. */
111
- PORTAL_ASSIGN: {
112
- search: !1,
113
- amenities: !1,
114
- floors: !0,
115
- zoomReset: !0,
116
- kioskOrigin: !1,
117
- fetchDraft: !1
118
- },
452
+ PORTAL_ASSIGN: rt,
119
453
  DISPLAY_APP: {
120
- search: !1,
121
- amenities: !1,
122
- floors: !0,
123
- zoomReset: !0,
124
- kioskOrigin: !0,
125
- fetchDraft: !1
454
+ ...rt,
455
+ kioskOrigin: !0
126
456
  }
127
457
  };
128
- function Ee(t) {
129
- return Ft[t];
458
+ function eo(t) {
459
+ return Le[t];
130
460
  }
131
- function Pe(t) {
461
+ function no(t) {
132
462
  return t !== "PORTAL";
133
463
  }
134
- function Te(t, e) {
464
+ function oo(t, e) {
135
465
  return e ? e + encodeURIComponent(t) : t;
136
466
  }
137
- function De(t, e) {
467
+ function ro(t, e) {
138
468
  return t.map((n) => ({ x: n.x, y: e - n.y }));
139
469
  }
140
- function P(t, e) {
141
- const n = t.x - e.x, s = t.y - e.y;
142
- return Math.hypot(n, s);
470
+ function w(t, e) {
471
+ const n = t.x - e.x, o = t.y - e.y;
472
+ return Math.hypot(n, o);
143
473
  }
144
- function Yt(t) {
474
+ function Oe(t) {
145
475
  if (t.length === 0)
146
476
  return { minX: 0, minY: 0, maxX: 0, maxY: 0 };
147
- let e = t[0].x, n = t[0].y, s = t[0].x, o = t[0].y;
148
- for (let i = 1; i < t.length; i++) {
149
- const u = t[i];
150
- u.x < e && (e = u.x), u.y < n && (n = u.y), u.x > s && (s = u.x), u.y > o && (o = u.y);
477
+ let e = t[0].x, n = t[0].y, o = t[0].x, r = t[0].y;
478
+ for (let s = 1; s < t.length; s++) {
479
+ const u = t[s];
480
+ u.x < e && (e = u.x), u.y < n && (n = u.y), u.x > o && (o = u.x), u.y > r && (r = u.y);
151
481
  }
152
- return { minX: e, minY: n, maxX: s, maxY: o };
482
+ return { minX: e, minY: n, maxX: o, maxY: r };
153
483
  }
154
- function Fe(t, e) {
484
+ function io(t, e) {
155
485
  return {
156
486
  minX: Math.min(t.minX, e.minX),
157
487
  minY: Math.min(t.minY, e.minY),
@@ -159,286 +489,286 @@ function Fe(t, e) {
159
489
  maxY: Math.max(t.maxY, e.maxY)
160
490
  };
161
491
  }
162
- function $t(t) {
492
+ function Me(t) {
163
493
  if (t.length === 0) return { x: 0, y: 0 };
164
494
  let e = 0, n = 0;
165
- for (const s of t)
166
- e += s.x, n += s.y;
495
+ for (const o of t)
496
+ e += o.x, n += o.y;
167
497
  return { x: e / t.length, y: n / t.length };
168
498
  }
169
- function Bt(t, e) {
499
+ function Ee(t, e) {
170
500
  let n = !1;
171
- for (let s = 0, o = e.length - 1; s < e.length; o = s++) {
172
- const i = e[s].x, u = e[s].y, c = e[o].x, r = e[o].y;
173
- u > t.y != r > t.y && t.x < (c - i) * (t.y - u) / (r - u + Number.EPSILON) + i && (n = !n);
501
+ for (let o = 0, r = e.length - 1; o < e.length; r = o++) {
502
+ const s = e[o].x, u = e[o].y, a = e[r].x, i = e[r].y;
503
+ u > t.y != i > t.y && t.x < (a - s) * (t.y - u) / (i - u + Number.EPSILON) + s && (n = !n);
174
504
  }
175
505
  return n;
176
506
  }
177
- function Ye(t, e) {
178
- return e.some((n) => Bt(t, n));
507
+ function so(t, e) {
508
+ return e.some((n) => Ee(t, n));
179
509
  }
180
- function Wt(t, e, n) {
181
- const s = n.x - e.x, o = n.y - e.y, i = s * s + o * o;
182
- if (i === 0)
183
- return { point: { ...e }, t: 0, distance: P(t, e) };
184
- let u = ((t.x - e.x) * s + (t.y - e.y) * o) / i;
510
+ function Re(t, e, n) {
511
+ const o = n.x - e.x, r = n.y - e.y, s = o * o + r * r;
512
+ if (s === 0)
513
+ return { point: { ...e }, t: 0, distance: w(t, e) };
514
+ let u = ((t.x - e.x) * o + (t.y - e.y) * r) / s;
185
515
  u = Math.max(0, Math.min(1, u));
186
- const c = { x: e.x + u * s, y: e.y + u * o };
187
- return { point: c, t: u, distance: P(t, c) };
516
+ const a = { x: e.x + u * o, y: e.y + u * r };
517
+ return { point: a, t: u, distance: w(t, a) };
188
518
  }
189
- function $e(t, e) {
519
+ function co(t, e) {
190
520
  if (e.length < 2) return null;
191
521
  let n = null;
192
- for (let s = 0; s < e.length - 1; s++) {
193
- const o = Wt(t, e[s], e[s + 1]);
194
- (!n || o.distance < n.distance) && (n = { point: o.point, segmentIndex: s, distance: o.distance });
522
+ for (let o = 0; o < e.length - 1; o++) {
523
+ const r = Re(t, e[o], e[o + 1]);
524
+ (!n || r.distance < n.distance) && (n = { point: r.point, segmentIndex: o, distance: r.distance });
195
525
  }
196
526
  return n;
197
527
  }
198
- function ut(t, e, n, s, o = 8) {
199
- const i = [];
200
- for (let u = 0; u <= o; u++) {
201
- const c = u / o, r = 1 - c;
202
- i.push({
203
- x: r * r * r * t.x + 3 * r * r * c * e.x + 3 * r * c * c * n.x + c * c * c * s.x,
204
- y: r * r * r * t.y + 3 * r * r * c * e.y + 3 * r * c * c * n.y + c * c * c * s.y
528
+ function bt(t, e, n, o, r = 8) {
529
+ const s = [];
530
+ for (let u = 0; u <= r; u++) {
531
+ const a = u / r, i = 1 - a;
532
+ s.push({
533
+ x: i * i * i * t.x + 3 * i * i * a * e.x + 3 * i * a * a * n.x + a * a * a * o.x,
534
+ y: i * i * i * t.y + 3 * i * i * a * e.y + 3 * i * a * a * n.y + a * a * a * o.y
205
535
  });
206
536
  }
207
- return i;
208
- }
209
- function ft(t, e, n, s = 6) {
210
- const o = [];
211
- for (let i = 0; i <= s; i++) {
212
- const u = i / s, c = 1 - u;
213
- o.push({
214
- x: c * c * t.x + 2 * c * u * e.x + u * u * n.x,
215
- y: c * c * t.y + 2 * c * u * e.y + u * u * n.y
537
+ return s;
538
+ }
539
+ function kt(t, e, n, o = 6) {
540
+ const r = [];
541
+ for (let s = 0; s <= o; s++) {
542
+ const u = s / o, a = 1 - u;
543
+ r.push({
544
+ x: a * a * t.x + 2 * a * u * e.x + u * u * n.x,
545
+ y: a * a * t.y + 2 * a * u * e.y + u * u * n.y
216
546
  });
217
547
  }
218
- return o;
548
+ return r;
219
549
  }
220
- const Xt = 8;
221
- function Gt(t, e, n, s, o, i, u) {
550
+ const ve = 8;
551
+ function Ne(t, e, n, o, r, s, u) {
222
552
  if (t.x === u.x && t.y === u.y) return [{ ...t }];
223
- let c = Math.abs(e), r = Math.abs(n);
224
- if (c === 0 || r === 0 || !Number.isFinite(c) || !Number.isFinite(r))
553
+ let a = Math.abs(e), i = Math.abs(n);
554
+ if (a === 0 || i === 0 || !Number.isFinite(a) || !Number.isFinite(i))
225
555
  return [{ ...t }, { ...u }];
226
- const m = s % 360 * Math.PI / 180, y = Math.cos(m), l = Math.sin(m), k = (t.x - u.x) / 2, a = (t.y - u.y) / 2, d = y * k + l * a, f = -l * k + y * a, h = d * d / (c * c) + f * f / (r * r);
556
+ const y = o % 360 * Math.PI / 180, p = Math.cos(y), l = Math.sin(y), k = (t.x - u.x) / 2, c = (t.y - u.y) / 2, d = p * k + l * c, f = -l * k + p * c, h = d * d / (a * a) + f * f / (i * i);
227
557
  if (h > 1) {
228
- const _ = Math.sqrt(h);
229
- c *= _, r *= _;
558
+ const N = Math.sqrt(h);
559
+ a *= N, i *= N;
230
560
  }
231
- const p = c * c, b = r * r, x = p * b - p * f * f - b * d * d, g = p * f * f + b * d * d, I = Math.sqrt(Math.max(0, x / g)) * (o === i ? -1 : 1), v = I * c * f / r, M = -I * r * d / c, S = y * v - l * M + (t.x + u.x) / 2, L = l * v + y * M + (t.y + u.y) / 2, C = (d - v) / c, T = (f - M) / r, R = (-d - v) / c, D = (-f - M) / r, $ = Math.atan2(T, C);
232
- let w = Math.atan2(C * D - T * R, C * R + T * D);
233
- !i && w > 0 ? w -= 2 * Math.PI : i && w < 0 && (w += 2 * Math.PI);
234
- const A = Math.abs(w) / (Math.PI / 2) * Xt, F = Math.max(1, Math.round(A)), N = [{ ...t }];
235
- for (let _ = 1; _ <= F; _++) {
236
- const W = $ + w * _ / F, z = Math.cos(W), H = Math.sin(W);
237
- N.push({
238
- x: S + c * y * z - r * l * H,
239
- y: L + c * l * z + r * y * H
561
+ const m = a * a, b = i * i, x = m * b - m * f * f - b * d * d, g = m * f * f + b * d * d, I = Math.sqrt(Math.max(0, x / g)) * (r === s ? -1 : 1), C = I * a * f / i, _ = -I * i * d / a, A = p * C - l * _ + (t.x + u.x) / 2, M = l * C + p * _ + (t.y + u.y) / 2, L = (d - C) / a, P = (f - _) / i, R = (-d - C) / a, F = (-f - _) / i, G = Math.atan2(P, L);
562
+ let S = Math.atan2(L * F - P * R, L * R + P * F);
563
+ !s && S > 0 ? S -= 2 * Math.PI : s && S < 0 && (S += 2 * Math.PI);
564
+ const O = Math.abs(S) / (Math.PI / 2) * ve, Y = Math.max(1, Math.round(O)), v = [{ ...t }];
565
+ for (let N = 1; N <= Y; N++) {
566
+ const $ = G + S * N / Y, V = Math.cos($), Z = Math.sin($);
567
+ v.push({
568
+ x: A + a * p * V - i * l * Z,
569
+ y: M + a * l * V + i * p * Z
240
570
  });
241
571
  }
242
- return N[N.length - 1] = { ...u }, N;
572
+ return v[v.length - 1] = { ...u }, v;
243
573
  }
244
- const zt = /[\s,]/;
245
- function Mt(t) {
574
+ const Te = /[\s,]/;
575
+ function Dt(t) {
246
576
  const e = [];
247
- let n = 0, s = "", o = 0;
577
+ let n = 0, o = "", r = 0;
248
578
  for (; n < t.length; ) {
249
- const i = t[n];
250
- if (zt.test(i)) {
579
+ const s = t[n];
580
+ if (Te.test(s)) {
251
581
  n++;
252
582
  continue;
253
583
  }
254
- if (i >= "a" && i <= "z" || i >= "A" && i <= "Z") {
255
- s = i, o = 0, e.push(i), n++;
584
+ if (s >= "a" && s <= "z" || s >= "A" && s <= "Z") {
585
+ o = s, r = 0, e.push(s), n++;
256
586
  continue;
257
587
  }
258
- const u = s === "A" || s === "a" ? o % 7 : -1;
259
- if ((u === 3 || u === 4) && (i === "0" || i === "1")) {
260
- e.push(i), n++, o++;
588
+ const u = o === "A" || o === "a" ? r % 7 : -1;
589
+ if ((u === 3 || u === 4) && (s === "0" || s === "1")) {
590
+ e.push(s), n++, r++;
261
591
  continue;
262
592
  }
263
- const c = n;
264
- let r = 0;
265
- for ((i === "+" || i === "-") && n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
266
- n++, r++;
593
+ const a = n;
594
+ let i = 0;
595
+ for ((s === "+" || s === "-") && n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
596
+ n++, i++;
267
597
  if (t[n] === ".")
268
598
  for (n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
269
- n++, r++;
270
- if (r > 0 && (t[n] === "e" || t[n] === "E")) {
271
- const m = n;
599
+ n++, i++;
600
+ if (i > 0 && (t[n] === "e" || t[n] === "E")) {
601
+ const y = n;
272
602
  if (n++, (t[n] === "+" || t[n] === "-") && n++, n < t.length && t[n] >= "0" && t[n] <= "9")
273
603
  for (; n < t.length && t[n] >= "0" && t[n] <= "9"; ) n++;
274
604
  else
275
- n = m;
605
+ n = y;
276
606
  }
277
- if (r === 0) {
278
- n = c + 1;
607
+ if (i === 0) {
608
+ n = a + 1;
279
609
  continue;
280
610
  }
281
- e.push(t.slice(c, n)), o++;
611
+ e.push(t.slice(a, n)), r++;
282
612
  }
283
613
  return e;
284
614
  }
285
- function vt(t) {
286
- const e = Mt(t), n = [];
287
- let s = [], o = 0, i = 0, u = 0, c = 0, r = null, m = 0, y = "";
288
- const l = () => Number(e[m++]);
289
- for (; m < e.length; ) {
290
- const k = e[m];
291
- switch (/[a-zA-Z]/.test(k) && (y = k, m++), y) {
615
+ function Bt(t) {
616
+ const e = Dt(t), n = [];
617
+ let o = [], r = 0, s = 0, u = 0, a = 0, i = null, y = 0, p = "";
618
+ const l = () => Number(e[y++]);
619
+ for (; y < e.length; ) {
620
+ const k = e[y];
621
+ switch (/[a-zA-Z]/.test(k) && (p = k, y++), p) {
292
622
  case "M":
293
623
  case "m": {
294
- const a = y === "m", d = l(), f = l();
295
- o = a ? o + d : d, i = a ? i + f : f, s.length > 0 && n.push(s), s = [{ x: o, y: i }], u = o, c = i, r = null, y = a ? "l" : "L";
624
+ const c = p === "m", d = l(), f = l();
625
+ r = c ? r + d : d, s = c ? s + f : f, o.length > 0 && n.push(o), o = [{ x: r, y: s }], u = r, a = s, i = null, p = c ? "l" : "L";
296
626
  break;
297
627
  }
298
628
  case "L":
299
629
  case "l": {
300
- const a = y === "l", d = l(), f = l();
301
- o = a ? o + d : d, i = a ? i + f : f, s.push({ x: o, y: i }), r = null;
630
+ const c = p === "l", d = l(), f = l();
631
+ r = c ? r + d : d, s = c ? s + f : f, o.push({ x: r, y: s }), i = null;
302
632
  break;
303
633
  }
304
634
  case "H":
305
635
  case "h": {
306
- const a = y === "h", d = l();
307
- o = a ? o + d : d, s.push({ x: o, y: i }), r = null;
636
+ const c = p === "h", d = l();
637
+ r = c ? r + d : d, o.push({ x: r, y: s }), i = null;
308
638
  break;
309
639
  }
310
640
  case "V":
311
641
  case "v": {
312
- const a = y === "v", d = l();
313
- i = a ? i + d : d, s.push({ x: o, y: i }), r = null;
642
+ const c = p === "v", d = l();
643
+ s = c ? s + d : d, o.push({ x: r, y: s }), i = null;
314
644
  break;
315
645
  }
316
646
  case "C":
317
647
  case "c": {
318
- const a = y === "c", d = a ? o + l() : l(), f = a ? i + l() : l(), h = a ? o + l() : l(), p = a ? i + l() : l(), b = a ? o + l() : l(), x = a ? i + l() : l(), g = ut(
319
- { x: o, y: i },
648
+ const c = p === "c", d = c ? r + l() : l(), f = c ? s + l() : l(), h = c ? r + l() : l(), m = c ? s + l() : l(), b = c ? r + l() : l(), x = c ? s + l() : l(), g = bt(
649
+ { x: r, y: s },
320
650
  { x: d, y: f },
321
- { x: h, y: p },
651
+ { x: h, y: m },
322
652
  { x: b, y: x }
323
653
  );
324
- s.push(...g.slice(1)), r = { x: h, y: p }, o = b, i = x;
654
+ o.push(...g.slice(1)), i = { x: h, y: m }, r = b, s = x;
325
655
  break;
326
656
  }
327
657
  case "Q":
328
658
  case "q": {
329
- const a = y === "q", d = a ? o + l() : l(), f = a ? i + l() : l(), h = a ? o + l() : l(), p = a ? i + l() : l(), b = ft(
330
- { x: o, y: i },
659
+ const c = p === "q", d = c ? r + l() : l(), f = c ? s + l() : l(), h = c ? r + l() : l(), m = c ? s + l() : l(), b = kt(
660
+ { x: r, y: s },
331
661
  { x: d, y: f },
332
- { x: h, y: p }
662
+ { x: h, y: m }
333
663
  );
334
- s.push(...b.slice(1)), r = { x: d, y: f }, o = h, i = p;
664
+ o.push(...b.slice(1)), i = { x: d, y: f }, r = h, s = m;
335
665
  break;
336
666
  }
337
667
  case "S":
338
668
  case "s": {
339
- const a = y === "s", d = r ? 2 * o - r.x : o, f = r ? 2 * i - r.y : i, h = a ? o + l() : l(), p = a ? i + l() : l(), b = a ? o + l() : l(), x = a ? i + l() : l(), g = ut(
340
- { x: o, y: i },
669
+ const c = p === "s", d = i ? 2 * r - i.x : r, f = i ? 2 * s - i.y : s, h = c ? r + l() : l(), m = c ? s + l() : l(), b = c ? r + l() : l(), x = c ? s + l() : l(), g = bt(
670
+ { x: r, y: s },
341
671
  { x: d, y: f },
342
- { x: h, y: p },
672
+ { x: h, y: m },
343
673
  { x: b, y: x }
344
674
  );
345
- s.push(...g.slice(1)), r = { x: h, y: p }, o = b, i = x;
675
+ o.push(...g.slice(1)), i = { x: h, y: m }, r = b, s = x;
346
676
  break;
347
677
  }
348
678
  case "T":
349
679
  case "t": {
350
- const a = y === "t", d = r ? 2 * o - r.x : o, f = r ? 2 * i - r.y : i, h = a ? o + l() : l(), p = a ? i + l() : l(), b = ft(
351
- { x: o, y: i },
680
+ const c = p === "t", d = i ? 2 * r - i.x : r, f = i ? 2 * s - i.y : s, h = c ? r + l() : l(), m = c ? s + l() : l(), b = kt(
681
+ { x: r, y: s },
352
682
  { x: d, y: f },
353
- { x: h, y: p }
683
+ { x: h, y: m }
354
684
  );
355
- s.push(...b.slice(1)), r = { x: d, y: f }, o = h, i = p;
685
+ o.push(...b.slice(1)), i = { x: d, y: f }, r = h, s = m;
356
686
  break;
357
687
  }
358
688
  case "A":
359
689
  case "a": {
360
- const a = y === "a", d = l(), f = l(), h = l(), p = l() !== 0, b = l() !== 0, x = a ? o + l() : l(), g = a ? i + l() : l(), I = Gt(
361
- { x: o, y: i },
690
+ const c = p === "a", d = l(), f = l(), h = l(), m = l() !== 0, b = l() !== 0, x = c ? r + l() : l(), g = c ? s + l() : l(), I = Ne(
691
+ { x: r, y: s },
362
692
  d,
363
693
  f,
364
694
  h,
365
- p,
695
+ m,
366
696
  b,
367
697
  { x, y: g }
368
698
  );
369
- s.push(...I.slice(1)), r = null, o = x, i = g;
699
+ o.push(...I.slice(1)), i = null, r = x, s = g;
370
700
  break;
371
701
  }
372
702
  case "Z":
373
703
  case "z": {
374
- s.push({ x: u, y: c }), n.push(s), s = [], o = u, i = c, r = null;
704
+ o.push({ x: u, y: a }), n.push(o), o = [], r = u, s = a, i = null;
375
705
  break;
376
706
  }
377
707
  default:
378
- m++;
708
+ y++;
379
709
  break;
380
710
  }
381
711
  }
382
- return s.length > 0 && n.push(s), n;
712
+ return o.length > 0 && n.push(o), n;
383
713
  }
384
- function Ht(t) {
714
+ function we(t) {
385
715
  const e = t.match(
386
716
  /^\s*M\s*(-?\d*\.?\d+(?:e[-+]?\d+)?)[\s,]+(-?\d*\.?\d+(?:e[-+]?\d+)?)/i
387
717
  );
388
718
  if (!e) return null;
389
- const n = Number(e[1]), s = Number(e[2]);
390
- return Number.isFinite(n) && Number.isFinite(s) ? { x: n, y: s } : null;
719
+ const n = Number(e[1]), o = Number(e[2]);
720
+ return Number.isFinite(n) && Number.isFinite(o) ? { x: n, y: o } : null;
391
721
  }
392
- function Kt(t) {
393
- var o, i;
394
- const e = (o = t.paths[0]) == null ? void 0 : o.d;
722
+ function Pe(t) {
723
+ var r, s;
724
+ const e = (r = t.paths[0]) == null ? void 0 : r.d;
395
725
  if (!e || t.polygons.length === 0) return !1;
396
- const n = Ht(e), s = (i = t.polygons[0]) == null ? void 0 : i[0];
397
- return !n || !s ? !1 : Math.abs(n.x - s.x) > 0.01 || Math.abs(n.y - s.y) > 0.01;
726
+ const n = we(e), o = (s = t.polygons[0]) == null ? void 0 : s[0];
727
+ return !n || !o ? !1 : Math.abs(n.x - o.x) > 0.01 || Math.abs(n.y - o.y) > 0.01;
398
728
  }
399
- function St(t) {
400
- if (!Kt(t)) return t;
401
- const e = t.paths.flatMap((n) => vt(n.d));
729
+ function Xt(t) {
730
+ if (!Pe(t)) return t;
731
+ const e = t.paths.flatMap((n) => Bt(n.d));
402
732
  return e.length === 0 ? t : { paths: t.paths, polygons: e };
403
733
  }
404
- function Ut(t) {
405
- const e = t.map((s) => ({
406
- d: s,
407
- closed: /z/i.test(s)
408
- })), n = t.flatMap((s) => vt(s));
734
+ function Fe(t) {
735
+ const e = t.map((o) => ({
736
+ d: o,
737
+ closed: /z/i.test(o)
738
+ })), n = t.flatMap((o) => Bt(o));
409
739
  return { paths: e, polygons: n };
410
740
  }
411
- function it(t) {
741
+ function xt(t) {
412
742
  const e = t.polygons.flat();
413
- return Yt(e);
743
+ return Oe(e);
414
744
  }
415
- function Vt(t) {
416
- return $t(t.polygons.flat());
745
+ function Ye(t) {
746
+ return Me(t.polygons.flat());
417
747
  }
418
- function Be(t, e, n = 0, s = [15, 45, 90]) {
419
- const o = e.x - t.x, i = e.y - t.y, u = Math.hypot(o, i);
748
+ function ao(t, e, n = 0, o = [15, 45, 90]) {
749
+ const r = e.x - t.x, s = e.y - t.y, u = Math.hypot(r, s);
420
750
  if (u === 0) return { ...e };
421
- const r = Math.atan2(i, o) * 180 / Math.PI - n;
422
- let m = r, y = 1 / 0;
423
- for (const k of s) {
424
- const a = Math.round(r / k) * k, d = Math.abs(r - a);
425
- d < y && (y = d, m = a);
751
+ const i = Math.atan2(s, r) * 180 / Math.PI - n;
752
+ let y = i, p = 1 / 0;
753
+ for (const k of o) {
754
+ const c = Math.round(i / k) * k, d = Math.abs(i - c);
755
+ d < p && (p = d, y = c);
426
756
  }
427
- const l = (m + n) * Math.PI / 180;
757
+ const l = (y + n) * Math.PI / 180;
428
758
  return {
429
759
  x: t.x + Math.cos(l) * u,
430
760
  y: t.y + Math.sin(l) * u
431
761
  };
432
762
  }
433
- function We(t, e) {
763
+ function lo(t, e) {
434
764
  return Math.atan2(e.y - t.y, e.x - t.x) * 180 / Math.PI;
435
765
  }
436
- function jt(t) {
766
+ function De(t) {
437
767
  if (!t) return null;
438
768
  const e = t.trim().split(/[\s,]+/).map(Number);
439
769
  return e.length !== 4 || e.some((n) => Number.isNaN(n)) ? null : { x: e[0], y: e[1], width: e[2], height: e[3] };
440
770
  }
441
- const Zt = {
771
+ const Be = {
442
772
  fill: "fill",
443
773
  "fill-opacity": "fill-opacity",
444
774
  stroke: "stroke",
@@ -446,68 +776,68 @@ const Zt = {
446
776
  "stroke-opacity": "stroke-opacity",
447
777
  opacity: "opacity"
448
778
  };
449
- function qt(t) {
779
+ function Xe(t) {
450
780
  const e = {};
451
781
  for (const n of t.split(";")) {
452
- const s = n.indexOf(":");
453
- if (s === -1) continue;
454
- const o = n.slice(0, s).trim().toLowerCase(), i = n.slice(s + 1).trim();
455
- o && i && (e[o] = i);
782
+ const o = n.indexOf(":");
783
+ if (o === -1) continue;
784
+ const r = n.slice(0, o).trim().toLowerCase(), s = n.slice(o + 1).trim();
785
+ r && s && (e[r] = s);
456
786
  }
457
787
  return e;
458
788
  }
459
- function Qt(t) {
789
+ function Ge(t) {
460
790
  const e = /* @__PURE__ */ new Map(), n = t.replace(/\/\*[\s\S]*?\*\//g, "");
461
- for (const s of n.matchAll(/([^{]+)\{([^}]*)\}/g)) {
462
- const o = s[1].split(",").map((u) => u.trim()), i = qt(s[2]);
463
- for (const u of o) {
464
- const c = u.match(/^\.([a-zA-Z0-9_-]+)$/);
465
- if (!c) continue;
466
- const r = c[1];
467
- e.set(r, {
468
- ...e.get(r) || {},
469
- ...i
791
+ for (const o of n.matchAll(/([^{]+)\{([^}]*)\}/g)) {
792
+ const r = o[1].split(",").map((u) => u.trim()), s = Xe(o[2]);
793
+ for (const u of r) {
794
+ const a = u.match(/^\.([a-zA-Z0-9_-]+)$/);
795
+ if (!a) continue;
796
+ const i = a[1];
797
+ e.set(i, {
798
+ ...e.get(i) || {},
799
+ ...s
470
800
  });
471
801
  }
472
802
  }
473
803
  return e;
474
804
  }
475
- function Jt(t, e) {
805
+ function Ke(t, e) {
476
806
  const n = {};
477
- for (const s of t.split(/\s+/).map((o) => o.trim()).filter(Boolean))
478
- Object.assign(n, e.get(s) || {});
807
+ for (const o of t.split(/\s+/).map((r) => r.trim()).filter(Boolean))
808
+ Object.assign(n, e.get(o) || {});
479
809
  return n;
480
810
  }
481
- function te(t) {
811
+ function $e(t) {
482
812
  const e = [], n = t.replace(/<!--[\s\S]*?-->/g, "");
483
- for (const o of n.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))
484
- e.push(o[1]);
813
+ for (const r of n.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))
814
+ e.push(r[1]);
485
815
  if (e.length === 0) return t;
486
- const s = /* @__PURE__ */ new Map();
487
- for (const o of e)
488
- for (const [i, u] of Qt(o))
489
- s.set(i, { ...s.get(i) || {}, ...u });
490
- return s.size === 0 ? t : t.replace(
816
+ const o = /* @__PURE__ */ new Map();
817
+ for (const r of e)
818
+ for (const [s, u] of Ge(r))
819
+ o.set(s, { ...o.get(s) || {}, ...u });
820
+ return o.size === 0 ? t : t.replace(
491
821
  /<(path|polygon|polyline|line|rect|g|circle|ellipse)\b([^>]*)>/gi,
492
- (o, i, u) => {
493
- const c = /\/\s*$/.test(u), r = u.replace(/\/\s*$/, ""), m = r.match(/\bclass\s*=\s*["']([^"']*)["']/i);
494
- if (!m) return o;
495
- const y = Jt(m[1], s);
496
- let l = r;
497
- for (const [k, a] of Object.entries(y)) {
498
- const d = Zt[k];
499
- d && (new RegExp(`\\b${d}\\s*=`, "i").test(l) || (l += ` ${d}="${a}"`));
822
+ (r, s, u) => {
823
+ const a = /\/\s*$/.test(u), i = u.replace(/\/\s*$/, ""), y = i.match(/\bclass\s*=\s*["']([^"']*)["']/i);
824
+ if (!y) return r;
825
+ const p = Ke(y[1], o);
826
+ let l = i;
827
+ for (const [k, c] of Object.entries(p)) {
828
+ const d = Be[k];
829
+ d && (new RegExp(`\\b${d}\\s*=`, "i").test(l) || (l += ` ${d}="${c}"`));
500
830
  }
501
- return `<${i}${l}${c ? " /" : ""}>`;
831
+ return `<${s}${l}${a ? " /" : ""}>`;
502
832
  }
503
833
  );
504
834
  }
505
- function dt(t) {
506
- var c, r, m, y, l;
507
- const e = {}, n = (c = t.match(/\bfill\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : c[1], s = (r = t.match(/\bstroke\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : r[1], o = (m = t.match(/\bstroke-width\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : m[1], i = (y = t.match(/\bopacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : y[1], u = (l = t.match(/\bfill-opacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : l[1];
508
- return n && n.toLowerCase() !== "none" && (e.fill = n), s && s.toLowerCase() !== "none" && (e.stroke = s), o != null && !Number.isNaN(Number(o)) && (e.strokeWidth = Number(o)), i != null && !Number.isNaN(Number(i)) ? e.opacity = Number(i) : u != null && !Number.isNaN(Number(u)) && (e.opacity = Number(u)), e;
835
+ function It(t) {
836
+ var a, i, y, p, l;
837
+ const e = {}, n = (a = t.match(/\bfill\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : a[1], o = (i = t.match(/\bstroke\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : i[1], r = (y = t.match(/\bstroke-width\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : y[1], s = (p = t.match(/\bopacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : p[1], u = (l = t.match(/\bfill-opacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : l[1];
838
+ return n && n.toLowerCase() !== "none" && (e.fill = n), o && o.toLowerCase() !== "none" && (e.stroke = o), r != null && !Number.isNaN(Number(r)) && (e.strokeWidth = Number(r)), s != null && !Number.isNaN(Number(s)) ? e.opacity = Number(s) : u != null && !Number.isNaN(Number(u)) && (e.opacity = Number(u)), e;
509
839
  }
510
- function j(t, e) {
840
+ function it(t, e) {
511
841
  return {
512
842
  fill: e.fill ?? t.fill,
513
843
  stroke: e.stroke ?? t.stroke,
@@ -515,8 +845,8 @@ function j(t, e) {
515
845
  opacity: e.opacity ?? t.opacity
516
846
  };
517
847
  }
518
- const et = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };
519
- function G(t, e) {
848
+ const ft = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };
849
+ function H(t, e) {
520
850
  return {
521
851
  a: t.a * e.a + t.c * e.b,
522
852
  b: t.b * e.a + t.d * e.b,
@@ -526,41 +856,41 @@ function G(t, e) {
526
856
  f: t.b * e.e + t.d * e.f + t.f
527
857
  };
528
858
  }
529
- function ee(t, e) {
859
+ function ze(t, e) {
530
860
  return {
531
861
  x: t.a * e.x + t.c * e.y + t.e,
532
862
  y: t.b * e.x + t.d * e.y + t.f
533
863
  };
534
864
  }
535
- function ne(t, e = 1e-9) {
865
+ function We(t, e = 1e-9) {
536
866
  return Math.abs(t.a - 1) < e && Math.abs(t.b) < e && Math.abs(t.c) < e && Math.abs(t.d - 1) < e && Math.abs(t.e) < e && Math.abs(t.f) < e;
537
867
  }
538
- function Z(t, e) {
868
+ function st(t, e) {
539
869
  return { a: 1, b: 0, c: 0, d: 1, e: t, f: e };
540
870
  }
541
- function se(t) {
542
- const e = t * Math.PI / 180, n = Math.cos(e), s = Math.sin(e);
543
- return { a: n, b: s, c: -s, d: n, e: 0, f: 0 };
871
+ function Ue(t) {
872
+ const e = t * Math.PI / 180, n = Math.cos(e), o = Math.sin(e);
873
+ return { a: n, b: o, c: -o, d: n, e: 0, f: 0 };
544
874
  }
545
- function oe(t, e) {
875
+ function He(t, e) {
546
876
  switch (t) {
547
877
  case "matrix":
548
878
  return e.length < 6 ? null : { a: e[0], b: e[1], c: e[2], d: e[3], e: e[4], f: e[5] };
549
879
  case "translate":
550
- return e.length < 1 ? null : Z(e[0], e[1] ?? 0);
880
+ return e.length < 1 ? null : st(e[0], e[1] ?? 0);
551
881
  case "scale": {
552
882
  if (e.length < 1) return null;
553
- const n = e[0], s = e[1] ?? n;
554
- return { a: n, b: 0, c: 0, d: s, e: 0, f: 0 };
883
+ const n = e[0], o = e[1] ?? n;
884
+ return { a: n, b: 0, c: 0, d: o, e: 0, f: 0 };
555
885
  }
556
886
  case "rotate": {
557
887
  if (e.length < 1) return null;
558
- const n = se(e[0]);
888
+ const n = Ue(e[0]);
559
889
  if (e.length < 3) return n;
560
- const s = e[1], o = e[2];
561
- return G(
562
- G(Z(s, o), n),
563
- Z(-s, -o)
890
+ const o = e[1], r = e[2];
891
+ return H(
892
+ H(st(o, r), n),
893
+ st(-o, -r)
564
894
  );
565
895
  }
566
896
  case "skewx":
@@ -571,114 +901,114 @@ function oe(t, e) {
571
901
  return null;
572
902
  }
573
903
  }
574
- const ht = /([a-zA-Z]+)\s*\(([^)]*)\)/g;
575
- function xt(t) {
576
- if (!t) return et;
577
- let e = et;
578
- ht.lastIndex = 0;
904
+ const _t = /([a-zA-Z]+)\s*\(([^)]*)\)/g;
905
+ function Ct(t) {
906
+ if (!t) return ft;
907
+ let e = ft;
908
+ _t.lastIndex = 0;
579
909
  let n;
580
- for (; (n = ht.exec(t)) !== null; ) {
581
- const s = n[1].toLowerCase(), o = n[2].trim().split(/[\s,]+/).filter(Boolean).map(Number);
582
- if (o.some((u) => Number.isNaN(u))) continue;
583
- const i = oe(s, o);
584
- i && (e = G(e, i));
910
+ for (; (n = _t.exec(t)) !== null; ) {
911
+ const o = n[1].toLowerCase(), r = n[2].trim().split(/[\s,]+/).filter(Boolean).map(Number);
912
+ if (r.some((u) => Number.isNaN(u))) continue;
913
+ const s = He(o, r);
914
+ s && (e = H(e, s));
585
915
  }
586
916
  return e;
587
917
  }
588
- function B(t) {
918
+ function K(t) {
589
919
  if (!Number.isFinite(t)) return "0";
590
920
  const e = Math.round(t * 1e4) / 1e4;
591
921
  return Object.is(e, -0) ? "0" : String(e);
592
922
  }
593
- function ie(t, e, n, s) {
594
- const o = s * Math.PI / 180, i = Math.cos(o), u = Math.sin(o), c = i * e, r = u * e, m = -u * n, y = i * n, l = t.a * c + t.c * r, k = t.b * c + t.d * r, a = t.a * m + t.c * y, d = t.b * m + t.d * y, f = (l + d) / 2, h = (l - d) / 2, p = (k + a) / 2, b = (k - a) / 2, x = Math.hypot(f, b), g = Math.hypot(h, p), I = Math.abs(x + g), v = Math.abs(x - g), M = Math.atan2(p, h), L = (Math.atan2(b, f) + M) / 2 * (180 / Math.PI);
595
- return { rx: I, ry: v, phiDeg: L };
923
+ function Ve(t, e, n, o) {
924
+ const r = o * Math.PI / 180, s = Math.cos(r), u = Math.sin(r), a = s * e, i = u * e, y = -u * n, p = s * n, l = t.a * a + t.c * i, k = t.b * a + t.d * i, c = t.a * y + t.c * p, d = t.b * y + t.d * p, f = (l + d) / 2, h = (l - d) / 2, m = (k + c) / 2, b = (k - c) / 2, x = Math.hypot(f, b), g = Math.hypot(h, m), I = Math.abs(x + g), C = Math.abs(x - g), _ = Math.atan2(m, h), M = (Math.atan2(b, f) + _) / 2 * (180 / Math.PI);
925
+ return { rx: I, ry: C, phiDeg: M };
596
926
  }
597
- function re(t, e) {
598
- if (!t || ne(e)) return t;
599
- const n = Mt(t), s = [], o = e.a * e.d - e.b * e.c < 0;
600
- let i = 0, u = "", c = 0, r = 0, m = 0, y = 0;
927
+ function Ze(t, e) {
928
+ if (!t || We(e)) return t;
929
+ const n = Dt(t), o = [], r = e.a * e.d - e.b * e.c < 0;
930
+ let s = 0, u = "", a = 0, i = 0, y = 0, p = 0;
601
931
  const l = () => {
602
- const d = Number(n[i++]);
932
+ const d = Number(n[s++]);
603
933
  return Number.isNaN(d) ? 0 : d;
604
934
  }, k = (d, ...f) => {
605
- s.push(d + (f.length ? " " + f.map(B).join(" ") : ""));
606
- }, a = (d, f) => {
607
- const h = ee(e, { x: d, y: f });
935
+ o.push(d + (f.length ? " " + f.map(K).join(" ") : ""));
936
+ }, c = (d, f) => {
937
+ const h = ze(e, { x: d, y: f });
608
938
  return [h.x, h.y];
609
939
  };
610
- for (; i < n.length; ) {
611
- const d = n[i];
612
- switch (/[a-zA-Z]/.test(d) && (u = d, i++), u) {
940
+ for (; s < n.length; ) {
941
+ const d = n[s];
942
+ switch (/[a-zA-Z]/.test(d) && (u = d, s++), u) {
613
943
  case "M":
614
944
  case "m": {
615
- const f = u === "m", h = l(), p = l();
616
- c = f ? c + h : h, r = f ? r + p : p, m = c, y = r, k("M", ...a(c, r)), u = f ? "l" : "L";
945
+ const f = u === "m", h = l(), m = l();
946
+ a = f ? a + h : h, i = f ? i + m : m, y = a, p = i, k("M", ...c(a, i)), u = f ? "l" : "L";
617
947
  break;
618
948
  }
619
949
  case "L":
620
950
  case "l": {
621
- const f = u === "l", h = l(), p = l();
622
- c = f ? c + h : h, r = f ? r + p : p, k("L", ...a(c, r));
951
+ const f = u === "l", h = l(), m = l();
952
+ a = f ? a + h : h, i = f ? i + m : m, k("L", ...c(a, i));
623
953
  break;
624
954
  }
625
955
  case "H":
626
956
  case "h": {
627
957
  const f = u === "h", h = l();
628
- c = f ? c + h : h, k("L", ...a(c, r));
958
+ a = f ? a + h : h, k("L", ...c(a, i));
629
959
  break;
630
960
  }
631
961
  case "V":
632
962
  case "v": {
633
963
  const f = u === "v", h = l();
634
- r = f ? r + h : h, k("L", ...a(c, r));
964
+ i = f ? i + h : h, k("L", ...c(a, i));
635
965
  break;
636
966
  }
637
967
  case "C":
638
968
  case "c": {
639
- const f = u === "c", h = f ? c + l() : l(), p = f ? r + l() : l(), b = f ? c + l() : l(), x = f ? r + l() : l(), g = f ? c + l() : l(), I = f ? r + l() : l();
640
- k("C", ...a(h, p), ...a(b, x), ...a(g, I)), c = g, r = I;
969
+ const f = u === "c", h = f ? a + l() : l(), m = f ? i + l() : l(), b = f ? a + l() : l(), x = f ? i + l() : l(), g = f ? a + l() : l(), I = f ? i + l() : l();
970
+ k("C", ...c(h, m), ...c(b, x), ...c(g, I)), a = g, i = I;
641
971
  break;
642
972
  }
643
973
  case "S":
644
974
  case "s": {
645
- const f = u === "s", h = f ? c + l() : l(), p = f ? r + l() : l(), b = f ? c + l() : l(), x = f ? r + l() : l();
646
- k("S", ...a(h, p), ...a(b, x)), c = b, r = x;
975
+ const f = u === "s", h = f ? a + l() : l(), m = f ? i + l() : l(), b = f ? a + l() : l(), x = f ? i + l() : l();
976
+ k("S", ...c(h, m), ...c(b, x)), a = b, i = x;
647
977
  break;
648
978
  }
649
979
  case "Q":
650
980
  case "q": {
651
- const f = u === "q", h = f ? c + l() : l(), p = f ? r + l() : l(), b = f ? c + l() : l(), x = f ? r + l() : l();
652
- k("Q", ...a(h, p), ...a(b, x)), c = b, r = x;
981
+ const f = u === "q", h = f ? a + l() : l(), m = f ? i + l() : l(), b = f ? a + l() : l(), x = f ? i + l() : l();
982
+ k("Q", ...c(h, m), ...c(b, x)), a = b, i = x;
653
983
  break;
654
984
  }
655
985
  case "T":
656
986
  case "t": {
657
- const f = u === "t", h = f ? c + l() : l(), p = f ? r + l() : l();
658
- k("T", ...a(h, p)), c = h, r = p;
987
+ const f = u === "t", h = f ? a + l() : l(), m = f ? i + l() : l();
988
+ k("T", ...c(h, m)), a = h, i = m;
659
989
  break;
660
990
  }
661
991
  case "A":
662
992
  case "a": {
663
- const f = u === "a", h = l(), p = l(), b = l(), x = l(), g = l(), I = f ? c + l() : l(), v = f ? r + l() : l(), M = ie(e, h, p, b), [S, L] = a(I, v);
664
- s.push(
665
- `A ${B(M.rx)} ${B(M.ry)} ${B(M.phiDeg)} ${x ? 1 : 0} ${(g ? 1 : 0) ^ (o ? 1 : 0)} ${B(S)} ${B(L)}`
666
- ), c = I, r = v;
993
+ const f = u === "a", h = l(), m = l(), b = l(), x = l(), g = l(), I = f ? a + l() : l(), C = f ? i + l() : l(), _ = Ve(e, h, m, b), [A, M] = c(I, C);
994
+ o.push(
995
+ `A ${K(_.rx)} ${K(_.ry)} ${K(_.phiDeg)} ${x ? 1 : 0} ${(g ? 1 : 0) ^ (r ? 1 : 0)} ${K(A)} ${K(M)}`
996
+ ), a = I, i = C;
667
997
  break;
668
998
  }
669
999
  case "Z":
670
1000
  case "z": {
671
- s.push("Z"), c = m, r = y;
1001
+ o.push("Z"), a = y, i = p;
672
1002
  break;
673
1003
  }
674
1004
  default:
675
- i++;
1005
+ s++;
676
1006
  break;
677
1007
  }
678
1008
  }
679
- return s.join(" ");
1009
+ return o.join(" ");
680
1010
  }
681
- const ce = [
1011
+ const je = [
682
1012
  { prefix: "walkable", kind: "walkable" },
683
1013
  { prefix: "void", kind: "void" },
684
1014
  { prefix: "unit", kind: "unit" },
@@ -706,7 +1036,7 @@ const ce = [
706
1036
  { prefix: "parking-icon", kind: "parking_icon" },
707
1037
  { prefix: "walking-path", kind: "walkable" },
708
1038
  { prefix: "water", kind: "water" }
709
- ], ae = [
1039
+ ], qe = [
710
1040
  { prefix: "parking-zone", kind: "parking_zone" },
711
1041
  { prefix: "parking-lane", kind: "parking_zone" },
712
1042
  { prefix: "parking-line", kind: "decor" },
@@ -728,127 +1058,127 @@ const ce = [
728
1058
  { prefix: "elevator-", kind: "connector" },
729
1059
  { prefix: "stairs-", kind: "connector" }
730
1060
  ];
731
- function nt(t) {
732
- const e = V(t);
1061
+ function dt(t) {
1062
+ const e = tt(t);
733
1063
  return e === "route path" || e.startsWith("route path ");
734
1064
  }
735
- function wt(t) {
736
- const e = V(t);
737
- return e === "routes" || e === "route" || e === "wayfinding" || e === "wayfinding routes" || nt(t);
1065
+ function Gt(t) {
1066
+ const e = tt(t);
1067
+ return e === "routes" || e === "route" || e === "wayfinding" || e === "wayfinding routes" || dt(t);
738
1068
  }
739
- const le = [
740
- ...Tt,
1069
+ const Qe = [
1070
+ ...le,
741
1071
  "walkable",
742
1072
  "void"
743
- ], ue = 8;
744
- function fe(t, e = "floor") {
745
- if (Lt(t))
1073
+ ], Je = 8;
1074
+ function tn(t, e = "floor") {
1075
+ if (zt(t))
746
1076
  return { kind: null, guessed: !1 };
747
- const n = t.toLowerCase(), s = e === "base" ? ae : ce;
748
- for (const { prefix: o, kind: i } of s)
749
- if (n === o || n.startsWith(o))
750
- return { kind: i, guessed: !1 };
1077
+ const n = t.toLowerCase(), o = e === "base" ? qe : je;
1078
+ for (const { prefix: r, kind: s } of o)
1079
+ if (n === r || n.startsWith(r))
1080
+ return { kind: s, guessed: !1 };
751
1081
  return n.startsWith("interactive") ? { kind: "unit", guessed: !0 } : { kind: null, guessed: !1 };
752
1082
  }
753
- function V(t) {
1083
+ function tt(t) {
754
1084
  return t.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
755
1085
  }
756
- function rt(t) {
1086
+ function pt(t) {
757
1087
  return /non[-_ ]?interactive/i.test(t);
758
1088
  }
759
- function Ct(t) {
760
- return rt(t) ? !1 : /^interactive( items)?( \d+)?$/.test(V(t));
1089
+ function Kt(t) {
1090
+ return pt(t) ? !1 : /^interactive( items)?( \d+)?$/.test(tt(t));
761
1091
  }
762
- function At(t) {
763
- const e = V(t);
1092
+ function $t(t) {
1093
+ const e = tt(t);
764
1094
  return e === "stores" || e === "store layer" || e === "units" || e === "unit layer";
765
1095
  }
766
- function Lt(t) {
767
- return Ct(t) || rt(t) || At(t) || wt(t);
1096
+ function zt(t) {
1097
+ return Kt(t) || pt(t) || $t(t) || Gt(t);
768
1098
  }
769
- function q(t) {
1099
+ function ct(t) {
770
1100
  return t.interactiveContainer || t.nonInteractiveContainer || t.storeFolder;
771
1101
  }
772
- function E(t, e) {
1102
+ function T(t, e) {
773
1103
  const n = t.match(new RegExp(`\\b${e}\\s*=\\s*["']([^"']*)["']`, "i"));
774
1104
  return n ? n[1] : null;
775
1105
  }
776
- function Y(t, e) {
1106
+ function D(t, e) {
777
1107
  const n = t.match(new RegExp(`\\b${e}\\s*=\\s*["']?(-?[\\d.]+)`, "i"));
778
1108
  return n ? Number(n[1]) : 0;
779
1109
  }
780
- function mt(t) {
1110
+ function At(t) {
781
1111
  return /\bdata-interactive\s*=\s*["']?(true|1|yes)/i.test(t);
782
1112
  }
783
- function de(t) {
784
- return [E(t, "id"), E(t, "data-name")].filter(
1113
+ function en(t) {
1114
+ return [T(t, "id"), T(t, "data-name")].filter(
785
1115
  (e) => !!e
786
1116
  );
787
1117
  }
788
- function he(t) {
789
- return t.some(rt) ? { interactiveContainer: !1, nonInteractiveContainer: !0, storeFolder: !1 } : t.some(Ct) ? { interactiveContainer: !0, nonInteractiveContainer: !1, storeFolder: !1 } : t.some(At) ? { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !0 } : { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !1 };
1118
+ function nn(t) {
1119
+ return t.some(pt) ? { interactiveContainer: !1, nonInteractiveContainer: !0, storeFolder: !1 } : t.some(Kt) ? { interactiveContainer: !0, nonInteractiveContainer: !1, storeFolder: !1 } : t.some($t) ? { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !0 } : { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !1 };
790
1120
  }
791
- function xe(t) {
1121
+ function on(t) {
792
1122
  const e = t.trim().split(/[\s,]+/).map(Number);
793
1123
  if (e.length < 4) return "";
794
1124
  let n = `M ${e[0]} ${e[1]}`;
795
- for (let s = 2; s < e.length; s += 2)
796
- n += ` L ${e[s]} ${e[s + 1]}`;
1125
+ for (let o = 2; o < e.length; o += 2)
1126
+ n += ` L ${e[o]} ${e[o + 1]}`;
797
1127
  return n += " Z", n;
798
1128
  }
799
- function me(t, e, n, s) {
800
- return `M ${t} ${e} L ${n} ${s}`;
1129
+ function rn(t, e, n, o) {
1130
+ return `M ${t} ${e} L ${n} ${o}`;
801
1131
  }
802
- function ye(t, e) {
1132
+ function sn(t, e) {
803
1133
  if (t === "path")
804
- return E(e, "d") ?? void 0;
1134
+ return T(e, "d") ?? void 0;
805
1135
  if (t === "polygon" || t === "polyline") {
806
- const n = E(e, "points");
807
- return n ? xe(n) : void 0;
1136
+ const n = T(e, "points");
1137
+ return n ? on(n) : void 0;
808
1138
  }
809
1139
  if (t === "line")
810
- return me(
811
- Y(e, "x1"),
812
- Y(e, "y1"),
813
- Y(e, "x2"),
814
- Y(e, "y2")
1140
+ return rn(
1141
+ D(e, "x1"),
1142
+ D(e, "y1"),
1143
+ D(e, "x2"),
1144
+ D(e, "y2")
815
1145
  );
816
1146
  if (t === "rect") {
817
- const n = Y(e, "x"), s = Y(e, "y"), o = Y(e, "width"), i = Y(e, "height");
818
- return `M ${n} ${s} L ${n + o} ${s} L ${n + o} ${s + i} L ${n} ${s + i} Z`;
1147
+ const n = D(e, "x"), o = D(e, "y"), r = D(e, "width"), s = D(e, "height");
1148
+ return `M ${n} ${o} L ${n + r} ${o} L ${n + r} ${o + s} L ${n} ${o + s} Z`;
819
1149
  }
820
1150
  }
821
- function pe(t) {
822
- const e = te(t).replace(/<!--[\s\S]*?-->/g, ""), n = e.match(/viewBox\s*=\s*["']([^"']+)["']/i), s = jt(n == null ? void 0 : n[1]), o = [], i = [], u = [], c = [];
823
- let r = 0;
824
- const m = () => c.some((x) => x.routeContainer), y = () => {
825
- for (let g = c.length - 1; g >= 0; g--) {
826
- const I = c[g].style;
1151
+ function cn(t) {
1152
+ const e = $e(t).replace(/<!--[\s\S]*?-->/g, ""), n = e.match(/viewBox\s*=\s*["']([^"']+)["']/i), o = De(n == null ? void 0 : n[1]), r = [], s = [], u = [], a = [];
1153
+ let i = 0;
1154
+ const y = () => a.some((x) => x.routeContainer), p = () => {
1155
+ for (let g = a.length - 1; g >= 0; g--) {
1156
+ const I = a[g].style;
827
1157
  if (I.fill || I.stroke || I.strokeWidth != null || I.opacity != null)
828
1158
  break;
829
1159
  }
830
1160
  let x = {};
831
- for (const g of c)
832
- x = j(x, g.style);
1161
+ for (const g of a)
1162
+ x = it(x, g.style);
833
1163
  return x;
834
1164
  }, l = () => {
835
- for (let x = c.length - 1; x >= 0; x--) {
836
- if (c[x].nonInteractiveContainer) return !1;
837
- if (c[x].interactiveContainer || c[x].storeFolder) return !0;
1165
+ for (let x = a.length - 1; x >= 0; x--) {
1166
+ if (a[x].nonInteractiveContainer) return !1;
1167
+ if (a[x].interactiveContainer || a[x].storeFolder) return !0;
838
1168
  }
839
1169
  return !1;
840
- }, k = () => c.length > 0 ? c[c.length - 1].matrix : et, a = () => {
841
- for (let x = c.length - 1; x >= 0; x--) {
842
- const g = c[x];
843
- if (!q(g) && g.id) {
1170
+ }, k = () => a.length > 0 ? a[a.length - 1].matrix : ft, c = () => {
1171
+ for (let x = a.length - 1; x >= 0; x--) {
1172
+ const g = a[x];
1173
+ if (!ct(g) && g.id) {
844
1174
  g.hasNamedChild = !0;
845
1175
  return;
846
1176
  }
847
1177
  }
848
1178
  }, d = () => {
849
- for (let x = c.length - 1; x >= 0; x--) {
850
- const g = c[x];
851
- if (!q(g) && g.id)
1179
+ for (let x = a.length - 1; x >= 0; x--) {
1180
+ const g = a[x];
1181
+ if (!ct(g) && g.id)
852
1182
  return g;
853
1183
  }
854
1184
  return null;
@@ -857,376 +1187,379 @@ function pe(t) {
857
1187
  for (const g of x.collectedPaths) h("path", g);
858
1188
  return;
859
1189
  }
860
- q(x) || !x.id || x.collectedPaths.length === 0 || (x.hasNamedChild && u.push(
1190
+ ct(x) || !x.id || x.collectedPaths.length === 0 || (x.hasNamedChild && u.push(
861
1191
  `Group ${x.id} mixes named children with ${x.collectedPaths.length} unnamed path(s); the unnamed paths were merged into a single shape "${x.id}" — give them ids if they are separate shapes`
862
- ), o.push({
1192
+ ), r.push({
863
1193
  id: x.id,
864
1194
  tag: "g",
865
1195
  d: x.collectedPaths.join(" "),
866
1196
  interactive: x.inInteractive,
867
- style: j(y(), x.style)
1197
+ style: it(p(), x.style)
868
1198
  }));
869
1199
  }, h = (x, g) => {
870
1200
  if (!g) return;
871
1201
  const I = x === "polyline" || x === "polygon" || x === "path" ? g.replace(/\s*Z\s*$/i, "") : g;
872
- i.includes(I) || i.push(I);
873
- }, p = /<(\/?)(path|polygon|polyline|line|rect|g)\b([^>]*)(\/?)>/gi;
1202
+ s.includes(I) || s.push(I);
1203
+ }, m = /<(\/?)(path|polygon|polyline|line|rect|g)\b([^>]*)(\/?)>/gi;
874
1204
  let b;
875
- for (; (b = p.exec(e)) !== null; ) {
876
- const x = b[1] === "/", g = b[2].toLowerCase(), I = b[3] ?? "", v = b[4] === "/" || /\/\s*$/.test(I);
1205
+ for (; (b = m.exec(e)) !== null; ) {
1206
+ const x = b[1] === "/", g = b[2].toLowerCase(), I = b[3] ?? "", C = b[4] === "/" || /\/\s*$/.test(I);
877
1207
  if (x) {
878
1208
  if (g === "g") {
879
- const A = c.pop();
880
- A && f(A);
1209
+ const O = a.pop();
1210
+ O && f(O);
881
1211
  }
882
1212
  continue;
883
1213
  }
884
1214
  if (g === "g") {
885
- const A = E(I, "id"), F = de(I), { interactiveContainer: N, nonInteractiveContainer: _, storeFolder: W } = he(F), z = l();
886
- A && a();
887
- const H = {
888
- id: A,
889
- interactiveContainer: N,
890
- nonInteractiveContainer: _,
891
- storeFolder: W,
892
- inInteractive: N || W || mt(I) || z && !_,
1215
+ const O = T(I, "id"), Y = en(I), { interactiveContainer: v, nonInteractiveContainer: N, storeFolder: $ } = nn(Y), V = l();
1216
+ O && c();
1217
+ const Z = {
1218
+ id: O,
1219
+ interactiveContainer: v,
1220
+ nonInteractiveContainer: N,
1221
+ storeFolder: $,
1222
+ inInteractive: v || $ || At(I) || V && !N,
893
1223
  collectedPaths: [],
894
- style: dt(I),
895
- matrix: G(k(), xt(E(I, "transform"))),
1224
+ style: It(I),
1225
+ matrix: H(k(), Ct(T(I, "transform"))),
896
1226
  hasNamedChild: !1,
897
- routeContainer: F.some(wt) || m()
1227
+ routeContainer: Y.some(Gt) || y()
898
1228
  };
899
- v || c.push(H);
1229
+ C || a.push(Z);
900
1230
  continue;
901
1231
  }
902
- const M = E(I, "id"), S = ye(g, I), L = G(k(), xt(E(I, "transform"))), C = S && re(S, L), T = mt(I) || l(), R = j(y(), dt(I)), D = E(I, "data-name");
903
- if (M != null && nt(M) || D != null && nt(D) || !M && m()) {
904
- h(g, C);
1232
+ const _ = T(I, "id"), A = sn(g, I), M = H(k(), Ct(T(I, "transform"))), L = A && Ze(A, M), P = At(I) || l(), R = it(p(), It(I)), F = T(I, "data-name");
1233
+ if (_ != null && dt(_) || F != null && dt(F) || !_ && y()) {
1234
+ h(g, L);
905
1235
  continue;
906
1236
  }
907
- if (M) {
908
- a(), C && o.push({ id: M, tag: g, d: C, interactive: T, style: R });
1237
+ if (_) {
1238
+ c(), L && r.push({ id: _, tag: g, d: L, interactive: P, style: R });
909
1239
  continue;
910
1240
  }
911
- if (!C) continue;
912
- const w = d();
913
- w ? (w.collectedPaths.push(C), !w.style.fill && R.fill && (w.style = R)) : T && (r += 1, o.push({
914
- id: `interactive-anon-${r}`,
1241
+ if (!L) continue;
1242
+ const S = d();
1243
+ S ? (S.collectedPaths.push(L), !S.style.fill && R.fill && (S.style = R)) : P && (i += 1, r.push({
1244
+ id: `interactive-anon-${i}`,
915
1245
  tag: g,
916
- d: C,
1246
+ d: L,
917
1247
  interactive: !0,
918
1248
  style: R
919
1249
  }));
920
1250
  }
921
- for (; c.length > 0; )
922
- f(c.pop());
923
- return { viewbox: s, elements: o, routePathDs: i, warnings: u };
1251
+ for (; a.length > 0; )
1252
+ f(a.pop());
1253
+ return { viewbox: o, elements: r, routePathDs: s, warnings: u };
924
1254
  }
925
- function ge(t) {
1255
+ function an(t) {
926
1256
  return t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 80);
927
1257
  }
928
- function be(t, e) {
929
- var o, i, u, c;
930
- const n = ot(e), s = {};
931
- return n != null && n.fill ? s.fill = n.fill : (o = t.style) != null && o.fill && (s.fill = t.style.fill), n != null && n.stroke ? s.stroke = n.stroke : (i = t.style) != null && i.stroke && (s.stroke = t.style.stroke), (n == null ? void 0 : n.strokeWidth) != null ? s.strokeWidth = n.strokeWidth : ((u = t.style) == null ? void 0 : u.strokeWidth) != null && (s.strokeWidth = t.style.strokeWidth), ((c = t.style) == null ? void 0 : c.opacity) != null && (s.opacity = t.style.opacity), (n == null ? void 0 : n.extrudeHeight) != null && (s.extrudeHeight = n.extrudeHeight), s;
1258
+ function ln(t, e) {
1259
+ var r, s, u, a;
1260
+ const n = yt(e), o = {};
1261
+ return n != null && n.fill ? o.fill = n.fill : (r = t.style) != null && r.fill && (o.fill = t.style.fill), n != null && n.stroke ? o.stroke = n.stroke : (s = t.style) != null && s.stroke && (o.stroke = t.style.stroke), (n == null ? void 0 : n.strokeWidth) != null ? o.strokeWidth = n.strokeWidth : ((u = t.style) == null ? void 0 : u.strokeWidth) != null && (o.strokeWidth = t.style.strokeWidth), ((a = t.style) == null ? void 0 : a.opacity) != null && (o.opacity = t.style.opacity), (n == null ? void 0 : n.extrudeHeight) != null && (o.extrudeHeight = n.extrudeHeight), o;
932
1262
  }
933
- function ke(t, e) {
1263
+ function un(t, e) {
934
1264
  return t == null && e == null ? !0 : t == null || e == null ? !1 : Math.abs(t.x - e.x) < 0.01 && Math.abs(t.y - e.y) < 0.01 && Math.abs(t.width - e.width) < 0.01 && Math.abs(t.height - e.height) < 0.01;
935
1265
  }
936
- function Xe(t, e = "floor", n = {}) {
937
- const s = pe(t), o = [], i = [], u = [], c = [...s.warnings], r = [];
938
- let m = 0, y = 0, l = 0;
939
- const k = n.previousViewbox != null && s.viewbox != null && !ke(n.previousViewbox, s.viewbox);
940
- k && c.push(
1266
+ function uo(t, e = "floor", n = {}) {
1267
+ const o = cn(t), r = [], s = [], u = [], a = [...o.warnings], i = [];
1268
+ let y = 0, p = 0, l = 0;
1269
+ const k = n.previousViewbox != null && o.viewbox != null && !un(n.previousViewbox, o.viewbox);
1270
+ k && a.push(
941
1271
  "SVG viewBox differs from the stored artboard — re-upload blocked until the designer restores the original viewBox"
942
1272
  );
943
- for (const a of s.elements) {
944
- if (Lt(a.id)) continue;
945
- let { kind: d, guessed: f } = fe(a.id, e);
946
- a.interactive && !d && (d = "unit", f = !0);
1273
+ for (const c of o.elements) {
1274
+ if (zt(c.id)) continue;
1275
+ let { kind: d, guessed: f } = tn(c.id, e);
1276
+ c.interactive && !d && (d = "unit", f = !0);
947
1277
  const h = {
948
- sourceSvgId: a.id,
1278
+ sourceSvgId: c.id,
949
1279
  kind: d,
950
1280
  guessed: f
951
1281
  };
952
1282
  if (!d)
953
- if (i.push(a.id), e === "floor")
1283
+ if (s.push(c.id), e === "floor")
954
1284
  d = "decor", h.kind = "decor", h.message = "No matching prefix; imported as decor (floor mode)";
955
1285
  else {
956
- h.message = "No matching prefix; skipped (outdoor decor stays in SVG)", o.push(h);
1286
+ h.message = "No matching prefix; skipped (outdoor decor stays in SVG)", r.push(h);
957
1287
  continue;
958
1288
  }
959
- if (!a.d) {
960
- c.push(`Element ${a.id} has no drawable geometry`);
1289
+ if (!c.d) {
1290
+ a.push(`Element ${c.id} has no drawable geometry`);
961
1291
  continue;
962
1292
  }
963
1293
  if (e === "base") {
964
- const x = ot(a.id) != null;
965
- if (!(!x && (le.includes(d) || !!a.interactive))) {
966
- o.push({
1294
+ const x = yt(c.id) != null;
1295
+ if (!(!x && (Qe.includes(d) || !!c.interactive))) {
1296
+ r.push({
967
1297
  ...h,
968
1298
  message: x ? "Static decoration — rendered from outdoor SVG" : "Decoration — not persisted; rendered from outdoor SVG"
969
1299
  });
970
1300
  continue;
971
1301
  }
972
1302
  }
973
- f && (u.push(h), h.message = h.message ?? "Guessed kind from interactive/fallback rule"), o.push(h), d === "walkable" && m++, d === "void" && y++, d === "unit" && l++;
974
- const p = Ut([a.d]), b = it(p);
975
- r.push({
976
- key: ge(a.id),
1303
+ f && (u.push(h), h.message = h.message ?? "Guessed kind from interactive/fallback rule"), r.push(h), d === "walkable" && y++, d === "void" && p++, d === "unit" && l++;
1304
+ const m = Fe([c.d]), b = xt(m);
1305
+ i.push({
1306
+ key: an(c.id),
977
1307
  kind: d,
978
- geometry: p,
1308
+ geometry: m,
979
1309
  bbox: b,
980
- sourceSvgId: a.id,
981
- style: be(a, a.id)
1310
+ sourceSvgId: c.id,
1311
+ style: ln(c, c.id)
982
1312
  });
983
1313
  }
984
- return e === "floor" && m === 0 && c.push(
1314
+ return e === "floor" && y === 0 && a.push(
985
1315
  "No walkable layer found — auto-skeleton will be unavailable for this level"
986
1316
  ), {
987
1317
  report: {
988
- classified: o,
989
- unrecognized: i,
1318
+ classified: r,
1319
+ unrecognized: s,
990
1320
  guessed: u,
991
- walkableCount: m,
992
- voidCount: y,
1321
+ walkableCount: y,
1322
+ voidCount: p,
993
1323
  unitCount: l,
994
- warnings: c
1324
+ warnings: a
995
1325
  },
996
- shapes: r,
997
- viewbox: s.viewbox,
998
- routePathDs: s.routePathDs,
1326
+ shapes: i,
1327
+ viewbox: o.viewbox,
1328
+ routePathDs: o.routePathDs,
999
1329
  viewBoxChanged: k
1000
1330
  };
1001
1331
  }
1002
- function Ge(t, e, n, s = {}) {
1003
- const o = s.driftThreshold ?? ue, i = new Map(
1004
- e.filter((r) => r.sourceSvgId).map((r) => [r.sourceSvgId, r])
1005
- ), u = /* @__PURE__ */ new Set(), c = [];
1006
- for (const r of t) {
1007
- const m = i.get(r.sourceSvgId);
1008
- if (u.add(r.sourceSvgId), !m)
1009
- c.push({
1010
- sourceSvgId: r.sourceSvgId,
1332
+ function fo(t, e, n, o = {}) {
1333
+ const r = o.driftThreshold ?? Je, s = new Map(
1334
+ e.filter((i) => i.sourceSvgId).map((i) => [i.sourceSvgId, i])
1335
+ ), u = /* @__PURE__ */ new Set(), a = [];
1336
+ for (const i of t) {
1337
+ const y = s.get(i.sourceSvgId);
1338
+ if (u.add(i.sourceSvgId), !y)
1339
+ a.push({
1340
+ sourceSvgId: i.sourceSvgId,
1011
1341
  change: "added",
1012
- newKind: r.kind
1342
+ newKind: i.kind
1013
1343
  });
1014
- else if (m.kind !== r.kind)
1015
- c.push({
1016
- sourceSvgId: r.sourceSvgId,
1344
+ else if (y.kind !== i.kind)
1345
+ a.push({
1346
+ sourceSvgId: i.sourceSvgId,
1017
1347
  change: "kind_changed",
1018
- existingShapeId: m.id,
1019
- existingKind: m.kind,
1020
- newKind: r.kind,
1021
- preserve: { key: m.key, assignment: !0, anchors: !0 },
1022
- geometryLocked: m.geometryLocked
1348
+ existingShapeId: y.id,
1349
+ existingKind: y.kind,
1350
+ newKind: i.kind,
1351
+ preserve: { key: y.key, assignment: !0, anchors: !0 },
1352
+ geometryLocked: y.geometryLocked
1023
1353
  });
1024
1354
  else {
1025
- let y = "unchanged";
1026
- if (m.bbox) {
1027
- const l = (m.bbox.minX + m.bbox.maxX) / 2, k = (m.bbox.minY + m.bbox.maxY) / 2, a = Vt(r.geometry);
1028
- Math.hypot(a.x - l, a.y - k) > o && (y = "moved");
1355
+ let p = "unchanged";
1356
+ if (y.bbox) {
1357
+ const l = (y.bbox.minX + y.bbox.maxX) / 2, k = (y.bbox.minY + y.bbox.maxY) / 2, c = Ye(i.geometry);
1358
+ Math.hypot(c.x - l, c.y - k) > r && (p = "moved");
1029
1359
  }
1030
- c.push({
1031
- sourceSvgId: r.sourceSvgId,
1032
- change: y,
1033
- existingShapeId: m.id,
1034
- existingKind: m.kind,
1035
- newKind: r.kind,
1036
- preserve: { key: m.key, assignment: !0, anchors: !0 },
1037
- geometryLocked: m.geometryLocked
1360
+ a.push({
1361
+ sourceSvgId: i.sourceSvgId,
1362
+ change: p,
1363
+ existingShapeId: y.id,
1364
+ existingKind: y.kind,
1365
+ newKind: i.kind,
1366
+ preserve: { key: y.key, assignment: !0, anchors: !0 },
1367
+ geometryLocked: y.geometryLocked
1038
1368
  });
1039
1369
  }
1040
1370
  }
1041
- for (const r of e)
1042
- r.sourceSvgId && !u.has(r.sourceSvgId) && c.push({
1043
- sourceSvgId: r.sourceSvgId,
1371
+ for (const i of e)
1372
+ i.sourceSvgId && !u.has(i.sourceSvgId) && a.push({
1373
+ sourceSvgId: i.sourceSvgId,
1044
1374
  change: "removed",
1045
- existingShapeId: r.id,
1046
- existingKind: r.kind,
1047
- geometryLocked: r.geometryLocked
1375
+ existingShapeId: i.id,
1376
+ existingKind: i.kind,
1377
+ geometryLocked: i.geometryLocked
1048
1378
  });
1049
1379
  return {
1050
- items: c,
1380
+ items: a,
1051
1381
  shapes: t,
1052
1382
  viewbox: n
1053
1383
  };
1054
1384
  }
1055
- const O = 1e-6, Ie = 15 * Math.PI / 180, Me = 1e-3, K = Math.PI * 2;
1056
- function yt(t, e) {
1057
- return Math.abs(t.x - e.x) < O && Math.abs(t.y - e.y) < O;
1385
+ const E = 1e-6, fn = 15 * Math.PI / 180, dn = 1e-3, j = Math.PI * 2;
1386
+ function St(t, e) {
1387
+ return Math.abs(t.x - e.x) < E && Math.abs(t.y - e.y) < E;
1058
1388
  }
1059
- function Q(t, e) {
1389
+ function at(t, e) {
1060
1390
  return { x: t.x + e.x, y: t.y + e.y };
1061
1391
  }
1062
- function pt(t, e) {
1392
+ function Lt(t, e) {
1063
1393
  return { x: t.x - e.x, y: t.y - e.y };
1064
1394
  }
1065
- function U(t, e) {
1395
+ function q(t, e) {
1066
1396
  return { x: t.x * e, y: t.y * e };
1067
1397
  }
1068
- function J(t, e, n) {
1398
+ function lt(t, e, n) {
1069
1399
  return {
1070
1400
  x: t.x + Math.cos(n) * e,
1071
1401
  y: t.y + Math.sin(n) * e
1072
1402
  };
1073
1403
  }
1074
- function ve(t) {
1404
+ function hn(t) {
1075
1405
  const e = [];
1076
1406
  for (const n of t) {
1077
- const s = e[e.length - 1];
1078
- s && yt(s, n) || e.push(n);
1407
+ const o = e[e.length - 1];
1408
+ o && St(o, n) || e.push(n);
1079
1409
  }
1080
- return e.length >= 2 && yt(e[0], e[e.length - 1]) && e.pop(), e;
1081
- }
1082
- function ze(t, e) {
1083
- const n = It(e), s = ve(t);
1084
- if (s.length < 3 || n <= 0) return t;
1085
- const o = s.length, i = new Array(o), u = new Array(o), c = new Array(o), r = new Array(o), m = new Array(o).fill(0), y = new Array(o).fill(0), l = new Array(o).fill(!1);
1086
- for (let a = 0; a < o; a++) {
1087
- const d = s[(a - 1 + o) % o], f = s[a], h = s[(a + 1) % o], p = P(d, f), b = P(f, h);
1088
- if (c[a] = b, p < O || b < O) {
1089
- i[a] = { x: 1, y: 0 }, u[a] = { x: 1, y: 0 }, r[a] = 0;
1410
+ return e.length >= 2 && St(e[0], e[e.length - 1]) && e.pop(), e;
1411
+ }
1412
+ function ho(t, e) {
1413
+ const n = wt(e), o = hn(t);
1414
+ if (o.length < 3 || n <= 0) return t;
1415
+ const r = o.length, s = new Array(r), u = new Array(r), a = new Array(r), i = new Array(r), y = new Array(r).fill(0), p = new Array(r).fill(0), l = new Array(r).fill(!1);
1416
+ for (let c = 0; c < r; c++) {
1417
+ const d = o[(c - 1 + r) % r], f = o[c], h = o[(c + 1) % r], m = w(d, f), b = w(f, h);
1418
+ if (a[c] = b, m < E || b < E) {
1419
+ s[c] = { x: 1, y: 0 }, u[c] = { x: 1, y: 0 }, i[c] = 0;
1090
1420
  continue;
1091
1421
  }
1092
- i[a] = U(pt(f, d), 1 / p), u[a] = U(pt(h, f), 1 / b);
1093
- const x = i[a].x * u[a].y - i[a].y * u[a].x, g = i[a].x * u[a].x + i[a].y * u[a].y;
1094
- r[a] = Math.atan2(x, g);
1095
- const I = Math.abs(r[a]);
1096
- if (I < Ie) continue;
1097
- const v = Math.PI - I, M = Math.tan(v / 2);
1098
- if (M < O || v <= O || v >= Math.PI - O) continue;
1099
- const S = n / M;
1100
- m[a] = S, y[a] = S, l[a] = !0;
1422
+ s[c] = q(Lt(f, d), 1 / m), u[c] = q(Lt(h, f), 1 / b);
1423
+ const x = s[c].x * u[c].y - s[c].y * u[c].x, g = s[c].x * u[c].x + s[c].y * u[c].y;
1424
+ i[c] = Math.atan2(x, g);
1425
+ const I = Math.abs(i[c]);
1426
+ if (I < fn) continue;
1427
+ const C = Math.PI - I, _ = Math.tan(C / 2);
1428
+ if (_ < E || C <= E || C >= Math.PI - E) continue;
1429
+ const A = n / _;
1430
+ y[c] = A, p[c] = A, l[c] = !0;
1101
1431
  }
1102
- for (let a = 0; a < o; a++) {
1103
- const d = (a + 1) % o, f = y[a] + m[d], h = Math.max(0, c[a] - Me);
1104
- if (f <= h || f <= O) continue;
1105
- const p = h / f;
1106
- y[a] *= p, m[d] *= p;
1432
+ for (let c = 0; c < r; c++) {
1433
+ const d = (c + 1) % r, f = p[c] + y[d], h = Math.max(0, a[c] - dn);
1434
+ if (f <= h || f <= E) continue;
1435
+ const m = h / f;
1436
+ p[c] *= m, y[d] *= m;
1107
1437
  }
1108
1438
  const k = [];
1109
- for (let a = 0; a < o; a++) {
1110
- const d = s[a], f = Math.min(m[a], y[a]), h = Math.abs(r[a]), p = Math.PI - h, b = f * Math.tan(p / 2);
1111
- if (!l[a] || b < O || f < O) {
1439
+ for (let c = 0; c < r; c++) {
1440
+ const d = o[c], f = Math.min(y[c], p[c]), h = Math.abs(i[c]), m = Math.PI - h, b = f * Math.tan(m / 2);
1441
+ if (!l[c] || b < E || f < E) {
1112
1442
  k.push({ ...d });
1113
1443
  continue;
1114
1444
  }
1115
- const x = Q(d, U(i[a], -f)), g = Q(d, U(u[a], f)), I = r[a] > 0 ? 1 : -1, v = Q(x, {
1116
- x: -i[a].y * I * b,
1117
- y: i[a].x * I * b
1118
- }), M = Math.atan2(x.y - v.y, x.x - v.x), S = Math.atan2(g.y - v.y, g.x - v.x), L = (S - M + K) % K, C = (M - S + K) % K, T = J(v, b, M + L / 2), R = J(v, b, M - C / 2), D = P(T, d) <= P(R, d), $ = D ? L : C, w = Math.max(8, Math.min(28, Math.ceil($ * b / 2)));
1119
- for (let A = 0; A <= w; A++) {
1120
- const F = A / w, N = D ? M + $ * F : M - $ * F;
1121
- k.push(J(v, b, N));
1445
+ const x = at(d, q(s[c], -f)), g = at(d, q(u[c], f)), I = i[c] > 0 ? 1 : -1, C = at(x, {
1446
+ x: -s[c].y * I * b,
1447
+ y: s[c].x * I * b
1448
+ }), _ = Math.atan2(x.y - C.y, x.x - C.x), A = Math.atan2(g.y - C.y, g.x - C.x), M = (A - _ + j) % j, L = (_ - A + j) % j, P = lt(C, b, _ + M / 2), R = lt(C, b, _ - L / 2), F = w(P, d) <= w(R, d), G = F ? M : L, S = Math.max(8, Math.min(28, Math.ceil(G * b / 2)));
1449
+ for (let O = 0; O <= S; O++) {
1450
+ const Y = O / S, v = F ? _ + G * Y : _ - G * Y;
1451
+ k.push(lt(C, b, v));
1122
1452
  }
1123
1453
  }
1124
1454
  return k;
1125
1455
  }
1126
- function Se(t, e, n = []) {
1127
- const s = Ot(), o = new Map(t.map((r) => [r.id, r])), i = new Map(n.map((r) => [r.id, r])), u = t.map((r) => ({
1128
- id: r.id,
1129
- levelId: r.levelId,
1130
- x: r.x,
1131
- y: r.y,
1132
- kind: r.kind,
1133
- shapeId: r.shapeId,
1134
- connectorId: r.connectorId
1456
+ function yn(t, e, n = []) {
1457
+ const o = Ut(), r = new Map(t.map((i) => [i.id, i])), s = new Map(n.map((i) => [i.id, i])), u = t.map((i) => ({
1458
+ id: i.id,
1459
+ levelId: i.levelId,
1460
+ x: i.x,
1461
+ y: i.y,
1462
+ kind: i.kind,
1463
+ shapeId: i.shapeId,
1464
+ connectorId: i.connectorId
1135
1465
  }));
1136
- for (const r of u)
1137
- s.addNode(r.id, r);
1138
- const c = [];
1139
- for (const r of e) {
1140
- const m = o.get(r.fromAnchorId), y = o.get(r.toAnchorId);
1141
- if (!m || !y) continue;
1142
- let l = r.weight;
1143
- l == null && (l = P(m, y), m.levelId !== y.levelId && (l += tt));
1144
- let k = r.accessible;
1145
- if (r.kind === "connector" && m.connectorId != null) {
1146
- const d = i.get(m.connectorId);
1466
+ for (const i of u)
1467
+ o.addNode(i.id, i);
1468
+ const a = [];
1469
+ for (const i of e) {
1470
+ const y = r.get(i.fromAnchorId), p = r.get(i.toAnchorId);
1471
+ if (!y || !p) continue;
1472
+ let l = i.weight;
1473
+ l == null && (l = w(y, p), y.levelId !== p.levelId && (l += ut));
1474
+ let k = i.accessible;
1475
+ if (i.kind === "connector" && y.connectorId != null) {
1476
+ const d = s.get(y.connectorId);
1147
1477
  d && (k = d.accessible);
1148
1478
  }
1149
- const a = {
1150
- id: r.id,
1151
- from: r.fromAnchorId,
1152
- to: r.toAnchorId,
1479
+ const c = {
1480
+ id: i.id,
1481
+ from: i.fromAnchorId,
1482
+ to: i.toAnchorId,
1153
1483
  weight: l,
1154
- directed: r.directed,
1484
+ directed: i.directed,
1155
1485
  accessible: k,
1156
- kind: r.kind
1486
+ kind: i.kind
1157
1487
  };
1158
- c.push(a), s.addLink(r.fromAnchorId, r.toAnchorId, a), r.directed || s.addLink(r.toAnchorId, r.fromAnchorId, a);
1488
+ a.push(c), o.addLink(i.fromAnchorId, i.toAnchorId, c), i.directed || o.addLink(i.toAnchorId, i.fromAnchorId, c);
1159
1489
  }
1160
- return { graph: s, nodes: u, edges: c, anchorById: o };
1490
+ return { graph: o, nodes: u, edges: a, anchorById: r };
1161
1491
  }
1162
- function we(t, e, n, s = {}) {
1163
- const { graph: o, anchorById: i } = t;
1164
- if (!i.has(e) || !i.has(n))
1492
+ function xn(t, e, n, o = {}) {
1493
+ const { graph: r, anchorById: s } = t;
1494
+ if (!s.has(e) || !s.has(n))
1165
1495
  return null;
1166
- const c = Rt.nba(o, {
1496
+ const a = Ht.nba(r, {
1167
1497
  oriented: !0,
1168
- distance(a, d, f) {
1498
+ distance(c, d, f) {
1169
1499
  const h = f.data;
1170
- return s.accessibleOnly && h && !h.accessible ? Number.POSITIVE_INFINITY : (h == null ? void 0 : h.weight) ?? 1;
1500
+ return o.accessibleOnly && h && !h.accessible ? Number.POSITIVE_INFINITY : (h == null ? void 0 : h.weight) ?? 1;
1171
1501
  },
1172
- heuristic(a, d) {
1173
- const f = i.get(a.id), h = i.get(d.id);
1502
+ heuristic(c, d) {
1503
+ const f = s.get(c.id), h = s.get(d.id);
1174
1504
  if (!f || !h) return 0;
1175
- let p = P(f, h);
1176
- return f.levelId !== h.levelId && (p += tt), p;
1505
+ let m = w(f, h);
1506
+ return f.levelId !== h.levelId && (m += ut), m;
1177
1507
  }
1178
1508
  }).find(e, n);
1179
- if (!c || c.length === 0) return null;
1180
- const m = c.reverse().map((a) => a.id), y = [], l = [];
1509
+ if (!a || a.length === 0) return null;
1510
+ const y = a.reverse().map((c) => c.id), p = [], l = [];
1181
1511
  let k = 0;
1182
- for (let a = 0; a < m.length; a++) {
1183
- const d = i.get(m[a]);
1184
- if (y.push({ x: d.x, y: d.y, levelId: d.levelId }), a > 0) {
1185
- const f = i.get(m[a - 1]);
1186
- k += P(f, d), f.levelId !== d.levelId && (k += tt, l.push({
1512
+ for (let c = 0; c < y.length; c++) {
1513
+ const d = s.get(y[c]);
1514
+ if (p.push({ x: d.x, y: d.y, levelId: d.levelId }), c > 0) {
1515
+ const f = s.get(y[c - 1]);
1516
+ k += w(f, d), f.levelId !== d.levelId && (k += ut, l.push({
1187
1517
  fromLevelId: f.levelId,
1188
1518
  toLevelId: d.levelId,
1189
1519
  connectorId: d.connectorId ?? f.connectorId
1190
1520
  }));
1191
1521
  }
1192
1522
  }
1193
- return { anchorIds: m, points: y, totalWeight: k, levelChanges: l };
1523
+ return { anchorIds: y, points: p, totalWeight: k, levelChanges: l };
1194
1524
  }
1195
- function He(t, e, n, s = {}) {
1196
- let o = null;
1197
- for (const i of n) {
1198
- const u = we(t, e, i, s);
1199
- u && (!o || u.totalWeight < o.totalWeight) && (o = u);
1525
+ function yo(t, e, n, o = {}) {
1526
+ let r = null;
1527
+ for (const s of n) {
1528
+ const u = xn(t, e, s, o);
1529
+ u && (!r || u.totalWeight < r.totalWeight) && (r = u);
1200
1530
  }
1201
- return o;
1202
- }
1203
- function Ke(t) {
1204
- const e = Pt(t.theme), n = new Map(
1205
- t.assignments.map((c) => [c.shapeId, c])
1206
- ), s = t.resolveSvgUrl ?? ((c) => c), o = t.levels.filter((c) => c.isActive).sort((c, r) => c.ordering - r.ordering).map((c) => {
1207
- const r = t.shapes.filter((y) => y.levelId === c.id).map((y) => {
1208
- const l = St(y.geometry);
1531
+ return r;
1532
+ }
1533
+ function xo(t) {
1534
+ const e = ae(t.theme), n = new Map(
1535
+ t.assignments.map((i) => [i.shapeId, i])
1536
+ ), o = new Map(
1537
+ (t.retailers ?? []).map((i) => [i.id, i])
1538
+ ), r = t.resolveSvgUrl ?? ((i) => i), s = t.levels.filter((i) => i.isActive).sort((i, y) => i.ordering - y.ordering).map((i) => {
1539
+ const y = t.shapes.filter((l) => l.levelId === i.id).map((l) => {
1540
+ const k = Xt(l.geometry), c = n.get(l.id) ?? null, d = (c == null ? void 0 : c.retailerId) != null ? o.get(c.retailerId) ?? null : null;
1209
1541
  return {
1210
- ...y,
1211
- geometry: l,
1212
- bbox: l === y.geometry ? y.bbox : it(l),
1213
- assignment: n.get(y.id) ?? null
1542
+ ...l,
1543
+ geometry: k,
1544
+ bbox: k === l.geometry ? l.bbox : xt(k),
1545
+ assignment: c,
1546
+ label: Ft(l, c, d)
1214
1547
  };
1215
- }), m = t.anchors.filter((y) => y.levelId === c.id);
1548
+ }), p = t.anchors.filter((l) => l.levelId === i.id);
1216
1549
  return {
1217
- id: c.id,
1218
- buildingId: c.buildingId,
1219
- kind: c.kind,
1220
- name: c.name,
1221
- levelIndex: c.levelIndex,
1222
- ordering: c.ordering,
1223
- sourceSvgUrl: s(c.sourceSvgKey) ?? c.sourceSvgUrl ?? null,
1224
- viewbox: c.sourceViewbox,
1225
- transform: c.transform,
1226
- shapes: r,
1227
- anchors: m
1550
+ id: i.id,
1551
+ buildingId: i.buildingId,
1552
+ kind: i.kind,
1553
+ name: i.name,
1554
+ levelIndex: i.levelIndex,
1555
+ ordering: i.ordering,
1556
+ sourceSvgUrl: r(i.sourceSvgKey) ?? i.sourceSvgUrl ?? null,
1557
+ viewbox: i.sourceViewbox,
1558
+ transform: i.transform,
1559
+ shapes: y,
1560
+ anchors: p
1228
1561
  };
1229
- }), { nodes: i, edges: u } = Se(
1562
+ }), { nodes: u, edges: a } = yn(
1230
1563
  t.anchors,
1231
1564
  t.edges,
1232
1565
  t.connectors
@@ -1241,54 +1574,138 @@ function Ke(t) {
1241
1574
  baseSvgUrl: t.baseSvgUrl,
1242
1575
  baseViewbox: t.baseViewbox,
1243
1576
  buildings: t.buildings,
1244
- levels: o,
1577
+ levels: s,
1245
1578
  connectors: t.connectors,
1246
- amenities: t.amenities.filter((c) => c.isActive),
1247
- graph: { nodes: i, edges: u },
1579
+ amenities: t.amenities.filter((i) => i.isActive),
1580
+ graph: { nodes: u, edges: a },
1248
1581
  responsiveOverrides: t.responsiveOverrides,
1249
1582
  publishedAt: t.publishedAt ?? (/* @__PURE__ */ new Date()).toISOString()
1250
1583
  };
1251
1584
  }
1252
- function Ue(t) {
1585
+ function po(t) {
1253
1586
  let e = !1;
1254
- const n = t.levels.map((s) => {
1255
- let o = !1;
1256
- const i = s.shapes.map((u) => {
1257
- const c = St(u.geometry);
1258
- return c === u.geometry ? u : (o = !0, {
1587
+ const n = t.levels.map((o) => {
1588
+ let r = !1;
1589
+ const s = o.shapes.map((u) => {
1590
+ const a = Xt(u.geometry), i = Ft(u, u.assignment), y = a !== u.geometry, p = i !== u.label;
1591
+ return !y && !p ? u : (r = !0, {
1259
1592
  ...u,
1260
- geometry: c,
1261
- bbox: it(c)
1593
+ geometry: a,
1594
+ bbox: y ? xt(a) : u.bbox,
1595
+ label: i
1262
1596
  });
1263
1597
  });
1264
- return o ? (e = !0, { ...s, shapes: i }) : s;
1598
+ return r ? (e = !0, { ...o, shapes: s }) : o;
1265
1599
  });
1266
1600
  return e ? { ...t, levels: n } : t;
1267
1601
  }
1268
- function Ce(t, e) {
1602
+ const pn = [
1603
+ "floorplate",
1604
+ "walkable",
1605
+ "decor",
1606
+ "zone",
1607
+ "green_area",
1608
+ "water",
1609
+ "parking_zone"
1610
+ ];
1611
+ function mn(t) {
1612
+ return t === "void";
1613
+ }
1614
+ function mo(t) {
1615
+ return pn.includes(t);
1616
+ }
1617
+ function Wt(t) {
1618
+ return mn(t.kind) && !t.orphanedAt;
1619
+ }
1620
+ function gn(t) {
1621
+ return (t.shapes ?? []).some(Wt);
1622
+ }
1623
+ function go(t) {
1624
+ var n;
1625
+ const e = [];
1626
+ for (const o of t.shapes ?? [])
1627
+ if (Wt(o))
1628
+ for (const r of ((n = o.geometry) == null ? void 0 : n.polygons) ?? [])
1629
+ r.length >= 3 && e.push(r);
1630
+ return e;
1631
+ }
1632
+ function Ot(t) {
1633
+ let e = 0;
1634
+ for (let n = 0, o = t.length - 1; n < t.length; o = n++)
1635
+ e += t[o].x * t[n].y - t[n].x * t[o].y;
1636
+ return e / 2;
1637
+ }
1638
+ function bn(t) {
1639
+ return t.slice().reverse();
1640
+ }
1641
+ function kn(t, e) {
1642
+ const n = Ot(t), o = Ot(e);
1643
+ return n === 0 || o === 0 ? e : Math.sign(n) === Math.sign(o) ? bn(e) : e;
1644
+ }
1645
+ function Mt(t) {
1646
+ let e = 1 / 0, n = 1 / 0, o = -1 / 0, r = -1 / 0;
1647
+ for (const s of t)
1648
+ s.x < e && (e = s.x), s.y < n && (n = s.y), s.x > o && (o = s.x), s.y > r && (r = s.y);
1649
+ return { minX: e, minY: n, maxX: o, maxY: r };
1650
+ }
1651
+ function In(t, e) {
1652
+ const n = Mt(t), o = Mt(e);
1653
+ return n.minX <= o.maxX && n.maxX >= o.minX && n.minY <= o.maxY && n.maxY >= o.minY;
1654
+ }
1655
+ function bo(t, e) {
1656
+ return e.filter((n) => n.length >= 3 && In(t, n)).map((n) => kn(t, n));
1657
+ }
1658
+ const ko = "#e8eef4", Io = "#64748b", _o = "#475569";
1659
+ function _n(t, e) {
1269
1660
  return t.ordering - e.ordering || t.levelIndex - e.levelIndex;
1270
1661
  }
1271
- function gt(t) {
1662
+ function Q(t) {
1272
1663
  return t.kind === "outdoor";
1273
1664
  }
1274
- function Ae(t, e) {
1275
- const n = t.filter(gt), s = e == null ? null : t.find((o) => o.id === e) ?? null;
1276
- return !s || gt(s) || n.some((o) => o.id === s.id) ? n : [...n, s];
1665
+ function Cn(t, e) {
1666
+ const n = t.filter(Q), o = e == null ? null : t.find((r) => r.id === e) ?? null;
1667
+ return !o || Q(o) || n.some((r) => r.id === o.id) ? n : [...n, o];
1668
+ }
1669
+ function An(t, e) {
1670
+ if (e == null) return [];
1671
+ const n = et(t), o = n.findIndex((u) => u.id === e);
1672
+ if (o < 0) return [];
1673
+ const r = [];
1674
+ let s = n[o];
1675
+ for (let u = o; u < n.length - 1 && gn(s); u++) {
1676
+ const a = n[u + 1];
1677
+ if (!a) break;
1678
+ r.unshift(a), s = a;
1679
+ }
1680
+ return r;
1277
1681
  }
1278
- function ct(t) {
1279
- return t.filter((e) => e.kind === "floor").slice().sort(Ce);
1682
+ function Co(t, e) {
1683
+ return An(t, e).at(-1) ?? null;
1684
+ }
1685
+ function Ao(t, e, n) {
1686
+ const o = t.find((s) => s.id === n);
1687
+ if (!o || !Q(o)) return n;
1688
+ const r = e == null ? null : t.find((s) => s.id === e) ?? null;
1689
+ return r && !Q(r) ? r.id : Sn(t) ?? n;
1690
+ }
1691
+ function et(t) {
1692
+ return t.filter((e) => e.kind === "floor").slice().sort(_n);
1280
1693
  }
1281
- function Ve(t) {
1282
- return ct(t);
1694
+ function So(t) {
1695
+ return et(t);
1283
1696
  }
1284
- function je(t) {
1285
- return ct(t).length > 1;
1697
+ function Lo(t) {
1698
+ return et(t).length > 1;
1286
1699
  }
1287
- function Ze(t) {
1700
+ function Oo(t) {
1701
+ return t.some((e) => e.kind === "floor");
1702
+ }
1703
+ const Mo = "This map doesn’t have any floors yet.";
1704
+ function Sn(t) {
1288
1705
  var e, n;
1289
- return ((e = ct(t).at(-1)) == null ? void 0 : e.id) ?? ((n = t[0]) == null ? void 0 : n.id) ?? null;
1706
+ return ((e = et(t).at(-1)) == null ? void 0 : e.id) ?? ((n = t[0]) == null ? void 0 : n.id) ?? null;
1290
1707
  }
1291
- function bt(t) {
1708
+ function Et(t) {
1292
1709
  return {
1293
1710
  minX: t.x,
1294
1711
  minY: t.y,
@@ -1299,128 +1716,228 @@ function bt(t) {
1299
1716
  size: Math.max(t.width, t.height, 100)
1300
1717
  };
1301
1718
  }
1302
- function kt(t, e) {
1303
- const n = Math.min(t.minX, e.minX), s = Math.min(t.minY, e.minY), o = Math.max(t.maxX, e.maxX), i = Math.max(t.maxY, e.maxY);
1719
+ function Ln(t, e) {
1720
+ const n = e.scale || 1, o = (e.rotate || 0) * Math.PI / 180, r = Math.cos(o), s = Math.sin(o), u = t.x * n, a = t.y * n;
1721
+ return {
1722
+ x: u * r - a * s + (e.translateX || 0),
1723
+ y: u * s + a * r + (e.translateY || 0)
1724
+ };
1725
+ }
1726
+ function On(t, e) {
1727
+ const n = [
1728
+ { x: t.minX, y: t.minY },
1729
+ { x: t.maxX, y: t.minY },
1730
+ { x: t.minX, y: t.maxY },
1731
+ { x: t.maxX, y: t.maxY }
1732
+ ].map((a) => e ? Ln(a, e) : a), o = Math.min(
1733
+ n[0].x,
1734
+ n[1].x,
1735
+ n[2].x,
1736
+ n[3].x
1737
+ ), r = Math.min(
1738
+ n[0].y,
1739
+ n[1].y,
1740
+ n[2].y,
1741
+ n[3].y
1742
+ ), s = Math.max(
1743
+ n[0].x,
1744
+ n[1].x,
1745
+ n[2].x,
1746
+ n[3].x
1747
+ ), u = Math.max(
1748
+ n[0].y,
1749
+ n[1].y,
1750
+ n[2].y,
1751
+ n[3].y
1752
+ );
1753
+ return {
1754
+ minX: o,
1755
+ minY: r,
1756
+ maxX: s,
1757
+ maxY: u,
1758
+ cx: (o + s) / 2,
1759
+ cy: (r + u) / 2,
1760
+ size: Math.max(s - o, u - r, 100)
1761
+ };
1762
+ }
1763
+ function Rt(t, e) {
1764
+ const n = Math.min(t.minX, e.minX), o = Math.min(t.minY, e.minY), r = Math.max(t.maxX, e.maxX), s = Math.max(t.maxY, e.maxY);
1304
1765
  return {
1305
1766
  minX: n,
1306
- minY: s,
1307
- maxX: o,
1308
- maxY: i,
1309
- cx: (n + o) / 2,
1310
- cy: (s + i) / 2,
1311
- size: Math.max(o - n, i - s, 100)
1767
+ minY: o,
1768
+ maxX: r,
1769
+ maxY: s,
1770
+ cx: (n + r) / 2,
1771
+ cy: (o + s) / 2,
1772
+ size: Math.max(r - n, s - o, 100)
1312
1773
  };
1313
1774
  }
1314
- function qe(t, e, n) {
1315
- let s = n ? bt(n) : null;
1316
- for (const o of Ae(t, e)) {
1317
- if (o.viewbox) {
1318
- const i = bt(o.viewbox);
1319
- s = s ? kt(s, i) : i;
1775
+ function Eo(t, e, n) {
1776
+ let o = n ? Et(n) : null;
1777
+ for (const r of Cn(t, e)) {
1778
+ if (r.viewbox) {
1779
+ const s = Et(r.viewbox);
1780
+ o = o ? Rt(o, s) : s;
1320
1781
  }
1321
- for (const i of o.shapes) {
1322
- const u = {
1323
- minX: i.bbox.minX,
1324
- minY: i.bbox.minY,
1325
- maxX: i.bbox.maxX,
1326
- maxY: i.bbox.maxY,
1327
- cx: (i.bbox.minX + i.bbox.maxX) / 2,
1328
- cy: (i.bbox.minY + i.bbox.maxY) / 2,
1329
- size: Math.max(
1330
- i.bbox.maxX - i.bbox.minX,
1331
- i.bbox.maxY - i.bbox.minY,
1332
- 100
1333
- )
1334
- };
1335
- s = s ? kt(s, u) : u;
1782
+ for (const s of r.shapes) {
1783
+ const u = On(s.bbox);
1784
+ o = o ? Rt(o, u) : u;
1336
1785
  }
1337
1786
  }
1338
- return s ?? { minX: 0, minY: 0, maxX: 500, maxY: 500, cx: 250, cy: 250, size: 500 };
1787
+ return o ?? { minX: 0, minY: 0, maxX: 500, maxY: 500, cx: 250, cy: 250, size: 500 };
1339
1788
  }
1340
- function Qe(t, e) {
1789
+ function Ro(t, e) {
1341
1790
  if (!t && !e) return { x: 0, y: 0, width: 1e3, height: 800 };
1342
1791
  if (!t) return e;
1343
1792
  if (!e) return t;
1344
- const n = Math.min(t.x, e.x), s = Math.min(t.y, e.y), o = Math.max(t.x + t.width, e.x + e.width), i = Math.max(t.y + t.height, e.y + e.height);
1345
- return { x: n, y: s, width: o - n, height: i - s };
1793
+ const n = Math.min(t.x, e.x), o = Math.min(t.y, e.y), r = Math.max(t.x + t.width, e.x + e.width), s = Math.max(t.y + t.height, e.y + e.height);
1794
+ return { x: n, y: o, width: r - n, height: s - o };
1346
1795
  }
1347
1796
  export {
1348
- St as $,
1349
- De as A,
1350
- Ve as B,
1351
- ct as C,
1352
- lt as D,
1353
- it as E,
1354
- tt as F,
1355
- Vt as G,
1356
- Xe as H,
1357
- et as I,
1358
- te as J,
1359
- Kt as K,
1360
- ne as L,
1361
- Ct as M,
1362
- Lt as N,
1363
- Pe as O,
1364
- rt as P,
1365
- gt as Q,
1366
- wt as R,
1367
- X as S,
1368
- nt as T,
1369
- At as U,
1370
- _e as V,
1371
- st as W,
1372
- j as X,
1373
- Pt as Y,
1374
- G as Z,
1375
- $e as _,
1376
- Ne as a,
1377
- V as a0,
1378
- at as a1,
1379
- Ue as a2,
1380
- pe as a3,
1381
- xt as a4,
1382
- jt as a5,
1383
- vt as a6,
1384
- Bt as a7,
1385
- Ye as a8,
1386
- Wt as a9,
1387
- dt as aa,
1388
- Te as ab,
1389
- ot as ac,
1390
- je as ad,
1391
- Be as ae,
1392
- Re as af,
1393
- Mt as ag,
1394
- re as ah,
1395
- Qe as ai,
1396
- ve as aj,
1397
- bt as ak,
1398
- Ee as al,
1399
- Ae as am,
1400
- ue as b,
1401
- le as c,
1402
- Tt as d,
1403
- We as e,
1404
- ee as f,
1405
- Gt as g,
1406
- ut as h,
1407
- ft as i,
1408
- Yt as j,
1409
- Fe as k,
1410
- qe as l,
1411
- Ut as m,
1412
- $t as n,
1413
- It as o,
1414
- fe as p,
1415
- Ce as q,
1416
- Ke as r,
1417
- Se as s,
1418
- Ze as t,
1419
- Ge as u,
1420
- P as v,
1421
- kt as w,
1422
- ze as x,
1423
- He as y,
1424
- we as z
1797
+ xo as $,
1798
+ xe as A,
1799
+ qn as B,
1800
+ he as C,
1801
+ J as D,
1802
+ ue as E,
1803
+ ut as F,
1804
+ Zn as G,
1805
+ gt as H,
1806
+ ft as I,
1807
+ Oe as J,
1808
+ io as K,
1809
+ Pn as L,
1810
+ Mo as M,
1811
+ Eo as N,
1812
+ ko as O,
1813
+ Fe as P,
1814
+ Qn as Q,
1815
+ ye as R,
1816
+ pn as S,
1817
+ Vt as T,
1818
+ Me as U,
1819
+ wn as V,
1820
+ vt as W,
1821
+ wt as X,
1822
+ tn as Y,
1823
+ Bn as Z,
1824
+ _n as _,
1825
+ Nn as a,
1826
+ Ot as a$,
1827
+ yn as a0,
1828
+ jn as a1,
1829
+ Pt as a2,
1830
+ Xn as a3,
1831
+ Sn as a4,
1832
+ fo as a5,
1833
+ w as a6,
1834
+ Gn as a7,
1835
+ Rt as a8,
1836
+ ho as a9,
1837
+ ht as aA,
1838
+ mn as aB,
1839
+ Vn as aC,
1840
+ Yn as aD,
1841
+ Dn as aE,
1842
+ gn as aF,
1843
+ to as aG,
1844
+ it as aH,
1845
+ ae as aI,
1846
+ H as aJ,
1847
+ co as aK,
1848
+ Co as aL,
1849
+ Xt as aM,
1850
+ Fn as aN,
1851
+ tt as aO,
1852
+ Tt as aP,
1853
+ po as aQ,
1854
+ Rn as aR,
1855
+ Un as aS,
1856
+ Kn as aT,
1857
+ cn as aU,
1858
+ Ct as aV,
1859
+ De as aW,
1860
+ Bt as aX,
1861
+ Ee as aY,
1862
+ so as aZ,
1863
+ Mt as a_,
1864
+ yo as aa,
1865
+ xn as ab,
1866
+ ro as ac,
1867
+ So as ad,
1868
+ et as ae,
1869
+ xt as af,
1870
+ Ye as ag,
1871
+ Oo as ah,
1872
+ kn as ai,
1873
+ bo as aj,
1874
+ uo as ak,
1875
+ $e as al,
1876
+ Wt as am,
1877
+ ke as an,
1878
+ Tn as ao,
1879
+ Pe as ap,
1880
+ We as aq,
1881
+ Kt as ar,
1882
+ zt as as,
1883
+ no as at,
1884
+ pt as au,
1885
+ Q as av,
1886
+ Gt as aw,
1887
+ dt as ax,
1888
+ mo as ay,
1889
+ $t as az,
1890
+ de as b,
1891
+ In as b0,
1892
+ Re as b1,
1893
+ Ft as b2,
1894
+ It as b3,
1895
+ oo as b4,
1896
+ yt as b5,
1897
+ Jt as b6,
1898
+ zn as b7,
1899
+ Wn as b8,
1900
+ $n as b9,
1901
+ An as ba,
1902
+ bn as bb,
1903
+ On as bc,
1904
+ Lo as bd,
1905
+ ao as be,
1906
+ z as bf,
1907
+ qt as bg,
1908
+ ee as bh,
1909
+ Dt as bi,
1910
+ Ze as bj,
1911
+ Ro as bk,
1912
+ hn as bl,
1913
+ Et as bm,
1914
+ eo as bn,
1915
+ Ao as bo,
1916
+ Cn as bp,
1917
+ go as bq,
1918
+ W as c,
1919
+ vn as d,
1920
+ Je as e,
1921
+ Qe as f,
1922
+ le as g,
1923
+ fe as h,
1924
+ _o as i,
1925
+ Io as j,
1926
+ Zt as k,
1927
+ Nt as l,
1928
+ jt as m,
1929
+ Hn as n,
1930
+ lo as o,
1931
+ Jn as p,
1932
+ Ln as q,
1933
+ ze as r,
1934
+ Ne as s,
1935
+ bt as t,
1936
+ kt as u,
1937
+ ge as v,
1938
+ Ce as w,
1939
+ X as x,
1940
+ Yt as y,
1941
+ Ae as z
1425
1942
  };
1426
1943
  //# sourceMappingURL=stacking.js.map