@seatlayer/core 0.53.0 → 0.54.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/README.md +2 -2
- package/dist/categoryInventory-B4xo7hE2.d.ts +109 -0
- package/dist/categoryInventory-lRtu3VjD.d.cts +109 -0
- package/dist/chunk-3QLFGEQY.js +1 -0
- package/dist/chunk-55NOSZK5.js +1 -0
- package/dist/chunk-6LIPQU4G.js +1 -0
- package/dist/chunk-6VTTBC5F.js +1 -0
- package/dist/chunk-7PT7OQUO.js +1 -0
- package/dist/chunk-AQKYUJBX.js +1 -0
- package/dist/chunk-CXF32VPG.js +1 -0
- package/dist/chunk-DDE7IOFT.js +1 -0
- package/dist/chunk-EQM4FFN5.js +1 -0
- package/dist/chunk-EYROIZGQ.js +1 -0
- package/dist/chunk-QUKWJQLR.js +1 -0
- package/dist/chunk-VDZ24QVV.js +1 -0
- package/dist/core/chart-ops/index.cjs +1 -0
- package/dist/core/chart-ops/index.d.cts +1235 -0
- package/dist/core/chart-ops/index.d.ts +1235 -0
- package/dist/core/chart-ops/index.js +1 -0
- package/dist/core/color.cjs +1 -0
- package/dist/core/color.d.cts +192 -0
- package/dist/core/color.d.ts +192 -0
- package/dist/core/color.js +1 -0
- package/dist/core/inventory/index.cjs +1 -0
- package/dist/core/inventory/index.d.cts +209 -0
- package/dist/core/inventory/index.d.ts +209 -0
- package/dist/core/inventory/index.js +1 -0
- package/dist/core/layout/index.cjs +1 -0
- package/dist/core/layout/index.d.cts +376 -0
- package/dist/core/layout/index.d.ts +376 -0
- package/dist/core/layout/index.js +1 -0
- package/dist/core/quality/index.cjs +1 -0
- package/dist/core/quality/index.d.cts +132 -0
- package/dist/core/quality/index.d.ts +132 -0
- package/dist/core/quality/index.js +1 -0
- package/dist/core/render-assets/index.cjs +1 -0
- package/dist/core/render-assets/index.d.cts +99 -0
- package/dist/core/render-assets/index.d.ts +99 -0
- package/dist/core/render-assets/index.js +1 -0
- package/dist/core/seatConfidence.cjs +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/seatConfidence.js +1 -1
- package/dist/core/sections/index.cjs +1 -0
- package/dist/core/sections/index.d.cts +346 -0
- package/dist/core/sections/index.d.ts +346 -0
- package/dist/core/sections/index.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +39 -533
- package/dist/index.d.ts +39 -533
- package/dist/index.js +1 -1
- package/dist/labeling-CsPt1mC_.d.cts +90 -0
- package/dist/labeling-w8bl86cb.d.ts +90 -0
- package/dist/layout-B5UYbwnv.d.ts +181 -0
- package/dist/layout-YFmuxw_M.d.cts +181 -0
- package/dist/renderedQuality-CugJarFp.d.cts +113 -0
- package/dist/renderedQuality-DbZM034G.d.ts +113 -0
- package/dist/renderer-DhUHFtsI.d.cts +531 -0
- package/dist/renderer-IBi9YKWR.d.ts +531 -0
- package/dist/sections-B7cDF0Nq.d.cts +123 -0
- package/dist/sections-mLOZrGrI.d.ts +123 -0
- package/dist/segmentedRowModel-BPTnJ7Tz.d.ts +75 -0
- package/dist/segmentedRowModel-CGoH684F.d.cts +75 -0
- package/dist/ticketRestrictions-BwAebpSK.d.cts +72 -0
- package/dist/ticketRestrictions-ChHJwvTq.d.ts +72 -0
- package/dist/{types-tLOunI-B.d.cts → types-COfJorq_.d.cts} +233 -757
- package/dist/{types-tLOunI-B.d.ts → types-COfJorq_.d.ts} +233 -757
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +25 -25
- package/dist/view3d/index.d.cts +2 -1
- package/dist/view3d/index.d.ts +2 -1
- package/dist/view3d/index.js +27 -27
- package/package.json +94 -5
- package/dist/chunk-54A7LIL5.js +0 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { P as Point, C as ChartDoc, R as RowObject } from '../../types-COfJorq_.cjs';
|
|
2
|
+
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-DhUHFtsI.cjs';
|
|
3
|
+
export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-lRtu3VjD.cjs';
|
|
4
|
+
export { C as CompanionSelectionIssue, M as MAX_EVENT_INVENTORY, a as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, T as TicketOptionApplicabilityIssue, b as TicketSelection, c as TicketSelectionIssue, d as TicketTierResolution, e as applicableTicketTiers, f as companionSelectionIssue, g as gaAreasOf, h as gaInventorySegments, i as gaUnitLabel, j as gaUnitLabels, k as growJoinedGAInventory, l as isGaUnitLabel, r as resolveTicketTierForSeat, t as ticketOptionNotApplicableIssue, m as ticketSelectionIssue, n as ticketTierAppliesToSeat, v as validGAInventorySegments } from '../../ticketRestrictions-BwAebpSK.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Best-available seat selection — a PURE, fully unit-testable ranking function.
|
|
8
|
+
*
|
|
9
|
+
* ONE definition, used by both sides. The API Worker's atomic best-available
|
|
10
|
+
* route owns the authoritative pick + hold for the default "Find best seats"
|
|
11
|
+
* flow; the buyer widget runs a premium-biased pre-pass locally (it already
|
|
12
|
+
* holds the full seat geometry + commercial flags + live availability) and then
|
|
13
|
+
* holds the resulting block through the normal hold endpoint. Until 2026-08-15
|
|
14
|
+
* the Worker kept a hand-maintained fork of this file
|
|
15
|
+
* (`workers/api/src/bestAvailable.ts`) whose own header admitted the copy; the
|
|
16
|
+
* fork is deleted and the Worker imports this module directly, so client and
|
|
17
|
+
* server can no longer drift on what "best" means.
|
|
18
|
+
*
|
|
19
|
+
* "Best" means, in priority order:
|
|
20
|
+
* 0. (opt-in) a run made entirely of `commercial.premium` seats — only when
|
|
21
|
+
* `preferPremium` is set; absent = this term is inert (byte-identical).
|
|
22
|
+
* 1. A single contiguous run of `qty` adjacent-available seats in ONE row
|
|
23
|
+
* (a booked/held/missing/wrong-category seat breaks contiguity).
|
|
24
|
+
* 2. …that does NOT strand a single isolated free seat ("orphan") beside the
|
|
25
|
+
* run — leaving a pair or more is fine, leaving a lone singleton is not.
|
|
26
|
+
* 3. …whose centroid is closest to the focal point (the stage).
|
|
27
|
+
* 4. Deterministic tie-break by rowId then seat index (so it's testable).
|
|
28
|
+
*
|
|
29
|
+
* When no single-row run of `qty` exists, it falls back to the `qty` available
|
|
30
|
+
* seats closest to the focal point overall (which may span rows).
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
type BestAvailableReason = 'not_enough_together' | 'sold_out';
|
|
34
|
+
interface BestAvailableResult {
|
|
35
|
+
labels: string[];
|
|
36
|
+
reason?: BestAvailableReason;
|
|
37
|
+
}
|
|
38
|
+
interface BestAvailableOpts {
|
|
39
|
+
qty: number;
|
|
40
|
+
categoryKey?: string;
|
|
41
|
+
/** Restrict the pick to one authored navigation zone. */
|
|
42
|
+
zoneId?: string;
|
|
43
|
+
focal: Point;
|
|
44
|
+
/**
|
|
45
|
+
* Additive premium bias. When true, candidate scoring STRONGLY prefers seats
|
|
46
|
+
* carrying `commercial.premium` (a fully-premium run beats any run holding a
|
|
47
|
+
* non-premium seat, ahead of orphan/distance). Undefined/false leaves scoring
|
|
48
|
+
* byte-identical to the baseline algorithm — the premium term never runs.
|
|
49
|
+
*/
|
|
50
|
+
preferPremium?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Pick the `qty` best available seats. Returns `{ labels }` on success, or
|
|
54
|
+
* `{ labels: [], reason }` when the request can't be satisfied at all.
|
|
55
|
+
*/
|
|
56
|
+
declare function pickBestAvailable(seats: ExpandedSeat[], available: Set<string>, opts: BestAvailableOpts): BestAvailableResult;
|
|
57
|
+
/**
|
|
58
|
+
* A whole-booking table offered alongside individual seats.
|
|
59
|
+
*
|
|
60
|
+
* Server-side (model-2 event inventory) input; the widget does not build these
|
|
61
|
+
* today, which is why the seat-only `pickBestAvailable` stays the entry point
|
|
62
|
+
* for both and this wrapper is additive.
|
|
63
|
+
*/
|
|
64
|
+
interface AtomicTableCandidate {
|
|
65
|
+
label: string;
|
|
66
|
+
objectId: string;
|
|
67
|
+
categoryKey: string;
|
|
68
|
+
bookingMode: 'whole' | 'variable';
|
|
69
|
+
capacity: number;
|
|
70
|
+
center: Point;
|
|
71
|
+
zoneId?: string;
|
|
72
|
+
focalPoint?: Point;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Group-aware wrapper for model-2 event inventory. `seats` must contain only
|
|
76
|
+
* individual inventory (grouped-table chairs are renderer geometry and are
|
|
77
|
+
* never adjacency slots). A fixed table participates only when its authored
|
|
78
|
+
* capacity exactly matches the requested party; a variable table is excluded
|
|
79
|
+
* because best-available has no explicit guest-quantity contract for it.
|
|
80
|
+
*/
|
|
81
|
+
declare function pickBestAvailableInventory(seats: ExpandedSeat[], tables: AtomicTableCandidate[], available: Set<string>, opts: BestAvailableOpts): BestAvailableResult;
|
|
82
|
+
|
|
83
|
+
type CapacityPresetSize = 'S' | 'M' | 'L' | 'XL';
|
|
84
|
+
interface CapacityControl {
|
|
85
|
+
family: string;
|
|
86
|
+
display: string;
|
|
87
|
+
min: number;
|
|
88
|
+
max: number;
|
|
89
|
+
presets: Array<{
|
|
90
|
+
size: CapacityPresetSize;
|
|
91
|
+
seats: number;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
/** Total sellable inventory, including GA and one unit per booth. */
|
|
95
|
+
declare function chartCapacity(doc: ChartDoc): number;
|
|
96
|
+
/**
|
|
97
|
+
* The same sellable inventory as `chartCapacity`, split by category key.
|
|
98
|
+
*
|
|
99
|
+
* Deliberately seat-level rather than object-level: a row/table carries a
|
|
100
|
+
* `categoryKey`, but individual seats can be reassigned to another category via
|
|
101
|
+
* `overrides[].categoryKey`, so counting whole objects would misattribute those
|
|
102
|
+
* seats. The expanders already resolve `override.categoryKey ?? object
|
|
103
|
+
* .categoryKey` and drop skipped slots, so this walks them.
|
|
104
|
+
*
|
|
105
|
+
* Invariant: the values sum to exactly `chartCapacity(doc)` — each branch below
|
|
106
|
+
* distributes precisely the same number that branch contributes there. A table
|
|
107
|
+
* booked as a whole (or with variable occupancy) has no per-seat identity, so
|
|
108
|
+
* its entire count lands on the table's own category, matching
|
|
109
|
+
* `tableInventoryCount`.
|
|
110
|
+
*
|
|
111
|
+
* Categories with no inventory are present with 0, so a caller can tell "this
|
|
112
|
+
* category sells nothing" apart from "this category does not exist".
|
|
113
|
+
*/
|
|
114
|
+
declare function categoryCapacity(doc: ChartDoc): Record<string, number>;
|
|
115
|
+
/**
|
|
116
|
+
* Registry-free capacity range derived from the current ChartDoc. It keeps the
|
|
117
|
+
* editor useful for old parametric documents without importing any template
|
|
118
|
+
* catalog or one-off venue builder into production.
|
|
119
|
+
*/
|
|
120
|
+
declare function capacityControl(doc: ChartDoc): CapacityControl | null;
|
|
121
|
+
/**
|
|
122
|
+
* Scale inventory across the existing adjustable objects using largest
|
|
123
|
+
* remainder allocation. Object ids, sections, floors, geometry, manual edits,
|
|
124
|
+
* categories and provenance remain stable; only row/table/GA capacities and
|
|
125
|
+
* the centering offsets required by changed row lengths are updated.
|
|
126
|
+
*/
|
|
127
|
+
declare function resizeChartCapacity(source: ChartDoc, requested: number): ChartDoc;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Orphan-seat detection for MANUAL selection — the client-side sibling of the
|
|
131
|
+
* server's best-available orphan avoidance (workers/api/src/bestAvailable):
|
|
132
|
+
* a "stranded single" is a free seat whose both same-row neighbors are
|
|
133
|
+
* unavailable (non-free or currently selected). The picker uses this to show
|
|
134
|
+
* a non-blocking hint; nothing is ever prevented.
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Free seats stranded by the current selection: both same-row neighbors exist
|
|
139
|
+
* and are unavailable, and at least one neighbor is part of `selectedIds` —
|
|
140
|
+
* so pre-existing single gaps (caused by earlier buyers) never nag.
|
|
141
|
+
* Booth units are ignored (no row adjacency).
|
|
142
|
+
*/
|
|
143
|
+
declare function strandedSingles(seats: Iterable<ExpandedSeat>, statusOf: (seatId: string) => SeatStatus, selectedIds: ReadonlySet<string>): ExpandedSeat[];
|
|
144
|
+
|
|
145
|
+
declare const MIN_ROW_BLOCK_ROWS = 1;
|
|
146
|
+
declare const MAX_ROW_BLOCK_ROWS = 100;
|
|
147
|
+
type Generation = NonNullable<RowObject['rowBlockGeneration']>;
|
|
148
|
+
interface RowBlockCountProposal {
|
|
149
|
+
rowCount: number;
|
|
150
|
+
edgePoint: Point;
|
|
151
|
+
}
|
|
152
|
+
declare function rowBlockPreviewRows(generation: Generation, rowCount: number): RowObject[] | null;
|
|
153
|
+
declare function rowBlockEdgePoint(generation: Generation, rowCount?: number): Point | null;
|
|
154
|
+
declare function resolveRowBlockCount(generation: Generation, pointer: Point): RowBlockCountProposal | null;
|
|
155
|
+
declare function intactRowBlockMembers(rows: readonly RowObject[], generation: Generation): boolean;
|
|
156
|
+
|
|
157
|
+
declare const MIN_ROW_SEATS = 1;
|
|
158
|
+
declare const MAX_ROW_SEATS = 300;
|
|
159
|
+
/** Avoid extending a parametric row into an overlapping spiral. */
|
|
160
|
+
declare const MAX_DIRECT_ROW_SWEEP = 330;
|
|
161
|
+
interface RowCapacityProposal {
|
|
162
|
+
seatCount: number;
|
|
163
|
+
curve: number;
|
|
164
|
+
endpoint: Point;
|
|
165
|
+
distance: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Change terminal capacity without moving seats that already exist.
|
|
169
|
+
*
|
|
170
|
+
* A parametric curved row stores its total sweep. Keeping its per-seat angular
|
|
171
|
+
* step constant while the count changes preserves every existing seat centre;
|
|
172
|
+
* only terminal seats are added or removed. Exact cubic paths are deliberately
|
|
173
|
+
* excluded because redistributing their fixed path would move every identity.
|
|
174
|
+
*/
|
|
175
|
+
declare function rowWithTerminalCapacity(row: RowObject, seatCount: number): RowObject | null;
|
|
176
|
+
declare function rowTerminalEndpoint(row: RowObject, seatCount?: number): Point | null;
|
|
177
|
+
/** Deterministically choose the terminal count whose exact endpoint is nearest the pointer. */
|
|
178
|
+
declare function resolveRowTerminalCapacity(row: RowObject, pointer: Point): RowCapacityProposal | null;
|
|
179
|
+
|
|
180
|
+
type ClientInventoryModelVersion = 1 | 2;
|
|
181
|
+
type GroupedTableBookingMode = 'whole' | 'variable';
|
|
182
|
+
/**
|
|
183
|
+
* Buyer-side projection of one atomic table inventory unit. The physical
|
|
184
|
+
* chairs remain renderer geometry, but `label` is the only booking identity.
|
|
185
|
+
*/
|
|
186
|
+
interface GroupedTableInventoryUnit {
|
|
187
|
+
objectId: string;
|
|
188
|
+
label: string;
|
|
189
|
+
displayLabel?: string;
|
|
190
|
+
displayType?: string;
|
|
191
|
+
categoryKey: string;
|
|
192
|
+
mode: GroupedTableBookingMode;
|
|
193
|
+
capacity: number;
|
|
194
|
+
minOccupancy: number;
|
|
195
|
+
maxOccupancy: number;
|
|
196
|
+
chairs: ExpandedSeat[];
|
|
197
|
+
}
|
|
198
|
+
declare class GroupedTableProjectionError extends Error {
|
|
199
|
+
readonly objectId: string;
|
|
200
|
+
constructor(objectId: string, message: string);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Project grouped tables only for the event's explicit model-2 contract.
|
|
204
|
+
* Model 1 deliberately returns no groups even if a legacy snapshot happens to
|
|
205
|
+
* carry a grouping flag, preserving per-chair selection byte-for-byte.
|
|
206
|
+
*/
|
|
207
|
+
declare function groupedTableInventory(doc: ChartDoc, modelVersion: ClientInventoryModelVersion): GroupedTableInventoryUnit[];
|
|
208
|
+
|
|
209
|
+
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, type ClientInventoryModelVersion, type GroupedTableBookingMode, type GroupedTableInventoryUnit, GroupedTableProjectionError, MAX_DIRECT_ROW_SWEEP, MAX_ROW_BLOCK_ROWS, MAX_ROW_SEATS, MIN_ROW_BLOCK_ROWS, MIN_ROW_SEATS, type RowBlockCountProposal, type RowCapacityProposal, capacityControl, categoryCapacity, chartCapacity, groupedTableInventory, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowTerminalEndpoint, rowWithTerminalCapacity, strandedSingles };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { P as Point, C as ChartDoc, R as RowObject } from '../../types-COfJorq_.js';
|
|
2
|
+
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-IBi9YKWR.js';
|
|
3
|
+
export { C as CATEGORY_INVENTORY_FAMILIES, a as CategoryInventoryClone, b as CategoryInventoryConflict, c as CategoryInventoryFamily, d as CategoryInventoryFamilyUsage, e as CategoryInventoryObjectType, f as CategoryInventoryReassignment, g as CategoryInventoryRemediationChange, h as CategoryInventoryRemediationResult, i as CategoryInventoryTarget, j as describeCategoryInventoryConflict, k as effectiveSeatOwnerCategoryCounts, l as inspectCategoryInventoryConflicts, r as remediateCategoryInventoryConflicts } from '../../categoryInventory-B4xo7hE2.js';
|
|
4
|
+
export { C as CompanionSelectionIssue, M as MAX_EVENT_INVENTORY, a as MAX_GA_CAPACITY, N as NotForSaleSelectionIssue, T as TicketOptionApplicabilityIssue, b as TicketSelection, c as TicketSelectionIssue, d as TicketTierResolution, e as applicableTicketTiers, f as companionSelectionIssue, g as gaAreasOf, h as gaInventorySegments, i as gaUnitLabel, j as gaUnitLabels, k as growJoinedGAInventory, l as isGaUnitLabel, r as resolveTicketTierForSeat, t as ticketOptionNotApplicableIssue, m as ticketSelectionIssue, n as ticketTierAppliesToSeat, v as validGAInventorySegments } from '../../ticketRestrictions-ChHJwvTq.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Best-available seat selection — a PURE, fully unit-testable ranking function.
|
|
8
|
+
*
|
|
9
|
+
* ONE definition, used by both sides. The API Worker's atomic best-available
|
|
10
|
+
* route owns the authoritative pick + hold for the default "Find best seats"
|
|
11
|
+
* flow; the buyer widget runs a premium-biased pre-pass locally (it already
|
|
12
|
+
* holds the full seat geometry + commercial flags + live availability) and then
|
|
13
|
+
* holds the resulting block through the normal hold endpoint. Until 2026-08-15
|
|
14
|
+
* the Worker kept a hand-maintained fork of this file
|
|
15
|
+
* (`workers/api/src/bestAvailable.ts`) whose own header admitted the copy; the
|
|
16
|
+
* fork is deleted and the Worker imports this module directly, so client and
|
|
17
|
+
* server can no longer drift on what "best" means.
|
|
18
|
+
*
|
|
19
|
+
* "Best" means, in priority order:
|
|
20
|
+
* 0. (opt-in) a run made entirely of `commercial.premium` seats — only when
|
|
21
|
+
* `preferPremium` is set; absent = this term is inert (byte-identical).
|
|
22
|
+
* 1. A single contiguous run of `qty` adjacent-available seats in ONE row
|
|
23
|
+
* (a booked/held/missing/wrong-category seat breaks contiguity).
|
|
24
|
+
* 2. …that does NOT strand a single isolated free seat ("orphan") beside the
|
|
25
|
+
* run — leaving a pair or more is fine, leaving a lone singleton is not.
|
|
26
|
+
* 3. …whose centroid is closest to the focal point (the stage).
|
|
27
|
+
* 4. Deterministic tie-break by rowId then seat index (so it's testable).
|
|
28
|
+
*
|
|
29
|
+
* When no single-row run of `qty` exists, it falls back to the `qty` available
|
|
30
|
+
* seats closest to the focal point overall (which may span rows).
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
type BestAvailableReason = 'not_enough_together' | 'sold_out';
|
|
34
|
+
interface BestAvailableResult {
|
|
35
|
+
labels: string[];
|
|
36
|
+
reason?: BestAvailableReason;
|
|
37
|
+
}
|
|
38
|
+
interface BestAvailableOpts {
|
|
39
|
+
qty: number;
|
|
40
|
+
categoryKey?: string;
|
|
41
|
+
/** Restrict the pick to one authored navigation zone. */
|
|
42
|
+
zoneId?: string;
|
|
43
|
+
focal: Point;
|
|
44
|
+
/**
|
|
45
|
+
* Additive premium bias. When true, candidate scoring STRONGLY prefers seats
|
|
46
|
+
* carrying `commercial.premium` (a fully-premium run beats any run holding a
|
|
47
|
+
* non-premium seat, ahead of orphan/distance). Undefined/false leaves scoring
|
|
48
|
+
* byte-identical to the baseline algorithm — the premium term never runs.
|
|
49
|
+
*/
|
|
50
|
+
preferPremium?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Pick the `qty` best available seats. Returns `{ labels }` on success, or
|
|
54
|
+
* `{ labels: [], reason }` when the request can't be satisfied at all.
|
|
55
|
+
*/
|
|
56
|
+
declare function pickBestAvailable(seats: ExpandedSeat[], available: Set<string>, opts: BestAvailableOpts): BestAvailableResult;
|
|
57
|
+
/**
|
|
58
|
+
* A whole-booking table offered alongside individual seats.
|
|
59
|
+
*
|
|
60
|
+
* Server-side (model-2 event inventory) input; the widget does not build these
|
|
61
|
+
* today, which is why the seat-only `pickBestAvailable` stays the entry point
|
|
62
|
+
* for both and this wrapper is additive.
|
|
63
|
+
*/
|
|
64
|
+
interface AtomicTableCandidate {
|
|
65
|
+
label: string;
|
|
66
|
+
objectId: string;
|
|
67
|
+
categoryKey: string;
|
|
68
|
+
bookingMode: 'whole' | 'variable';
|
|
69
|
+
capacity: number;
|
|
70
|
+
center: Point;
|
|
71
|
+
zoneId?: string;
|
|
72
|
+
focalPoint?: Point;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Group-aware wrapper for model-2 event inventory. `seats` must contain only
|
|
76
|
+
* individual inventory (grouped-table chairs are renderer geometry and are
|
|
77
|
+
* never adjacency slots). A fixed table participates only when its authored
|
|
78
|
+
* capacity exactly matches the requested party; a variable table is excluded
|
|
79
|
+
* because best-available has no explicit guest-quantity contract for it.
|
|
80
|
+
*/
|
|
81
|
+
declare function pickBestAvailableInventory(seats: ExpandedSeat[], tables: AtomicTableCandidate[], available: Set<string>, opts: BestAvailableOpts): BestAvailableResult;
|
|
82
|
+
|
|
83
|
+
type CapacityPresetSize = 'S' | 'M' | 'L' | 'XL';
|
|
84
|
+
interface CapacityControl {
|
|
85
|
+
family: string;
|
|
86
|
+
display: string;
|
|
87
|
+
min: number;
|
|
88
|
+
max: number;
|
|
89
|
+
presets: Array<{
|
|
90
|
+
size: CapacityPresetSize;
|
|
91
|
+
seats: number;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
/** Total sellable inventory, including GA and one unit per booth. */
|
|
95
|
+
declare function chartCapacity(doc: ChartDoc): number;
|
|
96
|
+
/**
|
|
97
|
+
* The same sellable inventory as `chartCapacity`, split by category key.
|
|
98
|
+
*
|
|
99
|
+
* Deliberately seat-level rather than object-level: a row/table carries a
|
|
100
|
+
* `categoryKey`, but individual seats can be reassigned to another category via
|
|
101
|
+
* `overrides[].categoryKey`, so counting whole objects would misattribute those
|
|
102
|
+
* seats. The expanders already resolve `override.categoryKey ?? object
|
|
103
|
+
* .categoryKey` and drop skipped slots, so this walks them.
|
|
104
|
+
*
|
|
105
|
+
* Invariant: the values sum to exactly `chartCapacity(doc)` — each branch below
|
|
106
|
+
* distributes precisely the same number that branch contributes there. A table
|
|
107
|
+
* booked as a whole (or with variable occupancy) has no per-seat identity, so
|
|
108
|
+
* its entire count lands on the table's own category, matching
|
|
109
|
+
* `tableInventoryCount`.
|
|
110
|
+
*
|
|
111
|
+
* Categories with no inventory are present with 0, so a caller can tell "this
|
|
112
|
+
* category sells nothing" apart from "this category does not exist".
|
|
113
|
+
*/
|
|
114
|
+
declare function categoryCapacity(doc: ChartDoc): Record<string, number>;
|
|
115
|
+
/**
|
|
116
|
+
* Registry-free capacity range derived from the current ChartDoc. It keeps the
|
|
117
|
+
* editor useful for old parametric documents without importing any template
|
|
118
|
+
* catalog or one-off venue builder into production.
|
|
119
|
+
*/
|
|
120
|
+
declare function capacityControl(doc: ChartDoc): CapacityControl | null;
|
|
121
|
+
/**
|
|
122
|
+
* Scale inventory across the existing adjustable objects using largest
|
|
123
|
+
* remainder allocation. Object ids, sections, floors, geometry, manual edits,
|
|
124
|
+
* categories and provenance remain stable; only row/table/GA capacities and
|
|
125
|
+
* the centering offsets required by changed row lengths are updated.
|
|
126
|
+
*/
|
|
127
|
+
declare function resizeChartCapacity(source: ChartDoc, requested: number): ChartDoc;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Orphan-seat detection for MANUAL selection — the client-side sibling of the
|
|
131
|
+
* server's best-available orphan avoidance (workers/api/src/bestAvailable):
|
|
132
|
+
* a "stranded single" is a free seat whose both same-row neighbors are
|
|
133
|
+
* unavailable (non-free or currently selected). The picker uses this to show
|
|
134
|
+
* a non-blocking hint; nothing is ever prevented.
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Free seats stranded by the current selection: both same-row neighbors exist
|
|
139
|
+
* and are unavailable, and at least one neighbor is part of `selectedIds` —
|
|
140
|
+
* so pre-existing single gaps (caused by earlier buyers) never nag.
|
|
141
|
+
* Booth units are ignored (no row adjacency).
|
|
142
|
+
*/
|
|
143
|
+
declare function strandedSingles(seats: Iterable<ExpandedSeat>, statusOf: (seatId: string) => SeatStatus, selectedIds: ReadonlySet<string>): ExpandedSeat[];
|
|
144
|
+
|
|
145
|
+
declare const MIN_ROW_BLOCK_ROWS = 1;
|
|
146
|
+
declare const MAX_ROW_BLOCK_ROWS = 100;
|
|
147
|
+
type Generation = NonNullable<RowObject['rowBlockGeneration']>;
|
|
148
|
+
interface RowBlockCountProposal {
|
|
149
|
+
rowCount: number;
|
|
150
|
+
edgePoint: Point;
|
|
151
|
+
}
|
|
152
|
+
declare function rowBlockPreviewRows(generation: Generation, rowCount: number): RowObject[] | null;
|
|
153
|
+
declare function rowBlockEdgePoint(generation: Generation, rowCount?: number): Point | null;
|
|
154
|
+
declare function resolveRowBlockCount(generation: Generation, pointer: Point): RowBlockCountProposal | null;
|
|
155
|
+
declare function intactRowBlockMembers(rows: readonly RowObject[], generation: Generation): boolean;
|
|
156
|
+
|
|
157
|
+
declare const MIN_ROW_SEATS = 1;
|
|
158
|
+
declare const MAX_ROW_SEATS = 300;
|
|
159
|
+
/** Avoid extending a parametric row into an overlapping spiral. */
|
|
160
|
+
declare const MAX_DIRECT_ROW_SWEEP = 330;
|
|
161
|
+
interface RowCapacityProposal {
|
|
162
|
+
seatCount: number;
|
|
163
|
+
curve: number;
|
|
164
|
+
endpoint: Point;
|
|
165
|
+
distance: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Change terminal capacity without moving seats that already exist.
|
|
169
|
+
*
|
|
170
|
+
* A parametric curved row stores its total sweep. Keeping its per-seat angular
|
|
171
|
+
* step constant while the count changes preserves every existing seat centre;
|
|
172
|
+
* only terminal seats are added or removed. Exact cubic paths are deliberately
|
|
173
|
+
* excluded because redistributing their fixed path would move every identity.
|
|
174
|
+
*/
|
|
175
|
+
declare function rowWithTerminalCapacity(row: RowObject, seatCount: number): RowObject | null;
|
|
176
|
+
declare function rowTerminalEndpoint(row: RowObject, seatCount?: number): Point | null;
|
|
177
|
+
/** Deterministically choose the terminal count whose exact endpoint is nearest the pointer. */
|
|
178
|
+
declare function resolveRowTerminalCapacity(row: RowObject, pointer: Point): RowCapacityProposal | null;
|
|
179
|
+
|
|
180
|
+
type ClientInventoryModelVersion = 1 | 2;
|
|
181
|
+
type GroupedTableBookingMode = 'whole' | 'variable';
|
|
182
|
+
/**
|
|
183
|
+
* Buyer-side projection of one atomic table inventory unit. The physical
|
|
184
|
+
* chairs remain renderer geometry, but `label` is the only booking identity.
|
|
185
|
+
*/
|
|
186
|
+
interface GroupedTableInventoryUnit {
|
|
187
|
+
objectId: string;
|
|
188
|
+
label: string;
|
|
189
|
+
displayLabel?: string;
|
|
190
|
+
displayType?: string;
|
|
191
|
+
categoryKey: string;
|
|
192
|
+
mode: GroupedTableBookingMode;
|
|
193
|
+
capacity: number;
|
|
194
|
+
minOccupancy: number;
|
|
195
|
+
maxOccupancy: number;
|
|
196
|
+
chairs: ExpandedSeat[];
|
|
197
|
+
}
|
|
198
|
+
declare class GroupedTableProjectionError extends Error {
|
|
199
|
+
readonly objectId: string;
|
|
200
|
+
constructor(objectId: string, message: string);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Project grouped tables only for the event's explicit model-2 contract.
|
|
204
|
+
* Model 1 deliberately returns no groups even if a legacy snapshot happens to
|
|
205
|
+
* carry a grouping flag, preserving per-chair selection byte-for-byte.
|
|
206
|
+
*/
|
|
207
|
+
declare function groupedTableInventory(doc: ChartDoc, modelVersion: ClientInventoryModelVersion): GroupedTableInventoryUnit[];
|
|
208
|
+
|
|
209
|
+
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, type ClientInventoryModelVersion, type GroupedTableBookingMode, type GroupedTableInventoryUnit, GroupedTableProjectionError, MAX_DIRECT_ROW_SWEEP, MAX_ROW_BLOCK_ROWS, MAX_ROW_SEATS, MIN_ROW_BLOCK_ROWS, MIN_ROW_SEATS, type RowBlockCountProposal, type RowCapacityProposal, capacityControl, categoryCapacity, chartCapacity, groupedTableInventory, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowTerminalEndpoint, rowWithTerminalCapacity, strandedSingles };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as H,b as V,c as Z,d as tt,e as et,f as ot,g as rt,h as nt,i as at,j as it,k as st}from"../../chunk-7PT7OQUO.js";import{a as ct,b as lt,c as ut,d as pt,e as ft,h as P}from"../../chunk-EYROIZGQ.js";import"../../chunk-6LIPQU4G.js";import"../../chunk-3QLFGEQY.js";import{a as L,b as z,c as F,d as J,e as Q,f as U,g as Y,h as $,i as q}from"../../chunk-AQKYUJBX.js";import"../../chunk-DDE7IOFT.js";import{ka as v,l as C,ma as g,na as R,pa as S,qa as _,va as O,w}from"../../chunk-VDZ24QVV.js";import"../../chunk-CXF32VPG.js";function b(t){return t.floors?.length?t.floors.flatMap(e=>e.objects):t.objects}function I(t){return b(t).reduce((e,r)=>r.type==="row"?e+v(r):r.type==="table"?e+S(r):r.type==="gaArea"?e+Math.max(0,Math.floor(r.capacity)):r.type==="booth"?e+1:e,0)}function bt(t){let e={};for(let o of t.categories??[])e[o.key]=0;let r=(o,a)=>{a>0&&(e[o]=(e[o]??0)+a)};for(let o of b(t))if(o.type==="row")for(let a of g(o))r(a.categoryKey,1);else if(o.type==="table")if(o.bookAsWhole||o.variableOccupancy)r(o.categoryKey,Math.max(0,Math.round(o.seatCount)));else for(let a of _(o))r(a.categoryKey,1);else o.type==="gaArea"?r(o.categoryKey,Math.max(0,Math.floor(o.capacity))):o.type==="booth"&&r(o.categoryKey,1);return e}function G(t){if(!t.template)return null;let e=b(t),r=e.filter(l=>l.type==="row"||l.type==="table"||l.type==="gaArea");if(!r.length)return null;let a=e.filter(l=>l.type==="booth").length+r.reduce((l,f)=>l+(f.type==="table"?2:1),0),s=I(t),c=Math.max(a+1,Math.min(5e4,s*4)),u=[.5,1,1.5,2].map(l=>w(Math.round(s*l),a,c));return{family:t.template.family,display:t.template.family.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase()),min:a,max:c,presets:["S","M","L","XL"].map((l,f)=>({size:l,seats:u[f]}))}}function A(t){let e=g(t);return e.length?C(e):{...t.origin}}function dt(t,e){let r=G(t);if(!r)return structuredClone(t);let o=structuredClone(t),a=b(o),s=a.filter(n=>n.type==="row"||n.type==="table"||n.type==="gaArea"),c=a.filter(n=>n.type==="booth").length,u=Math.max(r.min,Math.min(r.max,Math.round(e))),l=u-c,f=s.map((n,i)=>{let m=n.type==="gaArea"?Math.max(0,Math.floor(n.capacity)):n.seatCount,x=n.type==="table"?2:1;return{object:n,index:i,current:m,minimum:x,value:x,fraction:0}}),E=f.reduce((n,i)=>n+i.minimum,0),d=Math.max(0,l-E),T=f.reduce((n,i)=>n+Math.max(1,i.current-i.minimum),0);for(let n of f){let i=d*Math.max(1,n.current-n.minimum)/T,m=Math.floor(i);n.value+=m,n.fraction=i-m}d=l-f.reduce((n,i)=>n+i.value,0),f.sort((n,i)=>i.fraction-n.fraction||n.index-i.index);for(let n=0;n<d;n++)f[n%f.length].value++;f.sort((n,i)=>n.index-i.index);for(let n of f)if(n.object.type==="row"){let i=A(n.object);n.object.seatCount=n.value;let m=A(n.object);n.object.origin.x+=i.x-m.x,n.object.origin.y+=i.y-m.y}else if(n.object.type==="table"){let i=n.object;if(i.seatCountsBySide){let m=["top","bottom","left","right"],x=R(i),N=m.reduce((p,y)=>p+x[y],0)||1,h=m.map((p,y)=>{let M=n.value*x[p]/N;return{side:p,index:y,value:Math.floor(M),fraction:M-Math.floor(M)}}),k=n.value-h.reduce((p,y)=>p+y.value,0);h.sort((p,y)=>y.fraction-p.fraction||p.index-y.index);for(let p=0;p<k;p++)h[p%h.length].value+=1;h.sort((p,y)=>p.index-y.index),i.seatCountsBySide={top:h[0].value,bottom:h[1].value,left:h[2].value,right:h[3].value},i.sides=m.filter(p=>i.seatCountsBySide[p]>0)}i.seatCount=n.value,i.overrides&&(i.overrides=i.overrides.filter(m=>m.index<n.value),i.overrides.length||delete i.overrides)}else n.object.capacity=n.value;return o.floors?.length&&(o.objects=o.floors[0].objects),o.template={family:o.template.family,targetSeats:u},o=P(o).doc,o.template={family:t.template.family,targetSeats:I(o)},o}var W=1,B=100;function X(t,e){if(!Number.isInteger(e)||e<W||e>B)return null;let r=t.rotation*Math.PI/180,o={x:Math.cos(r),y:Math.sin(r)},a={x:-o.y,y:o.x};return Array.from({length:e},(s,c)=>{let u=t.style==="intertwined"&&c%2===1?t.seatSpacing/2:0;return{type:"row",id:`__block_preview_${c}`,label:"",origin:{x:t.origin.x+a.x*c*t.rowGap+o.x*u,y:t.origin.y+a.y*c*t.rowGap+o.y*u},rotation:t.rotation,curve:t.curve,seatCount:t.seatsPerRow,seatSpacing:t.seatSpacing,categoryKey:"__preview__"}})}function j(t,e=t.rowCount){let r=X(t,e);return r?.length?O(r[r.length-1]):null}function Ct(t,e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||t.rowGap<=0)return null;let r=j(t,1);if(!r)return null;let o=t.rotation*Math.PI/180,a={x:-Math.sin(o),y:Math.cos(o)},s=(e.x-r.x)*a.x+(e.y-r.y)*a.y,c=Math.max(W,Math.min(B,Math.round(s/t.rowGap)+1)),u=j(t,c);return u?{rowCount:c,edgePoint:u}:null}function wt(t,e){return t.length!==e.rowCount?!1:[...t].sort((o,a)=>(o.rowBlockGeneration?.rowIndex??1/0)-(a.rowBlockGeneration?.rowIndex??1/0)).every((o,a)=>{let s=o.rowBlockGeneration;return s?.kind==="row-block-v1"&&s.groupId===e.groupId&&s.rowIndex===a&&s.signature===e.signature&&JSON.stringify(s)===JSON.stringify({...e,rowIndex:a})})}var Rt=1,St=300,_t=330;function D(t,e){if(t.path||!Number.isInteger(e)||e<1||e>300)return null;let r=t.seatCount>1?t.curve/(t.seatCount-1):0;return{...t,seatCount:e,curve:r*(e-1)}}function K(t,e=t.seatCount){let r=D(t,e);if(!r)return null;if(e===1)return{...r.origin};let o=r.rotation*Math.PI/180,a=r.curve/(e-1)*Math.PI/180,s,c;if(Math.abs(a)<1e-9)s=(e-1)*r.seatSpacing,c=0;else{let u=r.seatSpacing/(2*Math.sin(Math.abs(a)/2)),l=a*(e-1);s=u*Math.sin(l),c=-u+u*Math.cos(l)}return{x:r.origin.x+s*Math.cos(o)-c*Math.sin(o),y:r.origin.y+s*Math.sin(o)+c*Math.cos(o)}}function Ot(t,e){if(t.path||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let r=t.seatCount>1?t.curve/(t.seatCount-1):0,o=Math.abs(r)<1e-9?300:Math.min(300,Math.floor(330/Math.abs(r))+1),a=null;for(let s=1;s<=Math.max(1,o);s+=1){let c=K(t,s);if(!c)continue;let u=Math.hypot(c.x-e.x,c.y-e.y),l=r*(s-1);(!a||u<a.distance||u===a.distance&&s<a.seatCount)&&(a={seatCount:s,curve:l,endpoint:c,distance:u})}return a}export{ct as CATEGORY_INVENTORY_FAMILIES,it as GroupedTableProjectionError,_t as MAX_DIRECT_ROW_SWEEP,z as MAX_EVENT_INVENTORY,L as MAX_GA_CAPACITY,B as MAX_ROW_BLOCK_ROWS,St as MAX_ROW_SEATS,W as MIN_ROW_BLOCK_ROWS,Rt as MIN_ROW_SEATS,ot as applicableTicketTiers,G as capacityControl,bt as categoryCapacity,I as chartCapacity,nt as companionSelectionIssue,pt as describeCategoryInventoryConflict,lt as effectiveSeatOwnerCategoryCounts,$ as gaAreasOf,Q as gaInventorySegments,F as gaUnitLabel,U as gaUnitLabels,st as groupedTableInventory,Y as growJoinedGAInventory,ut as inspectCategoryInventoryConflicts,wt as intactRowBlockMembers,q as isGaUnitLabel,V as pickBestAvailable,Z as pickBestAvailableInventory,ft as remediateCategoryInventoryConflicts,dt as resizeChartCapacity,Ct as resolveRowBlockCount,Ot as resolveRowTerminalCapacity,rt as resolveTicketTierForSeat,j as rowBlockEdgePoint,X as rowBlockPreviewRows,K as rowTerminalEndpoint,D as rowWithTerminalCapacity,H as strandedSingles,tt as ticketOptionNotApplicableIssue,at as ticketSelectionIssue,et as ticketTierAppliesToSeat,J as validGAInventorySegments};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var $=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var $e=(e,t)=>{for(var n in t)$(e,n,{get:t[n],enumerable:!0})},We=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ye(t))!Ke.call(e,r)&&r!==n&&$(e,r,{get:()=>t[r],enumerable:!(o=ze(t,r))||o.enumerable});return e};var Ve=e=>We($({},"__esModule",{value:!0}),e);var Qt={};$e(Qt,{DEFAULT_SEAT_RADIUS:()=>Ge,TEXT_BACKGROUND_PADDING_MAX:()=>dn,TEXT_BACKGROUND_RADIUS_MAX:()=>hn,TEXT_LETTER_SPACING_MAX:()=>un,TEXT_LETTER_SPACING_MIN:()=>ln,TEXT_LINE_HEIGHT_MAX:()=>an,TEXT_LINE_HEIGHT_MIN:()=>cn,TEXT_OPACITY_MIN:()=>fn,TEXT_WIDTH_MAX:()=>sn,TEXT_WIDTH_MIN:()=>rn,allObjects:()=>Ue,applyAffine:()=>Ft,buildAisleHoles:()=>Ze,buildSeatIndex:()=>Kt,buildSectionShell:()=>Qe,chartBounds:()=>Be,composeAffine:()=>Ut,createPerspectiveCamera:()=>Nt,cubicPoint:()=>H,decomposeAffineLinear:()=>Bt,distanceToRings:()=>ge,distributeAlongCubic:()=>W,expandBooth:()=>De,expandChart:()=>Dt,expandRow:()=>ue,expandRowSlots:()=>ke,expandTable:()=>je,expandTableSlots:()=>fe,floorObjects:()=>kt,floorOverviewTranslations:()=>Xe,floorsOf:()=>He,gridStats:()=>qt,hitTest:()=>$t,invertAffine:()=>Ht,layoutFloorOverview:()=>jt,nearestWithin:()=>Wt,objectCenter:()=>Ne,owningSectionForObject:()=>Fe,perspectiveTangentAffine:()=>Xt,pointInPolygon:()=>ae,pointInPolygonWithHoles:()=>Y,polygonArea:()=>Q,polygonInscribedAnchor:()=>Z,polygonLabelPoint:()=>Tt,polygonNetArea:()=>nt,projectPerspectivePoint:()=>K,queryRect:()=>Vt,resolveSegmentedRowGroups:()=>J,rowInventoryCount:()=>Ot,rowSeatPositions:()=>le,segmentedRowComponentSeats:()=>it,segmentedRowComponents:()=>rt,segmentedRowSeatTotal:()=>st,smoothCubicThroughMiddle:()=>qe,stackFloors:()=>Lt,tableInventoryCount:()=>Rt,tableSeatCountsBySide:()=>Le,textLayoutMetrics:()=>V,translateObject:()=>de});module.exports=Ve(Qt);var en=Math.PI/180;function j(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function L(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function H(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function qe(e,t,n){let o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},r={x:(n.x-o.x)*4/3,y:(n.y-o.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+r.x,y:e.y+(t.y-e.y)/3+r.y},control2:{x:e.x+(t.x-e.x)*2/3+r.x,y:e.y+(t.y-e.y)*2/3+r.y},end:{...t}}}function W(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[H(e,.5)];let o=Array.from({length:n+1},(u,y)=>H(e,y/n)),r=new Float64Array(o.length);for(let u=1;u<o.length;u+=1){let y=o[u].x-o[u-1].x,a=o[u].y-o[u-1].y;r[u]=r[u-1]+Math.hypot(y,a)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],c=1;for(let u=0;u<t;u+=1){let y=i*u/(t-1);for(;c<r.length-1&&r[c]<y;)c+=1;let a=r[c-1],f=r[c],l=f===a?0:(y-a)/(f-a);s.push({x:o[c-1].x+(o[c].x-o[c-1].x)*l,y:o[c-1].y+(o[c].y-o[c-1].y)*l})}return s}function T(e,t){return{x:e.x+t.x,y:e.y+t.y}}function F(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _(e,t){return{x:e.x*t,y:e.y*t}}function U(e,t=13){return Array.from({length:t},(n,o)=>H(e,o/(t-1)))}function he(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return L(e[o],e[o+1],n-o)}function me(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[he(e,o)];for(let s=1;s<e.length-1;s+=1){let c=s/(e.length-1);c>o+1e-9&&c<r-1e-9&&i.push(e[s])}return i.push(he(e,r)),i}function ye(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([l,p],b)=>{let m=j(L(e[l],e[p],.5),t);m<r&&(r=m,o=b)});let i=e[o],s=e[(o+1)%4],c=e[(o+2)%4],u=e[(o+3)%4],y=L(i,s,.5),a=F(t,y),f=Math.max(1e-9,Math.hypot(a.x,a.y));return{p0:i,p1:s,p2:c,p3:u,normal:_(a,1/f),depth:(j(i,u)+j(s,c))/2}}function xe(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:s}=e,c=F(n,t),u=F(o,r),y=s*.22,a=s*.12;return{nearPath:{start:t,control1:T(T(t,_(c,1/3)),_(i,y)),control2:T(T(t,_(c,2/3)),_(i,y)),end:n},farPath:{start:o,control1:T(T(r,_(u,2/3)),_(i,a)),control2:T(T(r,_(u,1/3)),_(i,a)),end:r}}}function Qe(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((b,m)=>T(b,m),{x:0,y:0});o.x/=4,o.y/=4;let r=j(e[0],e[1]),i=j(e[0],e[3]),s=n==="auto"?r>i*1.25&&j(o,t)>i?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(b=>({...b}))};let c=ye(e,t),{p0:u,p1:y,p2:a,p3:f}=c;if(s==="tapered")return{mode:s,outline:[T(u,_(F(y,u),.14)),T(u,_(F(y,u),1-.14)),a,f]};let{nearPath:l,farPath:p}=xe(c);return{mode:s,outline:[...U(l),...U(p).slice(1)]}}function Ze(e,t,n,o){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let r=ye(e,t),{p0:i,p1:s,p2:c,p3:u}=r,y=o==="bezier"?xe(r):null,a=y?U(y.nearPath):null,f=y?U(y.farPath).reverse():null,l=Math.min(.055,.18/(n+1));return Array.from({length:n},(p,b)=>{let m=(b+1)/(n+1),d=m-l/2,h=m+l/2;return a&&f?[...me(a,d,h),...me(f,d,h).reverse()]:[L(i,s,d),L(i,s,h),L(u,c,h),L(u,c,d)]})}var rn=40,sn=1200,cn=.8,an=3,ln=-2,un=20,fn=.1,dn=40,hn=40,pe=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Je(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/pe(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let c of i.split(/\s+/)){let u=c.length;s&&s+1+u<=o?s+=1+u:(r+=Math.max(1,Math.ceil(u/o)),s=u%o)}}return Math.max(1,r)}function V(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(c=>c.length))*pe(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=Je(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}function et(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,s=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-(t.x+s*o),e.y-(t.y+s*r))}function ge(e,t){let n=1/0;for(let o of t)if(!(o.length<2))for(let r=0,i=o.length-1;r<o.length;i=r++){let s=et(e,o[i],o[r]);s<n&&(n=s)}return n}function be(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,u=t[r].y;s>e.y!=u>e.y&&e.x<(c-i)*(e.y-s)/(u-s)+i&&(n=!n)}return n}function tt(e,t,n){let o=be(e,t)&&!n.some(i=>be(e,i)),r=ge(e,[t,...n]);return o?r:-r}function D(e,t,n,o,r){let i=tt({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var q=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let o=n.length-1;for(;o>0;){let r=o-1>>1;if(n[r].max>=n[o].max)break;[n[r],n[o]]=[n[o],n[r]],o=r}}pop(){let t=this.items,n=t[0],o=t.pop();if(t.length&&o){t[0]=o;let r=0;for(;;){let i=r*2+1,s=i+1,c=r;if(i<t.length&&t[i].max>t[c].max&&(c=i),s<t.length&&t[s].max>t[c].max&&(c=s),c===r)break;[t[c],t[r]]=[t[r],t[c]],r=c}}return n}};function Q(e){if(e.length<3)return 0;let t=0;for(let n=0,o=e.length-1;n<e.length;o=n++)t+=(e[o].x+e[n].x)*(e[o].y-e[n].y);return Math.abs(t)/2}function nt(e,t){return Math.max(0,Q(e)-(t??[]).reduce((n,o)=>n+Q(o),0))}function Z(e,t){let n=t??[];if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let m=e.reduce((h,g)=>h+g.x,0)/e.length,d=e.reduce((h,g)=>h+g.y,0)/e.length;return{point:{x:m,y:d},radius:0}}let o=1/0,r=1/0,i=-1/0,s=-1/0;for(let m of e)m.x<o&&(o=m.x),m.y<r&&(r=m.y),m.x>i&&(i=m.x),m.y>s&&(s=m.y);let c=i-o,u=s-r,y=Math.min(c,u);if(!(y>0))return{point:{x:(o+i)/2,y:(r+s)/2},radius:0};let a=Math.max(c,u)/150,f=new q,l=y/2;for(let m=o;m<i;m+=y)for(let d=r;d<s;d+=y)f.push(D(m+l,d+l,l,e,n));let p=D(o+c/2,r+u/2,0,e,n),b=0;for(;f.size;){let m=f.pop();if(!m)break;m.d>p.d&&(p=m),!(m.max-p.d<=a)&&(b>=4e3||(b+=1,l=m.h/2,f.push(D(m.x-l,m.y-l,l,e,n)),f.push(D(m.x+l,m.y-l,l,e,n)),f.push(D(m.x-l,m.y+l,l,e,n)),f.push(D(m.x+l,m.y+l,l,e,n))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function k(e,t,n){return e<t?t:e>n?n:e}var pn=Math.PI*2;function Me(e,t,n){return ot(e,r=>({x:r.x+t,y:r.y+n}))}function ot(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}var bn=4/3;function rt(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],s=e[r+1],c=Math.hypot(s.x-i.x,s.y-i.y);if(c<=0)continue;let u=Math.max(1,Math.round(c/n)),y=c/u,a=Math.atan2(s.y-i.y,s.x-i.x),f=r===0,p=(r>0?t[r-1]:void 0)==="break"?2:1,b=f?{...i}:{x:i.x+Math.cos(a)*y*p,y:i.y+Math.sin(a)*y*p},m=f?u+1:Math.max(1,u-(p-1));o.push({origin:b,rotation:a*180/Math.PI,seatCount:m,seatSpacing:y})}return o}function it(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(o,r)=>({x:e.origin.x+n.x*r*e.seatSpacing,y:e.origin.y+n.y*r*e.seatSpacing}))}function st(e){return e.reduce((t,n)=>t+n.seatCount,0)}function J(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((l,p)=>l.segmentedRow.componentIndex-p.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,c=i[0]?.segmentedRow;if(!c||!(s>=2&&i.length===s&&c?.boundaryBefore==="start"&&i.every((l,p)=>l.segmentedRow?.kind==="segmented-row-v1"&&l.segmentedRow.groupId===o&&l.segmentedRow.componentCount===s&&l.segmentedRow.componentIndex===p&&l.segmentedRow.repeatLabelOnComponents===c.repeatLabelOnComponents&&(p===0?l.segmentedRow.boundaryBefore==="start":l.segmentedRow.boundaryBefore!=="start")&&l.segmentedRow.displayLabel===c.displayLabel)))continue;let y=i.reduce((l,p)=>l+p.seatCount,0),a=0,f=0;for(let l of i)l.segmentedRow.boundaryBefore==="break"&&(a+=1),t.set(l.id,{groupId:o,adjacencyOffset:a,displayOffset:f,displayLabel:c.displayLabel,totalSeats:y,canonical:i[0],viewFromSeatUrl:c.viewFromSeatUrl,viewFromSeatMeta:c.viewFromSeatMeta,confidenceEvidence:c.confidenceEvidence}),a+=l.seatCount,f+=l.seatCount}return t}var ct="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var at="abcdefghijklmnopqrstuvwxyz";function lt(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function ee(e,t=!1){let n=t?at:ct;return lt(Math.max(0,Math.floor(e)-1),n)}var ut=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Se(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of ut)for(;t>=o;)n+=r,t-=o;return n}function ft(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function te(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",c=e.seatNumbering?.endAt,u=e.seatCount;if(i==="updown"||i==="updown-descending"){let p=Math.ceil(u/2),b=i==="updown"?t<p?n+2*t:n-1+2*(u-t):t<p?n+2*(p-1-t):n+1+2*(t-p);return`${s}${b}`}let y=i==="odd"||i==="even"?2:r,a=c!=null&&Number.isFinite(c)?c-(u-1)*y:n,f=o==="center"?ft(u)[t]:o==="rtl"?u-1-t:t,l;switch(i){case"odd":{let p=a%2===1?a:a+1;l=String(p+f*2);break}case"even":{let p=a%2===0?a:a+1;l=String(p+f*2);break}case"roman":l=Se(a+f*r);break;case"letters-upper":l=ee(a+f*r,!1);break;case"letters-lower":l=ee(a+f*r,!0);break;default:l=String(a+f*r);break}return`${s}${l}`}function dt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function we(e,t,n){return n?.label??`${e.label}-${te(e,t)}`}function ne(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(!n)return`${e.displayLabel??e.label}-${te(e,t)}`;let r=dt(n),i=n.displayOffset+t;return`${n.displayLabel}-${te(r,i)}`}var X=.02291666666666667,vn=1/X,ht=58,mt=ht*X;var yt=3,Pe=0,oe=120,xt=0,pt=45,bt=7,B=1.2;function re(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function gt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=bt?e:yt}function ve(e,t={}){let n=re(t.floorBaseHeightM,Pe,oe,0),o=Math.min(oe,n+gt(e.elevation)*mt),r=e.height===void 0?o:re(e.height,Pe,oe,o),i=re(e.rake,xt,pt,0);return{height:r,rake:i}}function Ie(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function Ce(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],s=e[r+1],c=s.x-i.x,u=s.y-i.y,y=c*c+u*u,a=y>1e-12?((t-i.x)*c+(n-i.y)*u)/y:0;a<0?a=0:a>1&&(a=1);let f=Math.hypot(t-(i.x+a*c),n-(i.y+a*u));f<o&&(o=f)}return o}function Mt(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function Ee(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ie(e,t){let n=1/0;for(let o of Ie(e)){let r=Ce(t,o.x,o.y);r<n&&(n=r)}for(let o of Ie(t)){let r=Ce(e,o.x,o.y);r<n&&(n=r)}return n}function St(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let a of e)n+=a.x,o+=a.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let a of e){let f=Math.hypot(a.x-n,a.y-o);f>r&&(r=f,i=a)}let s=i.x-n,c=i.y-o,u=Math.hypot(s,c);u>1e-9?(s/=u,c/=u):(s=1,c=0);let y=e.map((a,f)=>({p:a,i:f,t:(a.x-n)*s+(a.y-o)*c})).sort((a,f)=>a.t-f.t);return{pts:y.map(a=>a.p),seatIndices:y.map(a=>t[a.i])}}function wt(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let g of e)n+=g.x,o+=g.y;n/=t,o/=t;let r=0,i=0,s=0,c=0,u=0,y=0,a=0;for(let g of e){let x=g.x-n,M=g.y-o;r+=x*x,s+=M*M,i+=x*M,c+=x*x*x,u+=M*M*M,y+=x*M*M,a+=M*x*x}let f=r*s-i*i;if(Math.abs(f)<1e-9)return null;let l=(c+y)/2,p=(u+a)/2,b=(l*s-p*i)/f,m=(p*r-l*i)/f,d=b+n,h=m+o;return!Number.isFinite(d)||!Number.isFinite(h)?null:{cx:d,cy:h}}var Pt=.15;function vt(e){if(e.length<2)return null;let t=e.map(g=>{let x=0,M=0;for(let P of g.pts)x+=P.x,M+=P.y;return{x:x/g.pts.length,y:M/g.pts.length}}),n=0,o=0;for(let g of t)n+=g.x,o+=g.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let g of t){let x=g.x-n,M=g.y-o;r+=x*x,i+=x*M,s+=M*M}let c=r+s,u=r*s-i*i,y=c/2+Math.sqrt(Math.max(0,c*c/4-u)),a,f;Math.abs(i)>1e-12?(a=y-s,f=i):r>=s?(a=1,f=0):(a=0,f=1);let l=Math.hypot(a,f);if(!(l>1e-12))return null;a/=l,f/=l;let p=1/0,b=-1/0,m=[];for(let g of e){let x=1/0,M=-1/0;for(let P of g.pts){let S=P.x*a+P.y*f;S<x&&(x=S),S>M&&(M=S),S<p&&(p=S),S>b&&(b=S)}m.push(M-x)}let d=b-p;return d>1e-9?(m.sort((g,x)=>g-x),m[Math.min(m.length-1,Math.floor(m.length*.9))]/d<=It?{x:a,y:f}:null):null}var It=.35;function Oe(e,t,n,o){let r=new Map;for(let d of n){let h=t[d],g=h.rowId||`__seat-${d}`,x=r.get(g);x||(x={pts:[],idx:[]},r.set(g,x)),x.pts.push({x:h.x,y:h.y}),x.idx.push(d)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[d,h]of r){let g=St(h.pts,h.idx),x=0;for(let M of g.pts)x+=Math.hypot(M.x-o.x,M.y-o.y);i.push({id:d,pts:g.pts,seatIndices:g.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/g.pts.length})}let s=i.map(d=>Mt(d.pts)),c=[];for(let d=0;d<i.length;d++){let h=1/0;for(let g=0;g<i.length;g++){if(d===g||Ee(s[d],s[g])>=h)continue;let x=ie(i[d].pts,i[g].pts);x<h&&(h=x)}Number.isFinite(h)&&c.push(h)}c.sort((d,h)=>d-h);let u=c.length?c[Math.floor(c.length/2)]:1,y=Math.max(u*1.8,1e-6),a=i.map(()=>[]);for(let d=0;d<i.length;d++)for(let h=d+1;h<i.length;h++)Ee(s[d],s[h])>y||ie(i[d].pts,i[h].pts)<=y&&(a[d].push(h),a[h].push(d));let f=0;for(let d=0;d<i.length;d++){if(i[d].blockId!==-1)continue;let h=f++,g=[d];for(i[d].blockId=h;g.length;){let x=g.pop();for(let M of a[x])i[M].blockId===-1&&(i[M].blockId=h,g.push(M))}}let l=new Map;for(let d of i){let h=l.get(d.blockId)??[];h.push(d),l.set(d.blockId,h)}let p=[];for(let d of i){if(d.pts.length<4)continue;let h=wt(d.pts);h&&(!Number.isFinite(h.cx)||!Number.isFinite(h.cy)||p.push({x:h.cx,y:h.cy}))}let b=p.length>=2?(()=>{let d=p.map(x=>x.x).sort((x,M)=>x-M),h=p.map(x=>x.y).sort((x,M)=>x-M),g=Math.floor(p.length/2);return{cx:d[g],cy:h[g]}})():null;if(b){let d=S=>Math.hypot(S.x-b.cx,S.y-b.cy),h=1/0,g=-1/0,x=[];for(let S of i){let w=1/0,E=-1/0;for(let C of S.pts){let I=d(C);I<w&&(w=I),I>E&&(E=I)}x.push(E-w),w<h&&(h=w),E>g&&(g=E)}let M=g-h;x.sort((S,w)=>S-w);let P=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(M>1e-9&&P/M<=Pt){let S=i.map(v=>{let O=0;for(let R of v.pts)O+=d(R);return{row:v,radius:O/v.pts.length}}),w=1/0;for(let v of S)v.radius<w&&(w=v.radius);S.sort((v,O)=>v.radius-O.radius);let E=-1,C=-1/0,I=M/Math.max(1,S.length)*.5,A=[];for(let v of S)v.radius-C>I&&(E++,C=v.radius),v.row.ordinal=E,v.row.blockDepth=v.radius-w,A.push(v.row);return{sectionId:e,rows:A,blockCount:f}}}let m=[];for(let[,d]of l){let h=vt(d);if(h){let g=M=>{let P=0;for(let S of M.pts)P+=S.x*h.x+S.y*h.y;return P/M.pts.length};d.sort((M,P)=>g(M)-g(P));let x=0;for(let M=0;M<d.length;M++)M>0&&(x+=ie(d[M-1].pts,d[M].pts)),d[M].ordinal=M,d[M].blockDepth=x,m.push(d[M])}else{let g=1/0;for(let x of d)x.focalDistance<g&&(g=x.focalDistance);d.sort((x,M)=>x.focalDistance-M.focalDistance);for(let x=0;x<d.length;x++)d[x].ordinal=x,d[x].blockDepth=Math.max(0,d[x].focalDistance-g),m.push(d[x])}}return{sectionId:e,rows:m,blockCount:f}}function _e(e){return e?e.accessibility&&e.accessibility.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var z=Math.PI/180,Ct=9,N=16;function ce(e,t,n,o){let r=n*z,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function le(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return W(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let y=0;y<t;y++)s.push(ce(y*n,0,r,i));return s}let c=o/(t-1)*z,u=n/(2*Math.sin(Math.abs(c)/2));for(let y=0;y<t;y++){let a=y*c,f=u*Math.sin(a),l=-u+u*Math.cos(a);s.push(ce(f,l,r,i))}return s}function Et(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Ot(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function ke(e,t){let n=Et(e);return le(e).map((o,r)=>{let i=n.get(r),s=_e(i),c=we(e,r,i),u={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:c,displayLabel:ne(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(u).some(y=>y!==void 0&&y!==!1&&y!=="")?u:void 0,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function ue(e){let t=[];for(let n of ke(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function Le(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function fe(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(a=>[a.index,a])),r=(a,f,l,p)=>{let b=o.get(a),m=_e(b),d=b?.label??`${e.label}-${a+1}`,h=e.displayLabel??e.label;return{index:a,label:d,displayLabel:b?.displayLabel??`${h}-${a+1}`,x:f+(b?.dx??0),y:l+(b?.dy??0),categoryKey:b?.categoryKey??e.categoryKey,skipped:!!b?.skip,accessible:m.length>0,accessibility:m,wheelchairSpaceType:b?.wheelchairSpaceType,commercial:b?.commercial,viewUrl:b?.viewFromSeatUrl,viewMeta:b?.viewFromSeatUrl?b.viewFromSeatMeta:void 0,labelStyle:b?.labelStyle,...p?{side:p}:{}}};if(e.shape==="round"){let a=(e.radius??40)+N,f=e.rotation*z,l=Math.max(0,Math.min(360,e.seatArc??360));if(l>=360||n===1){for(let d=0;d<n;d++){let h=f+d/n*2*Math.PI;t.push(r(d,e.center.x+a*Math.cos(h),e.center.y+a*Math.sin(h)))}return t}let p=l*z,b=(2*Math.PI-p)/2,m=f+b;for(let d=0;d<n;d++){let h=m+d/(n-1)*p;t.push(r(d,e.center.x+a*Math.cos(h),e.center.y+a*Math.sin(h)))}return t}let i=e.width??80,s=e.height??50,c=Le(e),u=["top","bottom","left","right"],y=0;for(let a of u){let f=c[a];for(let l=0;l<f;l++){let p,b;a==="top"?(p=-i/2+(l+.5)*i/f,b=-s/2-N):a==="bottom"?(p=-i/2+(l+.5)*i/f,b=s/2+N):a==="left"?(p=-i/2-N,b=-s/2+(l+.5)*s/f):(p=i/2+N,b=-s/2+(l+.5)*s/f);let m=ce(p,b,e.rotation,e.center);t.push(r(y++,m.x,m.y,a))}}return t}function Rt(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):fe(e).filter(t=>!t.skipped).length}function je(e){return fe(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function De(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function ae(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,c=t[r].x,u=t[r].y;s>e.y!=u>e.y&&e.x<(c-i)*(e.y-s)/(u-s)+i&&(n=!n)}return n}function At(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),c=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=c+1e-7})}function Y(e,t,n){return ae(e,t)&&!(n??[]).some(o=>ae(e,o)||At(e,o))}function Tt(e,t){return Z(e,t).point}function se(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Ne(e){switch(e.type){case"row":{let t=ue(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return se(e.points);case"section":return se(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?se(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function Re(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function _t(e,t){if(e.type!=="gaArea"||!Re(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>Re(r,o[i]))}function Fe(e,t){let n=e.filter(s=>s.type==="section"),o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,r=Ne(t);return(o?n.find(s=>(s.logicalSectionId??s.id)===o&&(_t(t,s)||Y(r,s.outline,s.holes))):void 0)??n.find(s=>Y(r,s.outline,s.holes))}function He(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function kt(e,t){let n=He(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function Ue(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function de(e,t,n){let o=i=>({x:i.x+t,y:i.y+n}),r=i=>i.map(o);switch(e.type){case"row":return{...e,origin:o(e.origin)};case"table":case"booth":return{...e,center:o(e.center)};case"gaArea":return{...e,points:r(e.points),...e.holes?{holes:e.holes.map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:Me(e.outlinePath,t,n)}:{},...e.holes?{holes:e.holes.map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function Lt(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((o,r)=>{let i=-r*t;for(let s of o.objects)n.push(i===0?s:de(s,0,i))}),{...e,objects:n,floors:void 0}}function jt(e){let t=e.floors;if(!t||t.length<2)return e;let n=Xe(e),o=[];return t.forEach((r,i)=>{let{x:s,y:c}=n[i];for(let u of r.objects)o.push(de(u,s,c))}),{...e,objects:o,floors:void 0,referenceImage:void 0,backgroundImage:void 0}}function Xe(e){let t=e.floors;if(!t?.length)return[{x:0,y:0}];if(t.length<2)return t.map(()=>({x:0,y:0}));let n=t.map(l=>Be({...e,objects:l.objects,floors:void 0,focalPoint:l.focalPoint,referenceImage:void 0,backgroundImage:void 0})),o=Math.max(1,...n.map(l=>Math.max(l.width,l.height))),r=Math.max(64,Math.min(240,o*.08)),i=16/10,s=null;for(let l=1;l<=t.length;l+=1){let p=Math.ceil(t.length/l),b=new Array(l).fill(0),m=new Array(p).fill(0);n.forEach((M,P)=>{let S=P%l,w=Math.floor(P/l);b[S]=Math.max(b[S],M.width),m[w]=Math.max(m[w],M.height)});let d=b.reduce((M,P)=>M+P,0)+r*(l-1),h=m.reduce((M,P)=>M+P,0)+r*(p-1),g=l*p-t.length,x=Math.abs(Math.log(d/Math.max(1,h)/i))+g*.04;(!s||x<s.score)&&(s={columns:l,columnWidths:b,rowHeights:m,score:x})}let{columns:c,columnWidths:u,rowHeights:y}=s,a=[],f=[];return u.reduce((l,p,b)=>(a[b]=l,l+p+r),0),y.reduce((l,p,b)=>(f[b]=l,l+p+r),0),t.map((l,p)=>{let b=n[p],m=p%c,d=Math.floor(p/c),h=a[m]+(u[m]-b.width)/2,g=f[d]+(y[d]-b.height)/2;return{x:h-b.x,y:g-b.y}})}function Ae(e,t,n,o,r,i){let s=[],c=J(e),u=f=>!f?.eventConfigurationId||f.eventConfigurationId===o,y=f=>!!f&&(!f.eventConfigurationId||f.eventConfigurationId===o),a=(f,l)=>y(f)?{...f,coverage:l}:void 0;for(let f of e){let l=[];if(f.type==="row"?l=ue(f):f.type==="table"?l=je(f):f.type==="booth"&&(l=De(f)),!l.length)continue;for(let h of l)h.viewUrl&&!u(h.viewMeta)&&(h.viewUrl=void 0,h.viewMeta=void 0);if(f.type==="row"){let h=c.get(f.id);if(h){let g=new Map((f.overrides??[]).map(x=>[x.index,x]));for(let x of l){let M=Number(x.id.slice(x.id.lastIndexOf(":")+1));if(!Number.isInteger(M))continue;x.logicalRowId=h.groupId,x.logicalSeatIndex=h.adjacencyOffset+M,g.get(M)?.displayLabel||(x.displayLabel=ne(f,M,h)),!x.viewUrl&&h.viewFromSeatUrl&&u(h.viewFromSeatMeta)&&(x.viewUrl=h.viewFromSeatUrl,x.viewMeta=h.viewFromSeatMeta);let P=g.get(M)?.confidenceEvidence;x.confidenceEvidence=a(P,"exact-seat")??a(f.confidenceEvidence,"row-representative")??a(h.confidenceEvidence,"row-representative")}}}let p=Fe(e,f),b=p?.viewFromSeatUrl,d=(p?.zone?t?.find(h=>h.id===p.zone):void 0)?.focalPoint??n;for(let h of l){if(!h.confidenceEvidence){let g=Number(h.id.slice(h.id.lastIndexOf(":")+1)),x=(f.type==="row"||f.type==="table")&&Number.isInteger(g)?f.overrides?.find(M=>M.index===g)?.confidenceEvidence:void 0;h.confidenceEvidence=a(x,"exact-seat")??(f.type==="row"?a(f.confidenceEvidence,"row-representative"):void 0)}h.confidenceEvidence??=a(p?.confidenceEvidence,"section-representative")??(i?a(i.evidence,i.coverage):void 0),!h.viewUrl&&b&&u(p?.viewFromSeatMeta)&&(h.viewUrl=b,h.viewMeta=p?.viewFromSeatMeta),!h.viewUrl&&r&&u(r.meta)&&(h.viewUrl=r.url,h.viewMeta=r.meta),p&&(h.sectionId=p.logicalSectionId??p.id),p?.zone&&(h.zoneId=p.zone),d&&(h.focalPoint={...d})}s.push(...l)}return s}function Dt(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,s=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,c=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,u=Ae(r.objects,e.zones,i,e.eventConfigurationId,s,c);t.resolveEyeHeights!==!1&&Te(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,u),o.push(...u)}return o}let n=Ae(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0);return t.resolveEyeHeights!==!1&&Te(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),n}function Te(e,t,n,o){let r=e.filter(a=>a.type==="section"),i=n>0||r.some(a=>a.height!==void 0||a.rake!==void 0||(a.elevation??0)>0);if(!r.length||!i||!t){for(let a of o)a.eyeHeightM=n+B;return}let s=new Array(o.length),c=new Map,u=new Map;for(let a=0;a<o.length;a++){let f=o[a],l=r.find(b=>Y({x:f.x,y:f.y},b.outline,b.holes))??null;if(s[a]=l,!l)continue;c.has(l.id)||c.set(l.id,ve(l,{floorBaseHeightM:n}));let p=u.get(l.id);p?p.push(a):u.set(l.id,[a])}let y=new Array(o.length).fill(void 0);for(let[a,f]of u){let l=c.get(a);if(!l)continue;let p=l.rake>0?Math.tan(l.rake*Math.PI/180):0,b=Oe(a,o,f,t);for(let m of b.rows){let d=m.blockDepth*X*p,h=l.height+d;for(let g of m.seatIndices)y[g]=h}}for(let a=0;a<o.length;a++){let f=o[a],l=s[a];if(!l){f.eyeHeightM=n+B;continue}let p=c.get(l.id);f.eyeHeightM=(y[a]??p.height)+B}}var G=40;function Be(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=(s,c)=>{s<t&&(t=s),c<n&&(n=c),s>o&&(o=s),c>r&&(r=c)};for(let s of Ue(e))if(s.type==="row"){let c=new Map((s.overrides??[]).map(u=>[u.index,u]));le(s).forEach((u,y)=>{let a=c.get(y);a?.skip||i(u.x+(a?.dx??0),u.y+(a?.dy??0))})}else if(s.type==="gaArea")for(let c of s.points)i(c.x,c.y);else if(s.type==="section")for(let c of s.outline)i(c.x,c.y);else if(s.type==="decorImage")i(s.x,s.y),i(s.x+s.width,s.y+s.height);else if(s.type==="shape")if(s.points&&s.points.length)for(let c of s.points)i(c.x,c.y);else s.x!=null&&s.y!=null&&s.width!=null&&s.height!=null&&(i(s.x,s.y),i(s.x+s.width,s.y+s.height));else if(s.type==="table"){let c=N+Ct,u=s.shape==="round"?(s.radius??40)+c:Math.max((s.width??80)/2,(s.height??50)/2)+c;i(s.center.x-u,s.center.y-u),i(s.center.x+u,s.center.y+u)}else if(s.type==="booth"){let c=Math.max(s.width,s.height)/2;i(s.center.x-c,s.center.y-c),i(s.center.x+c,s.center.y+c)}else if(s.type==="text"){let c=V(s);i(s.position.x,s.position.y),i(s.position.x+c.width,s.position.y+c.height)}for(let s of[e.referenceImage,e.backgroundImage]){if(!s)continue;let{center:c,width:u}=s,y=u*3/4;i(c.x-u/2,c.y-y/2),i(c.x+u/2,c.y+y/2)}if(!isFinite(t)){let s=e.focalPoint??{x:0,y:0};return{x:s.x-200,y:s.y-200,width:400,height:400}}return{x:t-G,y:n-G,width:o-t+G*2,height:r-n+G*2}}function Nt(e,t=0){let n=Math.max(1,e.width,e.height),o={x:e.x+e.width/2,y:e.y+e.height/2},r=n*1.55,i=Math.max(n*.82,Math.max(0,t)+n*.45);return{target:o,distance:r,height:i,focalLength:Math.hypot(r,i),yawRad:-8*Math.PI/180}}function K(e,t,n=0){let o=t.x-e.target.x,r=t.y-e.target.y,i=Math.cos(e.yawRad),s=Math.sin(e.yawRad),c=o*i-r*s,y=o*s+r*i-e.distance,a=n-e.height,f=Math.hypot(e.distance,e.height),l=(-e.distance*y-e.height*a)/f,p=(-e.height*y+e.distance*a)/f,b=Math.max(f*.08,l),m=e.focalLength/b;return{x:e.target.x+c*m,y:e.target.y-p*m,depth:b,scale:m}}function Ft(e,t){return{x:e.a*t.x+e.c*t.y+e.e,y:e.b*t.x+e.d*t.y+e.f}}function Ht(e){let t=e.a*e.d-e.b*e.c;if(!Number.isFinite(t)||Math.abs(t)<1e-9)throw new Error("perspective projection produced a singular affine");let n=e.d/t,o=-e.b/t,r=-e.c/t,i=e.a/t;return{a:n,b:o,c:r,d:i,e:-(n*e.e+r*e.f),f:-(o*e.e+i*e.f)}}function Ut(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}}function Xt(e,t,n=()=>0){let o=K(e,t,n(t)),r={x:t.x+1,y:t.y},i={x:t.x,y:t.y+1},s=K(e,r,n(r)),c=K(e,i,n(i)),u=s.x-o.x,y=s.y-o.y,a=c.x-o.x,f=c.y-o.y;return{a:u,b:y,c:a,d:f,e:o.x-u*t.x-a*t.y,f:o.y-y*t.x-f*t.y}}function Bt(e){let t=Math.hypot(e.a,e.b),n=e.a*e.d-e.b*e.c;return{rotationDeg:Math.atan2(e.b,e.a)*180/Math.PI,scaleX:t,scaleY:n/Math.max(t,1e-9),skewX:(e.a*e.c+e.b*e.d)/Math.max(n,1e-9)}}var Ge=9;function Gt(e){if(e.kind==="circle")return{hx:e.r,hy:e.r};let t=e.width/2,n=e.height/2,o=e.rotation??0;if(!o)return{hx:t,hy:n};let r=o*Math.PI/180,i=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r));return{hx:t*i+n*s,hy:t*s+n*i}}function zt(e,t,n){let o=t-e.seat.x,r=n-e.seat.y;if(e.shape.kind==="circle")return o*o+r*r<=e.shape.r*e.shape.r;let i=e.shape.rotation??0,s=o,c=r;if(i){let u=-i*Math.PI/180,y=Math.cos(u),a=Math.sin(u);s=o*y-r*a,c=o*a+r*y}return Math.abs(s)<=e.shape.width/2&&Math.abs(c)<=e.shape.height/2}function Yt(e,t,n,o,r){if(e.shape.kind==="circle"){let b=Math.min(Math.max(e.seat.x,t),o),m=Math.min(Math.max(e.seat.y,n),r),d=e.seat.x-b,h=e.seat.y-m;return d*d+h*h<=e.shape.r*e.shape.r}let i=e.shape.rotation??0;if(!i)return e.seat.x-e.hx<=o&&e.seat.x+e.hx>=t&&e.seat.y-e.hy<=r&&e.seat.y+e.hy>=n;let s=i*Math.PI/180,c=Math.cos(s),u=Math.sin(s),y=e.shape.width/2,a=e.shape.height/2,f=[[-y,-a],[y,-a],[y,a],[-y,a]].map(([b,m])=>[e.seat.x+b*c-m*u,e.seat.y+b*u+m*c]),l=[[t,n],[o,n],[o,r],[t,r]],p=[[1,0],[0,1],[c,u],[-u,c]];for(let[b,m]of p){let d=1/0,h=-1/0;for(let[M,P]of f){let S=M*b+P*m;S<d&&(d=S),S>h&&(h=S)}let g=1/0,x=-1/0;for(let[M,P]of l){let S=M*b+P*m;S<g&&(g=S),S>x&&(x=S)}if(h<g||x<d)return!1}return!0}function Kt(e,t={}){let n=t.seatRadius??Ge,o=e.length,r=new Array(o),i=1/0,s=1/0,c=-1/0,u=-1/0,y=0;for(let S=0;S<o;S++){let w=e[S],E=t.shapeOf?.(w)??{kind:"circle",r:n},{hx:C,hy:I}=Gt(E);r[S]={seat:w,shape:E,hx:C,hy:I},w.x-C<i&&(i=w.x-C),w.y-I<s&&(s=w.y-I),w.x+C>c&&(c=w.x+C),w.y+I>u&&(u=w.y+I),C>y&&(y=C),I>y&&(y=I)}o===0&&(i=0,s=0,c=0,u=0);let a=y>0?y*4:1,f=Math.max(c-i,0),l=Math.max(u-s,0),p=Math.max(64,t.maxCells??o*4),b=a,m=Math.max(1,Math.ceil(f/b)||1),d=Math.max(1,Math.ceil(l/b)||1);for(;m*d>p&&(m>1||d>1);)b*=2,m=Math.max(1,Math.ceil(f/b)||1),d=Math.max(1,Math.ceil(l/b)||1);let h=m*d,g=new Int32Array(h+1),x=0;for(let S=0;S<o;S++){let w=r[S],E=k(Math.floor((w.seat.x-w.hx-i)/b),0,m-1),C=k(Math.floor((w.seat.x+w.hx-i)/b),0,m-1),I=k(Math.floor((w.seat.y-w.hy-s)/b),0,d-1),A=k(Math.floor((w.seat.y+w.hy-s)/b),0,d-1);for(let v=I;v<=A;v++)for(let O=E;O<=C;O++)g[v*m+O+1]++,x++}for(let S=0;S<h;S++)g[S+1]+=g[S];let M=new Int32Array(x),P=g.slice(0,h);for(let S=0;S<o;S++){let w=r[S],E=k(Math.floor((w.seat.x-w.hx-i)/b),0,m-1),C=k(Math.floor((w.seat.x+w.hx-i)/b),0,m-1),I=k(Math.floor((w.seat.y-w.hy-s)/b),0,d-1),A=k(Math.floor((w.seat.y+w.hy-s)/b),0,d-1);for(let v=I;v<=A;v++)for(let O=E;O<=C;O++){let R=v*m+O;M[P[R]++]=S}}return{seats:e,entries:r,minX:i,minY:s,cell:b,cols:m,rows:d,cellStart:g,items:M,stamp:new Int32Array(o),epoch:0}}function $t(e,t,n={}){let{cols:o,rows:r,cell:i,minX:s,minY:c,cellStart:u,items:y,entries:a}=e,f=Math.floor((t.x-s)/i),l=Math.floor((t.y-c)/i);if(f<0||l<0||f>=o||l>=r)return null;let p=l*o+f,b=u[p+1],m=-1,d=1/0;for(let h=u[p];h<b;h++){let g=y[h],x=a[g];if(n.filter&&!n.filter(x.seat.id,x.seat)||!zt(x,t.x,t.y))continue;let M=t.x-x.seat.x,P=t.y-x.seat.y,S=M*M+P*P;(S<d||S===d&&g<m)&&(d=S,m=g)}return m<0?null:a[m].seat.id}function Wt(e,t,n,o={}){if(!(n>0))return null;let{cols:r,rows:i,cell:s,minX:c,minY:u,cellStart:y,items:a,entries:f}=e,l=Math.max(0,Math.floor((t.x-n-c)/s)),p=Math.min(r-1,Math.floor((t.x+n-c)/s)),b=Math.max(0,Math.floor((t.y-n-u)/s)),m=Math.min(i-1,Math.floor((t.y+n-u)/s));if(l>p||b>m)return null;let d=-1,h=n*n,g=e.stamp,x=++e.epoch;for(let M=b;M<=m;M++){let P=M*r;for(let S=l;S<=p;S++){let w=P+S,E=y[w+1];for(let C=y[w];C<E;C++){let I=a[C];if(g[I]===x)continue;g[I]=x;let A=f[I];if(o.filter&&!o.filter(A.seat.id,A.seat))continue;let v=t.x-A.seat.x,O=t.y-A.seat.y,R=v*v+O*O;(R<h||R===h&&I<d)&&(h=R,d=I)}}}return d<0?null:f[d].seat.id}function Vt(e,t,n={}){let o=Math.min(t.x,t.x+t.width),r=Math.max(t.x,t.x+t.width),i=Math.min(t.y,t.y+t.height),s=Math.max(t.y,t.y+t.height),c=n.mode??"center",{cols:u,rows:y,cell:a,minX:f,minY:l,cellStart:p,items:b,entries:m}=e,d=Math.max(0,Math.floor((o-f)/a)),h=Math.min(u-1,Math.floor((r-f)/a)),g=Math.max(0,Math.floor((i-l)/a)),x=Math.min(y-1,Math.floor((s-l)/a));if(d>h||g>x)return[];let M=[],P=e.stamp,S=++e.epoch;for(let w=g;w<=x;w++){let E=w*u;for(let C=d;C<=h;C++){let I=E+C,A=p[I+1];for(let v=p[I];v<A;v++){let O=b[v];if(P[O]===S)continue;P[O]=S;let R=m[O];if(n.filter&&!n.filter(R.seat.id,R.seat))continue;(c==="center"?R.seat.x>=o&&R.seat.x<=r&&R.seat.y>=i&&R.seat.y<=s:Yt(R,o,i,r,s))&&M.push(O)}}}return M.sort((w,E)=>w-E),M.map(w=>m[w].seat.id)}function qt(e){let t=e.cols*e.rows,n=0,o=0;for(let i=0;i<t;i++){let s=e.cellStart[i+1]-e.cellStart[i];s>0&&n++,s>o&&(o=s)}let r=e.items.length;return{cell:e.cell,cols:e.cols,rows:e.rows,cells:t,occupiedCells:n,refs:r,maxPerCell:o,meanPerOccupiedCell:n?r/n:0}}0&&(module.exports={DEFAULT_SEAT_RADIUS,TEXT_BACKGROUND_PADDING_MAX,TEXT_BACKGROUND_RADIUS_MAX,TEXT_LETTER_SPACING_MAX,TEXT_LETTER_SPACING_MIN,TEXT_LINE_HEIGHT_MAX,TEXT_LINE_HEIGHT_MIN,TEXT_OPACITY_MIN,TEXT_WIDTH_MAX,TEXT_WIDTH_MIN,allObjects,applyAffine,buildAisleHoles,buildSeatIndex,buildSectionShell,chartBounds,composeAffine,createPerspectiveCamera,cubicPoint,decomposeAffineLinear,distanceToRings,distributeAlongCubic,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorOverviewTranslations,floorsOf,gridStats,hitTest,invertAffine,layoutFloorOverview,nearestWithin,objectCenter,owningSectionForObject,perspectiveTangentAffine,pointInPolygon,pointInPolygonWithHoles,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,projectPerspectivePoint,queryRect,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,stackFloors,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject});
|