@eyeon/map 2.0.15 → 2.0.17

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 (95) hide show
  1. package/dist/assets/MapViewer.css +1 -1
  2. package/dist/assets/index.css +1 -1
  3. package/dist/chunks/MapViewer.js +2353 -2096
  4. package/dist/chunks/MapViewer.js.map +1 -1
  5. package/dist/chunks/responsive.js +2534 -0
  6. package/dist/chunks/responsive.js.map +1 -0
  7. package/dist/chunks/wheelZoom.js +162 -176
  8. package/dist/chunks/wheelZoom.js.map +1 -1
  9. package/dist/core/assignment.d.ts +19 -2
  10. package/dist/core/assignment.d.ts.map +1 -1
  11. package/dist/core/entranceIcon.d.ts +17 -3
  12. package/dist/core/entranceIcon.d.ts.map +1 -1
  13. package/dist/core/hostChrome.d.ts +13 -2
  14. package/dist/core/hostChrome.d.ts.map +1 -1
  15. package/dist/core/hoverTooltip.d.ts +37 -0
  16. package/dist/core/hoverTooltip.d.ts.map +1 -0
  17. package/dist/core/import/index.d.ts +10 -1
  18. package/dist/core/import/index.d.ts.map +1 -1
  19. package/dist/core/index.d.ts +3 -0
  20. package/dist/core/index.d.ts.map +1 -1
  21. package/dist/core/index.js +226 -185
  22. package/dist/core/layerStyles.d.ts +32 -0
  23. package/dist/core/layerStyles.d.ts.map +1 -1
  24. package/dist/core/outdoorDecoration.d.ts.map +1 -1
  25. package/dist/core/publicShapes.d.ts +14 -0
  26. package/dist/core/publicShapes.d.ts.map +1 -1
  27. package/dist/core/responsive.d.ts +6 -0
  28. package/dist/core/responsive.d.ts.map +1 -1
  29. package/dist/core/routing/graph-tools.d.ts +6 -5
  30. package/dist/core/routing/graph-tools.d.ts.map +1 -1
  31. package/dist/core/routing/pathfinding.d.ts +36 -0
  32. package/dist/core/routing/pathfinding.d.ts.map +1 -1
  33. package/dist/core/shapeFill.d.ts +40 -0
  34. package/dist/core/shapeFill.d.ts.map +1 -0
  35. package/dist/core/stacking.d.ts +4 -0
  36. package/dist/core/stacking.d.ts.map +1 -1
  37. package/dist/core/types.d.ts +14 -3
  38. package/dist/core/types.d.ts.map +1 -1
  39. package/dist/core/viewerReset.d.ts +24 -0
  40. package/dist/core/viewerReset.d.ts.map +1 -0
  41. package/dist/editor/MapEditor.d.ts.map +1 -1
  42. package/dist/editor/assignmentOverlay.d.ts +37 -0
  43. package/dist/editor/assignmentOverlay.d.ts.map +1 -0
  44. package/dist/editor/canvas/AssignedShapeOverlay.d.ts +8 -0
  45. package/dist/editor/canvas/AssignedShapeOverlay.d.ts.map +1 -0
  46. package/dist/editor/canvas/EditorCanvas.d.ts +6 -1
  47. package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
  48. package/dist/editor/canvas/coords.d.ts +9 -0
  49. package/dist/editor/canvas/coords.d.ts.map +1 -1
  50. package/dist/editor/canvas/editorFill.d.ts.map +1 -1
  51. package/dist/editor/draftOps.d.ts.map +1 -1
  52. package/dist/editor/entranceIcon.d.ts +2 -2
  53. package/dist/editor/entranceIcon.d.ts.map +1 -1
  54. package/dist/editor/index.css +259 -29
  55. package/dist/editor/index.js +4780 -4355
  56. package/dist/editor/index.js.map +1 -1
  57. package/dist/editor/panels/AssignForm.d.ts +3 -1
  58. package/dist/editor/panels/AssignForm.d.ts.map +1 -1
  59. package/dist/editor/panels/BulkAssignForm.d.ts +3 -1
  60. package/dist/editor/panels/BulkAssignForm.d.ts.map +1 -1
  61. package/dist/editor/panels/ConnectorAssign.d.ts.map +1 -1
  62. package/dist/editor/panels/FloorsPanel.d.ts.map +1 -1
  63. package/dist/editor/panels/Inspector.d.ts +3 -1
  64. package/dist/editor/panels/Inspector.d.ts.map +1 -1
  65. package/dist/editor/panels/LeftRail.d.ts.map +1 -1
  66. package/dist/editor/routeStubs.d.ts +11 -0
  67. package/dist/editor/routeStubs.d.ts.map +1 -1
  68. package/dist/test-maps/LF - Shops At South Town.ai +4468 -1
  69. package/dist/test-maps/LF - Shops At South Town.svg +245 -0
  70. package/dist/viewer/MapViewer.d.ts.map +1 -1
  71. package/dist/viewer/camera.d.ts +10 -0
  72. package/dist/viewer/camera.d.ts.map +1 -1
  73. package/dist/viewer/components/CameraRig.d.ts.map +1 -1
  74. package/dist/viewer/components/LevelMeshes.d.ts +10 -2
  75. package/dist/viewer/components/LevelMeshes.d.ts.map +1 -1
  76. package/dist/viewer/components/MapScene.d.ts +5 -2
  77. package/dist/viewer/components/MapScene.d.ts.map +1 -1
  78. package/dist/viewer/components/RouteLine.d.ts +1 -8
  79. package/dist/viewer/components/RouteLine.d.ts.map +1 -1
  80. package/dist/viewer/components/SvgVectorLayer.d.ts +1 -1
  81. package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -1
  82. package/dist/viewer/index.css +242 -29
  83. package/dist/viewer/index.js +1 -1
  84. package/dist/viewer/pointer.d.ts +40 -4
  85. package/dist/viewer/pointer.d.ts.map +1 -1
  86. package/dist/viewer/routeFloorChanges.d.ts +35 -0
  87. package/dist/viewer/routeFloorChanges.d.ts.map +1 -0
  88. package/dist/viewer/ui/HoverTooltip.d.ts +6 -0
  89. package/dist/viewer/ui/HoverTooltip.d.ts.map +1 -0
  90. package/dist/viewer/ui/MapControls.d.ts.map +1 -1
  91. package/dist/viewer/ui/RuntimeChrome.d.ts +2 -1
  92. package/dist/viewer/ui/RuntimeChrome.d.ts.map +1 -1
  93. package/package.json +1 -1
  94. package/dist/chunks/stacking.js +0 -2243
  95. package/dist/chunks/stacking.js.map +0 -1
@@ -0,0 +1,2534 @@
1
+ import fe from "ngraph.graph";
2
+ import de from "ngraph.path";
3
+ const It = "transparent";
4
+ function Z(t) {
5
+ const e = (t ?? "").trim().toLowerCase();
6
+ return e === It || e === "none";
7
+ }
8
+ const Vt = "#E9F7FC", he = [
9
+ "green-area",
10
+ "water-area",
11
+ "parking-lane",
12
+ "parking-icon",
13
+ "walking-path"
14
+ ], ye = {
15
+ "green-area": "GREEN_AREA_COLOR",
16
+ "water-area": "WATER_COLOR",
17
+ "parking-lane": "PARKING_LANE_COLOR",
18
+ "parking-icon": "PARKING_ICON_COLOR",
19
+ "walking-path": "WALKABLE_COLOR"
20
+ }, pe = 2, Ut = {
21
+ "green-area": {
22
+ fill: "#C4DDAB",
23
+ // Above parking lanes (and other house fills). Parking icons stay at 7.
24
+ renderOrder: 4,
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-icon": {
38
+ fill: "#CCCCCC",
39
+ renderOrder: 7,
40
+ extrudeHeight: 1
41
+ },
42
+ "walking-path": {
43
+ fill: Vt,
44
+ renderOrder: 2,
45
+ extrudeHeight: 1
46
+ }
47
+ };
48
+ function X(t) {
49
+ const e = Ut[t];
50
+ return e.fill ?? e.stroke ?? "";
51
+ }
52
+ function me() {
53
+ return {
54
+ GREEN_AREA_COLOR: X("green-area"),
55
+ WATER_COLOR: X("water-area"),
56
+ PARKING_LANE_COLOR: X("parking-lane"),
57
+ PARKING_ICON_COLOR: X("parking-icon"),
58
+ WALKABLE_COLOR: X("walking-path")
59
+ };
60
+ }
61
+ const ct = {
62
+ amenity: "#444444",
63
+ kiosk: "#444444",
64
+ connector: "#0763b1"
65
+ }, Rr = {
66
+ amenity: "AMENITY_ICON_COLOR",
67
+ kiosk: "KIOSK_ICON_COLOR",
68
+ connector: "CONNECTOR_ICON_COLOR"
69
+ };
70
+ function xe() {
71
+ return {
72
+ AMENITY_ICON_COLOR: ct.amenity,
73
+ KIOSK_ICON_COLOR: ct.kiosk,
74
+ CONNECTOR_ICON_COLOR: ct.connector
75
+ };
76
+ }
77
+ function Ht(t) {
78
+ return t.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
79
+ }
80
+ function be(t, e) {
81
+ const n = Ht(e);
82
+ return !!(t === n || t.startsWith(`${n} `) || t === `${n}s` || t.startsWith(`${n}s `));
83
+ }
84
+ function Ie(t) {
85
+ if (!t) return null;
86
+ const e = Ht(t);
87
+ if (!e) return null;
88
+ const n = [...he].sort((r, o) => o.length - r.length);
89
+ for (const r of n)
90
+ if (be(e, r)) return r;
91
+ return null;
92
+ }
93
+ function ge(t, e, n) {
94
+ const r = ye[e];
95
+ if (!r) return t;
96
+ const o = n == null ? void 0 : n[r];
97
+ return typeof o != "string" ? t : Z(o) ? t.fill ? { ...t, fill: "transparent" } : t.stroke ? { ...t, stroke: "transparent" } : t : o.trim() ? t.fill ? { ...t, fill: o } : t.stroke ? { ...t, stroke: o } : t : t;
98
+ }
99
+ function rt(t, e) {
100
+ const n = Ie(t);
101
+ return n ? ge(Ut[n], n, e) : null;
102
+ }
103
+ function Ct(t) {
104
+ var e;
105
+ return ((e = rt(t)) == null ? void 0 : e.renderOrder) ?? pe;
106
+ }
107
+ function Lr(t, e) {
108
+ return t.map((n, r) => ({ item: n, index: r })).sort((n, r) => {
109
+ const o = Ct(e(n.item)) - Ct(e(r.item));
110
+ return o !== 0 ? o : n.index - r.index;
111
+ }).map(({ item: n }) => n);
112
+ }
113
+ function ke(t, e) {
114
+ const n = (e == null ? void 0 : e.omitStaticLayers) === !0, r = /* @__PURE__ */ new Set();
115
+ for (const o of t) {
116
+ const i = o.sourceSvgId;
117
+ i && (n && rt(i) || r.add(i));
118
+ }
119
+ return r;
120
+ }
121
+ function vr(t) {
122
+ return ke(
123
+ t.flatMap((e) => [...e.shapes]),
124
+ { omitStaticLayers: !0 }
125
+ );
126
+ }
127
+ const Er = ["escalator", "elevator"];
128
+ function _e(t) {
129
+ return t === "escalator" || t === "elevator";
130
+ }
131
+ const W = {
132
+ MAP_STYLE: "2D",
133
+ MAP_BACKGROUND_COLOR: "#FFFFFF",
134
+ ACCENT_COLOR: "#2563eb",
135
+ STORE_DEFAULT_COLOR: "#b6babe",
136
+ STORE_TEXT_COLOR: "#1e293b",
137
+ STORE_HEIGHT: 4,
138
+ STORE_RADIUS: 0,
139
+ WALL_COLOR: "#64748b",
140
+ WALL_THICKNESS: 0.4,
141
+ BOUNDARY_COLOR: "#334155",
142
+ BOUNDARY_THICKNESS: 0.6,
143
+ BASE_COLOR: "#ffffff",
144
+ OVERLAY_COLOR: "#000000",
145
+ OVERLAY_OPACITY: 0.15,
146
+ PARKING_ZONE_COLOR: "#cbd5e1",
147
+ ...me(),
148
+ ...xe(),
149
+ KIOSK_SIZE: 12,
150
+ ZOOM_STEP: 0.5,
151
+ CAMERA_MAX_DISTANCE: 2e3,
152
+ CAMERA_MIN_DISTANCE: 50
153
+ }, Oe = "#f5f5f5", Se = /* @__PURE__ */ new Set(["#f8fafc", "#f1efea"]), Ce = "#86efac", Ae = "#7dd3fc", Re = "#e2e8f0", Le = 500;
154
+ function Zt(t) {
155
+ const e = typeof t == "number" ? t : Number(t);
156
+ return !Number.isFinite(e) || e <= 0 ? 0 : Math.min(e, Le);
157
+ }
158
+ function ve(...t) {
159
+ const e = Object.assign({}, W, ...t.filter(Boolean));
160
+ return e.MAP_BACKGROUND_COLOR.toLowerCase() === Oe && (e.MAP_BACKGROUND_COLOR = W.MAP_BACKGROUND_COLOR), Se.has(e.WALKABLE_COLOR.toLowerCase()) && (e.WALKABLE_COLOR = Vt), e.GREEN_AREA_COLOR.toLowerCase() === Ce && (e.GREEN_AREA_COLOR = W.GREEN_AREA_COLOR), e.WATER_COLOR.toLowerCase() === Ae && (e.WATER_COLOR = W.WATER_COLOR), e.STORE_DEFAULT_COLOR.toLowerCase() === Re && (e.STORE_DEFAULT_COLOR = W.STORE_DEFAULT_COLOR), e.STORE_RADIUS = Zt(e.STORE_RADIUS), e;
161
+ }
162
+ const Ee = [
163
+ "unit",
164
+ "amenity",
165
+ "kiosk_screen",
166
+ "connector",
167
+ "entrance",
168
+ "parking_zone"
169
+ ], mt = 1e4, Nr = 2.5, nt = "entrance", Tr = 24, Ne = 8;
170
+ function Te(t) {
171
+ var o;
172
+ if (!t) return !1;
173
+ const e = t.trim();
174
+ return e ? e === nt ? !0 : ((o = (e.split(/[?#]/, 1)[0] ?? e).split("/").filter(Boolean).pop()) == null ? void 0 : o.toLowerCase()) === nt : !1;
175
+ }
176
+ function Me(t) {
177
+ var e;
178
+ return t.kind !== "entrance" ? !1 : Te((e = t.label) == null ? void 0 : e.imageKey) ? !0 : t.origin === "manual" && !t.sourceSvgId;
179
+ }
180
+ function jt(t) {
181
+ var e;
182
+ return !Me(t) || ((e = t.label) == null ? void 0 : e.imageKey) === nt ? t.label : {
183
+ ...t.label ?? {},
184
+ imageKey: nt
185
+ };
186
+ }
187
+ function Mr(t, e, n) {
188
+ const r = e != null ? { ...t, ...e } : { ...t ?? {} };
189
+ return jt({
190
+ ...n,
191
+ kind: n.kind ?? "unit",
192
+ label: r
193
+ }) ?? r;
194
+ }
195
+ function wr(t) {
196
+ return Math.max(Ne, t);
197
+ }
198
+ const Pr = ["left", "center", "right"], we = "center";
199
+ function Fr(t) {
200
+ return t === "left" || t === "right" ? t : we;
201
+ }
202
+ function Dr(t, e) {
203
+ return e === "left" ? t.minX : e === "right" ? t.maxX : (t.minX + t.maxX) / 2;
204
+ }
205
+ function Kr(t) {
206
+ return t === "left" ? "start" : t === "right" ? "end" : "middle";
207
+ }
208
+ const ot = 12, Pe = ot, Fe = 4, De = [
209
+ "retail_name",
210
+ "retail_logo",
211
+ "retail_text",
212
+ "kiosk",
213
+ "amenity",
214
+ "connector",
215
+ "custom_text",
216
+ "custom_image"
217
+ ], Ke = new Set(De);
218
+ function V(t, e) {
219
+ const n = typeof t == "number" ? t : Number(t);
220
+ return Number.isFinite(n) ? n : e;
221
+ }
222
+ const Ye = /^(?:|[+\-]|[+\-]?\.(?:0*)?)$/;
223
+ function Be(t) {
224
+ const e = t.trim();
225
+ if (Ye.test(e))
226
+ return { render: 0, complete: !1 };
227
+ const n = Number(e);
228
+ return Number.isFinite(n) ? { render: n, complete: !0 } : { render: 0, complete: !1 };
229
+ }
230
+ function Yr(t) {
231
+ const e = Be(t);
232
+ return e.complete ? { display: String(e.render), render: e.render } : { display: "0", render: 0 };
233
+ }
234
+ function F(t) {
235
+ if (t == null) return null;
236
+ const e = String(t).trim();
237
+ return e || null;
238
+ }
239
+ function ze(t) {
240
+ if (t == null) return null;
241
+ const e = String(t);
242
+ return e === "" ? null : e;
243
+ }
244
+ function at(t) {
245
+ if (t == null || t === "") return null;
246
+ const e = Number(t);
247
+ return Number.isFinite(e) ? e : null;
248
+ }
249
+ function $e(t) {
250
+ return typeof t == "string" && Ke.has(t);
251
+ }
252
+ function gt(t) {
253
+ return t === "amenity" ? "amenity" : t === "kiosk_screen" ? "kiosk" : t === "connector" ? "connector" : "retail_name";
254
+ }
255
+ function Br(t) {
256
+ return t === "amenity" ? "amenity" : t === "kiosk_screen" ? "kiosk" : t === "unit" || t === "parking_zone" ? "retailer" : "none";
257
+ }
258
+ function zr(t, e) {
259
+ return {
260
+ shapeId: t,
261
+ targetType: "none",
262
+ retailerId: null,
263
+ amenityId: null,
264
+ kioskId: null,
265
+ unitStatus: "vacant",
266
+ unitNumber: null,
267
+ customLabel: null,
268
+ customImageKey: null,
269
+ layerType: gt(e),
270
+ size: ot,
271
+ rotate: 0,
272
+ offsetX: 0,
273
+ offsetY: 0,
274
+ bgColor: null,
275
+ textColor: null
276
+ };
277
+ }
278
+ function $r(t, e = "unit") {
279
+ const n = t.layerType ?? t.layer_type, r = t.unitStatus ?? t.unit_status ?? "vacant";
280
+ return {
281
+ shapeId: V(
282
+ t.shapeId ?? t.shape_id,
283
+ 0
284
+ ),
285
+ targetType: t.targetType ?? t.target_type ?? "none",
286
+ retailerId: at(
287
+ t.retailerId ?? t.retailer_id
288
+ ),
289
+ amenityId: at(
290
+ t.amenityId ?? t.amenity_id
291
+ ),
292
+ kioskId: at(
293
+ t.kioskId ?? t.kiosk_id
294
+ ),
295
+ unitStatus: r || "vacant",
296
+ unitNumber: F(
297
+ t.unitNumber ?? t.unit_number
298
+ ),
299
+ customLabel: ze(
300
+ t.customLabel ?? t.custom_label
301
+ ),
302
+ customImageKey: F(
303
+ t.customImageKey ?? t.custom_image_key
304
+ ),
305
+ layerType: $e(n) ? n : gt(e),
306
+ size: V(t.size, ot),
307
+ rotate: V(t.rotate, 0),
308
+ offsetX: V(
309
+ t.offsetX ?? t.offset_x,
310
+ 0
311
+ ),
312
+ offsetY: V(
313
+ t.offsetY ?? t.offset_y,
314
+ 0
315
+ ),
316
+ bgColor: F(
317
+ t.bgColor ?? t.bg_color
318
+ ),
319
+ textColor: F(
320
+ t.textColor ?? t.text_color
321
+ ),
322
+ align: Ge(t.align)
323
+ };
324
+ }
325
+ function Ge(t) {
326
+ if (t === "left" || t === "right" || t === "center") return t;
327
+ }
328
+ function Gr(t, e) {
329
+ const n = (t.location ?? "").trim();
330
+ return e && n && n !== "-" ? `${t.name} (${n})` : t.name;
331
+ }
332
+ function At(t, e) {
333
+ var r;
334
+ const n = (r = t == null ? void 0 : t.bgColor) == null ? void 0 : r.trim();
335
+ return Z(n) ? "transparent" : n || e;
336
+ }
337
+ function kt(t) {
338
+ return t === "amenity" || t === "kiosk_screen" || t === "connector";
339
+ }
340
+ function Xr(t, e) {
341
+ return kt(t) ? It : e;
342
+ }
343
+ function Wr(t, e) {
344
+ var r;
345
+ const n = (r = t == null ? void 0 : t.textColor) == null ? void 0 : r.trim();
346
+ return Z(n) ? "transparent" : n || e;
347
+ }
348
+ function Xe(t, e, n) {
349
+ const r = (t == null ? void 0 : t.layerType) ?? (n ? gt(n) : void 0);
350
+ return r === "kiosk" ? e.KIOSK_ICON_COLOR : r === "amenity" ? e.AMENITY_ICON_COLOR : r === "connector" ? e.CONNECTOR_ICON_COLOR : e.STORE_TEXT_COLOR;
351
+ }
352
+ function Vr(t, e, n, r) {
353
+ var i;
354
+ const o = (i = n ?? (t == null ? void 0 : t.textColor)) == null ? void 0 : i.trim();
355
+ return Z(o) ? "transparent" : o || Xe(t, e, r);
356
+ }
357
+ function Ur(t) {
358
+ const e = t.trim();
359
+ if (!e || !/^\d+$/.test(e)) return null;
360
+ const n = Number(e);
361
+ return Number.isSafeInteger(n) && n > 0 ? n : null;
362
+ }
363
+ function Hr(t, e) {
364
+ var o;
365
+ const n = e == null ? void 0 : e.trim();
366
+ if (n) return n;
367
+ const r = (o = t == null ? void 0 : t.customLabel) == null ? void 0 : o.trim();
368
+ return r || ((t == null ? void 0 : t.amenityId) != null ? `Amenity ${t.amenityId}` : null);
369
+ }
370
+ function Zr(t, e) {
371
+ var o;
372
+ const n = (o = t == null ? void 0 : t.customLabel) == null ? void 0 : o.trim();
373
+ if (n) return n;
374
+ const r = e == null ? void 0 : e.trim();
375
+ return r || ((t == null ? void 0 : t.kioskId) != null ? `Kiosk ${t.kioskId}` : null);
376
+ }
377
+ function N(t) {
378
+ var e, n;
379
+ 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;
380
+ }
381
+ const We = /* @__PURE__ */ new Set([
382
+ "unit",
383
+ "parking_zone",
384
+ "amenity",
385
+ "kiosk_screen"
386
+ ]);
387
+ function qt(t, e, n) {
388
+ var r, o;
389
+ return t.kind === "label" ? t.label : t.kind === "entrance" ? jt(t) ?? t.label : t.kind === "connector" || (e == null ? void 0 : e.layerType) === "connector" ? e ? Lt(
390
+ { style: t.style ?? {}, label: t.label },
391
+ e,
392
+ n
393
+ ).label : t.label : We.has(t.kind) ? !e || !N(e) ? !((r = t.label) != null && r.text) && !((o = t.label) != null && o.imageKey) ? t.label : {
394
+ ...t.label,
395
+ text: void 0,
396
+ imageKey: void 0
397
+ } : Lt(
398
+ { style: t.style ?? {}, label: t.label },
399
+ e,
400
+ n
401
+ ).label : t.label;
402
+ }
403
+ function Ve(t, e) {
404
+ if (N(t)) {
405
+ if (t.layerType === "retail_text" || t.layerType === "custom_text")
406
+ return t.customLabel ?? void 0;
407
+ if (t.layerType === "retail_name")
408
+ return (e == null ? void 0 : e.name) ?? t.customLabel ?? void 0;
409
+ }
410
+ }
411
+ function Qt(t, e, n) {
412
+ if (!(!N(t) || !t) && !(t.layerType !== "retail_logo" && t.layerType !== "custom_image"))
413
+ return He(t, e) ?? F(n == null ? void 0 : n.imageKey) ?? void 0;
414
+ }
415
+ function jr(t, e) {
416
+ var n, r;
417
+ if (!(!N(t) || !t)) {
418
+ if (t.layerType === "kiosk") return "kiosk";
419
+ if (t.layerType === "amenity")
420
+ return ((n = e == null ? void 0 : e.find((o) => o.id === t.amenityId)) == null ? void 0 : n.code) ?? ((r = t.customLabel) == null ? void 0 : r.trim()) ?? void 0;
421
+ }
422
+ }
423
+ function Ue(t, e) {
424
+ const n = Number.isFinite(t) && t > 0 ? t : ot;
425
+ return (e == null ? void 0 : e.layerType) === "retail_logo" ? n * Fe : n;
426
+ }
427
+ function qr(t) {
428
+ const e = t.assignment, n = t.label;
429
+ return {
430
+ size: Ue(
431
+ (e == null ? void 0 : e.size) ?? (n == null ? void 0 : n.size) ?? Pe
432
+ ),
433
+ rotate: (e == null ? void 0 : e.rotate) ?? (n == null ? void 0 : n.rotate) ?? 0,
434
+ offsetX: (e == null ? void 0 : e.offsetX) ?? (n == null ? void 0 : n.offsetX) ?? 0,
435
+ offsetY: (e == null ? void 0 : e.offsetY) ?? (n == null ? void 0 : n.offsetY) ?? 0,
436
+ iconColor: (e == null ? void 0 : e.textColor) ?? (n == null ? void 0 : n.color) ?? null
437
+ };
438
+ }
439
+ function Qr(t, e) {
440
+ var n;
441
+ return N(t) ? (t == null ? void 0 : t.layerType) === "kiosk" || (t == null ? void 0 : t.layerType) === "amenity" || Qt(t, null, e) ? !0 : !!((n = e == null ? void 0 : e.text) != null && n.trim()) : !1;
442
+ }
443
+ function He(t, e) {
444
+ if (N(t)) {
445
+ if (t.layerType === "retail_logo")
446
+ return F(e == null ? void 0 : e.logoKey) ?? F(e == null ? void 0 : e.logoUrl) ?? F(t.customImageKey) ?? void 0;
447
+ if (t.layerType === "custom_image")
448
+ return F(t.customImageKey) ?? void 0;
449
+ }
450
+ }
451
+ function lt(t) {
452
+ if (t.length === 0) return "";
453
+ const e = t[0];
454
+ return t.every((n) => n === e) ? e : "";
455
+ }
456
+ function Rt(t) {
457
+ if (t.length === 0) return !1;
458
+ const e = t[0];
459
+ return t.some((n) => n !== e);
460
+ }
461
+ function Jr(t) {
462
+ const e = t.map((r) => r.bgColor ?? ""), n = t.map((r) => r.textColor ?? "");
463
+ return {
464
+ size: lt(t.map((r) => r.size)),
465
+ bgColor: lt(e),
466
+ textColor: lt(n),
467
+ bgColorMixed: Rt(e),
468
+ textColorMixed: Rt(n)
469
+ };
470
+ }
471
+ function to(t, e) {
472
+ return {
473
+ ...t,
474
+ ...e.size != null ? { size: e.size } : {},
475
+ ...e.bgColor !== void 0 ? { bgColor: e.bgColor } : {},
476
+ ...e.textColor !== void 0 ? { textColor: e.textColor } : {}
477
+ };
478
+ }
479
+ function Lt(t, e, n) {
480
+ const r = Qt(e, n, t.label), o = N(e) ? r ? void 0 : Ve(e, n) ?? t.label.text : void 0;
481
+ return {
482
+ style: {
483
+ ...t.style,
484
+ fill: e.bgColor ?? void 0
485
+ },
486
+ label: {
487
+ ...t.label,
488
+ text: o,
489
+ imageKey: r,
490
+ size: Number.isFinite(e.size) ? e.size : 0,
491
+ rotate: Number.isFinite(e.rotate) ? e.rotate : 0,
492
+ offsetX: Number.isFinite(e.offsetX) ? e.offsetX : 0,
493
+ offsetY: Number.isFinite(e.offsetY) ? e.offsetY : 0,
494
+ color: e.textColor ?? void 0,
495
+ ...e.align ? { align: e.align } : {}
496
+ }
497
+ };
498
+ }
499
+ const Ze = [
500
+ "floorplate",
501
+ "walkable",
502
+ "decor",
503
+ "zone",
504
+ "green_area",
505
+ "water",
506
+ "parking_zone"
507
+ ];
508
+ function je(t) {
509
+ return t === "void";
510
+ }
511
+ function eo(t) {
512
+ return Ze.includes(t);
513
+ }
514
+ function Jt(t) {
515
+ return je(t.kind) && !t.orphanedAt;
516
+ }
517
+ function qe(t) {
518
+ return (t.shapes ?? []).some(Jt);
519
+ }
520
+ function no(t) {
521
+ var n;
522
+ const e = [];
523
+ for (const r of t.shapes ?? [])
524
+ if (Jt(r))
525
+ for (const o of ((n = r.geometry) == null ? void 0 : n.polygons) ?? [])
526
+ o.length >= 3 && e.push(o);
527
+ return e;
528
+ }
529
+ function vt(t) {
530
+ let e = 0;
531
+ for (let n = 0, r = t.length - 1; n < t.length; r = n++)
532
+ e += t[r].x * t[n].y - t[n].x * t[r].y;
533
+ return e / 2;
534
+ }
535
+ function Qe(t) {
536
+ return t.slice().reverse();
537
+ }
538
+ function Je(t, e) {
539
+ const n = vt(t), r = vt(e);
540
+ return n === 0 || r === 0 ? e : Math.sign(n) === Math.sign(r) ? Qe(e) : e;
541
+ }
542
+ function Et(t) {
543
+ let e = 1 / 0, n = 1 / 0, r = -1 / 0, o = -1 / 0;
544
+ for (const i of t)
545
+ i.x < e && (e = i.x), i.y < n && (n = i.y), i.x > r && (r = i.x), i.y > o && (o = i.y);
546
+ return { minX: e, minY: n, maxX: r, maxY: o };
547
+ }
548
+ function tn(t, e) {
549
+ const n = Et(t), r = Et(e);
550
+ return n.minX <= r.maxX && n.maxX >= r.minX && n.minY <= r.maxY && n.maxY >= r.minY;
551
+ }
552
+ function ro(t, e) {
553
+ return e.filter((n) => n.length >= 3 && tn(t, n)).map((n) => Je(t, n));
554
+ }
555
+ const oo = "#e8eef4", io = "#64748b", so = "#475569";
556
+ function en(t, e) {
557
+ return t.ordering - e.ordering || t.levelIndex - e.levelIndex;
558
+ }
559
+ function U(t) {
560
+ return t.kind === "outdoor";
561
+ }
562
+ function nn(t, e) {
563
+ const n = t.filter(U), r = e == null ? null : t.find((o) => o.id === e) ?? null;
564
+ return !r || U(r) || n.some((o) => o.id === r.id) ? n : [...n, r];
565
+ }
566
+ function rn(t, e) {
567
+ if (e == null) return [];
568
+ const n = it(t), r = n.findIndex((u) => u.id === e);
569
+ if (r < 0) return [];
570
+ const o = [];
571
+ let i = n[r];
572
+ for (let u = r; u < n.length - 1 && qe(i); u++) {
573
+ const a = n[u + 1];
574
+ if (!a) break;
575
+ o.unshift(a), i = a;
576
+ }
577
+ return o;
578
+ }
579
+ function co(t, e) {
580
+ return rn(t, e).at(-1) ?? null;
581
+ }
582
+ function ao(t, e, n) {
583
+ const r = t.find((i) => i.id === n);
584
+ if (!r || !U(r)) return n;
585
+ const o = e == null ? null : t.find((i) => i.id === e) ?? null;
586
+ return o && !U(o) ? o.id : cn(t) ?? n;
587
+ }
588
+ function it(t) {
589
+ return t.filter((e) => e.kind === "floor").slice().sort(en);
590
+ }
591
+ function lo(t) {
592
+ return it(t);
593
+ }
594
+ function uo(t) {
595
+ return it(t).length > 1;
596
+ }
597
+ function on(t) {
598
+ return t.some((e) => e.kind === "floor");
599
+ }
600
+ function sn(t) {
601
+ return t.some(U);
602
+ }
603
+ const fo = "This map doesn’t have any floors yet.";
604
+ function cn(t) {
605
+ var e, n;
606
+ return ((e = it(t).at(-1)) == null ? void 0 : e.id) ?? ((n = t[0]) == null ? void 0 : n.id) ?? null;
607
+ }
608
+ function Nt(t) {
609
+ return {
610
+ minX: t.x,
611
+ minY: t.y,
612
+ maxX: t.x + t.width,
613
+ maxY: t.y + t.height,
614
+ cx: t.x + t.width / 2,
615
+ cy: t.y + t.height / 2,
616
+ size: Math.max(t.width, t.height, 100)
617
+ };
618
+ }
619
+ function an(t, e) {
620
+ const n = e.scale || 1, r = (e.rotate || 0) * Math.PI / 180, o = Math.cos(r), i = Math.sin(r), u = t.x * n, a = t.y * n;
621
+ return {
622
+ x: u * o - a * i + (e.translateX || 0),
623
+ y: u * i + a * o + (e.translateY || 0)
624
+ };
625
+ }
626
+ function ln(t, e) {
627
+ const n = [
628
+ { x: t.minX, y: t.minY },
629
+ { x: t.maxX, y: t.minY },
630
+ { x: t.minX, y: t.maxY },
631
+ { x: t.maxX, y: t.maxY }
632
+ ].map((a) => e ? an(a, e) : a), r = Math.min(
633
+ n[0].x,
634
+ n[1].x,
635
+ n[2].x,
636
+ n[3].x
637
+ ), o = Math.min(
638
+ n[0].y,
639
+ n[1].y,
640
+ n[2].y,
641
+ n[3].y
642
+ ), i = Math.max(
643
+ n[0].x,
644
+ n[1].x,
645
+ n[2].x,
646
+ n[3].x
647
+ ), u = Math.max(
648
+ n[0].y,
649
+ n[1].y,
650
+ n[2].y,
651
+ n[3].y
652
+ );
653
+ return {
654
+ minX: r,
655
+ minY: o,
656
+ maxX: i,
657
+ maxY: u,
658
+ cx: (r + i) / 2,
659
+ cy: (o + u) / 2,
660
+ size: Math.max(i - r, u - o, 100)
661
+ };
662
+ }
663
+ function Tt(t, e) {
664
+ const n = Math.min(t.minX, e.minX), r = Math.min(t.minY, e.minY), o = Math.max(t.maxX, e.maxX), i = Math.max(t.maxY, e.maxY);
665
+ return {
666
+ minX: n,
667
+ minY: r,
668
+ maxX: o,
669
+ maxY: i,
670
+ cx: (n + o) / 2,
671
+ cy: (r + i) / 2,
672
+ size: Math.max(o - n, i - r, 100)
673
+ };
674
+ }
675
+ function ho(t, e, n) {
676
+ let r = n ? Nt(n) : null;
677
+ for (const o of nn(t, e)) {
678
+ if (o.viewbox) {
679
+ const i = Nt(o.viewbox);
680
+ r = r ? Tt(r, i) : i;
681
+ }
682
+ for (const i of o.shapes) {
683
+ const u = ln(i.bbox);
684
+ r = r ? Tt(r, u) : u;
685
+ }
686
+ }
687
+ return r ?? { minX: 0, minY: 0, maxX: 500, maxY: 500, cx: 250, cy: 250, size: 500 };
688
+ }
689
+ function yo(t, e) {
690
+ if (!t && !e) return { x: 0, y: 0, width: 1e3, height: 800 };
691
+ if (!t) return e;
692
+ if (!e) return t;
693
+ const n = Math.min(t.x, e.x), r = Math.min(t.y, e.y), o = Math.max(t.x + t.width, e.x + e.width), i = Math.max(t.y + t.height, e.y + e.height);
694
+ return { x: n, y: r, width: o - n, height: i - r };
695
+ }
696
+ function po(t) {
697
+ return t === "PORTAL" ? "editor" : "viewer";
698
+ }
699
+ const ut = {
700
+ search: !1,
701
+ amenities: !1,
702
+ floors: !0,
703
+ zoomReset: !0,
704
+ kioskOrigin: !1,
705
+ fetchDraft: !1,
706
+ storeModal: !1,
707
+ hoverTooltip: !1
708
+ }, un = {
709
+ /** v1 WP_SITE / MapBox HOST WEBSITE. */
710
+ WEBSITE: { ...ut, storeModal: !0, hoverTooltip: !0 },
711
+ /** Assign mode: click shapes, no public directory chrome. */
712
+ PORTAL_ASSIGN: ut,
713
+ DISPLAY_APP: {
714
+ ...ut,
715
+ kioskOrigin: !0,
716
+ hoverTooltip: !0
717
+ }
718
+ };
719
+ function te(t) {
720
+ return un[t];
721
+ }
722
+ function mo(t) {
723
+ return t !== "WEBSITE";
724
+ }
725
+ function xo(t) {
726
+ return t !== "PORTAL";
727
+ }
728
+ function fn(t) {
729
+ return t === "WEBSITE" || t === "DISPLAY_APP";
730
+ }
731
+ function bo(t, e) {
732
+ return on(e) ? !0 : fn(t) ? !1 : sn(e);
733
+ }
734
+ function Mt(...t) {
735
+ for (const e of t) {
736
+ const n = e == null ? void 0 : e.trim();
737
+ if (n) return n;
738
+ }
739
+ return null;
740
+ }
741
+ function Io(t) {
742
+ return te(t).hoverTooltip;
743
+ }
744
+ function go(t, e = [], n = []) {
745
+ var r, o, i, u, a, s, h;
746
+ if (t.kind === "unit") {
747
+ const p = (r = t.assignment) == null ? void 0 : r.retailerId, c = p != null ? e.find((x) => x.id === p) : void 0;
748
+ return Mt(
749
+ c == null ? void 0 : c.name,
750
+ (o = t.assignment) == null ? void 0 : o.customLabel,
751
+ (i = t.label) == null ? void 0 : i.text
752
+ );
753
+ }
754
+ if (t.kind === "amenity") {
755
+ const p = (u = t.assignment) == null ? void 0 : u.amenityId, c = (s = (a = t.assignment) == null ? void 0 : a.customLabel) == null ? void 0 : s.trim(), x = p != null ? n.find((d) => d.id === p) : void 0, l = c ? n.find((d) => d.code === c) : void 0;
756
+ return Mt(x == null ? void 0 : x.name, l == null ? void 0 : l.name, c, (h = t.label) == null ? void 0 : h.text);
757
+ }
758
+ return null;
759
+ }
760
+ function dn(t, e, n) {
761
+ var r;
762
+ return t === "DISPLAY_APP" && e != null && n.kind === "kiosk_screen" && !n.orphanedAt && ((r = n.assignment) == null ? void 0 : r.kioskId) === e;
763
+ }
764
+ function ko(t, e, n) {
765
+ var r;
766
+ for (const o of t.levels) {
767
+ const i = o.shapes.find(
768
+ (u) => dn(e, n, u)
769
+ );
770
+ if (i)
771
+ return {
772
+ levelId: o.id,
773
+ shapeId: i.id,
774
+ anchorId: ((r = o.anchors.find((u) => u.shapeId === i.id)) == null ? void 0 : r.id) ?? null
775
+ };
776
+ }
777
+ return null;
778
+ }
779
+ function _o(t) {
780
+ var o, i;
781
+ const e = ((o = t.kioskOrigin) == null ? void 0 : o.anchorId) ?? null;
782
+ if (t.kind === "chrome")
783
+ return {
784
+ fromAnchorId: e,
785
+ toAnchorId: null,
786
+ nextLevelId: null,
787
+ resetCamera: !0
788
+ };
789
+ const n = ((i = t.kioskOrigin) == null ? void 0 : i.levelId) ?? t.defaultLevelId, r = n != null && n !== t.activeLevelId;
790
+ return {
791
+ fromAnchorId: e,
792
+ toAnchorId: null,
793
+ nextLevelId: r ? n : null,
794
+ resetCamera: !r
795
+ };
796
+ }
797
+ function _(t) {
798
+ if (typeof t != "string") return null;
799
+ const e = t.trim();
800
+ return e || null;
801
+ }
802
+ function Q(t) {
803
+ const e = typeof t == "number" ? t : Number(t);
804
+ return Number.isFinite(e) && e > 0 ? e : null;
805
+ }
806
+ function J(t) {
807
+ return !t || typeof t != "object" ? null : _(t.url);
808
+ }
809
+ function Oo(t, e) {
810
+ var n;
811
+ return !e || !te(t).storeModal ? !1 : e.kind === "unit" ? ((n = e.assignment) == null ? void 0 : n.retailerId) != null : e.kind === "amenity" ? N(e.assignment) : !1;
812
+ }
813
+ function hn(t, e) {
814
+ for (const n of t.levels) {
815
+ const r = n.shapes.find((o) => o.id === e);
816
+ if (r) return { level: n, shape: r };
817
+ }
818
+ return null;
819
+ }
820
+ function yn(t, e) {
821
+ var r, o, i, u;
822
+ const n = ((r = t.assignment) == null ? void 0 : r.amenityId) != null ? e == null ? void 0 : e.find((a) => a.id === t.assignment.amenityId) : void 0;
823
+ return _((o = t.assignment) == null ? void 0 : o.customLabel) || _(n == null ? void 0 : n.name) || _((i = t.label) == null ? void 0 : i.text) || _((u = t.assignment) == null ? void 0 : u.unitNumber) || t.key;
824
+ }
825
+ function So(t, e) {
826
+ var i, u;
827
+ const n = hn(t, e);
828
+ if (!n) return null;
829
+ const r = n.shape.kind === "amenity" ? "amenity" : "store", o = n.level.anchors.find((a) => a.shapeId === e);
830
+ return {
831
+ shapeId: e,
832
+ levelId: n.level.id,
833
+ anchorId: (o == null ? void 0 : o.id) ?? null,
834
+ kind: r,
835
+ retailerId: ((i = n.shape.assignment) == null ? void 0 : i.retailerId) ?? null,
836
+ amenityId: ((u = n.shape.assignment) == null ? void 0 : u.amenityId) ?? null,
837
+ name: yn(n.shape, t.amenities)
838
+ };
839
+ }
840
+ function pn(t) {
841
+ const e = /* @__PURE__ */ new Map();
842
+ for (const n of t ?? [])
843
+ (n == null ? void 0 : n.id) != null && e.set(n.id, n);
844
+ return e;
845
+ }
846
+ function mn(t, e) {
847
+ var n, r;
848
+ return _(t == null ? void 0 : t.logoUrl) || _(t == null ? void 0 : t.logoKey) || _((n = e.label) == null ? void 0 : n.imageKey) || _((r = e.assignment) == null ? void 0 : r.customImageKey);
849
+ }
850
+ function Co(t, e) {
851
+ var i, u, a, s;
852
+ const n = pn(e ?? t.retailers), r = /* @__PURE__ */ new Map();
853
+ for (const h of t.levels)
854
+ for (const p of h.shapes) {
855
+ const c = (i = p.assignment) == null ? void 0 : i.retailerId;
856
+ if (c == null || p.kind !== "unit") continue;
857
+ const x = n.get(c), l = h.anchors.find((y) => y.shapeId === p.id), d = {
858
+ id: c,
859
+ name: _(x == null ? void 0 : x.name) || _((u = p.label) == null ? void 0 : u.text) || _((a = p.assignment) == null ? void 0 : a.customLabel) || `Store ${c}`,
860
+ location: _(x == null ? void 0 : x.location) || _((s = p.assignment) == null ? void 0 : s.unitNumber),
861
+ phone: _(x == null ? void 0 : x.phone),
862
+ description: _(x == null ? void 0 : x.description),
863
+ logoUrl: mn(x, p),
864
+ globalRetailerId: (x == null ? void 0 : x.globalRetailerId) ?? null,
865
+ shapeId: p.id,
866
+ levelId: h.id,
867
+ anchorId: (l == null ? void 0 : l.id) ?? null
868
+ }, f = r.get(c);
869
+ (!f || f.anchorId == null && d.anchorId != null) && r.set(c, d);
870
+ }
871
+ return Array.from(r.values()).sort((h, p) => h.name.localeCompare(p.name));
872
+ }
873
+ function Ao(t, e) {
874
+ const n = /* @__PURE__ */ new Map();
875
+ for (const r of t)
876
+ r.globalRetailerId != null && n.set(r.globalRetailerId, (n.get(r.globalRetailerId) ?? 0) + 1);
877
+ return t.filter((r) => r.id !== e && r.anchorId != null).map((r) => {
878
+ const o = r.globalRetailerId != null && (n.get(r.globalRetailerId) ?? 0) > 1 && r.location;
879
+ return {
880
+ value: String(r.id),
881
+ label: o ? `${r.name} (${r.location})` : r.name
882
+ };
883
+ });
884
+ }
885
+ function Ro(t, e) {
886
+ return (t == null ? void 0 : t.anchorId) == null || (e == null ? void 0 : e.anchorId) == null ? null : {
887
+ fromAnchorId: t.anchorId,
888
+ toAnchorId: e.anchorId,
889
+ toLevelId: e.levelId
890
+ };
891
+ }
892
+ function Lo(t) {
893
+ const e = t.replace(/\D/g, "").slice(-10);
894
+ return e.length === 10 ? `${e.slice(0, 3)}.${e.slice(3, 6)}.${e.slice(-4)}` : t;
895
+ }
896
+ function vo(t) {
897
+ if (!t || typeof t != "object") return null;
898
+ const e = t, n = e.global_retailer && typeof e.global_retailer == "object" ? e.global_retailer : null, r = Q(e.id);
899
+ if (r == null) return null;
900
+ const o = _(n == null ? void 0 : n.name) || _(e.name) || `Retailer ${r}`;
901
+ return {
902
+ id: r,
903
+ name: o,
904
+ location: _(e.location),
905
+ phone: _(e.retailer_phone) || _(e.phone),
906
+ description: _(n == null ? void 0 : n.description) || _(e.description) || _(e.local_description),
907
+ logoUrl: J(n == null ? void 0 : n.media) || J(n == null ? void 0 : n.featured_image) || J(e.media) || J(e.featured_image) || _(e.logoUrl) || _(e.logo),
908
+ logoKey: _(e.logoKey),
909
+ globalRetailerId: Q(n == null ? void 0 : n.id) || Q(e.global_retailer_id) || Q(e.globalRetailerId)
910
+ };
911
+ }
912
+ function ee(t) {
913
+ return t === "WEBSITE" || t === "DISPLAY_APP";
914
+ }
915
+ function xn(t) {
916
+ return t === "PORTAL_ASSIGN";
917
+ }
918
+ function bn(t) {
919
+ return ee(t);
920
+ }
921
+ function Eo(t, e) {
922
+ return bn(e) ? N(t.assignment) : !0;
923
+ }
924
+ function In(t) {
925
+ const e = (t.sourceSvgId ?? t.key ?? "").trim().toLowerCase().replace(/_/g, "-");
926
+ return e === "escalator" || e.startsWith("escalator-") ? "escalator" : e === "elevator" || e.startsWith("elevator-") ? "elevator" : null;
927
+ }
928
+ function gn(t, e) {
929
+ return In(t) ? e.has(t.id) : t.kind === "amenity" || t.kind === "kiosk_screen" ? N(t.assignment) : !0;
930
+ }
931
+ function No(t, e, n) {
932
+ return ee(e) ? gn(t, n) : !0;
933
+ }
934
+ const ne = "#e2e8f0";
935
+ function To(t) {
936
+ if (!t) return !1;
937
+ const e = t.toLowerCase();
938
+ return e === "amenity" || e.startsWith("amenity-");
939
+ }
940
+ function kn(t) {
941
+ var n;
942
+ return ((n = t == null ? void 0 : t.GREEN_AREA_COLOR) == null ? void 0 : n.trim()) || X("green-area");
943
+ }
944
+ function _n(t, e) {
945
+ return t === "amenity" ? kn(e) : ne;
946
+ }
947
+ function On(t, e, n, r) {
948
+ if (t === "walkable") return e.WALKABLE_COLOR;
949
+ if (kt(t))
950
+ return At(r, It);
951
+ if (t === "unit")
952
+ return At(r, e.STORE_DEFAULT_COLOR);
953
+ if (n) return n;
954
+ switch (t) {
955
+ case "wall":
956
+ case "boundary":
957
+ return e.WALL_COLOR;
958
+ case "parking_zone":
959
+ return e.PARKING_ZONE_COLOR;
960
+ case "green_area":
961
+ return e.GREEN_AREA_COLOR;
962
+ case "water":
963
+ return e.WATER_COLOR;
964
+ case "floorplate":
965
+ return e.BASE_COLOR;
966
+ case "void":
967
+ return "#00000000";
968
+ default:
969
+ return ne;
970
+ }
971
+ }
972
+ function Mo(t, e, n, r, o) {
973
+ const i = On(t, e, r, o);
974
+ return xn(n) && kt(t) && Z(i) ? _n(t, e) : i;
975
+ }
976
+ function wo(t, e) {
977
+ return t === "amenity" ? 1 : e ?? 1;
978
+ }
979
+ function Sn(t) {
980
+ return /^https?:\/\//i.test(t.trim());
981
+ }
982
+ function Po(t, e) {
983
+ return !e || !Sn(t) ? t : e + encodeURIComponent(t);
984
+ }
985
+ function Fo(t, e) {
986
+ return t.map((n) => ({ x: n.x, y: e - n.y }));
987
+ }
988
+ function D(t, e) {
989
+ const n = t.x - e.x, r = t.y - e.y;
990
+ return Math.hypot(n, r);
991
+ }
992
+ function Cn(t) {
993
+ if (t.length === 0)
994
+ return { minX: 0, minY: 0, maxX: 0, maxY: 0 };
995
+ let e = t[0].x, n = t[0].y, r = t[0].x, o = t[0].y;
996
+ for (let i = 1; i < t.length; i++) {
997
+ const u = t[i];
998
+ u.x < e && (e = u.x), u.y < n && (n = u.y), u.x > r && (r = u.x), u.y > o && (o = u.y);
999
+ }
1000
+ return { minX: e, minY: n, maxX: r, maxY: o };
1001
+ }
1002
+ function Do(t, e) {
1003
+ return {
1004
+ minX: Math.min(t.minX, e.minX),
1005
+ minY: Math.min(t.minY, e.minY),
1006
+ maxX: Math.max(t.maxX, e.maxX),
1007
+ maxY: Math.max(t.maxY, e.maxY)
1008
+ };
1009
+ }
1010
+ function An(t) {
1011
+ if (t.length === 0) return { x: 0, y: 0 };
1012
+ let e = 0, n = 0;
1013
+ for (const r of t)
1014
+ e += r.x, n += r.y;
1015
+ return { x: e / t.length, y: n / t.length };
1016
+ }
1017
+ function Rn(t, e) {
1018
+ let n = !1;
1019
+ for (let r = 0, o = e.length - 1; r < e.length; o = r++) {
1020
+ const i = e[r].x, u = e[r].y, a = e[o].x, s = e[o].y;
1021
+ u > t.y != s > t.y && t.x < (a - i) * (t.y - u) / (s - u + Number.EPSILON) + i && (n = !n);
1022
+ }
1023
+ return n;
1024
+ }
1025
+ function Ko(t, e) {
1026
+ return e.some((n) => Rn(t, n));
1027
+ }
1028
+ function Ln(t, e, n) {
1029
+ const r = n.x - e.x, o = n.y - e.y, i = r * r + o * o;
1030
+ if (i === 0)
1031
+ return { point: { ...e }, t: 0, distance: D(t, e) };
1032
+ let u = ((t.x - e.x) * r + (t.y - e.y) * o) / i;
1033
+ u = Math.max(0, Math.min(1, u));
1034
+ const a = { x: e.x + u * r, y: e.y + u * o };
1035
+ return { point: a, t: u, distance: D(t, a) };
1036
+ }
1037
+ function Yo(t, e) {
1038
+ if (e.length < 2) return null;
1039
+ let n = null;
1040
+ for (let r = 0; r < e.length - 1; r++) {
1041
+ const o = Ln(t, e[r], e[r + 1]);
1042
+ (!n || o.distance < n.distance) && (n = { point: o.point, segmentIndex: r, distance: o.distance });
1043
+ }
1044
+ return n;
1045
+ }
1046
+ function wt(t, e, n, r, o = 8) {
1047
+ const i = [];
1048
+ for (let u = 0; u <= o; u++) {
1049
+ const a = u / o, s = 1 - a;
1050
+ i.push({
1051
+ x: s * s * s * t.x + 3 * s * s * a * e.x + 3 * s * a * a * n.x + a * a * a * r.x,
1052
+ y: s * s * s * t.y + 3 * s * s * a * e.y + 3 * s * a * a * n.y + a * a * a * r.y
1053
+ });
1054
+ }
1055
+ return i;
1056
+ }
1057
+ function Pt(t, e, n, r = 6) {
1058
+ const o = [];
1059
+ for (let i = 0; i <= r; i++) {
1060
+ const u = i / r, a = 1 - u;
1061
+ o.push({
1062
+ x: a * a * t.x + 2 * a * u * e.x + u * u * n.x,
1063
+ y: a * a * t.y + 2 * a * u * e.y + u * u * n.y
1064
+ });
1065
+ }
1066
+ return o;
1067
+ }
1068
+ const vn = 8;
1069
+ function En(t, e, n, r, o, i, u) {
1070
+ if (t.x === u.x && t.y === u.y) return [{ ...t }];
1071
+ let a = Math.abs(e), s = Math.abs(n);
1072
+ if (a === 0 || s === 0 || !Number.isFinite(a) || !Number.isFinite(s))
1073
+ return [{ ...t }, { ...u }];
1074
+ const h = r % 360 * Math.PI / 180, p = Math.cos(h), c = Math.sin(h), x = (t.x - u.x) / 2, l = (t.y - u.y) / 2, d = p * x + c * l, f = -c * x + p * l, y = d * d / (a * a) + f * f / (s * s);
1075
+ if (y > 1) {
1076
+ const w = Math.sqrt(y);
1077
+ a *= w, s *= w;
1078
+ }
1079
+ const b = a * a, g = s * s, m = b * g - b * f * f - g * d * d, I = b * f * f + g * d * d, k = Math.sqrt(Math.max(0, m / I)) * (o === i ? -1 : 1), S = k * a * f / s, O = -k * s * d / a, C = p * S - c * O + (t.x + u.x) / 2, L = c * S + p * O + (t.y + u.y) / 2, R = (d - S) / a, K = (f - O) / s, T = (-d - S) / a, Y = (-f - O) / s, v = Math.atan2(K, R);
1080
+ let A = Math.atan2(R * Y - K * T, R * T + K * Y);
1081
+ !i && A > 0 ? A -= 2 * Math.PI : i && A < 0 && (A += 2 * Math.PI);
1082
+ const B = Math.abs(A) / (Math.PI / 2) * vn, z = Math.max(1, Math.round(B)), M = [{ ...t }];
1083
+ for (let w = 1; w <= z; w++) {
1084
+ const j = v + A * w / z, q = Math.cos(j), St = Math.sin(j);
1085
+ M.push({
1086
+ x: C + a * p * q - s * c * St,
1087
+ y: L + a * c * q + s * p * St
1088
+ });
1089
+ }
1090
+ return M[M.length - 1] = { ...u }, M;
1091
+ }
1092
+ const Nn = /[\s,]/;
1093
+ function re(t) {
1094
+ const e = [];
1095
+ let n = 0, r = "", o = 0;
1096
+ for (; n < t.length; ) {
1097
+ const i = t[n];
1098
+ if (Nn.test(i)) {
1099
+ n++;
1100
+ continue;
1101
+ }
1102
+ if (i >= "a" && i <= "z" || i >= "A" && i <= "Z") {
1103
+ r = i, o = 0, e.push(i), n++;
1104
+ continue;
1105
+ }
1106
+ const u = r === "A" || r === "a" ? o % 7 : -1;
1107
+ if ((u === 3 || u === 4) && (i === "0" || i === "1")) {
1108
+ e.push(i), n++, o++;
1109
+ continue;
1110
+ }
1111
+ const a = n;
1112
+ let s = 0;
1113
+ for ((i === "+" || i === "-") && n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
1114
+ n++, s++;
1115
+ if (t[n] === ".")
1116
+ for (n++; n < t.length && t[n] >= "0" && t[n] <= "9"; )
1117
+ n++, s++;
1118
+ if (s > 0 && (t[n] === "e" || t[n] === "E")) {
1119
+ const h = n;
1120
+ if (n++, (t[n] === "+" || t[n] === "-") && n++, n < t.length && t[n] >= "0" && t[n] <= "9")
1121
+ for (; n < t.length && t[n] >= "0" && t[n] <= "9"; ) n++;
1122
+ else
1123
+ n = h;
1124
+ }
1125
+ if (s === 0) {
1126
+ n = a + 1;
1127
+ continue;
1128
+ }
1129
+ e.push(t.slice(a, n)), o++;
1130
+ }
1131
+ return e;
1132
+ }
1133
+ function oe(t) {
1134
+ const e = re(t), n = [];
1135
+ let r = [], o = 0, i = 0, u = 0, a = 0, s = null, h = 0, p = "";
1136
+ const c = () => Number(e[h++]);
1137
+ for (; h < e.length; ) {
1138
+ const x = e[h];
1139
+ switch (/[a-zA-Z]/.test(x) && (p = x, h++), p) {
1140
+ case "M":
1141
+ case "m": {
1142
+ const l = p === "m", d = c(), f = c();
1143
+ o = l ? o + d : d, i = l ? i + f : f, r.length > 0 && n.push(r), r = [{ x: o, y: i }], u = o, a = i, s = null, p = l ? "l" : "L";
1144
+ break;
1145
+ }
1146
+ case "L":
1147
+ case "l": {
1148
+ const l = p === "l", d = c(), f = c();
1149
+ o = l ? o + d : d, i = l ? i + f : f, r.push({ x: o, y: i }), s = null;
1150
+ break;
1151
+ }
1152
+ case "H":
1153
+ case "h": {
1154
+ const l = p === "h", d = c();
1155
+ o = l ? o + d : d, r.push({ x: o, y: i }), s = null;
1156
+ break;
1157
+ }
1158
+ case "V":
1159
+ case "v": {
1160
+ const l = p === "v", d = c();
1161
+ i = l ? i + d : d, r.push({ x: o, y: i }), s = null;
1162
+ break;
1163
+ }
1164
+ case "C":
1165
+ case "c": {
1166
+ const l = p === "c", d = l ? o + c() : c(), f = l ? i + c() : c(), y = l ? o + c() : c(), b = l ? i + c() : c(), g = l ? o + c() : c(), m = l ? i + c() : c(), I = wt(
1167
+ { x: o, y: i },
1168
+ { x: d, y: f },
1169
+ { x: y, y: b },
1170
+ { x: g, y: m }
1171
+ );
1172
+ r.push(...I.slice(1)), s = { x: y, y: b }, o = g, i = m;
1173
+ break;
1174
+ }
1175
+ case "Q":
1176
+ case "q": {
1177
+ const l = p === "q", d = l ? o + c() : c(), f = l ? i + c() : c(), y = l ? o + c() : c(), b = l ? i + c() : c(), g = Pt(
1178
+ { x: o, y: i },
1179
+ { x: d, y: f },
1180
+ { x: y, y: b }
1181
+ );
1182
+ r.push(...g.slice(1)), s = { x: d, y: f }, o = y, i = b;
1183
+ break;
1184
+ }
1185
+ case "S":
1186
+ case "s": {
1187
+ const l = p === "s", d = s ? 2 * o - s.x : o, f = s ? 2 * i - s.y : i, y = l ? o + c() : c(), b = l ? i + c() : c(), g = l ? o + c() : c(), m = l ? i + c() : c(), I = wt(
1188
+ { x: o, y: i },
1189
+ { x: d, y: f },
1190
+ { x: y, y: b },
1191
+ { x: g, y: m }
1192
+ );
1193
+ r.push(...I.slice(1)), s = { x: y, y: b }, o = g, i = m;
1194
+ break;
1195
+ }
1196
+ case "T":
1197
+ case "t": {
1198
+ const l = p === "t", d = s ? 2 * o - s.x : o, f = s ? 2 * i - s.y : i, y = l ? o + c() : c(), b = l ? i + c() : c(), g = Pt(
1199
+ { x: o, y: i },
1200
+ { x: d, y: f },
1201
+ { x: y, y: b }
1202
+ );
1203
+ r.push(...g.slice(1)), s = { x: d, y: f }, o = y, i = b;
1204
+ break;
1205
+ }
1206
+ case "A":
1207
+ case "a": {
1208
+ const l = p === "a", d = c(), f = c(), y = c(), b = c() !== 0, g = c() !== 0, m = l ? o + c() : c(), I = l ? i + c() : c(), k = En(
1209
+ { x: o, y: i },
1210
+ d,
1211
+ f,
1212
+ y,
1213
+ b,
1214
+ g,
1215
+ { x: m, y: I }
1216
+ );
1217
+ r.push(...k.slice(1)), s = null, o = m, i = I;
1218
+ break;
1219
+ }
1220
+ case "Z":
1221
+ case "z": {
1222
+ r.push({ x: u, y: a }), n.push(r), r = [], o = u, i = a, s = null;
1223
+ break;
1224
+ }
1225
+ default:
1226
+ h++;
1227
+ break;
1228
+ }
1229
+ }
1230
+ return r.length > 0 && n.push(r), n;
1231
+ }
1232
+ function Tn(t) {
1233
+ const e = t.match(
1234
+ /^\s*M\s*(-?\d*\.?\d+(?:e[-+]?\d+)?)[\s,]+(-?\d*\.?\d+(?:e[-+]?\d+)?)/i
1235
+ );
1236
+ if (!e) return null;
1237
+ const n = Number(e[1]), r = Number(e[2]);
1238
+ return Number.isFinite(n) && Number.isFinite(r) ? { x: n, y: r } : null;
1239
+ }
1240
+ function Mn(t) {
1241
+ var o, i;
1242
+ const e = (o = t.paths[0]) == null ? void 0 : o.d;
1243
+ if (!e || t.polygons.length === 0) return !1;
1244
+ const n = Tn(e), r = (i = t.polygons[0]) == null ? void 0 : i[0];
1245
+ return !n || !r ? !1 : Math.abs(n.x - r.x) > 0.01 || Math.abs(n.y - r.y) > 0.01;
1246
+ }
1247
+ function ie(t) {
1248
+ if (!Mn(t)) return t;
1249
+ const e = t.paths.flatMap((n) => oe(n.d));
1250
+ return e.length === 0 ? t : { paths: t.paths, polygons: e };
1251
+ }
1252
+ function wn(t) {
1253
+ const e = t.map((r) => ({
1254
+ d: r,
1255
+ closed: /z/i.test(r)
1256
+ })), n = t.flatMap((r) => oe(r));
1257
+ return { paths: e, polygons: n };
1258
+ }
1259
+ function _t(t) {
1260
+ const e = t.polygons.flat();
1261
+ return Cn(e);
1262
+ }
1263
+ function Pn(t) {
1264
+ return An(t.polygons.flat());
1265
+ }
1266
+ function Bo(t, e, n = 0, r = [15, 45, 90]) {
1267
+ const o = e.x - t.x, i = e.y - t.y, u = Math.hypot(o, i);
1268
+ if (u === 0) return { ...e };
1269
+ const s = Math.atan2(i, o) * 180 / Math.PI - n;
1270
+ let h = s, p = 1 / 0;
1271
+ for (const x of r) {
1272
+ const l = Math.round(s / x) * x, d = Math.abs(s - l);
1273
+ d < p && (p = d, h = l);
1274
+ }
1275
+ const c = (h + n) * Math.PI / 180;
1276
+ return {
1277
+ x: t.x + Math.cos(c) * u,
1278
+ y: t.y + Math.sin(c) * u
1279
+ };
1280
+ }
1281
+ function zo(t, e) {
1282
+ return Math.atan2(e.y - t.y, e.x - t.x) * 180 / Math.PI;
1283
+ }
1284
+ function Fn(t) {
1285
+ if (!t) return null;
1286
+ const e = t.trim().split(/[\s,]+/).map(Number);
1287
+ return e.length !== 4 || e.some((n) => Number.isNaN(n)) ? null : { x: e[0], y: e[1], width: e[2], height: e[3] };
1288
+ }
1289
+ const Dn = {
1290
+ fill: "fill",
1291
+ "fill-opacity": "fill-opacity",
1292
+ stroke: "stroke",
1293
+ "stroke-width": "stroke-width",
1294
+ "stroke-opacity": "stroke-opacity",
1295
+ opacity: "opacity"
1296
+ };
1297
+ function Kn(t) {
1298
+ const e = {};
1299
+ for (const n of t.split(";")) {
1300
+ const r = n.indexOf(":");
1301
+ if (r === -1) continue;
1302
+ const o = n.slice(0, r).trim().toLowerCase(), i = n.slice(r + 1).trim();
1303
+ o && i && (e[o] = i);
1304
+ }
1305
+ return e;
1306
+ }
1307
+ function Yn(t) {
1308
+ const e = /* @__PURE__ */ new Map(), n = t.replace(/\/\*[\s\S]*?\*\//g, "");
1309
+ for (const r of n.matchAll(/([^{]+)\{([^}]*)\}/g)) {
1310
+ const o = r[1].split(",").map((u) => u.trim()), i = Kn(r[2]);
1311
+ for (const u of o) {
1312
+ const a = u.match(/^\.([a-zA-Z0-9_-]+)$/);
1313
+ if (!a) continue;
1314
+ const s = a[1];
1315
+ e.set(s, {
1316
+ ...e.get(s) || {},
1317
+ ...i
1318
+ });
1319
+ }
1320
+ }
1321
+ return e;
1322
+ }
1323
+ function Bn(t, e) {
1324
+ const n = {};
1325
+ for (const r of t.split(/\s+/).map((o) => o.trim()).filter(Boolean))
1326
+ Object.assign(n, e.get(r) || {});
1327
+ return n;
1328
+ }
1329
+ function zn(t) {
1330
+ const e = [], n = t.replace(/<!--[\s\S]*?-->/g, "");
1331
+ for (const o of n.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))
1332
+ e.push(o[1]);
1333
+ if (e.length === 0) return t;
1334
+ const r = /* @__PURE__ */ new Map();
1335
+ for (const o of e)
1336
+ for (const [i, u] of Yn(o))
1337
+ r.set(i, { ...r.get(i) || {}, ...u });
1338
+ return r.size === 0 ? t : t.replace(
1339
+ /<(path|polygon|polyline|line|rect|g|circle|ellipse)\b([^>]*)>/gi,
1340
+ (o, i, u) => {
1341
+ const a = /\/\s*$/.test(u), s = u.replace(/\/\s*$/, ""), h = s.match(/\bclass\s*=\s*["']([^"']*)["']/i);
1342
+ if (!h) return o;
1343
+ const p = Bn(h[1], r);
1344
+ let c = s;
1345
+ for (const [x, l] of Object.entries(p)) {
1346
+ const d = Dn[x];
1347
+ d && (new RegExp(`\\b${d}\\s*=`, "i").test(c) || (c += ` ${d}="${l}"`));
1348
+ }
1349
+ return `<${i}${c}${a ? " /" : ""}>`;
1350
+ }
1351
+ );
1352
+ }
1353
+ function Ft(t) {
1354
+ var a, s, h, p, c;
1355
+ const e = {}, n = (a = t.match(/\bfill\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : a[1], r = (s = t.match(/\bstroke\s*=\s*["']([^"']*)["']/i)) == null ? void 0 : s[1], o = (h = t.match(/\bstroke-width\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : h[1], i = (p = t.match(/\bopacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : p[1], u = (c = t.match(/\bfill-opacity\s*=\s*["']?(-?[\d.]+)/i)) == null ? void 0 : c[1];
1356
+ return n && n.toLowerCase() !== "none" && (e.fill = n), r && r.toLowerCase() !== "none" && (e.stroke = r), o != null && !Number.isNaN(Number(o)) && (e.strokeWidth = Number(o)), i != null && !Number.isNaN(Number(i)) ? e.opacity = Number(i) : u != null && !Number.isNaN(Number(u)) && (e.opacity = Number(u)), e;
1357
+ }
1358
+ function ft(t, e) {
1359
+ return {
1360
+ fill: e.fill ?? t.fill,
1361
+ stroke: e.stroke ?? t.stroke,
1362
+ strokeWidth: e.strokeWidth ?? t.strokeWidth,
1363
+ opacity: e.opacity ?? t.opacity
1364
+ };
1365
+ }
1366
+ const xt = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };
1367
+ function H(t, e) {
1368
+ return {
1369
+ a: t.a * e.a + t.c * e.b,
1370
+ b: t.b * e.a + t.d * e.b,
1371
+ c: t.a * e.c + t.c * e.d,
1372
+ d: t.b * e.c + t.d * e.d,
1373
+ e: t.a * e.e + t.c * e.f + t.e,
1374
+ f: t.b * e.e + t.d * e.f + t.f
1375
+ };
1376
+ }
1377
+ function $n(t, e) {
1378
+ return {
1379
+ x: t.a * e.x + t.c * e.y + t.e,
1380
+ y: t.b * e.x + t.d * e.y + t.f
1381
+ };
1382
+ }
1383
+ function Gn(t, e = 1e-9) {
1384
+ 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;
1385
+ }
1386
+ function dt(t, e) {
1387
+ return { a: 1, b: 0, c: 0, d: 1, e: t, f: e };
1388
+ }
1389
+ function Xn(t) {
1390
+ const e = t * Math.PI / 180, n = Math.cos(e), r = Math.sin(e);
1391
+ return { a: n, b: r, c: -r, d: n, e: 0, f: 0 };
1392
+ }
1393
+ function Wn(t, e) {
1394
+ switch (t) {
1395
+ case "matrix":
1396
+ return e.length < 6 ? null : { a: e[0], b: e[1], c: e[2], d: e[3], e: e[4], f: e[5] };
1397
+ case "translate":
1398
+ return e.length < 1 ? null : dt(e[0], e[1] ?? 0);
1399
+ case "scale": {
1400
+ if (e.length < 1) return null;
1401
+ const n = e[0], r = e[1] ?? n;
1402
+ return { a: n, b: 0, c: 0, d: r, e: 0, f: 0 };
1403
+ }
1404
+ case "rotate": {
1405
+ if (e.length < 1) return null;
1406
+ const n = Xn(e[0]);
1407
+ if (e.length < 3) return n;
1408
+ const r = e[1], o = e[2];
1409
+ return H(
1410
+ H(dt(r, o), n),
1411
+ dt(-r, -o)
1412
+ );
1413
+ }
1414
+ case "skewx":
1415
+ return e.length < 1 ? null : { a: 1, b: 0, c: Math.tan(e[0] * Math.PI / 180), d: 1, e: 0, f: 0 };
1416
+ case "skewy":
1417
+ return e.length < 1 ? null : { a: 1, b: Math.tan(e[0] * Math.PI / 180), c: 0, d: 1, e: 0, f: 0 };
1418
+ default:
1419
+ return null;
1420
+ }
1421
+ }
1422
+ const Dt = /([a-zA-Z]+)\s*\(([^)]*)\)/g;
1423
+ function Kt(t) {
1424
+ if (!t) return xt;
1425
+ let e = xt;
1426
+ Dt.lastIndex = 0;
1427
+ let n;
1428
+ for (; (n = Dt.exec(t)) !== null; ) {
1429
+ const r = n[1].toLowerCase(), o = n[2].trim().split(/[\s,]+/).filter(Boolean).map(Number);
1430
+ if (o.some((u) => Number.isNaN(u))) continue;
1431
+ const i = Wn(r, o);
1432
+ i && (e = H(e, i));
1433
+ }
1434
+ return e;
1435
+ }
1436
+ function G(t) {
1437
+ if (!Number.isFinite(t)) return "0";
1438
+ const e = Math.round(t * 1e4) / 1e4;
1439
+ return Object.is(e, -0) ? "0" : String(e);
1440
+ }
1441
+ function Vn(t, e, n, r) {
1442
+ const o = r * Math.PI / 180, i = Math.cos(o), u = Math.sin(o), a = i * e, s = u * e, h = -u * n, p = i * n, c = t.a * a + t.c * s, x = t.b * a + t.d * s, l = t.a * h + t.c * p, d = t.b * h + t.d * p, f = (c + d) / 2, y = (c - d) / 2, b = (x + l) / 2, g = (x - l) / 2, m = Math.hypot(f, g), I = Math.hypot(y, b), k = Math.abs(m + I), S = Math.abs(m - I), O = Math.atan2(b, y), L = (Math.atan2(g, f) + O) / 2 * (180 / Math.PI);
1443
+ return { rx: k, ry: S, phiDeg: L };
1444
+ }
1445
+ function Un(t, e) {
1446
+ if (!t || Gn(e)) return t;
1447
+ const n = re(t), r = [], o = e.a * e.d - e.b * e.c < 0;
1448
+ let i = 0, u = "", a = 0, s = 0, h = 0, p = 0;
1449
+ const c = () => {
1450
+ const d = Number(n[i++]);
1451
+ return Number.isNaN(d) ? 0 : d;
1452
+ }, x = (d, ...f) => {
1453
+ r.push(d + (f.length ? " " + f.map(G).join(" ") : ""));
1454
+ }, l = (d, f) => {
1455
+ const y = $n(e, { x: d, y: f });
1456
+ return [y.x, y.y];
1457
+ };
1458
+ for (; i < n.length; ) {
1459
+ const d = n[i];
1460
+ switch (/[a-zA-Z]/.test(d) && (u = d, i++), u) {
1461
+ case "M":
1462
+ case "m": {
1463
+ const f = u === "m", y = c(), b = c();
1464
+ a = f ? a + y : y, s = f ? s + b : b, h = a, p = s, x("M", ...l(a, s)), u = f ? "l" : "L";
1465
+ break;
1466
+ }
1467
+ case "L":
1468
+ case "l": {
1469
+ const f = u === "l", y = c(), b = c();
1470
+ a = f ? a + y : y, s = f ? s + b : b, x("L", ...l(a, s));
1471
+ break;
1472
+ }
1473
+ case "H":
1474
+ case "h": {
1475
+ const f = u === "h", y = c();
1476
+ a = f ? a + y : y, x("L", ...l(a, s));
1477
+ break;
1478
+ }
1479
+ case "V":
1480
+ case "v": {
1481
+ const f = u === "v", y = c();
1482
+ s = f ? s + y : y, x("L", ...l(a, s));
1483
+ break;
1484
+ }
1485
+ case "C":
1486
+ case "c": {
1487
+ const f = u === "c", y = f ? a + c() : c(), b = f ? s + c() : c(), g = f ? a + c() : c(), m = f ? s + c() : c(), I = f ? a + c() : c(), k = f ? s + c() : c();
1488
+ x("C", ...l(y, b), ...l(g, m), ...l(I, k)), a = I, s = k;
1489
+ break;
1490
+ }
1491
+ case "S":
1492
+ case "s": {
1493
+ const f = u === "s", y = f ? a + c() : c(), b = f ? s + c() : c(), g = f ? a + c() : c(), m = f ? s + c() : c();
1494
+ x("S", ...l(y, b), ...l(g, m)), a = g, s = m;
1495
+ break;
1496
+ }
1497
+ case "Q":
1498
+ case "q": {
1499
+ const f = u === "q", y = f ? a + c() : c(), b = f ? s + c() : c(), g = f ? a + c() : c(), m = f ? s + c() : c();
1500
+ x("Q", ...l(y, b), ...l(g, m)), a = g, s = m;
1501
+ break;
1502
+ }
1503
+ case "T":
1504
+ case "t": {
1505
+ const f = u === "t", y = f ? a + c() : c(), b = f ? s + c() : c();
1506
+ x("T", ...l(y, b)), a = y, s = b;
1507
+ break;
1508
+ }
1509
+ case "A":
1510
+ case "a": {
1511
+ const f = u === "a", y = c(), b = c(), g = c(), m = c(), I = c(), k = f ? a + c() : c(), S = f ? s + c() : c(), O = Vn(e, y, b, g), [C, L] = l(k, S);
1512
+ r.push(
1513
+ `A ${G(O.rx)} ${G(O.ry)} ${G(O.phiDeg)} ${m ? 1 : 0} ${(I ? 1 : 0) ^ (o ? 1 : 0)} ${G(C)} ${G(L)}`
1514
+ ), a = k, s = S;
1515
+ break;
1516
+ }
1517
+ case "Z":
1518
+ case "z": {
1519
+ r.push("Z"), a = h, s = p;
1520
+ break;
1521
+ }
1522
+ default:
1523
+ i++;
1524
+ break;
1525
+ }
1526
+ }
1527
+ return r.join(" ");
1528
+ }
1529
+ const Hn = [
1530
+ { prefix: "walkable", kind: "walkable" },
1531
+ { prefix: "void", kind: "void" },
1532
+ { prefix: "unit", kind: "unit" },
1533
+ { prefix: "store", kind: "unit" },
1534
+ // v1 compatibility
1535
+ { prefix: "wall", kind: "wall" },
1536
+ { prefix: "boundary", kind: "boundary" },
1537
+ { prefix: "outer-wall", kind: "wall" },
1538
+ { prefix: "amenity-", kind: "amenity" },
1539
+ { prefix: "kiosk-", kind: "kiosk_screen" },
1540
+ { prefix: "escalator-", kind: "connector" },
1541
+ { prefix: "elevator-", kind: "connector" },
1542
+ { prefix: "stairs-", kind: "connector" },
1543
+ { prefix: "entrance-", kind: "entrance" },
1544
+ { prefix: "zone-", kind: "zone" },
1545
+ { prefix: "label-", kind: "label" },
1546
+ { prefix: "floorplate", kind: "floorplate" },
1547
+ { prefix: "base", kind: "floorplate" },
1548
+ { prefix: "decor", kind: "decor" },
1549
+ { prefix: "special-shape", kind: "decor" },
1550
+ { prefix: "overlay", kind: "decor" },
1551
+ { prefix: "green-area", kind: "green_area" },
1552
+ { prefix: "parking-lane", kind: "parking_zone" },
1553
+ { prefix: "parking-icon", kind: "parking_icon" },
1554
+ { prefix: "walking-path", kind: "walkable" },
1555
+ { prefix: "water", kind: "water" }
1556
+ ], Zn = [
1557
+ { prefix: "parking-zone", kind: "parking_zone" },
1558
+ { prefix: "parking-lane", kind: "parking_zone" },
1559
+ { prefix: "parking-icon", kind: "parking_icon" },
1560
+ { prefix: "green-area", kind: "green_area" },
1561
+ { prefix: "water", kind: "water" },
1562
+ { prefix: "walking-path", kind: "walkable" },
1563
+ { prefix: "decor", kind: "decor" },
1564
+ { prefix: "entrance-", kind: "entrance" },
1565
+ { prefix: "unit", kind: "unit" },
1566
+ { prefix: "store", kind: "unit" },
1567
+ { prefix: "interactive-", kind: "unit" },
1568
+ { prefix: "walkable", kind: "walkable" },
1569
+ { prefix: "void", kind: "void" },
1570
+ { prefix: "amenity-", kind: "amenity" },
1571
+ { prefix: "kiosk-", kind: "kiosk_screen" },
1572
+ // Connectors also appear in outdoor artboards (car-park decks, ramps).
1573
+ { prefix: "escalator-", kind: "connector" },
1574
+ { prefix: "elevator-", kind: "connector" },
1575
+ { prefix: "stairs-", kind: "connector" }
1576
+ ];
1577
+ function Yt(t) {
1578
+ const e = st(t);
1579
+ return e === "route path" || e.startsWith("route path ");
1580
+ }
1581
+ function se(t) {
1582
+ return /^routes?( \d+)?$/.test(st(t));
1583
+ }
1584
+ function Bt(t, e) {
1585
+ const n = t.toLowerCase();
1586
+ return n === "line" || n === "polyline" ? !0 : !(n !== "path" || !e || /[zZ]/.test(e) || /[csqtaCSQTA]/.test(e));
1587
+ }
1588
+ const jn = [
1589
+ ...Ee,
1590
+ "walkable",
1591
+ "void"
1592
+ ], qn = 8;
1593
+ function Qn(t, e = "floor") {
1594
+ if (le(t))
1595
+ return { kind: null, guessed: !1 };
1596
+ const n = t.toLowerCase(), r = e === "base" ? Zn : Hn;
1597
+ for (const { prefix: o, kind: i } of r)
1598
+ if (n === o || n.startsWith(o))
1599
+ return { kind: i, guessed: !1 };
1600
+ return n.startsWith("interactive") ? { kind: "unit", guessed: !0 } : { kind: null, guessed: !1 };
1601
+ }
1602
+ function st(t) {
1603
+ return t.toLowerCase().replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
1604
+ }
1605
+ function Ot(t) {
1606
+ return /non[-_ ]?interactive/i.test(t);
1607
+ }
1608
+ function ce(t) {
1609
+ return Ot(t) ? !1 : /^interactive( items)?( \d+)?$/.test(st(t));
1610
+ }
1611
+ function ae(t) {
1612
+ const e = st(t);
1613
+ return e === "stores" || e === "store layer" || e === "units" || e === "unit layer";
1614
+ }
1615
+ function le(t) {
1616
+ return ce(t) || Ot(t) || ae(t) || se(t);
1617
+ }
1618
+ function ht(t) {
1619
+ return t.interactiveContainer || t.nonInteractiveContainer || t.storeFolder || t.routeContainer;
1620
+ }
1621
+ function P(t, e) {
1622
+ const n = t.match(new RegExp(`\\b${e}\\s*=\\s*["']([^"']*)["']`, "i"));
1623
+ return n ? n[1] : null;
1624
+ }
1625
+ function $(t, e) {
1626
+ const n = t.match(new RegExp(`\\b${e}\\s*=\\s*["']?(-?[\\d.]+)`, "i"));
1627
+ return n ? Number(n[1]) : 0;
1628
+ }
1629
+ function zt(t) {
1630
+ return /\bdata-interactive\s*=\s*["']?(true|1|yes)/i.test(t);
1631
+ }
1632
+ function Jn(t) {
1633
+ return [P(t, "id"), P(t, "data-name")].filter(
1634
+ (e) => !!e
1635
+ );
1636
+ }
1637
+ function tr(t) {
1638
+ return t.some(Ot) ? { interactiveContainer: !1, nonInteractiveContainer: !0, storeFolder: !1 } : t.some(ce) ? { interactiveContainer: !0, nonInteractiveContainer: !1, storeFolder: !1 } : t.some(ae) ? { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !0 } : { interactiveContainer: !1, nonInteractiveContainer: !1, storeFolder: !1 };
1639
+ }
1640
+ function er(t) {
1641
+ const e = t.trim().split(/[\s,]+/).map(Number);
1642
+ if (e.length < 4) return "";
1643
+ let n = `M ${e[0]} ${e[1]}`;
1644
+ for (let r = 2; r < e.length; r += 2)
1645
+ n += ` L ${e[r]} ${e[r + 1]}`;
1646
+ return n += " Z", n;
1647
+ }
1648
+ function nr(t, e, n, r) {
1649
+ return `M ${t} ${e} L ${n} ${r}`;
1650
+ }
1651
+ function rr(t, e) {
1652
+ if (t === "path")
1653
+ return P(e, "d") ?? void 0;
1654
+ if (t === "polygon" || t === "polyline") {
1655
+ const n = P(e, "points");
1656
+ return n ? er(n) : void 0;
1657
+ }
1658
+ if (t === "line")
1659
+ return nr(
1660
+ $(e, "x1"),
1661
+ $(e, "y1"),
1662
+ $(e, "x2"),
1663
+ $(e, "y2")
1664
+ );
1665
+ if (t === "rect") {
1666
+ const n = $(e, "x"), r = $(e, "y"), o = $(e, "width"), i = $(e, "height");
1667
+ return `M ${n} ${r} L ${n + o} ${r} L ${n + o} ${r + i} L ${n} ${r + i} Z`;
1668
+ }
1669
+ }
1670
+ function or(t) {
1671
+ const e = zn(t).replace(/<!--[\s\S]*?-->/g, ""), n = e.match(/viewBox\s*=\s*["']([^"']+)["']/i), r = Fn(n == null ? void 0 : n[1]), o = [], i = [], u = [], a = [];
1672
+ let s = 0;
1673
+ const h = () => a.some((m) => m.routeContainer), p = () => {
1674
+ for (let I = a.length - 1; I >= 0; I--) {
1675
+ const k = a[I].style;
1676
+ if (k.fill || k.stroke || k.strokeWidth != null || k.opacity != null)
1677
+ break;
1678
+ }
1679
+ let m = {};
1680
+ for (const I of a)
1681
+ m = ft(m, I.style);
1682
+ return m;
1683
+ }, c = () => {
1684
+ for (let m = a.length - 1; m >= 0; m--) {
1685
+ if (a[m].nonInteractiveContainer) return !1;
1686
+ if (a[m].interactiveContainer || a[m].storeFolder) return !0;
1687
+ }
1688
+ return !1;
1689
+ }, x = () => a.length > 0 ? a[a.length - 1].matrix : xt, l = () => {
1690
+ for (let m = a.length - 1; m >= 0; m--) {
1691
+ const I = a[m];
1692
+ if (!ht(I) && I.id) {
1693
+ I.hasNamedChild = !0;
1694
+ return;
1695
+ }
1696
+ }
1697
+ }, d = () => {
1698
+ for (let m = a.length - 1; m >= 0; m--) {
1699
+ const I = a[m];
1700
+ if (!ht(I) && I.id)
1701
+ return I;
1702
+ }
1703
+ return null;
1704
+ }, f = (m) => {
1705
+ if (m.routeContainer) {
1706
+ for (const I of m.collectedPaths)
1707
+ Bt("path", I) && y("path", I);
1708
+ return;
1709
+ }
1710
+ ht(m) || !m.id || m.collectedPaths.length === 0 || (m.hasNamedChild && u.push(
1711
+ `Group ${m.id} mixes named children with ${m.collectedPaths.length} unnamed path(s); the unnamed paths were merged into a single shape "${m.id}" — give them ids if they are separate shapes`
1712
+ ), o.push({
1713
+ id: m.id,
1714
+ tag: "g",
1715
+ d: m.collectedPaths.join(" "),
1716
+ interactive: m.inInteractive,
1717
+ style: ft(p(), m.style)
1718
+ }));
1719
+ }, y = (m, I) => {
1720
+ if (!I) return;
1721
+ const k = m === "polyline" || m === "polygon" || m === "path" ? I.replace(/\s*Z\s*$/i, "") : I;
1722
+ i.includes(k) || i.push(k);
1723
+ }, b = /<(\/?)(path|polygon|polyline|line|rect|g)\b([^>]*)(\/?)>/gi;
1724
+ let g;
1725
+ for (; (g = b.exec(e)) !== null; ) {
1726
+ const m = g[1] === "/", I = g[2].toLowerCase(), k = g[3] ?? "", S = g[4] === "/" || /\/\s*$/.test(k);
1727
+ if (m) {
1728
+ if (I === "g") {
1729
+ const A = a.pop();
1730
+ A && f(A);
1731
+ }
1732
+ continue;
1733
+ }
1734
+ if (I === "g") {
1735
+ const A = P(k, "id"), B = Jn(k), { interactiveContainer: z, nonInteractiveContainer: M, storeFolder: w } = tr(B), j = c();
1736
+ A && l();
1737
+ const q = {
1738
+ id: A,
1739
+ interactiveContainer: z,
1740
+ nonInteractiveContainer: M,
1741
+ storeFolder: w,
1742
+ inInteractive: z || w || zt(k) || j && !M,
1743
+ collectedPaths: [],
1744
+ style: Ft(k),
1745
+ matrix: H(x(), Kt(P(k, "transform"))),
1746
+ hasNamedChild: !1,
1747
+ routeContainer: B.some(se) || h()
1748
+ };
1749
+ S || a.push(q);
1750
+ continue;
1751
+ }
1752
+ const O = P(k, "id"), C = rr(I, k), L = H(x(), Kt(P(k, "transform"))), R = C && Un(C, L), K = zt(k) || c(), T = ft(p(), Ft(k)), Y = P(k, "data-name");
1753
+ if (h()) {
1754
+ Bt(I, C) && y(I, R);
1755
+ continue;
1756
+ }
1757
+ if (O != null && Yt(O) || Y != null && Yt(Y))
1758
+ continue;
1759
+ if (O) {
1760
+ l(), R && o.push({ id: O, tag: I, d: R, interactive: K, style: T });
1761
+ continue;
1762
+ }
1763
+ if (!R) continue;
1764
+ const v = d();
1765
+ v ? (v.collectedPaths.push(R), !v.style.fill && T.fill && (v.style = T)) : K && (s += 1, o.push({
1766
+ id: `interactive-anon-${s}`,
1767
+ tag: I,
1768
+ d: R,
1769
+ interactive: !0,
1770
+ style: T
1771
+ }));
1772
+ }
1773
+ for (; a.length > 0; )
1774
+ f(a.pop());
1775
+ return { viewbox: r, elements: o, routePathDs: i, warnings: u };
1776
+ }
1777
+ function ir(t) {
1778
+ return t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 80);
1779
+ }
1780
+ function sr(t, e) {
1781
+ var o, i, u, a;
1782
+ const n = rt(e), r = {};
1783
+ return n != null && n.fill ? r.fill = n.fill : (o = t.style) != null && o.fill && (r.fill = t.style.fill), n != null && n.stroke ? r.stroke = n.stroke : (i = t.style) != null && i.stroke && (r.stroke = t.style.stroke), (n == null ? void 0 : n.strokeWidth) != null ? r.strokeWidth = n.strokeWidth : ((u = t.style) == null ? void 0 : u.strokeWidth) != null && (r.strokeWidth = t.style.strokeWidth), ((a = t.style) == null ? void 0 : a.opacity) != null && (r.opacity = t.style.opacity), (n == null ? void 0 : n.extrudeHeight) != null && (r.extrudeHeight = n.extrudeHeight), r;
1784
+ }
1785
+ function cr(t, e) {
1786
+ 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;
1787
+ }
1788
+ function $o(t, e = "floor", n = {}) {
1789
+ const r = or(t), o = [], i = [], u = [], a = [...r.warnings], s = [];
1790
+ let h = 0, p = 0, c = 0;
1791
+ const x = n.previousViewbox != null && r.viewbox != null && !cr(n.previousViewbox, r.viewbox);
1792
+ x && a.push(
1793
+ "SVG viewBox differs from the stored artboard — re-upload blocked until the designer restores the original viewBox"
1794
+ );
1795
+ for (const l of r.elements) {
1796
+ if (le(l.id)) continue;
1797
+ let { kind: d, guessed: f } = Qn(l.id, e);
1798
+ l.interactive && !d && (d = "unit", f = !0);
1799
+ const y = {
1800
+ sourceSvgId: l.id,
1801
+ kind: d,
1802
+ guessed: f
1803
+ };
1804
+ if (!d)
1805
+ if (i.push(l.id), e === "floor")
1806
+ d = "decor", y.kind = "decor", y.message = "No matching prefix; imported as decor (floor mode)";
1807
+ else {
1808
+ y.message = "No matching prefix; skipped (outdoor decor stays in SVG)", o.push(y);
1809
+ continue;
1810
+ }
1811
+ if (!l.d) {
1812
+ a.push(`Element ${l.id} has no drawable geometry`);
1813
+ continue;
1814
+ }
1815
+ if (e === "base") {
1816
+ const m = rt(l.id) != null;
1817
+ if (!(!m && (jn.includes(d) || !!l.interactive))) {
1818
+ o.push({
1819
+ ...y,
1820
+ message: m ? "Static decoration — rendered from outdoor SVG" : "Decoration — not persisted; rendered from outdoor SVG"
1821
+ });
1822
+ continue;
1823
+ }
1824
+ }
1825
+ f && (u.push(y), y.message = y.message ?? "Guessed kind from interactive/fallback rule"), o.push(y), d === "walkable" && h++, d === "void" && p++, d === "unit" && c++;
1826
+ const b = wn([l.d]), g = _t(b);
1827
+ s.push({
1828
+ key: ir(l.id),
1829
+ kind: d,
1830
+ geometry: b,
1831
+ bbox: g,
1832
+ sourceSvgId: l.id,
1833
+ style: sr(l, l.id)
1834
+ });
1835
+ }
1836
+ return e === "floor" && h === 0 && a.push(
1837
+ "No walkable layer found — auto-skeleton will be unavailable for this level"
1838
+ ), {
1839
+ report: {
1840
+ classified: o,
1841
+ unrecognized: i,
1842
+ guessed: u,
1843
+ walkableCount: h,
1844
+ voidCount: p,
1845
+ unitCount: c,
1846
+ warnings: a
1847
+ },
1848
+ shapes: s,
1849
+ viewbox: r.viewbox,
1850
+ routePathDs: r.routePathDs,
1851
+ viewBoxChanged: x
1852
+ };
1853
+ }
1854
+ function Go(t, e, n, r = {}) {
1855
+ const o = r.driftThreshold ?? qn, i = new Map(
1856
+ e.filter((s) => s.sourceSvgId).map((s) => [s.sourceSvgId, s])
1857
+ ), u = /* @__PURE__ */ new Set(), a = [];
1858
+ for (const s of t) {
1859
+ const h = i.get(s.sourceSvgId);
1860
+ if (u.add(s.sourceSvgId), !h)
1861
+ a.push({
1862
+ sourceSvgId: s.sourceSvgId,
1863
+ change: "added",
1864
+ newKind: s.kind
1865
+ });
1866
+ else if (h.kind !== s.kind)
1867
+ a.push({
1868
+ sourceSvgId: s.sourceSvgId,
1869
+ change: "kind_changed",
1870
+ existingShapeId: h.id,
1871
+ existingKind: h.kind,
1872
+ newKind: s.kind,
1873
+ preserve: { key: h.key, assignment: !0, anchors: !0 },
1874
+ geometryLocked: h.geometryLocked
1875
+ });
1876
+ else {
1877
+ let p = "unchanged";
1878
+ if (h.bbox) {
1879
+ const c = (h.bbox.minX + h.bbox.maxX) / 2, x = (h.bbox.minY + h.bbox.maxY) / 2, l = Pn(s.geometry);
1880
+ Math.hypot(l.x - c, l.y - x) > o && (p = "moved");
1881
+ }
1882
+ a.push({
1883
+ sourceSvgId: s.sourceSvgId,
1884
+ change: p,
1885
+ existingShapeId: h.id,
1886
+ existingKind: h.kind,
1887
+ newKind: s.kind,
1888
+ preserve: { key: h.key, assignment: !0, anchors: !0 },
1889
+ geometryLocked: h.geometryLocked
1890
+ });
1891
+ }
1892
+ }
1893
+ for (const s of e)
1894
+ s.sourceSvgId && !u.has(s.sourceSvgId) && a.push({
1895
+ sourceSvgId: s.sourceSvgId,
1896
+ change: "removed",
1897
+ existingShapeId: s.id,
1898
+ existingKind: s.kind,
1899
+ geometryLocked: s.geometryLocked
1900
+ });
1901
+ return {
1902
+ items: a,
1903
+ shapes: t,
1904
+ viewbox: n
1905
+ };
1906
+ }
1907
+ const E = 1e-6, ar = 15 * Math.PI / 180, lr = 1e-3, tt = Math.PI * 2;
1908
+ function $t(t, e) {
1909
+ return Math.abs(t.x - e.x) < E && Math.abs(t.y - e.y) < E;
1910
+ }
1911
+ function yt(t, e) {
1912
+ return { x: t.x + e.x, y: t.y + e.y };
1913
+ }
1914
+ function Gt(t, e) {
1915
+ return { x: t.x - e.x, y: t.y - e.y };
1916
+ }
1917
+ function et(t, e) {
1918
+ return { x: t.x * e, y: t.y * e };
1919
+ }
1920
+ function pt(t, e, n) {
1921
+ return {
1922
+ x: t.x + Math.cos(n) * e,
1923
+ y: t.y + Math.sin(n) * e
1924
+ };
1925
+ }
1926
+ function ur(t) {
1927
+ const e = [];
1928
+ for (const n of t) {
1929
+ const r = e[e.length - 1];
1930
+ r && $t(r, n) || e.push(n);
1931
+ }
1932
+ return e.length >= 2 && $t(e[0], e[e.length - 1]) && e.pop(), e;
1933
+ }
1934
+ function Xo(t, e) {
1935
+ const n = Zt(e), r = ur(t);
1936
+ if (r.length < 3 || n <= 0) return t;
1937
+ const o = r.length, i = new Array(o), u = new Array(o), a = new Array(o), s = new Array(o), h = new Array(o).fill(0), p = new Array(o).fill(0), c = new Array(o).fill(!1);
1938
+ for (let l = 0; l < o; l++) {
1939
+ const d = r[(l - 1 + o) % o], f = r[l], y = r[(l + 1) % o], b = D(d, f), g = D(f, y);
1940
+ if (a[l] = g, b < E || g < E) {
1941
+ i[l] = { x: 1, y: 0 }, u[l] = { x: 1, y: 0 }, s[l] = 0;
1942
+ continue;
1943
+ }
1944
+ i[l] = et(Gt(f, d), 1 / b), u[l] = et(Gt(y, f), 1 / g);
1945
+ const m = i[l].x * u[l].y - i[l].y * u[l].x, I = i[l].x * u[l].x + i[l].y * u[l].y;
1946
+ s[l] = Math.atan2(m, I);
1947
+ const k = Math.abs(s[l]);
1948
+ if (k < ar) continue;
1949
+ const S = Math.PI - k, O = Math.tan(S / 2);
1950
+ if (O < E || S <= E || S >= Math.PI - E) continue;
1951
+ const C = n / O;
1952
+ h[l] = C, p[l] = C, c[l] = !0;
1953
+ }
1954
+ for (let l = 0; l < o; l++) {
1955
+ const d = (l + 1) % o, f = p[l] + h[d], y = Math.max(0, a[l] - lr);
1956
+ if (f <= y || f <= E) continue;
1957
+ const b = y / f;
1958
+ p[l] *= b, h[d] *= b;
1959
+ }
1960
+ const x = [];
1961
+ for (let l = 0; l < o; l++) {
1962
+ const d = r[l], f = Math.min(h[l], p[l]), y = Math.abs(s[l]), b = Math.PI - y, g = f * Math.tan(b / 2);
1963
+ if (!c[l] || g < E || f < E) {
1964
+ x.push({ ...d });
1965
+ continue;
1966
+ }
1967
+ const m = yt(d, et(i[l], -f)), I = yt(d, et(u[l], f)), k = s[l] > 0 ? 1 : -1, S = yt(m, {
1968
+ x: -i[l].y * k * g,
1969
+ y: i[l].x * k * g
1970
+ }), O = Math.atan2(m.y - S.y, m.x - S.x), C = Math.atan2(I.y - S.y, I.x - S.x), L = (C - O + tt) % tt, R = (O - C + tt) % tt, K = pt(S, g, O + L / 2), T = pt(S, g, O - R / 2), Y = D(K, d) <= D(T, d), v = Y ? L : R, A = Math.max(8, Math.min(28, Math.ceil(v * g / 2)));
1971
+ for (let B = 0; B <= A; B++) {
1972
+ const z = B / A, M = Y ? O + v * z : O - v * z;
1973
+ x.push(pt(S, g, M));
1974
+ }
1975
+ }
1976
+ return x;
1977
+ }
1978
+ function fr(t, e, n) {
1979
+ const r = t.connectorId ?? e.connectorId;
1980
+ return r == null ? void 0 : n.get(r);
1981
+ }
1982
+ function dr(t, e, n, r) {
1983
+ var o;
1984
+ return e.levelId === n.levelId ? !0 : t.kind !== "connector" ? !1 : _e(
1985
+ (o = fr(e, n, r)) == null ? void 0 : o.kind
1986
+ );
1987
+ }
1988
+ function hr(t, e, n = []) {
1989
+ const r = fe(), o = new Map(t.map((s) => [s.id, s])), i = new Map(n.map((s) => [s.id, s])), u = t.map((s) => ({
1990
+ id: s.id,
1991
+ levelId: s.levelId,
1992
+ x: s.x,
1993
+ y: s.y,
1994
+ kind: s.kind,
1995
+ shapeId: s.shapeId,
1996
+ connectorId: s.connectorId
1997
+ }));
1998
+ for (const s of u)
1999
+ r.addNode(s.id, s);
2000
+ const a = [];
2001
+ for (const s of e) {
2002
+ const h = o.get(s.fromAnchorId), p = o.get(s.toAnchorId);
2003
+ if (!h || !p || !dr(s, h, p, i)) continue;
2004
+ let c = s.weight;
2005
+ c == null && (c = D(h, p), h.levelId !== p.levelId && (c += mt));
2006
+ let x = s.accessible;
2007
+ if (s.kind === "connector" && h.connectorId != null) {
2008
+ const d = i.get(h.connectorId);
2009
+ d && (x = d.accessible);
2010
+ }
2011
+ const l = {
2012
+ id: s.id,
2013
+ from: s.fromAnchorId,
2014
+ to: s.toAnchorId,
2015
+ weight: c,
2016
+ directed: s.directed,
2017
+ accessible: x,
2018
+ kind: s.kind
2019
+ };
2020
+ a.push(l), r.addLink(s.fromAnchorId, s.toAnchorId, l), s.directed || r.addLink(s.toAnchorId, s.fromAnchorId, l);
2021
+ }
2022
+ return { graph: r, nodes: u, edges: a, anchorById: o };
2023
+ }
2024
+ function yr(t, e, n, r = {}) {
2025
+ const { graph: o, anchorById: i } = t;
2026
+ if (!i.has(e) || !i.has(n))
2027
+ return null;
2028
+ const a = de.nba(o, {
2029
+ oriented: !0,
2030
+ distance(l, d, f) {
2031
+ const y = f.data;
2032
+ return r.accessibleOnly && y && !y.accessible ? Number.POSITIVE_INFINITY : (y == null ? void 0 : y.weight) ?? 1;
2033
+ },
2034
+ heuristic(l, d) {
2035
+ const f = i.get(l.id), y = i.get(d.id);
2036
+ if (!f || !y) return 0;
2037
+ let b = D(f, y);
2038
+ return f.levelId !== y.levelId && (b += mt), b;
2039
+ }
2040
+ }).find(e, n);
2041
+ if (!a || a.length === 0) return null;
2042
+ const h = a.reverse().map((l) => l.id), p = [], c = [];
2043
+ let x = 0;
2044
+ for (let l = 0; l < h.length; l++) {
2045
+ const d = i.get(h[l]);
2046
+ if (p.push({ x: d.x, y: d.y, levelId: d.levelId }), l > 0) {
2047
+ const f = i.get(h[l - 1]);
2048
+ x += D(f, d), f.levelId !== d.levelId && (x += mt, c.push({
2049
+ fromLevelId: f.levelId,
2050
+ toLevelId: d.levelId,
2051
+ connectorId: d.connectorId ?? f.connectorId
2052
+ }));
2053
+ }
2054
+ }
2055
+ return { anchorIds: h, points: p, totalWeight: x, levelChanges: c };
2056
+ }
2057
+ function bt(t) {
2058
+ const e = /* @__PURE__ */ new Set(), n = [];
2059
+ for (const r of t)
2060
+ !Number.isFinite(r) || e.has(r) || (e.add(r), n.push(r));
2061
+ return n;
2062
+ }
2063
+ function Wo(t, e) {
2064
+ return t.filter((n) => n.shapeId === e).map((n) => n.id);
2065
+ }
2066
+ function Vo(t, e) {
2067
+ const n = [];
2068
+ for (const r of t) {
2069
+ const o = /* @__PURE__ */ new Set();
2070
+ for (const i of r.shapes)
2071
+ e(i) && o.add(i.id);
2072
+ if (o.size !== 0)
2073
+ for (const i of r.anchors)
2074
+ i.shapeId != null && o.has(i.shapeId) && n.push(i.id);
2075
+ }
2076
+ return n;
2077
+ }
2078
+ function pr(t, e) {
2079
+ const n = t.anchorById.get(e);
2080
+ if (!n) return [];
2081
+ if (n.shapeId == null) return [e];
2082
+ const r = t.nodes.filter((o) => o.shapeId === n.shapeId).map((o) => o.id);
2083
+ return r.length > 0 ? r : [e];
2084
+ }
2085
+ function Xt(t, e) {
2086
+ const n = /* @__PURE__ */ new Set();
2087
+ for (const r of bt(e))
2088
+ for (const o of pr(t, r))
2089
+ n.add(o);
2090
+ return [...n];
2091
+ }
2092
+ function mr(t, e, n, r = {}) {
2093
+ const o = bt(e), i = bt(n);
2094
+ if (o.length === 0 || i.length === 0) return null;
2095
+ let u = null;
2096
+ for (const a of o)
2097
+ for (const s of i) {
2098
+ const h = yr(t, a, s, r);
2099
+ h && (!u || h.totalWeight < u.totalWeight) && (u = h);
2100
+ }
2101
+ return u;
2102
+ }
2103
+ function xr(t, e, n, r = {}) {
2104
+ return mr(
2105
+ t,
2106
+ Xt(t, e),
2107
+ Xt(t, n),
2108
+ r
2109
+ );
2110
+ }
2111
+ function Uo(t, e, n, r = {}) {
2112
+ return xr(
2113
+ t,
2114
+ [e],
2115
+ n,
2116
+ r
2117
+ );
2118
+ }
2119
+ function Ho(t) {
2120
+ const e = ve(t.theme), n = new Map(
2121
+ t.assignments.map((s) => [s.shapeId, s])
2122
+ ), r = new Map(
2123
+ (t.retailers ?? []).map((s) => [s.id, s])
2124
+ ), o = t.resolveSvgUrl ?? ((s) => s), i = t.levels.filter((s) => s.isActive).sort((s, h) => s.ordering - h.ordering).map((s) => {
2125
+ const h = t.shapes.filter((c) => c.levelId === s.id).map((c) => {
2126
+ const x = ie(c.geometry), l = n.get(c.id) ?? null, d = (l == null ? void 0 : l.retailerId) != null ? r.get(l.retailerId) ?? null : null, f = d && !t.persistMediaKeys ? { ...d, logoKey: null } : d;
2127
+ return {
2128
+ ...c,
2129
+ geometry: x,
2130
+ bbox: x === c.geometry ? c.bbox : _t(x),
2131
+ assignment: l,
2132
+ label: qt(c, l, f)
2133
+ };
2134
+ }), p = t.anchors.filter((c) => c.levelId === s.id);
2135
+ return {
2136
+ id: s.id,
2137
+ buildingId: s.buildingId,
2138
+ kind: s.kind,
2139
+ name: s.name,
2140
+ levelIndex: s.levelIndex,
2141
+ ordering: s.ordering,
2142
+ sourceSvgUrl: o(s.sourceSvgKey) ?? s.sourceSvgUrl ?? null,
2143
+ viewbox: s.sourceViewbox,
2144
+ transform: s.transform,
2145
+ shapes: h,
2146
+ anchors: p
2147
+ };
2148
+ }), { nodes: u, edges: a } = hr(
2149
+ t.anchors,
2150
+ t.edges,
2151
+ t.connectors
2152
+ );
2153
+ return {
2154
+ version: 2,
2155
+ revisionId: t.revisionId,
2156
+ revisionNumber: t.revisionNumber,
2157
+ centerId: t.centerId,
2158
+ mapId: t.mapId,
2159
+ theme: e,
2160
+ baseSvgUrl: t.baseSvgUrl,
2161
+ baseViewbox: t.baseViewbox,
2162
+ buildings: t.buildings,
2163
+ levels: i,
2164
+ connectors: t.connectors,
2165
+ amenities: t.amenities.filter((s) => s.isActive),
2166
+ retailers: (t.retailers ?? []).map(
2167
+ (s) => br(s, !!t.persistMediaKeys)
2168
+ ),
2169
+ graph: { nodes: u, edges: a },
2170
+ responsiveOverrides: t.responsiveOverrides,
2171
+ publishedAt: t.publishedAt ?? (/* @__PURE__ */ new Date()).toISOString()
2172
+ };
2173
+ }
2174
+ function br(t, e) {
2175
+ return {
2176
+ id: t.id,
2177
+ name: t.name,
2178
+ location: t.location ?? null,
2179
+ logoUrl: e ? null : t.logoUrl ?? null,
2180
+ logoKey: e ? t.logoKey ?? null : null,
2181
+ phone: t.phone ?? null,
2182
+ description: t.description ?? null,
2183
+ globalRetailerId: t.globalRetailerId ?? null
2184
+ };
2185
+ }
2186
+ function Zo(t) {
2187
+ let e = !1;
2188
+ const n = t.levels.map((r) => {
2189
+ let o = !1;
2190
+ const i = r.shapes.map((u) => {
2191
+ const a = ie(u.geometry), s = qt(u, u.assignment), h = a !== u.geometry, p = s !== u.label;
2192
+ return !h && !p ? u : (o = !0, {
2193
+ ...u,
2194
+ geometry: a,
2195
+ bbox: h ? _t(a) : u.bbox,
2196
+ label: s
2197
+ });
2198
+ });
2199
+ return o ? (e = !0, { ...r, shapes: i }) : r;
2200
+ });
2201
+ return e ? { ...t, levels: n } : t;
2202
+ }
2203
+ const jo = [
2204
+ "admin_portal",
2205
+ "desktop",
2206
+ "tablet",
2207
+ "mobile",
2208
+ "display_app"
2209
+ ], qo = [
2210
+ { id: "admin_portal", label: "Admin Portal" },
2211
+ { id: "desktop", label: "Desktop" },
2212
+ { id: "tablet", label: "Tablet" },
2213
+ { id: "mobile", label: "Mobile" },
2214
+ { id: "display_app", label: "Kiosk App" }
2215
+ ], Ir = 1024, gr = 767;
2216
+ function Qo(t) {
2217
+ return t === "admin_portal" || t === "display_app" || t === "desktop" || t === "tablet" || t === "mobile";
2218
+ }
2219
+ function Jo(t, e) {
2220
+ return t === "PORTAL_ASSIGN" ? "admin_portal" : t === "DISPLAY_APP" ? "display_app" : e > Ir ? "desktop" : e > gr ? "tablet" : "mobile";
2221
+ }
2222
+ function kr(t, e) {
2223
+ return `${t ?? "none"}:${e}`;
2224
+ }
2225
+ function ti(t, e, n) {
2226
+ return `${n ? "capture" : "viewer"}:${kr(t, e)}`;
2227
+ }
2228
+ function Wt(t) {
2229
+ return t ? t.x === 0 && t.y === 0 && t.z === 0 : !0;
2230
+ }
2231
+ function ue(t) {
2232
+ var n;
2233
+ if (!t) return !0;
2234
+ const e = (n = t.camera) == null ? void 0 : n.zoom;
2235
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? !1 : Wt(t.camera) && Wt(t.controls);
2236
+ }
2237
+ function ei(t, e, n) {
2238
+ if (!(t != null && t.length) || e == null) return null;
2239
+ const r = t.find(
2240
+ (o) => o.levelId === e && o.device === n
2241
+ );
2242
+ return !r || ue(r) ? null : r;
2243
+ }
2244
+ function ni(t) {
2245
+ const e = t.camera.zoom;
2246
+ return {
2247
+ zoom: typeof e == "number" && Number.isFinite(e) && e > 0 ? e : 0,
2248
+ position: [t.camera.x, t.camera.y, t.camera.z],
2249
+ target: [t.controls.x, t.controls.y, t.controls.z]
2250
+ };
2251
+ }
2252
+ function ri(t) {
2253
+ return {
2254
+ camera: {
2255
+ x: t.position[0],
2256
+ y: t.position[1],
2257
+ z: t.position[2],
2258
+ zoom: t.zoom
2259
+ },
2260
+ controls: {
2261
+ x: t.target[0],
2262
+ y: t.target[1],
2263
+ z: t.target[2]
2264
+ }
2265
+ };
2266
+ }
2267
+ const _r = {
2268
+ x: 0,
2269
+ y: 0,
2270
+ z: 0,
2271
+ zoom: 0
2272
+ }, Or = { x: 0, y: 0, z: 0 };
2273
+ function oi(t, e) {
2274
+ return {
2275
+ levelId: t,
2276
+ device: e,
2277
+ camera: { ..._r },
2278
+ controls: { ...Or }
2279
+ };
2280
+ }
2281
+ function Sr(t, e) {
2282
+ const n = {
2283
+ id: e.id ?? 0,
2284
+ mapId: e.mapId ?? 0,
2285
+ levelId: e.levelId,
2286
+ device: e.device,
2287
+ camera: e.camera,
2288
+ controls: e.controls
2289
+ }, r = t.findIndex(
2290
+ (i) => i.levelId === e.levelId && i.device === e.device
2291
+ );
2292
+ if (r < 0) return [...t, n];
2293
+ const o = t.slice();
2294
+ return o[r] = {
2295
+ ...t[r],
2296
+ ...n,
2297
+ id: e.id ?? t[r].id,
2298
+ mapId: e.mapId ?? t[r].mapId
2299
+ }, o;
2300
+ }
2301
+ function ii(t, e) {
2302
+ let n = t;
2303
+ for (const r of e) {
2304
+ if (ue(r)) {
2305
+ n = n.filter(
2306
+ (o) => !(o.levelId === r.levelId && o.device === r.device)
2307
+ );
2308
+ continue;
2309
+ }
2310
+ n = Sr(n, r);
2311
+ }
2312
+ return n;
2313
+ }
2314
+ export {
2315
+ Qr as $,
2316
+ De as A,
2317
+ zo as B,
2318
+ Pe as C,
2319
+ ot as D,
2320
+ _r as E,
2321
+ mt as F,
2322
+ to as G,
2323
+ an as H,
2324
+ Rr as I,
2325
+ $n as J,
2326
+ En as K,
2327
+ Pr as L,
2328
+ fo as M,
2329
+ wt as N,
2330
+ oo as O,
2331
+ Pt as P,
2332
+ Be as Q,
2333
+ Ir as R,
2334
+ Ze as S,
2335
+ It as T,
2336
+ Ve as U,
2337
+ Er as V,
2338
+ Vt as W,
2339
+ N as X,
2340
+ Xe as Y,
2341
+ Qt as Z,
2342
+ Ue as _,
2343
+ Tr as a,
2344
+ se as a$,
2345
+ Xr as a0,
2346
+ jr as a1,
2347
+ Lt as a2,
2348
+ Cn as a3,
2349
+ Do as a4,
2350
+ ho as a5,
2351
+ wn as a6,
2352
+ Jr as a7,
2353
+ jt as a8,
2354
+ An as a9,
2355
+ Fo as aA,
2356
+ lo as aB,
2357
+ it as aC,
2358
+ Lo as aD,
2359
+ _t as aE,
2360
+ Pn as aF,
2361
+ on as aG,
2362
+ sn as aH,
2363
+ Je as aI,
2364
+ ro as aJ,
2365
+ $o as aK,
2366
+ zn as aL,
2367
+ Jt as aM,
2368
+ To as aN,
2369
+ $e as aO,
2370
+ Qo as aP,
2371
+ ue as aQ,
2372
+ Wt as aR,
2373
+ Me as aS,
2374
+ Te as aT,
2375
+ Mn as aU,
2376
+ Gn as aV,
2377
+ ce as aW,
2378
+ le as aX,
2379
+ xo as aY,
2380
+ Ot as aZ,
2381
+ U as a_,
2382
+ wr as aa,
2383
+ Zt as ab,
2384
+ Qn as ac,
2385
+ Yr as ad,
2386
+ en as ae,
2387
+ Ho as af,
2388
+ hr as ag,
2389
+ qr as ah,
2390
+ gt as ai,
2391
+ Br as aj,
2392
+ cn as ak,
2393
+ Jo as al,
2394
+ Go as am,
2395
+ D as an,
2396
+ oi as ao,
2397
+ zr as ap,
2398
+ Tt as aq,
2399
+ Xt as ar,
2400
+ Xo as as,
2401
+ Uo as at,
2402
+ yr as au,
2403
+ hn as av,
2404
+ ei as aw,
2405
+ mr as ax,
2406
+ xr as ay,
2407
+ ko as az,
2408
+ we as b,
2409
+ pr as b$,
2410
+ Bt as b0,
2411
+ Yt as b1,
2412
+ eo as b2,
2413
+ ae as b3,
2414
+ Z as b4,
2415
+ kt as b5,
2416
+ _e as b6,
2417
+ dn as b7,
2418
+ je as b8,
2419
+ Zr as b9,
2420
+ oe as bA,
2421
+ Rn as bB,
2422
+ Ko as bC,
2423
+ Et as bD,
2424
+ vt as bE,
2425
+ tn as bF,
2426
+ ri as bG,
2427
+ Ln as bH,
2428
+ qt as bI,
2429
+ Ft as bJ,
2430
+ Po as bK,
2431
+ rt as bL,
2432
+ Ie as bM,
2433
+ At as bN,
2434
+ Vr as bO,
2435
+ Wr as bP,
2436
+ On as bQ,
2437
+ Mo as bR,
2438
+ kr as bS,
2439
+ ti as bT,
2440
+ Gr as bU,
2441
+ rn as bV,
2442
+ Qe as bW,
2443
+ ln as bX,
2444
+ Wo as bY,
2445
+ Sn as bZ,
2446
+ uo as b_,
2447
+ Dr as ba,
2448
+ Kr as bb,
2449
+ qe as bc,
2450
+ po as bd,
2451
+ Vo as be,
2452
+ Mr as bf,
2453
+ ft as bg,
2454
+ ii as bh,
2455
+ ve as bi,
2456
+ H as bj,
2457
+ Yo as bk,
2458
+ co as bl,
2459
+ ie as bm,
2460
+ Fr as bn,
2461
+ st as bo,
2462
+ Ht as bp,
2463
+ Zo as bq,
2464
+ vo as br,
2465
+ Ct as bs,
2466
+ vr as bt,
2467
+ ni as bu,
2468
+ Ur as bv,
2469
+ $r as bw,
2470
+ or as bx,
2471
+ Kt as by,
2472
+ Fn as bz,
2473
+ W as c,
2474
+ Bo as c0,
2475
+ Lr as c1,
2476
+ _n as c2,
2477
+ xe as c3,
2478
+ X as c4,
2479
+ me as c5,
2480
+ ke as c6,
2481
+ re as c7,
2482
+ Un as c8,
2483
+ yo as c9,
2484
+ bt as ca,
2485
+ ur as cb,
2486
+ Sr as cc,
2487
+ Nt as cd,
2488
+ mo as ce,
2489
+ bo as cf,
2490
+ te as cg,
2491
+ ee as ch,
2492
+ bn as ci,
2493
+ go as cj,
2494
+ ao as ck,
2495
+ nn as cl,
2496
+ fn as cm,
2497
+ _o as cn,
2498
+ gn as co,
2499
+ wo as cp,
2500
+ Eo as cq,
2501
+ No as cr,
2502
+ Io as cs,
2503
+ xn as ct,
2504
+ no as cu,
2505
+ Oo as cv,
2506
+ So as cw,
2507
+ Ao as cx,
2508
+ Ro as cy,
2509
+ Co as cz,
2510
+ Nr as d,
2511
+ Or as e,
2512
+ nt as f,
2513
+ xt as g,
2514
+ qn as h,
2515
+ jn as i,
2516
+ Ee as j,
2517
+ Ne as k,
2518
+ so as l,
2519
+ io as m,
2520
+ pe as n,
2521
+ jo as o,
2522
+ qo as p,
2523
+ gr as q,
2524
+ Fe as r,
2525
+ ne as s,
2526
+ ct as t,
2527
+ he as u,
2528
+ Ut as v,
2529
+ ye as w,
2530
+ dr as x,
2531
+ Hr as y,
2532
+ kn as z
2533
+ };
2534
+ //# sourceMappingURL=responsive.js.map