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