@expofp/floorplan 3.44.8 → 3.45.0

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 (131) hide show
  1. package/dist/browser/{Button-C1iQgU3z.js → Button-6lV64H09.js} +5 -5
  2. package/dist/browser/{CookieConsent-Dv1LCPG3.js → CookieConsent-k11VHxoM.js} +7 -7
  3. package/dist/browser/{Debug-DPy0A0cw.js → Debug-DbfbGWb0.js} +7 -7
  4. package/dist/browser/{DebugTools-Dp8d4gPZ.js → DebugTools-BjHOBi_k.js} +6 -6
  5. package/dist/browser/{Demo-CHH4a7sZ.js → Demo-CrFjKybB.js} +9 -9
  6. package/dist/browser/{Free-BidfuRjG.js → Free-4IN6GHrY.js} +10 -10
  7. package/dist/browser/{GalleryContainer-7IYWWKkK.js → GalleryContainer-BWd-8Nhp.js} +11 -11
  8. package/dist/browser/{GpsLoader-CrO61Fpj.js → GpsLoader-C43ADyfU.js} +13 -13
  9. package/dist/browser/{KioskStore-BE_V60tp.js → KioskStore-0xBjJ9AG.js} +14 -20
  10. package/dist/browser/{LayerStore-BM7GOQ3J.js → LayerStore-BifpIwHB.js} +3726 -3220
  11. package/dist/browser/{MaplibreAdapter-DmrCTw3Q.js → MaplibreAdapter-CxETR3-R.js} +2517 -2517
  12. package/dist/browser/{ModalContainer-DqsSRv60.js → ModalContainer-IvkrtwT_.js} +10 -10
  13. package/dist/browser/{PermissionNotice--Vn_MkaQ.js → PermissionNotice-C4Nu1dPO.js} +6 -6
  14. package/dist/browser/{RouteStore-D7G9YROM.js → RouteStore-ltbgXRLP.js} +28 -28
  15. package/dist/browser/{SetKioskMode-CMndo5d3.js → SetKioskMode-BWzFzO_Q.js} +12 -12
  16. package/dist/browser/{ShowKiosk-CUiprdS9.js → ShowKiosk-BYOTTOrX.js} +10 -10
  17. package/dist/browser/{UIState-D0GHKRf4.js → UIState-BG-A7rPb.js} +230 -230
  18. package/dist/browser/{ViewerMenuPanel-B7corw44.js → ViewerMenuPanel-DscD3jCY.js} +11 -11
  19. package/dist/browser/{add-debug-secret-listener-uMLIuPW5.js → add-debug-secret-listener-qgQOxLV_.js} +1 -1
  20. package/dist/browser/{adopt-global-settings-BVVdz-YX.js → adopt-global-settings-CB1YrOJs.js} +9 -9
  21. package/dist/browser/{boolean-editor-Dg3cfoLy.js → boolean-editor-DcFqYLg6.js} +9 -9
  22. package/dist/browser/{bootIntercom-7FTJ0piX.js → bootIntercom-DJEOZaFU.js} +2 -2
  23. package/dist/browser/bundle.json +87 -87
  24. package/dist/browser/{camera-events-DbYubA01.js → camera-events-BwP3bfY4.js} +1 -1
  25. package/dist/browser/{classnames-BryLpfgQ.js → classnames-C6CE8V3C.js} +2 -2
  26. package/dist/browser/{client-DnnJr0Ks.js → client-B42ooBdH.js} +5 -5
  27. package/dist/browser/{components-DHNMQbqJ.js → components-DelXq6ex.js} +461 -461
  28. package/dist/browser/{create-live-plan-BgCjK-Kh.js → create-live-plan-jO-YW94S.js} +263 -245
  29. package/dist/browser/{debug-context-BEABO7OL.js → debug-context-BFAUm0Rv.js} +5 -5
  30. package/dist/browser/{debug-overlay-Bv-C1rmT.js → debug-overlay-0pLu5_hz.js} +10 -10
  31. package/dist/browser/{debug-ui-FirQ0EQb.js → debug-ui-CPF3Fr0y.js} +6 -6
  32. package/dist/browser/{dist-sup8YcEL.js → dist-5MtJlmvC.js} +5 -5
  33. package/dist/browser/{dist-p14a9te8.js → dist-BImkgFoY.js} +6 -6
  34. package/dist/browser/{dist-DN5ATV5p.js → dist-D7lv86ly.js} +3 -3
  35. package/dist/browser/{efp-debug-init-DUPmVtYg.js → efp-debug-init-DBnQHIuj.js} +3 -3
  36. package/dist/browser/{enum-editor-g46R4Zq7.js → enum-editor-wagTer9Z.js} +4 -4
  37. package/dist/browser/{es5-D_WEVRPo.js → es5-ClZJZH3H.js} +2 -2
  38. package/dist/browser/{event-head-DBemDpob.js → event-head-Dvg64Dl9.js} +1 -1
  39. package/dist/browser/{event-not-found-m_QUX3nl.js → event-not-found-CmHnmais.js} +3 -3
  40. package/dist/browser/{event-scoped-cache-BpjbCC59.js → event-scoped-cache-blYstzYW.js} +2 -2
  41. package/dist/browser/{expofpUrl-CAOzqFzt.js → expofpUrl-D99TqyHD.js} +1 -1
  42. package/dist/browser/{exports-svWN4mLB.js → exports-BBJtyyI0.js} +1 -1
  43. package/dist/browser/{favicon-hR5BaEm4.js → favicon-Bac0ZnSB.js} +1 -1
  44. package/dist/browser/{fetch-retry.umd-DS-5XmpN.js → fetch-retry.umd-Dkr69k7z.js} +2 -2
  45. package/dist/browser/{flex-BAz1Zlx4.js → flex-2znF0sHW.js} +5 -5
  46. package/dist/browser/{floorplan.loader-DPHmWNvd.js → floorplan.loader-B2NptbPQ.js} +12 -12
  47. package/dist/browser/{floorplan.ready-clG372Lo.js → floorplan.ready-DTyG-lkM.js} +344 -335
  48. package/dist/browser/{freeBanner-D0nU1aT0.js → freeBanner-yyOqSdAy.js} +2 -2
  49. package/dist/browser/{fuse-DFf-hk6f.js → fuse-x_QTzSiL.js} +2 -2
  50. package/dist/browser/{i18n-CPJmxFQX.js → i18n-CLEztXjo.js} +6 -6
  51. package/dist/browser/index.js +17 -17
  52. package/dist/browser/{index.module-COSPv-bu.js → index.module-C9C4kJk7.js} +4 -4
  53. package/dist/browser/{init-ui-Cj38w8tb.js → init-ui-rxZzKF4X.js} +16 -16
  54. package/dist/browser/{integrateKiosk-Du5HThkw.js → integrateKiosk-DsU-d7uk.js} +5 -5
  55. package/dist/browser/{is-debug-CmeNjnvW.js → is-debug-Bnj4naYd.js} +4 -4
  56. package/dist/browser/{is-own-domain-z0V4JpKp.js → is-own-domain-DNjOZllq.js} +1 -1
  57. package/dist/browser/{is-webview-JHA9dtnx.js → is-webview-Drer0GOu.js} +1 -1
  58. package/dist/browser/{jsx-runtime-D-d_UIhH.js → jsx-runtime-DB8EwfzE.js} +2 -2
  59. package/dist/browser/{kiosk-mode-ZBMSIWbK.js → kiosk-mode-B89VL0oY.js} +3 -3
  60. package/dist/browser/{kiosk-record-Djd0ZbEF.js → kiosk-record-rnTon4Lp.js} +1 -1
  61. package/dist/browser/{kioskApi-CXqDoN71.js → kioskApi-opoHdUqq.js} +7 -7
  62. package/dist/browser/{lib-GyGKAKXf.js → lib-eiqwFHwk.js} +3 -3
  63. package/dist/browser/{loadImage-cnbZD9uN.js → loadImage-BS80HTUK.js} +1 -1
  64. package/dist/browser/{logDeviceInfo-BSf9sLzS.js → logDeviceInfo-BqSbYo5l.js} +9 -9
  65. package/dist/browser/{mobx-D3NQFhEq.js → mobx-9NGoPiek.js} +4 -4
  66. package/dist/browser/{mobx.module-CAKsDOYI.js → mobx.module-BP1vMHLz.js} +1 -1
  67. package/dist/browser/{optional-boolean-editor-IR9THgLK.js → optional-boolean-editor-D6hR19BE.js} +3 -3
  68. package/dist/browser/{optional-enum-editor-PRQn6yzK.js → optional-enum-editor-BQPM-fRt.js} +4 -4
  69. package/dist/browser/{optional-string-editor-bZCuZ1tn.js → optional-string-editor-DUXoDnXB.js} +4 -4
  70. package/dist/browser/{particles.min-CwWuVwyg.js → particles.min-CBeInmmW.js} +2 -2
  71. package/dist/browser/{react-DQVTc7xG.js → react-Dg88gKA7.js} +2 -2
  72. package/dist/browser/{react-dom-BsqqKfoG.js → react-dom-C3PpoQeD.js} +3 -3
  73. package/dist/browser/{rolldown-runtime-Cyn7iuGp.js → rolldown-runtime-C7pJ6q0h.js} +1 -1
  74. package/dist/browser/{scene-CqJCEbSr.js → scene-CV1XFwO9.js} +12 -12
  75. package/dist/browser/{scheduler-CVY86sNW.js → scheduler-D-EvNbvQ.js} +2 -2
  76. package/dist/browser/{select-Du3T8Mpj.js → select-CQPuihmE.js} +10 -10
  77. package/dist/browser/{settings-NB72PTux.js → settings-BBn9P5W0.js} +2 -2
  78. package/dist/browser/{settings-item-BIPeCHmD.js → settings-item-BOVedxqA.js} +6 -6
  79. package/dist/browser/{store-BvnDl4Sc.js → store-D73yMRu5.js} +2 -2
  80. package/dist/browser/{string-editor-o-TMbaK8.js → string-editor-Drmcb4Uw.js} +4 -4
  81. package/dist/browser/{text-field-BZ5346fV.js → text-field-CnzYOUfF.js} +5 -5
  82. package/dist/browser/{theme-CPcxdYz7.js → theme-B4d7ReQC.js} +8 -8
  83. package/dist/browser/{ui-CesJTtUW.js → ui-DQ22eDdk.js} +8 -8
  84. package/dist/browser/useManageTraffic-C-4Maw9l.js +1439 -0
  85. package/dist/browser/{useRenderTarget-DpLNpx1f.js → useRenderTarget-BaCkqntS.js} +4 -4
  86. package/dist/browser/{viewport-QrHclV_L.js → viewport-CcbGLmJI.js} +3 -3
  87. package/dist/browser/{wayfinding-v9-TVwHq.js → wayfinding-4TI6Xwmj.js} +416 -383
  88. package/dist/esm/components/Kiosk/KioskStore.d.ts +5 -0
  89. package/dist/esm/components/Kiosk/KioskStore.js +1 -1
  90. package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +2 -2
  91. package/dist/esm/components/Map/drawing/config/TextFitter.js +1 -1
  92. package/dist/esm/components/Map/drawing/config/canvases.d.ts +90 -2
  93. package/dist/esm/components/Map/drawing/config/canvases.js +1 -1
  94. package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
  95. package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +3 -3
  96. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +1 -1
  97. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
  98. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +3 -4
  99. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
  100. package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +2 -2
  101. package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
  102. package/dist/esm/components/Map/drawing/config/config-markers.d.ts +17 -1
  103. package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
  104. package/dist/esm/components/Map/drawing/config/config-pins.d.ts +40 -0
  105. package/dist/esm/components/Map/drawing/config/config-pins.js +1 -0
  106. package/dist/esm/components/Map/drawing/config/pin-geometry.d.ts +65 -0
  107. package/dist/esm/components/Map/drawing/config/pin-geometry.js +1 -0
  108. package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +1 -1
  109. package/dist/esm/components/Map/traffic/useBuildRoute.js +4 -4
  110. package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
  111. package/dist/esm/engine/defs.d.ts +5 -0
  112. package/dist/esm/engine/defs.js +3 -3
  113. package/dist/esm/engine/update-def.d.ts +13 -1
  114. package/dist/esm/engine/update-def.js +1 -1
  115. package/dist/esm/services/url-dispatch.js +1 -1
  116. package/dist/esm/store/init/init-heatmap.d.ts +1 -1
  117. package/dist/esm/store/init/init-heatmap.js +1 -1
  118. package/dist/esm/store/search-buttons/SearchButtonsActions.d.ts +9 -0
  119. package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
  120. package/dist/esm/store/search-buttons/SearchButtonsStore.d.ts +15 -0
  121. package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
  122. package/dist/esm/test/store-harness.d.ts +13 -0
  123. package/dist/esm/test/store-harness.js +1 -1
  124. package/dist/esm/utils/dimming.js +1 -1
  125. package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
  126. package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -1
  127. package/dist/esm/wayfinding/handlers/yahHandler.js +1 -1
  128. package/package.json +10 -10
  129. package/dist/browser/dimming-B7lpw_UN.js +0 -1214
  130. package/dist/esm/engine/canvases.d.ts +0 -5
  131. package/dist/esm/engine/canvases.js +0 -1
@@ -1,1214 +0,0 @@
1
- (function() {
2
- try {
3
- var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.44.8" };
5
- var t = new e.Error().stack;
6
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "4fe757b8-ee61-475d-9899-aed10b25e418", e._sentryDebugIdIdentifier = "sentry-dbid-4fe757b8-ee61-475d-9899-aed10b25e418");
7
- } catch {}
8
- })();
9
- import { r as e } from "./rolldown-runtime-Cyn7iuGp.js";
10
- import { g as t } from "./i18n-CPJmxFQX.js";
11
- import { t as n } from "./react-DQVTc7xG.js";
12
- import { l as r } from "./mobx.module-CAKsDOYI.js";
13
- import { t as i } from "./loadImage-cnbZD9uN.js";
14
- import { r as a } from "./debug-context-BEABO7OL.js";
15
- import { a as o, l as s, t as c, u as l } from "./store-BvnDl4Sc.js";
16
- import { $ as u, Bt as d, D as f, Et as p, Ft as m, G as h, Ht as g, J as _, Kt as v, Nt as y, Rt as b, Vt as x, W as S, Wt as C, X as w, Y as T, _t as E, b as D, d as ee, dt as O, f as k, gt as A, i as j, it as M, kt as N, nt as te, q as ne, qt as P, rt as re, t as ie, vt as F, wt as ae, x as oe, xt as se } from "./LayerStore-BM7GOQ3J.js";
17
- import { _ as I, l as ce } from "./wayfinding-v9-TVwHq.js";
18
- import { i as le, n as ue } from "./viewport-QrHclV_L.js";
19
- import { r as de } from "./scene-CqJCEbSr.js";
20
- //#region src/components/Map/traffic/trafficLayers.ts
21
- var fe = "traffic_route", L = "traffic_route_stop", R = "traffic_vehicles", pe = "build_route_lines", me = "build_route_dots", he = 5;
22
- function ge() {
23
- let e = [];
24
- for (let t = 0; t < he; t++) e.push({
25
- name: _e(t),
26
- children: []
27
- }), e.push({
28
- name: ve(t),
29
- children: []
30
- });
31
- return e.push({
32
- name: R,
33
- children: []
34
- }), e.push({
35
- name: pe,
36
- children: []
37
- }), e.push({
38
- name: me,
39
- children: []
40
- }), e;
41
- }
42
- function _e(e) {
43
- return `${fe}_${e + 1}`;
44
- }
45
- function ve(e) {
46
- return `${L}_${e + 1}`;
47
- }
48
- function ye() {
49
- return RegExp(`^${fe}_\\d+$`);
50
- }
51
- function be() {
52
- return RegExp(`^${L}_\\d+$`);
53
- }
54
- //#endregion
55
- //#region src/components/Map/drawing/config/booth-badge-anchor.ts
56
- var xe = /* @__PURE__ */ e(A(), 1), Se = .5, Ce = .3, we = 10, Te = 8, Ee = 4, De = 50, z = class e {
57
- constructor(e, t, n, r) {
58
- this.booth = e, this.triangles = t, this.border = n, this.source = r, this.fits = [], this.prefetchRotation = 0, this.polygon = void 0, this.bbox = void 0, this.vertices = null, this.polygon = ke(t), this.bbox = Oe(t);
59
- }
60
- fit(e, t) {
61
- let n = this.fits[e];
62
- return n || (this.fits[e] = n = this.compute(e, t), this.fits.filter(Boolean).length === 4 && (this.vertices = null)), n;
63
- }
64
- prefetch(t) {
65
- e.idle.has(this) || (this.prefetchRotation = t, e.idle.add(this), e.scheduleIdle());
66
- }
67
- cancelPrefetch() {
68
- e.idle.delete(this);
69
- }
70
- static scheduleIdle() {
71
- e.idleScheduled || !e.idle.size || (e.idleScheduled = !0, typeof requestIdleCallback == "function" ? requestIdleCallback(e.runIdle) : typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => setTimeout(e.runSlice, 0)) : setTimeout(e.runSlice, De));
72
- }
73
- static runSlice() {
74
- let t = performance.now() + Ee;
75
- e.runIdle({ timeRemaining: () => t - performance.now() });
76
- }
77
- static runIdle(t) {
78
- e.idleScheduled = !1;
79
- let n = performance.now() + Te;
80
- try {
81
- for (let r of e.idle) {
82
- if (t.timeRemaining() <= 0 || performance.now() >= n) break;
83
- let i = !1;
84
- try {
85
- i = r.prefetchNext();
86
- } finally {
87
- i || e.idle.delete(r);
88
- }
89
- }
90
- } finally {
91
- e.scheduleIdle();
92
- }
93
- }
94
- prefetchNext() {
95
- for (let e = 1; e < 4; e++) if (!this.fits[e]) return this.fit(e, this.prefetchRotation + e * Math.PI / 2), e < 3;
96
- return !1;
97
- }
98
- compute(e, t) {
99
- let n = e === 0 || e === 3 ? 1 : -1, r = e === 0 || e === 1 ? 1 : -1, i = this.findAnchor(n, r), a = this.clampScale(i.x, i.y, this.rectMaxScale(e % 2 == 1), t);
100
- return {
101
- x: i.x,
102
- y: i.y,
103
- maxScale: a
104
- };
105
- }
106
- rectMaxScale(e) {
107
- let t = this.booth.rect.size.width, n = this.booth.rect.size.height, r = e ? n : t, i = e ? t : n;
108
- return Math.min(r > 0 ? r * Se / this.source.x : Infinity, i > 0 ? i * Ce / this.source.y : Infinity);
109
- }
110
- findAnchor(e, t) {
111
- var n;
112
- let { booth: r, border: i, bbox: a } = this;
113
- if (a) {
114
- let n = e > 0 ? a.min.x : a.max.x, r = t > 0 ? a.min.y : a.max.y, o = [];
115
- for (let [a, s] of this.distinctVertices()) {
116
- let c = a + i * e, l = s + i * t, u = Math.abs(c - n) + Math.abs(l - r);
117
- u < Infinity && o.push({
118
- x: c,
119
- y: l,
120
- score: u,
121
- order: o.length
122
- });
123
- }
124
- o.sort((e, t) => e.score - t.score || e.order - t.order);
125
- for (let e of o) {
126
- let t = {
127
- x: e.x,
128
- y: e.y
129
- };
130
- if (this.polygon.containsPoint(t)) return t;
131
- }
132
- }
133
- let o = e > 0 ? r.rect.min.x + i : r.rect.max.x - i, s = t > 0 ? r.rect.min.y + i : r.rect.max.y - i, c = (n = r.rotate) == null ? 0 : n;
134
- return c ? v({
135
- x: o,
136
- y: s
137
- }, c, r.rect.center) : {
138
- x: o,
139
- y: s
140
- };
141
- }
142
- clampScale(e, t, n, r) {
143
- let { polygon: i, source: a } = this;
144
- if (!this.triangles.length) return n;
145
- let o = {
146
- x: e,
147
- y: t
148
- };
149
- if (!i.containsPoint(o)) return n;
150
- let s = 0, c = n;
151
- for (let n = 0; n < we; n++) {
152
- let n = (s + c) / 2, l = a.x * n, u = a.y * n;
153
- i.containsPoint(v({
154
- x: e + l,
155
- y: t
156
- }, r, o)) && i.containsPoint(v({
157
- x: e,
158
- y: t + u
159
- }, r, o)) && i.containsPoint(v({
160
- x: e + l,
161
- y: t + u
162
- }, r, o)) ? s = n : c = n;
163
- }
164
- return s;
165
- }
166
- distinctVertices() {
167
- if (this.vertices) return this.vertices;
168
- let e = /* @__PURE__ */ new Set(), t = [];
169
- for (let n of this.triangles) for (let r of n) {
170
- let n = `${r[0]},${r[1]}`;
171
- e.has(n) || (e.add(n), t.push([r[0], r[1]]));
172
- }
173
- return this.vertices = t;
174
- }
175
- };
176
- z.idle = /* @__PURE__ */ new Set(), z.idleScheduled = !1;
177
- function Oe(e) {
178
- if (!e.length) return null;
179
- let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
180
- for (let a of e) for (let [e, o] of a) e < t && (t = e), o < n && (n = o), e > r && (r = e), o > i && (i = o);
181
- return b.fromMinMax({
182
- x: t,
183
- y: n
184
- }, {
185
- x: r,
186
- y: i
187
- });
188
- }
189
- function ke(e) {
190
- let t = [], n = [];
191
- for (let r of e) {
192
- let e = t.length;
193
- t.push({
194
- x: r[0][0],
195
- y: r[0][1]
196
- }), t.push({
197
- x: r[1][0],
198
- y: r[1][1]
199
- }), t.push({
200
- x: r[2][0],
201
- y: r[2][1]
202
- }), n.push([
203
- e,
204
- e + 1,
205
- e + 2
206
- ]);
207
- }
208
- return new g(t, n);
209
- }
210
- //#endregion
211
- //#region src/components/Map/drawing/config/config-booth-badge-eligibility.ts
212
- function Ae(e) {
213
- return e.hideExhibitorBoothNumber || e.hideBoothBadges || !e.hasExhibitors ? !1 : e.noLabels || !e.hideLogoInBooth && e.hasLogoInBooth;
214
- }
215
- //#endregion
216
- //#region src/components/Map/drawing/config/config-booth-badge.ts
217
- var je = 15, Me = 24, Ne = 30, Pe = 12, Fe = .8, Ie = document.createElement("canvas").getContext("2d");
218
- function Le(e) {
219
- return e.length <= je ? e : e.slice(0, je - 1) + "…";
220
- }
221
- function Re(e) {
222
- var t, n;
223
- if (!((t = e.paths) != null && t.length)) return [];
224
- let r = ((n = e.layer) == null ? void 0 : n.name) || "", i = [];
225
- for (let t of e.paths) for (let e of N(t.index, r)) i.push(e);
226
- return i;
227
- }
228
- function B(e) {
229
- return e && e !== "none" ? e : void 0;
230
- }
231
- function ze(e) {
232
- var t;
233
- let n = B(e.borderColor) || B(p.boothBorderColor) || p.colors.booths.default;
234
- return ((t = e.paths) == null ? void 0 : t.length) > 1 && B(e.paths[e.paths.length - 1].color) || n;
235
- }
236
- function Be(e) {
237
- var t;
238
- let n = Le(e.title || e.name), i = ze(e), a = de((0, xe.default)(i).hex()), o = ee();
239
- Ie.font = ae(Ne, o);
240
- let s = Ie.measureText(n).width, u = Math.ceil(s + Pe * 2), d = (e.borderWidth || c.borderWidth) / 2, f = u * Fe, p = 54 * Fe, m = new z(e, Re(e), d, {
241
- x: f,
242
- y: p
243
- }), h = (t = e.rotate) == null ? 0 : t, g = 0, y = 0, b = 0, S = 0, C = () => {
244
- let e = m.fit(g, h);
245
- y = e.x, b = e.y, S = e.maxScale;
246
- };
247
- C();
248
- let E = (t, n) => {
249
- let r = t / 2, i = n / 2;
250
- return new x(v({
251
- x: y + r,
252
- y: b + i
253
- }, h, {
254
- x: y,
255
- y: b
256
- }), {
257
- x: t,
258
- y: n
259
- }, h, e.elevation);
260
- }, D = k(o, w()), A = ne(E(1, 1), i);
261
- A.hidden = !0, A.dim = e.skipDim ? 0 : void 0;
262
- let j = _(T([[n], []], a, 0, [D, D]), E(1, 1), [0, 0], {
263
- horizontal: "center",
264
- vertical: "center"
265
- });
266
- j.hidden = !0, j.dim = e.skipDim ? 0 : void 0;
267
- let M = {
268
- booth: e,
269
- anchor: {
270
- x: y,
271
- y: b
272
- },
273
- source: {
274
- x: f,
275
- y: p
276
- },
277
- rotation: h,
278
- maxScale: S,
279
- bg: A,
280
- text: j
281
- }, N = new Ve(M);
282
- A.onScale = ({ pixelSize: e }) => N.layOutBg(e), j.onScale = ({ pixelSize: e }) => N.layOutText(e);
283
- let P = [];
284
- return P.push(r(() => e.skipDim, (e) => {
285
- A.dim = e ? 0 : void 0, j.dim = e ? 0 : void 0, O(A, j);
286
- })), P.push(r(() => {
287
- var t, n;
288
- return (t = (n = e.layer) == null ? void 0 : n.visible) == null || t;
289
- }, (e) => {
290
- A.hidden = !e, j.hidden = !e, O(A, j);
291
- })), P.push(r(() => l.mapSettings, ({ roll: t }) => {
292
- var n;
293
- re(t == null ? 0 : t) && (m.prefetch((n = e.rotate) == null ? 0 : n), A.onRoll = ({ roll: e, pixelSize: t }) => {
294
- let n = te(e, h);
295
- if (n !== 0) return h += n * Math.PI / 2, g = ((g + n) % 4 + 4) % 4, C(), M.anchor.x = y, M.anchor.y = b, M.rotation = h, M.maxScale = S, [...N.layOutBg(t), ...N.layOutText(t)];
296
- });
297
- }, { fireImmediately: !0 }), () => m.cancelPrefetch()), {
298
- bg: A,
299
- text: j,
300
- dispose: () => {
301
- P.forEach((e) => e()), P.length = 0;
302
- }
303
- };
304
- }
305
- var Ve = class {
306
- constructor(e) {
307
- this.placement = e;
308
- }
309
- layOutBg(e) {
310
- let { bg: t } = this.placement;
311
- return t.shape = this.rectScaled(e), t.hidden = this.isHidden(), t.hidden ? [] : [t];
312
- }
313
- layOutText(e) {
314
- let { text: t, maxScale: n } = this.placement;
315
- return t.lines[0].fontSize = Me * Math.min(e, n), t.bounds = this.rectScaled(e), t.hidden = this.isHidden(), t.hidden ? [] : [t];
316
- }
317
- rectScaled(e) {
318
- let { anchor: t, booth: n, source: r, rotation: i, maxScale: a } = this.placement, o = Math.min(e, a), s = r.x * o, c = r.y * o;
319
- return new x(v({
320
- x: t.x + s / 2,
321
- y: t.y + c / 2
322
- }, i, t), {
323
- x: s,
324
- y: c
325
- }, i, n.elevation);
326
- }
327
- isHidden() {
328
- let { booth: e } = this.placement;
329
- return !!(e.layer && !e.layer.visible);
330
- }
331
- };
332
- function He(e, t) {
333
- let n = [], r = [], i = [];
334
- for (let e of t) if (e instanceof u && Ae({
335
- hideExhibitorBoothNumber: y.hideExhibitorBoothNumber,
336
- hideBoothBadges: y.hideBoothBadges,
337
- hideLogoInBooth: l.hideLogoInBooth,
338
- noLabels: e.noLabels,
339
- hasExhibitors: e.exhibitors.length > 0,
340
- hasLogoInBooth: e.exhibitors.some((e) => e.logoInBooth && e.logo)
341
- })) {
342
- let { bg: t, text: a, dispose: o } = Be(e);
343
- n.push(t), r.push(a), i.push(o);
344
- }
345
- let a = () => {
346
- i.forEach((e) => e()), i.length = 0;
347
- };
348
- return n.length ? {
349
- layer: {
350
- name: `${e}:badges`,
351
- children: [{
352
- name: `${e}:badgeBgs`,
353
- children: n
354
- }, {
355
- name: `${e}:badgeTexts`,
356
- children: r
357
- }]
358
- },
359
- cleanup: a
360
- } : {
361
- layer: null,
362
- cleanup: a
363
- };
364
- }
365
- //#endregion
366
- //#region src/components/Map/drawing/config/config-markers.ts
367
- var V = "_selected", H = "markers";
368
- function Ue(e, t) {
369
- let { center: n, rotation: r, elevation: i } = e.bounds, { width: a, height: o } = e.source;
370
- return e.bounds = F(n.x, n.y, a, o, t, r, i), [e];
371
- }
372
- function We(e) {
373
- U = e;
374
- }
375
- function Ge(e) {
376
- let { scene: t } = e, n = [], i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), c = [], u = t.rootLayer.children.find((e) => e.name === H);
377
- u.onScale = ({ pixelSize: e }) => We(e), D(Ke), O(u);
378
- async function d(e) {
379
- let t = [];
380
- e.forEach((e) => {
381
- let { name: n, content: r, width: a, height: o, scale: s } = e;
382
- if (i.has(n)) return;
383
- let c = new Image(), l = new Promise((e, t) => {
384
- c.onload = () => {
385
- i.set(n, {
386
- img: c,
387
- width: a,
388
- height: o,
389
- scale: s
390
- }), e();
391
- }, c.onerror = (e) => {
392
- t(e);
393
- };
394
- });
395
- t.push(l), c.src = r, c.crossOrigin = "anonymous";
396
- }), await Promise.all(t);
397
- }
398
- let f = (e) => {
399
- e.onScale = ({ pixelSize: t }) => Ue(e, t);
400
- }, p = (e) => {
401
- e.screenSpace || (e.onRoll = ({ roll: t }) => {
402
- if (t !== e.bounds.rotation) return e.bounds.rotate(t - e.bounds.rotation, e.bounds), [e];
403
- });
404
- };
405
- function m(e, t, n) {
406
- let r = a.get(e);
407
- if (r) return r;
408
- let i = se(t.img, t.width, t.height, n);
409
- return a.set(e, i), i;
410
- }
411
- function h() {
412
- let e = s.routeStore.markersData.markers;
413
- if (!e.length) return;
414
- c = [];
415
- let t = l.is3DView;
416
- e.forEach((e) => {
417
- var n, r;
418
- let a = i.get(e.icon);
419
- if (!a) return;
420
- let s = i.get(e.selectedIcon);
421
- if (!s) return;
422
- let l = a.scale || window.devicePixelRatio, u = m(e.icon, a, l), d = m(e.selectedIcon, s, l), f = (n = (r = o.findLayer(e.z)) == null ? void 0 : r.visible) == null || n, p = F(e.x, e.y, u.width, u.height, 1, 0), h = F(e.x, e.y, d.width, d.height, 1, 0), g;
423
- switch (e.position) {
424
- case "lefttop":
425
- g = [0, 0];
426
- break;
427
- case "centertop":
428
- g = [.5, 0];
429
- break;
430
- case "centerbottom":
431
- g = [.5, 1];
432
- break;
433
- default: g = [.5, .5];
434
- }
435
- let _ = {
436
- ...S(u, p, {
437
- hidden: !f,
438
- origin: g
439
- }),
440
- id: e.id,
441
- scale: l,
442
- screenSpace: t
443
- }, v = {
444
- ...S(d, h, {
445
- hidden: !(f && e.active),
446
- origin: g
447
- }),
448
- id: `${e.id}${V}`,
449
- scale: l,
450
- screenSpace: t
451
- };
452
- c.push(_, v);
453
- }), u.children = c, c.forEach((e) => {
454
- f(e), p(e);
455
- });
456
- }
457
- function g() {
458
- u.children = [], c = [];
459
- }
460
- function _() {
461
- let e = s.routeStore.markersData.markers;
462
- e.length && e.forEach((e) => {
463
- var t, n;
464
- let r = c.find((t) => t.id === e.id), i = c.find((t) => t.id === `${e.id}${V}`);
465
- if (!r || !i) return;
466
- let a = (t = (n = o.findLayer(e.z)) == null ? void 0 : n.visible) == null || t;
467
- e.active ? (r.hidden = !0, i.hidden = !(a && e.active)) : (r.hidden = !a, i.hidden = !0);
468
- });
469
- }
470
- return n.push(r(() => [s.routeStore.selectedMarkers, s.layerStore.visible], () => {
471
- if (!s.routeStore.markersData.markers.length) {
472
- g(), O(u);
473
- return;
474
- }
475
- _(), O(...c);
476
- })), n.push(r(() => s.routeStore.markersData.markers, () => {
477
- d(s.routeStore.markersData.icons).then(() => {
478
- h(), O(u);
479
- });
480
- }, { fireImmediately: !0 })), function() {
481
- n.forEach((e) => e()), n.length = 0, u.onScale = void 0, D(), U = 1, O(u);
482
- };
483
- }
484
- function Ke(e, t) {
485
- return qe(e, t, U);
486
- }
487
- function qe(e, t, n) {
488
- for (let r of s.routeStore.markersData.markers) {
489
- let i = s.routeStore.markersData.icons.find((e) => e.name === r.icon);
490
- if (!i) continue;
491
- let a = i.width * n * devicePixelRatio, o = i.height * n * devicePixelRatio;
492
- if (Je(e, t, r.x, r.y, a, o)) {
493
- let e = s.layerStore.findLayer(r.z);
494
- if (!e || e && e.visible) return r;
495
- }
496
- }
497
- return null;
498
- }
499
- function Je(e, t, n, r, i, a) {
500
- return b.fromCenter({
501
- x: n,
502
- y: r
503
- }, {
504
- x: 2 * i,
505
- y: 2 * a
506
- }).containsPoint({
507
- x: e,
508
- y: t
509
- });
510
- }
511
- var U = 1;
512
- //#endregion
513
- //#region src/components/Map/drawing/config/config-all.ts
514
- function Ye() {
515
- let { defaultLayer: e } = s.layerStore, { layers: t } = s.layerStore;
516
- if (e) {
517
- let n = [...t], r = t.indexOf(e);
518
- n.splice(r, 1), t = [e, ...n];
519
- }
520
- let n = t.filter((e) => !e.rootParent).map((e) => j(e));
521
- return Promise.all(n).then((e) => {
522
- let t = h(H, []);
523
- t.overlay = l.is3DView;
524
- let n = ce({ overlay: l.is3DView }), r = [], i = [];
525
- for (let t of e.flat()) f(t.name) ? (t.dim = 0, i.push(t)) : r.push(t);
526
- let { layer: a, cleanup: o } = He("root", c.booths);
527
- return {
528
- layers: [
529
- ...r,
530
- ...a ? [a] : [],
531
- ...i,
532
- ...ge(),
533
- t,
534
- n
535
- ],
536
- cleanup: o
537
- };
538
- });
539
- }
540
- //#endregion
541
- //#region src/components/Map/MapCursorCoords.tsx
542
- var W = /* @__PURE__ */ e(n(), 1), Xe = 2;
543
- function Ze(e) {
544
- let { canvas: t } = e, n = M(), r = a(), i = (0, W.useCallback)(() => r("cursor", void 0), [r]), o = (0, W.useEffectEvent)((e) => {
545
- if (!e.isPrimary) return;
546
- let t = n.canvasToPlan({
547
- x: e.offsetX,
548
- y: e.offsetY
549
- });
550
- r("cursor", t ? $e(t, Qe()) : void 0);
551
- });
552
- return (0, W.useEffect)(() => {
553
- let e = t.current;
554
- if (!e) return;
555
- let n = (e) => o(e), r = () => i();
556
- return e.addEventListener("pointermove", n), e.addEventListener("pointerleave", r), () => {
557
- e.removeEventListener("pointermove", n), e.removeEventListener("pointerleave", r);
558
- };
559
- }, [t, i]), null;
560
- }
561
- function Qe() {
562
- let e = s.layerStore.layers.find((e) => e.visible && (e.mode === ie.TurnedOn || e.mode === ie.TurnedOff));
563
- return (e == null ? void 0 : e.name) || null;
564
- }
565
- function $e(e, t) {
566
- let n = `[${e.x.toFixed(Xe)}, ${e.y.toFixed(Xe)}]`;
567
- return t ? `${n} · layer ${t}` : n;
568
- }
569
- //#endregion
570
- //#region src/components/Map/MapViewport.tsx
571
- function et() {
572
- let e = M(), t = (0, W.useRef)({ api: e }), [n] = (0, W.useState)(() => ue(t));
573
- return (0, W.useLayoutEffect)(() => {
574
- t.current = { api: e };
575
- }), (0, W.useEffect)(() => (le(n), () => le(void 0)), [n]), null;
576
- }
577
- //#endregion
578
- //#region src/components/Map/traffic/UpdateQueue.ts
579
- var tt = class {
580
- constructor() {
581
- this.queue = [], this.isProcessing = !1, this.rafId = null, this.CHUNK_SIZE = 100, this.TIME_BUDGET = 4;
582
- }
583
- add(e) {
584
- this.queue.push(e), this.scheduleProcessing();
585
- }
586
- scheduleProcessing() {
587
- this.isProcessing || this.queue.length === 0 || (this.isProcessing = !0, this.queue.length <= this.CHUNK_SIZE * 2 ? Promise.resolve().then(() => this.processMicrotaskQueue()) : this.rafId = requestAnimationFrame((e) => {
588
- this.processQueue(e);
589
- }));
590
- }
591
- processMicrotaskQueue() {
592
- let e = performance.now(), t = 0;
593
- for (; this.queue.length > 0 && t < this.CHUNK_SIZE;) {
594
- let n = this.queue.shift();
595
- try {
596
- n();
597
- } catch (e) {
598
- console.warn("UpdateQueue task error:", e);
599
- }
600
- if (t++, performance.now() - e > this.TIME_BUDGET) break;
601
- }
602
- this.queue.length > 0 ? Promise.resolve().then(() => this.processMicrotaskQueue()) : this.isProcessing = !1;
603
- }
604
- processQueue(e) {
605
- this.rafId = null;
606
- let t = 0;
607
- for (; this.queue.length > 0 && t < this.CHUNK_SIZE;) {
608
- let n = this.queue.shift();
609
- try {
610
- n();
611
- } catch (e) {
612
- console.warn("UpdateQueue task error:", e);
613
- }
614
- if (t++, performance.now() - e > this.TIME_BUDGET) break;
615
- }
616
- this.queue.length > 0 ? this.rafId = requestAnimationFrame((e) => this.processQueue(e)) : this.isProcessing = !1;
617
- }
618
- destroy() {
619
- this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.queue = [], this.isProcessing = !1;
620
- }
621
- }, G = 49, K = `hsl(257, 76%, ${G}%)`, nt = `hsl(339.903, 82%, ${G}%)`, rt = `hsl(257, 76%, ${Math.round(G * 1.82)}%)`, q = 4, it = q, at = "U", ot = "R", st = "S", ct = "P", lt = class {
622
- constructor() {
623
- this._state = [[]], this.index = 0, this.pointHashSet = /* @__PURE__ */ new Set(), this.locked = !1, this.storageKey = "expofp_build_route_state", this._selected = 0;
624
- }
625
- get points() {
626
- return this._state[this.index];
627
- }
628
- set points(e) {
629
- this._state.push(e), this.setIndex(), this.save();
630
- }
631
- setIndex() {
632
- this.index = Math.max(this._state.length - 1, 0);
633
- }
634
- genPointHash(e) {
635
- return `${e.x},${e.y}`;
636
- }
637
- add(e) {
638
- let t = this.genPointHash(e);
639
- this.pointHashSet.has(t) || (this.pointHashSet.add(t), this.points = [...this.points, e]);
640
- }
641
- undo() {
642
- this.index && (this._state.pop(), this.setIndex(), this.save(), this.select(this.points.length - 1));
643
- }
644
- execute(e) {
645
- try {
646
- if (this.locked) return;
647
- this.locked = !0, e();
648
- } finally {
649
- requestAnimationFrame(() => {
650
- this.locked = !1;
651
- });
652
- }
653
- }
654
- log(e, t = 12) {
655
- console.log(`%c${e}`, `color: black; font-size: ${t}px; background: LemonChiffon;`);
656
- }
657
- instruct() {
658
- this.log(`How to Build a Route:
659
- Add Point: Click on the map.
660
- Apply Smoothing: Press ${ot}.
661
- Apply Simplification: Press ${st}.
662
- Undo: Press ${at}.
663
- Enable/Disable Preview: Press ${ct}.
664
- `, 16);
665
- }
666
- applyChaikinSmoothing(e, t, n) {
667
- let r;
668
- if (n >= 1 && e.length >= 2) {
669
- r = [e[0]];
670
- for (let t = 1; t < e.length; t++) {
671
- let i = e[t - 1], a = e[t];
672
- for (let e = 1; e <= n; e++) {
673
- let t = e / (n + 1);
674
- r.push({
675
- x: i.x + (a.x - i.x) * t,
676
- y: i.y + (a.y - i.y) * t
677
- });
678
- }
679
- r.push(a);
680
- }
681
- } else r = e.slice();
682
- for (let e = 0; e < t && !(r.length < 2); e++) {
683
- let e = [{ ...r[0] }];
684
- for (let t = 1; t < r.length; t++) {
685
- let n = r[t - 1], i = r[t];
686
- e.push({
687
- x: .75 * n.x + .25 * i.x,
688
- y: .75 * n.y + .25 * i.y
689
- }), e.push({
690
- x: .25 * n.x + .75 * i.x,
691
- y: .25 * n.y + .75 * i.y
692
- });
693
- }
694
- e.push({ ...r[r.length - 1] }), r = e;
695
- }
696
- return r;
697
- }
698
- applySmoothing() {
699
- this.points.length < 3 || (this.points = this.applyChaikinSmoothing(this.points, 1, 0), this.select(this.points.length - 1));
700
- }
701
- save() {
702
- try {
703
- this.points.length ? sessionStorage.setItem(this.storageKey, JSON.stringify(this.points)) : sessionStorage.removeItem(this.storageKey);
704
- } catch (e) {
705
- console.warn(e);
706
- }
707
- }
708
- restore() {
709
- try {
710
- let e = sessionStorage.getItem(this.storageKey);
711
- if (!e) return;
712
- let t = JSON.parse(e);
713
- if (!Array.isArray(t)) return;
714
- t.forEach((e) => this.add(e)), this.select(this.points.length - 1);
715
- } catch (e) {
716
- console.warn(e);
717
- }
718
- }
719
- topologyPreservingSimplify(e, t) {
720
- if (e.length <= 2) return e.map((e) => ({ ...e }));
721
- let n = (e, t, n) => {
722
- let r = e.x, i = e.y, a = t.x, o = t.y, s = n.x, c = n.y;
723
- return Math.abs((c - o) * r - (s - a) * i + s * o - c * a) / (Math.sqrt((c - o) ** 2 + (s - a) ** 2) || 1e-10);
724
- }, r = (e, t, n, r) => {
725
- let i = d({
726
- p0: e,
727
- p1: t
728
- }, {
729
- p0: n,
730
- p1: r
731
- });
732
- return i !== null && i.onLine1 && i.onLine2;
733
- }, i = Array(e.length).fill(!1);
734
- i[0] = i[i.length - 1] = !0;
735
- let a = [], o = (s, c) => {
736
- if (c <= s + 1) return;
737
- let l = e[s], u = e[c], d = 0, f = 0;
738
- for (let t = s + 1; t < c; t++) {
739
- let r = n(e[t], l, u);
740
- r > d && (d = r, f = t);
741
- }
742
- if (d > t) {
743
- let t = e[f], n = !0;
744
- for (let e = 0; e < a.length - 1; e++) if (r(a[e], a[e + 1], l, t) || r(a[e], a[e + 1], t, u)) {
745
- n = !1;
746
- break;
747
- }
748
- n && (i[f] = !0, o(s, f), o(f, c));
749
- }
750
- };
751
- return o(0, e.length - 1), e.filter((e, t) => i[t]);
752
- }
753
- applySimplification() {
754
- this.points = this.topologyPreservingSimplify(this.points, .5), this.select(this.points.length - 1);
755
- }
756
- get selected() {
757
- return this._selected;
758
- }
759
- select(e) {
760
- this._selected = Math.max(0, Math.min(e, this.points.length - 1));
761
- }
762
- };
763
- function ut({ enabled: e, scene: t }) {
764
- let n = (0, W.useRef)(!1), r = (0, W.useRef)(), i = (0, W.useMemo)(() => E(q, K), []), a = (0, W.useMemo)(() => E(q, nt), []), o = (0, W.useMemo)(() => new lt(), []), s = (0, W.useRef)(new tt()), c = (0, W.useMemo)(() => {
765
- if (!t) return {};
766
- let e = t.rootLayer.children;
767
- return {
768
- linesLayer: e.find((e) => e.name === pe),
769
- pointsLayer: e.find((e) => e.name === me)
770
- };
771
- }, [t]), l = (0, W.useCallback)(() => {
772
- if (!c || !i || !a) return;
773
- let { linesLayer: e, pointsLayer: t } = c;
774
- if (!e || !t) return;
775
- let l = o.points, u = n.current;
776
- u ? t.children.length = 0 : t.children = l.map(({ x: e, y: t }, n) => {
777
- let s = n == o.selected ? a : i;
778
- return {
779
- source: s,
780
- bounds: F(e, t, s.width, s.height, r.current)
781
- };
782
- });
783
- let d = [];
784
- for (let e = 1; e < l.length; e++) {
785
- let t = l[e - 1], n = l[e];
786
- d.push({
787
- points: {
788
- p0: t,
789
- p1: n
790
- },
791
- color: u ? K : rt,
792
- width: it
793
- });
794
- }
795
- d.length ? e.children = d : e.children.length = 0, s.current.add(() => O(t, e)), o.instruct(), o.log(JSON.stringify(o.points));
796
- }, [
797
- o,
798
- c,
799
- i,
800
- a
801
- ]), u = (0, W.useCallback)((e) => {
802
- let t = e.key.toUpperCase();
803
- o.execute(() => {
804
- switch (t) {
805
- case at:
806
- e.preventDefault(), o.undo(), n.current = !1, l();
807
- break;
808
- case ot:
809
- e.preventDefault(), o.applySmoothing(), n.current = !1, l();
810
- break;
811
- case st:
812
- e.preventDefault(), o.applySimplification(), n.current = !1, l();
813
- break;
814
- case ct:
815
- e.preventDefault(), n.current = !n.current, l();
816
- break;
817
- }
818
- });
819
- }, [o, l]), d = (0, W.useCallback)((e) => {
820
- r.current = e;
821
- let { pointsLayer: t } = c;
822
- if (!t) return [];
823
- let n = [];
824
- return o.execute(() => {
825
- let e = t.children;
826
- for (let t of e) t.bounds = F(t.bounds.center.x, t.bounds.center.y, t.source.width, t.source.height, r.current), n.push(t);
827
- }), n;
828
- }, [c, o]), f = (0, W.useCallback)((e) => {
829
- o.execute(() => {
830
- o.add({
831
- x: e.x,
832
- y: e.y
833
- }), o.select(o.points.length - 1), l();
834
- });
835
- }, [o, l]);
836
- (0, W.useEffect)(() => {
837
- var t, n;
838
- if (!e || !(c != null && c.pointsLayer)) return;
839
- let { pointsLayer: i } = c;
840
- return r.current = (t = (n = m()) == null ? void 0 : n.state().pixelSize) == null ? 1 : t, o.execute(() => {
841
- o.restore(), l();
842
- }), i.onScale = ({ pixelSize: e }) => d(e), s.current.add(() => O(i)), oe(f), window.addEventListener("keyup", u), () => {
843
- window.removeEventListener("keyup", u), oe(), i.onScale = void 0, s.current.destroy();
844
- };
845
- }, [
846
- e,
847
- c,
848
- o,
849
- l,
850
- f,
851
- d,
852
- u
853
- ]);
854
- }
855
- //#endregion
856
- //#region src/components/Map/traffic/useManageTraffic.ts
857
- var J = 2, dt = J * 3.5, Y = J * 12, ft = Y * .7, pt = 8, mt = "transport_locations", ht = 150, gt = "#a4aab6", _t = 1e3, vt = 2e4, yt = 500;
858
- function bt({ permission: e, scene: n, dataJsonUrl: r, websocketUrl: a }) {
859
- let o = (0, W.useRef)(window.devicePixelRatio), s = (0, W.useRef)(/* @__PURE__ */ new Map()), c = (0, W.useRef)(/* @__PURE__ */ new Map()), l = (0, W.useRef)(null), u = (0, W.useRef)(null), d = (0, W.useRef)(0), f = (0, W.useRef)(1), p = (0, W.useRef)(new tt()), h = (0, W.useRef)(/* @__PURE__ */ new Map()), g = (0, W.useRef)(_t), _ = (0, W.useRef)(/* @__PURE__ */ new Map()), v = (0, W.useRef)(void 0);
860
- (0, W.useEffect)(() => {
861
- if (!e || !n) return;
862
- let y = !1, b, x = n.rootLayer.children, S = c.current, C = s.current, w = p.current;
863
- async function T() {
864
- try {
865
- var e, n;
866
- let a;
867
- try {
868
- let e = await fetch(r, {
869
- method: "GET",
870
- headers: { "Content-Type": "application/json" }
871
- });
872
- if (!e.ok || e.status === 204) return;
873
- a = await e.json();
874
- } catch (e) {
875
- console.warn("useManageTraffic failed to get JSON", e);
876
- }
877
- if (y || !a || a.disabled || a.error) return;
878
- o.current = xt((e = (n = m()) == null ? void 0 : n.state().pixelSize) == null ? window.devicePixelRatio : e);
879
- let c = new Map(a.routes.map(({ id: e, color: t }) => [e, t])), l = /* @__PURE__ */ new Map();
880
- c.forEach((e) => {
881
- l.set(e, Ct({
882
- radius: dt,
883
- color: e,
884
- scale: window.devicePixelRatio
885
- }));
886
- });
887
- let p = ye(), g = x.filter((e) => p.test(e.name)), v = be(), b = x.filter((e) => v.test(e.name));
888
- a.routes.slice(0, g.length).forEach(({ id: e, color: t, path: n, stops: r, hiddenPoints: i }, a) => {
889
- h.current.set(e, n);
890
- let s = g[a];
891
- if (s) {
892
- var c;
893
- let e = new Map((c = i == null ? void 0 : i.map((e) => [$(e), e])) == null ? [] : c);
894
- for (let r = 1; r < n.length; r++) {
895
- let i = n[r - 1], a = n[r];
896
- e.has($(i)) || e.has($(a)) || s.children.push({
897
- points: {
898
- p0: i,
899
- p1: a
900
- },
901
- color: t,
902
- width: J
903
- });
904
- }
905
- s.children.length && w.add(() => O(s));
906
- }
907
- let u = b[a], d = l.get(t);
908
- u && d && r != null && r.length && (r.forEach((e) => {
909
- u.children.push({
910
- source: d,
911
- bounds: F(e.x, e.y, d.width, d.height, o.current)
912
- });
913
- }), u.children.length && w.add(() => O(u)));
914
- });
915
- let T = x.find((e) => e.name === R);
916
- if (!T) {
917
- console.warn(`useManageTraffic: the scene has no "${R}" layer`);
918
- return;
919
- }
920
- let k = /* @__PURE__ */ new Map();
921
- T.onScale = ({ pixelSize: e }) => {
922
- o.current = xt(e);
923
- let t = [];
924
- for (let e of b) {
925
- let n = e.children;
926
- for (let e of n) {
927
- let n = e.source;
928
- e.bounds = F(e.bounds.center.x, e.bounds.center.y, n.width, n.height, o.current, e.bounds.rotation), t.push(e);
929
- }
930
- }
931
- for (let e of s.current.values()) {
932
- let n = e.source;
933
- e.bounds = F(e.bounds.center.x, e.bounds.center.y, n.width, n.height, o.current, e.bounds.rotation), t.push(e);
934
- }
935
- return t;
936
- }, w.add(() => O(T)), c.forEach((e, t) => {
937
- k.set(t, wt({
938
- id: t,
939
- width: Y,
940
- height: Y,
941
- color: e,
942
- scale: window.devicePixelRatio
943
- }));
944
- });
945
- let A = wt({
946
- id: "orphan",
947
- width: Y,
948
- height: Y,
949
- color: gt,
950
- scale: window.devicePixelRatio
951
- }), j = null;
952
- try {
953
- let e = await i(`${t}icons/bus-white.svg`);
954
- if (y) return;
955
- j = se(e, ft, ft, window.devicePixelRatio);
956
- } catch (e) {
957
- console.error(e);
958
- }
959
- u.current = (e) => {
960
- try {
961
- var t;
962
- let n = JSON.parse(e.data);
963
- if (n.type !== mt) return;
964
- let r = e.timeStamp || performance.now();
965
- f.current = Math.round(r - d.current), d.current = r;
966
- let i = Math.max((t = f.current) == null ? yt : t, yt), a = T.children, s = !1;
967
- n.data.forEach(({ id: e, x: t, y: n, route_id: r, hidden: c }) => {
968
- var l;
969
- if (S.has(e)) {
970
- var u;
971
- (u = S.get(e)) == null || u(), S.delete(e);
972
- }
973
- let d = C.get(e), f = (l = C.get(Z(e))) == null ? null : l;
974
- if (c && d && f) {
975
- d.hidden = !0, f.hidden = !0, w.add(() => O(d, f));
976
- return;
977
- }
978
- if (_.current.set(e, performance.now()), !d) {
979
- var p;
980
- let i = (p = k.get(r)) == null ? A : p, c = {
981
- source: i,
982
- bounds: F(t, n, i.width, i.height, o.current, 0)
983
- };
984
- if (C.set(e, c), j) {
985
- let r = Z(e), i = {
986
- source: j,
987
- bounds: F(t, n, j.width, j.height, o.current, 0)
988
- };
989
- j.setAttribute("id", r), C.set(r, i), a.push(c, i);
990
- } else a.push(c);
991
- s = !0;
992
- return;
993
- }
994
- let m = d.bounds.center, g = Ot(m, {
995
- x: t,
996
- y: n
997
- }, h.current.get(r));
998
- if (g.reduce((e, t, n) => n === 0 ? e : e + X(g[n - 1], t), 0) >= ht || document.hidden) Tt({
999
- updateQueue: w,
1000
- vehicle: d,
1001
- vehicleFinery: f,
1002
- x: t,
1003
- y: n,
1004
- scale: o.current,
1005
- angle: St(d.bounds.center, {
1006
- x: t,
1007
- y: n
1008
- })
1009
- });
1010
- else {
1011
- let t = kt(g, i, (e) => {
1012
- Tt({
1013
- updateQueue: w,
1014
- vehicle: d,
1015
- vehicleFinery: f,
1016
- x: e.x,
1017
- y: e.y,
1018
- scale: o.current,
1019
- angle: e.angle
1020
- });
1021
- });
1022
- S.set(e, t);
1023
- }
1024
- }), s && w.add(() => O(T));
1025
- } catch (e) {
1026
- console.error("handleSocketMessage", e);
1027
- }
1028
- }, d.current = performance.now(), E(), window.addEventListener("online", D), ee(a.config ? (Number(a.config.vehicle_inactive_interval) || 20) * 1e3 : vt);
1029
- } catch (e) {
1030
- console.warn(e);
1031
- }
1032
- }
1033
- T();
1034
- function E() {
1035
- var e, t;
1036
- y || ((e = l.current) == null ? void 0 : e.readyState) === WebSocket.OPEN || ((t = l.current) == null ? void 0 : t.readyState) === WebSocket.CONNECTING || (l.current = new WebSocket(a), l.current.onmessage = u.current, l.current.onopen = () => {
1037
- g.current = _t;
1038
- }, l.current.onclose = () => {
1039
- y || !navigator.onLine || (b = window.setTimeout(E, g.current), g.current = Math.min(g.current * 2, 3e4));
1040
- });
1041
- }
1042
- function D() {
1043
- E();
1044
- }
1045
- function ee(e) {
1046
- clearInterval(v.current), !y && (v.current = window.setInterval(() => {
1047
- let t = performance.now(), n = [], r = [];
1048
- _.current.forEach((i, a) => {
1049
- if (t - i < e) return;
1050
- let o = C.get(a);
1051
- o && (o.hidden = !0, r.push(o), n.push(a));
1052
- let s = Z(a), c = C.get(s);
1053
- c && (c.hidden = !0, r.push(c), n.push(s));
1054
- }), r.length && w.add(() => O(...r)), n.forEach((e) => _.current.delete(e));
1055
- }, e));
1056
- }
1057
- return () => {
1058
- y = !0, clearTimeout(b);
1059
- let e = l.current;
1060
- e && (e.onopen = null, e.onmessage = null, e.onclose = null, e.close(), l.current = null), u.current = null;
1061
- let t = x.find((e) => e.name === R);
1062
- t && (t.onScale = void 0), S.forEach((e) => e == null ? void 0 : e()), S.clear(), C.clear(), w.destroy(), window.removeEventListener("online", D), clearInterval(v.current);
1063
- };
1064
- }, [
1065
- e,
1066
- n,
1067
- r,
1068
- a
1069
- ]);
1070
- }
1071
- function xt(e) {
1072
- return Math.min(e || window.devicePixelRatio, pt);
1073
- }
1074
- function St(e, t) {
1075
- return I(e, t);
1076
- }
1077
- function Ct({ radius: e, scale: t, color: n }) {
1078
- let r = document.createElement("canvas"), i = r.getContext("2d");
1079
- i.imageSmoothingEnabled = !1;
1080
- let a = Math.ceil(e * 2 * t), o = a / 2, s = e * .78, c = e * .33;
1081
- return r.width = a, r.height = a, i.translate(o, o), i.scale(t, t), i.beginPath(), i.arc(0, 0, e, 0, 2 * Math.PI), i.fillStyle = "#FFFFFF", i.fill(), i.beginPath(), i.arc(0, 0, s, 0, 2 * Math.PI), i.fillStyle = n, i.fill(), i.beginPath(), i.arc(0, 0, c, 0, 2 * Math.PI), i.fillStyle = "#FFFFFF", i.fill(), r;
1082
- }
1083
- function wt({ id: e, width: t, height: n, color: r, scale: i }) {
1084
- let a = 2 * i, o = t / 2 * i, s = n * i, c = .01, l = s * .6, u = s, d = 8 * i, f = u + a + l / 2 + d * 2, p = o * 2 + l + a + d * 2, m = document.createElement("canvas");
1085
- m.setAttribute("id", e), m.width = f, m.height = p;
1086
- let h = m.getContext("2d"), g = f / 2, _ = p / 2;
1087
- h.save(), h.translate(g, _), h.rotate(-Math.PI / 2), h.translate(-g, -_);
1088
- let v = g, y = _ - u / 2 + o, b = y + l;
1089
- return h.shadowColor = "rgba(16, 24, 40, 0.2)", h.shadowBlur = d / 2, h.beginPath(), h.arc(v, y, o, Math.PI, 0, !1), h.bezierCurveTo(v + o, y + s * .3, v + c * o, b, v, b), h.bezierCurveTo(v - c * o, b, v - o, y + s * .3, v - o, y), h.closePath(), h.fillStyle = r, h.fill(), h.strokeStyle = "#FFFFFF", h.lineWidth = a, h.stroke(), h.restore(), m;
1090
- }
1091
- function X(e, t) {
1092
- return C(e, t);
1093
- }
1094
- function Z(e) {
1095
- return `${e}_finery`;
1096
- }
1097
- function Tt({ updateQueue: e, vehicle: t, vehicleFinery: n, x: r, y: i, scale: a, angle: o }) {
1098
- let s = t.source;
1099
- if (t.bounds = F(r, i, s.width, s.height, a, o), t.hidden = !1, n) {
1100
- var c, l;
1101
- let o = (c = (l = m()) == null ? void 0 : l.state().roll) == null ? 0 : c, s = n.source;
1102
- n.bounds = F(r, i, s.width, s.height, a, P(o)), n.hidden = !1, e.add(() => O(n, t));
1103
- } else e.add(() => O(t));
1104
- }
1105
- function Q(e, t, n) {
1106
- return {
1107
- x: e.x + (t.x - e.x) * n,
1108
- y: e.y + (t.y - e.y) * n
1109
- };
1110
- }
1111
- function Et(e, t) {
1112
- let n = Infinity, r = {
1113
- index: 0,
1114
- t: 0
1115
- };
1116
- for (let i = 0; i < t.length - 1; i++) {
1117
- let a = t[i], o = t[i + 1], s = o.x - a.x, c = o.y - a.y, l = s * s + c * c, u = l ? ((e.x - a.x) * s + (e.y - a.y) * c) / l : 0, d = Math.max(0, Math.min(1, u)), f = X(e, Q(a, o, d));
1118
- f < n && (n = f, r = {
1119
- index: i,
1120
- t: d
1121
- });
1122
- }
1123
- return r;
1124
- }
1125
- function Dt(e, t, n) {
1126
- let r = X(e, t), i = Math.max(2, Math.ceil(r / n) + 1), a = [];
1127
- for (let n = 0; n < i; n++) {
1128
- let r = Q(e, t, n / (i - 1));
1129
- a.push(r);
1130
- }
1131
- return a;
1132
- }
1133
- function Ot(e, t, n) {
1134
- if (!n || !n.length) return Dt(e, t, 10);
1135
- let r = Et(e, n), i = Et(t, n), a = [], o = (e) => a.push(e);
1136
- r.index + 1 < n.length ? o(Q(n[r.index], n[r.index + 1], r.t)) : o(n[r.index]);
1137
- for (let e = r.index + 1; e <= i.index && e < n.length; e++) o(n[e]);
1138
- return i.index + 1 < n.length ? o(Q(n[i.index], n[i.index + 1], i.t)) : o(n[i.index]), a;
1139
- }
1140
- function kt(e, t, n, r) {
1141
- if (e.length < 2) return () => {};
1142
- let i = null, a, o = [], s = 0;
1143
- for (let t = 0; t < e.length - 1; t++) {
1144
- let n = C(e[t], e[t + 1]);
1145
- o.push(n), s += n;
1146
- }
1147
- let c = (l) => {
1148
- i || (i = l);
1149
- let u = l - i, d = Math.min(u / t, 1), f = d * s, p = 0, m = 0;
1150
- for (; m < o.length && p + o[m] < f;) p += o[m], m++;
1151
- m >= o.length && (m = o.length - 1);
1152
- let h = e[m], g = e[Math.min(m + 1, e.length - 1)], _ = o[m] || 0, v = _ === 0 ? 0 : (f - p) / _;
1153
- n({
1154
- x: h.x + (g.x - h.x) * v,
1155
- y: h.y + (g.y - h.y) * v,
1156
- angle: I(h, g)
1157
- }), d < 1 ? a = requestAnimationFrame(c) : r && r();
1158
- };
1159
- return a = requestAnimationFrame(c), () => {
1160
- a && cancelAnimationFrame(a);
1161
- };
1162
- }
1163
- function $(e) {
1164
- return `${e.x},${e.y}`;
1165
- }
1166
- //#endregion
1167
- //#region src/utils/dimming.ts
1168
- var At = .5, jt = "cubic";
1169
- function Mt(e, t) {
1170
- return !e || e.rootLayer.dim === t ? !1 : (e.rootLayer.dim = t, !0);
1171
- }
1172
- function Nt(e, t = 300, n = jt) {
1173
- let r = null, i = 0, a = 0, o = 0, s = 0, c = Math.max(t, 0);
1174
- function l() {
1175
- r === null || typeof cancelAnimationFrame != "function" || (cancelAnimationFrame(r), r = null);
1176
- }
1177
- function u(t) {
1178
- l(), i = t, e(i);
1179
- }
1180
- function d(t) {
1181
- let l = t - s, u = Math.min(l / c, 1), f = Pt(u, n);
1182
- if (i = a + (o - a) * f, e(i), u < 1) {
1183
- r = requestAnimationFrame(d);
1184
- return;
1185
- }
1186
- r = null, i = o, e(i);
1187
- }
1188
- return {
1189
- getValue() {
1190
- return i;
1191
- },
1192
- setTarget(e, t = {}) {
1193
- let n = +!!e;
1194
- if (!(!t.immediate && n === o && r === null)) {
1195
- if (o = n, t.immediate || c === 0 || typeof requestAnimationFrame != "function") {
1196
- u(o);
1197
- return;
1198
- }
1199
- l(), a = i, s = typeof performance > "u" ? Date.now() : performance.now(), r = requestAnimationFrame(d);
1200
- }
1201
- },
1202
- stop() {
1203
- l();
1204
- }
1205
- };
1206
- }
1207
- function Pt(e, t) {
1208
- return t === "linear" ? e : Ft(e);
1209
- }
1210
- function Ft(e) {
1211
- return e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2;
1212
- }
1213
- //#endregion
1214
- export { ut as a, Ye as c, bt as i, Ge as l, Mt as n, et as o, Nt as r, Ze as s, At as t };