venuekit 0.10.2 → 0.11.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.
package/dist/react.cjs CHANGED
@@ -45,7 +45,9 @@
45
45
 
46
46
 
47
47
 
48
- var _chunkZ47OPTEPcjs = require('./chunk-Z47OPTEP.cjs');
48
+
49
+
50
+ var _chunkYLV7JK57cjs = require('./chunk-YLV7JK57.cjs');
49
51
 
50
52
  // ../canvas/src/camera.ts
51
53
  var MIN_ZOOM = 0.05;
@@ -133,7 +135,7 @@ function reduceGesture(state, camera, viewport, input) {
133
135
  const [a, b] = list2;
134
136
  return {
135
137
  // Con dos dedos ya no hay tap posible: `moved` queda en true a propósito.
136
- state: { pointers, origin: null, moved: true, pinchDistance: _chunkZ47OPTEPcjs.distance.call(void 0, a, b) },
138
+ state: { pointers, origin: null, moved: true, pinchDistance: _chunkYLV7JK57cjs.distance.call(void 0, a, b) },
137
139
  camera
138
140
  };
139
141
  }
@@ -146,7 +148,7 @@ function reduceGesture(state, camera, viewport, input) {
146
148
  const [a, b] = list2;
147
149
  const previousA = state.pointers[a.id];
148
150
  const previousB = state.pointers[b.id];
149
- const nextDistance = _chunkZ47OPTEPcjs.distance.call(void 0, a, b);
151
+ const nextDistance = _chunkYLV7JK57cjs.distance.call(void 0, a, b);
150
152
  const previousDistance = state.pinchDistance;
151
153
  if (!previousA || !previousB || !previousDistance || previousDistance < 1e-6 || nextDistance < 1e-6) {
152
154
  return { state: { ...state, pointers, pinchDistance: nextDistance }, camera };
@@ -159,7 +161,7 @@ function reduceGesture(state, camera, viewport, input) {
159
161
  camera: panBy(zoomed, nextMid.x - previousMid.x, nextMid.y - previousMid.y)
160
162
  };
161
163
  }
162
- const movedEnough = state.moved || state.origin !== null && _chunkZ47OPTEPcjs.distance.call(void 0, state.origin, pointer) > TAP_SLOP;
164
+ const movedEnough = state.moved || state.origin !== null && _chunkYLV7JK57cjs.distance.call(void 0, state.origin, pointer) > TAP_SLOP;
163
165
  if (!movedEnough) return { state: { ...state, pointers }, camera };
164
166
  return {
165
167
  state: { ...state, pointers, moved: true },
@@ -199,7 +201,12 @@ var defaultPalette = {
199
201
  unitLabel: "#0b0b0d",
200
202
  landmark: "#23232a",
201
203
  landmarkStroke: "#34343c",
202
- landmarkLabel: "#d6d6dc"
204
+ landmarkLabel: "#d6d6dc",
205
+ courtesy: "#7c3aed",
206
+ courtesyLabel: "#ffffff",
207
+ heldFor: "#f59e0b",
208
+ heldForLabel: "#0b0b0d",
209
+ statusMark: "#ffffff"
203
210
  };
204
211
  var PALETTE_VARIABLES = {
205
212
  taken: "--vk-taken",
@@ -219,7 +226,12 @@ var PALETTE_VARIABLES = {
219
226
  unitLabel: "--vk-unit-fg",
220
227
  landmark: "--vk-landmark",
221
228
  landmarkStroke: "--vk-landmark-stroke",
222
- landmarkLabel: "--vk-landmark-fg"
229
+ landmarkLabel: "--vk-landmark-fg",
230
+ courtesy: "--vk-courtesy",
231
+ courtesyLabel: "--vk-courtesy-fg",
232
+ heldFor: "--vk-held-for",
233
+ heldForLabel: "--vk-held-for-fg",
234
+ statusMark: "--vk-status-mark"
223
235
  };
224
236
  function paletteFromVariables(read, base = defaultPalette) {
225
237
  const out = { ...base };
@@ -262,7 +274,7 @@ function centredBox(at, width, height, rotation) {
262
274
  return { minX: at.x - hw, minY: at.y - hh, maxX: at.x + hw, maxY: at.y + hh };
263
275
  }
264
276
  function tableBodyBox(table) {
265
- const size = _chunkZ47OPTEPcjs.tableSize.call(void 0, table.shape, table.places);
277
+ const size = _chunkYLV7JK57cjs.tableSize.call(void 0, table.shape, table.places);
266
278
  const k = _nullishCoalesce(table.scale, () => ( 1));
267
279
  const [w, h] = "radius" in size ? [size.radius * 2 * k, size.radius * 2 * k] : [size.width * k, size.height * k];
268
280
  return centredBox(table.transform, w, h, table.transform.rotation);
@@ -279,12 +291,12 @@ function pieceBounds(element) {
279
291
  return box;
280
292
  }
281
293
  function computeBounds(element) {
282
- if (element.type === "zone") return _chunkZ47OPTEPcjs.zoneBounds.call(void 0, element);
294
+ if (element.type === "zone") return _chunkYLV7JK57cjs.zoneBounds.call(void 0, element);
283
295
  if (element.type === "landmark") {
284
296
  return centredBox(element.transform, element.width, element.height, element.transform.rotation);
285
297
  }
286
- const units = element.type === "seatBlock" ? _chunkZ47OPTEPcjs.expandSeatBlock.call(void 0, element) : _chunkZ47OPTEPcjs.expandTable.call(void 0, element);
287
- const own = units.length > 0 ? _chunkZ47OPTEPcjs.bbox.call(void 0, units.map((u) => ({ x: u.x, y: u.y }))) : null;
298
+ const units = element.type === "seatBlock" ? _chunkYLV7JK57cjs.expandSeatBlock.call(void 0, element) : _chunkYLV7JK57cjs.expandTable.call(void 0, element);
299
+ const own = units.length > 0 ? _chunkYLV7JK57cjs.bbox.call(void 0, units.map((u) => ({ x: u.x, y: u.y }))) : null;
288
300
  if (element.type === "table") {
289
301
  const body = tableBodyBox(element);
290
302
  return own ? {
@@ -296,13 +308,17 @@ function computeBounds(element) {
296
308
  }
297
309
  return own;
298
310
  }
299
- function elementAt(layout, screen, camera, viewport) {
311
+ var EDIT_HIT_SLOP_PX = 4;
312
+ function elementAt(layout, screen, camera, viewport, options = {}) {
300
313
  const world = screenToWorld(camera, viewport, screen);
314
+ const slop = (_nullishCoalesce(options.slopPx, () => ( 0))) / camera.zoom;
301
315
  for (let i = layout.elements.length - 1; i >= 0; i -= 1) {
302
316
  const element = layout.elements[i];
303
317
  const box = elementBounds(layout, element);
304
- if (box && world.x >= box.minX && world.x <= box.maxX && world.y >= box.minY && world.y <= box.maxY) {
305
- if (element.type === "zone" && !_chunkZ47OPTEPcjs.pointInZone.call(void 0, element, world)) continue;
318
+ const ownsRadius = element.type === "seatBlock" || element.type === "table" && element.mode === "perPlace";
319
+ const pad = element.type === "seatBlock" || element.type === "table" ? (ownsRadius ? _nullishCoalesce(_optionalChain([options, 'access', _2 => _2.radii, 'optionalAccess', _3 => _3.get, 'call', _4 => _4(element.id)]), () => ( 0)) : 0) + slop : 0;
320
+ if (box && world.x >= box.minX - pad && world.x <= box.maxX + pad && world.y >= box.minY - pad && world.y <= box.maxY + pad) {
321
+ if (element.type === "zone" && !_chunkYLV7JK57cjs.pointInZone.call(void 0, element, world)) continue;
306
322
  return element;
307
323
  }
308
324
  }
@@ -336,12 +352,13 @@ function unitRadii(layout) {
336
352
  out.set(el.id, DEFAULT_UNIT_RADIUS * k);
337
353
  continue;
338
354
  }
339
- const size = _chunkZ47OPTEPcjs.tableSize.call(void 0, el.shape, el.places);
355
+ const size = _chunkYLV7JK57cjs.tableSize.call(void 0, el.shape, el.places);
340
356
  out.set(el.id, ("radius" in size ? size.radius : Math.max(size.width, size.height) / 2) * k);
341
357
  }
342
358
  }
343
359
  return out;
344
360
  }
361
+ var RESERVED_DASH_PX = 3;
345
362
  var MIN_NUMBERED_RADIUS_PX = 8;
346
363
  var LABEL_INSET_PX = 12;
347
364
  var TWO_LINES_PX = 40;
@@ -365,13 +382,13 @@ function buildScene(input) {
365
382
  })
366
383
  );
367
384
  const colorOf = (ref) => ref === null ? null : _nullishCoalesce(placeTypeColors.get(ref), () => ( null));
368
- const dim = (ref) => mode === "map" && (colorOf(ref) === null || input.focusRef != null && ref !== input.focusRef || ref !== null && !!_optionalChain([input, 'access', _ => _.dimmedRefs, 'optionalAccess', _2 => _2.has, 'call', _3 => _3(ref)]));
385
+ const dim = (ref) => mode === "map" && (colorOf(ref) === null || input.focusRef != null && ref !== input.focusRef || ref !== null && !!_optionalChain([input, 'access', _5 => _5.dimmedRefs, 'optionalAccess', _6 => _6.has, 'call', _7 => _7(ref)]));
369
386
  const bg = layout.meta.background;
370
387
  const background = bg ? { src: bg.src, box: { minX: bg.x, minY: bg.y, maxX: bg.x + bg.width, maxY: bg.y + bg.height }, opacity: bg.opacity } : null;
371
388
  const shapes = [];
372
389
  const labels = [];
373
390
  const chip = { fill: palette.shapeFill, stroke: palette.shape };
374
- const refOf = (el) => el.type === "landmark" ? null : _optionalChain([el, 'access', _4 => _4.placeType, 'optionalAccess', _5 => _5.ref]) || null;
391
+ const refOf = (el) => el.type === "landmark" ? null : _optionalChain([el, 'access', _8 => _8.placeType, 'optionalAccess', _9 => _9.ref]) || null;
375
392
  for (const el of layout.elements) {
376
393
  if (el.type === "landmark") {
377
394
  const b = centredBox(el.transform, el.width, el.height, el.transform.rotation);
@@ -429,24 +446,24 @@ function buildScene(input) {
429
446
  const ref = refOf(el);
430
447
  const color = _nullishCoalesce(colorOf(ref), () => ( palette.unassigned));
431
448
  const b = centredBox(el.transform, el.width, el.height, el.transform.rotation);
432
- const strong = mode === "map" && ref !== null && !!_optionalChain([input, 'access', _6 => _6.highlightRefs, 'optionalAccess', _7 => _7.has, 'call', _8 => _8(ref)]);
449
+ const strong = mode === "map" && ref !== null && !!_optionalChain([input, 'access', _10 => _10.highlightRefs, 'optionalAccess', _11 => _11.has, 'call', _12 => _12(ref)]);
433
450
  const paint2 = {
434
451
  fill: translucent(color, strong ? palette.zoneSelectedAlpha : palette.zoneAlpha),
435
452
  stroke: color,
436
453
  strokeWidth: strong ? 2.5 : 1.5,
437
454
  ...dim(ref) ? { alpha: DIMMED_ALPHA } : {}
438
455
  };
439
- const outline = _chunkZ47OPTEPcjs.zoneOutline.call(void 0, el, ZONE_CORNER);
456
+ const outline = _chunkYLV7JK57cjs.zoneOutline.call(void 0, el, ZONE_CORNER);
440
457
  if (outline.length > 0) shapes.push({ kind: "polygon", points: outline, ...paint2 });
441
458
  else shapes.push({ kind: "rect", x: b.minX, y: b.minY, width: b.maxX - b.minX, height: b.maxY - b.minY, cornerRadius: ZONE_CORNER, ...paint2 });
442
- const room = _chunkZ47OPTEPcjs.zoneLabelSize.call(void 0, el);
459
+ const room = _chunkYLV7JK57cjs.zoneLabelSize.call(void 0, el);
443
460
  const swap = el.transform.rotation === 90 || el.transform.rotation === 270;
444
461
  const roomW = (swap ? room.height : room.width) * camera.zoom;
445
462
  const roomH = (swap ? room.width : room.height) * camera.zoom;
446
- const text = colorOf(ref) !== null ? _nullishCoalesce(_optionalChain([el, 'access', _9 => _9.placeType, 'optionalAccess', _10 => _10.name]), () => ( "")) : mode === "designer" ? input.unassignedLabel : "";
463
+ const text = colorOf(ref) !== null ? _nullishCoalesce(_optionalChain([el, 'access', _13 => _13.placeType, 'optionalAccess', _14 => _14.name]), () => ( "")) : mode === "designer" ? input.unassignedLabel : "";
447
464
  if (text && mode === "map") {
448
465
  const maxWidth = roomW - LABEL_INSET_PX;
449
- const price = ref !== null ? _optionalChain([input, 'access', _11 => _11.placeTypePrices, 'optionalAccess', _12 => _12.get, 'call', _13 => _13(ref)]) : void 0;
466
+ const price = ref !== null ? _optionalChain([input, 'access', _15 => _15.placeTypePrices, 'optionalAccess', _16 => _16.get, 'call', _17 => _17(ref)]) : void 0;
450
467
  const twoLines = !!price && roomH >= TWO_LINES_PX;
451
468
  const shift = twoLines ? 9 / camera.zoom : 0;
452
469
  const maxHeight = twoLines ? void 0 : roomH - LABEL_INSET_PX;
@@ -491,7 +508,7 @@ function buildScene(input) {
491
508
  }
492
509
  const chipped = mode === "designer" ? layout.elements.filter((el) => el.type !== "landmark" && colorOf(refOf(el)) === null) : [];
493
510
  const byElement = new Map(chipped.map((el) => [el.id, []]));
494
- if (byElement.size > 0) for (const u of units) _optionalChain([byElement, 'access', _14 => _14.get, 'call', _15 => _15(u.elementId), 'optionalAccess', _16 => _16.push, 'call', _17 => _17(u)]);
511
+ if (byElement.size > 0) for (const u of units) _optionalChain([byElement, 'access', _18 => _18.get, 'call', _19 => _19(u.elementId), 'optionalAccess', _20 => _20.push, 'call', _21 => _21(u)]);
495
512
  for (const el of chipped) {
496
513
  const own = byElement.get(el.id);
497
514
  if (!own || own.length === 0) continue;
@@ -525,7 +542,9 @@ function buildScene(input) {
525
542
  const maxWidth = (body.maxX - body.minX) * camera.zoom - 4;
526
543
  if (maxWidth < MIN_NUMBERED_RADIUS_PX * 2) continue;
527
544
  const ref = refOf(el);
528
- const color = el.mode === "whole" ? dim(ref) ? palette.soldLabel : mapUnitPaint(_nullishCoalesce(states.get(el.id), () => ( "free")), "", palette).label : palette.landmarkLabel;
545
+ const state = _nullishCoalesce(states.get(el.id), () => ( "free"));
546
+ const mark = state !== "selected" && state !== "held" ? _optionalChain([input, 'access', _22 => _22.unitMarks, 'optionalAccess', _23 => _23.get, 'call', _24 => _24(el.id)]) : void 0;
547
+ const color = el.mode === "whole" ? dim(ref) ? palette.soldLabel : (mark ? markPaint(mark, palette) : mapUnitPaint(state, "", palette)).label : palette.landmarkLabel;
529
548
  labels.push({ x, y, text: el.label, size: 13, weight: 700, color, align: "centre", maxWidth });
530
549
  }
531
550
  const elementsById = new Map(layout.elements.map((el) => [el.id, el]));
@@ -534,9 +553,11 @@ function buildScene(input) {
534
553
  if (!visible.has(u.id)) continue;
535
554
  visibleUnitIds.push(u.id);
536
555
  const color = _nullishCoalesce(colorOf(u.placeTypeRef), () => ( palette.unassigned));
537
- const state = mode === "designer" && _optionalChain([input, 'access', _18 => _18.locked, 'optionalAccess', _19 => _19.has, 'call', _20 => _20(u.id)]) ? "taken" : _nullishCoalesce(states.get(u.id), () => ( "free"));
538
- const mapPaint = mode === "map" ? mapUnitPaint(state, color, palette) : null;
539
- const paint2 = mapPaint ? { fill: mapPaint.fill, stroke: mapPaint.stroke, strokeWidth: mapPaint.strokeWidth } : unitPaint(state, color, palette);
556
+ const state = mode === "designer" && _optionalChain([input, 'access', _25 => _25.locked, 'optionalAccess', _26 => _26.has, 'call', _27 => _27(u.id)]) ? "taken" : _nullishCoalesce(states.get(u.id), () => ( "free"));
557
+ const mark = mode === "map" && state !== "selected" && state !== "held" ? _optionalChain([input, 'access', _28 => _28.unitMarks, 'optionalAccess', _29 => _29.get, 'call', _30 => _30(u.id)]) : void 0;
558
+ const mapPaint = mode === "map" ? mark ? markPaint(mark, palette) : mapUnitPaint(state, color, palette) : null;
559
+ const base = mapPaint ? { fill: mapPaint.fill, stroke: mapPaint.stroke, strokeWidth: mapPaint.strokeWidth } : unitPaint(state, color, palette);
560
+ const paint2 = u.inviteOnly && state === "free" && !mark ? { ...base, stroke: palette.label, strokeWidth: 2, dash: RESERVED_DASH_PX } : base;
540
561
  const dimmed = dim(u.placeTypeRef);
541
562
  const alpha = dimmed ? { alpha: DIMMED_ALPHA } : {};
542
563
  const el = elementsById.get(u.elementId);
@@ -546,15 +567,33 @@ function buildScene(input) {
546
567
  const size = Math.min(13, Math.max(8, radius * camera.zoom * 0.9));
547
568
  labels.push({ x: u.x, y: u.y, text: number, size, weight: 700, color: mapPaint.label, align: "centre", maxWidth: radius * camera.zoom * 1.7 });
548
569
  }
549
- if (_optionalChain([el, 'optionalAccess', _21 => _21.type]) === "table" && el.mode === "whole" && el.shape === "rect") {
570
+ if (_optionalChain([el, 'optionalAccess', _31 => _31.type]) === "table" && el.mode === "whole" && el.shape === "rect") {
550
571
  const b = tableBodyBox(el);
551
572
  shapes.push({ kind: "rect", x: b.minX, y: b.minY, width: b.maxX - b.minX, height: b.maxY - b.minY, ...paint2, ...alpha });
573
+ if (mark) shapes.push(...markBadge(mark, b.maxX - radius * 0.25, b.minY + radius * 0.25, radius, palette));
552
574
  continue;
553
575
  }
554
576
  shapes.push({ kind: "circle", x: u.x, y: u.y, radius, ...paint2, ...alpha });
577
+ if (mark) shapes.push(...markBadge(mark, u.x + radius * 0.65, u.y - radius * 0.65, radius, palette));
555
578
  }
556
579
  return { background, shapes, labels, visibleUnitIds };
557
580
  }
581
+ function markPaint(mark, palette) {
582
+ switch (mark) {
583
+ case "sold":
584
+ return mapUnitPaint("taken", "", palette);
585
+ case "courtesy":
586
+ return { fill: palette.courtesy, stroke: palette.soldStroke, strokeWidth: 1, label: palette.courtesyLabel };
587
+ case "held":
588
+ return { fill: palette.heldFor, stroke: palette.soldStroke, strokeWidth: 1, label: palette.heldForLabel };
589
+ }
590
+ }
591
+ function markBadge(mark, x, y, radius, palette) {
592
+ if (mark === "sold") return [];
593
+ const r = radius * 0.4;
594
+ if (mark === "courtesy") return [{ kind: "circle", x, y, radius: r, fill: palette.statusMark, stroke: palette.soldStroke, strokeWidth: 1 }];
595
+ return [{ kind: "rect", x: x - r, y: y - r, width: r * 2, height: r * 2, fill: palette.statusMark, stroke: palette.soldStroke, strokeWidth: 1 }];
596
+ }
558
597
 
559
598
  // ../canvas/src/label-fit.ts
560
599
  var MIN_LEGIBLE_PX = 11;
@@ -625,7 +664,7 @@ function paint(ctx, fill, stroke, strokeWidth, zoom) {
625
664
  }
626
665
  function drawBackground(ctx, scene, images) {
627
666
  const bg = scene.background;
628
- const bitmap = bg ? _optionalChain([images, 'optionalAccess', _22 => _22.get, 'call', _23 => _23(bg.src)]) : void 0;
667
+ const bitmap = bg ? _optionalChain([images, 'optionalAccess', _32 => _32.get, 'call', _33 => _33(bg.src)]) : void 0;
629
668
  if (!bg || !bitmap) return;
630
669
  const previous = ctx.globalAlpha;
631
670
  ctx.globalAlpha = bg.opacity;
@@ -642,7 +681,10 @@ function drawShape(ctx, shape, zoom) {
642
681
  shape.points.forEach((p, i) => i === 0 ? ctx.moveTo(p.x, p.y) : ctx.lineTo(p.x, p.y));
643
682
  ctx.closePath();
644
683
  } else ctx.arc(shape.x, shape.y, shape.radius, 0, Math.PI * 2);
684
+ const dash = shape.kind !== "polygon" ? shape.dash : void 0;
685
+ if (dash) ctx.setLineDash([dash / zoom, dash / zoom]);
645
686
  paint(ctx, shape.fill, shape.stroke, shape.strokeWidth, zoom);
687
+ if (dash) ctx.setLineDash([]);
646
688
  ctx.globalAlpha = previous;
647
689
  }
648
690
  function renderScene(scene, target) {
@@ -734,7 +776,7 @@ function hitUnit(input) {
734
776
  const unit = unitById.get(id);
735
777
  if (!unit) continue;
736
778
  const radius = _nullishCoalesce(radii.get(unit.elementId), () => ( 0));
737
- const d = _chunkZ47OPTEPcjs.distance.call(void 0, world, unit);
779
+ const d = _chunkYLV7JK57cjs.distance.call(void 0, world, unit);
738
780
  if (d > reach + radius) continue;
739
781
  const score = d - radius;
740
782
  if (score < bestScore) {
@@ -759,7 +801,7 @@ function cornerPoint(box, corner) {
759
801
  var clamp = (v, min, max) => Math.min(max, Math.max(min, v));
760
802
  function resizeElement(el, corner, from, to) {
761
803
  if (el.type === "zone" || el.type === "landmark") {
762
- const box2 = el.type === "zone" ? _chunkZ47OPTEPcjs.zoneBounds.call(void 0, el) : centredBox(el.transform, el.width, el.height, el.transform.rotation);
804
+ const box2 = el.type === "zone" ? _chunkYLV7JK57cjs.zoneBounds.call(void 0, el) : centredBox(el.transform, el.width, el.height, el.transform.rotation);
763
805
  const east = corner === "ne" || corner === "se";
764
806
  const south = corner === "se" || corner === "sw";
765
807
  const start = cornerPoint(box2, corner);
@@ -770,11 +812,11 @@ function resizeElement(el, corner, from, to) {
770
812
  const swap = el.transform.rotation === 90 || el.transform.rotation === 270;
771
813
  const [w, h] = swap ? [worldH, worldW] : [worldW, worldH];
772
814
  if (el.type === "zone" && (_nullishCoalesce(el.curve, () => ( 0))) > 0) {
773
- const sized = _chunkZ47OPTEPcjs.zoneWithLocalSize.call(void 0, el, w, h);
815
+ const sized = _chunkYLV7JK57cjs.zoneWithLocalSize.call(void 0, el, w, h);
774
816
  const width = Math.round(clamp(sized.width, RESIZE_MIN, RESIZE_MAX));
775
817
  const height = Math.round(clamp(sized.height, RESIZE_MIN, RESIZE_MAX));
776
818
  const next = { ...sized, width, height };
777
- const b = _chunkZ47OPTEPcjs.zoneBounds.call(void 0, next);
819
+ const b = _chunkYLV7JK57cjs.zoneBounds.call(void 0, next);
778
820
  const dx = east ? box2.minX - b.minX : box2.maxX - b.maxX;
779
821
  const dy = south ? box2.minY - b.minY : box2.maxY - b.maxY;
780
822
  return { ...next, transform: { ...el.transform, x: el.transform.x + dx, y: el.transform.y + dy } };
@@ -786,11 +828,11 @@ function resizeElement(el, corner, from, to) {
786
828
  const box = pieceBounds(el);
787
829
  if (!box) return el;
788
830
  const centre = { x: (box.minX + box.maxX) / 2, y: (box.minY + box.maxY) / 2 };
789
- const reach = _chunkZ47OPTEPcjs.distance.call(void 0, from, centre);
831
+ const reach = _chunkYLV7JK57cjs.distance.call(void 0, from, centre);
790
832
  if (reach < 1) return el;
791
- const scale = _chunkZ47OPTEPcjs.snapScale.call(void 0, (_nullishCoalesce(el.scale, () => ( 1))) * (_chunkZ47OPTEPcjs.distance.call(void 0, to, centre) / reach), RESIZE_SCALE_STEP);
833
+ const scale = _chunkYLV7JK57cjs.snapScale.call(void 0, (_nullishCoalesce(el.scale, () => ( 1))) * (_chunkYLV7JK57cjs.distance.call(void 0, to, centre) / reach), RESIZE_SCALE_STEP);
792
834
  if (scale === (_nullishCoalesce(el.scale, () => ( 1)))) return el;
793
- return _chunkZ47OPTEPcjs.scalePiece.call(void 0, el, scale);
835
+ return _chunkYLV7JK57cjs.scalePiece.call(void 0, el, scale);
794
836
  }
795
837
 
796
838
  // ../canvas/src/a11y.ts
@@ -802,12 +844,12 @@ var defaultA11yLabels = {
802
844
  row: "fila",
803
845
  seat: "asiento"
804
846
  };
805
- function buildA11yNodes(units, states, placeTypeNames, labels = defaultA11yLabels) {
847
+ function buildA11yNodes(units, states, placeTypeNames, labels = defaultA11yLabels, stateWords) {
806
848
  return units.map((u) => {
807
849
  const state = _nullishCoalesce(states.get(u.id), () => ( "free"));
808
850
  const where = u.row !== void 0 && u.seat !== void 0 ? `${labels.row} ${u.row}, ${labels.seat} ${u.seat}` : u.label;
809
851
  const typeName = u.placeTypeRef === null ? void 0 : placeTypeNames.get(u.placeTypeRef);
810
- const name = [typeName, where, labels[state]].filter(Boolean).join(", ");
852
+ const name = [typeName, where, _nullishCoalesce(_optionalChain([stateWords, 'optionalAccess', _34 => _34.get, 'call', _35 => _35(u.id)]), () => ( labels[state]))].filter(Boolean).join(", ");
811
853
  return {
812
854
  id: u.id,
813
855
  name,
@@ -834,7 +876,7 @@ function nearestInDirection(nodes, from, direction) {
834
876
  const d = Math.hypot(dx, dy);
835
877
  if (!best2 || d < best2.d) best2 = { id: n.id, d };
836
878
  }
837
- return _nullishCoalesce(_optionalChain([best2, 'optionalAccess', _24 => _24.id]), () => ( null));
879
+ return _nullishCoalesce(_optionalChain([best2, 'optionalAccess', _36 => _36.id]), () => ( null));
838
880
  }
839
881
  function navigateA11y(nodes, fromId, direction) {
840
882
  const from = nodes.find((n) => n.id === fromId);
@@ -870,10 +912,10 @@ function initialEditGesture() {
870
912
  return { g: initialGestureState, press: null };
871
913
  }
872
914
  function isArmed(state) {
873
- return !!_optionalChain([state, 'access', _25 => _25.press, 'optionalAccess', _26 => _26.armed]) && state.press.movable !== null;
915
+ return !!_optionalChain([state, 'access', _37 => _37.press, 'optionalAccess', _38 => _38.armed]) && state.press.movable !== null;
874
916
  }
875
917
  function isMarqueeArmed(state) {
876
- return !!_optionalChain([state, 'access', _27 => _27.press, 'optionalAccess', _28 => _28.armed]) && !!state.press.marquee;
918
+ return !!_optionalChain([state, 'access', _39 => _39.press, 'optionalAccess', _40 => _40.armed]) && !!state.press.marquee;
877
919
  }
878
920
  var sample = (p) => ({ id: p.id, x: p.x, y: p.y });
879
921
  function reduceEditGesture(state, camera, viewport, input) {
@@ -900,9 +942,9 @@ function reduceEditGesture(state, camera, viewport, input) {
900
942
  if (input.kind === "down") {
901
943
  const r2 = delegate(state.g, { type: "pointerdown", pointer: sample(p) });
902
944
  if (Object.keys(r2.state.pointers).length >= 2) {
903
- const effects2 = _optionalChain([press, 'optionalAccess', _29 => _29.moving]) && press.movable ? [{ type: "moveEnd", elementId: press.movable }] : [];
904
- if (_optionalChain([press, 'optionalAccess', _30 => _30.resize, 'optionalAccess', _31 => _31.active]) && press.elementId) effects2.push({ type: "resizeCancel", elementId: press.elementId });
905
- if (_optionalChain([press, 'optionalAccess', _32 => _32.marquee, 'optionalAccess', _33 => _33.active])) effects2.push({ type: "marqueeCancel" });
945
+ const effects2 = _optionalChain([press, 'optionalAccess', _41 => _41.moving]) && press.movable ? [{ type: "moveEnd", elementId: press.movable }] : [];
946
+ if (_optionalChain([press, 'optionalAccess', _42 => _42.resize, 'optionalAccess', _43 => _43.active]) && press.elementId) effects2.push({ type: "resizeCancel", elementId: press.elementId });
947
+ if (_optionalChain([press, 'optionalAccess', _44 => _44.marquee, 'optionalAccess', _45 => _45.active])) effects2.push({ type: "marqueeCancel" });
906
948
  return {
907
949
  state: {
908
950
  g: r2.state,
@@ -957,9 +999,9 @@ function reduceEditGesture(state, camera, viewport, input) {
957
999
  };
958
1000
  }
959
1001
  if (input.kind === "move") {
960
- if (_optionalChain([press, 'optionalAccess', _34 => _34.marquee]) && Object.keys(state.g.pointers).length === 1) {
1002
+ if (_optionalChain([press, 'optionalAccess', _46 => _46.marquee]) && Object.keys(state.g.pointers).length === 1) {
961
1003
  const { origin } = press.marquee;
962
- const active = press.marquee.active || press.armed || _chunkZ47OPTEPcjs.distance.call(void 0, origin, p) > TAP_SLOP;
1004
+ const active = press.marquee.active || press.armed || _chunkYLV7JK57cjs.distance.call(void 0, origin, p) > TAP_SLOP;
963
1005
  if (!active) return { state, camera, effects: [] };
964
1006
  return {
965
1007
  state: { g: state.g, press: { ...press, last: { x: p.x, y: p.y }, marquee: { origin, active: true } } },
@@ -967,7 +1009,7 @@ function reduceEditGesture(state, camera, viewport, input) {
967
1009
  effects: [{ type: "marquee", from: screenToWorld(camera, viewport, origin), to: screenToWorld(camera, viewport, p) }]
968
1010
  };
969
1011
  }
970
- if (_optionalChain([press, 'optionalAccess', _35 => _35.resize]) && press.elementId) {
1012
+ if (_optionalChain([press, 'optionalAccess', _47 => _47.resize]) && press.elementId) {
971
1013
  if (Object.keys(state.g.pointers).length !== 1) return { state, camera, effects: [] };
972
1014
  const { corner, from } = press.resize;
973
1015
  return {
@@ -977,7 +1019,7 @@ function reduceEditGesture(state, camera, viewport, input) {
977
1019
  };
978
1020
  }
979
1021
  if (press && press.movable && Object.keys(state.g.pointers).length === 1) {
980
- const dragging = press.pointerType === "touch" ? press.armed : press.moving || _chunkZ47OPTEPcjs.distance.call(void 0,
1022
+ const dragging = press.pointerType === "touch" ? press.armed : press.moving || _chunkYLV7JK57cjs.distance.call(void 0,
981
1023
  _nullishCoalesce(state.g.origin, () => ( press.last)),
982
1024
  p
983
1025
  ) > TAP_SLOP;
@@ -993,7 +1035,7 @@ function reduceEditGesture(state, camera, viewport, input) {
993
1035
  if (press.pointerType !== "touch") return { state, camera, effects: [] };
994
1036
  }
995
1037
  const r2 = delegate(state.g, { type: "pointermove", pointer: sample(p) });
996
- const lostPiece = _optionalChain([press, 'optionalAccess', _36 => _36.movable]) && r2.state.moved && !press.moving;
1038
+ const lostPiece = _optionalChain([press, 'optionalAccess', _48 => _48.movable]) && r2.state.moved && !press.moving;
997
1039
  return {
998
1040
  state: { g: r2.state, press: press && lostPiece ? { ...press, movable: null } : press },
999
1041
  camera: r2.camera,
@@ -1003,19 +1045,19 @@ function reduceEditGesture(state, camera, viewport, input) {
1003
1045
  const r = delegate(state.g, { type: input.kind === "up" ? "pointerup" : "pointercancel", pointer: sample(p) });
1004
1046
  const idle = Object.keys(r.state.pointers).length === 0;
1005
1047
  const effects = [];
1006
- if (_optionalChain([press, 'optionalAccess', _37 => _37.resize]) && press.elementId) {
1048
+ if (_optionalChain([press, 'optionalAccess', _49 => _49.resize]) && press.elementId) {
1007
1049
  if (press.resize.active) {
1008
1050
  effects.push({ type: input.kind === "up" ? "resizeEnd" : "resizeCancel", elementId: press.elementId });
1009
1051
  }
1010
1052
  return { state: { g: r.state, press: idle ? null : { ...press, resize: void 0 } }, camera: r.camera, effects };
1011
1053
  }
1012
- if (_optionalChain([press, 'optionalAccess', _38 => _38.marquee, 'optionalAccess', _39 => _39.active])) {
1054
+ if (_optionalChain([press, 'optionalAccess', _50 => _50.marquee, 'optionalAccess', _51 => _51.active])) {
1013
1055
  const from = screenToWorld(camera, viewport, press.marquee.origin);
1014
1056
  const to = screenToWorld(camera, viewport, press.last);
1015
1057
  effects.push(input.kind === "up" ? { type: "marqueeEnd", from, to, additive: !!press.additive } : { type: "marqueeCancel" });
1016
1058
  return { state: { g: r.state, press: idle ? null : { ...press, marquee: void 0, canMarquee: false } }, camera: r.camera, effects };
1017
1059
  }
1018
- if (_optionalChain([press, 'optionalAccess', _40 => _40.moving]) && press.movable) effects.push({ type: "moveEnd", elementId: press.movable });
1060
+ if (_optionalChain([press, 'optionalAccess', _52 => _52.moving]) && press.movable) effects.push({ type: "moveEnd", elementId: press.movable });
1019
1061
  else if (r.tap && press) {
1020
1062
  const world = screenToWorld(camera, viewport, r.tap);
1021
1063
  effects.push(press.additive ? { type: "tap", world, elementId: press.elementId, additive: true } : { type: "tap", world, elementId: press.elementId });
@@ -1148,11 +1190,11 @@ function snapMove(moving, others, threshold, opts = {}) {
1148
1190
  const pick = (axis) => best([...alignCandidates(moving, others, axis, threshold, opts.sheet), ...gapCandidates(moving, others, axis, threshold)]);
1149
1191
  const x = pick("x");
1150
1192
  const y = pick("y");
1151
- const dx = _nullishCoalesce(_optionalChain([x, 'optionalAccess', _41 => _41.delta]), () => ( 0));
1152
- const dy = _nullishCoalesce(_optionalChain([y, 'optionalAccess', _42 => _42.delta]), () => ( 0));
1193
+ const dx = _nullishCoalesce(_optionalChain([x, 'optionalAccess', _53 => _53.delta]), () => ( 0));
1194
+ const dy = _nullishCoalesce(_optionalChain([y, 'optionalAccess', _54 => _54.delta]), () => ( 0));
1153
1195
  const moved = shiftBox(moving, dx, dy);
1154
1196
  const guides = alignmentGuides(moved, others, opts.sheet);
1155
- const gaps = [..._nullishCoalesce(_optionalChain([x, 'optionalAccess', _43 => _43.gaps, 'call', _44 => _44(moved)]), () => ( [])), ..._nullishCoalesce(_optionalChain([y, 'optionalAccess', _45 => _45.gaps, 'call', _46 => _46(moved)]), () => ( []))];
1197
+ const gaps = [..._nullishCoalesce(_optionalChain([x, 'optionalAccess', _55 => _55.gaps, 'call', _56 => _56(moved)]), () => ( [])), ..._nullishCoalesce(_optionalChain([y, 'optionalAccess', _57 => _57.gaps, 'call', _58 => _58(moved)]), () => ( []))];
1156
1198
  return { dx, dy, guides, gaps };
1157
1199
  }
1158
1200
  function snapResize(box, edges, others, threshold, opts = {}) {
@@ -1275,7 +1317,7 @@ function focusBox(layout, units, radii, ref) {
1275
1317
  maxY = Math.max(maxY, u.y + r);
1276
1318
  }
1277
1319
  for (const el of layout.elements) {
1278
- if (el.type !== "zone" || _optionalChain([el, 'access', _47 => _47.placeType, 'optionalAccess', _48 => _48.ref]) !== ref) continue;
1320
+ if (el.type !== "zone" || _optionalChain([el, 'access', _59 => _59.placeType, 'optionalAccess', _60 => _60.ref]) !== ref) continue;
1279
1321
  const b = pieceBounds(el);
1280
1322
  if (!b) continue;
1281
1323
  minX = Math.min(minX, b.minX);
@@ -1341,7 +1383,18 @@ var es = {
1341
1383
  backToMap: "Todo el mapa",
1342
1384
  focusHintSeats: "Toc\xE1 las butacas que quer\xE9s.",
1343
1385
  focusHintPlaces: "Toc\xE1 los lugares que quer\xE9s en cada mesa.",
1344
- focusHintTables: "Toc\xE1 las mesas que quer\xE9s."
1386
+ focusHintTables: "Toc\xE1 las mesas que quer\xE9s.",
1387
+ notForSale: "no est\xE1 a la venta",
1388
+ inviteOnlySeat: "Esa butaca no est\xE1 a la venta",
1389
+ inviteOnlyTable: "Esa mesa no est\xE1 a la venta",
1390
+ inviteOnlyPlace: "Ese lugar no est\xE1 a la venta",
1391
+ inviteOnly: "s\xF3lo con invitaci\xF3n",
1392
+ legendInviteOnly: "S\xF3lo con invitaci\xF3n",
1393
+ statusSold: "vendida",
1394
+ statusCourtesy: "regalada",
1395
+ statusHeld: "apartada",
1396
+ legendCourtesy: "Regalada",
1397
+ legendHeld: "Apartada"
1345
1398
  };
1346
1399
  var en = {
1347
1400
  free: "available",
@@ -1386,7 +1439,18 @@ var en = {
1386
1439
  backToMap: "Whole map",
1387
1440
  focusHintSeats: "Tap the seats you want.",
1388
1441
  focusHintPlaces: "Tap the places you want at each table.",
1389
- focusHintTables: "Tap the tables you want."
1442
+ focusHintTables: "Tap the tables you want.",
1443
+ notForSale: "not for sale",
1444
+ inviteOnlySeat: "That seat is not for sale",
1445
+ inviteOnlyTable: "That table is not for sale",
1446
+ inviteOnlyPlace: "That place is not for sale",
1447
+ inviteOnly: "invitation only",
1448
+ legendInviteOnly: "Invitation only",
1449
+ statusSold: "sold",
1450
+ statusCourtesy: "complimentary",
1451
+ statusHeld: "held",
1452
+ legendCourtesy: "Complimentary",
1453
+ legendHeld: "Held"
1390
1454
  };
1391
1455
  function format(template, vars) {
1392
1456
  return template.replace(
@@ -1472,6 +1536,12 @@ var PICKER_CSS = `
1472
1536
  --vk-landmark:#23232a;
1473
1537
  --vk-landmark-stroke:#34343c;
1474
1538
  --vk-landmark-fg:#d6d6dc;
1539
+ /* Panel de la productora: regalada, apartada y la marca que las distingue sin color. */
1540
+ --vk-courtesy:#7c3aed;
1541
+ --vk-courtesy-fg:#ffffff;
1542
+ --vk-held-for:#f59e0b;
1543
+ --vk-held-for-fg:#0b0b0d;
1544
+ --vk-status-mark:#ffffff;
1475
1545
  }
1476
1546
  .vk-root{display:flex;flex-direction:column;gap:12px;font:var(--vk-font);
1477
1547
  color:var(--vk-fg);background:var(--vk-bg);position:relative;box-sizing:border-box;
@@ -1512,6 +1582,9 @@ var PICKER_CSS = `
1512
1582
  .vk-dot{width:14px;height:14px;border-radius:50%;flex:none;box-sizing:border-box}
1513
1583
  .vk-dot[data-state="selected"]{background:var(--vk-mine);border:3px solid var(--vk-accent)}
1514
1584
  .vk-dot[data-state="taken"]{background:var(--vk-sold);border:1px solid var(--vk-sold-stroke)}
1585
+ .vk-dot[data-state="courtesy"]{background:radial-gradient(circle at 70% 30%,var(--vk-status-mark,#fff) 0 2.5px,transparent 3px),var(--vk-courtesy,#7c3aed);border:1px solid var(--vk-sold-stroke)}
1586
+ .vk-dot[data-state="held-for"]{background:linear-gradient(var(--vk-status-mark,#fff),var(--vk-status-mark,#fff)) 80% 20%/5px 5px no-repeat,var(--vk-held-for,#f59e0b);border:1px solid var(--vk-sold-stroke)}
1587
+ .vk-dot[data-state="invite-only"]{border:2px dashed var(--vk-fg)}
1515
1588
  .vk-cta{border:1px solid var(--vk-accent);background:var(--vk-accent);color:var(--vk-accent-fg);
1516
1589
  border-radius:var(--vk-radius);padding:10px 16px;cursor:pointer;font-size:14px;font-weight:600;min-height:44px}
1517
1590
  .vk-cta:disabled{opacity:.5;cursor:default}
@@ -1556,6 +1629,38 @@ var PICKER_CSS = `
1556
1629
  .vk-type-btn[data-selected="true"]{border-color:var(--vk-accent)}
1557
1630
  `;
1558
1631
 
1632
+ // ../react/src/unit-status.ts
1633
+ var KINDS = ["sold", "courtesy", "held"];
1634
+ function unitMarks(status) {
1635
+ const out = /* @__PURE__ */ new Map();
1636
+ if (!status) return out;
1637
+ for (const [id, s] of Object.entries(status)) {
1638
+ if (s && KINDS.includes(s.kind)) out.set(id, s.kind);
1639
+ }
1640
+ return out;
1641
+ }
1642
+ function presentStatusKinds(marks, units) {
1643
+ const seen = /* @__PURE__ */ new Set();
1644
+ for (const u of units) {
1645
+ const k = marks.get(u.id);
1646
+ if (k) seen.add(k);
1647
+ }
1648
+ return KINDS.filter((k) => seen.has(k));
1649
+ }
1650
+ function statusWord(kind, m) {
1651
+ return kind === "sold" ? m.statusSold : kind === "courtesy" ? m.statusCourtesy : m.statusHeld;
1652
+ }
1653
+ function statusA11y(s, m) {
1654
+ const word = statusWord(s.kind, m);
1655
+ return s.label ? `${word}, ${s.label}` : word;
1656
+ }
1657
+ function statusAnnouncement(unit, s, m) {
1658
+ return `${unitName(unit, m)}: ${s.label || statusWord(s.kind, m)}`;
1659
+ }
1660
+ function blockedInviteOnly(units, allow) {
1661
+ return allow ? [] : units.filter((u) => u.inviteOnly).map((u) => u.id);
1662
+ }
1663
+
1559
1664
  // ../react/src/useImage.ts
1560
1665
 
1561
1666
  function useImage(src) {
@@ -1577,7 +1682,7 @@ function useImage(src) {
1577
1682
  img.onerror = null;
1578
1683
  };
1579
1684
  }, [src]);
1580
- if (!src || _optionalChain([loaded, 'optionalAccess', _49 => _49.src]) !== src) return { image: null, failed: false };
1685
+ if (!src || _optionalChain([loaded, 'optionalAccess', _61 => _61.src]) !== src) return { image: null, failed: false };
1581
1686
  return { image: loaded.image, failed: loaded.failed };
1582
1687
  }
1583
1688
 
@@ -1664,7 +1769,8 @@ function VenueCanvas(props) {
1664
1769
  unassignedLabel: messages.unassigned,
1665
1770
  ...props.dimmedRefs ? { dimmedRefs: props.dimmedRefs } : {},
1666
1771
  ...props.placeTypePrices ? { placeTypePrices: props.placeTypePrices } : {},
1667
- ...props.highlightRefs ? { highlightRefs: props.highlightRefs } : {}
1772
+ ...props.highlightRefs ? { highlightRefs: props.highlightRefs } : {},
1773
+ ...props.unitMarks ? { unitMarks: props.unitMarks } : {}
1668
1774
  }),
1669
1775
  [
1670
1776
  layout,
@@ -1679,6 +1785,7 @@ function VenueCanvas(props) {
1679
1785
  props.dimmedRefs,
1680
1786
  props.placeTypePrices,
1681
1787
  props.highlightRefs,
1788
+ props.unitMarks,
1682
1789
  messages.unassigned
1683
1790
  ]
1684
1791
  );
@@ -1757,9 +1864,9 @@ function VenueCanvas(props) {
1757
1864
  _react.useEffect.call(void 0, () => {
1758
1865
  const id = pendingFocus.current;
1759
1866
  if (!id) return;
1760
- const button = _optionalChain([wrapRef, 'access', _50 => _50.current, 'optionalAccess', _51 => _51.querySelector, 'call', _52 => _52(`[data-unit-id="${id}"]`)]);
1867
+ const button = _optionalChain([wrapRef, 'access', _62 => _62.current, 'optionalAccess', _63 => _63.querySelector, 'call', _64 => _64(`[data-unit-id="${id}"]`)]);
1761
1868
  pendingFocus.current = null;
1762
- _optionalChain([(_nullishCoalesce(button, () => ( chooseRef.current))), 'optionalAccess', _53 => _53.focus, 'call', _54 => _54()]);
1869
+ _optionalChain([(_nullishCoalesce(button, () => ( chooseRef.current))), 'optionalAccess', _65 => _65.focus, 'call', _66 => _66()]);
1763
1870
  }, [visibleNodes]);
1764
1871
  const send = (input) => {
1765
1872
  const result = reduceGesture(gesture.current, camera, viewport, input);
@@ -1768,11 +1875,12 @@ function VenueCanvas(props) {
1768
1875
  if (!result.tap) return;
1769
1876
  const unitId = hitUnit({ index, camera, viewport, screenPoint: result.tap, units, radii: props.radii });
1770
1877
  if (!unitId) {
1771
- _optionalChain([props, 'access', _55 => _55.onTapEmpty, 'optionalCall', _56 => _56(result.tap)]);
1878
+ _optionalChain([props, 'access', _67 => _67.onTapEmpty, 'optionalCall', _68 => _68(result.tap)]);
1772
1879
  return;
1773
1880
  }
1774
1881
  const unit = unitById.get(unitId);
1775
- if (unit && props.focusRef !== null && unit.placeTypeRef === props.focusRef) {
1882
+ const choosable = unit && unit.placeTypeRef !== null && (props.focusRef !== null && unit.placeTypeRef === props.focusRef || !!_optionalChain([props, 'access', _69 => _69.selectableRefs, 'optionalAccess', _70 => _70.has, 'call', _71 => _71(unit.placeTypeRef)]));
1883
+ if (unit && choosable) {
1776
1884
  const closer = tapZoom(camera, viewport, result.tap, (_nullishCoalesce(props.radii.get(unit.elementId), () => ( DEFAULT_UNIT_RADIUS))) * camera.zoom);
1777
1885
  if (closer) {
1778
1886
  props.onCameraChange(closer);
@@ -1804,12 +1912,12 @@ function VenueCanvas(props) {
1804
1912
  const node = a11yNodes.find((n) => n.id === next);
1805
1913
  if (node) props.onCameraChange({ ...camera, x: node.x, y: node.y });
1806
1914
  } else {
1807
- _optionalChain([wrapRef, 'access', _57 => _57.current, 'optionalAccess', _58 => _58.querySelector, 'call', _59 => _59(`[data-unit-id="${next}"]`), 'optionalAccess', _60 => _60.focus, 'call', _61 => _61()]);
1915
+ _optionalChain([wrapRef, 'access', _72 => _72.current, 'optionalAccess', _73 => _73.querySelector, 'call', _74 => _74(`[data-unit-id="${next}"]`), 'optionalAccess', _75 => _75.focus, 'call', _76 => _76()]);
1808
1916
  pendingFocus.current = null;
1809
1917
  }
1810
1918
  };
1811
1919
  const zoomButton = (factor) => () => props.onCameraChange(zoomAt(camera, viewport, { x: viewport.width / 2, y: viewport.height / 2 }, factor));
1812
- const tabbableId = _nullishCoalesce((activeId !== null && visible.has(activeId) ? activeId : _optionalChain([visibleNodes, 'access', _62 => _62[0], 'optionalAccess', _63 => _63.id])), () => ( null));
1920
+ const tabbableId = _nullishCoalesce((activeId !== null && visible.has(activeId) ? activeId : _optionalChain([visibleNodes, 'access', _77 => _77[0], 'optionalAccess', _78 => _78.id])), () => ( null));
1813
1921
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1814
1922
  "div",
1815
1923
  {
@@ -1875,7 +1983,7 @@ function VenueCanvas(props) {
1875
1983
  var NONE = [];
1876
1984
  var EMPTY_SET = /* @__PURE__ */ new Set();
1877
1985
  function byKind(u, seat, table, place) {
1878
- return _optionalChain([u, 'optionalAccess', _64 => _64.kind]) === "table" ? table : _optionalChain([u, 'optionalAccess', _65 => _65.kind]) === "place" ? place : seat;
1986
+ return _optionalChain([u, 'optionalAccess', _79 => _79.kind]) === "table" ? table : _optionalChain([u, 'optionalAccess', _80 => _80.kind]) === "place" ? place : seat;
1879
1987
  }
1880
1988
  function a11yLabel(u, m) {
1881
1989
  const table = format(m.summaryTable, { table: _nullishCoalesce(u.table, () => ( u.label)) });
@@ -1885,13 +1993,13 @@ function a11yLabel(u, m) {
1885
1993
  }
1886
1994
  function SeatMap(props) {
1887
1995
  const { layout, focusRef, selection, onSelectionChange } = props;
1888
- const maxSelection = _nullishCoalesce(props.maxSelection, () => ( _chunkZ47OPTEPcjs.DEFAULT_MAX_SELECTION));
1996
+ const maxSelection = _nullishCoalesce(props.maxSelection, () => ( _chunkYLV7JK57cjs.DEFAULT_MAX_SELECTION));
1889
1997
  const messages = _react.useMemo.call(void 0,
1890
1998
  () => mergeMessages({ ...props.messages, ...props.continueLabel ? { continueLabel: props.continueLabel } : {} }),
1891
1999
  [props.messages, props.continueLabel]
1892
2000
  );
1893
- const units = _react.useMemo.call(void 0, () => _chunkZ47OPTEPcjs.expand.call(void 0, layout), [layout]);
1894
- const index = _react.useMemo.call(void 0, () => new (0, _chunkZ47OPTEPcjs.SpatialIndex)(units), [units]);
2001
+ const units = _react.useMemo.call(void 0, () => _chunkYLV7JK57cjs.expand.call(void 0, layout), [layout]);
2002
+ const index = _react.useMemo.call(void 0, () => new (0, _chunkYLV7JK57cjs.SpatialIndex)(units), [units]);
1895
2003
  const radii = _react.useMemo.call(void 0, () => unitRadii(layout), [layout]);
1896
2004
  const unitById = _react.useMemo.call(void 0, () => new Map(units.map((u) => [u.id, u])), [units]);
1897
2005
  const placeTypeColors = _react.useMemo.call(void 0, () => new Map(props.placeTypes.map((p) => [p.ref, p.color])), [props.placeTypes]);
@@ -1924,24 +2032,43 @@ function SeatMap(props) {
1924
2032
  const first = unitById.get(ids[0]);
1925
2033
  announce(byKind(first, messages.conflictSeat, messages.conflictTable, messages.conflictPlace), true);
1926
2034
  }, [props.conflictUnitIds, unitById, messages, announce]);
2035
+ const marks = _react.useMemo.call(void 0, () => unitMarks(props.unitStatus), [props.unitStatus]);
2036
+ const allowInviteOnly = props.allowInviteOnly === true;
2037
+ const blocked = _react.useMemo.call(void 0, () => new Set(blockedInviteOnly(units, allowInviteOnly)), [units, allowInviteOnly]);
1927
2038
  const taken = _react.useMemo.call(void 0,
1928
- () => /* @__PURE__ */ new Set([...props.takenUnitIds, ...conflicted]),
1929
- [props.takenUnitIds, conflicted]
2039
+ () => /* @__PURE__ */ new Set([...props.takenUnitIds, ...conflicted, ...marks.keys(), ...blocked]),
2040
+ [props.takenUnitIds, conflicted, marks, blocked]
1930
2041
  );
1931
2042
  const held = _react.useMemo.call(void 0, () => new Set(_nullishCoalesce(props.heldUnitIds, () => ( NONE))), [props.heldUnitIds]);
1932
- const states = _react.useMemo.call(void 0, () => _chunkZ47OPTEPcjs.unitStates.call(void 0, units, taken, selection, held), [units, taken, selection, held]);
1933
- const selectable = _react.useMemo.call(void 0, () => units.filter((u) => u.placeTypeRef === focusRef), [units, focusRef]);
2043
+ const states = _react.useMemo.call(void 0, () => _chunkYLV7JK57cjs.unitStates.call(void 0, units, taken, selection, held), [units, taken, selection, held]);
2044
+ const multiType = props.multiType === true;
2045
+ const selectableRefs = _react.useMemo.call(void 0, () => multiType ? new Set(placeTypeNames.keys()) : void 0, [multiType, placeTypeNames]);
2046
+ const selectable = _react.useMemo.call(void 0,
2047
+ () => units.filter((u) => selectableRefs ? u.placeTypeRef !== null && selectableRefs.has(u.placeTypeRef) : u.placeTypeRef === focusRef),
2048
+ [units, focusRef, selectableRefs]
2049
+ );
2050
+ const stateWords = _react.useMemo.call(void 0, () => {
2051
+ const out = /* @__PURE__ */ new Map();
2052
+ for (const u of selectable) {
2053
+ const s = _optionalChain([props, 'access', _81 => _81.unitStatus, 'optionalAccess', _82 => _82[u.id]]);
2054
+ if (s && marks.has(u.id)) out.set(u.id, statusA11y(s, messages));
2055
+ else if (blocked.has(u.id)) out.set(u.id, messages.notForSale);
2056
+ else if (u.inviteOnly && states.get(u.id) === "free") out.set(u.id, `${messages.free}, ${messages.inviteOnly}`);
2057
+ }
2058
+ return out;
2059
+ }, [selectable, props.unitStatus, marks, blocked, states, messages]);
1934
2060
  const a11yNodes = _react.useMemo.call(void 0,
1935
2061
  () => buildA11yNodes(
1936
2062
  selectable.map((u) => u.kind === "seat" ? u : { ...u, label: a11yLabel(u, messages) }),
1937
2063
  states,
1938
2064
  placeTypeNames,
1939
- { free: messages.free, taken: messages.taken, selected: messages.selected, held: messages.held, row: messages.row, seat: messages.seat }
2065
+ { free: messages.free, taken: messages.taken, selected: messages.selected, held: messages.held, row: messages.row, seat: messages.seat },
2066
+ stateWords
1940
2067
  ),
1941
- [selectable, states, placeTypeNames, messages]
2068
+ [selectable, states, placeTypeNames, messages, stateWords]
1942
2069
  );
1943
2070
  const bg = layout.meta.background;
1944
- const background = useImage(_nullishCoalesce(_optionalChain([bg, 'optionalAccess', _66 => _66.src]), () => ( null)));
2071
+ const background = useImage(_nullishCoalesce(_optionalChain([bg, 'optionalAccess', _83 => _83.src]), () => ( null)));
1945
2072
  const images = _react.useMemo.call(void 0,
1946
2073
  () => new Map(bg && background.image ? [[bg.src, background.image]] : []),
1947
2074
  [bg, background.image]
@@ -1952,7 +2079,7 @@ function SeatMap(props) {
1952
2079
  const framedFor = _react.useRef.call(void 0, null);
1953
2080
  _react.useEffect.call(void 0, () => {
1954
2081
  if (viewport.width === 0 || viewport.height === 0) return;
1955
- if (_optionalChain([framedFor, 'access', _67 => _67.current, 'optionalAccess', _68 => _68.layout]) === layout && framedFor.current.focusRef === focusRef) return;
2082
+ if (_optionalChain([framedFor, 'access', _84 => _84.current, 'optionalAccess', _85 => _85.layout]) === layout && framedFor.current.focusRef === focusRef) return;
1956
2083
  framedFor.current = { layout, focusRef };
1957
2084
  const box = _nullishCoalesce(focusBox(layout, units, radii, focusRef), () => ( { minX: 0, minY: 0, maxX: layout.meta.width, maxY: layout.meta.height }));
1958
2085
  setCamera(fitBox(box, viewport, props.embedded ? 16 : 24));
@@ -1970,20 +2097,30 @@ function SeatMap(props) {
1970
2097
  const onTapEmpty = _react.useCallback.call(void 0, (screen) => {
1971
2098
  const el = elementAt(layout, screen, cameraRef.current, viewportRef.current);
1972
2099
  if (!el || el.type === "landmark") return;
1973
- switchTo(_optionalChain([el, 'access', _69 => _69.placeType, 'optionalAccess', _70 => _70.ref]) || null);
2100
+ switchTo(_optionalChain([el, 'access', _86 => _86.placeType, 'optionalAccess', _87 => _87.ref]) || null);
1974
2101
  }, [layout, switchTo]);
1975
2102
  const activateUnit = _react.useCallback.call(void 0, (unitId) => {
1976
2103
  const unit = unitById.get(unitId);
1977
2104
  if (!unit) return;
1978
- if (unit.placeTypeRef !== focusRef) {
2105
+ const ownType = unit.placeTypeRef === focusRef || !!selectableRefs && unit.placeTypeRef !== null && selectableRefs.has(unit.placeTypeRef);
2106
+ if (!ownType) {
1979
2107
  switchTo(unit.placeTypeRef);
1980
2108
  return;
1981
2109
  }
2110
+ const status = _optionalChain([props, 'access', _88 => _88.unitStatus, 'optionalAccess', _89 => _89[unitId]]);
2111
+ if (status && marks.has(unitId) && !selection.includes(unitId)) {
2112
+ announce(statusAnnouncement(unit, status, messages), true);
2113
+ return;
2114
+ }
2115
+ if (blocked.has(unitId) && !selection.includes(unitId)) {
2116
+ announce(byKind(unit, messages.inviteOnlySeat, messages.inviteOnlyTable, messages.inviteOnlyPlace), true);
2117
+ return;
2118
+ }
1982
2119
  if (states.get(unitId) === "held" && !selection.includes(unitId)) {
1983
2120
  announce(messages.heldSeat, true);
1984
2121
  return;
1985
2122
  }
1986
- const result = _chunkZ47OPTEPcjs.toggleUnit.call(void 0, selection, unitId, states, maxSelection);
2123
+ const result = _chunkYLV7JK57cjs.toggleUnit.call(void 0, selection, unitId, states, maxSelection);
1987
2124
  if (result.rejected === "taken") {
1988
2125
  announce(byKind(unit, messages.takenSeat, messages.takenTable, messages.takenPlace), true);
1989
2126
  return;
@@ -1995,13 +2132,29 @@ function SeatMap(props) {
1995
2132
  const added = result.selection.includes(unitId);
1996
2133
  announce(`${unitName(unit, messages)}: ${added ? messages.selected : messages.free}`);
1997
2134
  onSelectionChange(result.selection);
1998
- }, [unitById, focusRef, states, selection, maxSelection, messages, announce, onSelectionChange, switchTo]);
2135
+ }, [
2136
+ unitById,
2137
+ focusRef,
2138
+ selectableRefs,
2139
+ props.unitStatus,
2140
+ marks,
2141
+ blocked,
2142
+ states,
2143
+ selection,
2144
+ maxSelection,
2145
+ messages,
2146
+ announce,
2147
+ onSelectionChange,
2148
+ switchTo
2149
+ ]);
1999
2150
  const summary = _react.useMemo.call(void 0, () => selectionSummary(units, selection, messages), [units, selection, messages]);
2000
2151
  const focusColor = _nullishCoalesce(placeTypeColors.get(focusRef), () => ( "var(--vk-unassigned)"));
2001
2152
  const focusType = props.placeTypes.find((p) => p.ref === focusRef);
2002
2153
  const embedded = props.embedded === true;
2003
2154
  const kind = _react.useMemo.call(void 0, () => focusKind(units, focusRef), [units, focusRef]);
2004
2155
  const hint = kind === "seat" ? messages.focusHintSeats : kind === "place" ? messages.focusHintPlaces : messages.focusHintTables;
2156
+ const statusKinds = _react.useMemo.call(void 0, () => presentStatusKinds(marks, units), [marks, units]);
2157
+ const showInviteOnly = _react.useMemo.call(void 0, () => allowInviteOnly && units.some((u) => u.inviteOnly && !marks.has(u.id)), [allowInviteOnly, units, marks]);
2005
2158
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2006
2159
  "div",
2007
2160
  {
@@ -2043,7 +2196,9 @@ function SeatMap(props) {
2043
2196
  onActivateUnit: activateUnit,
2044
2197
  messages,
2045
2198
  placeTypeColors,
2046
- focusRef,
2199
+ focusRef: multiType ? null : focusRef,
2200
+ ...selectableRefs ? { selectableRefs } : {},
2201
+ ...marks.size > 0 ? { unitMarks: marks } : {},
2047
2202
  onTapEmpty,
2048
2203
  placeTypePrices,
2049
2204
  ...props.height !== void 0 ? { height: props.height } : {},
@@ -2064,7 +2219,19 @@ function SeatMap(props) {
2064
2219
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { children: [
2065
2220
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-dot", "data-state": "taken" }),
2066
2221
  messages.legendTaken
2067
- ] })
2222
+ ] }),
2223
+ statusKinds.includes("courtesy") ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { children: [
2224
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-dot", "data-state": "courtesy" }),
2225
+ messages.legendCourtesy
2226
+ ] }) : null,
2227
+ statusKinds.includes("held") ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { children: [
2228
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-dot", "data-state": "held-for" }),
2229
+ messages.legendHeld
2230
+ ] }) : null,
2231
+ showInviteOnly ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { children: [
2232
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-dot", "data-state": "invite-only", style: { background: focusColor } }),
2233
+ messages.legendInviteOnly
2234
+ ] }) : null
2068
2235
  ] }),
2069
2236
  announcement.blocking && announcement.text ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "vk-notice", "data-testid": "notice", children: announcement.text }) : null,
2070
2237
  embedded ? null : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-bar", "data-testid": "summary-bar", children: [
@@ -2096,7 +2263,7 @@ function overviewBox(layout, radii) {
2096
2263
  for (const el of layout.elements) {
2097
2264
  const b = elementBounds(layout, el);
2098
2265
  if (!b) continue;
2099
- const r = el.type === "seatBlock" || el.type === "table" ? _nullishCoalesce(_optionalChain([radii, 'optionalAccess', _71 => _71.get, 'call', _72 => _72(el.id)]), () => ( 0)) : 0;
2266
+ const r = el.type === "seatBlock" || el.type === "table" ? _nullishCoalesce(_optionalChain([radii, 'optionalAccess', _90 => _90.get, 'call', _91 => _91(el.id)]), () => ( 0)) : 0;
2100
2267
  box = box ? {
2101
2268
  minX: Math.min(box.minX, b.minX - r),
2102
2269
  minY: Math.min(box.minY, b.minY - r),
@@ -2118,8 +2285,8 @@ var NO_NODES = [];
2118
2285
  function VenueOverview(props) {
2119
2286
  const { layout, placeTypes, onSelect } = props;
2120
2287
  const messages = _react.useMemo.call(void 0, () => mergeMessages(props.messages), [props.messages]);
2121
- const units = _react.useMemo.call(void 0, () => _chunkZ47OPTEPcjs.expand.call(void 0, layout), [layout]);
2122
- const index = _react.useMemo.call(void 0, () => new (0, _chunkZ47OPTEPcjs.SpatialIndex)(units), [units]);
2288
+ const units = _react.useMemo.call(void 0, () => _chunkYLV7JK57cjs.expand.call(void 0, layout), [layout]);
2289
+ const index = _react.useMemo.call(void 0, () => new (0, _chunkYLV7JK57cjs.SpatialIndex)(units), [units]);
2123
2290
  const radii = _react.useMemo.call(void 0, () => unitRadii(layout), [layout]);
2124
2291
  const unitById = _react.useMemo.call(void 0, () => new Map(units.map((u) => [u.id, u])), [units]);
2125
2292
  const placeTypeColors = _react.useMemo.call(void 0, () => new Map(placeTypes.map((p) => [p.ref, p.color])), [placeTypes]);
@@ -2135,9 +2302,11 @@ function VenueOverview(props) {
2135
2302
  const highlightRefs = _react.useMemo.call(void 0, () => new Set(selectedRefs), [selectedRefs]);
2136
2303
  const takenIds = _nullishCoalesce(props.takenUnitIds, () => ( NONE2));
2137
2304
  const selectedIds = _nullishCoalesce(props.selectedUnitIds, () => ( NONE2));
2305
+ const marks = _react.useMemo.call(void 0, () => unitMarks(props.unitStatus), [props.unitStatus]);
2306
+ const allowInviteOnly = props.allowInviteOnly === true;
2138
2307
  const states = _react.useMemo.call(void 0,
2139
- () => _chunkZ47OPTEPcjs.unitStates.call(void 0, units, new Set(takenIds), selectedIds, NO_HELD),
2140
- [units, takenIds, selectedIds]
2308
+ () => _chunkYLV7JK57cjs.unitStates.call(void 0, units, /* @__PURE__ */ new Set([...takenIds, ...blockedInviteOnly(units, allowInviteOnly)]), selectedIds, NO_HELD),
2309
+ [units, takenIds, selectedIds, allowInviteOnly]
2141
2310
  );
2142
2311
  const hideList = props.hideList === true;
2143
2312
  const canvasMessages = _react.useMemo.call(void 0,
@@ -2149,12 +2318,12 @@ function VenueOverview(props) {
2149
2318
  const tap = overviewTap(ref, placeTypes);
2150
2319
  if (tap.kind === "select") onSelect(tap.ref);
2151
2320
  else if (tap.kind === "soldOut") {
2152
- const name = _nullishCoalesce(_optionalChain([placeTypes, 'access', _73 => _73.find, 'call', _74 => _74((p) => p.ref === tap.ref), 'optionalAccess', _75 => _75.label]), () => ( ""));
2321
+ const name = _nullishCoalesce(_optionalChain([placeTypes, 'access', _92 => _92.find, 'call', _93 => _93((p) => p.ref === tap.ref), 'optionalAccess', _94 => _94.label]), () => ( ""));
2153
2322
  setNotice((n) => ({ text: format(messages.soldOutNotice, { name }), seq: n.seq + 1 }));
2154
2323
  }
2155
2324
  }, [placeTypes, onSelect, messages]);
2156
2325
  const bg = layout.meta.background;
2157
- const background = useImage(_nullishCoalesce(_optionalChain([bg, 'optionalAccess', _76 => _76.src]), () => ( null)));
2326
+ const background = useImage(_nullishCoalesce(_optionalChain([bg, 'optionalAccess', _95 => _95.src]), () => ( null)));
2158
2327
  const images = _react.useMemo.call(void 0,
2159
2328
  () => new Map(bg && background.image ? [[bg.src, background.image]] : []),
2160
2329
  [bg, background.image]
@@ -2181,7 +2350,7 @@ function VenueOverview(props) {
2181
2350
  const onTapEmpty = _react.useCallback.call(void 0, (screen) => {
2182
2351
  const el = elementAt(layout, screen, cameraRef.current, viewportRef.current);
2183
2352
  if (!el || el.type === "landmark") return;
2184
- choose(_optionalChain([el, 'access', _77 => _77.placeType, 'optionalAccess', _78 => _78.ref]) || null);
2353
+ choose(_optionalChain([el, 'access', _96 => _96.placeType, 'optionalAccess', _97 => _97.ref]) || null);
2185
2354
  }, [layout, choose]);
2186
2355
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2187
2356
  "div",
@@ -2206,7 +2375,7 @@ function VenueOverview(props) {
2206
2375
  onCameraChange: setCamera,
2207
2376
  viewport,
2208
2377
  onViewportChange: setViewport,
2209
- onActivateUnit: (id) => choose(_nullishCoalesce(_optionalChain([unitById, 'access', _79 => _79.get, 'call', _80 => _80(id), 'optionalAccess', _81 => _81.placeTypeRef]), () => ( null))),
2378
+ onActivateUnit: (id) => choose(_nullishCoalesce(_optionalChain([unitById, 'access', _98 => _98.get, 'call', _99 => _99(id), 'optionalAccess', _100 => _100.placeTypeRef]), () => ( null))),
2210
2379
  onTapEmpty,
2211
2380
  messages: canvasMessages,
2212
2381
  placeTypeColors,
@@ -2214,6 +2383,7 @@ function VenueOverview(props) {
2214
2383
  dimmedRefs,
2215
2384
  placeTypePrices,
2216
2385
  highlightRefs,
2386
+ ...marks.size > 0 ? { unitMarks: marks } : {},
2217
2387
  ...props.height !== void 0 ? { height: props.height } : {},
2218
2388
  ratio: contentRatio,
2219
2389
  cooperative: true,
@@ -2301,9 +2471,9 @@ function withWorldSize(el, axis, size) {
2301
2471
  const swap = el.transform.rotation === 90 || el.transform.rotation === 270;
2302
2472
  const field = axis === "x" !== swap ? "width" : "height";
2303
2473
  if (el.type === "zone" && (_nullishCoalesce(el.curve, () => ( 0))) > 0) {
2304
- const now = _chunkZ47OPTEPcjs.zoneLocalSize.call(void 0, el);
2474
+ const now = _chunkYLV7JK57cjs.zoneLocalSize.call(void 0, el);
2305
2475
  if (Math.abs(now[field] - size) < 1e-6) return el;
2306
- const next = _chunkZ47OPTEPcjs.zoneWithLocalSize.call(void 0, el, field === "width" ? size : now.width, field === "height" ? size : now.height);
2476
+ const next = _chunkYLV7JK57cjs.zoneWithLocalSize.call(void 0, el, field === "width" ? size : now.width, field === "height" ? size : now.height);
2307
2477
  return { ...next, width: Math.round(next.width), height: Math.round(next.height) };
2308
2478
  }
2309
2479
  return el[field] === size ? el : { ...el, [field]: size };
@@ -2329,7 +2499,7 @@ function arrangeCommands(layout, ids, action) {
2329
2499
  const scale = _nullishCoalesce(model.el.scale, () => ( 1));
2330
2500
  return scaled.slice(1).flatMap(({ el }) => {
2331
2501
  const piece = el;
2332
- return (_nullishCoalesce(piece.scale, () => ( 1))) === scale ? [] : [{ type: "replaceElement", element: _chunkZ47OPTEPcjs.scalePiece.call(void 0, piece, scale) }];
2502
+ return (_nullishCoalesce(piece.scale, () => ( 1))) === scale ? [] : [{ type: "replaceElement", element: _chunkYLV7JK57cjs.scalePiece.call(void 0, piece, scale) }];
2333
2503
  });
2334
2504
  }
2335
2505
  const shifts = action === "distributeX" ? distributeBoxes(boxes, "x") : action === "distributeY" ? distributeBoxes(boxes, "y") : alignBoxes(boxes, action);
@@ -2486,7 +2656,7 @@ function splitUnits(units, changed) {
2486
2656
  const still = [];
2487
2657
  const moving = [];
2488
2658
  for (const u of units) (changed.has(u.elementId) ? moving : still).push(u);
2489
- return { changed, still, stillIndex: new (0, _chunkZ47OPTEPcjs.SpatialIndex)(still), moving, movingIndex: new (0, _chunkZ47OPTEPcjs.SpatialIndex)(moving) };
2659
+ return { changed, still, stillIndex: new (0, _chunkYLV7JK57cjs.SpatialIndex)(still), moving, movingIndex: new (0, _chunkYLV7JK57cjs.SpatialIndex)(moving) };
2490
2660
  }
2491
2661
  function boxesOf(layout) {
2492
2662
  const out = /* @__PURE__ */ new Map();
@@ -2522,21 +2692,21 @@ function previewFrame(base, split, baseBoxes, preview) {
2522
2692
  }
2523
2693
  const { element } = preview;
2524
2694
  const layout = { ...base, elements: base.elements.map((el) => el.id === element.id ? element : el) };
2525
- const own = _chunkZ47OPTEPcjs.expand.call(void 0, { ...base, elements: [element] });
2695
+ const own = _chunkYLV7JK57cjs.expand.call(void 0, { ...base, elements: [element] });
2526
2696
  const b = pieceBounds(element);
2527
2697
  if (b) boxes.set(element.id, b);
2528
2698
  else boxes.delete(element.id);
2529
- return { layout, units: split.still.concat(own), index: joined(split.stillIndex, new (0, _chunkZ47OPTEPcjs.SpatialIndex)(own), 0, 0), boxes };
2699
+ return { layout, units: split.still.concat(own), index: joined(split.stillIndex, new (0, _chunkYLV7JK57cjs.SpatialIndex)(own), 0, 0), boxes };
2530
2700
  }
2531
2701
 
2532
2702
  // ../react/src/designer/sizing.ts
2533
2703
  var SIZE_STEP = 0.1;
2534
2704
  var KEY_RESIZE_STEP = 20;
2535
2705
  function steppedScale(scale, direction) {
2536
- return _chunkZ47OPTEPcjs.snapScale.call(void 0, scale + direction * SIZE_STEP);
2706
+ return _chunkYLV7JK57cjs.snapScale.call(void 0, scale + direction * SIZE_STEP);
2537
2707
  }
2538
2708
  function keyboardResize(el, corner, direction) {
2539
- if (el.type === "seatBlock" || el.type === "table") return _chunkZ47OPTEPcjs.scalePiece.call(void 0, el, steppedScale(_nullishCoalesce(el.scale, () => ( 1)), direction));
2709
+ if (el.type === "seatBlock" || el.type === "table") return _chunkYLV7JK57cjs.scalePiece.call(void 0, el, steppedScale(_nullishCoalesce(el.scale, () => ( 1)), direction));
2540
2710
  const box = pieceBounds(el);
2541
2711
  if (!box) return el;
2542
2712
  const from = cornerPoint(box, corner);
@@ -2570,29 +2740,29 @@ function frame(layout, viewport) {
2570
2740
  function pieceName(el, placeTypes, m) {
2571
2741
  if (el.type === "landmark") return el.name;
2572
2742
  if (el.type === "zone") {
2573
- const ref2 = _optionalChain([el, 'access', _82 => _82.placeType, 'optionalAccess', _83 => _83.ref]) || null;
2574
- return _nullishCoalesce((ref2 ? _optionalChain([placeTypes, 'access', _84 => _84.find, 'call', _85 => _85((p) => p.ref === ref2), 'optionalAccess', _86 => _86.label]) : void 0), () => ( m.unassigned));
2743
+ const ref2 = _optionalChain([el, 'access', _101 => _101.placeType, 'optionalAccess', _102 => _102.ref]) || null;
2744
+ return _nullishCoalesce((ref2 ? _optionalChain([placeTypes, 'access', _103 => _103.find, 'call', _104 => _104((p) => p.ref === ref2), 'optionalAccess', _105 => _105.label]) : void 0), () => ( m.unassigned));
2575
2745
  }
2576
2746
  const own = el.type === "seatBlock" ? (() => {
2577
- const rows = _chunkZ47OPTEPcjs.expandLabels.call(void 0, el.rowLabels, el.rows);
2747
+ const rows = _chunkYLV7JK57cjs.expandLabels.call(void 0, el.rowLabels, el.rows);
2578
2748
  return format(m.pieceBlockName, { from: _nullishCoalesce(rows[0], () => ( "")), to: _nullishCoalesce(rows[rows.length - 1], () => ( "")) });
2579
2749
  })() : format(m.pieceTableName, { label: el.label });
2580
- const ref = _optionalChain([el, 'access', _87 => _87.placeType, 'optionalAccess', _88 => _88.ref]) || null;
2581
- const type = ref ? _optionalChain([placeTypes, 'access', _89 => _89.find, 'call', _90 => _90((p) => p.ref === ref), 'optionalAccess', _91 => _91.label]) : void 0;
2750
+ const ref = _optionalChain([el, 'access', _106 => _106.placeType, 'optionalAccess', _107 => _107.ref]) || null;
2751
+ const type = ref ? _optionalChain([placeTypes, 'access', _108 => _108.find, 'call', _109 => _109((p) => p.ref === ref), 'optionalAccess', _110 => _110.label]) : void 0;
2582
2752
  return `${own}, ${_nullishCoalesce(type, () => ( m.unassigned))}`;
2583
2753
  }
2584
2754
  function fullBlock(layout, id) {
2585
2755
  const el = id ? layout.elements.find((e) => e.id === id) : void 0;
2586
- return _optionalChain([el, 'optionalAccess', _92 => _92.type]) === "seatBlock" ? _chunkZ47OPTEPcjs.expandSeatBlock.call(void 0, { ...el, removed: [] }) : [];
2756
+ return _optionalChain([el, 'optionalAccess', _111 => _111.type]) === "seatBlock" ? _chunkYLV7JK57cjs.expandSeatBlock.call(void 0, { ...el, removed: [] }) : [];
2587
2757
  }
2588
2758
  var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ designer, placeTypes, lockedUnitIds, messages, frameKey, onPieceTap, backgroundImage = null, compact = false, overlay, theme }, ref) {
2589
2759
  const { ui } = designer;
2590
2760
  const [preview, setPreview] = _react.useState.call(void 0, null);
2591
2761
  const resizingRef = _react.useRef.call(void 0, null);
2592
- const resizing = _optionalChain([preview, 'optionalAccess', _93 => _93.kind]) === "replace" ? preview.element : null;
2762
+ const resizing = _optionalChain([preview, 'optionalAccess', _112 => _112.kind]) === "replace" ? preview.element : null;
2593
2763
  const base = designer.layout;
2594
- const baseUnits = _react.useMemo.call(void 0, () => _chunkZ47OPTEPcjs.expand.call(void 0, base), [base]);
2595
- const baseIndex = _react.useMemo.call(void 0, () => new (0, _chunkZ47OPTEPcjs.SpatialIndex)(baseUnits), [baseUnits]);
2764
+ const baseUnits = _react.useMemo.call(void 0, () => _chunkYLV7JK57cjs.expand.call(void 0, base), [base]);
2765
+ const baseIndex = _react.useMemo.call(void 0, () => new (0, _chunkYLV7JK57cjs.SpatialIndex)(baseUnits), [baseUnits]);
2596
2766
  const baseBoxes = _react.useMemo.call(void 0, () => boxesOf(base), [base]);
2597
2767
  const changedKey = preview ? changedIds(preview).join("\0") : "";
2598
2768
  const split = _react.useMemo.call(void 0, () => changedKey ? splitUnits(baseUnits, new Set(changedKey.split("\0"))) : null, [baseUnits, changedKey]);
@@ -2631,7 +2801,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
2631
2801
  );
2632
2802
  const placeTypeColors = _react.useMemo.call(void 0, () => new Map(placeTypes.map((p) => [p.ref, p.color])), [placeTypes]);
2633
2803
  const seatEditUnits = _react.useMemo.call(void 0, () => fullBlock(base, ui.seatEditId), [base, ui.seatEditId]);
2634
- const seatEditIndex = _react.useMemo.call(void 0, () => new (0, _chunkZ47OPTEPcjs.SpatialIndex)(seatEditUnits), [seatEditUnits]);
2804
+ const seatEditIndex = _react.useMemo.call(void 0, () => new (0, _chunkYLV7JK57cjs.SpatialIndex)(seatEditUnits), [seatEditUnits]);
2635
2805
  const seatEditById = _react.useMemo.call(void 0, () => new Map(seatEditUnits.map((u) => [u.id, u])), [seatEditUnits]);
2636
2806
  const elementBoxes = _react.useMemo.call(void 0,
2637
2807
  () => layout.elements.flatMap((el) => {
@@ -2708,7 +2878,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
2708
2878
  [layout, units, index, camera, viewport, palette, placeTypeColors, lockedUnitIds, messages.unassigned]
2709
2879
  );
2710
2880
  _react.useEffect.call(void 0, () => {
2711
- const ctx = _optionalChain([canvasRef, 'access', _94 => _94.current, 'optionalAccess', _95 => _95.getContext, 'call', _96 => _96("2d")]);
2881
+ const ctx = _optionalChain([canvasRef, 'access', _113 => _113.current, 'optionalAccess', _114 => _114.getContext, 'call', _115 => _115("2d")]);
2712
2882
  if (!ctx || viewport.width === 0) return;
2713
2883
  renderScene(scene, { ctx, camera, viewport, dpr, images });
2714
2884
  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
@@ -2782,7 +2952,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
2782
2952
  }, [scene, camera, viewport, dpr, images, bg, ui.backgroundEditing, ui.selection, ui.seatEditId, boxes, radii, palette, seatEditUnits, removed, lifted, hints, marquee]);
2783
2953
  _react.useImperativeHandle.call(void 0, ref, () => ({
2784
2954
  clientToWorld: (clientX, clientY) => {
2785
- const r = _optionalChain([stageRef, 'access', _97 => _97.current, 'optionalAccess', _98 => _98.getBoundingClientRect, 'call', _99 => _99()]);
2955
+ const r = _optionalChain([stageRef, 'access', _116 => _116.current, 'optionalAccess', _117 => _117.getBoundingClientRect, 'call', _118 => _118()]);
2786
2956
  if (!r || clientX < r.left || clientX > r.right || clientY < r.top || clientY > r.bottom) return null;
2787
2957
  const { camera: c, viewport: v } = latest.current;
2788
2958
  return screenToWorld(c, v, { x: clientX - r.left, y: clientY - r.top });
@@ -2860,7 +3030,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
2860
3030
  if (fx.elementId) d.dispatchUi({ type: "toggleSelect", id: fx.elementId });
2861
3031
  } else {
2862
3032
  d.dispatchUi({ type: "select", id: fx.elementId });
2863
- if (fx.elementId) _optionalChain([onPieceTapRef, 'access', _100 => _100.current, 'optionalCall', _101 => _101(fx.elementId)]);
3033
+ if (fx.elementId) _optionalChain([onPieceTapRef, 'access', _119 => _119.current, 'optionalCall', _120 => _120(fx.elementId)]);
2864
3034
  }
2865
3035
  };
2866
3036
  const sheetBox = (l) => ({ minX: 0, minY: 0, maxX: l.meta.width, maxY: l.meta.height });
@@ -2878,7 +3048,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
2878
3048
  }
2879
3049
  current.raw = { x: current.raw.x + dx, y: current.raw.y + dy };
2880
3050
  const snap = altHeld.current ? null : snapMove(shiftBox(current.start, current.raw.x, current.raw.y), current.others, SNAP_PX / zoom, { sheet: sheetBox(d.layout) });
2881
- const target = { x: current.raw.x + (_nullishCoalesce(_optionalChain([snap, 'optionalAccess', _102 => _102.dx]), () => ( 0))), y: current.raw.y + (_nullishCoalesce(_optionalChain([snap, 'optionalAccess', _103 => _103.dy]), () => ( 0))) };
3051
+ const target = { x: current.raw.x + (_nullishCoalesce(_optionalChain([snap, 'optionalAccess', _121 => _121.dx]), () => ( 0))), y: current.raw.y + (_nullishCoalesce(_optionalChain([snap, 'optionalAccess', _122 => _122.dy]), () => ( 0))) };
2882
3052
  if (target.x !== current.applied.x || target.y !== current.applied.y) {
2883
3053
  current.applied = target;
2884
3054
  setPreview({ kind: "move", ids: current.ids, dx: target.x, dy: target.y });
@@ -2900,7 +3070,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
2900
3070
  if (isScaled2(next) && isScaled2(start)) {
2901
3071
  const same = d.layout.elements.filter((el) => el.id !== start.id && el.type === next.type);
2902
3072
  const match = snapScaleTo(_nullishCoalesce(next.scale, () => ( 1)), same.map((el) => _nullishCoalesce(el.scale, () => ( 1))));
2903
- const sized2 = match !== null && match !== (_nullishCoalesce(next.scale, () => ( 1))) ? _chunkZ47OPTEPcjs.scalePiece.call(void 0, start, match) : next;
3073
+ const sized2 = match !== null && match !== (_nullishCoalesce(next.scale, () => ( 1))) ? _chunkYLV7JK57cjs.scalePiece.call(void 0, start, match) : next;
2904
3074
  const now = _nullishCoalesce(sized2.scale, () => ( 1));
2905
3075
  const matches = same.filter((el) => (_nullishCoalesce(el.scale, () => ( 1))) === now).flatMap((el) => _nullishCoalesce(pieceBounds(el), () => ( [])));
2906
3076
  setHints(matches.length > 0 ? { guides: [], gaps: [], matches } : null);
@@ -2926,7 +3096,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
2926
3096
  const nowMarquee = isMarqueeArmed(r.state);
2927
3097
  if (nowMarquee && !marqueeArmed.current) {
2928
3098
  try {
2929
- _optionalChain([navigator, 'access', _104 => _104.vibrate, 'optionalCall', _105 => _105(10)]);
3099
+ _optionalChain([navigator, 'access', _123 => _123.vibrate, 'optionalCall', _124 => _124(10)]);
2930
3100
  } catch (e2) {
2931
3101
  }
2932
3102
  }
@@ -2935,7 +3105,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
2935
3105
  if (nowLifted !== liftedRef.current) {
2936
3106
  if (nowLifted) {
2937
3107
  try {
2938
- _optionalChain([navigator, 'access', _106 => _106.vibrate, 'optionalCall', _107 => _107(10)]);
3108
+ _optionalChain([navigator, 'access', _125 => _125.vibrate, 'optionalCall', _126 => _126(10)]);
2939
3109
  } catch (e3) {
2940
3110
  }
2941
3111
  }
@@ -3007,7 +3177,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
3007
3177
  }
3008
3178
  const d = latest.current.designer;
3009
3179
  const { camera: c, viewport: v } = latest.current;
3010
- const hit = kind === "down" ? _nullishCoalesce(_nullishCoalesce(backgroundAt(d.layout.meta.background, screenToWorld(c, v, p), d.ui.backgroundEditing), () => ( _optionalChain([elementAt, 'call', _108 => _108(d.layout, p, c, v), 'optionalAccess', _109 => _109.id]))), () => ( null)) : null;
3180
+ const hit = kind === "down" ? _nullishCoalesce(_nullishCoalesce(backgroundAt(d.layout.meta.background, screenToWorld(c, v, p), d.ui.backgroundEditing), () => ( _optionalChain([elementAt, 'call', _127 => _127(d.layout, p, c, v, { radii, slopPx: EDIT_HIT_SLOP_PX }), 'optionalAccess', _128 => _128.id]))), () => ( null)) : null;
3011
3181
  const elementLocked = d.ui.armed !== null || hit !== null && hit === d.ui.seatEditId;
3012
3182
  if (kind !== "down") {
3013
3183
  feed({ kind, p, hitElementId: hit, elementLocked });
@@ -3068,7 +3238,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
3068
3238
  const id = pendingFocus.current;
3069
3239
  if (!id) return;
3070
3240
  pendingFocus.current = null;
3071
- _optionalChain([stageRef, 'access', _110 => _110.current, 'optionalAccess', _111 => _111.querySelector, 'call', _112 => _112(`[data-element-id="${id}"]`), 'optionalAccess', _113 => _113.focus, 'call', _114 => _114()]);
3241
+ _optionalChain([stageRef, 'access', _129 => _129.current, 'optionalAccess', _130 => _130.querySelector, 'call', _131 => _131(`[data-element-id="${id}"]`), 'optionalAccess', _132 => _132.focus, 'call', _133 => _133()]);
3072
3242
  });
3073
3243
  const armedName = ui.armed ? armedLabel(ui.armed, messages) : null;
3074
3244
  const selectedEl = ui.selectedId ? layout.elements.find((e) => e.id === ui.selectedId) : void 0;
@@ -3157,7 +3327,7 @@ var DesignerCanvas = _react.forwardRef.call(void 0, function DesignerCanvas2({ d
3157
3327
  return;
3158
3328
  }
3159
3329
  designer.dispatchUi({ type: "select", id: el.id });
3160
- if (plain) _optionalChain([onPieceTap, 'optionalCall', _115 => _115(el.id)]);
3330
+ if (plain) _optionalChain([onPieceTap, 'optionalCall', _134 => _134(el.id)]);
3161
3331
  },
3162
3332
  children: pieceName(el, placeTypes, messages)
3163
3333
  },
@@ -3213,7 +3383,7 @@ function armedLabel(kind, m) {
3213
3383
  if (kind === "roundTable") return m.pieceRoundTable;
3214
3384
  if (kind === "rectTable") return m.pieceRectTable;
3215
3385
  if (kind === "zone") return m.pieceZone;
3216
- return _nullishCoalesce(_optionalChain([_chunkZ47OPTEPcjs.landmarkById.call(void 0, kind.slice("landmark:".length)), 'optionalAccess', _116 => _116.name]), () => ( kind));
3386
+ return _nullishCoalesce(_optionalChain([_chunkYLV7JK57cjs.landmarkById.call(void 0, kind.slice("landmark:".length)), 'optionalAccess', _135 => _135.name]), () => ( kind));
3217
3387
  }
3218
3388
  function drawHints(ctx, hints, camera, viewport, color) {
3219
3389
  const at = (x, y) => worldToScreen(camera, viewport, { x, y });
@@ -3352,7 +3522,7 @@ function anchorPanel(piece, panel, viewport, margin = 12) {
3352
3522
  return docked;
3353
3523
  }
3354
3524
  function range(rule, count) {
3355
- const labels = _chunkZ47OPTEPcjs.labelSequence.call(void 0, rule, count);
3525
+ const labels = _chunkYLV7JK57cjs.labelSequence.call(void 0, rule, count);
3356
3526
  return { from: _nullishCoalesce(labels[0], () => ( "")), to: _nullishCoalesce(labels[labels.length - 1], () => ( "")) };
3357
3527
  }
3358
3528
  function blockRangeText(block, templates) {
@@ -3362,25 +3532,28 @@ function blockRangeText(block, templates) {
3362
3532
  }
3363
3533
  function reshapeBlock(block, patch) {
3364
3534
  const next = { ...block, ...patch };
3365
- if (block.removed.length === 0) return next;
3366
- const oldRows = _chunkZ47OPTEPcjs.expandLabels.call(void 0, block.rowLabels, block.rows);
3367
- const oldSeats = _chunkZ47OPTEPcjs.expandLabels.call(void 0, block.seatLabels, block.cols);
3368
- const newRows = _chunkZ47OPTEPcjs.expandLabels.call(void 0, next.rowLabels, next.rows);
3369
- const newSeats = _chunkZ47OPTEPcjs.expandLabels.call(void 0, next.seatLabels, next.cols);
3370
- const removed = [];
3371
- for (const id of block.removed) {
3372
- const [, row, seat] = _chunkZ47OPTEPcjs.parseUnitId.call(void 0, id);
3373
- const r = row === void 0 ? -1 : oldRows.indexOf(row);
3374
- const c = seat === void 0 ? -1 : oldSeats.indexOf(seat);
3375
- if (r < 0 || c < 0 || r >= next.rows || c >= next.cols) continue;
3376
- removed.push(_chunkZ47OPTEPcjs.seatUnitId.call(void 0, block.id, newRows[r], newSeats[c]));
3377
- }
3378
- return { ...next, removed };
3535
+ if (block.removed.length === 0 && !_optionalChain([block, 'access', _136 => _136.reserved, 'optionalAccess', _137 => _137.length])) return next;
3536
+ const oldRows = _chunkYLV7JK57cjs.expandLabels.call(void 0, block.rowLabels, block.rows);
3537
+ const oldSeats = _chunkYLV7JK57cjs.expandLabels.call(void 0, block.seatLabels, block.cols);
3538
+ const newRows = _chunkYLV7JK57cjs.expandLabels.call(void 0, next.rowLabels, next.rows);
3539
+ const newSeats = _chunkYLV7JK57cjs.expandLabels.call(void 0, next.seatLabels, next.cols);
3540
+ const remap = (ids) => {
3541
+ const out = [];
3542
+ for (const id of ids) {
3543
+ const [, row, seat] = _chunkYLV7JK57cjs.parseUnitId.call(void 0, id);
3544
+ const r = row === void 0 ? -1 : oldRows.indexOf(row);
3545
+ const c = seat === void 0 ? -1 : oldSeats.indexOf(seat);
3546
+ if (r < 0 || c < 0 || r >= next.rows || c >= next.cols) continue;
3547
+ out.push(_chunkYLV7JK57cjs.seatUnitId.call(void 0, block.id, newRows[r], newSeats[c]));
3548
+ }
3549
+ return out;
3550
+ };
3551
+ return { ...next, removed: remap(block.removed), ...block.reserved ? { reserved: remap(block.reserved) } : {} };
3379
3552
  }
3380
3553
  function labelStart(kind, raw, alphabet) {
3381
3554
  const start = kind === "letters" ? raw.trim().toUpperCase() : raw.trim();
3382
3555
  const rule = kind === "letters" && alphabet ? { kind, start, direction: "ltr", alphabet } : { kind, start, direction: "ltr" };
3383
- return _chunkZ47OPTEPcjs.labelRuleSchema.safeParse(rule).success ? start : null;
3556
+ return _chunkYLV7JK57cjs.labelRuleSchema.safeParse(rule).success ? start : null;
3384
3557
  }
3385
3558
  function switchLabelKind(rule, kind) {
3386
3559
  if (rule.kind === kind) return rule;
@@ -3399,7 +3572,7 @@ function setLabelAlphabet(rule, alphabet) {
3399
3572
  if (rule.kind !== "letters") return rule;
3400
3573
  const { alphabet: _old, ...rest } = rule;
3401
3574
  if (alphabet === "es") return { ...rest, alphabet };
3402
- const skip = _optionalChain([rest, 'access', _117 => _117.skip, 'optionalAccess', _118 => _118.filter, 'call', _119 => _119((s) => !/ñ/i.test(s))]);
3575
+ const skip = _optionalChain([rest, 'access', _138 => _138.skip, 'optionalAccess', _139 => _139.filter, 'call', _140 => _140((s) => !/ñ/i.test(s))]);
3403
3576
  const { skip: _skip, ...noSkip } = rest;
3404
3577
  return {
3405
3578
  ...skip && skip.length > 0 ? { ...noSkip, skip } : noSkip,
@@ -3425,10 +3598,10 @@ function withSkip(rule, skip) {
3425
3598
  var plural = (n, one, many) => n === 1 ? one : format(many, { n });
3426
3599
  function placeTypeStatus(option, layout, summary, m) {
3427
3600
  const s = summary.byRef[option.ref];
3428
- const pieces = layout.elements.filter((e) => e.type !== "landmark" && (_optionalChain([e, 'access', _120 => _120.placeType, 'optionalAccess', _121 => _121.ref]) || null) === option.ref).length;
3429
- const units = _nullishCoalesce(_optionalChain([s, 'optionalAccess', _122 => _122.units]), () => ( 0));
3601
+ const pieces = layout.elements.filter((e) => e.type !== "landmark" && (_optionalChain([e, 'access', _141 => _141.placeType, 'optionalAccess', _142 => _142.ref]) || null) === option.ref).length;
3602
+ const units = _nullishCoalesce(_optionalChain([s, 'optionalAccess', _143 => _143.units]), () => ( 0));
3430
3603
  if (option.accepts === "zone") {
3431
- const zones = _nullishCoalesce(_optionalChain([s, 'optionalAccess', _123 => _123.zones]), () => ( 0));
3604
+ const zones = _nullishCoalesce(_optionalChain([s, 'optionalAccess', _144 => _144.zones]), () => ( 0));
3432
3605
  return {
3433
3606
  units,
3434
3607
  pieces,
@@ -3450,15 +3623,21 @@ function joinNames(names, m) {
3450
3623
  return format(m.summaryAnd, { a: names.slice(0, -1).join(", "), b: names[names.length - 1] });
3451
3624
  }
3452
3625
  function missingPlaceTypes(placeTypes, summary) {
3453
- return placeTypes.filter((o) => o.accepts !== "zone" && (_nullishCoalesce(_optionalChain([summary, 'access', _124 => _124.byRef, 'access', _125 => _125[o.ref], 'optionalAccess', _126 => _126.units]), () => ( 0))) === 0);
3626
+ return placeTypes.filter((o) => o.accepts !== "zone" && (_nullishCoalesce(_optionalChain([summary, 'access', _145 => _145.byRef, 'access', _146 => _146[o.ref], 'optionalAccess', _147 => _147.units]), () => ( 0))) === 0);
3454
3627
  }
3455
3628
  function unitsOnSale(placeTypes, summary) {
3456
- return placeTypes.reduce((n, o) => o.accepts === "zone" ? n : n + (_nullishCoalesce(_optionalChain([summary, 'access', _127 => _127.byRef, 'access', _128 => _128[o.ref], 'optionalAccess', _129 => _129.units]), () => ( 0))), 0);
3629
+ return placeTypes.reduce((n, o) => o.accepts === "zone" ? n : n + (_nullishCoalesce(_optionalChain([summary, 'access', _148 => _148.byRef, 'access', _149 => _149[o.ref], 'optionalAccess', _150 => _150.units]), () => ( 0))), 0);
3457
3630
  }
3458
3631
  function numberingCounts(block, m) {
3459
3632
  const removed = block.removed.length;
3460
- const onSale = format(m.resultOnSale, { seats: plural(block.rows * block.cols - removed, m.countSeat, m.countSeats) });
3461
- return removed === 0 ? onSale : `${onSale} \xB7 ${plural(removed, m.removedOne, m.removedMany)}`;
3633
+ const out = new Set(block.removed);
3634
+ const reserved = (_nullishCoalesce(block.reserved, () => ( []))).filter((id) => !out.has(id)).length;
3635
+ const onSale = format(m.resultOnSale, { seats: plural(block.rows * block.cols - removed - reserved, m.countSeat, m.countSeats) });
3636
+ return [
3637
+ onSale,
3638
+ ...reserved > 0 ? [plural(reserved, m.reservedOne, m.reservedMany)] : [],
3639
+ ...removed > 0 ? [plural(removed, m.removedOne, m.removedMany)] : []
3640
+ ].join(" \xB7 ");
3462
3641
  }
3463
3642
 
3464
3643
  // ../react/src/designer/FloatingPanel.tsx
@@ -3485,9 +3664,9 @@ function FloatingPanel(props) {
3485
3664
  ref,
3486
3665
  className: "vk-d-float",
3487
3666
  "aria-labelledby": props.labelledBy,
3488
- "data-docked": _optionalChain([pos, 'optionalAccess', _130 => _130.docked]) || void 0,
3667
+ "data-docked": _optionalChain([pos, 'optionalAccess', _151 => _151.docked]) || void 0,
3489
3668
  "data-testid": "piece-panel",
3490
- style: { width, left: _nullishCoalesce(_optionalChain([pos, 'optionalAccess', _131 => _131.left]), () => ( 0)), top: _nullishCoalesce(_optionalChain([pos, 'optionalAccess', _132 => _132.top]), () => ( 0)), visibility: pos ? "visible" : "hidden" },
3669
+ style: { width, left: _nullishCoalesce(_optionalChain([pos, 'optionalAccess', _152 => _152.left]), () => ( 0)), top: _nullishCoalesce(_optionalChain([pos, 'optionalAccess', _153 => _153.top]), () => ( 0)), visibility: pos ? "visible" : "hidden" },
3491
3670
  children: props.children
3492
3671
  }
3493
3672
  );
@@ -3495,29 +3674,29 @@ function FloatingPanel(props) {
3495
3674
 
3496
3675
  // ../react/src/designer/capacity.ts
3497
3676
  function capacityRejections(before, after, placeTypes) {
3498
- const over = _chunkZ47OPTEPcjs.capacityViolations.call(void 0, before, after, placeTypes);
3677
+ const over = _chunkYLV7JK57cjs.capacityViolations.call(void 0, before, after, placeTypes);
3499
3678
  if (over.length === 0) return [];
3500
- const was = _chunkZ47OPTEPcjs.summarize.call(void 0, before).byRef;
3501
- return over.map((v) => ({ ref: v.ref, label: v.label, capacity: v.capacity, placed: _nullishCoalesce(_optionalChain([was, 'access', _133 => _133[v.ref], 'optionalAccess', _134 => _134.units]), () => ( 0)) }));
3679
+ const was = _chunkYLV7JK57cjs.summarize.call(void 0, before).byRef;
3680
+ return over.map((v) => ({ ref: v.ref, label: v.label, capacity: v.capacity, placed: _nullishCoalesce(_optionalChain([was, 'access', _154 => _154[v.ref], 'optionalAccess', _155 => _155.units]), () => ( 0)) }));
3502
3681
  }
3503
3682
  function placedUnits(option, summary) {
3504
- return _nullishCoalesce(_optionalChain([summary, 'access', _135 => _135.byRef, 'access', _136 => _136[option.ref], 'optionalAccess', _137 => _137.units]), () => ( 0));
3683
+ return _nullishCoalesce(_optionalChain([summary, 'access', _156 => _156.byRef, 'access', _157 => _157[option.ref], 'optionalAccess', _158 => _158.units]), () => ( 0));
3505
3684
  }
3506
3685
  function nextPiece(option, placed) {
3507
3686
  if (option.accepts === "zone") return { units: 1 };
3508
- if (option.accepts === "seats") return { units: _chunkZ47OPTEPcjs.nextBlockUnits.call(void 0, option, placed) };
3509
- const capacity = _chunkZ47OPTEPcjs.placeTypeCapacity.call(void 0, option);
3687
+ if (option.accepts === "seats") return { units: _chunkYLV7JK57cjs.nextBlockUnits.call(void 0, option, placed) };
3688
+ const capacity = _chunkYLV7JK57cjs.placeTypeCapacity.call(void 0, option);
3510
3689
  const left = capacity === null ? Infinity : Math.max(0, capacity - placed);
3511
3690
  if (option.accepts === "tableWhole") return { units: Math.min(1, left) };
3512
- return { units: Math.min(_chunkZ47OPTEPcjs.DEFAULT_TABLE_PLACES, left) };
3691
+ return { units: Math.min(_chunkYLV7JK57cjs.DEFAULT_TABLE_PLACES, left) };
3513
3692
  }
3514
3693
  function capacityText(option, summary, m) {
3515
- const capacity = _chunkZ47OPTEPcjs.placeTypeCapacity.call(void 0, option);
3694
+ const capacity = _chunkYLV7JK57cjs.placeTypeCapacity.call(void 0, option);
3516
3695
  if (capacity === null || option.accepts === "zone") return null;
3517
3696
  return format(m.capacityCount, { placed: placedUnits(option, summary), capacity });
3518
3697
  }
3519
3698
  function capacityFullText(option, summary, m) {
3520
- const capacity = _chunkZ47OPTEPcjs.placeTypeCapacity.call(void 0, option);
3699
+ const capacity = _chunkYLV7JK57cjs.placeTypeCapacity.call(void 0, option);
3521
3700
  if (capacity === null || option.accepts === "zone") return null;
3522
3701
  const placed = placedUnits(option, summary);
3523
3702
  if (placed > capacity) return format(m.capacityOver, { over: placed - capacity, capacity, name: option.label });
@@ -3525,20 +3704,20 @@ function capacityFullText(option, summary, m) {
3525
3704
  return format(m.capacityFull, { capacity, name: option.label });
3526
3705
  }
3527
3706
  function overCapacity(option, summary) {
3528
- const capacity = _chunkZ47OPTEPcjs.placeTypeCapacity.call(void 0, option);
3707
+ const capacity = _chunkYLV7JK57cjs.placeTypeCapacity.call(void 0, option);
3529
3708
  if (capacity === null || option.accepts === "zone") return 0;
3530
3709
  return Math.max(0, placedUnits(option, summary) - capacity);
3531
3710
  }
3532
3711
  function trimPlan(layout, option, locked) {
3533
- let left = overCapacity(option, _chunkZ47OPTEPcjs.summarize.call(void 0, layout));
3712
+ let left = overCapacity(option, _chunkYLV7JK57cjs.summarize.call(void 0, layout));
3534
3713
  if (left === 0) return null;
3535
3714
  const commands = [];
3536
3715
  let removed = 0;
3537
3716
  for (let i = layout.elements.length - 1; i >= 0 && left > 0; i--) {
3538
3717
  const el = layout.elements[i];
3539
- if (el.type === "landmark" || el.type === "zone" || (_optionalChain([el, 'access', _138 => _138.placeType, 'optionalAccess', _139 => _139.ref]) || null) !== option.ref) continue;
3718
+ if (el.type === "landmark" || el.type === "zone" || (_optionalChain([el, 'access', _159 => _159.placeType, 'optionalAccess', _160 => _160.ref]) || null) !== option.ref) continue;
3540
3719
  if (el.type === "seatBlock") {
3541
- const units = _chunkZ47OPTEPcjs.expandSeatBlock.call(void 0, el);
3720
+ const units = _chunkYLV7JK57cjs.expandSeatBlock.call(void 0, el);
3542
3721
  const take = units.filter((u) => !locked.has(u.id)).sort((a, b) => b.rowIndex - a.rowIndex || b.colIndex - a.colIndex).slice(0, left);
3543
3722
  if (take.length === 0) continue;
3544
3723
  commands.push(
@@ -3553,7 +3732,7 @@ function trimPlan(layout, option, locked) {
3553
3732
  left--;
3554
3733
  } else {
3555
3734
  let lastLocked = 0;
3556
- for (let n = 1; n <= el.places; n++) if (locked.has(_chunkZ47OPTEPcjs.placeUnitId.call(void 0, el.id, n))) lastLocked = n;
3735
+ for (let n = 1; n <= el.places; n++) if (locked.has(_chunkYLV7JK57cjs.placeUnitId.call(void 0, el.id, n))) lastLocked = n;
3557
3736
  if (lastLocked === 0 && left >= el.places) {
3558
3737
  commands.push({ type: "removeElement", id: el.id });
3559
3738
  removed += el.places;
@@ -3574,7 +3753,7 @@ function trimPlan(layout, option, locked) {
3574
3753
  function piecesByRef(layout) {
3575
3754
  const out = {};
3576
3755
  for (const el of layout.elements) {
3577
- const ref = el.type === "landmark" ? "" : _optionalChain([el, 'access', _140 => _140.placeType, 'optionalAccess', _141 => _141.ref]) || "";
3756
+ const ref = el.type === "landmark" ? "" : _optionalChain([el, 'access', _161 => _161.placeType, 'optionalAccess', _162 => _162.ref]) || "";
3578
3757
  if (ref) out[ref] = (_nullishCoalesce(out[ref], () => ( 0))) + 1;
3579
3758
  }
3580
3759
  return out;
@@ -3587,8 +3766,8 @@ function hostReads(placeTypes, summary, pieces, m) {
3587
3766
  return o ? nextPiece(o, placedUnits(o, summary)).units : 0;
3588
3767
  },
3589
3768
  placed: (ref) => ({
3590
- units: _nullishCoalesce(_optionalChain([summary, 'access', _142 => _142.byRef, 'access', _143 => _143[ref], 'optionalAccess', _144 => _144.units]), () => ( 0)),
3591
- zones: _nullishCoalesce(_optionalChain([summary, 'access', _145 => _145.byRef, 'access', _146 => _146[ref], 'optionalAccess', _147 => _147.zones]), () => ( 0)),
3769
+ units: _nullishCoalesce(_optionalChain([summary, 'access', _163 => _163.byRef, 'access', _164 => _164[ref], 'optionalAccess', _165 => _165.units]), () => ( 0)),
3770
+ zones: _nullishCoalesce(_optionalChain([summary, 'access', _166 => _166.byRef, 'access', _167 => _167[ref], 'optionalAccess', _168 => _168.zones]), () => ( 0)),
3592
3771
  pieces: _nullishCoalesce(pieces[ref], () => ( 0))
3593
3772
  }),
3594
3773
  capacityText: (ref) => {
@@ -3627,17 +3806,17 @@ function syncPlaceTypes(layout, previous, placeTypes) {
3627
3806
  const before = new Set(previous.map((o) => o.ref));
3628
3807
  let changed = false;
3629
3808
  const elements = layout.elements.map((el) => {
3630
- if (el.type === "landmark" || !_optionalChain([el, 'access', _148 => _148.placeType, 'optionalAccess', _149 => _149.ref])) return el;
3809
+ if (el.type === "landmark" || !_optionalChain([el, 'access', _169 => _169.placeType, 'optionalAccess', _170 => _170.ref])) return el;
3631
3810
  const option = byRef.get(el.placeType.ref);
3632
3811
  if (!option && !before.has(el.placeType.ref)) return el;
3633
- if (!option || !_chunkZ47OPTEPcjs.canAssign.call(void 0, el, option)) {
3812
+ if (!option || !_chunkYLV7JK57cjs.canAssign.call(void 0, el, option)) {
3634
3813
  changed = true;
3635
3814
  return { ...el, placeType: { ref: "", name: el.placeType.name } };
3636
3815
  }
3637
3816
  const mode = option.accepts === "tablePerPlace" ? "perPlace" : "whole";
3638
3817
  if (el.placeType.name === option.label && (el.type !== "table" || el.mode === mode)) return el;
3639
3818
  changed = true;
3640
- return _chunkZ47OPTEPcjs.assignPlaceType.call(void 0, el, option);
3819
+ return _chunkYLV7JK57cjs.assignPlaceType.call(void 0, el, option);
3641
3820
  });
3642
3821
  return changed ? { ...layout, elements } : layout;
3643
3822
  }
@@ -3791,7 +3970,7 @@ function LandmarkPicker({ messages: m, onPick }) {
3791
3970
  const groups = LANDMARK_GROUPS.map(({ group, key }) => ({
3792
3971
  group,
3793
3972
  title: m[key],
3794
- items: _chunkZ47OPTEPcjs.landmarks.filter((l) => l.group === group && (q === "" || fold(l.name).includes(q)))
3973
+ items: _chunkYLV7JK57cjs.landmarks.filter((l) => l.group === group && (q === "" || fold(l.name).includes(q)))
3795
3974
  })).filter((g) => g.items.length > 0);
3796
3975
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-landmarks", children: [
3797
3976
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "vk-d-search", htmlFor: searchId, children: [
@@ -3951,7 +4130,7 @@ var designerEs = {
3951
4130
  blockRangeOneRow: "Fila {row} \xB7 butacas {seatFrom} a {seatTo}",
3952
4131
  numbering: "Numeraci\xF3n y pasillos",
3953
4132
  numberingTitle: "Numeraci\xF3n y pasillos \xB7 {name}",
3954
- numberingHint: "As\xED lo va a ver quien compra. Toc\xE1 una butaca para sacarla (pasillo o columna); los n\xFAmeros de las dem\xE1s no cambian.",
4133
+ numberingHint: "As\xED lo va a ver quien compra. Toc\xE1 una butaca para reservarla, o eleg\xED \xABSacar (pasillo)\xBB para sacarla; los n\xFAmeros de las dem\xE1s no cambian.",
3955
4134
  numberingTooBig: "El bloque es muy grande para mostrarlo ac\xE1. La numeraci\xF3n se puede cambiar igual.",
3956
4135
  numberingFailed: "No se pudo aplicar este cambio.",
3957
4136
  rowsNamed: "Las filas se llaman",
@@ -3987,6 +4166,17 @@ var designerEs = {
3987
4166
  seatName: "Fila {row}, butaca {seat}",
3988
4167
  seatNameRemoved: "Fila {row}, butaca {seat} sacada",
3989
4168
  seatNameSold: "Fila {row}, butaca {seat}, ya vendida",
4169
+ seatNameReserved: "Fila {row}, butaca {seat}, reservada",
4170
+ tapMode: "Al tocar",
4171
+ tapReserve: "Reservar",
4172
+ tapRemove: "Sacar (pasillo)",
4173
+ reservedNotice: "Una butaca reservada se ve en el mapa pero no se vende al p\xFAblico: queda para cortes\xEDas y cupos apartados.",
4174
+ legendReserved: "Reservada",
4175
+ reservedOne: "1 reservada",
4176
+ reservedMany: "{n} reservadas",
4177
+ tableInviteOnly: "Mesa s\xF3lo con invitaci\xF3n",
4178
+ placesInviteOnly: "Lugares s\xF3lo con invitaci\xF3n",
4179
+ placeInviteOnly: "Lugar {n} s\xF3lo con invitaci\xF3n",
3990
4180
  assignTitle: "\xBFDe qu\xE9 entrada es?",
3991
4181
  noPlaceTypes: "No hay entradas que le sirvan a esta pieza.",
3992
4182
  capacityCount: "{placed} de {capacity} lugares",
@@ -4171,7 +4361,7 @@ var designerEn = {
4171
4361
  blockRangeOneRow: "Row {row} \xB7 seats {seatFrom} to {seatTo}",
4172
4362
  numbering: "Numbering and aisles",
4173
4363
  numberingTitle: "Numbering and aisles \xB7 {name}",
4174
- numberingHint: "This is how buyers will see it. Tap a seat to remove it (an aisle or a pillar); the other numbers don't change.",
4364
+ numberingHint: "This is how buyers will see it. Tap a seat to reserve it, or pick \xABRemove (aisle)\xBB to remove it; the other numbers don't change.",
4175
4365
  numberingTooBig: "The block is too big to show here. You can still change the numbering.",
4176
4366
  numberingFailed: "This change couldn't be applied.",
4177
4367
  rowsNamed: "Rows are named",
@@ -4207,6 +4397,17 @@ var designerEn = {
4207
4397
  seatName: "Row {row}, seat {seat}",
4208
4398
  seatNameRemoved: "Row {row}, seat {seat} removed",
4209
4399
  seatNameSold: "Row {row}, seat {seat}, already sold",
4400
+ seatNameReserved: "Row {row}, seat {seat}, reserved",
4401
+ tapMode: "On tap",
4402
+ tapReserve: "Reserve",
4403
+ tapRemove: "Remove (aisle)",
4404
+ reservedNotice: "A reserved seat shows on the map but isn't sold to the public: it's kept for complimentary tickets and held allocations.",
4405
+ legendReserved: "Reserved",
4406
+ reservedOne: "1 reserved",
4407
+ reservedMany: "{n} reserved",
4408
+ tableInviteOnly: "Invitation-only table",
4409
+ placesInviteOnly: "Invitation-only places",
4410
+ placeInviteOnly: "Place {n} invitation only",
4210
4411
  assignTitle: "Which ticket is it for?",
4211
4412
  noPlaceTypes: "No tickets fit this piece.",
4212
4413
  capacityCount: "{placed} of {capacity} spots",
@@ -4320,13 +4521,13 @@ function SizeStepper(props) {
4320
4521
  const { piece, messages: m } = props;
4321
4522
  const scale = _nullishCoalesce(piece.scale, () => ( 1));
4322
4523
  const id = _react.useId.call(void 0, );
4323
- const set = (direction) => props.onRun({ type: "replaceElement", element: _chunkZ47OPTEPcjs.scalePiece.call(void 0, piece, steppedScale(scale, direction)) });
4524
+ const set = (direction) => props.onRun({ type: "replaceElement", element: _chunkYLV7JK57cjs.scalePiece.call(void 0, piece, steppedScale(scale, direction)) });
4324
4525
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-field", role: "group", "aria-labelledby": id, children: [
4325
4526
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { id, children: m.pieceSize }),
4326
4527
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-stepper", children: [
4327
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", "aria-label": m.sizeLess, disabled: scale <= _chunkZ47OPTEPcjs.MIN_SCALE, onClick: () => set(-1), children: "\u2212" }),
4528
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", "aria-label": m.sizeLess, disabled: scale <= _chunkYLV7JK57cjs.MIN_SCALE, onClick: () => set(-1), children: "\u2212" }),
4328
4529
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "output", { className: "vk-d-stepper-value", "aria-live": "polite", children: format(m.pieceSizeValue, { n: Math.round(scale * 100) }) }),
4329
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", "aria-label": m.sizeMore, disabled: scale >= _chunkZ47OPTEPcjs.MAX_SCALE, onClick: () => set(1), children: "+" })
4530
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", "aria-label": m.sizeMore, disabled: scale >= _chunkYLV7JK57cjs.MAX_SCALE, onClick: () => set(1), children: "+" })
4330
4531
  ] })
4331
4532
  ] });
4332
4533
  }
@@ -4371,12 +4572,44 @@ var ZONE_MAX = 4e3;
4371
4572
  var ZONE_STEP = 20;
4372
4573
  function pieceHeading(el, placeTypes, m) {
4373
4574
  if (el.type === "landmark") return { color: null, text: el.name };
4374
- const ref = _optionalChain([el, 'access', _150 => _150.placeType, 'optionalAccess', _151 => _151.ref]) || null;
4575
+ const ref = _optionalChain([el, 'access', _171 => _171.placeType, 'optionalAccess', _172 => _172.ref]) || null;
4375
4576
  const option = ref ? placeTypes.find((p) => p.ref === ref) : void 0;
4376
- const name = _nullishCoalesce(_optionalChain([option, 'optionalAccess', _152 => _152.label]), () => ( m.unassigned));
4377
- if (el.type === "zone") return { color: _nullishCoalesce(_optionalChain([option, 'optionalAccess', _153 => _153.color]), () => ( null)), text: name };
4378
- const count = el.type === "seatBlock" ? plural2(_chunkZ47OPTEPcjs.expandSeatBlock.call(void 0, el).length, m.countSeat, m.countSeats) : el.mode === "whole" ? plural2(1, m.countTable, m.countTables) : plural2(el.places, m.countPlace, m.countPlaces);
4379
- return { color: _nullishCoalesce(_optionalChain([option, 'optionalAccess', _154 => _154.color]), () => ( null)), text: `${name} \xB7 ${count}` };
4577
+ const name = _nullishCoalesce(_optionalChain([option, 'optionalAccess', _173 => _173.label]), () => ( m.unassigned));
4578
+ if (el.type === "zone") return { color: _nullishCoalesce(_optionalChain([option, 'optionalAccess', _174 => _174.color]), () => ( null)), text: name };
4579
+ const count = el.type === "seatBlock" ? plural2(_chunkYLV7JK57cjs.expandSeatBlock.call(void 0, el).length, m.countSeat, m.countSeats) : el.mode === "whole" ? plural2(1, m.countTable, m.countTables) : plural2(el.places, m.countPlace, m.countPlaces);
4580
+ return { color: _nullishCoalesce(_optionalChain([option, 'optionalAccess', _175 => _175.color]), () => ( null)), text: `${name} \xB7 ${count}` };
4581
+ }
4582
+ function TableInviteOnly(props) {
4583
+ const { table: t, messages: m } = props;
4584
+ const reserved = new Set(_nullishCoalesce(t.reservedPlaces, () => ( [])));
4585
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-num-group", "data-testid": "table-invite-only", style: { ["--vk-type"]: _nullishCoalesce(props.color, () => ( "var(--vk-unassigned, #9ca3af)")) }, children: [
4586
+ t.mode === "whole" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "vk-d-check", children: [
4587
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4588
+ "input",
4589
+ {
4590
+ type: "checkbox",
4591
+ checked: t.reserved === true,
4592
+ onChange: () => props.onRun({ type: "replaceElement", element: _chunkYLV7JK57cjs.toggleReservedTable.call(void 0, t) })
4593
+ }
4594
+ ),
4595
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: m.tableInviteOnly })
4596
+ ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { role: "group", "aria-label": m.placesInviteOnly, children: [
4597
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-d-sub", children: m.placesInviteOnly }),
4598
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "vk-d-places", children: Array.from({ length: t.places }, (_, i) => i + 1).map((n) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4599
+ "button",
4600
+ {
4601
+ type: "button",
4602
+ className: "vk-d-place",
4603
+ "aria-pressed": reserved.has(n),
4604
+ "aria-label": format(m.placeInviteOnly, { n }),
4605
+ onClick: () => props.onRun({ type: "replaceElement", element: _chunkYLV7JK57cjs.toggleReservedTable.call(void 0, t, n) }),
4606
+ children: n
4607
+ },
4608
+ n
4609
+ )) })
4610
+ ] }),
4611
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "vk-d-hint", children: m.reservedNotice })
4612
+ ] });
4380
4613
  }
4381
4614
  function PieceInspector(props) {
4382
4615
  const { element: el, messages: m } = props;
@@ -4394,8 +4627,8 @@ function PieceInspector(props) {
4394
4627
  setLabelError(null);
4395
4628
  patch("label", label, `label:${el.id}`);
4396
4629
  };
4397
- const assigned = el.type !== "landmark" && !!_optionalChain([el, 'access', _155 => _155.placeType, 'optionalAccess', _156 => _156.ref]);
4398
- const options = el.type === "landmark" ? [] : props.placeTypes.filter((o) => _chunkZ47OPTEPcjs.canAssign.call(void 0, el, o));
4630
+ const assigned = el.type !== "landmark" && !!_optionalChain([el, 'access', _176 => _176.placeType, 'optionalAccess', _177 => _177.ref]);
4631
+ const options = el.type === "landmark" ? [] : props.placeTypes.filter((o) => _chunkYLV7JK57cjs.canAssign.call(void 0, el, o));
4399
4632
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-inspector", children: [
4400
4633
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-insp-head", children: [
4401
4634
  el.type !== "landmark" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-d-dot", "aria-hidden": "true", style: { ["--vk-type"]: _nullishCoalesce(heading.color, () => ( "var(--vk-unassigned, #9ca3af)")) } }),
@@ -4449,7 +4682,7 @@ function PieceInspector(props) {
4449
4682
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SizeStepper, { piece: el, messages: m, onRun: props.onRun })
4450
4683
  ] }),
4451
4684
  el.type === "table" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4452
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TextField, { label: m.tableNumber, maxLength: _chunkZ47OPTEPcjs.MAX_TABLE_LABEL_LENGTH, value: el.label, onCommit: tableLabelCommit }),
4685
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TextField, { label: m.tableNumber, maxLength: _chunkYLV7JK57cjs.MAX_TABLE_LABEL_LENGTH, value: el.label, onCommit: tableLabelCommit }),
4453
4686
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4454
4687
  Stepper,
4455
4688
  {
@@ -4514,12 +4747,13 @@ function PieceInspector(props) {
4514
4747
  ] }),
4515
4748
  el.type === "landmark" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TextField, { label: m.landmarkName, wide: true, maxLength: 60, value: el.name, onCommit: (v) => v.trim() && patch("name", v.trim(), `name:${el.id}`) })
4516
4749
  ] }, el.id),
4517
- _optionalChain([labelError, 'optionalAccess', _157 => _157.id]) === el.id && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "vk-d-error", role: "alert", children: labelError.text }),
4750
+ _optionalChain([labelError, 'optionalAccess', _178 => _178.id]) === el.id && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "vk-d-error", role: "alert", children: labelError.text }),
4518
4751
  el.type === "seatBlock" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-insp-foot", children: [
4519
4752
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "block-range", children: blockRangeText(el, { many: m.blockRange, one: m.blockRangeOneRow }) }),
4520
4753
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "vk-d-link", "aria-haspopup": "dialog", onClick: props.onNumbering, children: m.numbering })
4521
4754
  ] }),
4522
- el.type === "table" && assigned && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "vk-d-hint", children: el.mode === "whole" ? m.sellWhole : m.sellPerPlace })
4755
+ el.type === "table" && assigned && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "vk-d-hint", children: el.mode === "whole" ? m.sellWhole : m.sellPerPlace }),
4756
+ el.type === "table" && assigned && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableInviteOnly, { table: el, color: heading.color, messages: m, onRun: props.onRun })
4523
4757
  ] });
4524
4758
  }
4525
4759
 
@@ -4581,12 +4815,14 @@ function NumberingDialog(props) {
4581
4815
  const m = props.messages;
4582
4816
  const [draft, setDraft] = _react.useState.call(void 0, props.block);
4583
4817
  const [failed, setFailed] = _react.useState.call(void 0, false);
4584
- const rowLabels = _chunkZ47OPTEPcjs.expandLabels.call(void 0, draft.rowLabels, draft.rows);
4585
- const seatLabels = _chunkZ47OPTEPcjs.expandLabels.call(void 0, draft.seatLabels, draft.cols);
4818
+ const rowLabels = _chunkYLV7JK57cjs.expandLabels.call(void 0, draft.rowLabels, draft.rows);
4819
+ const seatLabels = _chunkYLV7JK57cjs.expandLabels.call(void 0, draft.seatLabels, draft.cols);
4586
4820
  const removed = new Set(draft.removed);
4587
- const origRows = _chunkZ47OPTEPcjs.expandLabels.call(void 0, props.block.rowLabels, props.block.rows);
4588
- const origSeats = _chunkZ47OPTEPcjs.expandLabels.call(void 0, props.block.seatLabels, props.block.cols);
4589
- const soldAt = (r, c) => r < origRows.length && c < origSeats.length && props.lockedUnitIds.has(_chunkZ47OPTEPcjs.seatUnitId.call(void 0, props.block.id, origRows[r], origSeats[c]));
4821
+ const reserved = new Set(_nullishCoalesce(draft.reserved, () => ( [])));
4822
+ const [tapMode, setTapMode] = _react.useState.call(void 0, "reserve");
4823
+ const origRows = _chunkYLV7JK57cjs.expandLabels.call(void 0, props.block.rowLabels, props.block.rows);
4824
+ const origSeats = _chunkYLV7JK57cjs.expandLabels.call(void 0, props.block.seatLabels, props.block.cols);
4825
+ const soldAt = (r, c) => r < origRows.length && c < origSeats.length && props.lockedUnitIds.has(_chunkYLV7JK57cjs.seatUnitId.call(void 0, props.block.id, origRows[r], origSeats[c]));
4590
4826
  const tooBig = draft.rows * draft.cols > MAX_PREVIEW_SEATS;
4591
4827
  const pattern = draft.seatLabels.kind === "numbers" ? _nullishCoalesce(draft.seatLabels.pattern, () => ( "sequential")) : "sequential";
4592
4828
  const patternId = _react.useId.call(void 0, );
@@ -4608,22 +4844,24 @@ function NumberingDialog(props) {
4608
4844
  tooBig ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "vk-d-hint", children: m.numberingTooBig }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "vk-d-num-grid", role: "group", "aria-label": m.numbering, children: rowLabels.map((row, r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-num-row", children: [
4609
4845
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-d-num-label", "aria-hidden": "true", children: row }),
4610
4846
  seatLabels.map((seat, c) => {
4611
- const id = _chunkZ47OPTEPcjs.seatUnitId.call(void 0, draft.id, row, seat);
4847
+ const id = _chunkYLV7JK57cjs.seatUnitId.call(void 0, draft.id, row, seat);
4612
4848
  const sold = soldAt(r, c) && !removed.has(id);
4613
4849
  const out = removed.has(id);
4850
+ const held = !out && reserved.has(id);
4614
4851
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4615
4852
  "button",
4616
4853
  {
4617
4854
  type: "button",
4618
4855
  className: "vk-d-num-seat",
4619
4856
  "data-removed": out || void 0,
4857
+ "data-reserved": held || void 0,
4620
4858
  "data-sold": sold || void 0,
4621
4859
  disabled: sold,
4622
- "aria-pressed": out,
4623
- "aria-label": format(sold ? m.seatNameSold : out ? m.seatNameRemoved : m.seatName, { row, seat }),
4860
+ "aria-pressed": tapMode === "reserve" ? held : out,
4861
+ "aria-label": format(sold ? m.seatNameSold : out ? m.seatNameRemoved : held ? m.seatNameReserved : m.seatName, { row, seat }),
4624
4862
  onClick: () => {
4625
4863
  setFailed(false);
4626
- setDraft((d) => _chunkZ47OPTEPcjs.toggleRemovedSeat.call(void 0, d, id));
4864
+ setDraft((d) => tapMode === "remove" || out ? _chunkYLV7JK57cjs.toggleRemovedSeat.call(void 0, d, id) : _chunkYLV7JK57cjs.toggleReservedSeat.call(void 0, d, id));
4627
4865
  },
4628
4866
  children: seat
4629
4867
  },
@@ -4636,6 +4874,10 @@ function NumberingDialog(props) {
4636
4874
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-d-legend-dot", "aria-hidden": "true" }),
4637
4875
  m.legendOnSale
4638
4876
  ] }),
4877
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
4878
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-d-legend-dot vk-d-legend-reserved", "aria-hidden": "true" }),
4879
+ m.legendReserved
4880
+ ] }),
4639
4881
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
4640
4882
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "vk-d-legend-dot vk-d-legend-out", "aria-hidden": "true" }),
4641
4883
  m.legendRemoved
@@ -4644,6 +4886,18 @@ function NumberingDialog(props) {
4644
4886
  ] })
4645
4887
  ] }),
4646
4888
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-num-side", children: [
4889
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-num-group", "data-testid": "tap-mode", children: [
4890
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4891
+ Segmented,
4892
+ {
4893
+ label: m.tapMode,
4894
+ value: tapMode,
4895
+ options: [{ value: "reserve", label: m.tapReserve }, { value: "remove", label: m.tapRemove }],
4896
+ onChange: setTapMode
4897
+ }
4898
+ ),
4899
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "vk-d-hint", "data-testid": "reserved-notice", children: m.reservedNotice })
4900
+ ] }),
4647
4901
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "vk-d-num-group", children: [
4648
4902
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4649
4903
  Segmented,
@@ -4762,7 +5016,7 @@ function listOf(items, m) {
4762
5016
  function duplicateWarnings(placeTypes, summary, m) {
4763
5017
  const out = [];
4764
5018
  for (const o of placeTypes) {
4765
- const d = _optionalChain([summary, 'access', _158 => _158.byRef, 'access', _159 => _159[o.ref], 'optionalAccess', _160 => _160.duplicates]);
5019
+ const d = _optionalChain([summary, 'access', _179 => _179.byRef, 'access', _180 => _180[o.ref], 'optionalAccess', _181 => _181.duplicates]);
4766
5020
  if (!d) continue;
4767
5021
  if (d.seats.length > 0) {
4768
5022
  const items = d.seats.map((s) => {
@@ -4814,10 +5068,10 @@ function PlaceTypePanel(props) {
4814
5068
  const capped = capacityText(o, summary, m);
4815
5069
  const fullText = capacityFullText(o, summary, m);
4816
5070
  const done = fullText !== null;
4817
- const cap = _chunkZ47OPTEPcjs.placeTypeCapacity.call(void 0, o);
5071
+ const cap = _chunkYLV7JK57cjs.placeTypeCapacity.call(void 0, o);
4818
5072
  const over = cap !== null && placedUnits(o, summary) > cap;
4819
5073
  const excess = over ? overCapacity(o, summary) : 0;
4820
- const trimmable = excess > 0 && props.onTrim ? _nullishCoalesce(_optionalChain([trimPlan, 'call', _161 => _161(props.layout, o, _nullishCoalesce(props.lockedUnitIds, () => ( NOTHING))), 'optionalAccess', _162 => _162.removed]), () => ( 0)) : 0;
5074
+ const trimmable = excess > 0 && props.onTrim ? _nullishCoalesce(_optionalChain([trimPlan, 'call', _182 => _182(props.layout, o, _nullishCoalesce(props.lockedUnitIds, () => ( NOTHING))), 'optionalAccess', _183 => _183.removed]), () => ( 0)) : 0;
4821
5075
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
4822
5076
  "li",
4823
5077
  {
@@ -4847,7 +5101,7 @@ function PlaceTypePanel(props) {
4847
5101
  className: "vk-d-btn vk-d-trim",
4848
5102
  "data-testid": "capacity-trim",
4849
5103
  "aria-label": format(m.trimToCapacityLabel, { over: trimmable, name: o.label }),
4850
- onClick: () => _optionalChain([props, 'access', _163 => _163.onTrim, 'optionalCall', _164 => _164(o)]),
5104
+ onClick: () => _optionalChain([props, 'access', _184 => _184.onTrim, 'optionalCall', _185 => _185(o)]),
4851
5105
  children: m.trimToCapacity
4852
5106
  }
4853
5107
  ),
@@ -4905,18 +5159,18 @@ function Popover({ title, onClose, anchorRef, children, className }) {
4905
5159
  const close = _react.useRef.call(void 0, onClose);
4906
5160
  close.current = onClose;
4907
5161
  _react.useEffect.call(void 0, () => {
4908
- const first = _optionalChain([ref, 'access', _165 => _165.current, 'optionalAccess', _166 => _166.querySelector, 'call', _167 => _167("input, button, select, [href]")]);
4909
- _optionalChain([(_nullishCoalesce(first, () => ( ref.current))), 'optionalAccess', _168 => _168.focus, 'call', _169 => _169()]);
5162
+ const first = _optionalChain([ref, 'access', _186 => _186.current, 'optionalAccess', _187 => _187.querySelector, 'call', _188 => _188("input, button, select, [href]")]);
5163
+ _optionalChain([(_nullishCoalesce(first, () => ( ref.current))), 'optionalAccess', _189 => _189.focus, 'call', _190 => _190()]);
4910
5164
  const onDown = (e) => {
4911
5165
  const t = e.target;
4912
- if (_optionalChain([ref, 'access', _170 => _170.current, 'optionalAccess', _171 => _171.contains, 'call', _172 => _172(t)]) || _optionalChain([anchorRef, 'access', _173 => _173.current, 'optionalAccess', _174 => _174.contains, 'call', _175 => _175(t)])) return;
5166
+ if (_optionalChain([ref, 'access', _191 => _191.current, 'optionalAccess', _192 => _192.contains, 'call', _193 => _193(t)]) || _optionalChain([anchorRef, 'access', _194 => _194.current, 'optionalAccess', _195 => _195.contains, 'call', _196 => _196(t)])) return;
4913
5167
  close.current();
4914
5168
  };
4915
5169
  document.addEventListener("pointerdown", onDown);
4916
5170
  const anchor = anchorRef.current;
4917
5171
  return () => {
4918
5172
  document.removeEventListener("pointerdown", onDown);
4919
- if (_optionalChain([anchor, 'optionalAccess', _176 => _176.isConnected]) && (!document.activeElement || document.activeElement === document.body)) anchor.focus();
5173
+ if (_optionalChain([anchor, 'optionalAccess', _197 => _197.isConnected]) && (!document.activeElement || document.activeElement === document.body)) anchor.focus();
4920
5174
  };
4921
5175
  }, [anchorRef]);
4922
5176
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -4930,7 +5184,7 @@ function Popover({ title, onClose, anchorRef, children, className }) {
4930
5184
  onKeyDown: (e) => {
4931
5185
  if (e.key === "Escape") {
4932
5186
  e.stopPropagation();
4933
- _optionalChain([anchorRef, 'access', _177 => _177.current, 'optionalAccess', _178 => _178.focus, 'call', _179 => _179()]);
5187
+ _optionalChain([anchorRef, 'access', _198 => _198.current, 'optionalAccess', _199 => _199.focus, 'call', _200 => _200()]);
4934
5188
  close.current();
4935
5189
  }
4936
5190
  },
@@ -5011,9 +5265,9 @@ function Sheet({
5011
5265
  if (!shown) return;
5012
5266
  const active = document.activeElement instanceof HTMLElement && document.activeElement !== document.body ? document.activeElement : null;
5013
5267
  const opener = _nullishCoalesce(returnTo.current, () => ( active));
5014
- _optionalChain([panelRef, 'access', _180 => _180.current, 'optionalAccess', _181 => _181.focus, 'call', _182 => _182()]);
5268
+ _optionalChain([panelRef, 'access', _201 => _201.current, 'optionalAccess', _202 => _202.focus, 'call', _203 => _203()]);
5015
5269
  return () => {
5016
- if (_optionalChain([opener, 'optionalAccess', _183 => _183.isConnected])) opener.focus();
5270
+ if (_optionalChain([opener, 'optionalAccess', _204 => _204.isConnected])) opener.focus();
5017
5271
  };
5018
5272
  }, [shown]);
5019
5273
  const onKeyDown = (e) => {
@@ -5262,10 +5516,15 @@ var DESIGNER_CSS = `
5262
5516
  .vk-d-num-seat{flex:none;width:34px;height:34px;border-radius:999px;border:0;padding:0;background:var(--vk-type);
5263
5517
  color:#fff;font:inherit;font-size:12px;font-weight:600;cursor:pointer}
5264
5518
  .vk-d-num-seat[data-removed]{background:transparent;border:2px dashed var(--vk-unassigned,#5a5a66);color:var(--vk-muted)}
5519
+ .vk-d-num-seat[data-reserved]{background:repeating-linear-gradient(45deg,var(--vk-type) 0 4px,var(--vk-surface,#fff) 4px 7px);border:2px solid var(--vk-fg);color:var(--vk-fg)}
5265
5520
  .vk-d-num-seat[data-sold]{cursor:not-allowed;opacity:.55}
5266
- .vk-d-legend{display:flex;gap:18px;font-size:13px;color:var(--vk-muted)}
5521
+ .vk-d-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;font-size:13px;color:var(--vk-muted)}
5267
5522
  .vk-d-legend > span{display:flex;align-items:center;gap:6px}
5268
5523
  .vk-d-legend-dot{width:12px;height:12px;border-radius:999px;background:var(--vk-type)}
5524
+ .vk-d-places{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
5525
+ .vk-d-place{min-width:44px;min-height:44px;border-radius:999px;border:1px solid var(--vk-line);background:var(--vk-seg,transparent);color:var(--vk-fg);font:inherit;font-weight:600;cursor:pointer}
5526
+ .vk-d-place[aria-pressed="true"]{background:repeating-linear-gradient(45deg,var(--vk-type,#9ca3af) 0 4px,var(--vk-surface,#fff) 4px 7px);border:2px solid var(--vk-fg)}
5527
+ .vk-d-legend-reserved{background:repeating-linear-gradient(45deg,var(--vk-type) 0 3px,var(--vk-surface,#fff) 3px 5px);border:2px solid var(--vk-fg)}
5269
5528
  .vk-d-legend-out{background:transparent;border:2px dashed var(--vk-unassigned,#5a5a66)}
5270
5529
  .vk-d-num-side{width:340px;flex:none;border-left:1px solid var(--vk-line);padding:24px;display:flex;flex-direction:column;gap:20px;overflow:auto;background:var(--vk-surface)}
5271
5530
  .vk-d-num-group{display:flex;flex-direction:column;gap:8px}
@@ -5394,12 +5653,12 @@ function TopBar(props) {
5394
5653
  function guardedStep(history, step, locked) {
5395
5654
  const candidate = step === "undo" ? history.peekUndo() : history.peekRedo();
5396
5655
  if (!candidate) return null;
5397
- const violations = _chunkZ47OPTEPcjs.findLockViolations.call(void 0, history.present, candidate, locked);
5656
+ const violations = _chunkYLV7JK57cjs.findLockViolations.call(void 0, history.present, candidate, locked);
5398
5657
  if (violations.length > 0) return { ok: false, rejection: { violations } };
5399
5658
  return { ok: true, layout: step === "undo" ? history.undo() : history.redo() };
5400
5659
  }
5401
5660
  function guardedLoad(history, next, locked, placeTypes = []) {
5402
- const violations = _chunkZ47OPTEPcjs.findLockViolations.call(void 0, history.present, next, locked);
5661
+ const violations = _chunkYLV7JK57cjs.findLockViolations.call(void 0, history.present, next, locked);
5403
5662
  if (violations.length > 0) return { ok: false, rejection: { violations } };
5404
5663
  const capacity = capacityRejections(history.present, next, placeTypes);
5405
5664
  if (capacity.length > 0) return { ok: false, rejection: { violations: [], capacity } };
@@ -5422,7 +5681,7 @@ function elementPrefix(el) {
5422
5681
  return el.type === "seatBlock" ? "b" : el.type === "table" ? "m" : el.type === "zone" ? "z" : "r";
5423
5682
  }
5424
5683
  function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5425
- const [history] = _react.useState.call(void 0, () => new (0, _chunkZ47OPTEPcjs.History)(initial));
5684
+ const [history] = _react.useState.call(void 0, () => new (0, _chunkYLV7JK57cjs.History)(initial));
5426
5685
  const historyRef = _react.useRef.call(void 0, history);
5427
5686
  const [layout, setLayout] = _react.useState.call(void 0, initial);
5428
5687
  const [rejection, setRejectionState] = _react.useState.call(void 0, null);
@@ -5439,7 +5698,7 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5439
5698
  (next) => {
5440
5699
  setLayout(next);
5441
5700
  setRejection(null);
5442
- _optionalChain([onChange, 'optionalCall', _184 => _184(next)]);
5701
+ _optionalChain([onChange, 'optionalCall', _205 => _205(next)]);
5443
5702
  },
5444
5703
  [onChange, setRejection]
5445
5704
  );
@@ -5460,13 +5719,13 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5460
5719
  const before = historyRef.current.present;
5461
5720
  let candidate;
5462
5721
  try {
5463
- candidate = _chunkZ47OPTEPcjs.applyCommand.call(void 0, before, command);
5722
+ candidate = _chunkYLV7JK57cjs.applyCommand.call(void 0, before, command);
5464
5723
  } catch (error) {
5465
5724
  setRejection({ violations: [], invalid: error instanceof Error ? error.message : String(error) });
5466
5725
  return false;
5467
5726
  }
5468
5727
  const moveOnly = keepsCount(command);
5469
- const violations = moveOnly ? [] : _chunkZ47OPTEPcjs.findLockViolations.call(void 0, before, candidate, locked);
5728
+ const violations = moveOnly ? [] : _chunkYLV7JK57cjs.findLockViolations.call(void 0, before, candidate, locked);
5470
5729
  if (violations.length > 0) {
5471
5730
  setRejection({ violations });
5472
5731
  return false;
@@ -5485,8 +5744,8 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5485
5744
  const place = _react.useCallback.call(void 0,
5486
5745
  (kind, at) => {
5487
5746
  const current = historyRef.current.present;
5488
- const id = _chunkZ47OPTEPcjs.newElementId.call(void 0, current, idPrefix(kind));
5489
- if (!run({ type: "addElement", element: _chunkZ47OPTEPcjs.createPiece.call(void 0, kind, id, at, current) })) return null;
5747
+ const id = _chunkYLV7JK57cjs.newElementId.call(void 0, current, idPrefix(kind));
5748
+ if (!run({ type: "addElement", element: _chunkYLV7JK57cjs.createPiece.call(void 0, kind, id, at, current) })) return null;
5490
5749
  dispatchUi({ type: "select", id });
5491
5750
  return id;
5492
5751
  },
@@ -5495,10 +5754,10 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5495
5754
  const addFor = _react.useCallback.call(void 0,
5496
5755
  (kind, option, near, opts = {}) => {
5497
5756
  const current = historyRef.current.present;
5498
- const id = _chunkZ47OPTEPcjs.newElementId.call(void 0, current, idPrefix(kind));
5499
- let piece = _chunkZ47OPTEPcjs.createPiece.call(void 0, kind, id, near, current, opts.seats === void 0 ? {} : { seats: opts.seats });
5757
+ const id = _chunkYLV7JK57cjs.newElementId.call(void 0, current, idPrefix(kind));
5758
+ let piece = _chunkYLV7JK57cjs.createPiece.call(void 0, kind, id, near, current, opts.seats === void 0 ? {} : { seats: opts.seats });
5500
5759
  if (piece.type === "table" && opts.places !== void 0) piece = { ...piece, places: opts.places };
5501
- if (option && piece.type !== "landmark" && _chunkZ47OPTEPcjs.canAssign.call(void 0, piece, option)) piece = _chunkZ47OPTEPcjs.assignPlaceType.call(void 0, piece, option);
5760
+ if (option && piece.type !== "landmark" && _chunkYLV7JK57cjs.canAssign.call(void 0, piece, option)) piece = _chunkYLV7JK57cjs.assignPlaceType.call(void 0, piece, option);
5502
5761
  const own = elementBounds({ ...current, elements: [...current.elements, piece] }, piece);
5503
5762
  if (own) {
5504
5763
  const occupied = current.elements.flatMap((e) => _nullishCoalesce(elementBounds(current, e), () => ( [])));
@@ -5516,8 +5775,8 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5516
5775
  const el = find(id);
5517
5776
  if (!el) return;
5518
5777
  const current = historyRef.current.present;
5519
- const newId = _chunkZ47OPTEPcjs.newElementId.call(void 0, current, elementPrefix(el));
5520
- if (run({ type: "addElement", element: _chunkZ47OPTEPcjs.duplicatePiece.call(void 0, el, newId, current) })) {
5778
+ const newId = _chunkYLV7JK57cjs.newElementId.call(void 0, current, elementPrefix(el));
5779
+ if (run({ type: "addElement", element: _chunkYLV7JK57cjs.duplicatePiece.call(void 0, el, newId, current) })) {
5521
5780
  dispatchUi({ type: "select", id: newId });
5522
5781
  }
5523
5782
  },
@@ -5526,7 +5785,7 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5526
5785
  const rotate = _react.useCallback.call(void 0,
5527
5786
  (id) => {
5528
5787
  const el = find(id);
5529
- if (el) run({ type: "replaceElement", element: _chunkZ47OPTEPcjs.rotatePiece.call(void 0, el) });
5788
+ if (el) run({ type: "replaceElement", element: _chunkYLV7JK57cjs.rotatePiece.call(void 0, el) });
5530
5789
  },
5531
5790
  [run]
5532
5791
  );
@@ -5561,7 +5820,7 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5561
5820
  for (const id of ids) {
5562
5821
  const el = current.elements.find((e) => e.id === id);
5563
5822
  if (!el) continue;
5564
- const copy = _chunkZ47OPTEPcjs.duplicatePiece.call(void 0, el, _chunkZ47OPTEPcjs.newElementId.call(void 0, current, elementPrefix(el)), current);
5823
+ const copy = _chunkYLV7JK57cjs.duplicatePiece.call(void 0, el, _chunkYLV7JK57cjs.newElementId.call(void 0, current, elementPrefix(el)), current);
5565
5824
  current = { ...current, elements: [...current.elements, copy] };
5566
5825
  commands.push({ type: "addElement", element: copy });
5567
5826
  created.push(copy.id);
@@ -5587,7 +5846,7 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5587
5846
  const toggleSeat = _react.useCallback.call(void 0,
5588
5847
  (blockId, unitId) => {
5589
5848
  const el = find(blockId);
5590
- if (_optionalChain([el, 'optionalAccess', _185 => _185.type]) === "seatBlock") run({ type: "replaceElement", element: _chunkZ47OPTEPcjs.toggleRemovedSeat.call(void 0, el, unitId) });
5849
+ if (_optionalChain([el, 'optionalAccess', _206 => _206.type]) === "seatBlock") run({ type: "replaceElement", element: _chunkYLV7JK57cjs.toggleRemovedSeat.call(void 0, el, unitId) });
5591
5850
  },
5592
5851
  [run]
5593
5852
  );
@@ -5595,8 +5854,8 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5595
5854
  (id, option) => {
5596
5855
  const el = find(id);
5597
5856
  if (!el || el.type === "landmark") return;
5598
- if (option && !_chunkZ47OPTEPcjs.canAssign.call(void 0, el, option)) return;
5599
- run({ type: "replaceElement", element: _chunkZ47OPTEPcjs.assignPlaceType.call(void 0, el, option) });
5857
+ if (option && !_chunkYLV7JK57cjs.canAssign.call(void 0, el, option)) return;
5858
+ run({ type: "replaceElement", element: _chunkYLV7JK57cjs.assignPlaceType.call(void 0, el, option) });
5600
5859
  },
5601
5860
  [run]
5602
5861
  );
@@ -5662,7 +5921,7 @@ function useDesigner({ initial, lockedUnitIds, onChange, placeTypes }) {
5662
5921
  var NOTHING_LOCKED = /* @__PURE__ */ new Set();
5663
5922
  function blankLayout(name) {
5664
5923
  return {
5665
- meta: { id: "plan", name, version: _chunkZ47OPTEPcjs.CURRENT_VERSION, width: 1200, height: 800, background: null },
5924
+ meta: { id: "plan", name, version: _chunkYLV7JK57cjs.CURRENT_VERSION, width: 1200, height: 800, background: null },
5666
5925
  elements: []
5667
5926
  };
5668
5927
  }
@@ -5686,13 +5945,13 @@ function VenueDesigner(props) {
5686
5945
  const loadingExternal = _react.useRef.call(void 0, false);
5687
5946
  const onChange = _react.useCallback.call(void 0, (layout2) => {
5688
5947
  lastEmitted.current = layout2;
5689
- if (!loadingExternal.current) _optionalChain([onChangeRef, 'access', _186 => _186.current, 'optionalCall', _187 => _187(layout2)]);
5948
+ if (!loadingExternal.current) _optionalChain([onChangeRef, 'access', _207 => _207.current, 'optionalCall', _208 => _208(layout2)]);
5690
5949
  }, []);
5691
5950
  const designer = useDesigner({ initial, lockedUnitIds: locked, onChange, placeTypes: props.placeTypes });
5692
5951
  const { layout, ui, dispatchUi } = designer;
5693
5952
  const messages = _react.useMemo.call(void 0, () => mergeDesignerMessages(props.messages), [props.messages]);
5694
5953
  const m = messages;
5695
- const summary = _react.useMemo.call(void 0, () => _chunkZ47OPTEPcjs.summarize.call(void 0, layout), [layout]);
5954
+ const summary = _react.useMemo.call(void 0, () => _chunkYLV7JK57cjs.summarize.call(void 0, layout), [layout]);
5696
5955
  const selected = ui.selectedId ? _nullishCoalesce(layout.elements.find((e) => e.id === ui.selectedId), () => ( null)) : null;
5697
5956
  const canvasRef = _react.useRef.call(void 0, null);
5698
5957
  const otherTableLabels = _react.useMemo.call(void 0,
@@ -5761,7 +6020,7 @@ function VenueDesigner(props) {
5761
6020
  if (compact && popover !== null) setPopover(null);
5762
6021
  }, [sheet, selected, compact, popover]);
5763
6022
  const bg = layout.meta.background;
5764
- const current = useImage(_nullishCoalesce(_optionalChain([bg, 'optionalAccess', _188 => _188.src]), () => ( null)));
6023
+ const current = useImage(_nullishCoalesce(_optionalChain([bg, 'optionalAccess', _209 => _209.src]), () => ( null)));
5765
6024
  const [incomingSrc, setIncomingSrc] = _react.useState.call(void 0, null);
5766
6025
  const incoming = useImage(incomingSrc);
5767
6026
  const { run } = designer;
@@ -5783,7 +6042,7 @@ function VenueDesigner(props) {
5783
6042
  };
5784
6043
  const adoptBackground = (src) => {
5785
6044
  if (!src) return;
5786
- if (src === _optionalChain([bg, 'optionalAccess', _189 => _189.src]) && incomingSrc === null) return;
6045
+ if (src === _optionalChain([bg, 'optionalAccess', _210 => _210.src]) && incomingSrc === null) return;
5787
6046
  setIncomingSrc(src);
5788
6047
  };
5789
6048
  const bgProp = props.background;
@@ -5799,7 +6058,7 @@ function VenueDesigner(props) {
5799
6058
  }
5800
6059
  adoptBackground(src);
5801
6060
  } : null;
5802
- const suggestedSrc = _optionalChain([bgProp, 'optionalAccess', _190 => _190.suggestedSrc]) || null;
6061
+ const suggestedSrc = _optionalChain([bgProp, 'optionalAccess', _211 => _211.suggestedSrc]) || null;
5803
6062
  const bgStatus = incomingSrc ? incoming.failed ? "failed" : "loading" : current.failed ? "failed" : "idle";
5804
6063
  const showBackground = bgProp !== void 0 || bg !== null;
5805
6064
  const latest = _react.useRef.call(void 0, { summary, placeTypes: props.placeTypes, compact, meta: layout.meta });
@@ -5810,9 +6069,9 @@ function VenueDesigner(props) {
5810
6069
  const { summary: summary2, placeTypes, compact: compact2, meta } = latest.current;
5811
6070
  const request = pieceRequest(kind, ref, placeTypes, summary2);
5812
6071
  if (!request) return null;
5813
- const centre = _nullishCoalesce(_optionalChain([canvasRef, 'access', _191 => _191.current, 'optionalAccess', _192 => _192.centre, 'call', _193 => _193()]), () => ( { x: meta.width / 2, y: meta.height / 2 }));
6072
+ const centre = _nullishCoalesce(_optionalChain([canvasRef, 'access', _212 => _212.current, 'optionalAccess', _213 => _213.centre, 'call', _214 => _214()]), () => ( { x: meta.width / 2, y: meta.height / 2 }));
5814
6073
  const id = designerAddFor(kind, request.option, centre, request.opts);
5815
- if (id) _optionalChain([canvasRef, 'access', _194 => _194.current, 'optionalAccess', _195 => _195.reveal, 'call', _196 => _196(id)]);
6074
+ if (id) _optionalChain([canvasRef, 'access', _215 => _215.current, 'optionalAccess', _216 => _216.reveal, 'call', _217 => _217(id)]);
5816
6075
  if (id && compact2) setSheet("piece");
5817
6076
  return id;
5818
6077
  },
@@ -5822,12 +6081,12 @@ function VenueDesigner(props) {
5822
6081
  (id) => {
5823
6082
  dispatchUi({ type: "select", id });
5824
6083
  if (!id) return;
5825
- _optionalChain([canvasRef, 'access', _197 => _197.current, 'optionalAccess', _198 => _198.reveal, 'call', _199 => _199(id)]);
6084
+ _optionalChain([canvasRef, 'access', _218 => _218.current, 'optionalAccess', _219 => _219.reveal, 'call', _220 => _220(id)]);
5826
6085
  if (latest.current.compact) setSheet("piece");
5827
6086
  },
5828
6087
  [dispatchUi]
5829
6088
  );
5830
- const revealPiece = _react.useCallback.call(void 0, (id) => _optionalChain([canvasRef, 'access', _200 => _200.current, 'optionalAccess', _201 => _201.reveal, 'call', _202 => _202(id)]), []);
6089
+ const revealPiece = _react.useCallback.call(void 0, (id) => _optionalChain([canvasRef, 'access', _221 => _221.current, 'optionalAccess', _222 => _222.reveal, 'call', _223 => _223(id)]), []);
5831
6090
  const trimToCapacity = _react.useCallback.call(void 0,
5832
6091
  (ref) => {
5833
6092
  const option = latest.current.placeTypes.find((o) => o.ref === ref);
@@ -5843,7 +6102,7 @@ function VenueDesigner(props) {
5843
6102
  () => hostReads(latest.current.placeTypes, facts.summary, facts.pieces, m),
5844
6103
  [typesKey, facts, m]
5845
6104
  );
5846
- const selectedRef = selected && selected.type !== "landmark" ? _optionalChain([selected, 'access', _203 => _203.placeType, 'optionalAccess', _204 => _204.ref]) || null : null;
6105
+ const selectedRef = selected && selected.type !== "landmark" ? _optionalChain([selected, 'access', _224 => _224.placeType, 'optionalAccess', _225 => _225.ref]) || null : null;
5847
6106
  const hostApi = _react.useMemo.call(void 0,
5848
6107
  () => ({ ...reads, addPiece, trimToCapacity, select: selectPiece, reveal: revealPiece, selectedRef }),
5849
6108
  [reads, addPiece, trimToCapacity, selectPiece, revealPiece, selectedRef]
@@ -5908,7 +6167,7 @@ function VenueDesigner(props) {
5908
6167
  editing: ui.backgroundEditing,
5909
6168
  compact,
5910
6169
  onPick: pickBackground ? () => void pickBackground() : null,
5911
- onUseSuggested: suggestedSrc && suggestedSrc !== _optionalChain([bg, 'optionalAccess', _205 => _205.src]) ? () => adoptBackground(suggestedSrc) : null,
6170
+ onUseSuggested: suggestedSrc && suggestedSrc !== _optionalChain([bg, 'optionalAccess', _226 => _226.src]) ? () => adoptBackground(suggestedSrc) : null,
5912
6171
  onSet: setBackground,
5913
6172
  onEditing: (on) => {
5914
6173
  dispatchUi({ type: "backgroundEdit", on });
@@ -5972,8 +6231,8 @@ function VenueDesigner(props) {
5972
6231
  const panel = _nullishCoalesce(inspector, () => ( multiPanel));
5973
6232
  const numberingTitleId = _react.useId.call(void 0, );
5974
6233
  const numberingBlock = numberingId ? layout.elements.find((e) => e.id === numberingId) : void 0;
5975
- const numberingTarget = _optionalChain([numberingBlock, 'optionalAccess', _206 => _206.type]) === "seatBlock" ? numberingBlock : null;
5976
- const numberingRef = _optionalChain([numberingTarget, 'optionalAccess', _207 => _207.placeType, 'optionalAccess', _208 => _208.ref]) || null;
6234
+ const numberingTarget = _optionalChain([numberingBlock, 'optionalAccess', _227 => _227.type]) === "seatBlock" ? numberingBlock : null;
6235
+ const numberingRef = _optionalChain([numberingTarget, 'optionalAccess', _228 => _228.placeType, 'optionalAccess', _229 => _229.ref]) || null;
5977
6236
  const numberingType = numberingRef ? props.placeTypes.find((p) => p.ref === numberingRef) : void 0;
5978
6237
  const closeNumbering = _react.useCallback.call(void 0, () => setNumberingId(null), []);
5979
6238
  const canvas = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6075,8 +6334,8 @@ function VenueDesigner(props) {
6075
6334
  NumberingDialog,
6076
6335
  {
6077
6336
  block: numberingTarget,
6078
- typeName: _nullishCoalesce(_optionalChain([numberingType, 'optionalAccess', _209 => _209.label]), () => ( m.unassigned)),
6079
- color: _nullishCoalesce(_optionalChain([numberingType, 'optionalAccess', _210 => _210.color]), () => ( null)),
6337
+ typeName: _nullishCoalesce(_optionalChain([numberingType, 'optionalAccess', _230 => _230.label]), () => ( m.unassigned)),
6338
+ color: _nullishCoalesce(_optionalChain([numberingType, 'optionalAccess', _231 => _231.color]), () => ( null)),
6080
6339
  lockedUnitIds: locked,
6081
6340
  messages: m,
6082
6341
  titleId: numberingTitleId,
@@ -6098,7 +6357,7 @@ function VenueDesigner(props) {
6098
6357
  }
6099
6358
 
6100
6359
  // ../react/src/index.ts
6101
- var VERSION = "0.10.2";
6360
+ var VERSION = "0.11.0";
6102
6361
 
6103
6362
 
6104
6363