@eyeon/map 2.0.2 → 2.0.4

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