@zonetrix/viewer 2.13.1 → 2.13.3
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.
- package/dist/firebase/client.d.ts +30 -0
- package/dist/hooks/useFirebaseConfig.d.ts +41 -0
- package/dist/hooks/useFirebaseSeatStates.d.ts +53 -0
- package/dist/hooks/useRealtimeSeatMap.d.ts +74 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +294 -289
- package/dist/types/index.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Stage as oe, Layer as
|
|
4
|
-
import { clearFirebaseInstance as
|
|
5
|
-
function
|
|
6
|
-
const [u, e] =
|
|
1
|
+
import { jsx as c, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { useState as A, useCallback as N, useEffect as B, useRef as K, useMemo as z, memo as J } from "react";
|
|
3
|
+
import { Stage as oe, Layer as St, Group as re, Text as Dt, Circle as Nt, Rect as Tt, Path as se, RegularPolygon as ce } from "react-konva";
|
|
4
|
+
import { clearFirebaseInstance as me, getFirebaseDatabase as be, initializeFirebaseForViewer as ve, isFirebaseInitialized as Se, useFirebaseConfig as we, useFirebaseSeatStates as Ce, useRealtimeSeatMap as Me } from "@zonetrix/shared";
|
|
5
|
+
function ae(n) {
|
|
6
|
+
const [u, e] = A(null), [r, S] = A(!1), [y, f] = A(null), x = N(async () => {
|
|
7
7
|
if (n) {
|
|
8
8
|
S(!0), f(null);
|
|
9
9
|
try {
|
|
10
10
|
const g = await fetch(n);
|
|
11
11
|
if (!g.ok)
|
|
12
12
|
throw new Error(`Failed to fetch config: ${g.statusText}`);
|
|
13
|
-
const
|
|
14
|
-
e(
|
|
13
|
+
const a = await g.json();
|
|
14
|
+
e(a);
|
|
15
15
|
} catch (g) {
|
|
16
|
-
const
|
|
17
|
-
f(
|
|
16
|
+
const a = g instanceof Error ? g : new Error("Unknown error occurred");
|
|
17
|
+
f(a), console.error("Failed to fetch seat map config:", a);
|
|
18
18
|
} finally {
|
|
19
19
|
S(!1);
|
|
20
20
|
}
|
|
@@ -30,7 +30,7 @@ function ce(n) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function le(n) {
|
|
33
|
-
const [u, e] =
|
|
33
|
+
const [u, e] = A({ width: 0, height: 0 });
|
|
34
34
|
return B(() => {
|
|
35
35
|
const r = n.current;
|
|
36
36
|
if (!r) return;
|
|
@@ -39,67 +39,69 @@ function le(n) {
|
|
|
39
39
|
const f = new ResizeObserver((x) => {
|
|
40
40
|
const g = x[0];
|
|
41
41
|
if (!g) return;
|
|
42
|
-
const { width:
|
|
43
|
-
|
|
42
|
+
const { width: a, height: p } = g.contentRect;
|
|
43
|
+
a > 0 && p > 0 && e((m) => m.width === a && m.height === p ? m : { width: a, height: p });
|
|
44
44
|
});
|
|
45
45
|
return f.observe(r), () => {
|
|
46
46
|
f.disconnect();
|
|
47
47
|
};
|
|
48
48
|
}, [n]), u;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function kt(n, u) {
|
|
51
51
|
return Math.sqrt(Math.pow(u.x - n.x, 2) + Math.pow(u.y - n.y, 2));
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Rt(n, u) {
|
|
54
54
|
return {
|
|
55
55
|
x: (n.x + u.x) / 2,
|
|
56
56
|
y: (n.y + u.y) / 2
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
function he(n, u) {
|
|
60
|
-
const e =
|
|
60
|
+
const e = K(null), r = K(null), S = K(1), {
|
|
61
61
|
enabled: y,
|
|
62
62
|
minScale: f,
|
|
63
63
|
maxScale: x,
|
|
64
64
|
currentScale: g,
|
|
65
|
-
currentPosition:
|
|
65
|
+
currentPosition: a,
|
|
66
66
|
onScaleChange: p
|
|
67
67
|
} = u;
|
|
68
68
|
B(() => {
|
|
69
|
-
const
|
|
70
|
-
if (!
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
const m = n.current;
|
|
70
|
+
if (!m || !y) return;
|
|
71
|
+
const h = m.container(), I = h.style.touchAction;
|
|
72
|
+
h.style.touchAction = "none";
|
|
73
|
+
const b = (v) => {
|
|
74
|
+
if (v.touches.length === 2) {
|
|
75
|
+
v.preventDefault();
|
|
76
|
+
const T = { x: v.touches[0].clientX, y: v.touches[0].clientY }, P = { x: v.touches[1].clientX, y: v.touches[1].clientY };
|
|
77
|
+
e.current = kt(T, P), r.current = Rt(T, P), S.current = g;
|
|
76
78
|
}
|
|
77
|
-
},
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
const
|
|
79
|
+
}, w = (v) => {
|
|
80
|
+
if (v.touches.length !== 2) return;
|
|
81
|
+
v.preventDefault();
|
|
82
|
+
const T = { x: v.touches[0].clientX, y: v.touches[0].clientY }, P = { x: v.touches[1].clientX, y: v.touches[1].clientY }, F = kt(T, P), W = Rt(T, P);
|
|
81
83
|
if (e.current !== null && r.current !== null) {
|
|
82
|
-
const
|
|
83
|
-
Math.max(g *
|
|
84
|
+
const Q = F / e.current, O = Math.min(
|
|
85
|
+
Math.max(g * Q, f),
|
|
84
86
|
x
|
|
85
|
-
),
|
|
86
|
-
x: (
|
|
87
|
-
y: (
|
|
88
|
-
},
|
|
89
|
-
x:
|
|
90
|
-
y:
|
|
87
|
+
), j = h.getBoundingClientRect(), ct = W.x - j.left, at = W.y - j.top, lt = g, tt = {
|
|
88
|
+
x: (ct - a.x) / lt,
|
|
89
|
+
y: (at - a.y) / lt
|
|
90
|
+
}, Y = W.x - r.current.x, V = W.y - r.current.y, ht = {
|
|
91
|
+
x: ct - tt.x * O + Y,
|
|
92
|
+
y: at - tt.y * O + V
|
|
91
93
|
};
|
|
92
|
-
p(
|
|
94
|
+
p(O, ht), e.current = F, r.current = W;
|
|
93
95
|
}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
+
}, E = (v) => {
|
|
97
|
+
v.touches.length < 2 && (e.current = null, r.current = null);
|
|
96
98
|
};
|
|
97
|
-
return
|
|
99
|
+
return h.addEventListener("touchstart", b, {
|
|
98
100
|
passive: !1
|
|
99
|
-
}),
|
|
101
|
+
}), h.addEventListener("touchmove", w, {
|
|
100
102
|
passive: !1
|
|
101
|
-
}),
|
|
102
|
-
|
|
103
|
+
}), h.addEventListener("touchend", E), () => {
|
|
104
|
+
h.style.touchAction = I, h.removeEventListener("touchstart", b), h.removeEventListener("touchmove", w), h.removeEventListener("touchend", E);
|
|
103
105
|
};
|
|
104
106
|
}, [
|
|
105
107
|
n,
|
|
@@ -107,7 +109,7 @@ function he(n, u) {
|
|
|
107
109
|
f,
|
|
108
110
|
x,
|
|
109
111
|
g,
|
|
110
|
-
|
|
112
|
+
a,
|
|
111
113
|
p
|
|
112
114
|
]);
|
|
113
115
|
}
|
|
@@ -121,7 +123,7 @@ const de = {
|
|
|
121
123
|
seatHidden: "#4a4a4a",
|
|
122
124
|
gridLines: "#404040",
|
|
123
125
|
currency: "KD"
|
|
124
|
-
}, Wt =
|
|
126
|
+
}, Wt = J(
|
|
125
127
|
({ seat: n, state: u, colors: e, onClick: r, onMouseEnter: S, onMouseLeave: y }) => {
|
|
126
128
|
const f = (n.size || 24) / 2, g = {
|
|
127
129
|
available: e.seatAvailable,
|
|
@@ -130,35 +132,36 @@ const de = {
|
|
|
130
132
|
unavailable: e.seatUnavailable,
|
|
131
133
|
hidden: e.seatHidden
|
|
132
134
|
// Hidden seats are filtered out, but included for type safety
|
|
133
|
-
}[u],
|
|
134
|
-
|
|
135
|
-
}, [n, r,
|
|
136
|
-
(
|
|
137
|
-
S(n,
|
|
138
|
-
const w =
|
|
139
|
-
w &&
|
|
135
|
+
}[u], a = u === "available" || u === "selected", p = N(() => {
|
|
136
|
+
a && r(n);
|
|
137
|
+
}, [n, r, a]), m = N(
|
|
138
|
+
(b) => {
|
|
139
|
+
S(n, b);
|
|
140
|
+
const w = b.target.getStage();
|
|
141
|
+
w && a && (w.container().style.cursor = "pointer");
|
|
140
142
|
},
|
|
141
|
-
[n, S,
|
|
142
|
-
),
|
|
143
|
-
(
|
|
143
|
+
[n, S, a]
|
|
144
|
+
), h = N(
|
|
145
|
+
(b) => {
|
|
144
146
|
y();
|
|
145
|
-
const w =
|
|
147
|
+
const w = b.target.getStage();
|
|
146
148
|
w && (w.container().style.cursor = "grab");
|
|
147
149
|
},
|
|
148
150
|
[y]
|
|
149
151
|
), I = {
|
|
150
152
|
x: n.position.x,
|
|
151
153
|
y: n.position.y,
|
|
154
|
+
rotation: n.rotation || 0,
|
|
152
155
|
fill: g,
|
|
153
156
|
stroke: "#ffffff",
|
|
154
157
|
strokeWidth: 1,
|
|
155
158
|
onClick: p,
|
|
156
159
|
onTap: p,
|
|
157
|
-
onMouseEnter:
|
|
158
|
-
onMouseLeave:
|
|
160
|
+
onMouseEnter: m,
|
|
161
|
+
onMouseLeave: h
|
|
159
162
|
};
|
|
160
|
-
return n.shape === "circle" ? /* @__PURE__ */
|
|
161
|
-
|
|
163
|
+
return n.shape === "circle" ? /* @__PURE__ */ c(Nt, { ...I, radius: f }) : /* @__PURE__ */ c(
|
|
164
|
+
Tt,
|
|
162
165
|
{
|
|
163
166
|
...I,
|
|
164
167
|
width: f * 2,
|
|
@@ -171,59 +174,59 @@ const de = {
|
|
|
171
174
|
}
|
|
172
175
|
);
|
|
173
176
|
Wt.displayName = "ViewerSeat";
|
|
174
|
-
const
|
|
177
|
+
const Xt = J(({ stage: n, stageColor: u }) => {
|
|
175
178
|
const e = n.config, r = e.shape || "rectangle", S = e.showLabel !== !1, y = e.color || u, f = e.width / e.height, x = f < 0.5, g = f > 2;
|
|
176
|
-
let
|
|
177
|
-
x ?
|
|
178
|
-
const p = e.label?.length || 6, I = e.width * 0.85 / p * 1.5,
|
|
179
|
+
let a;
|
|
180
|
+
x ? a = e.width * 0.25 : g ? a = e.height * 0.35 : a = Math.min(e.width, e.height) * 0.25;
|
|
181
|
+
const p = e.label?.length || 6, I = e.width * 0.85 / p * 1.5, b = Math.max(
|
|
179
182
|
10,
|
|
180
|
-
Math.min(24, Math.min(
|
|
181
|
-
), w = 4,
|
|
183
|
+
Math.min(24, Math.min(a, I))
|
|
184
|
+
), w = 4, E = Math.max(20, e.width - w * 2), v = (e.width - E) / 2, T = {
|
|
182
185
|
fill: y + "80",
|
|
183
186
|
stroke: "#ffffff",
|
|
184
187
|
strokeWidth: 2,
|
|
185
188
|
perfectDrawEnabled: !1,
|
|
186
189
|
hitStrokeWidth: 0
|
|
187
|
-
},
|
|
190
|
+
}, P = () => {
|
|
188
191
|
switch (r) {
|
|
189
192
|
case "circle": {
|
|
190
|
-
const
|
|
191
|
-
return /* @__PURE__ */
|
|
192
|
-
|
|
193
|
+
const F = Math.min(e.width, e.height) / 2;
|
|
194
|
+
return /* @__PURE__ */ c(
|
|
195
|
+
Nt,
|
|
193
196
|
{
|
|
194
197
|
x: e.width / 2,
|
|
195
198
|
y: e.height / 2,
|
|
196
|
-
radius:
|
|
197
|
-
...
|
|
199
|
+
radius: F,
|
|
200
|
+
...T
|
|
198
201
|
}
|
|
199
202
|
);
|
|
200
203
|
}
|
|
201
204
|
case "triangle": {
|
|
202
|
-
const
|
|
203
|
-
return /* @__PURE__ */
|
|
204
|
-
|
|
205
|
+
const F = Math.min(e.width, e.height) / 2;
|
|
206
|
+
return /* @__PURE__ */ c(
|
|
207
|
+
ce,
|
|
205
208
|
{
|
|
206
209
|
x: e.width / 2,
|
|
207
210
|
y: e.height / 2,
|
|
208
211
|
sides: 3,
|
|
209
|
-
radius:
|
|
212
|
+
radius: F,
|
|
210
213
|
rotation: -90,
|
|
211
|
-
...
|
|
214
|
+
...T
|
|
212
215
|
}
|
|
213
216
|
);
|
|
214
217
|
}
|
|
215
218
|
case "arrow": {
|
|
216
|
-
const
|
|
217
|
-
return /* @__PURE__ */
|
|
219
|
+
const F = e.width / 24, W = e.height / 24, Q = `M${9 * F},${18 * W} v${-8 * W} H${5 * F} l${7 * F},${-7 * W} l${7 * F},${7 * W} h${-4 * F} v${8 * W} Z`;
|
|
220
|
+
return /* @__PURE__ */ c(se, { data: Q, ...T });
|
|
218
221
|
}
|
|
219
222
|
default:
|
|
220
|
-
return /* @__PURE__ */
|
|
221
|
-
|
|
223
|
+
return /* @__PURE__ */ c(
|
|
224
|
+
Tt,
|
|
222
225
|
{
|
|
223
226
|
width: e.width,
|
|
224
227
|
height: e.height,
|
|
225
228
|
cornerRadius: 10,
|
|
226
|
-
...
|
|
229
|
+
...T
|
|
227
230
|
}
|
|
228
231
|
);
|
|
229
232
|
}
|
|
@@ -235,16 +238,16 @@ const Tt = K(({ stage: n, stageColor: u }) => {
|
|
|
235
238
|
y: n.position.y,
|
|
236
239
|
rotation: e.rotation || 0,
|
|
237
240
|
children: [
|
|
238
|
-
|
|
239
|
-
S && /* @__PURE__ */
|
|
240
|
-
|
|
241
|
+
P(),
|
|
242
|
+
S && /* @__PURE__ */ c(
|
|
243
|
+
Dt,
|
|
241
244
|
{
|
|
242
245
|
text: e.label,
|
|
243
|
-
x:
|
|
246
|
+
x: v,
|
|
244
247
|
y: w,
|
|
245
|
-
width:
|
|
248
|
+
width: E,
|
|
246
249
|
height: e.height - w * 2,
|
|
247
|
-
fontSize:
|
|
250
|
+
fontSize: b,
|
|
248
251
|
fontStyle: "bold",
|
|
249
252
|
fill: "#ffffff",
|
|
250
253
|
align: "center",
|
|
@@ -257,9 +260,9 @@ const Tt = K(({ stage: n, stageColor: u }) => {
|
|
|
257
260
|
}
|
|
258
261
|
);
|
|
259
262
|
});
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
+
Xt.displayName = "ViewerStage";
|
|
264
|
+
const Yt = J(({ text: n }) => /* @__PURE__ */ c(
|
|
265
|
+
Dt,
|
|
263
266
|
{
|
|
264
267
|
x: n.position.x,
|
|
265
268
|
y: n.position.y,
|
|
@@ -267,11 +270,13 @@ const Lt = K(({ text: n }) => /* @__PURE__ */ a(
|
|
|
267
270
|
fontSize: n.config.fontSize,
|
|
268
271
|
fill: n.config.color,
|
|
269
272
|
rotation: n.config.rotation || 0,
|
|
273
|
+
scaleX: n.config.scaleX || 1,
|
|
274
|
+
scaleY: n.config.scaleY || 1,
|
|
270
275
|
listening: !1
|
|
271
276
|
}
|
|
272
277
|
));
|
|
273
|
-
|
|
274
|
-
const
|
|
278
|
+
Yt.displayName = "ViewerText";
|
|
279
|
+
const Lt = J(
|
|
275
280
|
({
|
|
276
281
|
floors: n,
|
|
277
282
|
currentFloorId: u,
|
|
@@ -282,9 +287,9 @@ const $t = K(
|
|
|
282
287
|
className: f
|
|
283
288
|
}) => {
|
|
284
289
|
const x = z(
|
|
285
|
-
() => [...n].sort((
|
|
290
|
+
() => [...n].sort((h, I) => h.order - I.order),
|
|
286
291
|
[n]
|
|
287
|
-
),
|
|
292
|
+
), a = {
|
|
288
293
|
position: "absolute",
|
|
289
294
|
display: "flex",
|
|
290
295
|
alignItems: "center",
|
|
@@ -312,36 +317,36 @@ const $t = K(
|
|
|
312
317
|
transition: "all 0.2s ease",
|
|
313
318
|
minHeight: "44px",
|
|
314
319
|
touchAction: "manipulation"
|
|
315
|
-
},
|
|
320
|
+
}, m = {
|
|
316
321
|
...p,
|
|
317
322
|
backgroundColor: "#3A7DE5",
|
|
318
323
|
borderColor: "#3A7DE5"
|
|
319
324
|
};
|
|
320
|
-
return /* @__PURE__ */ k("div", { className: f, style:
|
|
321
|
-
r && /* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ k("div", { className: f, style: a, children: [
|
|
326
|
+
r && /* @__PURE__ */ c(
|
|
322
327
|
"button",
|
|
323
328
|
{
|
|
324
329
|
type: "button",
|
|
325
330
|
onClick: () => e(null),
|
|
326
|
-
style: u === null ?
|
|
331
|
+
style: u === null ? m : p,
|
|
327
332
|
children: S
|
|
328
333
|
}
|
|
329
334
|
),
|
|
330
|
-
x.map((
|
|
335
|
+
x.map((h) => /* @__PURE__ */ c(
|
|
331
336
|
"button",
|
|
332
337
|
{
|
|
333
338
|
type: "button",
|
|
334
|
-
onClick: () => e(
|
|
335
|
-
style: u ===
|
|
336
|
-
children:
|
|
339
|
+
onClick: () => e(h.id),
|
|
340
|
+
style: u === h.id ? m : p,
|
|
341
|
+
children: h.name
|
|
337
342
|
},
|
|
338
|
-
|
|
343
|
+
h.id
|
|
339
344
|
))
|
|
340
345
|
] });
|
|
341
346
|
}
|
|
342
347
|
);
|
|
343
|
-
|
|
344
|
-
const
|
|
348
|
+
Lt.displayName = "FloorSelectorBar";
|
|
349
|
+
const $t = J(
|
|
345
350
|
({ scale: n, minScale: u, maxScale: e, fitScale: r, onZoomIn: S, onZoomOut: y, onFitToScreen: f, position: x, className: g }) => {
|
|
346
351
|
const p = {
|
|
347
352
|
position: "absolute",
|
|
@@ -359,7 +364,7 @@ const Et = K(
|
|
|
359
364
|
"bottom-left": { bottom: 0, left: 0 },
|
|
360
365
|
"bottom-right": { bottom: 0, right: 0 }
|
|
361
366
|
}[x]
|
|
362
|
-
},
|
|
367
|
+
}, m = {
|
|
363
368
|
width: "44px",
|
|
364
369
|
height: "44px",
|
|
365
370
|
minWidth: "44px",
|
|
@@ -376,43 +381,43 @@ const Et = K(
|
|
|
376
381
|
justifyContent: "center",
|
|
377
382
|
transition: "all 0.2s ease",
|
|
378
383
|
touchAction: "manipulation"
|
|
379
|
-
},
|
|
380
|
-
...
|
|
384
|
+
}, h = {
|
|
385
|
+
...m,
|
|
381
386
|
opacity: 0.4,
|
|
382
387
|
cursor: "not-allowed"
|
|
383
|
-
}, I = n < e,
|
|
388
|
+
}, I = n < e, b = n > u, w = Math.abs(n - r) < 0.01;
|
|
384
389
|
return /* @__PURE__ */ k("div", { className: g, style: p, children: [
|
|
385
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ c(
|
|
386
391
|
"button",
|
|
387
392
|
{
|
|
388
393
|
type: "button",
|
|
389
394
|
onClick: S,
|
|
390
395
|
disabled: !I,
|
|
391
|
-
style: I ?
|
|
396
|
+
style: I ? m : h,
|
|
392
397
|
title: "Zoom In",
|
|
393
398
|
"aria-label": "Zoom In",
|
|
394
399
|
children: "+"
|
|
395
400
|
}
|
|
396
401
|
),
|
|
397
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ c(
|
|
398
403
|
"button",
|
|
399
404
|
{
|
|
400
405
|
type: "button",
|
|
401
406
|
onClick: f,
|
|
402
407
|
disabled: w,
|
|
403
|
-
style: w ?
|
|
408
|
+
style: w ? h : m,
|
|
404
409
|
title: "Fit to Screen",
|
|
405
410
|
"aria-label": "Fit to Screen",
|
|
406
411
|
children: "⤢"
|
|
407
412
|
}
|
|
408
413
|
),
|
|
409
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ c(
|
|
410
415
|
"button",
|
|
411
416
|
{
|
|
412
417
|
type: "button",
|
|
413
418
|
onClick: y,
|
|
414
|
-
disabled: !
|
|
415
|
-
style:
|
|
419
|
+
disabled: !b,
|
|
420
|
+
style: b ? m : h,
|
|
416
421
|
title: "Zoom Out",
|
|
417
422
|
"aria-label": "Zoom Out",
|
|
418
423
|
children: "−"
|
|
@@ -421,8 +426,8 @@ const Et = K(
|
|
|
421
426
|
] });
|
|
422
427
|
}
|
|
423
428
|
);
|
|
424
|
-
|
|
425
|
-
const
|
|
429
|
+
$t.displayName = "ZoomControls";
|
|
430
|
+
const At = J(
|
|
426
431
|
({ visible: n, x: u, y: e, seat: r, currency: S, state: y }) => {
|
|
427
432
|
if (!n || !r) return null;
|
|
428
433
|
const f = r.seatNumber || (r.rowLabel && r.columnLabel ? `${r.rowLabel}-${r.columnLabel}` : "N/A"), x = {
|
|
@@ -440,45 +445,45 @@ const Xt = K(
|
|
|
440
445
|
fontSize: "13px",
|
|
441
446
|
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)",
|
|
442
447
|
minWidth: "140px"
|
|
443
|
-
},
|
|
448
|
+
}, a = {
|
|
444
449
|
color: "#9ca3af",
|
|
445
450
|
marginRight: "4px"
|
|
446
451
|
}, p = {
|
|
447
452
|
fontWeight: 600
|
|
448
|
-
},
|
|
453
|
+
}, m = {
|
|
449
454
|
color: "#4ade80",
|
|
450
455
|
fontWeight: 600
|
|
451
|
-
},
|
|
456
|
+
}, h = {
|
|
452
457
|
fontSize: "11px",
|
|
453
458
|
color: "#6b7280",
|
|
454
459
|
textTransform: "capitalize",
|
|
455
460
|
marginTop: "4px"
|
|
456
461
|
};
|
|
457
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ c("div", { style: x, children: /* @__PURE__ */ k("div", { style: g, children: [
|
|
458
463
|
r.sectionName && /* @__PURE__ */ k("div", { style: { marginBottom: "4px" }, children: [
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ c("span", { style: a, children: "Section:" }),
|
|
465
|
+
/* @__PURE__ */ c("span", { style: { ...p, color: "#3b82f6" }, children: r.sectionName })
|
|
461
466
|
] }),
|
|
462
467
|
/* @__PURE__ */ k("div", { style: { marginBottom: "4px" }, children: [
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ c("span", { style: a, children: "Seat:" }),
|
|
469
|
+
/* @__PURE__ */ c("span", { style: p, children: f })
|
|
465
470
|
] }),
|
|
466
471
|
r.price !== void 0 && r.price > 0 && y === "available" && /* @__PURE__ */ k("div", { style: { marginBottom: "4px" }, children: [
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */ k("span", { style:
|
|
472
|
+
/* @__PURE__ */ c("span", { style: a, children: "Price:" }),
|
|
473
|
+
/* @__PURE__ */ k("span", { style: m, children: [
|
|
469
474
|
S,
|
|
470
475
|
" ",
|
|
471
476
|
r.price.toFixed(2)
|
|
472
477
|
] })
|
|
473
478
|
] }),
|
|
474
|
-
/* @__PURE__ */ k("div", { style:
|
|
479
|
+
/* @__PURE__ */ k("div", { style: h, children: [
|
|
475
480
|
"Status: ",
|
|
476
481
|
y
|
|
477
482
|
] })
|
|
478
483
|
] }) });
|
|
479
484
|
}
|
|
480
485
|
);
|
|
481
|
-
|
|
486
|
+
At.displayName = "SeatTooltip";
|
|
482
487
|
const pe = ({
|
|
483
488
|
config: n,
|
|
484
489
|
configUrl: u,
|
|
@@ -490,84 +495,84 @@ const pe = ({
|
|
|
490
495
|
unavailableSeats: f = [],
|
|
491
496
|
selectedSeats: x,
|
|
492
497
|
myReservedSeats: g = [],
|
|
493
|
-
onSeatSelect:
|
|
498
|
+
onSeatSelect: a,
|
|
494
499
|
onSeatDeselect: p,
|
|
495
|
-
onSelectionChange:
|
|
496
|
-
colorOverrides:
|
|
500
|
+
onSelectionChange: m,
|
|
501
|
+
colorOverrides: h,
|
|
497
502
|
showTooltip: I = !0,
|
|
498
|
-
zoomEnabled:
|
|
503
|
+
zoomEnabled: b = !0,
|
|
499
504
|
className: w = "",
|
|
500
|
-
onConfigLoad:
|
|
501
|
-
onError:
|
|
505
|
+
onConfigLoad: E,
|
|
506
|
+
onError: v,
|
|
502
507
|
// Floor selector props
|
|
503
|
-
showFloorSelector:
|
|
504
|
-
floorSelectorPosition:
|
|
505
|
-
floorSelectorClassName:
|
|
506
|
-
showAllFloorsOption:
|
|
507
|
-
allFloorsLabel:
|
|
508
|
-
fitToView:
|
|
508
|
+
showFloorSelector: T,
|
|
509
|
+
floorSelectorPosition: P = "top-left",
|
|
510
|
+
floorSelectorClassName: F,
|
|
511
|
+
showAllFloorsOption: W = !0,
|
|
512
|
+
allFloorsLabel: Q = "All",
|
|
513
|
+
fitToView: O = !0,
|
|
509
514
|
fitPadding: j = 40,
|
|
510
515
|
// Zoom controls
|
|
511
|
-
showZoomControls:
|
|
512
|
-
zoomControlsPosition:
|
|
513
|
-
zoomControlsClassName:
|
|
514
|
-
minZoom:
|
|
515
|
-
maxZoom:
|
|
516
|
+
showZoomControls: ct = !0,
|
|
517
|
+
zoomControlsPosition: at = "bottom-right",
|
|
518
|
+
zoomControlsClassName: lt,
|
|
519
|
+
minZoom: tt,
|
|
520
|
+
maxZoom: Y = 3,
|
|
516
521
|
zoomStep: V = 0.25,
|
|
517
522
|
// Touch gestures
|
|
518
|
-
touchEnabled:
|
|
523
|
+
touchEnabled: ht = !0
|
|
519
524
|
}) => {
|
|
520
|
-
const
|
|
525
|
+
const wt = y !== void 0 ? y : S, yt = K(null), Ct = K(null), C = le(Ct), [Z, Mt] = A(
|
|
521
526
|
/* @__PURE__ */ new Set()
|
|
522
|
-
), [R,
|
|
527
|
+
), [R, et] = A(1), [X, _] = A({ x: 0, y: 0 }), [Et, Pt] = A(null), [It, zt] = A(1), dt = K({ width: 0, height: 0 }), [nt, Ft] = A({ visible: !1, x: 0, y: 0, seat: null, state: "available" }), { config: Bt, loading: Ht, error: it } = ae(u), s = n || Bt, xt = e !== void 0, D = xt ? e || null : Et, ut = x !== void 0, Ot = N(
|
|
523
528
|
(t) => {
|
|
524
|
-
|
|
529
|
+
xt || Pt(t), r?.(t);
|
|
525
530
|
},
|
|
526
|
-
[
|
|
527
|
-
),
|
|
528
|
-
() => s ? { ...s.colors, ...
|
|
529
|
-
[s,
|
|
531
|
+
[xt, r]
|
|
532
|
+
), mt = s?.floors || [], jt = T !== void 0 ? T : mt.length > 1, ft = z(
|
|
533
|
+
() => s ? { ...s.colors, ...h } : { ...de, ...h },
|
|
534
|
+
[s, h]
|
|
530
535
|
), q = z(() => {
|
|
531
536
|
if (!s) return [];
|
|
532
537
|
let t = s.seats.filter((i) => i.state !== "hidden");
|
|
533
538
|
return D && (t = t.filter(
|
|
534
539
|
(i) => i.floorId === D || !i.floorId && D === "floor_default"
|
|
535
540
|
)), t;
|
|
536
|
-
}, [s, D]),
|
|
541
|
+
}, [s, D]), gt = z(() => s?.stages ? D ? s.stages.filter(
|
|
537
542
|
(t) => t.floorId === D || !t.floorId && D === "floor_default"
|
|
538
|
-
) : s.stages : [], [s, D]),
|
|
543
|
+
) : s.stages : [], [s, D]), pt = z(() => s?.texts ? D ? s.texts.filter(
|
|
539
544
|
(t) => t.floorId === D || !t.floorId && D === "floor_default"
|
|
540
|
-
) : s.texts : [], [s, D]),
|
|
541
|
-
if (!s || q.length === 0 &&
|
|
545
|
+
) : s.texts : [], [s, D]), L = z(() => {
|
|
546
|
+
if (!s || q.length === 0 && gt.length === 0 && pt.length === 0)
|
|
542
547
|
return null;
|
|
543
|
-
let t = 1 / 0, i = 1 / 0, l = -1 / 0,
|
|
548
|
+
let t = 1 / 0, i = 1 / 0, l = -1 / 0, d = -1 / 0;
|
|
544
549
|
return q.forEach((o) => {
|
|
545
|
-
const
|
|
546
|
-
t = Math.min(t, o.position.x -
|
|
547
|
-
}),
|
|
548
|
-
t = Math.min(t, o.position.x), i = Math.min(i, o.position.y), l = Math.max(l, o.position.x + (o.config?.width || 200)),
|
|
549
|
-
}),
|
|
550
|
-
const
|
|
551
|
-
t = Math.min(t, o.position.x), i = Math.min(i, o.position.y), l = Math.max(l, o.position.x +
|
|
552
|
-
}), { minX: t, minY: i, maxX: l, maxY:
|
|
553
|
-
}, [s, q,
|
|
554
|
-
if (!s || !
|
|
555
|
-
const t = C.width, i = C.height, l = t - j * 2,
|
|
556
|
-
|
|
557
|
-
}, [s,
|
|
550
|
+
const M = (o.size || 24) / 2;
|
|
551
|
+
t = Math.min(t, o.position.x - M), i = Math.min(i, o.position.y - M), l = Math.max(l, o.position.x + M), d = Math.max(d, o.position.y + M);
|
|
552
|
+
}), gt.forEach((o) => {
|
|
553
|
+
t = Math.min(t, o.position.x), i = Math.min(i, o.position.y), l = Math.max(l, o.position.x + (o.config?.width || 200)), d = Math.max(d, o.position.y + (o.config?.height || 100));
|
|
554
|
+
}), pt.forEach((o) => {
|
|
555
|
+
const M = o.config.scaleX || 1, $ = o.config.scaleY || 1, U = o.config.text.length * o.config.fontSize * 0.6 * M, st = o.config.fontSize * $;
|
|
556
|
+
t = Math.min(t, o.position.x), i = Math.min(i, o.position.y), l = Math.max(l, o.position.x + U), d = Math.max(d, o.position.y + st);
|
|
557
|
+
}), { minX: t, minY: i, maxX: l, maxY: d, width: l - t, height: d - i };
|
|
558
|
+
}, [s, q, gt, pt]), bt = N(() => {
|
|
559
|
+
if (!s || !L || C.width === 0 || C.height === 0) return;
|
|
560
|
+
const t = C.width, i = C.height, l = t - j * 2, d = i - j * 2, o = l / L.width, M = d / L.height, $ = Math.min(o, M, Y), U = L.minX + L.width / 2, st = L.minY + L.height / 2, te = t / 2, ee = i / 2, ne = te - U * $, ie = ee - st * $;
|
|
561
|
+
et($), _({ x: ne, y: ie }), zt($);
|
|
562
|
+
}, [s, L, C, j, Y]);
|
|
558
563
|
B(() => {
|
|
559
|
-
if (!
|
|
564
|
+
if (!O || !s || !L || C.width === 0 || C.height === 0) return;
|
|
560
565
|
const t = Math.abs(
|
|
561
|
-
C.width -
|
|
566
|
+
C.width - dt.current.width
|
|
562
567
|
), i = Math.abs(
|
|
563
|
-
C.height -
|
|
568
|
+
C.height - dt.current.height
|
|
564
569
|
);
|
|
565
|
-
!(
|
|
566
|
-
}, [
|
|
570
|
+
!(dt.current.width === 0) && t < 10 && i < 10 || (dt.current = C, bt());
|
|
571
|
+
}, [O, s, L, C, D, bt]);
|
|
567
572
|
const H = z(() => {
|
|
568
|
-
const t = new Set(
|
|
573
|
+
const t = new Set(wt), i = new Set(f), l = new Set(g);
|
|
569
574
|
return { reserved: t, unavailable: i, myReserved: l };
|
|
570
|
-
}, [
|
|
575
|
+
}, [wt, f, g]), vt = z(() => x ? new Set(x) : null, [x]), ot = N(
|
|
571
576
|
(t) => {
|
|
572
577
|
const i = t.id, l = t.seatNumber || "";
|
|
573
578
|
return H.unavailable.has(i) || H.unavailable.has(l) ? "unavailable" : H.reserved.has(i) || H.reserved.has(l) ? "reserved" : H.myReserved.has(i) || H.myReserved.has(l) || Z.has(i) ? "selected" : t.state;
|
|
@@ -575,76 +580,76 @@ const pe = ({
|
|
|
575
580
|
[H, Z]
|
|
576
581
|
);
|
|
577
582
|
B(() => {
|
|
578
|
-
s &&
|
|
579
|
-
}, [s,
|
|
580
|
-
|
|
581
|
-
}, [
|
|
582
|
-
|
|
583
|
-
}, [
|
|
583
|
+
s && E && E(s);
|
|
584
|
+
}, [s, E]), B(() => {
|
|
585
|
+
it && v && v(it);
|
|
586
|
+
}, [it, v]), B(() => {
|
|
587
|
+
ut && vt && Mt(vt);
|
|
588
|
+
}, [ut, vt]);
|
|
584
589
|
const Vt = N(
|
|
585
590
|
(t) => {
|
|
586
|
-
const i =
|
|
591
|
+
const i = ot(t);
|
|
587
592
|
if (i !== "available" && i !== "selected")
|
|
588
593
|
return;
|
|
589
594
|
const l = Z.has(t.id);
|
|
590
|
-
|
|
591
|
-
const o = new Set(
|
|
595
|
+
ut || Mt((d) => {
|
|
596
|
+
const o = new Set(d);
|
|
592
597
|
return l ? o.delete(t.id) : o.add(t.id), o;
|
|
593
|
-
}), l ? p?.(t) : (
|
|
598
|
+
}), l ? p?.(t) : (a?.(t), a || console.log("Seat selected:", t));
|
|
594
599
|
},
|
|
595
600
|
[
|
|
596
|
-
|
|
601
|
+
ot,
|
|
597
602
|
Z,
|
|
598
|
-
|
|
599
|
-
|
|
603
|
+
ut,
|
|
604
|
+
a,
|
|
600
605
|
p
|
|
601
606
|
]
|
|
602
|
-
),
|
|
607
|
+
), rt = z(() => s ? q.filter((t) => Z.has(t.id)) : [], [s, q, Z]);
|
|
603
608
|
B(() => {
|
|
604
|
-
|
|
605
|
-
}, [
|
|
606
|
-
const G =
|
|
607
|
-
if (!
|
|
608
|
-
const t = Math.min(R + V,
|
|
609
|
+
m?.(rt);
|
|
610
|
+
}, [rt, m]);
|
|
611
|
+
const G = tt !== void 0 ? tt : It * 0.5, Zt = N(() => {
|
|
612
|
+
if (!b) return;
|
|
613
|
+
const t = Math.min(R + V, Y);
|
|
609
614
|
if (t !== R) {
|
|
610
|
-
const i = C.width || s?.canvas.width || 800, l = C.height || s?.canvas.height || 600,
|
|
611
|
-
x: (
|
|
612
|
-
y: (o -
|
|
615
|
+
const i = C.width || s?.canvas.width || 800, l = C.height || s?.canvas.height || 600, d = i / 2, o = l / 2, M = {
|
|
616
|
+
x: (d - X.x) / R,
|
|
617
|
+
y: (o - X.y) / R
|
|
613
618
|
};
|
|
614
|
-
|
|
615
|
-
x:
|
|
616
|
-
y: o -
|
|
619
|
+
et(t), _({
|
|
620
|
+
x: d - M.x * t,
|
|
621
|
+
y: o - M.y * t
|
|
617
622
|
});
|
|
618
623
|
}
|
|
619
624
|
}, [
|
|
620
|
-
|
|
625
|
+
b,
|
|
621
626
|
R,
|
|
622
627
|
V,
|
|
623
|
-
|
|
628
|
+
Y,
|
|
624
629
|
C,
|
|
625
630
|
s,
|
|
626
|
-
|
|
631
|
+
X
|
|
627
632
|
]), _t = N(() => {
|
|
628
|
-
if (!
|
|
633
|
+
if (!b) return;
|
|
629
634
|
const t = Math.max(R - V, G);
|
|
630
635
|
if (t !== R) {
|
|
631
|
-
const i = C.width || s?.canvas.width || 800, l = C.height || s?.canvas.height || 600,
|
|
632
|
-
x: (
|
|
633
|
-
y: (o -
|
|
636
|
+
const i = C.width || s?.canvas.width || 800, l = C.height || s?.canvas.height || 600, d = i / 2, o = l / 2, M = {
|
|
637
|
+
x: (d - X.x) / R,
|
|
638
|
+
y: (o - X.y) / R
|
|
634
639
|
};
|
|
635
|
-
|
|
636
|
-
x:
|
|
637
|
-
y: o -
|
|
640
|
+
et(t), _({
|
|
641
|
+
x: d - M.x * t,
|
|
642
|
+
y: o - M.y * t
|
|
638
643
|
});
|
|
639
644
|
}
|
|
640
645
|
}, [
|
|
641
|
-
|
|
646
|
+
b,
|
|
642
647
|
R,
|
|
643
648
|
V,
|
|
644
649
|
G,
|
|
645
650
|
C,
|
|
646
651
|
s,
|
|
647
|
-
|
|
652
|
+
X
|
|
648
653
|
]), qt = N((t) => {
|
|
649
654
|
_({
|
|
650
655
|
x: t.target.x(),
|
|
@@ -652,31 +657,31 @@ const pe = ({
|
|
|
652
657
|
});
|
|
653
658
|
}, []), Gt = N(
|
|
654
659
|
(t) => {
|
|
655
|
-
if (!
|
|
660
|
+
if (!b) return;
|
|
656
661
|
t.evt.preventDefault();
|
|
657
|
-
const i =
|
|
662
|
+
const i = yt.current;
|
|
658
663
|
if (!i) return;
|
|
659
|
-
const l = i.scaleX(),
|
|
660
|
-
if (!
|
|
661
|
-
const o = 1.1,
|
|
662
|
-
x: (
|
|
663
|
-
y: (
|
|
664
|
-
},
|
|
665
|
-
x:
|
|
666
|
-
y:
|
|
664
|
+
const l = i.scaleX(), d = i.getPointerPosition();
|
|
665
|
+
if (!d) return;
|
|
666
|
+
const o = 1.1, M = t.evt.deltaY > 0 ? l / o : l * o, $ = Math.min(Math.max(M, G), Y), U = {
|
|
667
|
+
x: (d.x - X.x) / l,
|
|
668
|
+
y: (d.y - X.y) / l
|
|
669
|
+
}, st = {
|
|
670
|
+
x: d.x - U.x * $,
|
|
671
|
+
y: d.y - U.y * $
|
|
667
672
|
};
|
|
668
|
-
|
|
673
|
+
et($), _(st);
|
|
669
674
|
},
|
|
670
|
-
[
|
|
675
|
+
[b, X, G, Y]
|
|
671
676
|
);
|
|
672
|
-
he(
|
|
673
|
-
enabled:
|
|
677
|
+
he(yt, {
|
|
678
|
+
enabled: ht && b,
|
|
674
679
|
minScale: G,
|
|
675
|
-
maxScale:
|
|
680
|
+
maxScale: Y,
|
|
676
681
|
currentScale: R,
|
|
677
|
-
currentPosition:
|
|
682
|
+
currentPosition: X,
|
|
678
683
|
onScaleChange: (t, i) => {
|
|
679
|
-
|
|
684
|
+
et(t), _(i);
|
|
680
685
|
}
|
|
681
686
|
});
|
|
682
687
|
const Ut = N(
|
|
@@ -684,60 +689,60 @@ const pe = ({
|
|
|
684
689
|
if (!I) return;
|
|
685
690
|
const l = i.target.getStage();
|
|
686
691
|
if (!l) return;
|
|
687
|
-
const
|
|
688
|
-
if (!
|
|
692
|
+
const d = l.getPointerPosition();
|
|
693
|
+
if (!d) return;
|
|
689
694
|
const o = l.container().getBoundingClientRect();
|
|
690
|
-
|
|
695
|
+
Ft({
|
|
691
696
|
visible: !0,
|
|
692
|
-
x: o.left +
|
|
693
|
-
y: o.top +
|
|
697
|
+
x: o.left + d.x,
|
|
698
|
+
y: o.top + d.y,
|
|
694
699
|
seat: t,
|
|
695
|
-
state:
|
|
700
|
+
state: ot(t)
|
|
696
701
|
});
|
|
697
702
|
},
|
|
698
|
-
[I,
|
|
703
|
+
[I, ot]
|
|
699
704
|
), Kt = N(() => {
|
|
700
|
-
|
|
705
|
+
Ft((t) => ({ ...t, visible: !1 }));
|
|
701
706
|
}, []);
|
|
702
707
|
if (Ht)
|
|
703
|
-
return /* @__PURE__ */
|
|
704
|
-
if (
|
|
705
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ c("div", { className: `flex items-center justify-center h-full ${w}`, children: /* @__PURE__ */ c("p", { children: "Loading seat map..." }) });
|
|
709
|
+
if (it)
|
|
710
|
+
return /* @__PURE__ */ c("div", { className: `flex items-center justify-center h-full ${w}`, children: /* @__PURE__ */ k("p", { className: "text-red-500", children: [
|
|
706
711
|
"Error loading seat map: ",
|
|
707
|
-
|
|
712
|
+
it.message
|
|
708
713
|
] }) });
|
|
709
714
|
if (!s)
|
|
710
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ c("div", { className: `flex items-center justify-center h-full ${w}`, children: /* @__PURE__ */ c("p", { children: "No configuration provided" }) });
|
|
711
716
|
const Jt = C.width || s.canvas.width, Qt = C.height || s.canvas.height;
|
|
712
717
|
return /* @__PURE__ */ k(
|
|
713
718
|
"div",
|
|
714
719
|
{
|
|
715
|
-
ref:
|
|
720
|
+
ref: Ct,
|
|
716
721
|
className: `relative ${w}`,
|
|
717
|
-
style: { width: "100%", height: "100%" },
|
|
722
|
+
style: { width: "100%", height: "100%", touchAction: ht && b ? "none" : "auto" },
|
|
718
723
|
children: [
|
|
719
|
-
jt &&
|
|
720
|
-
|
|
724
|
+
jt && mt.length > 0 && /* @__PURE__ */ c(
|
|
725
|
+
Lt,
|
|
721
726
|
{
|
|
722
|
-
floors:
|
|
727
|
+
floors: mt,
|
|
723
728
|
currentFloorId: D,
|
|
724
729
|
onFloorChange: Ot,
|
|
725
|
-
showAllOption:
|
|
726
|
-
allLabel:
|
|
727
|
-
position:
|
|
728
|
-
className:
|
|
730
|
+
showAllOption: W,
|
|
731
|
+
allLabel: Q,
|
|
732
|
+
position: P,
|
|
733
|
+
className: F
|
|
729
734
|
}
|
|
730
735
|
),
|
|
731
736
|
/* @__PURE__ */ k(
|
|
732
737
|
oe,
|
|
733
738
|
{
|
|
734
|
-
ref:
|
|
739
|
+
ref: yt,
|
|
735
740
|
width: Jt,
|
|
736
741
|
height: Qt,
|
|
737
742
|
scaleX: R,
|
|
738
743
|
scaleY: R,
|
|
739
|
-
x:
|
|
740
|
-
y:
|
|
744
|
+
x: X.x,
|
|
745
|
+
y: X.y,
|
|
741
746
|
draggable: !0,
|
|
742
747
|
onDragEnd: qt,
|
|
743
748
|
onWheel: Gt,
|
|
@@ -746,21 +751,21 @@ const pe = ({
|
|
|
746
751
|
cursor: "grab"
|
|
747
752
|
},
|
|
748
753
|
children: [
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
|
|
754
|
+
/* @__PURE__ */ c(St, { listening: !1, children: gt.map((t) => /* @__PURE__ */ c(
|
|
755
|
+
Xt,
|
|
751
756
|
{
|
|
752
757
|
stage: t,
|
|
753
|
-
stageColor:
|
|
758
|
+
stageColor: ft.stageColor
|
|
754
759
|
},
|
|
755
760
|
t.id
|
|
756
761
|
)) }),
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ c(St, { listening: !1, children: pt.map((t) => /* @__PURE__ */ c(Yt, { text: t }, t.id)) }),
|
|
763
|
+
/* @__PURE__ */ c(St, { children: q.map((t) => /* @__PURE__ */ c(
|
|
759
764
|
Wt,
|
|
760
765
|
{
|
|
761
766
|
seat: t,
|
|
762
|
-
state:
|
|
763
|
-
colors:
|
|
767
|
+
state: ot(t),
|
|
768
|
+
colors: ft,
|
|
764
769
|
onClick: Vt,
|
|
765
770
|
onMouseEnter: Ut,
|
|
766
771
|
onMouseLeave: Kt
|
|
@@ -770,40 +775,40 @@ const pe = ({
|
|
|
770
775
|
]
|
|
771
776
|
}
|
|
772
777
|
),
|
|
773
|
-
I && /* @__PURE__ */
|
|
774
|
-
|
|
778
|
+
I && /* @__PURE__ */ c(
|
|
779
|
+
At,
|
|
775
780
|
{
|
|
776
|
-
visible:
|
|
777
|
-
x:
|
|
778
|
-
y:
|
|
779
|
-
seat:
|
|
780
|
-
currency:
|
|
781
|
-
state:
|
|
781
|
+
visible: nt.visible,
|
|
782
|
+
x: nt.x,
|
|
783
|
+
y: nt.y,
|
|
784
|
+
seat: nt.seat,
|
|
785
|
+
currency: ft.currency,
|
|
786
|
+
state: nt.state
|
|
782
787
|
}
|
|
783
788
|
),
|
|
784
|
-
|
|
785
|
-
|
|
789
|
+
ct && b && /* @__PURE__ */ c(
|
|
790
|
+
$t,
|
|
786
791
|
{
|
|
787
792
|
scale: R,
|
|
788
793
|
minScale: G,
|
|
789
|
-
maxScale:
|
|
790
|
-
fitScale:
|
|
794
|
+
maxScale: Y,
|
|
795
|
+
fitScale: It,
|
|
791
796
|
onZoomIn: Zt,
|
|
792
797
|
onZoomOut: _t,
|
|
793
|
-
onFitToScreen:
|
|
794
|
-
position:
|
|
795
|
-
className:
|
|
798
|
+
onFitToScreen: bt,
|
|
799
|
+
position: at,
|
|
800
|
+
className: lt
|
|
796
801
|
}
|
|
797
802
|
),
|
|
798
|
-
|
|
803
|
+
rt.length > 0 && /* @__PURE__ */ k("div", { className: "absolute top-4 right-4 bg-white dark:bg-gray-800 p-4 rounded shadow-lg", children: [
|
|
799
804
|
/* @__PURE__ */ k("h3", { className: "font-semibold mb-2", children: [
|
|
800
805
|
"Selected Seats (",
|
|
801
|
-
|
|
806
|
+
rt.length,
|
|
802
807
|
")"
|
|
803
808
|
] }),
|
|
804
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ c("div", { className: "max-h-48 overflow-y-auto space-y-1", children: rt.map((t) => /* @__PURE__ */ k("div", { className: "text-sm", children: [
|
|
805
810
|
t.seatNumber,
|
|
806
|
-
t.price && ` - ${
|
|
811
|
+
t.price && ` - ${ft.currency} ${t.price.toFixed(2)}`
|
|
807
812
|
] }, t.id)) })
|
|
808
813
|
] })
|
|
809
814
|
]
|
|
@@ -813,11 +818,11 @@ const pe = ({
|
|
|
813
818
|
export {
|
|
814
819
|
de as DEFAULT_COLORS,
|
|
815
820
|
pe as SeatMapViewer,
|
|
816
|
-
|
|
817
|
-
|
|
821
|
+
me as clearFirebaseInstance,
|
|
822
|
+
be as getFirebaseDatabase,
|
|
818
823
|
ve as initializeFirebaseForViewer,
|
|
819
824
|
Se as isFirebaseInitialized,
|
|
820
|
-
|
|
825
|
+
ae as useConfigFetcher,
|
|
821
826
|
le as useContainerSize,
|
|
822
827
|
we as useFirebaseConfig,
|
|
823
828
|
Ce as useFirebaseSeatStates,
|