@burdenoff/microfe-eventfullymanaged 2026.1030.1 → 2026.1101.1

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 (37) hide show
  1. package/dist/eventfullymanaged/api/eventApi.d.ts +39 -0
  2. package/dist/eventfullymanaged/api/eventApi.d.ts.map +1 -1
  3. package/dist/eventfullymanaged/api/eventApi.js +187 -157
  4. package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
  5. package/dist/eventfullymanaged/components/FloorPlanZoneEditor.d.ts +24 -0
  6. package/dist/eventfullymanaged/components/FloorPlanZoneEditor.d.ts.map +1 -0
  7. package/dist/eventfullymanaged/components/FloorPlanZoneEditor.js +65 -0
  8. package/dist/eventfullymanaged/components/FloorPlanZoneEditor.js.map +1 -0
  9. package/dist/eventfullymanaged/components/floorPlanEditor/ZoneCanvas.d.ts +24 -0
  10. package/dist/eventfullymanaged/components/floorPlanEditor/ZoneCanvas.d.ts.map +1 -0
  11. package/dist/eventfullymanaged/components/floorPlanEditor/ZoneCanvas.js +169 -0
  12. package/dist/eventfullymanaged/components/floorPlanEditor/ZoneCanvas.js.map +1 -0
  13. package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.d.ts +33 -0
  14. package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.d.ts.map +1 -0
  15. package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.js +248 -0
  16. package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.js.map +1 -0
  17. package/dist/eventfullymanaged/components/floorPlanEditor/useZoneEditorState.d.ts +33 -0
  18. package/dist/eventfullymanaged/components/floorPlanEditor/useZoneEditorState.d.ts.map +1 -0
  19. package/dist/eventfullymanaged/components/floorPlanEditor/useZoneEditorState.js +78 -0
  20. package/dist/eventfullymanaged/components/floorPlanEditor/useZoneEditorState.js.map +1 -0
  21. package/dist/eventfullymanaged/lib/floorPlanZones.d.ts +148 -0
  22. package/dist/eventfullymanaged/lib/floorPlanZones.d.ts.map +1 -0
  23. package/dist/eventfullymanaged/lib/floorPlanZones.js +239 -0
  24. package/dist/eventfullymanaged/lib/floorPlanZones.js.map +1 -0
  25. package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.d.ts.map +1 -1
  26. package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js +63 -57
  27. package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js.map +1 -1
  28. package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.d.ts +13 -0
  29. package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.d.ts.map +1 -0
  30. package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.js +181 -0
  31. package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.js.map +1 -0
  32. package/dist/eventfullymanaged/pages/venues/FloorPlansPage.d.ts.map +1 -1
  33. package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js +367 -291
  34. package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js.map +1 -1
  35. package/dist/eventfullymanaged/types/index.d.ts.map +1 -1
  36. package/dist/utils/pageContext.js +1 -1
  37. package/package.json +1 -1
@@ -4,69 +4,33 @@ import { useCreateFloorPlanMutation as n, useDeleteFloorPlanMutation as r, useUp
4
4
  import { ActionMenu as o } from "../../components/ActionMenu.js";
5
5
  import { describeError as s, mutationSucceeded as c } from "../../lib/mutationResult.js";
6
6
  import { ImageUploadField as l } from "../../components/ImageUploadField.js";
7
- import { useMemo as u, useState as d } from "react";
8
- import { useParams as f } from "react-router";
9
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
- import { ArrowLeft as h, LayoutGrid as g, Map as _, Plus as v, SquareStack as y } from "lucide-react";
11
- import { Badge as b, Button as x, GlassCard as S, GradientText as C, IllustratedEmptyState as w, Input as T, Skeleton as E } from "@burdenoff/fe-libs/ui";
7
+ import { asNumber as u, asString as d, extractZones as ee, serializeZones as te, summarizeZones as f, zoneTypeLabel as p } from "../../lib/floorPlanZones.js";
8
+ import { FloorPlanZoneEditor as m } from "../../components/FloorPlanZoneEditor.js";
9
+ import { useZoneEditorState as ne } from "../../components/floorPlanEditor/useZoneEditorState.js";
10
+ import { useCallback as re, useEffect as ie, useMemo as h, useState as g } from "react";
11
+ import { useParams as ae } from "react-router";
12
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
13
+ import { ArrowLeft as oe, LayoutGrid as y, Map as b, PencilRuler as x, Plus as S, SquareStack as C } from "lucide-react";
14
+ import { AlertDialog as w, AlertDialogAction as T, AlertDialogCancel as se, AlertDialogContent as ce, AlertDialogDescription as le, AlertDialogFooter as ue, AlertDialogHeader as de, AlertDialogTitle as fe, Badge as E, Button as D, GlassCard as O, GradientText as pe, IllustratedEmptyState as me, Input as he, Skeleton as k } from "@burdenoff/fe-libs/ui";
12
15
  //#region src/eventfullymanaged/pages/venues/FloorPlansPage.tsx
13
- var D = "/EventfullyManaged/FloorPlans";
14
- function O(e) {
15
- if (typeof e == "number" && Number.isFinite(e)) return e;
16
- if (typeof e == "string" && e.trim() !== "" && Number.isFinite(Number(e))) return Number(e);
17
- }
18
- function k(e) {
19
- return typeof e == "string" && e.trim() !== "" ? e : void 0;
20
- }
21
- function A(e) {
22
- if (!e) return [];
23
- let t = e;
24
- if (!Array.isArray(t) && typeof t == "object") {
25
- let e = t;
26
- Array.isArray(e.zones) ? t = e.zones : Array.isArray(e.areas) ? t = e.areas : Array.isArray(e.booths) && (t = e.booths);
27
- }
28
- let n = Array.isArray(t) ? t.map((e, t) => [String(t), e]) : typeof t == "object" && t ? Object.entries(t) : [], r = [];
29
- for (let [e, t] of n) {
30
- if (typeof t != "object" || !t) continue;
31
- let n = t, i = k(n.label) ?? k(n.name) ?? k(n.title) ?? k(n.id) ?? e, a = O(n.x), o = O(n.y), s = O(n.w) ?? O(n.width), c = O(n.h) ?? O(n.height), l;
32
- if (a !== void 0 && o !== void 0 && s !== void 0 && c !== void 0) {
33
- let e = a <= 1 && o <= 1 && s <= 1 && c <= 1 ? 100 : 1;
34
- (e === 100 || a <= 100 && o <= 100 && s <= 100 && c <= 100) && (l = {
35
- x: a * e,
36
- y: o * e,
37
- w: s * e,
38
- h: c * e
39
- });
40
- }
41
- r.push({
42
- key: `${e}-${i}`,
43
- label: i,
44
- type: k(n.type) ?? k(n.kind),
45
- capacity: O(n.capacity) ?? O(n.seats),
46
- rect: l
47
- });
48
- }
49
- return r;
50
- }
51
- function j(e, t) {
52
- let n = [];
53
- t.length > 0 && n.push({
16
+ var A = "/EventfullyManaged/FloorPlans";
17
+ function ge(e, t) {
18
+ let n = [], r = f(t);
19
+ r.zones > 0 && n.push({
54
20
  label: "Zones",
55
- value: t.length.toLocaleString()
56
- });
57
- let r = t.filter((e) => (e.type ?? "").toLowerCase().includes("booth")).length;
58
- r > 0 && n.push({
21
+ value: r.zones.toLocaleString()
22
+ }), r.booths > 0 && n.push({
59
23
  label: "Booths",
60
- value: r.toLocaleString()
24
+ value: r.booths.toLocaleString()
61
25
  });
62
- let i = t.reduce((e, t) => e + (t.capacity ?? 0), 0), a = e.dimensions ?? {}, o = O(a.capacity) ?? O(a.totalCapacity), s = i > 0 ? i : o;
26
+ let i = r.capacity, a = e.dimensions ?? {}, o = u(a.capacity) ?? u(a.totalCapacity), s = i > 0 ? i : o;
63
27
  s !== void 0 && s > 0 && n.push({
64
28
  label: "Total capacity",
65
29
  value: s.toLocaleString()
66
30
  });
67
- let c = O(a.width), l = O(a.height);
31
+ let c = u(a.width), l = u(a.height);
68
32
  if (c !== void 0 && l !== void 0) {
69
- let e = k(a.unit) ?? "m";
33
+ let e = d(a.unit) ?? "m";
70
34
  n.push({
71
35
  label: "Dimensions",
72
36
  value: `${c} × ${l} ${e}`
@@ -74,109 +38,145 @@ function j(e, t) {
74
38
  }
75
39
  return n;
76
40
  }
77
- function M({ plan: e, zones: t, onAttachImage: n }) {
78
- let r = t.filter((e) => e.rect);
79
- return /* @__PURE__ */ m(S, {
41
+ function _e({ plan: e, zones: t, editing: n, saving: r, onAttachImage: i, onStartEditing: a, onSaveZones: o, onStopEditing: s, editor: c }) {
42
+ let u = t.filter((e) => e.rect);
43
+ return /* @__PURE__ */ v(O, {
80
44
  treatment: "plain",
81
45
  className: "overflow-hidden border-border-seam p-0",
82
46
  children: [
83
- /* @__PURE__ */ m("div", {
47
+ /* @__PURE__ */ v("div", {
84
48
  className: "flex items-center justify-between gap-2 border-b border-border-seam px-5 py-3",
85
- children: [/* @__PURE__ */ m("div", {
49
+ children: [/* @__PURE__ */ v("div", {
86
50
  className: "flex min-w-0 items-center gap-2 text-text-primary",
87
- children: [/* @__PURE__ */ p(_, { className: "h-4 w-4 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ p("h2", {
51
+ children: [/* @__PURE__ */ _(b, { className: "h-4 w-4 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ _("h2", {
88
52
  className: "truncate text-base font-semibold",
89
53
  children: e.name
90
54
  })]
91
- }), t.length > 0 ? /* @__PURE__ */ m(b, {
92
- variant: "secondary",
93
- className: "shrink-0",
94
- children: [
95
- t.length,
96
- " ",
97
- t.length === 1 ? "zone" : "zones"
98
- ]
99
- }) : null]
55
+ }), /* @__PURE__ */ v("div", {
56
+ className: "flex shrink-0 items-center gap-2",
57
+ children: [t.length > 0 ? /* @__PURE__ */ v(E, {
58
+ variant: "secondary",
59
+ children: [
60
+ t.length,
61
+ " ",
62
+ t.length === 1 ? "zone" : "zones"
63
+ ]
64
+ }) : null, e.imageUrl && !n ? /* @__PURE__ */ v(D, {
65
+ type: "button",
66
+ size: "sm",
67
+ variant: "outline",
68
+ onClick: a,
69
+ children: [/* @__PURE__ */ _(x, { className: "h-4 w-4" }), t.length > 0 ? "Edit zones" : "Add zones"]
70
+ }) : null]
71
+ })]
100
72
  }),
101
- e.imageUrl ? /* @__PURE__ */ m("div", {
102
- className: "relative bg-bg-sunken",
103
- children: [/* @__PURE__ */ p("img", {
104
- src: e.imageUrl,
105
- alt: `${e.name} floor plan`,
106
- className: "mx-auto max-h-[32rem] w-full object-contain"
107
- }), r.map((e) => /* @__PURE__ */ p("div", {
108
- className: "absolute flex items-center justify-center rounded-md border border-accent-primary/70 bg-action-primary-bg/15 text-[10px] font-medium text-accent-primary",
109
- style: {
110
- left: `${e.rect?.x}%`,
111
- top: `${e.rect?.y}%`,
112
- width: `${e.rect?.w}%`,
113
- height: `${e.rect?.h}%`
114
- },
115
- title: e.label,
116
- children: /* @__PURE__ */ p("span", {
117
- className: "truncate px-1",
118
- children: e.label
119
- })
120
- }, e.key))]
121
- }) : /* @__PURE__ */ p("div", {
73
+ e.imageUrl && n ? /* @__PURE__ */ _(m, {
74
+ editor: c,
75
+ planName: e.name,
76
+ imageUrl: e.imageUrl,
77
+ saving: r,
78
+ onSave: (t) => o(e, t),
79
+ onCancel: s
80
+ }) : e.imageUrl ? /* @__PURE__ */ _("div", {
81
+ className: "flex justify-center bg-bg-sunken p-3",
82
+ children: /* @__PURE__ */ v("div", {
83
+ className: "relative inline-block max-w-full",
84
+ children: [/* @__PURE__ */ _("img", {
85
+ src: e.imageUrl,
86
+ alt: `${e.name} floor plan`,
87
+ className: "block h-auto max-h-[32rem] w-auto max-w-full"
88
+ }), u.map((e) => /* @__PURE__ */ v("div", {
89
+ "data-testid": "floor-plan-zone",
90
+ className: "absolute flex flex-col items-center justify-center overflow-hidden rounded-md border border-accent-primary/70 bg-action-primary-bg/15 text-[10px] font-medium leading-tight text-accent-primary",
91
+ style: {
92
+ left: `${e.rect?.x}%`,
93
+ top: `${e.rect?.y}%`,
94
+ width: `${e.rect?.w}%`,
95
+ height: `${e.rect?.h}%`
96
+ },
97
+ title: [
98
+ e.label,
99
+ p(e.type),
100
+ e.capacity === void 0 ? "" : `capacity ${e.capacity}`
101
+ ].filter(Boolean).join(" · "),
102
+ children: [/* @__PURE__ */ _("span", {
103
+ className: "max-w-full truncate px-1",
104
+ children: e.label
105
+ }), e.capacity === void 0 ? null : /* @__PURE__ */ _("span", {
106
+ className: "max-w-full truncate px-1 text-text-muted",
107
+ children: e.capacity
108
+ })]
109
+ }, e.id))]
110
+ })
111
+ }) : /* @__PURE__ */ _("div", {
122
112
  className: "p-6",
123
- children: /* @__PURE__ */ m("div", {
113
+ children: /* @__PURE__ */ v("div", {
124
114
  className: "rounded-card border border-dashed border-border-default bg-bg-sunken p-6",
125
- children: [/* @__PURE__ */ p("p", {
115
+ children: [/* @__PURE__ */ _("p", {
126
116
  className: "mb-3 text-center text-sm text-text-secondary",
127
- children: "No image attached yet. Upload the hall map for this plan."
128
- }), /* @__PURE__ */ p(l, {
117
+ children: "No image attached yet. Upload the hall map for this plan, then draw its zones and booths."
118
+ }), /* @__PURE__ */ _(l, {
129
119
  label: "Upload floor plan image",
130
- folderPath: D,
120
+ folderPath: A,
131
121
  value: null,
132
- onUploaded: (t) => n(e, t),
122
+ onUploaded: (t) => i(e, t),
133
123
  hint: "Stored securely in Files and shown here once attached."
134
124
  })]
135
125
  })
136
126
  }),
137
- t.length > 0 ? /* @__PURE__ */ m("div", {
127
+ t.length > 0 && !n ? /* @__PURE__ */ v("div", {
138
128
  className: "border-t border-border-seam px-5 py-4",
139
- children: [/* @__PURE__ */ m("div", {
129
+ children: [/* @__PURE__ */ v("div", {
140
130
  className: "mb-2 flex items-center gap-2 text-sm font-medium text-text-primary",
141
- children: [/* @__PURE__ */ p(g, { className: "h-4 w-4 text-text-muted" }), "Labeled zones"]
142
- }), /* @__PURE__ */ p("div", {
131
+ children: [/* @__PURE__ */ _(y, { className: "h-4 w-4 text-text-muted" }), "Labeled zones"]
132
+ }), /* @__PURE__ */ _("div", {
143
133
  className: "flex flex-wrap gap-2",
144
- children: t.map((e) => /* @__PURE__ */ m(b, {
145
- variant: "outline",
146
- className: "gap-1.5",
147
- children: [e.label, e.capacity ? /* @__PURE__ */ m("span", {
148
- className: "text-text-muted",
149
- children: ["· ", e.capacity]
150
- }) : null]
151
- }, e.key))
134
+ children: t.map((e) => {
135
+ let t = p(e.type);
136
+ return /* @__PURE__ */ v(E, {
137
+ variant: "outline",
138
+ className: "gap-1.5",
139
+ children: [
140
+ e.label,
141
+ t ? /* @__PURE__ */ v("span", {
142
+ className: "text-text-muted",
143
+ children: ["· ", t]
144
+ }) : null,
145
+ e.capacity === void 0 ? null : /* @__PURE__ */ v("span", {
146
+ className: "text-text-muted",
147
+ children: ["· ", e.capacity]
148
+ })
149
+ ]
150
+ }, e.id);
151
+ })
152
152
  })]
153
153
  }) : null
154
154
  ]
155
155
  });
156
156
  }
157
- function N() {
158
- let { id: g = "" } = f(), { navigate: _ } = e(), { data: b, loading: O, refetch: k } = a(g), [N, { loading: P }] = n(), [F] = i(), [I] = r(), [L, R] = d(""), [z, B] = d(""), [V, H] = d(null), [U, W] = d(!1), G = b?.venue, K = u(() => b?.floorPlans?.items ?? [], [b]), q = u(() => K.find((e) => e.id === V) ?? K[0] ?? null, [K, V]), J = u(() => A(q?.interactiveAreas), [q]), Y = u(() => q ? j(q, J) : [], [q, J]), X = async () => {
159
- if (!(!L.trim() || !g)) try {
160
- let e = await N({ variables: { input: {
161
- venueId: g,
162
- name: L.trim(),
163
- imageUrl: z,
157
+ function j() {
158
+ let { id: u = "" } = ae(), { navigate: d } = e(), { data: f, loading: p, refetch: m } = a(u), [y, { loading: b }] = n(), [x] = i(), [E] = r(), [j, M] = g(""), [N, P] = g(""), [F, I] = g(null), [L, R] = g(!1), [z, B] = g(null), [ve, V] = g(!1), H = ne(), [U, W] = g(null), G = f?.venue, K = h(() => f?.floorPlans?.items ?? [], [f]), q = h(() => K.find((e) => e.id === F) ?? K[0] ?? null, [K, F]), J = h(() => ee(q?.interactiveAreas), [q]), Y = h(() => q ? ge(q, J) : [], [q, J]), X = (e) => e.venueId || u, ye = async () => {
159
+ if (!(!j.trim() || !u)) try {
160
+ let e = await y({ variables: { input: {
161
+ venueId: u,
162
+ name: j.trim(),
163
+ imageUrl: N,
164
164
  dimensions: {},
165
165
  interactiveAreas: {}
166
166
  } } });
167
167
  if (!c(e, e.data?.createFloorPlan?.id, "Could not create floor plan")) return;
168
- R(""), B(""), W(!1);
168
+ M(""), P(""), R(!1);
169
169
  let n = e.data?.createFloorPlan?.id;
170
- n && H(n), t.success("Floor plan created"), await k();
170
+ n && I(n), t.success("Floor plan created"), await m();
171
171
  } catch (e) {
172
172
  t.error("Could not create floor plan", s(e));
173
173
  }
174
- }, Z = async (e, n) => {
174
+ }, be = async (e, n) => {
175
175
  try {
176
- let t = await F({ variables: {
176
+ let t = await x({ variables: {
177
177
  id: e.id,
178
178
  input: {
179
- venueId: e.venueId,
179
+ venueId: X(e),
180
180
  name: e.name,
181
181
  imageUrl: n,
182
182
  dimensions: e.dimensions ?? {},
@@ -184,193 +184,269 @@ function N() {
184
184
  }
185
185
  } });
186
186
  if (!c(t, t.data?.updateFloorPlan?.id, "Could not attach image")) return;
187
- await k();
187
+ await m();
188
188
  } catch (e) {
189
189
  t.error("Could not attach image", s(e));
190
190
  }
191
- }, Q = async (e) => {
192
- let n = await I({ variables: { id: e.id } });
191
+ }, Z = re(() => {
192
+ B(null);
193
+ }, []), xe = (e, t) => {
194
+ H.reset(t), B(e.id);
195
+ }, Q = z !== null && H.dirty;
196
+ ie(() => {
197
+ if (!Q) return;
198
+ let e = (e) => {
199
+ e.preventDefault();
200
+ };
201
+ return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
202
+ }, [Q]);
203
+ let Se = () => {
204
+ if (Q) {
205
+ W({ kind: "venue" });
206
+ return;
207
+ }
208
+ d(`/venues/${u}`);
209
+ }, Ce = (e) => {
210
+ if (Q && z !== e) {
211
+ W({
212
+ kind: "plan",
213
+ planId: e
214
+ });
215
+ return;
216
+ }
217
+ z !== e && Z(), I(e);
218
+ }, $ = () => {
219
+ let e = U;
220
+ W(null), Z(), e?.kind === "plan" ? I(e.planId) : e?.kind === "venue" && d(`/venues/${u}`);
221
+ }, we = async (e, n) => {
222
+ V(!0);
223
+ try {
224
+ let r = await x({ variables: {
225
+ id: e.id,
226
+ input: {
227
+ venueId: X(e),
228
+ name: e.name,
229
+ imageUrl: e.imageUrl ?? null,
230
+ dimensions: e.dimensions ?? {},
231
+ interactiveAreas: te(n, e.interactiveAreas)
232
+ }
233
+ } });
234
+ return c(r, r.data?.updateFloorPlan?.id, "Could not save zones") ? (await m(), Z(), t.success("Zones saved", `${n.length} ${n.length === 1 ? "zone" : "zones"} on ${e.name}`), !0) : !1;
235
+ } catch (e) {
236
+ return t.error("Could not save zones", s(e)), !1;
237
+ } finally {
238
+ V(!1);
239
+ }
240
+ }, Te = async (e) => {
241
+ let n;
242
+ try {
243
+ n = await E({ variables: { id: e.id } });
244
+ } catch (e) {
245
+ throw t.error("Could not delete floor plan", s(e)), e;
246
+ }
193
247
  if (n.error) throw t.error("Could not delete floor plan", n.error.message), n.error;
194
248
  if (!n.data?.deleteFloorPlan) throw t.error("Could not delete floor plan", "The server did not confirm the change."), Error("delete-unconfirmed");
195
- V === e.id && H(null), t.success("Floor plan deleted", e.name), await k();
249
+ F === e.id && I(null), z === e.id && Z(), t.success("Floor plan deleted", e.name), await m();
196
250
  };
197
- return /* @__PURE__ */ m("div", {
251
+ return /* @__PURE__ */ v("div", {
198
252
  className: "space-y-6 p-6",
199
- children: [/* @__PURE__ */ m("div", {
200
- className: "flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between",
201
- children: [/* @__PURE__ */ m("div", {
202
- className: "space-y-3",
203
- children: [
204
- /* @__PURE__ */ m(x, {
205
- type: "button",
206
- variant: "ghost",
207
- size: "sm",
208
- onClick: () => _(`/venues/${g}`),
209
- children: [/* @__PURE__ */ p(h, { className: "h-4 w-4" }), "Back to Venue"]
210
- }),
211
- /* @__PURE__ */ p(C, {
212
- as: "h1",
213
- className: "text-2xl font-bold",
214
- children: G?.name ? `${G.name} — Floor Plans` : "Floor Plans"
215
- }),
216
- /* @__PURE__ */ p("p", {
217
- className: "text-sm text-text-secondary",
218
- children: "Map the hall layout, booth positions, stage and entrances so exhibitors and attendees can navigate on the day."
219
- })
220
- ]
221
- }), /* @__PURE__ */ m(x, {
222
- type: "button",
223
- onClick: () => W((e) => !e),
224
- children: [/* @__PURE__ */ p(v, { className: "h-4 w-4" }), "Add floor plan"]
225
- })]
226
- }), O ? /* @__PURE__ */ m("div", {
227
- className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
228
- children: [/* @__PURE__ */ p(E, { className: "h-96 rounded-card lg:col-span-2" }), /* @__PURE__ */ p(E, { className: "h-96 rounded-card" })]
229
- }) : K.length === 0 && !U ? /* @__PURE__ */ p(S, {
230
- treatment: "plain",
231
- className: "border-border-seam",
232
- children: /* @__PURE__ */ p(w, {
233
- illustration: "empty-files",
234
- title: "No floor plans yet.",
235
- description: "Add one to start mapping this venue — upload the hall map and label its zones.",
236
- action: /* @__PURE__ */ m(x, {
253
+ children: [
254
+ /* @__PURE__ */ v("div", {
255
+ className: "flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between",
256
+ children: [/* @__PURE__ */ v("div", {
257
+ className: "space-y-3",
258
+ children: [
259
+ /* @__PURE__ */ v(D, {
260
+ type: "button",
261
+ variant: "ghost",
262
+ size: "sm",
263
+ onClick: Se,
264
+ children: [/* @__PURE__ */ _(oe, { className: "h-4 w-4" }), "Back to Venue"]
265
+ }),
266
+ /* @__PURE__ */ _(pe, {
267
+ as: "h1",
268
+ className: "text-2xl font-bold",
269
+ children: G?.name ? `${G.name} — Floor Plans` : "Floor Plans"
270
+ }),
271
+ /* @__PURE__ */ _("p", {
272
+ className: "text-sm text-text-secondary",
273
+ children: "Map the hall layout, booth positions, stage and entrances so exhibitors and attendees can navigate on the day."
274
+ })
275
+ ]
276
+ }), /* @__PURE__ */ v(D, {
237
277
  type: "button",
238
- onClick: () => W(!0),
239
- children: [/* @__PURE__ */ p(v, { className: "h-4 w-4" }), "Add floor plan"]
240
- })
241
- })
242
- }) : /* @__PURE__ */ m("div", {
243
- className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
244
- children: [/* @__PURE__ */ p("div", {
245
- className: "lg:col-span-2",
246
- children: q ? /* @__PURE__ */ p(M, {
247
- plan: q,
248
- zones: J,
249
- onAttachImage: Z
250
- }) : /* @__PURE__ */ p(S, {
251
- treatment: "plain",
252
- className: "flex h-full items-center justify-center border-border-seam p-10",
253
- children: /* @__PURE__ */ p("p", {
254
- className: "text-sm text-text-secondary",
255
- children: "Add a floor plan to preview it here."
278
+ onClick: () => R((e) => !e),
279
+ children: [/* @__PURE__ */ _(S, { className: "h-4 w-4" }), "Add floor plan"]
280
+ })]
281
+ }),
282
+ p ? /* @__PURE__ */ v("div", {
283
+ className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
284
+ children: [/* @__PURE__ */ _(k, { className: "h-96 rounded-card lg:col-span-2" }), /* @__PURE__ */ _(k, { className: "h-96 rounded-card" })]
285
+ }) : K.length === 0 && !L ? /* @__PURE__ */ _(O, {
286
+ treatment: "plain",
287
+ className: "border-border-seam",
288
+ children: /* @__PURE__ */ _(me, {
289
+ illustration: "empty-files",
290
+ title: "No floor plans yet.",
291
+ description: "Add one to start mapping this venue — upload the hall map and label its zones.",
292
+ action: /* @__PURE__ */ v(D, {
293
+ type: "button",
294
+ onClick: () => R(!0),
295
+ children: [/* @__PURE__ */ _(S, { className: "h-4 w-4" }), "Add floor plan"]
256
296
  })
257
297
  })
258
- }), /* @__PURE__ */ m("div", {
259
- className: "space-y-6",
260
- children: [
261
- /* @__PURE__ */ m(S, {
298
+ }) : /* @__PURE__ */ v("div", {
299
+ className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
300
+ children: [/* @__PURE__ */ _("div", {
301
+ className: "lg:col-span-2",
302
+ children: q ? /* @__PURE__ */ _(_e, {
303
+ plan: q,
304
+ zones: J,
305
+ editing: z === q.id,
306
+ saving: ve,
307
+ onAttachImage: be,
308
+ onStartEditing: () => xe(q, J),
309
+ onSaveZones: we,
310
+ onStopEditing: Z,
311
+ editor: H
312
+ }) : /* @__PURE__ */ _(O, {
262
313
  treatment: "plain",
263
- className: "border-border-seam p-5",
264
- children: [/* @__PURE__ */ p("h2", {
265
- className: "text-sm font-semibold text-text-primary",
266
- children: "Available Floor Plans"
267
- }), /* @__PURE__ */ p("ul", {
268
- className: "mt-3 space-y-2",
269
- role: "list",
270
- children: K.length === 0 ? /* @__PURE__ */ p("li", {
271
- className: "text-sm text-text-secondary",
272
- children: "None yet — create one below."
273
- }) : K.map((e) => {
274
- let t = q?.id === e.id;
275
- return /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m("div", {
276
- className: `flex items-center gap-3 rounded-card border p-3 transition-colors ${t ? "border-accent-primary bg-action-primary-bg/10" : "border-border-seam hover:border-border-strong"}`,
277
- children: [/* @__PURE__ */ m("button", {
278
- type: "button",
279
- onClick: () => H(e.id),
280
- className: "flex min-w-0 flex-1 items-center gap-3 text-left focus-visible:outline-none",
281
- "aria-pressed": t,
282
- children: [/* @__PURE__ */ p("span", {
283
- className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-md ${t ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary"}`,
284
- children: /* @__PURE__ */ p(y, { className: "h-4 w-4" })
285
- }), /* @__PURE__ */ m("span", {
286
- className: "min-w-0",
287
- children: [/* @__PURE__ */ p("span", {
288
- className: "block truncate text-sm font-medium text-text-primary",
289
- children: e.name
290
- }), /* @__PURE__ */ p("span", {
291
- className: "block text-xs text-text-muted",
292
- children: e.imageUrl ? "Map attached" : "No image yet"
314
+ className: "flex h-full items-center justify-center border-border-seam p-10",
315
+ children: /* @__PURE__ */ _("p", {
316
+ className: "text-sm text-text-secondary",
317
+ children: "Add a floor plan to preview it here."
318
+ })
319
+ })
320
+ }), /* @__PURE__ */ v("div", {
321
+ className: "space-y-6",
322
+ children: [
323
+ /* @__PURE__ */ v(O, {
324
+ treatment: "plain",
325
+ className: "border-border-seam p-5",
326
+ children: [/* @__PURE__ */ _("h2", {
327
+ className: "text-sm font-semibold text-text-primary",
328
+ children: "Available Floor Plans"
329
+ }), /* @__PURE__ */ _("ul", {
330
+ className: "mt-3 space-y-2",
331
+ role: "list",
332
+ children: K.length === 0 ? /* @__PURE__ */ _("li", {
333
+ className: "text-sm text-text-secondary",
334
+ children: "None yet — create one below."
335
+ }) : K.map((e) => {
336
+ let t = q?.id === e.id;
337
+ return /* @__PURE__ */ _("li", { children: /* @__PURE__ */ v("div", {
338
+ className: `flex items-center gap-3 rounded-card border p-3 transition-colors ${t ? "border-accent-primary bg-action-primary-bg/10" : "border-border-seam hover:border-border-strong"}`,
339
+ children: [/* @__PURE__ */ v("button", {
340
+ type: "button",
341
+ onClick: () => Ce(e.id),
342
+ className: "flex min-w-0 flex-1 items-center gap-3 text-left focus-visible:outline-none",
343
+ "aria-pressed": t,
344
+ children: [/* @__PURE__ */ _("span", {
345
+ className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-md ${t ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary"}`,
346
+ children: /* @__PURE__ */ _(C, { className: "h-4 w-4" })
347
+ }), /* @__PURE__ */ v("span", {
348
+ className: "min-w-0",
349
+ children: [/* @__PURE__ */ _("span", {
350
+ className: "block truncate text-sm font-medium text-text-primary",
351
+ children: e.name
352
+ }), /* @__PURE__ */ _("span", {
353
+ className: "block text-xs text-text-muted",
354
+ children: e.imageUrl ? "Map attached" : "No image yet"
355
+ })]
293
356
  })]
357
+ }), /* @__PURE__ */ _(o, {
358
+ ariaLabel: `Floor plan actions for ${e.name}`,
359
+ entityName: e.name,
360
+ deleteLabel: "Delete floor plan",
361
+ onDelete: () => Te(e)
294
362
  })]
295
- }), /* @__PURE__ */ p(o, {
296
- ariaLabel: `Floor plan actions for ${e.name}`,
297
- entityName: e.name,
298
- deleteLabel: "Delete floor plan",
299
- onDelete: () => Q(e)
300
- })]
301
- }) }, e.id);
302
- })
303
- })]
304
- }),
305
- q ? /* @__PURE__ */ m(S, {
306
- treatment: "metric",
307
- className: "p-5",
308
- children: [/* @__PURE__ */ p("h2", {
309
- className: "text-sm font-semibold text-text-primary",
310
- children: "Plan Details"
311
- }), Y.length > 0 ? /* @__PURE__ */ p("dl", {
312
- className: "mt-3 space-y-2",
313
- children: Y.map((e) => /* @__PURE__ */ m("div", {
314
- className: "flex items-center justify-between text-sm",
315
- children: [/* @__PURE__ */ p("dt", {
316
- className: "text-text-secondary",
317
- children: e.label
318
- }), /* @__PURE__ */ p("dd", {
319
- className: "font-semibold tabular-nums text-text-primary",
320
- children: e.value
321
- })]
322
- }, e.label))
323
- }) : /* @__PURE__ */ p("p", {
324
- className: "mt-3 text-sm text-text-secondary",
325
- children: "No zones or dimensions captured for this plan yet."
326
- })]
327
- }) : null,
328
- U || K.length === 0 ? /* @__PURE__ */ m(S, {
329
- treatment: "plain",
330
- className: "border-border-seam p-5",
331
- children: [/* @__PURE__ */ p("h2", {
332
- className: "mb-3 text-sm font-semibold text-text-primary",
333
- children: "Add a floor plan"
334
- }), /* @__PURE__ */ m("div", {
335
- className: "space-y-4",
336
- children: [
337
- /* @__PURE__ */ p(T, {
338
- type: "text",
339
- value: L,
340
- onChange: (e) => R(e.target.value),
341
- placeholder: "Main Hall Layout",
342
- "aria-label": "Floor plan name"
343
- }),
344
- /* @__PURE__ */ p(l, {
345
- label: "Upload floor plan image",
346
- folderPath: D,
347
- value: z || null,
348
- onUploaded: B,
349
- hint: "Optional now — you can attach it later from the viewer."
350
- }),
351
- /* @__PURE__ */ m("div", {
352
- className: "flex justify-end gap-2",
353
- children: [K.length > 0 ? /* @__PURE__ */ p(x, {
354
- type: "button",
355
- variant: "ghost",
356
- onClick: () => W(!1),
357
- children: "Cancel"
358
- }) : null, /* @__PURE__ */ m(x, {
359
- type: "button",
360
- onClick: X,
361
- disabled: P || !L.trim(),
362
- children: [/* @__PURE__ */ p(v, { className: "h-4 w-4" }), P ? "Creating…" : "Create"]
363
- })]
363
+ }) }, e.id);
364
364
  })
365
- ]
366
- })]
367
- }) : null
368
- ]
369
- })]
370
- })]
365
+ })]
366
+ }),
367
+ q ? /* @__PURE__ */ v(O, {
368
+ treatment: "metric",
369
+ className: "p-5",
370
+ children: [/* @__PURE__ */ _("h2", {
371
+ className: "text-sm font-semibold text-text-primary",
372
+ children: "Plan Details"
373
+ }), Y.length > 0 ? /* @__PURE__ */ _("dl", {
374
+ className: "mt-3 space-y-2",
375
+ children: Y.map((e) => /* @__PURE__ */ v("div", {
376
+ className: "flex items-center justify-between text-sm",
377
+ children: [/* @__PURE__ */ _("dt", {
378
+ className: "text-text-secondary",
379
+ children: e.label
380
+ }), /* @__PURE__ */ _("dd", {
381
+ className: "font-semibold tabular-nums text-text-primary",
382
+ children: e.value
383
+ })]
384
+ }, e.label))
385
+ }) : /* @__PURE__ */ _("p", {
386
+ className: "mt-3 text-sm text-text-secondary",
387
+ children: "No zones or dimensions captured for this plan yet."
388
+ })]
389
+ }) : null,
390
+ L || K.length === 0 ? /* @__PURE__ */ v(O, {
391
+ treatment: "plain",
392
+ className: "border-border-seam p-5",
393
+ children: [/* @__PURE__ */ _("h2", {
394
+ className: "mb-3 text-sm font-semibold text-text-primary",
395
+ children: "Add a floor plan"
396
+ }), /* @__PURE__ */ v("div", {
397
+ className: "space-y-4",
398
+ children: [
399
+ /* @__PURE__ */ _(he, {
400
+ type: "text",
401
+ value: j,
402
+ onChange: (e) => M(e.target.value),
403
+ placeholder: "Main Hall Layout",
404
+ "aria-label": "Floor plan name"
405
+ }),
406
+ /* @__PURE__ */ _(l, {
407
+ label: "Upload floor plan image",
408
+ folderPath: A,
409
+ value: N || null,
410
+ onUploaded: P,
411
+ hint: "Optional now — you can attach it later from the viewer."
412
+ }),
413
+ /* @__PURE__ */ v("div", {
414
+ className: "flex justify-end gap-2",
415
+ children: [K.length > 0 ? /* @__PURE__ */ _(D, {
416
+ type: "button",
417
+ variant: "ghost",
418
+ onClick: () => R(!1),
419
+ children: "Cancel"
420
+ }) : null, /* @__PURE__ */ v(D, {
421
+ type: "button",
422
+ onClick: ye,
423
+ disabled: b || !j.trim(),
424
+ children: [/* @__PURE__ */ _(S, { className: "h-4 w-4" }), b ? "Creating…" : "Create"]
425
+ })]
426
+ })
427
+ ]
428
+ })]
429
+ }) : null
430
+ ]
431
+ })]
432
+ }),
433
+ /* @__PURE__ */ _(w, {
434
+ open: U !== null,
435
+ onOpenChange: (e) => e ? void 0 : W(null),
436
+ children: /* @__PURE__ */ v(ce, { children: [/* @__PURE__ */ v(de, { children: [/* @__PURE__ */ _(fe, { children: "Discard unsaved zone changes?" }), /* @__PURE__ */ v(le, { children: [
437
+ "The zones you edited on this floor plan have not been saved.",
438
+ " ",
439
+ U?.kind === "venue" ? "Leaving this page" : "Switching plans",
440
+ " will discard them."
441
+ ] })] }), /* @__PURE__ */ v(ue, { children: [/* @__PURE__ */ _(se, { children: "Keep editing" }), /* @__PURE__ */ _(T, {
442
+ onClick: $,
443
+ children: "Discard changes"
444
+ })] })] })
445
+ })
446
+ ]
371
447
  });
372
448
  }
373
449
  //#endregion
374
- export { N as default };
450
+ export { j as default };
375
451
 
376
452
  //# sourceMappingURL=FloorPlansPage.js.map