@seatlayer/core 0.101.0 → 0.103.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/ar-D6ASWQBI.js +1 -0
- package/dist/be-T23MSCFC.js +1 -0
- package/dist/bg-2MMSY43I.js +1 -0
- package/dist/ca-EXRTYE33.js +1 -0
- package/dist/{categoryInventory-H77A_8pF.d.cts → categoryInventory-D_gpkfsq.d.cts} +1 -1
- package/dist/{categoryInventory-DZ5IcDOy.d.ts → categoryInventory-i-mGCBD3.d.ts} +1 -1
- package/dist/chunk-2STEWCI2.js +1 -0
- package/dist/chunk-33SRM2CP.js +1 -0
- package/dist/chunk-3W4ZMU4G.js +1 -0
- package/dist/chunk-76AUT55N.js +1 -0
- package/dist/chunk-B75VUM6L.js +1 -0
- package/dist/{chunk-L34T3APU.js → chunk-FAY7ARLB.js} +1 -1
- package/dist/{chunk-2RNZOV5I.js → chunk-GPZFVQXV.js} +1 -1
- package/dist/chunk-JRZHC75P.js +1 -0
- package/dist/chunk-KTMZ3QAO.js +1 -0
- package/dist/chunk-NWRHKTMV.js +1 -0
- package/dist/{chunk-5HXTEMRE.js → chunk-QG7ZFUNX.js} +1 -1
- package/dist/{chunk-GLGXP5I7.js → chunk-R2TRYVOY.js} +1 -1
- package/dist/chunk-RF4QU72N.js +1 -0
- package/dist/chunk-TFYAMLCK.js +1 -0
- package/dist/chunk-TZBJCAXH.js +1 -0
- package/dist/chunk-UEDS3HJ3.js +1 -0
- package/dist/chunk-UEYHH7Y5.js +1 -0
- package/dist/chunk-WH2EVBIG.js +1 -0
- package/dist/chunk-WKWXU5QM.js +1 -0
- package/dist/{chunk-P4J57TK6.js → chunk-YPVYZYMH.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +491 -18
- package/dist/core/chart-ops/index.d.ts +491 -18
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/color.d.cts +1 -1
- package/dist/core/color.d.ts +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +72 -5
- package/dist/core/inventory/index.d.ts +72 -5
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +63 -6
- package/dist/core/layout/index.d.ts +63 -6
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +18 -4
- package/dist/core/quality/index.d.ts +18 -4
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.cjs +1 -1
- package/dist/core/render-assets/index.d.cts +45 -5
- package/dist/core/render-assets/index.d.ts +45 -5
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/cs-L5EG7LLR.js +1 -0
- package/dist/cy-AB2Q6XHI.js +1 -0
- package/dist/da-EGJO7W4Q.js +1 -0
- package/dist/de-Q56NNVPD.js +1 -0
- package/dist/el-JW2YADAL.js +1 -0
- package/dist/es-N35HVHMD.js +1 -0
- package/dist/et-53UYPQR7.js +1 -0
- package/dist/{eventConfigurations-ClFqXQi9.d.cts → eventConfigurations-C0x_OtjQ.d.cts} +1 -1
- package/dist/{eventConfigurations-B6aS6c-_.d.ts → eventConfigurations-CDPqKz_8.d.ts} +1 -1
- package/dist/fa-JL3HW42Q.js +1 -0
- package/dist/fi-ZFWROLPU.js +1 -0
- package/dist/fr-6EKBGKIT.js +1 -0
- package/dist/he-KSOTIRJW.js +1 -0
- package/dist/hi-RWHSYCVV.js +1 -0
- package/dist/hr-ECH5LYKR.js +1 -0
- package/dist/hu-BAXHRRWC.js +1 -0
- package/dist/id-ECFNLK3G.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +65 -17
- package/dist/index.d.ts +65 -17
- package/dist/index.js +1 -1
- package/dist/it-HT57FDFI.js +1 -0
- package/dist/ja-LHVHSM5J.js +1 -0
- package/dist/ko-G2HVHBKT.js +1 -0
- package/dist/ku-MNPV6BJJ.js +1 -0
- package/dist/{labeling-ByEZkLee.d.cts → labeling-20iLar-Q.d.ts} +11 -3
- package/dist/{labeling-CP3GhUrf.d.ts → labeling-DW_pEMgl.d.cts} +11 -3
- package/dist/localeLoaders-L36RHPNS.js +1 -0
- package/dist/lt-GB2GJDNS.js +1 -0
- package/dist/lv-3ZE6IM47.js +1 -0
- package/dist/ms-YH2PYOHG.js +1 -0
- package/dist/nl-D4FX7T7U.js +1 -0
- package/dist/no-5YNLYHN4.js +1 -0
- package/dist/pl-RUXCR6JV.js +1 -0
- package/dist/pt-TKFGIUL6.js +1 -0
- package/dist/{renderedQuality--H0toc-2.d.cts → renderedQuality-BIWwSRMS.d.cts} +1 -1
- package/dist/{renderedQuality-Bo4k99GE.d.ts → renderedQuality-CdpKQidA.d.ts} +1 -1
- package/dist/{renderer-BPhSZUGh.d.cts → renderer-BSjyHBDK.d.cts} +8 -1
- package/dist/{renderer-CWbam_zr.d.ts → renderer-BurPZ2Io.d.ts} +8 -1
- package/dist/ro-UFIOIOVH.js +1 -0
- package/dist/ru-VMRD53B7.js +1 -0
- package/dist/{seatTypeIcons-CSt1isBY.d.ts → seatTypeIcons-BlEzPXFf.d.cts} +2 -2
- package/dist/{seatTypeIcons-B2tvcQ0H.d.cts → seatTypeIcons-D_T5HfJs.d.ts} +2 -2
- package/dist/{sections-C_AKwOIh.d.cts → sections-BySKMsFE.d.ts} +5 -2
- package/dist/{sections-JHox6Lsw.d.ts → sections-DXUcW0ZT.d.cts} +5 -2
- package/dist/{segmentedRowModel-DQO0vHR1.d.ts → segmentedRowModel-C5qFY6jJ.d.ts} +1 -1
- package/dist/{segmentedRowModel-CZ0Ciea-.d.cts → segmentedRowModel-CyW-LFuI.d.cts} +1 -1
- package/dist/sk-XIK2KO3F.js +1 -0
- package/dist/sl-CDZGH6C6.js +1 -0
- package/dist/sr-A3TESNV3.js +1 -0
- package/dist/sv-HKGKDGSG.js +1 -0
- package/dist/{tableSizing-ClgbhNks.d.ts → tableSizing-Bos5ueqg.d.cts} +5 -4
- package/dist/{tableSizing-Cp5T_6Lw.d.cts → tableSizing-CAiE_oii.d.ts} +5 -4
- package/dist/th-ZPGRIY7D.js +1 -0
- package/dist/{ticketRestrictions-DUdzkp4F.d.ts → ticketRestrictions-DKdJWh9u.d.cts} +39 -3
- package/dist/{ticketRestrictions-BHNbxzFT.d.cts → ticketRestrictions-DRDtAVKw.d.ts} +39 -3
- package/dist/tr-IUB54G3R.js +1 -0
- package/dist/{types-5AlKCD4j.d.ts → types-ZviQR7ch.d.cts} +194 -9
- package/dist/{types-5AlKCD4j.d.cts → types-ZviQR7ch.d.ts} +194 -9
- package/dist/uk-JQKEV42K.js +1 -0
- package/dist/vi-KRM5S2Q7.js +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +54 -54
- package/dist/view3d/index.d.cts +13 -3
- package/dist/view3d/index.d.ts +13 -3
- package/dist/view3d/index.js +44 -44
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-FEUYIOYS.js +1 -0
- package/dist/zh-Hant-PK2XOE2G.js +1 -0
- package/package.json +1 -1
- package/dist/ar-Q44JP5JY.js +0 -1
- package/dist/be-CGFFSIQL.js +0 -1
- package/dist/bg-WOYK6OLH.js +0 -1
- package/dist/ca-77ZVI3X5.js +0 -1
- package/dist/chunk-52XO3LA7.js +0 -1
- package/dist/chunk-5BMXWOE7.js +0 -1
- package/dist/chunk-5ITK5236.js +0 -1
- package/dist/chunk-5N4H3KMR.js +0 -1
- package/dist/chunk-5PFYIYM5.js +0 -1
- package/dist/chunk-CTIGUXXK.js +0 -1
- package/dist/chunk-D723OZEY.js +0 -1
- package/dist/chunk-FLZKBXHA.js +0 -1
- package/dist/chunk-HO4MFTVX.js +0 -1
- package/dist/chunk-JK3DUFRX.js +0 -1
- package/dist/chunk-N4J4CT6P.js +0 -1
- package/dist/chunk-NO6OLVTT.js +0 -1
- package/dist/chunk-TQN2VWQO.js +0 -1
- package/dist/chunk-UISTXRO5.js +0 -1
- package/dist/cs-OSBZYCSR.js +0 -1
- package/dist/cy-ZCOJW2WH.js +0 -1
- package/dist/da-2PDK6JTR.js +0 -1
- package/dist/de-R5LLVFUU.js +0 -1
- package/dist/el-ZPFVDCWA.js +0 -1
- package/dist/es-7YASJP32.js +0 -1
- package/dist/et-J4TV6KQL.js +0 -1
- package/dist/fa-4TEO7UGM.js +0 -1
- package/dist/fi-GIUDDKMH.js +0 -1
- package/dist/fr-J5J2XJLA.js +0 -1
- package/dist/he-OCEHSVUJ.js +0 -1
- package/dist/hi-EK5CTBW5.js +0 -1
- package/dist/hr-SLDTQOYC.js +0 -1
- package/dist/hu-2QNE77NO.js +0 -1
- package/dist/id-LGDAFQJK.js +0 -1
- package/dist/it-DT4Y3IYB.js +0 -1
- package/dist/ja-D5EY2XCQ.js +0 -1
- package/dist/ko-DD2NV45Q.js +0 -1
- package/dist/ku-KZCMVLBE.js +0 -1
- package/dist/localeLoaders-GGAKX22E.js +0 -1
- package/dist/lt-QWGTJ47Y.js +0 -1
- package/dist/lv-LYAIG3VK.js +0 -1
- package/dist/ms-XTF4KNGD.js +0 -1
- package/dist/nl-QEXY6XHS.js +0 -1
- package/dist/no-HCOXN2CN.js +0 -1
- package/dist/pl-BWY53TSD.js +0 -1
- package/dist/pt-2UJUBCPL.js +0 -1
- package/dist/ro-GGXOLTED.js +0 -1
- package/dist/ru-ZTFK3WCU.js +0 -1
- package/dist/sk-KU543Y2U.js +0 -1
- package/dist/sl-FT576R7A.js +0 -1
- package/dist/sr-WE3J46JE.js +0 -1
- package/dist/sv-YEAOPSEB.js +0 -1
- package/dist/th-BEBRDHJA.js +0 -1
- package/dist/tr-LOAHUPSH.js +0 -1
- package/dist/uk-2GMICSHN.js +0 -1
- package/dist/vi-TC5B6AUR.js +0 -1
- package/dist/zh-Hans-TSZWTZQY.js +0 -1
- package/dist/zh-Hant-TLB4FZYM.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-
|
|
2
|
-
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-
|
|
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-
|
|
4
|
-
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as
|
|
1
|
+
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-ZviQR7ch.cjs';
|
|
2
|
+
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-BSjyHBDK.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-D_gpkfsq.cjs';
|
|
4
|
+
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GABoxMode, b as GA_UNIT_LABEL_PREFIX, c as GroupedTableBookingMode, d as GroupedTableInventoryUnit, e as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, f as MAX_GA_CAPACITY, g as MAX_ONE_PARTY_GUESTS, N as NotForSaleSelectionIssue, O as ONE_PARTY_LIMIT_MESSAGE, R as RestrictionChartDoc, h as RestrictionSeat, T as TicketOptionApplicabilityIssue, i as TicketSelection, j as TicketSelectionIssue, k as TicketSelectionOptions, l as TicketTierResolution, m as applicableTicketTiers, n as companionSelectionIssue, o as eventInventoryLimitFor, p as gaAreasOf, q as gaBoxBounds, r as gaBoxMode, s as gaInventorySegments, t as gaUnitLabel, u as gaUnitLabels, v as gaUnitLabelsForModel, w as gaWheelchairPlaceCount, x as gaWheelchairUnitLabels, y as groupedTableInventory, z as growJoinedGAInventory, A as isFullChartDoc, B as isGaUnitLabel, E as resolveTicketTierForSeat, F as ticketOptionNotApplicableIssue, H as ticketSelectionIssue, I as ticketTierAppliesToSeat, J as validGAInventorySegments } from '../../ticketRestrictions-DKdJWh9u.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Best-available seat selection — a PURE, fully unit-testable ranking function.
|
|
@@ -19,6 +19,15 @@ export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DE
|
|
|
19
19
|
* "Best" means, in priority order:
|
|
20
20
|
* 0. (opt-in) a run made entirely of `commercial.premium` seats — only when
|
|
21
21
|
* `preferPremium` is set; absent = this term is inert (byte-identical).
|
|
22
|
+
* ½. A run with fewer seats BEHIND THE STAGE (see `behindStageLabels`): on
|
|
23
|
+
* an end-stage layout, a seat in a block that reaches behind the focal
|
|
24
|
+
* point ranks after every seat in front of it, however close it sits.
|
|
25
|
+
* Off for in-the-round/arena layouts, for a single-category or
|
|
26
|
+
* single-zone request, and for a replacement-seat request.
|
|
27
|
+
* ¾. (opt-in) a run holding at least one AISLE seat — only when
|
|
28
|
+
* `preferAisle` is set with the chart's `aisleLabels`; absent = inert.
|
|
29
|
+
* After the behind-the-stage tier: an aisle is never worth a seat
|
|
30
|
+
* behind the stage. Before orphan and distance.
|
|
22
31
|
* 1. A single contiguous run of `qty` adjacent-available seats in ONE row
|
|
23
32
|
* (a booked/held/missing/wrong-category seat breaks contiguity).
|
|
24
33
|
* 2. …that does NOT strand a single isolated free seat ("orphan") beside the
|
|
@@ -59,7 +68,65 @@ interface BestAvailableOpts {
|
|
|
59
68
|
preferNearest?: boolean;
|
|
60
69
|
/** Logical rows containing the original seats in a recovery request. */
|
|
61
70
|
preferredRowIds?: readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* Opt-in aisle bias: a run holding at least one of `aisleLabels` beats one
|
|
73
|
+
* that holds none, after the behind-the-stage tier and before the
|
|
74
|
+
* orphan/distance rules. Inert unless both are given (byte-identical).
|
|
75
|
+
* `aisleLabels` are booking labels of aisle seats (core/layout/aisleSeats).
|
|
76
|
+
*/
|
|
77
|
+
preferAisle?: boolean;
|
|
78
|
+
aisleLabels?: ReadonlySet<string>;
|
|
62
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The labels of seats that sit BEHIND THE STAGE on an end-stage layout —
|
|
82
|
+
* empty when the layout is not end-stage.
|
|
83
|
+
*
|
|
84
|
+
* Seen on the Grand Theatre demo (2026-09-26): "Find 2 best seats" (all
|
|
85
|
+
* prices, any zone) picked West Choir A-1/A-2. The choir wraps round the
|
|
86
|
+
* sides and back of the stage, 266 units from the focal point, which is ON
|
|
87
|
+
* the stage; the nearest arena seat is 476 away, so distance alone put the
|
|
88
|
+
* choir first.
|
|
89
|
+
*
|
|
90
|
+
* Seats are taken per focal point (a zone may carry its own). For each group:
|
|
91
|
+
*
|
|
92
|
+
* - The AUDIENCE AXIS runs from the focal point F to the centroid of the
|
|
93
|
+
* group's seats: on an end stage, from the stage into the house.
|
|
94
|
+
* - A seat's DEPTH is its signed distance along that axis from F. A seat
|
|
95
|
+
* with negative depth is on the far side of the focal point from the
|
|
96
|
+
* audience: behind the stage.
|
|
97
|
+
* - A BLOCK (the seat's section, or its logical row when it has none) that
|
|
98
|
+
* reaches behind the stage is a stage-side block, and every seat in it
|
|
99
|
+
* ranks after the house. The choir's last seat, level with the stage lip,
|
|
100
|
+
* is only "close" because the choir hugs the stage.
|
|
101
|
+
*
|
|
102
|
+
* Why the focal point and not the stage's own outline: a thrust or a runway
|
|
103
|
+
* puts the stage's deepest point well into the house, and the tables and the
|
|
104
|
+
* parterre ends flanking it are among the best seats. Measured on the bundled
|
|
105
|
+
* templates, a stage-lip line demoted the whole opera parterre and a comedy
|
|
106
|
+
* club's front tables; the focal-point line demotes choirs, platform parties,
|
|
107
|
+
* head tables and the side blocks level with an arena's end stage.
|
|
108
|
+
*
|
|
109
|
+
* WHEN IT DOES NOT APPLY. In the round, in an arena bowl, in a stadium, on a
|
|
110
|
+
* thrust, the audience surrounds the focal point and "behind" means nothing.
|
|
111
|
+
* That is decided by COUNTING, not by a knife-edge distance: a group is
|
|
112
|
+
* end-stage only while at most one seat in ten sits behind its focal point,
|
|
113
|
+
* and the stage-side blocks hold at most one seat in four. Measured over every
|
|
114
|
+
* bundled template (2026-09-26): every end-stage theatre, hall and cinema has
|
|
115
|
+
* 0-8% of its seats behind the focal point; the nearest layouts that are not
|
|
116
|
+
* end-stage (a nightclub, a ballpark grandstand) 13%; the thrust, black-box
|
|
117
|
+
* and esports layouts 18-20%; every bowl, stadium and in-the-round layout
|
|
118
|
+
* 36-50%. The cut at 10% sits in the gap, with room on both sides.
|
|
119
|
+
*
|
|
120
|
+
* FLOAT-SAFE BY CONSTRUCTION (CLAUDE.md: x86 and arm64 disagree on
|
|
121
|
+
* near-equal floats). A seat within a tolerance of the line through F counts
|
|
122
|
+
* as ON the line, never behind it, so a seat level with the focal point
|
|
123
|
+
* cannot flip between runners. The tolerance is a millionth of the group's
|
|
124
|
+
* extent: orders of magnitude above float noise, far below any authored seat
|
|
125
|
+
* spacing. A group whose centroid sits on its focal point within that
|
|
126
|
+
* tolerance has no axis at all, and is in the round. Every other decision is
|
|
127
|
+
* an integer count.
|
|
128
|
+
*/
|
|
129
|
+
declare function behindStageLabels(seats: readonly ExpandedSeat[], focal: Point): Set<string>;
|
|
63
130
|
/**
|
|
64
131
|
* Pick the `qty` best available seats. Returns `{ labels }` on success, or
|
|
65
132
|
* `{ labels: [], reason }` when the request can't be satisfied at all.
|
|
@@ -198,4 +265,4 @@ declare function resolveRowTerminalCapacity(row: RowObject, pointer: Point): Row
|
|
|
198
265
|
/** Deterministically choose the start-edge count nearest the pointer. */
|
|
199
266
|
declare function resolveRowStartCapacity(row: RowObject, pointer: Point): RowCapacityProposal | null;
|
|
200
267
|
|
|
201
|
-
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, 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, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowStartCapacity, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowStartEndpoint, rowTerminalEndpoint, rowWithStartCapacity, rowWithTerminalCapacity, strandedSingles };
|
|
268
|
+
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, MAX_DIRECT_ROW_SWEEP, MAX_ROW_BLOCK_ROWS, MAX_ROW_SEATS, MIN_ROW_BLOCK_ROWS, MIN_ROW_SEATS, type RowBlockCountProposal, type RowCapacityProposal, behindStageLabels, capacityControl, categoryCapacity, chartCapacity, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowStartCapacity, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowStartEndpoint, rowTerminalEndpoint, rowWithStartCapacity, rowWithTerminalCapacity, strandedSingles };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-
|
|
2
|
-
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-
|
|
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-
|
|
4
|
-
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as
|
|
1
|
+
import { P as Point, A as AccessibilityType, C as ChartDoc, R as RowObject } from '../../types-ZviQR7ch.js';
|
|
2
|
+
import { E as ExpandedSeat, S as SeatStatus } from '../../renderer-BurPZ2Io.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-i-mGCBD3.js';
|
|
4
|
+
export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DEFAULT_EVENT_INVENTORY_LIMIT, G as GABoxMode, b as GA_UNIT_LABEL_PREFIX, c as GroupedTableBookingMode, d as GroupedTableInventoryUnit, e as GroupedTableProjectionError, L as LARGE_VENUE_INVENTORY_MODULE, M as MAX_EVENT_INVENTORY, f as MAX_GA_CAPACITY, g as MAX_ONE_PARTY_GUESTS, N as NotForSaleSelectionIssue, O as ONE_PARTY_LIMIT_MESSAGE, R as RestrictionChartDoc, h as RestrictionSeat, T as TicketOptionApplicabilityIssue, i as TicketSelection, j as TicketSelectionIssue, k as TicketSelectionOptions, l as TicketTierResolution, m as applicableTicketTiers, n as companionSelectionIssue, o as eventInventoryLimitFor, p as gaAreasOf, q as gaBoxBounds, r as gaBoxMode, s as gaInventorySegments, t as gaUnitLabel, u as gaUnitLabels, v as gaUnitLabelsForModel, w as gaWheelchairPlaceCount, x as gaWheelchairUnitLabels, y as groupedTableInventory, z as growJoinedGAInventory, A as isFullChartDoc, B as isGaUnitLabel, E as resolveTicketTierForSeat, F as ticketOptionNotApplicableIssue, H as ticketSelectionIssue, I as ticketTierAppliesToSeat, J as validGAInventorySegments } from '../../ticketRestrictions-DRDtAVKw.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Best-available seat selection — a PURE, fully unit-testable ranking function.
|
|
@@ -19,6 +19,15 @@ export { C as ClientInventoryModelVersion, a as CompanionSelectionIssue, D as DE
|
|
|
19
19
|
* "Best" means, in priority order:
|
|
20
20
|
* 0. (opt-in) a run made entirely of `commercial.premium` seats — only when
|
|
21
21
|
* `preferPremium` is set; absent = this term is inert (byte-identical).
|
|
22
|
+
* ½. A run with fewer seats BEHIND THE STAGE (see `behindStageLabels`): on
|
|
23
|
+
* an end-stage layout, a seat in a block that reaches behind the focal
|
|
24
|
+
* point ranks after every seat in front of it, however close it sits.
|
|
25
|
+
* Off for in-the-round/arena layouts, for a single-category or
|
|
26
|
+
* single-zone request, and for a replacement-seat request.
|
|
27
|
+
* ¾. (opt-in) a run holding at least one AISLE seat — only when
|
|
28
|
+
* `preferAisle` is set with the chart's `aisleLabels`; absent = inert.
|
|
29
|
+
* After the behind-the-stage tier: an aisle is never worth a seat
|
|
30
|
+
* behind the stage. Before orphan and distance.
|
|
22
31
|
* 1. A single contiguous run of `qty` adjacent-available seats in ONE row
|
|
23
32
|
* (a booked/held/missing/wrong-category seat breaks contiguity).
|
|
24
33
|
* 2. …that does NOT strand a single isolated free seat ("orphan") beside the
|
|
@@ -59,7 +68,65 @@ interface BestAvailableOpts {
|
|
|
59
68
|
preferNearest?: boolean;
|
|
60
69
|
/** Logical rows containing the original seats in a recovery request. */
|
|
61
70
|
preferredRowIds?: readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* Opt-in aisle bias: a run holding at least one of `aisleLabels` beats one
|
|
73
|
+
* that holds none, after the behind-the-stage tier and before the
|
|
74
|
+
* orphan/distance rules. Inert unless both are given (byte-identical).
|
|
75
|
+
* `aisleLabels` are booking labels of aisle seats (core/layout/aisleSeats).
|
|
76
|
+
*/
|
|
77
|
+
preferAisle?: boolean;
|
|
78
|
+
aisleLabels?: ReadonlySet<string>;
|
|
62
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The labels of seats that sit BEHIND THE STAGE on an end-stage layout —
|
|
82
|
+
* empty when the layout is not end-stage.
|
|
83
|
+
*
|
|
84
|
+
* Seen on the Grand Theatre demo (2026-09-26): "Find 2 best seats" (all
|
|
85
|
+
* prices, any zone) picked West Choir A-1/A-2. The choir wraps round the
|
|
86
|
+
* sides and back of the stage, 266 units from the focal point, which is ON
|
|
87
|
+
* the stage; the nearest arena seat is 476 away, so distance alone put the
|
|
88
|
+
* choir first.
|
|
89
|
+
*
|
|
90
|
+
* Seats are taken per focal point (a zone may carry its own). For each group:
|
|
91
|
+
*
|
|
92
|
+
* - The AUDIENCE AXIS runs from the focal point F to the centroid of the
|
|
93
|
+
* group's seats: on an end stage, from the stage into the house.
|
|
94
|
+
* - A seat's DEPTH is its signed distance along that axis from F. A seat
|
|
95
|
+
* with negative depth is on the far side of the focal point from the
|
|
96
|
+
* audience: behind the stage.
|
|
97
|
+
* - A BLOCK (the seat's section, or its logical row when it has none) that
|
|
98
|
+
* reaches behind the stage is a stage-side block, and every seat in it
|
|
99
|
+
* ranks after the house. The choir's last seat, level with the stage lip,
|
|
100
|
+
* is only "close" because the choir hugs the stage.
|
|
101
|
+
*
|
|
102
|
+
* Why the focal point and not the stage's own outline: a thrust or a runway
|
|
103
|
+
* puts the stage's deepest point well into the house, and the tables and the
|
|
104
|
+
* parterre ends flanking it are among the best seats. Measured on the bundled
|
|
105
|
+
* templates, a stage-lip line demoted the whole opera parterre and a comedy
|
|
106
|
+
* club's front tables; the focal-point line demotes choirs, platform parties,
|
|
107
|
+
* head tables and the side blocks level with an arena's end stage.
|
|
108
|
+
*
|
|
109
|
+
* WHEN IT DOES NOT APPLY. In the round, in an arena bowl, in a stadium, on a
|
|
110
|
+
* thrust, the audience surrounds the focal point and "behind" means nothing.
|
|
111
|
+
* That is decided by COUNTING, not by a knife-edge distance: a group is
|
|
112
|
+
* end-stage only while at most one seat in ten sits behind its focal point,
|
|
113
|
+
* and the stage-side blocks hold at most one seat in four. Measured over every
|
|
114
|
+
* bundled template (2026-09-26): every end-stage theatre, hall and cinema has
|
|
115
|
+
* 0-8% of its seats behind the focal point; the nearest layouts that are not
|
|
116
|
+
* end-stage (a nightclub, a ballpark grandstand) 13%; the thrust, black-box
|
|
117
|
+
* and esports layouts 18-20%; every bowl, stadium and in-the-round layout
|
|
118
|
+
* 36-50%. The cut at 10% sits in the gap, with room on both sides.
|
|
119
|
+
*
|
|
120
|
+
* FLOAT-SAFE BY CONSTRUCTION (CLAUDE.md: x86 and arm64 disagree on
|
|
121
|
+
* near-equal floats). A seat within a tolerance of the line through F counts
|
|
122
|
+
* as ON the line, never behind it, so a seat level with the focal point
|
|
123
|
+
* cannot flip between runners. The tolerance is a millionth of the group's
|
|
124
|
+
* extent: orders of magnitude above float noise, far below any authored seat
|
|
125
|
+
* spacing. A group whose centroid sits on its focal point within that
|
|
126
|
+
* tolerance has no axis at all, and is in the round. Every other decision is
|
|
127
|
+
* an integer count.
|
|
128
|
+
*/
|
|
129
|
+
declare function behindStageLabels(seats: readonly ExpandedSeat[], focal: Point): Set<string>;
|
|
63
130
|
/**
|
|
64
131
|
* Pick the `qty` best available seats. Returns `{ labels }` on success, or
|
|
65
132
|
* `{ labels: [], reason }` when the request can't be satisfied at all.
|
|
@@ -198,4 +265,4 @@ declare function resolveRowTerminalCapacity(row: RowObject, pointer: Point): Row
|
|
|
198
265
|
/** Deterministically choose the start-edge count nearest the pointer. */
|
|
199
266
|
declare function resolveRowStartCapacity(row: RowObject, pointer: Point): RowCapacityProposal | null;
|
|
200
267
|
|
|
201
|
-
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, 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, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowStartCapacity, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowStartEndpoint, rowTerminalEndpoint, rowWithStartCapacity, rowWithTerminalCapacity, strandedSingles };
|
|
268
|
+
export { type AtomicTableCandidate, type BestAvailableOpts, type BestAvailableReason, type BestAvailableResult, type CapacityControl, type CapacityPresetSize, MAX_DIRECT_ROW_SWEEP, MAX_ROW_BLOCK_ROWS, MAX_ROW_SEATS, MIN_ROW_BLOCK_ROWS, MIN_ROW_SEATS, type RowBlockCountProposal, type RowCapacityProposal, behindStageLabels, capacityControl, categoryCapacity, chartCapacity, intactRowBlockMembers, pickBestAvailable, pickBestAvailableInventory, resizeChartCapacity, resolveRowBlockCount, resolveRowStartCapacity, resolveRowTerminalCapacity, rowBlockEdgePoint, rowBlockPreviewRows, rowStartEndpoint, rowTerminalEndpoint, rowWithStartCapacity, rowWithTerminalCapacity, strandedSingles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as D,b as Y,c as $,d as q,e as H,f as Q,g as U,h as V,i as Z,j as tt,k as nt,l as ot,m as et}from"../../chunk-2STEWCI2.js";import{a as ut,b as lt,c as pt,d as ft}from"../../chunk-UEYHH7Y5.js";import{a as m}from"../../chunk-TZBJCAXH.js";import{a as rt,b as it,c as at,d as ct,e as st}from"../../chunk-76AUT55N.js";import"../../chunk-B75VUM6L.js";import"../../chunk-RF4QU72N.js";import"../../chunk-33SRM2CP.js";import"../../chunk-TFYAMLCK.js";import"../../chunk-JRZHC75P.js";import"../../chunk-UEDS3HJ3.js";import{a as C,b as N,c as g,d as k,e as G,f as B,g as W,h as A,i as E,j as F,k as T,l as L,m as X,n as K,o as J,p as z}from"../../chunk-WH2EVBIG.js";import{_a as f,d as _,e as v,f as I,g as j}from"../../chunk-3W4ZMU4G.js";import"../../chunk-KTMZ3QAO.js";import"../../chunk-JBOTRSMY.js";import"../../chunk-CRCGO52K.js";var b=1,d=100;function w(t,n){if(!Number.isInteger(n)||n<b||n>d)return null;let e=t.rotation*Math.PI/180,i={x:Math.cos(e),y:Math.sin(e)},o={x:-i.y,y:i.x};return Array.from({length:n},(r,a)=>{let c=t.style==="intertwined"&&a%2===1?t.seatSpacing/2:0;return{type:"row",id:`__block_preview_${a}`,label:"",origin:{x:t.origin.x+o.x*a*t.rowGap+i.x*c,y:t.origin.y+o.y*a*t.rowGap+i.y*c},rotation:t.rotation,curve:t.curve,seatCount:t.seatsPerRow,seatSpacing:t.seatSpacing,categoryKey:"__preview__"}})}function x(t,n=t.rowCount){let e=w(t,n);return e?.length?f(e[e.length-1]):null}function xt(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y)||t.rowGap<=0)return null;let e=x(t,1);if(!e)return null;let i=t.rotation*Math.PI/180,o={x:-Math.sin(i),y:Math.cos(i)},r=(n.x-e.x)*o.x+(n.y-e.y)*o.y,a=Math.max(b,Math.min(d,Math.round(r/t.rowGap)+1)),c=x(t,a);return c?{rowCount:a,edgePoint:c}:null}function bt(t,n){return t.length!==n.rowCount?!1:[...t].sort((i,o)=>(i.rowBlockGeneration?.rowIndex??1/0)-(o.rowBlockGeneration?.rowIndex??1/0)).every((i,o)=>{let r=i.rowBlockGeneration;return r?.kind==="row-block-v1"&&r.groupId===n.groupId&&r.rowIndex===o&&r.signature===n.signature&&JSON.stringify(r)===JSON.stringify({...n,rowIndex:o})})}var s=1,u=300,y=330;function l(t){return t.seatCount>1?t.curve/(t.seatCount-1):0}function h(t,n){let e=t.rotation*Math.PI/180,i=l(t)*Math.PI/180,o,r;if(Math.abs(i)<1e-9)o=n*t.seatSpacing,r=0;else{let a=t.seatSpacing/(2*Math.sin(Math.abs(i)/2)),c=i*n;o=a*Math.sin(c),r=-a+a*Math.cos(c)}return{x:t.origin.x+o*Math.cos(e)-r*Math.sin(e),y:t.origin.y+o*Math.sin(e)+r*Math.cos(e)}}function M(t,n,e){let i=(t??[]).map(o=>({...o,index:o.index+n})).filter(o=>o.index>=0&&o.index<e);return i.length?i:void 0}function R(t,n){if(t.path||!Number.isInteger(n)||n<s||n>u)return null;let e=l(t);return{...t,seatCount:n,curve:e*(n-1)}}function O(t,n){if(t.path||!Number.isInteger(n)||n<s||n>u)return null;let e=l(t),i=t.seatCount-n,o=-i;return{...t,origin:h(t,i),rotation:m(t.rotation-e*i),seatCount:n,curve:e*(n-1),overrides:M(t.overrides,o,n)}}function P(t,n=t.seatCount){let e=R(t,n);return e?h(e,n-1):null}function S(t,n=t.seatCount){return O(t,n)?.origin??null}function ht(t,n){if(t.path||!Number.isFinite(n.x)||!Number.isFinite(n.y))return null;let e=l(t),i=Math.abs(e)<1e-9?u:Math.min(u,Math.floor(y/Math.abs(e))+1),o=null;for(let r=s;r<=Math.max(s,i);r+=1){let a=P(t,r);if(!a)continue;let c=Math.hypot(a.x-n.x,a.y-n.y),p=e*(r-1);(!o||c<o.distance||c===o.distance&&r<o.seatCount)&&(o={seatCount:r,curve:p,endpoint:a,distance:c})}return o}function wt(t,n){if(t.path||!Number.isFinite(n.x)||!Number.isFinite(n.y))return null;let e=l(t),i=Math.abs(e)<1e-9?u:Math.min(u,Math.floor(y/Math.abs(e))+1),o=null;for(let r=s;r<=Math.max(s,i);r+=1){let a=S(t,r);if(!a)continue;let c=Math.hypot(a.x-n.x,a.y-n.y),p=e*(r-1);(!o||c<o.distance||c===o.distance&&r<o.seatCount)&&(o={seatCount:r,curve:p,endpoint:a,distance:c})}return o}export{rt as CATEGORY_INVENTORY_FAMILIES,v as DEFAULT_EVENT_INVENTORY_LIMIT,C as GA_UNIT_LABEL_PREFIX,ot as GroupedTableProjectionError,I as LARGE_VENUE_INVENTORY_MODULE,y as MAX_DIRECT_ROW_SWEEP,_ as MAX_EVENT_INVENTORY,g as MAX_GA_CAPACITY,W as MAX_ONE_PARTY_GUESTS,d as MAX_ROW_BLOCK_ROWS,u as MAX_ROW_SEATS,b as MIN_ROW_BLOCK_ROWS,s as MIN_ROW_SEATS,A as ONE_PARTY_LIMIT_MESSAGE,H as applicableTicketTiers,Z as behindStageLabels,pt as capacityControl,lt as categoryCapacity,ut as chartCapacity,U as companionSelectionIssue,ct as describeCategoryInventoryConflict,it as effectiveSeatOwnerCategoryCounts,j as eventInventoryLimitFor,z as gaAreasOf,F as gaBoxBounds,E as gaBoxMode,B as gaInventorySegments,k as gaUnitLabel,T as gaUnitLabels,L as gaUnitLabelsForModel,X as gaWheelchairPlaceCount,K as gaWheelchairUnitLabels,et as groupedTableInventory,J as growJoinedGAInventory,at as inspectCategoryInventoryConflicts,bt as intactRowBlockMembers,Y as isFullChartDoc,N as isGaUnitLabel,tt as pickBestAvailable,nt as pickBestAvailableInventory,st as remediateCategoryInventoryConflicts,ft as resizeChartCapacity,xt as resolveRowBlockCount,wt as resolveRowStartCapacity,ht as resolveRowTerminalCapacity,Q as resolveTicketTierForSeat,x as rowBlockEdgePoint,w as rowBlockPreviewRows,S as rowStartEndpoint,P as rowTerminalEndpoint,O as rowWithStartCapacity,R as rowWithTerminalCapacity,D as strandedSingles,$ as ticketOptionNotApplicableIssue,V as ticketSelectionIssue,q as ticketTierAppliesToSeat,G as validGAInventorySegments};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ce=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var gt=Object.prototype.hasOwnProperty;var Mt=(e,t)=>{for(var n in t)ce(e,n,{get:t[n],enumerable:!0})},St=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xt(t))!gt.call(e,r)&&r!==n&&ce(e,r,{get:()=>t[r],enumerable:!(o=yt(t,r))||o.enumerable});return e};var wt=e=>St(ce({},"__esModule",{value:!0}),e);var no={};Mt(no,{AUTOMATIC_ROUND_TABLE_RADIUS_MAX:()=>Ve,AUTOMATIC_ROUND_TABLE_RADIUS_MIN:()=>Ye,DEFAULT_SEAT_RADIUS:()=>mt,FLOOR_STACK_GAP_RATIO:()=>ft,FLOOR_STACK_MIN_SURFACE_PX:()=>Hn,TABLE_SEAT_OFFSET:()=>X,TEXT_BACKGROUND_PADDING_MAX:()=>po,TEXT_BACKGROUND_RADIUS_MAX:()=>yo,TEXT_LETTER_SPACING_MAX:()=>mo,TEXT_LETTER_SPACING_MIN:()=>ho,TEXT_LINE_HEIGHT_MAX:()=>fo,TEXT_LINE_HEIGHT_MIN:()=>uo,TEXT_OPACITY_MIN:()=>bo,TEXT_WIDTH_MAX:()=>lo,TEXT_WIDTH_MIN:()=>co,allObjects:()=>lt,applyAffine:()=>Gn,automaticRoundTableRadius:()=>cn,buildAisleHoles:()=>vt,buildSeatIndex:()=>qn,buildSectionShell:()=>It,chartBounds:()=>$,combinedFloorZoneId:()=>ve,composeAffine:()=>Yn,createPerspectiveCamera:()=>Un,cubicPoint:()=>q,decomposeAffineLinear:()=>zn,distanceToRings:()=>_e,distributeAlongCubic:()=>le,expandBooth:()=>at,expandChart:()=>Tn,expandRow:()=>rt,expandRowSlots:()=>ot,expandTable:()=>st,expandTableSlots:()=>Pe,floorObjects:()=>On,floorStackPlacements:()=>ht,floorsOf:()=>te,gridStats:()=>to,hitTest:()=>Zn,initialFloorMode:()=>Xn,invertAffine:()=>Kn,layoutCombinedFloorPlan:()=>jn,layoutFloorStack:()=>Nn,mainFloorId:()=>Bn,nearestWithin:()=>Jn,objectCenter:()=>Ie,owningSectionForObject:()=>ct,perspectiveTangentAffine:()=>Vn,pointInPolygon:()=>we,pointInPolygonWithHoles:()=>W,polygonArea:()=>de,polygonInscribedAnchor:()=>he,polygonLabelPoint:()=>Rn,polygonNetArea:()=>Et,projectPerspectivePoint:()=>ae,queryRect:()=>eo,resolveSegmentedRowGroups:()=>me,rowInventoryCount:()=>vn,rowSeatPositions:()=>ie,segmentedRowComponentSeats:()=>Tt,segmentedRowComponents:()=>At,segmentedRowSeatTotal:()=>_t,smoothCubicThroughMiddle:()=>Pt,stackFloors:()=>An,tableInventoryCount:()=>kn,tableSeatCountsBySide:()=>it,textLayoutMetrics:()=>ue,translateObject:()=>se,usableHoles:()=>V});module.exports=wt(no);var ro=Math.PI/180;function H(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function N(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function q(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 Pt(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 le(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[q(e,.5)];let o=Array.from({length:n+1},(u,a)=>q(e,a/n)),r=new Float64Array(o.length);for(let u=1;u<o.length;u+=1){let a=o[u].x-o[u-1].x,c=o[u].y-o[u-1].y;r[u]=r[u-1]+Math.hypot(a,c)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],l=1;for(let u=0;u<t;u+=1){let a=i*u/(t-1);for(;l<r.length-1&&r[l]<a;)l+=1;let c=r[l-1],f=r[l],b=f===c?0:(a-c)/(f-c);s.push({x:o[l-1].x+(o[l].x-o[l-1].x)*b,y:o[l-1].y+(o[l].y-o[l-1].y)*b})}return s}function T(e,t){return{x:e.x+t.x,y:e.y+t.y}}function z(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 Z(e,t=13){return Array.from({length:t},(n,o)=>q(e,o/(t-1)))}function Ce(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return N(e[o],e[o+1],n-o)}function Re(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[Ce(e,o)];for(let s=1;s<e.length-1;s+=1){let l=s/(e.length-1);l>o+1e-9&&l<r-1e-9&&i.push(e[s])}return i.push(Ce(e,r)),i}function Ee(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([b,p],y)=>{let m=H(N(e[b],e[p],.5),t);m<r&&(r=m,o=y)});let i=e[o],s=e[(o+1)%4],l=e[(o+2)%4],u=e[(o+3)%4],a=N(i,s,.5),c=z(t,a),f=Math.max(1e-9,Math.hypot(c.x,c.y));return{p0:i,p1:s,p2:l,p3:u,normal:_(c,1/f),depth:(H(i,u)+H(s,l))/2}}function Oe(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:s}=e,l=z(n,t),u=z(o,r),a=s*.22,c=s*.12;return{nearPath:{start:t,control1:T(T(t,_(l,1/3)),_(i,a)),control2:T(T(t,_(l,2/3)),_(i,a)),end:n},farPath:{start:o,control1:T(T(r,_(u,2/3)),_(i,c)),control2:T(T(r,_(u,1/3)),_(i,c)),end:r}}}function It(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((y,m)=>T(y,m),{x:0,y:0});o.x/=4,o.y/=4;let r=H(e[0],e[1]),i=H(e[0],e[3]),s=n==="auto"?r>i*1.25&&H(o,t)>i?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(y=>({...y}))};let l=Ee(e,t),{p0:u,p1:a,p2:c,p3:f}=l;if(s==="tapered")return{mode:s,outline:[T(u,_(z(a,u),.14)),T(u,_(z(a,u),1-.14)),c,f]};let{nearPath:b,farPath:p}=Oe(l);return{mode:s,outline:[...Z(b),...Z(p).slice(1)]}}function vt(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=Ee(e,t),{p0:i,p1:s,p2:l,p3:u}=r,a=o==="bezier"?Oe(r):null,c=a?Z(a.nearPath):null,f=a?Z(a.farPath).reverse():null,b=Math.min(.055,.18/(n+1));return Array.from({length:n},(p,y)=>{let m=(y+1)/(n+1),g=m-b/2,w=m+b/2;return c&&f?[...Re(c,g,w),...Re(f,g,w).reverse()]:[N(i,s,g),N(i,s,w),N(u,l,w),N(u,l,g)]})}var co=40,lo=1200,uo=.8,fo=3,ho=-2,mo=20,bo=.1,po=40,yo=40,Ae=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function kt(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/Ae(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let s=0;for(let l of i.split(/\s+/)){let u=l.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 ue(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(l=>l.length))*Ae(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),s=kt(e,i);return{width:r,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}function Ct(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 _e(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=Ct(e,o[i],o[r]);s<n&&(n=s)}return n}function Te(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,l=t[r].x,u=t[r].y;s>e.y!=u>e.y&&e.x<(l-i)*(e.y-s)/(u-s)+i&&(n=!n)}return n}function De(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Rt(e,t,n){let o=Te(e,t)&&!n.some(i=>Te(e,i)),r=_e(e,[t,...n]);return o?r:-r}function G(e,t,n,o,r){let i=Rt({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var fe=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,l=r;if(i<t.length&&t[i].max>t[l].max&&(l=i),s<t.length&&t[s].max>t[l].max&&(l=s),l===r)break;[t[l],t[r]]=[t[r],t[l]],r=l}}return n}};function de(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 Et(e,t){return Math.max(0,de(e)-De(t).reduce((n,o)=>n+de(o),0))}function he(e,t){let n=De(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let m=e.reduce((w,v)=>w+v.x,0)/e.length,g=e.reduce((w,v)=>w+v.y,0)/e.length;return{point:{x:m,y:g},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 l=i-o,u=s-r,a=Math.min(l,u);if(!(a>0))return{point:{x:(o+i)/2,y:(r+s)/2},radius:0};let c=Math.max(l,u)/150,f=new fe,b=a/2;for(let m=o;m<i;m+=a)for(let g=r;g<s;g+=a)f.push(G(m+b,g+b,b,e,n));let p=G(o+l/2,r+u/2,0,e,n),y=0;for(;f.size;){let m=f.pop();if(!m)break;m.d>p.d&&(p=m),!(m.max-p.d<=c)&&(y>=4e3||(y+=1,b=m.h/2,f.push(G(m.x-b,m.y-b,b,e,n)),f.push(G(m.x+b,m.y-b,b,e,n)),f.push(G(m.x-b,m.y+b,b,e,n)),f.push(G(m.x+b,m.y+b,b,e,n))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function J(e,t,n){return Math.max(t,Math.min(n,e))}function F(e,t,n){return e<t?t:e>n?n:e}var So=Math.PI*2;function Le(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 wo=4/3;function At(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],s=e[r+1],l=Math.hypot(s.x-i.x,s.y-i.y);if(l<=0)continue;let u=Math.max(1,Math.round(l/n)),a=l/u,c=Math.atan2(s.y-i.y,s.x-i.x),f=r===0,p=(r>0?t[r-1]:void 0)==="break"?2:1,y=f?{...i}:{x:i.x+Math.cos(c)*a*p,y:i.y+Math.sin(c)*a*p},m=f?u+1:Math.max(1,u-(p-1));o.push({origin:y,rotation:c*180/Math.PI,seatCount:m,seatSpacing:a})}return o}function Tt(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 _t(e){return e.reduce((t,n)=>t+n.seatCount,0)}function me(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((b,p)=>b.segmentedRow.componentIndex-p.segmentedRow.componentIndex),s=i[0]?.segmentedRow?.componentCount??0,l=i[0]?.segmentedRow;if(!l||!(s>=2&&i.length===s&&l?.boundaryBefore==="start"&&i.every((b,p)=>b.segmentedRow?.kind==="segmented-row-v1"&&b.segmentedRow.groupId===o&&b.segmentedRow.componentCount===s&&b.segmentedRow.componentIndex===p&&b.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(p===0?b.segmentedRow.boundaryBefore==="start":b.segmentedRow.boundaryBefore!=="start")&&b.segmentedRow.displayLabel===l.displayLabel)))continue;let a=i.reduce((b,p)=>b+p.seatCount,0),c=0,f=0;for(let b of i)b.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(b.id,{groupId:o,adjacencyOffset:c,displayOffset:f,displayLabel:l.displayLabel,totalSeats:a,canonical:i[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),c+=b.seatCount,f+=b.seatCount}return t}var Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Lt="abcdefghijklmnopqrstuvwxyz";function Ft(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 be(e,t=!1){let n=t?Lt:Dt;return Ft(Math.max(0,Math.floor(e)-1),n)}var Nt=[[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 Fe(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Nt)for(;t>=o;)n+=r,t-=o;return n}function jt(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 ee(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??"",l=e.seatNumbering?.endAt,u=e.seatCount;if(i==="updown"||i==="updown-descending"){let p=Math.ceil(u/2),y=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}${y}`}let a=i==="odd"||i==="even"?2:r,c=l!=null&&Number.isFinite(l)?l-(u-1)*a:n,f=o==="center"?jt(u)[t]:o==="rtl"?u-1-t:t,b;switch(i){case"odd":{let p=c%2===1?c:c+1;b=String(p+f*2);break}case"even":{let p=c%2===0?c:c+1;b=String(p+f*2);break}case"roman":b=Fe(c+f*r);break;case"letters-upper":b=be(c+f*r,!1);break;case"letters-lower":b=be(c+f*r,!0);break;default:b=String(c+f*r);break}return`${s}${b}`}function Bt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Ne(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${ee(e,t)}`}function pe(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(e.seatDisplayLabelMode==="number")return ee(e,t);if(!n)return`${e.displayLabel||e.label}-${ee(e,t)}`;let r=Bt(n),i=n.displayOffset+t;return`${n.displayLabel}-${ee(r,i)}`}var K=.02291666666666667,Ro=1/K,Ht=58,Xt=Ht*K;var Ut=3,je=0,ye=120,Gt=0,Kt=45,Yt=7,Y=1.2;function xe(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Vt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Yt?e:Ut}function Be(e,t={}){let n=xe(t.floorBaseHeightM,je,ye,0),o=Math.min(ye,n+Vt(e.elevation)*Xt),r=e.height===void 0?o:xe(e.height,je,ye,o),i=xe(e.rake,Gt,Kt,0);return{height:r,rake:i}}function He(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 Xe(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],l=s.x-i.x,u=s.y-i.y,a=l*l+u*u,c=a>1e-12?((t-i.x)*l+(n-i.y)*u)/a:0;c<0?c=0:c>1&&(c=1);let f=t-(i.x+c*l),b=n-(i.y+c*u);if(Math.abs(f)>=o||Math.abs(b)>=o)continue;let p=Math.hypot(f,b);p<o&&(o=p)}return o}function zt(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 Ue(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ge(e,t){let n=1/0;for(let o of He(e)){let r=Xe(t,o.x,o.y);r<n&&(n=r)}for(let o of He(t)){let r=Xe(e,o.x,o.y);r<n&&(n=r)}return n}function Wt(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let c of e)n+=c.x,o+=c.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let c of e){let f=Math.hypot(c.x-n,c.y-o);f>r&&(r=f,i=c)}let s=i.x-n,l=i.y-o,u=Math.hypot(s,l);u>1e-9?(s/=u,l/=u):(s=1,l=0);let a=e.map((c,f)=>({p:c,i:f,t:(c.x-n)*s+(c.y-o)*l})).sort((c,f)=>c.t-f.t);return{pts:a.map(c=>c.p),seatIndices:a.map(c=>t[c.i])}}function $t(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let v of e)n+=v.x,o+=v.y;n/=t,o/=t;let r=0,i=0,s=0,l=0,u=0,a=0,c=0;for(let v of e){let R=v.x-n,C=v.y-o;r+=R*R,s+=C*C,i+=R*C,l+=R*R*R,u+=C*C*C,a+=R*C*C,c+=C*R*R}let f=r*s-i*i;if(Math.abs(f)<1e-9)return null;let b=(l+a)/2,p=(u+c)/2,y=(b*s-p*i)/f,m=(p*r-b*i)/f,g=y+n,w=m+o;return!Number.isFinite(g)||!Number.isFinite(w)?null:{cx:g,cy:w}}var Qt=.15;function qt(e){if(e.length<2)return null;let t=e.map(M=>{let d=0,h=0;for(let S of M.pts)d+=S.x,h+=S.y;return{x:d/M.pts.length,y:h/M.pts.length}}),n=0,o=0;for(let M of t)n+=M.x,o+=M.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let M of t){let d=M.x-n,h=M.y-o;r+=d*d,i+=d*h,s+=h*h}let l=r+s,u=r*s-i*i,a=l/2+Math.sqrt(Math.max(0,l*l/4-u)),c,f;Math.abs(i)>1e-12?(c=a-s,f=i):r>=s?(c=1,f=0):(c=0,f=1);let b=Math.hypot(c,f);if(!(b>1e-12))return null;c/=b,f/=b;let p=0,y=0,m=0;for(let M of e){if(M.pts.length<2)continue;let d=M.pts[0],h=M.pts[M.pts.length-1],S=h.x-d.x,x=h.y-d.y,I=Math.hypot(S,x);if(!(I>1e-9))continue;let A=S/I,P=x/I;p+=(A*A-P*P)*I,y+=2*A*P*I,m+=I}if(m>0&&Math.hypot(p,y)>=Jt*m){let M=Math.atan2(y,p)/2,d=Math.cos(M),h=Math.sin(M);Math.abs(c*d+f*h)>en&&(c=-h,f=d)}let g=1/0,w=-1/0,v=[];for(let M of e){let d=1/0,h=-1/0;for(let S of M.pts){let x=S.x*c+S.y*f;x<d&&(d=x),x>h&&(h=x),x<g&&(g=x),x>w&&(w=x)}v.push(h-d)}let R=w-g;return R>1e-9?(v.sort((M,d)=>M-d),v[Math.min(v.length-1,Math.floor(v.length*.9))]/R<=Zt?{x:c,y:f}:null):null}var Zt=.35,Jt=.8,en=.7;function Ge(e,t,n,o){let r=new Map;for(let d of n){let h=t[d],S=h.rowId||`__seat-${d}`,x=r.get(S);x||(x={pts:[],idx:[]},r.set(S,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 S=Wt(h.pts,h.idx),x=0;for(let I of S.pts)x+=Math.hypot(I.x-o.x,I.y-o.y);i.push({id:d,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/S.pts.length})}let s=i.map(d=>zt(d.pts)),l=i.length<=256?i.length*(i.length-1)/2:0,u=l?new Float64Array(l):null;u?.fill(Number.NaN);let a=u?new Map(i.map((d,h)=>[d,h])):null,c=(d,h)=>(d>h&&([d,h]=[h,d]),d*(2*i.length-d-1)/2+(h-d-1)),f=(d,h)=>{if(!u)return ge(i[d].pts,i[h].pts);let S=c(d,h),x=u[S];if(!Number.isNaN(x))return x;let I=ge(i[d].pts,i[h].pts);return u[S]=I,I},b=(d,h)=>a?f(a.get(d),a.get(h)):ge(d.pts,h.pts),p=[];for(let d=0;d<i.length;d++){let h=1/0;for(let S=0;S<i.length;S++){if(d===S||Ue(s[d],s[S])>=h)continue;let x=f(d,S);x<h&&(h=x)}Number.isFinite(h)&&p.push(h)}p.sort((d,h)=>d-h);let y=p.length?p[Math.floor(p.length/2)]:1,m=Math.max(y*1.8,1e-6),g=i.map(()=>[]);for(let d=0;d<i.length;d++)for(let h=d+1;h<i.length;h++)Ue(s[d],s[h])>m||f(d,h)<=m&&(g[d].push(h),g[h].push(d));let w=0;for(let d=0;d<i.length;d++){if(i[d].blockId!==-1)continue;let h=w++,S=[d];for(i[d].blockId=h;S.length;){let x=S.pop();for(let I of g[x])i[I].blockId===-1&&(i[I].blockId=h,S.push(I))}}let v=new Map;for(let d of i){let h=v.get(d.blockId)??[];h.push(d),v.set(d.blockId,h)}let R=[];for(let d of i){if(d.pts.length<4)continue;let h=$t(d.pts);h&&(!Number.isFinite(h.cx)||!Number.isFinite(h.cy)||R.push({x:h.cx,y:h.cy}))}let C=R.length>=2?(()=>{let d=R.map(x=>x.x).sort((x,I)=>x-I),h=R.map(x=>x.y).sort((x,I)=>x-I),S=Math.floor(R.length/2);return{cx:d[S],cy:h[S]}})():null;if(C){let d=P=>Math.hypot(P.x-C.cx,P.y-C.cy),h=1/0,S=-1/0,x=[];for(let P of i){let k=1/0,E=-1/0;for(let D of P.pts){let j=d(D);j<k&&(k=j),j>E&&(E=j)}x.push(E-k),k<h&&(h=k),E>S&&(S=E)}let I=S-h;x.sort((P,k)=>P-k);let A=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(I>1e-9&&A/I<=Qt){let P=i.map(O=>{let Q=0;for(let pt of O.pts)Q+=d(pt);return{row:O,radius:Q/O.pts.length}}),k=0,E=0;for(let O of P)k+=O.radius,E+=O.row.focalDistance;k/=P.length,E/=P.length;let D=0;for(let O of P)D+=(O.radius-k)*(O.row.focalDistance-E);if(D<0)for(let O of P)O.radius=-O.radius;let B=1/0;for(let O of P)O.radius<B&&(B=O.radius);P.sort((O,Q)=>O.radius-Q.radius);let L=-1,U=-1/0,bt=I/Math.max(1,P.length)*.5,ke=[];for(let O of P)O.radius-U>bt&&(L++,U=O.radius),O.row.ordinal=L,O.row.blockDepth=O.radius-B,ke.push(O.row);return{sectionId:e,rows:ke,blockCount:w}}}let M=[];for(let[,d]of v){let h=qt(d);if(h){let S=P=>{let k=0;for(let E of P.pts)k+=E.x*h.x+E.y*h.y;return k/P.pts.length};d.sort((P,k)=>S(P)-S(k)),d.length>=2&&d[0].focalDistance>d[d.length-1].focalDistance&&d.reverse();let x=[],I=y*.5;for(let P of d){let k=x[x.length-1];k&&Math.abs(S(P)-S(k[0]))<I?k.push(P):x.push([P])}let A=0;for(let P=0;P<x.length;P++){if(P>0){let k=1/0;for(let E of x[P-1])for(let D of x[P])k=Math.min(k,b(E,D));A+=k}for(let k of x[P])k.ordinal=P,k.blockDepth=A,M.push(k)}}else{let S=1/0;for(let x of d)x.focalDistance<S&&(S=x.focalDistance);d.sort((x,I)=>x.focalDistance-I.focalDistance);for(let x=0;x<d.length;x++)d[x].ordinal=x,d[x].blockDepth=Math.max(0,d[x].focalDistance-S),M.push(d[x])}}return{sectionId:e,rows:M,blockCount:w}}var tn=/^\d{4}-\d{2}-\d{2}$/;function nn(e){let t=Date.parse(e);return Number.isFinite(t)?tn.test(e)?t+864e5:t:null}function on(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=nn(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function rn(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function sn(e){return e.status!=="draft"&&e.status!=="retracted"}function an(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function Ke(e,t={}){return!!e&&sn(e)&&rn(e,t.activeConfigurationId,t.activeConfigurationVersion)&&an(e,t.activeBasisSha256)&&on(e,t.now)}var Ye=36,Ve=160;function cn(e,t=360){let n=J(Math.round(Number.isFinite(e)?e:1),1,40),o=J(Number.isFinite(t)?t:360,120,360);return Math.round(J(n*4*(360/o),Ye,Ve))}var ln=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function un(e){return!!e&&ln.has(e)}var ze=1.1;var Do=Math.PI*2;var Lo=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,s=[],l=Math.atan2(o.y-r,o.x),u=Math.atan2(o.y-r,-o.x);for(let a=0;a<=24;a++){let c=l+(u-l)*a/24;s.push({x:i*Math.cos(c),y:r+i*Math.sin(c)})}return{half:70,home:t,backstop:n,fence:s}})();function We(e){return un(e)}function fn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function dn(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),s=e.x-t.x,l=e.y-t.y;return{x:t.x+s*r-l*i,y:t.y+s*i+l*r}}function $e(e){let t=fn(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(u=>dn(u,{x:t.reduce((a,c)=>a+c.x,0)/t.length,y:t.reduce((a,c)=>a+c.y,0)/t.length},n)),r=1/0,i=1/0,s=-1/0,l=-1/0;for(let u of o)r=Math.min(r,u.x),i=Math.min(i,u.y),s=Math.max(s,u.x),l=Math.max(l,u.y);return!Number.isFinite(r)||s-r<1e-6||l-i<1e-6?null:{minX:r,minY:i,maxX:s,maxY:l}}var hn=5,mn=3,bn=.92,pn=1.9,yn=2,xn=.6,gn=1,Mn=.06;function Sn(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?ze:We(e.stageKind)?Mn:gn}function Qe(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let s of te(e)){let l=s.baseHeightM??0;for(let u of s.objects){if(u.type!=="shape"||u.role!=="stage")continue;let a=$e(u);a&&(t=Math.min(t,a.minX),n=Math.min(n,a.minY),o=Math.max(o,a.maxX),r=Math.max(r,a.maxY),i=Math.max(i,l+Sn(u)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function wn(e,t,n,o){let r=1/0,i=1/0,s=-1/0,l=-1/0;for(let p of e)Number.isFinite(p.eyeHeightM)&&(r=Math.min(r,p.x),s=Math.max(s,p.x),i=Math.min(i,p.y),l=Math.max(l,p.y));if(!Number.isFinite(r))return null;let u=r*t,a=i*t,c=Math.max(1,Math.ceil((s-r)*t/n)+1),f=Math.max(1,Math.ceil((l-i)*t/n)+1),b=new Float64Array(c*f).fill(-1/0);for(let p of e){if(!Number.isFinite(p.eyeHeightM))continue;let y=p.eyeHeightM-Y,m=Math.min(c-1,Math.max(0,Math.floor((p.x*t-u)/n))),w=Math.min(f-1,Math.max(0,Math.floor((p.y*t-a)/n)))*c+m,v=y+o;v>b[w]&&(b[w]=v)}return{cellM:n,minX:u,minY:a,cols:c,rows:f,top:b}}function Pn(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function qe(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??K,i=n.cellM??xn,s=n.chairBackM??bn,l=n.selfRowSkipM??yn,u=n.clearThreshold??.9,a=n.partialThreshold??.25,c=Math.max(1,n.columns??hn),f=Math.max(1,n.rows??mn),b=wn(e,r,i,s);if(!b)return o;let p=(t.maxX-t.minX)*r,y=(t.maxY-t.minY)*r,m=p>=y,g=(t.minX+t.maxX)/2*r,w=(t.minY+t.maxY)/2*r,v=[];for(let C=0;C<c;C++){let M=(C+.5)/c-.5,d=m?g+M*p:g,h=m?w:w+M*y;for(let S=0;S<f;S++){let x=t.deckTopM+(f===1?0:S/(f-1)*pn);v.push({x:d,y:h,z:x})}}let R=i/2;for(let C of e){if(!Number.isFinite(C.eyeHeightM))continue;let M=C.x*r,d=C.y*r,h=C.eyeHeightM,S=0,x=1/0;for(let A of v){let P=A.x-M,k=A.y-d,E=Math.hypot(P,k);if(!(E>l)){S++;continue}let D=P/E,j=k/E,B=0;for(let L=l;L<E;L+=R){let U=Pn(b,M+D*L,d+j*L);if(!(!Number.isFinite(U)||U>=h)&&U>h+(A.z-h)*L/E){B=L;break}}B?x=Math.min(x,B):S++}let I=S/v.length;I>=u||o.set(C.id,{seatId:C.id,mark:I<a?"obstructedView":"restrictedView",visibleFraction:I,totalRays:v.length,atDistanceM:Number.isFinite(x)?x:0})}return o}function Ze(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function Me(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var re=Math.PI/180,In=9,X=16;function Se(e,t,n,o){let r=n*re,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function ie(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return le(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let a=0;a<t;a++)s.push(Se(a*n,0,r,i));return s}let l=o/(t-1)*re,u=n/(2*Math.sin(Math.abs(l)/2));for(let a=0;a<t;a++){let c=a*l,f=u*Math.sin(c),b=-u+u*Math.cos(c);s.push(Se(f,b,r,i))}return s}function nt(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function vn(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 ot(e,t){let n=nt(e);return ie(e).map((o,r)=>{let i=n.get(r),s=Me(i),l=Ne(e,r,i),u={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:l,displayLabel:pe(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(a=>a!==void 0&&a!==!1&&a!=="")?u:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function rt(e){let t=[];for(let n of ot(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,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function it(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 Pe(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(c=>[c.index,c])),r=(c,f,b,p)=>{let y=o.get(c),m=Me(y),g=y?.label??`${e.label}-${c+1}`,w=e.displayLabel??e.label;return{index:c,label:g,displayLabel:y?.displayLabel??`${w}-${c+1}`,x:f+(y?.dx??0),y:b+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:m.length>0,accessibility:m,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...p?{side:p}:{}}};if(e.shape==="round"){let c=(e.radius??40)+X,f=e.rotation*re,b=Math.max(0,Math.min(360,e.seatArc??360));if(b>=360||n===1){for(let g=0;g<n;g++){let w=f+g/n*2*Math.PI;t.push(r(g,e.center.x+c*Math.cos(w),e.center.y+c*Math.sin(w)))}return t}let p=b*re,y=(2*Math.PI-p)/2,m=f+y;for(let g=0;g<n;g++){let w=m+g/(n-1)*p;t.push(r(g,e.center.x+c*Math.cos(w),e.center.y+c*Math.sin(w)))}return t}let i=e.width??80,s=e.height??50,l=it(e),u=["top","bottom","left","right"],a=0;for(let c of u){let f=l[c];for(let b=0;b<f;b++){let p,y;c==="top"?(p=-i/2+(b+.5)*i/f,y=-s/2-X):c==="bottom"?(p=-i/2+(b+.5)*i/f,y=s/2+X):c==="left"?(p=-i/2-X,y=-s/2+(b+.5)*s/f):(p=i/2+X,y=-s/2+(b+.5)*s/f);let m=Se(p,y,e.rotation,e.center);t.push(r(a++,m.x,m.y,c))}}return t}function kn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Pe(e).filter(t=>!t.skipped).length}function st(e){return Pe(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.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function at(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 we(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,l=t[r].x,u=t[r].y;s>e.y!=u>e.y&&e.x<(l-i)*(e.y-s)/(u-s)+i&&(n=!n)}return n}function Cn(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),l=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=l+1e-7})}function V(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function W(e,t,n){return we(e,t)&&!V(n).some(o=>we(e,o)||Cn(e,o))}function Rn(e,t){return he(e,t).point}function oe(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 Ie(e){switch(e.type){case"row":{let t=ie(e),n=nt(e),o=0,r=0,i=0;for(let s=0;s<t.length;s++){let l=n.get(s);l?.skip||(o+=t[s].x+(l?.dx??0),r+=t[s].y+(l?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return oe(e.points);case"section":return oe(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?oe(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 Je(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function En(e,t){if(e.type!=="gaArea"||!Je(e.points,t.outline))return!1;let n=V(e.holes),o=V(t.holes);return n.length===o.length&&n.every((r,i)=>Je(r,o[i]))}function ct(e,t,n=e.filter(r=>r.type==="section"),o=Ie(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(s=>(s.logicalSectionId??s.id)===r&&(En(t,s)||W(o,s.outline,s.holes))):void 0)??n.find(s=>W(o,s.outline,s.holes))}function te(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 On(e,t){let n=te(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function lt(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function se(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:V(e.holes).map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:Le(e.outlinePath,t,n)}:{},...e.holes?{holes:V(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 An(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:se(s,0,i))}),{...e,objects:n,floors:void 0}}function et(e,t,n,o,r,i,s,l,u){let a=[],c=e.filter(m=>m.type==="section"),f=me(e),b=m=>!m?.eventConfigurationId||m.eventConfigurationId===o&&(m.eventConfigurationVersion===void 0||m.eventConfigurationVersion===u),p=m=>Ke(m,{activeConfigurationId:o,activeConfigurationVersion:u,activeBasisSha256:r,now:l}),y=(m,g)=>p(m)?{...m,coverage:g}:void 0;for(let m of e){let g=[];if(m.type==="row"?g=rt(m):m.type==="table"?g=st(m):m.type==="booth"&&(g=at(m)),!g.length)continue;for(let M of g)M.viewUrl&&!b(M.viewMeta)&&(M.viewUrl=void 0,M.viewMeta=void 0);if(m.type==="row"){let M=f.get(m.id);if(M){let d=new Map((m.overrides??[]).map(h=>[h.index,h]));for(let h of g){let S=Number(h.id.slice(h.id.lastIndexOf(":")+1));if(!Number.isInteger(S))continue;h.logicalRowId=M.groupId,h.logicalSeatIndex=M.adjacencyOffset+S,d.get(S)?.displayLabel||(h.displayLabel=pe(m,S,M)),!h.viewUrl&&M.viewFromSeatUrl&&b(M.viewFromSeatMeta)&&(h.viewUrl=M.viewFromSeatUrl,h.viewMeta=M.viewFromSeatMeta);let x=d.get(S)?.confidenceEvidence;h.confidenceEvidence=y(x,"exact-seat")??y(m.confidenceEvidence,"row-representative")??y(M.confidenceEvidence,"row-representative")}}}let w=ct(e,m,c,m.type==="row"?oe(g):Ie(m)),v=w?.viewFromSeatUrl,C=(w?.zone?t?.find(M=>M.id===w.zone):void 0)?.focalPoint??n;for(let M of g){if(!M.confidenceEvidence){let d=Number(M.id.slice(M.id.lastIndexOf(":")+1)),h=(m.type==="row"||m.type==="table")&&Number.isInteger(d)?m.overrides?.find(S=>S.index===d)?.confidenceEvidence:void 0;M.confidenceEvidence=y(h,"exact-seat")??(m.type==="row"?y(m.confidenceEvidence,"row-representative"):void 0)}M.confidenceEvidence??=y(w?.confidenceEvidence,"section-representative")??(s?y(s.evidence,s.coverage):void 0),!M.viewUrl&&v&&b(w?.viewFromSeatMeta)&&(M.viewUrl=v,M.viewMeta=w?.viewFromSeatMeta),!M.viewUrl&&i&&b(i.meta)&&(M.viewUrl=i.url,M.viewMeta=i.meta),w&&(M.sectionId=w.logicalSectionId??w.id),w?.zone&&(M.zoneId=w.zone),C&&(M.focalPoint={...C})}a.push(...g)}return a}function Tn(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,l=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,u=et(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&tt(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,u);for(let a of u)a.floorId=r.id;for(let a of u)o.push(a)}return o}let n=et(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&tt(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),_n(e,n,t)}function _n(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||Ze(t,qe(t,Qe(e))),t}function tt(e,t,n,o){let r=e.filter(f=>f.type==="section"),i=n>0||r.some(f=>f.height!==void 0||f.rake!==void 0||(f.elevation??0)>0);if(!r.length||!i||!t){for(let f of o)f.eyeHeightM=n+Y;return}let s=new Array(o.length),l=new Map;for(let f of r)l.has(f.id)||l.set(f.id,f);let u=new Map,a=new Map;for(let f=0;f<o.length;f++){let b=o[f],y=(b.sectionId?l.get(b.sectionId)??r.find(g=>g.logicalSectionId===b.sectionId&&W({x:b.x,y:b.y},g.outline,g.holes)):void 0)??r.find(g=>W({x:b.x,y:b.y},g.outline,g.holes))??null;if(s[f]=y,!y)continue;u.has(y.id)||u.set(y.id,Be(y,{floorBaseHeightM:n}));let m=a.get(y.id);m?m.push(f):a.set(y.id,[f])}let c=new Array(o.length).fill(void 0);for(let[f,b]of a){let p=u.get(f);if(!p)continue;let y=p.rake>0?Math.tan(p.rake*Math.PI/180):0,m=Ge(f,o,b,t);for(let g of m.rows){let w=g.blockDepth*K*y,v=p.height+w;for(let R of g.seatIndices)c[R]=v}}for(let f=0;f<o.length;f++){let b=o[f],p=s[f];if(!p){b.eyeHeightM=n+Y;continue}let y=u.get(p.id);b.eyeHeightM=(c[f]??y.height)+Y}}var ne=40;function $(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,s=-1/0,l=(a,c)=>{a<o&&(o=a),c<r&&(r=c),a>i&&(i=a),c>s&&(s=c)},u=a=>{if(Array.isArray(a))for(let c of a)!c||typeof c!="object"||l(c.x,c.y)};for(let a of lt(e))if(a.type==="row"){let c=new Map((a.overrides??[]).map(f=>[f.index,f]));ie(a).forEach((f,b)=>{let p=c.get(b);p?.skip||l(f.x+(p?.dx??0),f.y+(p?.dy??0))})}else if(a.type==="gaArea")u(a.points);else if(a.type==="section")u(a.outline);else if(a.type==="decorImage")l(a.x,a.y),l(a.x+a.width,a.y+a.height);else if(a.type==="shape")a.points&&a.points.length?u(a.points):a.x!=null&&a.y!=null&&a.width!=null&&a.height!=null&&(l(a.x,a.y),l(a.x+a.width,a.y+a.height));else if(a.type==="table"){let c=X+In,f=a.shape==="round"?(a.radius??40)+c:Math.max((a.width??80)/2,(a.height??50)/2)+c;l(a.center.x-f,a.center.y-f),l(a.center.x+f,a.center.y+f)}else if(a.type==="booth"){let c=Math.max(a.width,a.height)/2;l(a.center.x-c,a.center.y-c),l(a.center.x+c,a.center.y+c)}else if(a.type==="text"){if(n)continue;let c=ue(a);l(a.position.x,a.position.y),l(a.position.x+c.width,a.position.y+c.height)}for(let a of[e.referenceImage,e.backgroundImage]){if(!a)continue;let{center:c,width:f}=a;if(!c||!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(f))continue;let b=f*3/4;l(c.x-f/2,c.y-b/2),l(c.x+f/2,c.y+b/2)}if(!isFinite(o)){let a=e.focalPoint??{x:0,y:0};return{x:a.x-200,y:a.y-200,width:400,height:400}}return{x:o-ne,y:r-ne,width:i-o+ne*2,height:s-r+ne*2}}function ut(e){let t=e.backgroundImage;return t?.url&&!t.assetId?t:void 0}var ft=.08,Dn=.045;function ve(e){return`__floor__:${encodeURIComponent(e)}`}function dt(e,t,n){return{...e,objects:t,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function Ln(e,t,n){let o=e.focalPoint??t.focalPoint;return o?o.x:n.x+n.width/2}function ht(e){let t=e.floors??[];if(!t.length)return[];let n=t.map(s=>$(dt(e,s.objects,s.focalPoint),{freeText:"exclude"})),r=Math.max(1,...n.map(s=>s.width))*ft,i=0;return t.map((s,l)=>{let u=n[l],a=i-(u.y+u.height);return i-=u.height+r,{floorId:s.id,label:s.name??s.id,level:l,levelBadge:l===0?"G":String(l),translation:{x:-Ln(s,e,u),y:a},bounds:u}})}function Fn(e,t,n,o){let r=t==="name"?e.label:e.levelBadge;if(!r)return[];let i=Math.max(1,n*Dn),s=e.bounds.x+e.translation.x,l=e.bounds.y+e.translation.y+i*.4,u=`floor-level-${e.floorId}`,a={type:"text",id:`${u}-text`,text:r,position:{x:s,y:l},fontSize:i,rotation:0,color:o,bold:!0};if(t==="name")return[a];let c=i*.95;return[{type:"shape",id:`${u}-badge`,kind:"ellipse",x:s-c*.35,y:l-c*.3,width:c*2,height:c*2,fill:"transparent",stroke:{color:o,width:Math.max(1,i*.09)},opacity:.8},a]}function Nn(e,t={}){let n=e.floors;if(!n||n.length<2)return e;let o=ht(e),r=[];n.forEach((a,c)=>{let{x:f,y:b}=o[c].translation;for(let p of a.objects)c>0&&p.type==="shape"&&p.role==="stage"||r.push(se(p,f,b))});let i={...e,objects:r,floors:void 0},s=$(i,{freeText:"exclude"}),l=Math.max(1,s.width,s.height),u=e.theme?.textColor??"#94a3b8";for(let a of o)r.push(...Fn(a,t.labelStyle??"number",l,u));return{...i,objects:r,referenceImage:void 0,backgroundImage:void 0}}function jn(e){if(!e.floors||e.floors.length<2)return e;let t=!e.zones?.length,n=new Set,o=e.floors.flatMap(i=>i.objects.flatMap(s=>{if(s.type==="shape"&&s.role==="stage"){let l=JSON.stringify([s.kind,s.x,s.y,s.width,s.height,s.points,s.rotation??0,s.label,s.heightM,s.eventConfigurationIds]);if(n.has(l))return[];n.add(l)}return t&&s.type==="section"?[{...s,zone:ve(i.id)}]:[s]})),r=t?e.floors.map(i=>({id:ve(i.id),label:i.name,focalPoint:{...i.focalPoint}})):e.zones;return{...e,objects:o,zones:r,floors:void 0,referenceImage:void 0,backgroundImage:ut(e)}}function Bn(e){let t=e.floors;if(!t?.length)return null;let n=t.find(i=>i.objects.some(s=>s.type==="shape"&&s.role==="stage"));if(n)return n.id;let o=t[0],r=-1;for(let i of t){let s=$(dt(e,i.objects,i.focalPoint),{freeText:"exclude"}),l=s.width*s.height;l>r&&(r=l,o=i)}return o.id}var Hn=640;function Xn(e,t){return(e.floors?.length??0)<2?null:"all"}function Un(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 ae(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),l=o*i-r*s,a=o*s+r*i-e.distance,c=n-e.height,f=Math.hypot(e.distance,e.height),b=(-e.distance*a-e.height*c)/f,p=(-e.height*a+e.distance*c)/f,y=Math.max(f*.08,b),m=e.focalLength/y;return{x:e.target.x+l*m,y:e.target.y-p*m,depth:y,scale:m}}function Gn(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 Kn(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 Yn(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 Vn(e,t,n=()=>0){let o=ae(e,t,n(t)),r={x:t.x+1,y:t.y},i={x:t.x,y:t.y+1},s=ae(e,r,n(r)),l=ae(e,i,n(i)),u=s.x-o.x,a=s.y-o.y,c=l.x-o.x,f=l.y-o.y;return{a:u,b:a,c,d:f,e:o.x-u*t.x-c*t.y,f:o.y-a*t.x-f*t.y}}function zn(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 mt=9;function Wn(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 $n(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,l=r;if(i){let u=-i*Math.PI/180,a=Math.cos(u),c=Math.sin(u);s=o*a-r*c,l=o*c+r*a}return Math.abs(s)<=e.shape.width/2&&Math.abs(l)<=e.shape.height/2}function Qn(e,t,n,o,r){if(e.shape.kind==="circle"){let y=Math.min(Math.max(e.seat.x,t),o),m=Math.min(Math.max(e.seat.y,n),r),g=e.seat.x-y,w=e.seat.y-m;return g*g+w*w<=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,l=Math.cos(s),u=Math.sin(s),a=e.shape.width/2,c=e.shape.height/2,f=[[-a,-c],[a,-c],[a,c],[-a,c]].map(([y,m])=>[e.seat.x+y*l-m*u,e.seat.y+y*u+m*l]),b=[[t,n],[o,n],[o,r],[t,r]],p=[[1,0],[0,1],[l,u],[-u,l]];for(let[y,m]of p){let g=1/0,w=-1/0;for(let[C,M]of f){let d=C*y+M*m;d<g&&(g=d),d>w&&(w=d)}let v=1/0,R=-1/0;for(let[C,M]of b){let d=C*y+M*m;d<v&&(v=d),d>R&&(R=d)}if(w<v||R<g)return!1}return!0}function qn(e,t={}){let n=t.seatRadius??mt,o=e.length,r=new Array(o),i=1/0,s=1/0,l=-1/0,u=-1/0,a=0;for(let d=0;d<o;d++){let h=e[d],S=t.shapeOf?.(h)??{kind:"circle",r:n},{hx:x,hy:I}=Wn(S);r[d]={seat:h,shape:S,hx:x,hy:I},h.x-x<i&&(i=h.x-x),h.y-I<s&&(s=h.y-I),h.x+x>l&&(l=h.x+x),h.y+I>u&&(u=h.y+I),x>a&&(a=x),I>a&&(a=I)}o===0&&(i=0,s=0,l=0,u=0);let c=a>0?a*4:1,f=Math.max(l-i,0),b=Math.max(u-s,0),p=Math.max(64,t.maxCells??o*4),y=c,m=Math.max(1,Math.ceil(f/y)||1),g=Math.max(1,Math.ceil(b/y)||1);for(;m*g>p&&(m>1||g>1);)y*=2,m=Math.max(1,Math.ceil(f/y)||1),g=Math.max(1,Math.ceil(b/y)||1);let w=m*g,v=new Int32Array(w+1),R=0;for(let d=0;d<o;d++){let h=r[d],S=F(Math.floor((h.seat.x-h.hx-i)/y),0,m-1),x=F(Math.floor((h.seat.x+h.hx-i)/y),0,m-1),I=F(Math.floor((h.seat.y-h.hy-s)/y),0,g-1),A=F(Math.floor((h.seat.y+h.hy-s)/y),0,g-1);for(let P=I;P<=A;P++)for(let k=S;k<=x;k++)v[P*m+k+1]++,R++}for(let d=0;d<w;d++)v[d+1]+=v[d];let C=new Int32Array(R),M=v.slice(0,w);for(let d=0;d<o;d++){let h=r[d],S=F(Math.floor((h.seat.x-h.hx-i)/y),0,m-1),x=F(Math.floor((h.seat.x+h.hx-i)/y),0,m-1),I=F(Math.floor((h.seat.y-h.hy-s)/y),0,g-1),A=F(Math.floor((h.seat.y+h.hy-s)/y),0,g-1);for(let P=I;P<=A;P++)for(let k=S;k<=x;k++){let E=P*m+k;C[M[E]++]=d}}return{seats:e,entries:r,minX:i,minY:s,cell:y,cols:m,rows:g,cellStart:v,items:C,stamp:new Int32Array(o),epoch:0}}function Zn(e,t,n={}){let{cols:o,rows:r,cell:i,minX:s,minY:l,cellStart:u,items:a,entries:c}=e,f=Math.floor((t.x-s)/i),b=Math.floor((t.y-l)/i);if(f<0||b<0||f>=o||b>=r)return null;let p=b*o+f,y=u[p+1],m=-1,g=1/0;for(let w=u[p];w<y;w++){let v=a[w],R=c[v];if(n.filter&&!n.filter(R.seat.id,R.seat)||!$n(R,t.x,t.y))continue;let C=t.x-R.seat.x,M=t.y-R.seat.y,d=C*C+M*M;(d<g||d===g&&v<m)&&(g=d,m=v)}return m<0?null:c[m].seat.id}function Jn(e,t,n,o={}){if(!(n>0))return null;let{cols:r,rows:i,cell:s,minX:l,minY:u,cellStart:a,items:c,entries:f}=e,b=Math.max(0,Math.floor((t.x-n-l)/s)),p=Math.min(r-1,Math.floor((t.x+n-l)/s)),y=Math.max(0,Math.floor((t.y-n-u)/s)),m=Math.min(i-1,Math.floor((t.y+n-u)/s));if(b>p||y>m)return null;let g=-1,w=n*n,v=e.stamp,R=++e.epoch;for(let C=y;C<=m;C++){let M=C*r;for(let d=b;d<=p;d++){let h=M+d,S=a[h+1];for(let x=a[h];x<S;x++){let I=c[x];if(v[I]===R)continue;v[I]=R;let A=f[I];if(o.filter&&!o.filter(A.seat.id,A.seat))continue;let P=t.x-A.seat.x,k=t.y-A.seat.y,E=P*P+k*k;(E<w||E===w&&I<g)&&(w=E,g=I)}}}return g<0?null:f[g].seat.id}function eo(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),l=n.mode??"center",{cols:u,rows:a,cell:c,minX:f,minY:b,cellStart:p,items:y,entries:m}=e,g=Math.max(0,Math.floor((o-f)/c)),w=Math.min(u-1,Math.floor((r-f)/c)),v=Math.max(0,Math.floor((i-b)/c)),R=Math.min(a-1,Math.floor((s-b)/c));if(g>w||v>R)return[];let C=[],M=e.stamp,d=++e.epoch;for(let h=v;h<=R;h++){let S=h*u;for(let x=g;x<=w;x++){let I=S+x,A=p[I+1];for(let P=p[I];P<A;P++){let k=y[P];if(M[k]===d)continue;M[k]=d;let E=m[k];if(n.filter&&!n.filter(E.seat.id,E.seat))continue;(l==="center"?E.seat.x>=o&&E.seat.x<=r&&E.seat.y>=i&&E.seat.y<=s:Qn(E,o,i,r,s))&&C.push(k)}}}return C.sort((h,S)=>h-S),C.map(h=>m[h].seat.id)}function to(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={AUTOMATIC_ROUND_TABLE_RADIUS_MAX,AUTOMATIC_ROUND_TABLE_RADIUS_MIN,DEFAULT_SEAT_RADIUS,FLOOR_STACK_GAP_RATIO,FLOOR_STACK_MIN_SURFACE_PX,TABLE_SEAT_OFFSET,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,automaticRoundTableRadius,buildAisleHoles,buildSeatIndex,buildSectionShell,chartBounds,combinedFloorZoneId,composeAffine,createPerspectiveCamera,cubicPoint,decomposeAffineLinear,distanceToRings,distributeAlongCubic,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorStackPlacements,floorsOf,gridStats,hitTest,initialFloorMode,invertAffine,layoutCombinedFloorPlan,layoutFloorStack,mainFloorId,nearestWithin,objectCenter,owningSectionForObject,perspectiveTangentAffine,pointInPolygon,pointInPolygonWithHoles,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,projectPerspectivePoint,queryRect,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,stackFloors,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject,usableHoles});
|
|
1
|
+
"use strict";var be=Object.defineProperty;var Ut=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var Xt=Object.prototype.hasOwnProperty;var Kt=(e,t)=>{for(var n in t)be(e,n,{get:t[n],enumerable:!0})},Yt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vt(t))!Xt.call(e,o)&&o!==n&&be(e,o,{get:()=>t[o],enumerable:!(r=Ut(t,o))||r.enumerable});return e};var zt=e=>Yt(be({},"__esModule",{value:!0}),e);var Wr={};Kt(Wr,{AUTOMATIC_ROUND_TABLE_RADIUS_MAX:()=>ft,AUTOMATIC_ROUND_TABLE_RADIUS_MIN:()=>dt,CHAIR_NUMBERING_DIRECTIONS:()=>tt,CHAIR_NUMBERING_FORMATS:()=>nt,CHAIR_NUMBERING_START_MAX:()=>Pe,DEFAULT_SEAT_RADIUS:()=>Dt,FLOOR_STACK_GAP_RATIO:()=>Tt,FLOOR_STACK_MIN_SURFACE_PX:()=>Ir,TABLE_SEAT_OFFSET:()=>H,TEXT_BACKGROUND_PADDING_MAX:()=>so,TEXT_BACKGROUND_RADIUS_MAX:()=>co,TEXT_LETTER_SPACING_MAX:()=>io,TEXT_LETTER_SPACING_MIN:()=>oo,TEXT_LINE_HEIGHT_MAX:()=>ro,TEXT_LINE_HEIGHT_MIN:()=>no,TEXT_OPACITY_MIN:()=>ao,TEXT_WIDTH_MAX:()=>to,TEXT_WIDTH_MIN:()=>eo,aisleSeatIds:()=>Bt,allObjects:()=>Et,applyAffine:()=>Rr,automaticRoundTableRadius:()=>Wn,buildAisleHoles:()=>qt,buildSeatIndex:()=>jr,buildSectionShell:()=>$t,chairNumberingProblem:()=>In,chartBounds:()=>ne,combinedFloorZoneId:()=>_e,compactChairNumbering:()=>Cn,composeAffine:()=>Er,createPerspectiveCamera:()=>kr,cubicPoint:()=>oe,decomposeAffineLinear:()=>Tr,distanceToRings:()=>Xe,distributeAlongCubic:()=>pe,expandBooth:()=>kt,expandChart:()=>yr,expandRow:()=>vt,expandRowSlots:()=>Pt,expandTable:()=>Ct,expandTableSlots:()=>Te,floorObjects:()=>br,floorStackPlacements:()=>_t,floorsOf:()=>$,gridStats:()=>Gr,hitTest:()=>Nr,initialFloorMode:()=>Cr,invertAffine:()=>Or,isAisleSeat:()=>Kr,isRowAisleSeats:()=>q,layoutCombinedFloorPlan:()=>Pr,layoutFloorStack:()=>wr,mainFloorId:()=>vr,mergeRowAisleSeats:()=>zr,nearestWithin:()=>Fr,objectCenter:()=>Le,owningSectionForObject:()=>Ot,perspectiveTangentAffine:()=>Ar,pointInPolygon:()=>Ae,pointInPolygonWithHoles:()=>te,pointOnPolygonBoundary:()=>Rt,polygonArea:()=>xe,polygonInscribedAnchor:()=>Se,polygonLabelPoint:()=>mr,polygonNetArea:()=>en,projectPerspectivePoint:()=>me,queryRect:()=>Br,resolveRowAisleSeats:()=>Xr,resolveSegmentedRowGroups:()=>J,rowInventoryCount:()=>dr,rowSeatPositions:()=>de,segmentedRowComponentSeats:()=>pn,segmentedRowComponents:()=>bn,segmentedRowSeatTotal:()=>yn,smoothCubicThroughMiddle:()=>Wt,splitRowAisleSeats:()=>Yr,stackFloors:()=>pr,tableChairBookingLabel:()=>ve,tableChairDisplayLabel:()=>Ie,tableChairToken:()=>rt,tableInventoryCount:()=>fr,tableSeatCountsBySide:()=>It,textLayoutMetrics:()=>ye,translateObject:()=>fe,usableHoles:()=>U});module.exports=zt(Wr);var qr=Math.PI/180;function T(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 oe(e,t){let n=1-t,r=n*n*n,o=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:r*e.start.x+o*e.control1.x+i*e.control2.x+a*e.end.x,y:r*e.start.y+o*e.control1.y+i*e.control2.y+a*e.end.y}}function Wt(e,t,n){let r={x:(e.x+t.x)/2,y:(e.y+t.y)/2},o={x:(n.x-r.x)*4/3,y:(n.y-r.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+o.x,y:e.y+(t.y-e.y)/3+o.y},control2:{x:e.x+(t.x-e.x)*2/3+o.x,y:e.y+(t.y-e.y)*2/3+o.y},end:{...t}}}function pe(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[oe(e,.5)];let r=Array.from({length:n+1},(d,s)=>oe(e,s/n)),o=new Float64Array(r.length);for(let d=1;d<r.length;d+=1){let s=r[d].x-r[d-1].x,l=r[d].y-r[d-1].y;o[d]=o[d-1]+Math.hypot(s,l)}let i=o[o.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],c=1;for(let d=0;d<t;d+=1){let s=i*d/(t-1);for(;c<o.length-1&&o[c]<s;)c+=1;let l=o[c-1],u=o[c],b=u===l?0:(s-l)/(u-l);a.push({x:r[c-1].x+(r[c].x-r[c-1].x)*b,y:r[c-1].y+(r[c].y-r[c-1].y)*b})}return a}function _(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Q(e,t){return{x:e.x-t.x,y:e.y-t.y}}function D(e,t){return{x:e.x*t,y:e.y*t}}function ie(e,t=13){return Array.from({length:t},(n,r)=>oe(e,r/(t-1)))}function Fe(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),r=Math.min(e.length-2,Math.floor(n));return L(e[r],e[r+1],n-r)}function Be(e,t,n){let r=Math.max(0,Math.min(1,t)),o=Math.max(r,Math.min(1,n)),i=[Fe(e,r)];for(let a=1;a<e.length-1;a+=1){let c=a/(e.length-1);c>r+1e-9&&c<o-1e-9&&i.push(e[a])}return i.push(Fe(e,o)),i}function Ge(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],r=0,o=Number.POSITIVE_INFINITY;n.forEach(([b,p],y)=>{let h=T(L(e[b],e[p],.5),t);h<o&&(o=h,r=y)});let i=e[r],a=e[(r+1)%4],c=e[(r+2)%4],d=e[(r+3)%4],s=L(i,a,.5),l=Q(t,s),u=Math.max(1e-9,Math.hypot(l.x,l.y));return{p0:i,p1:a,p2:c,p3:d,normal:D(l,1/u),depth:(T(i,d)+T(a,c))/2}}function He(e){let{p0:t,p1:n,p2:r,p3:o,normal:i,depth:a}=e,c=Q(n,t),d=Q(r,o),s=a*.22,l=a*.12;return{nearPath:{start:t,control1:_(_(t,D(c,1/3)),D(i,s)),control2:_(_(t,D(c,2/3)),D(i,s)),end:n},farPath:{start:r,control1:_(_(o,D(d,2/3)),D(i,l)),control2:_(_(o,D(d,1/3)),D(i,l)),end:o}}}function $t(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let r=e.reduce((y,h)=>_(y,h),{x:0,y:0});r.x/=4,r.y/=4;let o=T(e[0],e[1]),i=T(e[0],e[3]),a=n==="auto"?o>i*1.25&&T(r,t)>i?"bezier":"tapered":n;if(a==="rectangle")return{mode:a,outline:e.map(y=>({...y}))};let c=Ge(e,t),{p0:d,p1:s,p2:l,p3:u}=c;if(a==="tapered")return{mode:a,outline:[_(d,D(Q(s,d),.14)),_(d,D(Q(s,d),1-.14)),l,u]};let{nearPath:b,farPath:p}=He(c);return{mode:a,outline:[...ie(b),...ie(p).slice(1)]}}function qt(e,t,n,r){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 o=Ge(e,t),{p0:i,p1:a,p2:c,p3:d}=o,s=r==="bezier"?He(o):null,l=s?ie(s.nearPath):null,u=s?ie(s.farPath).reverse():null,b=Math.min(.055,.18/(n+1));return Array.from({length:n},(p,y)=>{let h=(y+1)/(n+1),M=h-b/2,P=h+b/2;return l&&u?[...Be(l,M,P),...Be(u,M,P).reverse()]:[L(i,a,M),L(i,a,P),L(d,c,P),L(d,c,M)]})}var eo=40,to=1200,no=.8,ro=3,oo=-2,io=20,ao=.1,so=40,co=40,Ue=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Qt(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let r=Math.max(1,Math.floor(t/Ue(e))),o=0;for(let i of n){if(!i.length){o+=1;continue}let a=0;for(let c of i.split(/\s+/)){let d=c.length;a&&a+1+d<=r?a+=1+d:(o+=Math.max(1,Math.ceil(d/r)),a=d%r)}}return Math.max(1,o)}function ye(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),r=Math.max(1,...n.map(c=>c.length))*Ue(e),o=e.width??r+t*2,i=Math.max(1,o-t*2),a=Qt(e,i);return{width:o,height:a*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:a,padding:t}}function Zt(e,t,n){let r=n.x-t.x,o=n.y-t.y,i=r*r+o*o,a=i?Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*o)/i)):0;return Math.hypot(e.x-(t.x+a*r),e.y-(t.y+a*o))}function Xe(e,t){let n=1/0;for(let r of t)if(!(r.length<2))for(let o=0,i=r.length-1;o<r.length;i=o++){let a=Zt(e,r[i],r[o]);a<n&&(n=a)}return n}function Ve(e,t){let n=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){let i=t[r].x,a=t[r].y,c=t[o].x,d=t[o].y;a>e.y!=d>e.y&&e.x<(c-i)*(e.y-a)/(d-a)+i&&(n=!n)}return n}function Ke(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Jt(e,t,n){let r=Ve(e,t)&&!n.some(i=>Ve(e,i)),o=Xe(e,[t,...n]);return r?o:-o}function X(e,t,n,r,o){let i=Jt({x:e,y:t},r,o);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var ge=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let r=n.length-1;for(;r>0;){let o=r-1>>1;if(n[o].max>=n[r].max)break;[n[o],n[r]]=[n[r],n[o]],r=o}}pop(){let t=this.items,n=t[0],r=t.pop();if(t.length&&r){t[0]=r;let o=0;for(;;){let i=o*2+1,a=i+1,c=o;if(i<t.length&&t[i].max>t[c].max&&(c=i),a<t.length&&t[a].max>t[c].max&&(c=a),c===o)break;[t[c],t[o]]=[t[o],t[c]],o=c}}return n}};function xe(e){if(e.length<3)return 0;let t=0;for(let n=0,r=e.length-1;n<e.length;r=n++)t+=(e[r].x+e[n].x)*(e[r].y-e[n].y);return Math.abs(t)/2}function en(e,t){return Math.max(0,xe(e)-Ke(t).reduce((n,r)=>n+xe(r),0))}function Se(e,t){let n=Ke(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let h=e.reduce((P,C)=>P+C.x,0)/e.length,M=e.reduce((P,C)=>P+C.y,0)/e.length;return{point:{x:h,y:M},radius:0}}let r=1/0,o=1/0,i=-1/0,a=-1/0;for(let h of e)h.x<r&&(r=h.x),h.y<o&&(o=h.y),h.x>i&&(i=h.x),h.y>a&&(a=h.y);let c=i-r,d=a-o,s=Math.min(c,d);if(!(s>0))return{point:{x:(r+i)/2,y:(o+a)/2},radius:0};let l=Math.max(c,d)/150,u=new ge,b=s/2;for(let h=r;h<i;h+=s)for(let M=o;M<a;M+=s)u.push(X(h+b,M+b,b,e,n));let p=X(r+c/2,o+d/2,0,e,n),y=0;for(;u.size;){let h=u.pop();if(!h)break;h.d>p.d&&(p=h),!(h.max-p.d<=l)&&(y>=4e3||(y+=1,b=h.h/2,u.push(X(h.x-b,h.y-b,b,e,n)),u.push(X(h.x+b,h.y-b,b,e,n)),u.push(X(h.x-b,h.y+b,b,e,n)),u.push(X(h.x+b,h.y+b,b,e,n))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function Z(e,t,n){return Math.max(t,Math.min(n,e))}function F(e,t,n){return e<t?t:e>n?n:e}function tn(e){return Z(e,0,1)}function Ye(e){let t=tn(e);return t*t*(3-2*t)}var K=Math.PI*2;function Y(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function nn(e,t,n){let r=t-e;if(n){for(;r<0;)r+=K;for(;r>=K;)r-=K}else{for(;r>0;)r-=K;for(;r<=-K;)r+=K}return r}function $e(e){if(e.version!==1||e.closed!==!0||!Y(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!Y(n.end))return!1;if(n.kind==="line"){if(T(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!Y(n.control1)||!Y(n.control2)||T(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!Y(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(T(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(T(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||T(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return T(t,e.start)<=1e-4}function rn(e,t,n){let r=1-n;return{x:r**3*e.x+3*r**2*n*t.control1.x+3*r*n**2*t.control2.x+n**3*t.end.x,y:r**3*e.y+3*r**2*n*t.control1.y+3*r*n**2*t.control2.y+n**3*t.end.y}}function qe(e,t=2){if(!$e(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),r=[{...e.start}],o=e.start;for(let i of e.segments){if(i.kind==="line")r.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(o.y-i.center.y,o.x-i.center.x),c=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),d=nn(a,c,i.clockwise),s=Math.max(2,Math.ceil(Math.abs(d)*i.radius/n));for(let l=1;l<=s;l+=1){let u=a+d*l/s;r.push({x:i.center.x+Math.cos(u)*i.radius,y:i.center.y+Math.sin(u)*i.radius})}}else{let a=T(o,i.control1)+T(i.control1,i.control2)+T(i.control2,i.end),c=Math.max(2,Math.ceil(a/n));for(let d=1;d<=c;d+=1)r.push(rn(o,i,d/c))}o=i.end}return T(r[r.length-1],r[0])<=1e-4&&r.pop(),r}function Qe(e,t,n){return on(e,o=>({x:o.x+t,y:o.y+n}))}function on(e,t,n=1,r=!1){return{...e,start:t(e.start),segments:e.segments.map(o=>o.kind==="line"?{...o,end:t(o.end)}:o.kind==="arc"?{...o,center:t(o.center),radius:o.radius*Math.abs(n),clockwise:r?!o.clockwise:o.clockwise,end:t(o.end)}:{...o,control1:t(o.control1),control2:t(o.control2),end:t(o.end)})}}var an=45,Me=150,sn=60;function cn(e){let t=an/100;if(e<=t)return Me;let n=Math.min(1,(e-t)/(1-t));return Me-n*(Me-sn)}var ze=.5523;function We(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function ln(e){let t=[],n=[];for(e.forEach((r,o)=>{Y(r)&&(t.length&&We(t[t.length-1],r)||(t.push({x:r.x,y:r.y}),n.push(o)))});t.length>1&&We(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var un=.5,dn=4/3;function fn(e,t,n){let r=t.x-e.x,o=t.y-e.y,i=Math.hypot(r,o);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-o/i,c=r/i,d=n*dn;return{kind:"bezier",control1:{x:e.x+r/3+a*d,y:e.y+o/3+c*d},control2:{x:e.x+r*2/3+a*d,y:e.y+o*2/3+c*d},end:{...t}}}function Ze(e,t){let{points:n,sourceIndex:r}=ln(e),o=n.length;if(o<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,c=new Array(o).fill(0);if(a?.length)for(let x=0;x<o;x+=1){let g=a[r[x]];c[x]=Number.isFinite(g)?Math.min(100,Math.max(-100,g))/100:0}let d=c.some(x=>Math.abs(x)>1e-6);if(i<=0&&!d)return null;let s=t.wideAngleThresholdDeg??cn(i),l=[];for(let x=0;x<o;x+=1)l[x]=T(n[x],n[(x+1)%o]);let u=new Array(o).fill(0);for(let x=0;x<o;x+=1){let g=n[(x-1+o)%o],f=n[x],m=n[(x+1)%o],w={x:g.x-f.x,y:g.y-f.y},S={x:m.x-f.x,y:m.y-f.y},v=Math.hypot(w.x,w.y),E=Math.hypot(S.x,S.y);if(v<=1e-9||E<=1e-9)continue;let I=Math.min(1,Math.max(-1,(w.x*S.x+w.y*S.y)/(v*E))),k=Math.acos(I)*180/Math.PI;if(k<s)continue;let O=Ye((k-s)/(180-s));u[x]=i*O*.5*Math.min(v,E)}for(let x=0;x<o;x+=1){let g=(x+1)%o,f=u[x]+u[g];if(f>l[x]&&f>1e-9){let m=l[x]/f;u[x]*=m,u[g]*=m}}let b=new Array(o),p=new Array(o);for(let x=0;x<o;x+=1){let g=n[(x-1+o)%o],f=n[x],m=n[(x+1)%o];if(u[x]<=1e-6){b[x]={...f},p[x]={...f};continue}let w=T(f,g)||1,S=T(f,m)||1;b[x]={x:f.x+(g.x-f.x)/w*u[x],y:f.y+(g.y-f.y)/w*u[x]},p[x]={x:f.x+(m.x-f.x)/S*u[x],y:f.y+(m.y-f.y)/S*u[x]}}if(u.every(x=>x<=1e-6)&&!d)return null;let y=[],h={...p[0]},M=h,P=(x,g)=>{if(T(M,x)<=1e-9)return;let f=c[g];Math.abs(f)>1e-6?y.push(fn(M,x,f*un*l[g])):y.push({kind:"line",end:{...x}}),M=x};for(let x=1;x<=o;x+=1){let g=x%o,f=n[g];P(b[g],(x-1)%o),u[g]>1e-6&&T(b[g],p[g])>1e-9&&(y.push({kind:"bezier",control1:L(b[g],f,ze),control2:L(p[g],f,ze),end:{...p[g]}}),M=p[g])}if(!y.length)return null;let C=y[y.length-1];T(C.end,h)>1e-9&&(C.kind==="line"?C.end={...h}:y.push({kind:"line",end:{...h}}));let R={version:1,closed:!0,start:h,segments:y};return $e(R)?R:null}function mn(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((r,o)=>{let i=e.edgeCurvature[o];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(r=>Math.abs(r)>.5)?n:[]}function hn(e){let t=mn(e);return t.length?Ze(e.points,{edgeCurvature:t}):null}function ae(e,t=2){let n=hn(e);return n?qe(n,t):e.points??[]}function bn(e,t,n){let r=[];for(let o=0;o<e.length-1;o+=1){let i=e[o],a=e[o+1],c=Math.hypot(a.x-i.x,a.y-i.y);if(c<=0)continue;let d=Math.max(1,Math.round(c/n)),s=c/d,l=Math.atan2(a.y-i.y,a.x-i.x),u=o===0,p=(o>0?t[o-1]:void 0)==="break"?2:1,y=u?{...i}:{x:i.x+Math.cos(l)*s*p,y:i.y+Math.sin(l)*s*p},h=u?d+1:Math.max(1,d-(p-1));r.push({origin:y,rotation:l*180/Math.PI,seatCount:h,seatSpacing:s})}return r}function pn(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(r,o)=>({x:e.origin.x+n.x*o*e.seatSpacing,y:e.origin.y+n.y*o*e.seatSpacing}))}function yn(e){return e.reduce((t,n)=>t+n.seatCount,0)}function J(e){let t=new Map,n=new Map;for(let r of e){if(r.type!=="row"||!r.segmentedRow)continue;let o=n.get(r.segmentedRow.groupId)??[];o.push(r),n.set(r.segmentedRow.groupId,o)}for(let[r,o]of n){let i=o.slice().sort((b,p)=>b.segmentedRow.componentIndex-p.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,c=i[0]?.segmentedRow;if(!c||!(a>=2&&i.length===a&&c?.boundaryBefore==="start"&&i.every((b,p)=>b.segmentedRow?.kind==="segmented-row-v1"&&b.segmentedRow.groupId===r&&b.segmentedRow.componentCount===a&&b.segmentedRow.componentIndex===p&&b.segmentedRow.repeatLabelOnComponents===c.repeatLabelOnComponents&&(p===0?b.segmentedRow.boundaryBefore==="start":b.segmentedRow.boundaryBefore!=="start")&&b.segmentedRow.displayLabel===c.displayLabel)))continue;let s=i.reduce((b,p)=>b+p.seatCount,0),l=0,u=0;for(let b of i)b.segmentedRow.boundaryBefore==="break"&&(l+=1),t.set(b.id,{groupId:r,adjacencyOffset:l,displayOffset:u,displayLabel:c.displayLabel,totalSeats:s,canonical:i[0],viewFromSeatUrl:c.viewFromSeatUrl,viewFromSeatMeta:c.viewFromSeatMeta,confidenceEvidence:c.confidenceEvidence}),l+=b.seatCount,u+=b.seatCount}return t}var gn="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var xn="abcdefghijklmnopqrstuvwxyz";function Sn(e,t){let n=t.length,r=e+1,o="";for(;r>0;){r-=1;let i=r%n;o=t[i]+o,r=Math.floor(r/n)}return o}function ee(e,t=!1){let n=t?xn:gn;return Sn(Math.max(0,Math.floor(e)-1),n)}var Mn=[[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 Je(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[r,o]of Mn)for(;t>=r;)n+=o,t-=r;return n}function wn(e){let t=new Array(e);return Array.from({length:e},(n,r)=>r).sort((n,r)=>Math.abs(2*n-(e-1))-Math.abs(2*r-(e-1))||n-r).forEach((n,r)=>t[n]=r),t}function se(e,t){let n=e.seatLabelStart??1,r=e.seatNumbering?.direction??"ltr",o=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",c=e.seatNumbering?.endAt,d=e.seatCount;if(i==="updown"||i==="updown-descending"){let p=Math.ceil(d/2),y=i==="updown"?t<p?n+2*t:n-1+2*(d-t):t<p?n+2*(p-1-t):n+1+2*(t-p);return`${a}${y}`}let s=i==="odd"||i==="even"?2:o,l=c!=null&&Number.isFinite(c)?c-(d-1)*s:n,u=r==="center"?wn(d)[t]:r==="rtl"?d-1-t:t,b;switch(i){case"odd":{let p=l%2===1?l:l+1;b=String(p+u*2);break}case"even":{let p=l%2===0?l:l+1;b=String(p+u*2);break}case"roman":b=Je(l+u*o);break;case"letters-upper":b=ee(l+u*o,!1);break;case"letters-lower":b=ee(l+u*o,!0);break;default:b=String(l+u*o);break}return`${a}${b}`}function Pn(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function et(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${se(e,t)}`}function we(e,t,n,r){if(r?.displayLabel)return r.displayLabel;if(e.seatDisplayLabelMode==="number")return se(e,t);if(!n)return`${e.displayLabel||e.label}-${se(e,t)}`;let o=Pn(n),i=n.displayOffset+t;return`${n.displayLabel}-${se(o,i)}`}var Pe=999,tt=["clockwise","anticlockwise"],nt=["table-number","number","letter"];function ve(e,t){return`${e.label}-${t+1}`}function vn(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function rt(e,t){let n=e.chairNumbering,r=n?.start??1,o=vn(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?ee(Math.max(1,r)+o):String(r+o)}function Ie(e,t){let n=rt(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function In(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,n=Object.keys(t).filter(r=>!["start","direction","format"].includes(r));return n.length?`chairNumbering has unsupported field(s): ${n.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>Pe)?`chairNumbering.start must be a whole number from 0 to ${Pe}`:t.direction!==void 0&&!tt.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!nt.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}function Cn(e){let t={};return e.start!==void 0&&e.start!==1&&(t.start=e.start),e.direction==="anticlockwise"&&(t.direction="anticlockwise"),e.format&&e.format!=="table-number"&&(t.format=e.format),Object.keys(t).length?t:void 0}var z=.02291666666666667,vo=1/z,kn=58,Rn=kn*z;var On=3,ot=0,Ce=120,En=0,An=45,Tn=7,W=1.2;function ke(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function Ln(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Tn?e:On}function it(e,t={}){let n=ke(t.floorBaseHeightM,ot,Ce,0),r=Math.min(Ce,n+Ln(e.elevation)*Rn),o=e.height===void 0?r:ke(e.height,ot,Ce,r),i=ke(e.rake,En,An,0);return{height:o,rake:i}}function at(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 st(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 r=1/0;for(let o=0;o+1<e.length;o++){let i=e[o],a=e[o+1],c=a.x-i.x,d=a.y-i.y,s=c*c+d*d,l=s>1e-12?((t-i.x)*c+(n-i.y)*d)/s:0;l<0?l=0:l>1&&(l=1);let u=t-(i.x+l*c),b=n-(i.y+l*d);if(Math.abs(u)>=r||Math.abs(b)>=r)continue;let p=Math.hypot(u,b);p<r&&(r=p)}return r}function _n(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let r=e.length||1;t/=r,n/=r;let o=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>o&&(o=a)}return{cx:t,cy:n,r:o}}function ct(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Re(e,t){let n=1/0;for(let r of at(e)){let o=st(t,r.x,r.y);o<n&&(n=o)}for(let r of at(t)){let o=st(e,r.x,r.y);o<n&&(n=o)}return n}function Dn(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,r=0;for(let l of e)n+=l.x,r+=l.y;n/=e.length,r/=e.length;let o=-1,i=e[0];for(let l of e){let u=Math.hypot(l.x-n,l.y-r);u>o&&(o=u,i=l)}let a=i.x-n,c=i.y-r,d=Math.hypot(a,c);d>1e-9?(a/=d,c/=d):(a=1,c=0);let s=e.map((l,u)=>({p:l,i:u,t:(l.x-n)*a+(l.y-r)*c})).sort((l,u)=>l.t-u.t);return{pts:s.map(l=>l.p),seatIndices:s.map(l=>t[l.i])}}function jn(e){let t=e.length;if(t<3)return null;let n=0,r=0;for(let C of e)n+=C.x,r+=C.y;n/=t,r/=t;let o=0,i=0,a=0,c=0,d=0,s=0,l=0;for(let C of e){let R=C.x-n,x=C.y-r;o+=R*R,a+=x*x,i+=R*x,c+=R*R*R,d+=x*x*x,s+=R*x*x,l+=x*R*R}let u=o*a-i*i;if(Math.abs(u)<1e-9)return null;let b=(c+s)/2,p=(d+l)/2,y=(b*a-p*i)/u,h=(p*o-b*i)/u,M=y+n,P=h+r;return!Number.isFinite(M)||!Number.isFinite(P)?null:{cx:M,cy:P}}var Nn=.15;function Fn(e){if(e.length<2)return null;let t=e.map(g=>{let f=0,m=0;for(let w of g.pts)f+=w.x,m+=w.y;return{x:f/g.pts.length,y:m/g.pts.length}}),n=0,r=0;for(let g of t)n+=g.x,r+=g.y;n/=t.length,r/=t.length;let o=0,i=0,a=0;for(let g of t){let f=g.x-n,m=g.y-r;o+=f*f,i+=f*m,a+=m*m}let c=o+a,d=o*a-i*i,s=c/2+Math.sqrt(Math.max(0,c*c/4-d)),l,u;Math.abs(i)>1e-12?(l=s-a,u=i):o>=a?(l=1,u=0):(l=0,u=1);let b=Math.hypot(l,u);if(!(b>1e-12))return null;l/=b,u/=b;let p=0,y=0,h=0;for(let g of e){if(g.pts.length<2)continue;let f=g.pts[0],m=g.pts[g.pts.length-1],w=m.x-f.x,S=m.y-f.y,v=Math.hypot(w,S);if(!(v>1e-9))continue;let E=w/v,I=S/v;p+=(E*E-I*I)*v,y+=2*E*I*v,h+=v}if(h>0&&Math.hypot(p,y)>=Gn*h){let g=Math.atan2(y,p)/2,f=Math.cos(g),m=Math.sin(g);Math.abs(l*f+u*m)>Hn&&(l=-m,u=f)}let M=1/0,P=-1/0,C=[];for(let g of e){let f=1/0,m=-1/0;for(let w of g.pts){let S=w.x*l+w.y*u;S<f&&(f=S),S>m&&(m=S),S<M&&(M=S),S>P&&(P=S)}C.push(m-f)}let R=P-M;return R>1e-9?(C.sort((g,f)=>g-f),C[Math.min(C.length-1,Math.floor(C.length*.9))]/R<=Bn?{x:l,y:u}:null):null}var Bn=.35,Gn=.8,Hn=.7;function lt(e,t,n,r){let o=new Map;for(let f of n){let m=t[f],w=m.rowId||`__seat-${f}`,S=o.get(w);S||(S={pts:[],idx:[]},o.set(w,S)),S.pts.push({x:m.x,y:m.y}),S.idx.push(f)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[f,m]of o){let w=Dn(m.pts,m.idx),S=0;for(let v of w.pts)S+=Math.hypot(v.x-r.x,v.y-r.y);i.push({id:f,pts:w.pts,seatIndices:w.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:S/w.pts.length})}let a=i.map(f=>_n(f.pts)),c=i.length<=256?i.length*(i.length-1)/2:0,d=c?new Float64Array(c):null;d?.fill(Number.NaN);let s=d?new Map(i.map((f,m)=>[f,m])):null,l=(f,m)=>(f>m&&([f,m]=[m,f]),f*(2*i.length-f-1)/2+(m-f-1)),u=(f,m)=>{if(!d)return Re(i[f].pts,i[m].pts);let w=l(f,m),S=d[w];if(!Number.isNaN(S))return S;let v=Re(i[f].pts,i[m].pts);return d[w]=v,v},b=(f,m)=>s?u(s.get(f),s.get(m)):Re(f.pts,m.pts),p=[];for(let f=0;f<i.length;f++){let m=1/0;for(let w=0;w<i.length;w++){if(f===w||ct(a[f],a[w])>=m)continue;let S=u(f,w);S<m&&(m=S)}Number.isFinite(m)&&p.push(m)}p.sort((f,m)=>f-m);let y=p.length?p[Math.floor(p.length/2)]:1,h=Math.max(y*1.8,1e-6),M=i.map(()=>[]);for(let f=0;f<i.length;f++)for(let m=f+1;m<i.length;m++)ct(a[f],a[m])>h||u(f,m)<=h&&(M[f].push(m),M[m].push(f));let P=0;for(let f=0;f<i.length;f++){if(i[f].blockId!==-1)continue;let m=P++,w=[f];for(i[f].blockId=m;w.length;){let S=w.pop();for(let v of M[S])i[v].blockId===-1&&(i[v].blockId=m,w.push(v))}}let C=new Map;for(let f of i){let m=C.get(f.blockId)??[];m.push(f),C.set(f.blockId,m)}let R=[];for(let f of i){if(f.pts.length<4)continue;let m=jn(f.pts);m&&(!Number.isFinite(m.cx)||!Number.isFinite(m.cy)||R.push({x:m.cx,y:m.cy}))}let x=R.length>=2?(()=>{let f=R.map(S=>S.x).sort((S,v)=>S-v),m=R.map(S=>S.y).sort((S,v)=>S-v),w=Math.floor(R.length/2);return{cx:f[w],cy:m[w]}})():null;if(x){let f=I=>Math.hypot(I.x-x.cx,I.y-x.cy),m=1/0,w=-1/0,S=[];for(let I of i){let k=1/0,O=-1/0;for(let j of I.pts){let B=f(j);B<k&&(k=B),B>O&&(O=B)}S.push(O-k),k<m&&(m=k),O>w&&(w=O)}let v=w-m;S.sort((I,k)=>I-k);let E=S[Math.min(S.length-1,Math.floor(S.length*.9))];if(v>1e-9&&E/v<=Nn){let I=i.map(A=>{let re=0;for(let Ht of A.pts)re+=f(Ht);return{row:A,radius:re/A.pts.length}}),k=0,O=0;for(let A of I)k+=A.radius,O+=A.row.focalDistance;k/=I.length,O/=I.length;let j=0;for(let A of I)j+=(A.radius-k)*(A.row.focalDistance-O);if(j<0)for(let A of I)A.radius=-A.radius;let G=1/0;for(let A of I)A.radius<G&&(G=A.radius);I.sort((A,re)=>A.radius-re.radius);let N=-1,V=-1/0,Gt=v/Math.max(1,I.length)*.5,Ne=[];for(let A of I)A.radius-V>Gt&&(N++,V=A.radius),A.row.ordinal=N,A.row.blockDepth=A.radius-G,Ne.push(A.row);return{sectionId:e,rows:Ne,blockCount:P}}}let g=[];for(let[,f]of C){let m=Fn(f);if(m){let w=I=>{let k=0;for(let O of I.pts)k+=O.x*m.x+O.y*m.y;return k/I.pts.length};f.sort((I,k)=>w(I)-w(k)),f.length>=2&&f[0].focalDistance>f[f.length-1].focalDistance&&f.reverse();let S=[],v=y*.5;for(let I of f){let k=S[S.length-1];k&&Math.abs(w(I)-w(k[0]))<v?k.push(I):S.push([I])}let E=0;for(let I=0;I<S.length;I++){if(I>0){let k=1/0;for(let O of S[I-1])for(let j of S[I])k=Math.min(k,b(O,j));E+=k}for(let k of S[I])k.ordinal=I,k.blockDepth=E,g.push(k)}}else{let w=1/0;for(let S of f)S.focalDistance<w&&(w=S.focalDistance);f.sort((S,v)=>S.focalDistance-v.focalDistance);for(let S=0;S<f.length;S++)f[S].ordinal=S,f[S].blockDepth=Math.max(0,f[S].focalDistance-w),g.push(f[S])}}return{sectionId:e,rows:g,blockCount:P}}var Un=/^\d{4}-\d{2}-\d{2}$/;function Vn(e){let t=Date.parse(e);return Number.isFinite(t)?Un.test(e)?t+864e5:t:null}function Xn(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let r=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(r)&&(t instanceof Date?t.getTime():t)<=r+366*864e5}let n=Vn(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Kn(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function Yn(e){return e.status!=="draft"&&e.status!=="retracted"}function zn(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function ut(e,t={}){return!!e&&Yn(e)&&Kn(e,t.activeConfigurationId,t.activeConfigurationVersion)&&zn(e,t.activeBasisSha256)&&Xn(e,t.now)}var dt=36,ft=160;function Wn(e,t=360){let n=Z(Math.round(Number.isFinite(e)?e:1),1,40),r=Z(Number.isFinite(t)?t:360,120,360);return Math.round(Z(n*4*(360/r),dt,ft))}var $n=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function qn(e){return!!e&&$n.has(e)}var mt=1.1;var Eo=Math.PI*2;var Ao=(()=>{let t={x:0,y:52},n=25,r={x:70,y:t.y-70},o=(r.x*r.x+r.y*r.y-4900)/(2*(r.y+70)),i=o+70,a=[],c=Math.atan2(r.y-o,r.x),d=Math.atan2(r.y-o,-r.x);for(let s=0;s<=24;s++){let l=c+(d-c)*s/24;a.push({x:i*Math.cos(l),y:o+i*Math.sin(l)})}return{half:70,home:t,backstop:n,fence:a}})();function ht(e){return qn(e)}function Qn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?ae(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,r=e.width,o=e.height;return[{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+o},{x:t,y:n+o}]}function Zn(e,t,n){let r=n*Math.PI/180,o=Math.cos(r),i=Math.sin(r),a=e.x-t.x,c=e.y-t.y;return{x:t.x+a*o-c*i,y:t.y+a*i+c*o}}function bt(e){let t=Qn(e);if(!t||t.length<2)return null;let n=e.rotation??0,r=Math.abs(n)<1e-6?t:t.map(d=>Zn(d,{x:t.reduce((s,l)=>s+l.x,0)/t.length,y:t.reduce((s,l)=>s+l.y,0)/t.length},n)),o=1/0,i=1/0,a=-1/0,c=-1/0;for(let d of r)o=Math.min(o,d.x),i=Math.min(i,d.y),a=Math.max(a,d.x),c=Math.max(c,d.y);return!Number.isFinite(o)||a-o<1e-6||c-i<1e-6?null:{minX:o,minY:i,maxX:a,maxY:c}}var Jn=5,er=3,tr=.92,nr=1.9,rr=2,or=.6,ir=1,ar=.06;function sr(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?mt:ht(e.stageKind)?ar:ir}function pt(e){let t=1/0,n=1/0,r=-1/0,o=-1/0,i=-1/0;for(let a of $(e)){let c=a.baseHeightM??0;for(let d of a.objects){if(d.type!=="shape"||d.role!=="stage")continue;let s=bt(d);s&&(t=Math.min(t,s.minX),n=Math.min(n,s.minY),r=Math.max(r,s.maxX),o=Math.max(o,s.maxY),i=Math.max(i,c+sr(d)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:r,maxY:o,deckTopM:i}}function cr(e,t,n,r){let o=1/0,i=1/0,a=-1/0,c=-1/0;for(let p of e)Number.isFinite(p.eyeHeightM)&&(o=Math.min(o,p.x),a=Math.max(a,p.x),i=Math.min(i,p.y),c=Math.max(c,p.y));if(!Number.isFinite(o))return null;let d=o*t,s=i*t,l=Math.max(1,Math.ceil((a-o)*t/n)+1),u=Math.max(1,Math.ceil((c-i)*t/n)+1),b=new Float64Array(l*u).fill(-1/0);for(let p of e){if(!Number.isFinite(p.eyeHeightM))continue;let y=p.eyeHeightM-W,h=Math.min(l-1,Math.max(0,Math.floor((p.x*t-d)/n))),P=Math.min(u-1,Math.max(0,Math.floor((p.y*t-s)/n)))*l+h,C=y+r;C>b[P]&&(b[P]=C)}return{cellM:n,minX:d,minY:s,cols:l,rows:u,top:b}}function lr(e,t,n){let r=Math.floor((t-e.minX)/e.cellM),o=Math.floor((n-e.minY)/e.cellM);return r<0||o<0||r>=e.cols||o>=e.rows?-1/0:e.top[o*e.cols+r]}function yt(e,t,n={}){let r=new Map;if(!t||!e.length)return r;let o=n.metresPerChartUnit??z,i=n.cellM??or,a=n.chairBackM??tr,c=n.selfRowSkipM??rr,d=n.clearThreshold??.9,s=n.partialThreshold??.25,l=Math.max(1,n.columns??Jn),u=Math.max(1,n.rows??er),b=cr(e,o,i,a);if(!b)return r;let p=(t.maxX-t.minX)*o,y=(t.maxY-t.minY)*o,h=p>=y,M=(t.minX+t.maxX)/2*o,P=(t.minY+t.maxY)/2*o,C=[];for(let x=0;x<l;x++){let g=(x+.5)/l-.5,f=h?M+g*p:M,m=h?P:P+g*y;for(let w=0;w<u;w++){let S=t.deckTopM+(u===1?0:w/(u-1)*nr);C.push({x:f,y:m,z:S})}}let R=i/2;for(let x of e){if(!Number.isFinite(x.eyeHeightM))continue;let g=x.x*o,f=x.y*o,m=x.eyeHeightM,w=0,S=1/0;for(let E of C){let I=E.x-g,k=E.y-f,O=Math.hypot(I,k);if(!(O>c)){w++;continue}let j=I/O,B=k/O,G=0;for(let N=c;N<O;N+=R){let V=lr(b,g+j*N,f+B*N);if(!(!Number.isFinite(V)||V>=m)&&V>m+(E.z-m)*N/O){G=N;break}}G?S=Math.min(S,G):w++}let v=w/C.length;v>=d||r.set(x.id,{seatId:x.id,mark:v<s?"obstructedView":"restrictedView",visibleFraction:v,totalRays:C.length,atDistanceM:Number.isFinite(S)?S:0})}return r}function gt(e,t){if(!t.size)return 0;let n=0;for(let r of e){let o=t.get(r.id);if(!o)continue;let i=r.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(r.commercial={...i,[o.mark]:!0},n++)}return n}function Oe(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var ue=Math.PI/180,ur=9,H=16;function Ee(e,t,n,r){let o=n*ue,i=Math.cos(o),a=Math.sin(o);return{x:r.x+e*i-t*a,y:r.y+e*a+t*i}}function de(e){let{seatCount:t,seatSpacing:n,curve:r,rotation:o,origin:i}=e,a=[];if(e.path)return pe(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(r===0){for(let s=0;s<t;s++)a.push(Ee(s*n,0,o,i));return a}let c=r/(t-1)*ue,d=n/(2*Math.sin(Math.abs(c)/2));for(let s=0;s<t;s++){let l=s*c,u=d*Math.sin(l),b=-d+d*Math.cos(l);a.push(Ee(u,b,o,i))}return a}function wt(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function dr(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 Pt(e,t){let n=wt(e);return de(e).map((r,o)=>{let i=n.get(o),a=Oe(i),c=et(e,o,i),d={...e.commercial,...i?.commercial};return{index:o,x:r.x+(i?.dx??0),y:r.y+(i?.dy??0),label:c,displayLabel:we(e,o,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(d).some(s=>s!==void 0&&s!==!1&&s!=="")?d:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function vt(e){let t=[];for(let n of Pt(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,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function It(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)),r={top:0,bottom:0,left:0,right:0};if(!n.length)return r;let o=Math.max(0,Math.round(e.seatCount));for(let i=0;i<o;i++)r[n[i%n.length]]+=1;return r}function Te(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let r=new Map((e.overrides??[]).map(l=>[l.index,l])),o=(l,u,b,p)=>{let y=r.get(l),h=Oe(y),M=y?.label??ve(e,l);return{index:l,label:M,displayLabel:y?.displayLabel??Ie(e,l),x:u+(y?.dx??0),y:b+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:h.length>0,accessibility:h,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...p?{side:p}:{}}};if(e.shape==="round"){let l=(e.radius??40)+H,u=e.rotation*ue,b=Math.max(0,Math.min(360,e.seatArc??360));if(b>=360||n===1){for(let M=0;M<n;M++){let P=u+M/n*2*Math.PI;t.push(o(M,e.center.x+l*Math.cos(P),e.center.y+l*Math.sin(P)))}return t}let p=b*ue,y=(2*Math.PI-p)/2,h=u+y;for(let M=0;M<n;M++){let P=h+M/(n-1)*p;t.push(o(M,e.center.x+l*Math.cos(P),e.center.y+l*Math.sin(P)))}return t}let i=e.width??80,a=e.height??50,c=It(e),d=["top","bottom","left","right"],s=0;for(let l of d){let u=c[l];for(let b=0;b<u;b++){let p,y;l==="top"?(p=-i/2+(b+.5)*i/u,y=-a/2-H):l==="bottom"?(p=-i/2+(b+.5)*i/u,y=a/2+H):l==="left"?(p=-i/2-H,y=-a/2+(b+.5)*a/u):(p=i/2+H,y=-a/2+(b+.5)*a/u);let h=Ee(p,y,e.rotation,e.center);t.push(o(s++,h.x,h.y,l))}}return t}function fr(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Te(e).filter(t=>!t.skipped).length}function Ct(e){return Te(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.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function kt(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",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function Ae(e,t){let n=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){let i=t[r].x,a=t[r].y,c=t[o].x,d=t[o].y;a>e.y!=d>e.y&&e.x<(c-i)*(e.y-a)/(d-a)+i&&(n=!n)}return n}function Rt(e,t){return t.some((n,r)=>{let o=t[(r+1)%t.length],i=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y),c=(o.x-n.x)**2+(o.y-n.y)**2;return a>=-1e-7&&a<=c+1e-7})}function U(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function te(e,t,n){return Ae(e,t)&&!U(n).some(r=>Ae(e,r)||Rt(e,r))}function mr(e,t){return Se(e,t).point}function le(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;return{x:t/e.length,y:n/e.length}}function Le(e){switch(e.type){case"row":{let t=de(e),n=wt(e),r=0,o=0,i=0;for(let a=0;a<t.length;a++){let c=n.get(a);c?.skip||(r+=t[a].x+(c?.dx??0),o+=t[a].y+(c?.dy??0),i++)}return i?{x:r/i,y:o/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return le(e.points);case"section":return le(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?le(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 xt(e,t){return e.length===t.length&&e.every((n,r)=>n.x===t[r].x&&n.y===t[r].y)}function hr(e,t){if(e.type!=="gaArea"||!xt(e.points,t.outline))return!1;let n=U(e.holes),r=U(t.holes);return n.length===r.length&&n.every((o,i)=>xt(o,r[i]))}function Ot(e,t,n=e.filter(o=>o.type==="section"),r=Le(t)){let o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(o?n.find(a=>(a.logicalSectionId??a.id)===o&&(hr(t,a)||te(r,a.outline,a.holes))):void 0)??n.find(a=>te(r,a.outline,a.holes))}function $(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 br(e,t){let n=$(e);return(t?n.find(r=>r.id===t):n[0])?.objects??[]}function Et(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function fe(e,t,n){let r=i=>({x:i.x+t,y:i.y+n}),o=i=>i.map(r);switch(e.type){case"row":return{...e,origin:r(e.origin)};case"table":case"booth":return{...e,center:r(e.center)};case"gaArea":return{...e,points:o(e.points),...e.holes?{holes:U(e.holes).map(o)}:{}};case"section":return{...e,outline:o(e.outline),...e.outlinePath?{outlinePath:Qe(e.outlinePath,t,n)}:{},...e.holes?{holes:U(e.holes).map(o)}:{}};case"text":return{...e,position:r(e.position)};case"shape":return{...e,...e.points?{points:o(e.points)}:{},...e.holes?{holes:U(e.holes).map(o)}:{},...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 pr(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((r,o)=>{let i=-o*t;for(let a of r.objects)n.push(i===0?a:fe(a,0,i))}),{...e,objects:n,floors:void 0}}function St(e,t,n,r,o,i,a,c,d){let s=[],l=e.filter(h=>h.type==="section"),u=J(e),b=h=>!h?.eventConfigurationId||h.eventConfigurationId===r&&(h.eventConfigurationVersion===void 0||h.eventConfigurationVersion===d),p=h=>ut(h,{activeConfigurationId:r,activeConfigurationVersion:d,activeBasisSha256:o,now:c}),y=(h,M)=>p(h)?{...h,coverage:M}:void 0;for(let h of e){let M=[];if(h.type==="row"?M=vt(h):h.type==="table"?M=Ct(h):h.type==="booth"&&(M=kt(h)),!M.length)continue;for(let g of M)g.viewUrl&&!b(g.viewMeta)&&(g.viewUrl=void 0,g.viewMeta=void 0);if(h.type==="row"){let g=u.get(h.id);if(g){let f=new Map((h.overrides??[]).map(m=>[m.index,m]));for(let m of M){let w=Number(m.id.slice(m.id.lastIndexOf(":")+1));if(!Number.isInteger(w))continue;m.logicalRowId=g.groupId,m.logicalSeatIndex=g.adjacencyOffset+w,f.get(w)?.displayLabel||(m.displayLabel=we(h,w,g)),!m.viewUrl&&g.viewFromSeatUrl&&b(g.viewFromSeatMeta)&&(m.viewUrl=g.viewFromSeatUrl,m.viewMeta=g.viewFromSeatMeta);let S=f.get(w)?.confidenceEvidence;m.confidenceEvidence=y(S,"exact-seat")??y(h.confidenceEvidence,"row-representative")??y(g.confidenceEvidence,"row-representative")}}}let P=Ot(e,h,l,h.type==="row"?le(M):Le(h)),C=P?.viewFromSeatUrl,x=(P?.zone?t?.find(g=>g.id===P.zone):void 0)?.focalPoint??n;for(let g of M){if(!g.confidenceEvidence){let f=Number(g.id.slice(g.id.lastIndexOf(":")+1)),m=(h.type==="row"||h.type==="table")&&Number.isInteger(f)?h.overrides?.find(w=>w.index===f)?.confidenceEvidence:void 0;g.confidenceEvidence=y(m,"exact-seat")??(h.type==="row"?y(h.confidenceEvidence,"row-representative"):void 0)}g.confidenceEvidence??=y(P?.confidenceEvidence,"section-representative")??(a?y(a.evidence,a.coverage):void 0),!g.viewUrl&&C&&b(P?.viewFromSeatMeta)&&(g.viewUrl=C,g.viewMeta=P?.viewFromSeatMeta),!g.viewUrl&&i&&b(i.meta)&&(g.viewUrl=i.url,g.viewMeta=i.meta),P&&(g.sectionId=P.logicalSectionId??P.id),P?.zone&&(g.zoneId=P.zone),x&&(g.focalPoint={...x})}s.push(...M)}return s}function yr(e,t={}){if(e.floors?.length){let r=[];for(let o of e.floors){let i=o.focalPoint??e.focalPoint,a=o.viewFromSeatUrl?{url:o.viewFromSeatUrl,meta:o.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,c=o.confidenceEvidence?{evidence:o.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,d=St(o.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,c,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Mt(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,d);for(let s of d)s.floorId=o.id;for(let s of d)r.push(s)}return r}let n=St(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&Mt(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),gr(e,n,t)}function gr(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||gt(t,yt(t,pt(e))),t}function Mt(e,t,n,r){let o=e.filter(u=>u.type==="section"),i=n>0||o.some(u=>u.height!==void 0||u.rake!==void 0||(u.elevation??0)>0);if(!o.length||!i||!t){for(let u of r)u.eyeHeightM=n+W;return}let a=new Array(r.length),c=new Map;for(let u of o)c.has(u.id)||c.set(u.id,u);let d=new Map,s=new Map;for(let u=0;u<r.length;u++){let b=r[u],y=(b.sectionId?c.get(b.sectionId)??o.find(M=>M.logicalSectionId===b.sectionId&&te({x:b.x,y:b.y},M.outline,M.holes)):void 0)??o.find(M=>te({x:b.x,y:b.y},M.outline,M.holes))??null;if(a[u]=y,!y)continue;d.has(y.id)||d.set(y.id,it(y,{floorBaseHeightM:n}));let h=s.get(y.id);h?h.push(u):s.set(y.id,[u])}let l=new Array(r.length).fill(void 0);for(let[u,b]of s){let p=d.get(u);if(!p)continue;let y=p.rake>0?Math.tan(p.rake*Math.PI/180):0,h=lt(u,r,b,t);for(let M of h.rows){let P=M.blockDepth*z*y,C=p.height+P;for(let R of M.seatIndices)l[R]=C}}for(let u=0;u<r.length;u++){let b=r[u],p=a[u];if(!p){b.eyeHeightM=n+W;continue}let y=d.get(p.id);b.eyeHeightM=(l[u]??y.height)+W}}var ce=40;function ne(e,t){let n=t?.freeText==="exclude",r=1/0,o=1/0,i=-1/0,a=-1/0,c=(s,l)=>{s<r&&(r=s),l<o&&(o=l),s>i&&(i=s),l>a&&(a=l)},d=s=>{if(Array.isArray(s))for(let l of s)!l||typeof l!="object"||c(l.x,l.y)};for(let s of Et(e))if(s.type==="row"){let l=new Map((s.overrides??[]).map(u=>[u.index,u]));de(s).forEach((u,b)=>{let p=l.get(b);p?.skip||c(u.x+(p?.dx??0),u.y+(p?.dy??0))})}else if(s.type==="gaArea")d(s.points);else if(s.type==="section")d(s.outline);else if(s.type==="decorImage")c(s.x,s.y),c(s.x+s.width,s.y+s.height);else if(s.type==="shape")s.points&&s.points.length?d(ae(s)):s.x!=null&&s.y!=null&&s.width!=null&&s.height!=null&&(c(s.x,s.y),c(s.x+s.width,s.y+s.height));else if(s.type==="table"){let l=H+ur,u=s.shape==="round"?(s.radius??40)+l:Math.max((s.width??80)/2,(s.height??50)/2)+l;c(s.center.x-u,s.center.y-u),c(s.center.x+u,s.center.y+u)}else if(s.type==="booth"){let l=Math.max(s.width,s.height)/2;c(s.center.x-l,s.center.y-l),c(s.center.x+l,s.center.y+l)}else if(s.type==="text"){if(n)continue;let l=ye(s);c(s.position.x,s.position.y),c(s.position.x+l.width,s.position.y+l.height)}for(let s of[e.referenceImage,e.backgroundImage]){if(!s)continue;let{center:l,width:u}=s;if(!l||!Number.isFinite(l.x)||!Number.isFinite(l.y)||!Number.isFinite(u))continue;let b=u*3/4;c(l.x-u/2,l.y-b/2),c(l.x+u/2,l.y+b/2)}if(!isFinite(r)){let s=e.focalPoint??{x:0,y:0};return{x:s.x-200,y:s.y-200,width:400,height:400}}return{x:r-ce,y:o-ce,width:i-r+ce*2,height:a-o+ce*2}}function At(e){let t=e.backgroundImage;return t?.url&&!t.assetId?t:void 0}var Tt=.08,xr=.045;function _e(e){return`__floor__:${encodeURIComponent(e)}`}function Lt(e,t,n){return{...e,objects:t,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function Sr(e,t,n){let r=e.focalPoint??t.focalPoint;return r?r.x:n.x+n.width/2}function _t(e){let t=e.floors??[];if(!t.length)return[];let n=t.map(a=>ne(Lt(e,a.objects,a.focalPoint),{freeText:"exclude"})),o=Math.max(1,...n.map(a=>a.width))*Tt,i=0;return t.map((a,c)=>{let d=n[c],s=i-(d.y+d.height);return i-=d.height+o,{floorId:a.id,label:a.name??a.id,level:c,levelBadge:c===0?"G":String(c),translation:{x:-Sr(a,e,d),y:s},bounds:d}})}function Mr(e,t,n,r){let o=t==="name"?e.label:e.levelBadge;if(!o)return[];let i=Math.max(1,n*xr),a=e.bounds.x+e.translation.x,c=e.bounds.y+e.translation.y+i*.4,d=`floor-level-${e.floorId}`,s={type:"text",id:`${d}-text`,text:o,position:{x:a,y:c},fontSize:i,rotation:0,color:r,bold:!0};if(t==="name")return[s];let l=i*.95;return[{type:"shape",id:`${d}-badge`,kind:"ellipse",x:a-l*.35,y:c-l*.3,width:l*2,height:l*2,fill:"transparent",stroke:{color:r,width:Math.max(1,i*.09)},opacity:.8},s]}function wr(e,t={}){let n=e.floors;if(!n||n.length<2)return e;let r=_t(e),o=[];n.forEach((s,l)=>{let{x:u,y:b}=r[l].translation;for(let p of s.objects)l>0&&p.type==="shape"&&p.role==="stage"||o.push(fe(p,u,b))});let i={...e,objects:o,floors:void 0},a=ne(i,{freeText:"exclude"}),c=Math.max(1,a.width,a.height),d=e.theme?.textColor??"#94a3b8";for(let s of r)o.push(...Mr(s,t.labelStyle??"number",c,d));return{...i,objects:o,referenceImage:void 0,backgroundImage:void 0}}function Pr(e){if(!e.floors||e.floors.length<2)return e;let t=!e.zones?.length,n=new Set,r=e.floors.flatMap(i=>i.objects.flatMap(a=>{if(a.type==="shape"&&a.role==="stage"){let c=JSON.stringify([a.kind,a.x,a.y,a.width,a.height,a.points,a.rotation??0,a.label,a.heightM,a.eventConfigurationIds]);if(n.has(c))return[];n.add(c)}return t&&a.type==="section"?[{...a,zone:_e(i.id)}]:[a]})),o=t?e.floors.map(i=>({id:_e(i.id),label:i.name,focalPoint:{...i.focalPoint}})):e.zones;return{...e,objects:r,zones:o,floors:void 0,referenceImage:void 0,backgroundImage:At(e)}}function vr(e){let t=e.floors;if(!t?.length)return null;let n=t.find(i=>i.objects.some(a=>a.type==="shape"&&a.role==="stage"));if(n)return n.id;let r=t[0],o=-1;for(let i of t){let a=ne(Lt(e,i.objects,i.focalPoint),{freeText:"exclude"}),c=a.width*a.height;c>o&&(o=c,r=i)}return r.id}var Ir=640;function Cr(e,t){return(e.floors?.length??0)<2?null:"all"}function kr(e,t=0){let n=Math.max(1,e.width,e.height),r={x:e.x+e.width/2,y:e.y+e.height/2},o=n*1.55,i=Math.max(n*.82,Math.max(0,t)+n*.45);return{target:r,distance:o,height:i,focalLength:Math.hypot(o,i),yawRad:-8*Math.PI/180}}function me(e,t,n=0){let r=t.x-e.target.x,o=t.y-e.target.y,i=Math.cos(e.yawRad),a=Math.sin(e.yawRad),c=r*i-o*a,s=r*a+o*i-e.distance,l=n-e.height,u=Math.hypot(e.distance,e.height),b=(-e.distance*s-e.height*l)/u,p=(-e.height*s+e.distance*l)/u,y=Math.max(u*.08,b),h=e.focalLength/y;return{x:e.target.x+c*h,y:e.target.y-p*h,depth:y,scale:h}}function Rr(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 Or(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,r=-e.b/t,o=-e.c/t,i=e.a/t;return{a:n,b:r,c:o,d:i,e:-(n*e.e+o*e.f),f:-(r*e.e+i*e.f)}}function Er(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 Ar(e,t,n=()=>0){let r=me(e,t,n(t)),o={x:t.x+1,y:t.y},i={x:t.x,y:t.y+1},a=me(e,o,n(o)),c=me(e,i,n(i)),d=a.x-r.x,s=a.y-r.y,l=c.x-r.x,u=c.y-r.y;return{a:d,b:s,c:l,d:u,e:r.x-d*t.x-l*t.y,f:r.y-s*t.x-u*t.y}}function Tr(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 Dt=9;function Lr(e){if(e.kind==="circle")return{hx:e.r,hy:e.r};let t=e.width/2,n=e.height/2,r=e.rotation??0;if(!r)return{hx:t,hy:n};let o=r*Math.PI/180,i=Math.abs(Math.cos(o)),a=Math.abs(Math.sin(o));return{hx:t*i+n*a,hy:t*a+n*i}}function _r(e,t,n){let r=t-e.seat.x,o=n-e.seat.y;if(e.shape.kind==="circle")return r*r+o*o<=e.shape.r*e.shape.r;let i=e.shape.rotation??0,a=r,c=o;if(i){let d=-i*Math.PI/180,s=Math.cos(d),l=Math.sin(d);a=r*s-o*l,c=r*l+o*s}return Math.abs(a)<=e.shape.width/2&&Math.abs(c)<=e.shape.height/2}function Dr(e,t,n,r,o){if(e.shape.kind==="circle"){let y=Math.min(Math.max(e.seat.x,t),r),h=Math.min(Math.max(e.seat.y,n),o),M=e.seat.x-y,P=e.seat.y-h;return M*M+P*P<=e.shape.r*e.shape.r}let i=e.shape.rotation??0;if(!i)return e.seat.x-e.hx<=r&&e.seat.x+e.hx>=t&&e.seat.y-e.hy<=o&&e.seat.y+e.hy>=n;let a=i*Math.PI/180,c=Math.cos(a),d=Math.sin(a),s=e.shape.width/2,l=e.shape.height/2,u=[[-s,-l],[s,-l],[s,l],[-s,l]].map(([y,h])=>[e.seat.x+y*c-h*d,e.seat.y+y*d+h*c]),b=[[t,n],[r,n],[r,o],[t,o]],p=[[1,0],[0,1],[c,d],[-d,c]];for(let[y,h]of p){let M=1/0,P=-1/0;for(let[x,g]of u){let f=x*y+g*h;f<M&&(M=f),f>P&&(P=f)}let C=1/0,R=-1/0;for(let[x,g]of b){let f=x*y+g*h;f<C&&(C=f),f>R&&(R=f)}if(P<C||R<M)return!1}return!0}function jr(e,t={}){let n=t.seatRadius??Dt,r=e.length,o=new Array(r),i=1/0,a=1/0,c=-1/0,d=-1/0,s=0;for(let f=0;f<r;f++){let m=e[f],w=t.shapeOf?.(m)??{kind:"circle",r:n},{hx:S,hy:v}=Lr(w);o[f]={seat:m,shape:w,hx:S,hy:v},m.x-S<i&&(i=m.x-S),m.y-v<a&&(a=m.y-v),m.x+S>c&&(c=m.x+S),m.y+v>d&&(d=m.y+v),S>s&&(s=S),v>s&&(s=v)}r===0&&(i=0,a=0,c=0,d=0);let l=s>0?s*4:1,u=Math.max(c-i,0),b=Math.max(d-a,0),p=Math.max(64,t.maxCells??r*4),y=l,h=Math.max(1,Math.ceil(u/y)||1),M=Math.max(1,Math.ceil(b/y)||1);for(;h*M>p&&(h>1||M>1);)y*=2,h=Math.max(1,Math.ceil(u/y)||1),M=Math.max(1,Math.ceil(b/y)||1);let P=h*M,C=new Int32Array(P+1),R=0;for(let f=0;f<r;f++){let m=o[f],w=F(Math.floor((m.seat.x-m.hx-i)/y),0,h-1),S=F(Math.floor((m.seat.x+m.hx-i)/y),0,h-1),v=F(Math.floor((m.seat.y-m.hy-a)/y),0,M-1),E=F(Math.floor((m.seat.y+m.hy-a)/y),0,M-1);for(let I=v;I<=E;I++)for(let k=w;k<=S;k++)C[I*h+k+1]++,R++}for(let f=0;f<P;f++)C[f+1]+=C[f];let x=new Int32Array(R),g=C.slice(0,P);for(let f=0;f<r;f++){let m=o[f],w=F(Math.floor((m.seat.x-m.hx-i)/y),0,h-1),S=F(Math.floor((m.seat.x+m.hx-i)/y),0,h-1),v=F(Math.floor((m.seat.y-m.hy-a)/y),0,M-1),E=F(Math.floor((m.seat.y+m.hy-a)/y),0,M-1);for(let I=v;I<=E;I++)for(let k=w;k<=S;k++){let O=I*h+k;x[g[O]++]=f}}return{seats:e,entries:o,minX:i,minY:a,cell:y,cols:h,rows:M,cellStart:C,items:x,stamp:new Int32Array(r),epoch:0}}function Nr(e,t,n={}){let{cols:r,rows:o,cell:i,minX:a,minY:c,cellStart:d,items:s,entries:l}=e,u=Math.floor((t.x-a)/i),b=Math.floor((t.y-c)/i);if(u<0||b<0||u>=r||b>=o)return null;let p=b*r+u,y=d[p+1],h=-1,M=1/0;for(let P=d[p];P<y;P++){let C=s[P],R=l[C];if(n.filter&&!n.filter(R.seat.id,R.seat)||!_r(R,t.x,t.y))continue;let x=t.x-R.seat.x,g=t.y-R.seat.y,f=x*x+g*g;(f<M||f===M&&C<h)&&(M=f,h=C)}return h<0?null:l[h].seat.id}function Fr(e,t,n,r={}){if(!(n>0))return null;let{cols:o,rows:i,cell:a,minX:c,minY:d,cellStart:s,items:l,entries:u}=e,b=Math.max(0,Math.floor((t.x-n-c)/a)),p=Math.min(o-1,Math.floor((t.x+n-c)/a)),y=Math.max(0,Math.floor((t.y-n-d)/a)),h=Math.min(i-1,Math.floor((t.y+n-d)/a));if(b>p||y>h)return null;let M=-1,P=n*n,C=e.stamp,R=++e.epoch;for(let x=y;x<=h;x++){let g=x*o;for(let f=b;f<=p;f++){let m=g+f,w=s[m+1];for(let S=s[m];S<w;S++){let v=l[S];if(C[v]===R)continue;C[v]=R;let E=u[v];if(r.filter&&!r.filter(E.seat.id,E.seat))continue;let I=t.x-E.seat.x,k=t.y-E.seat.y,O=I*I+k*k;(O<P||O===P&&v<M)&&(P=O,M=v)}}}return M<0?null:u[M].seat.id}function Br(e,t,n={}){let r=Math.min(t.x,t.x+t.width),o=Math.max(t.x,t.x+t.width),i=Math.min(t.y,t.y+t.height),a=Math.max(t.y,t.y+t.height),c=n.mode??"center",{cols:d,rows:s,cell:l,minX:u,minY:b,cellStart:p,items:y,entries:h}=e,M=Math.max(0,Math.floor((r-u)/l)),P=Math.min(d-1,Math.floor((o-u)/l)),C=Math.max(0,Math.floor((i-b)/l)),R=Math.min(s-1,Math.floor((a-b)/l));if(M>P||C>R)return[];let x=[],g=e.stamp,f=++e.epoch;for(let m=C;m<=R;m++){let w=m*d;for(let S=M;S<=P;S++){let v=w+S,E=p[v+1];for(let I=p[v];I<E;I++){let k=y[I];if(g[k]===f)continue;g[k]=f;let O=h[k];if(n.filter&&!n.filter(O.seat.id,O.seat))continue;(c==="center"?O.seat.x>=r&&O.seat.x<=o&&O.seat.y>=i&&O.seat.y<=a:Dr(O,r,i,o,a))&&x.push(k)}}}return x.sort((m,w)=>m-w),x.map(m=>h[m].seat.id)}function Gr(e){let t=e.cols*e.rows,n=0,r=0;for(let i=0;i<t;i++){let a=e.cellStart[i+1]-e.cellStart[i];a>0&&n++,a>r&&(r=a)}let o=e.items.length;return{cell:e.cell,cols:e.cols,rows:e.rows,cells:t,occupiedCells:n,refs:o,maxPerCell:r,meanPerOccupiedCell:n?o/n:0}}var Hr=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],ui=new Map(Hr.map(e=>[e.key,e]));var Ur=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],di=new Map(Ur.map(e=>[e.key,e]));var jt=["start","end","both","none"];var Vr=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],fi=new Set(Vr);function q(e){return typeof e=="string"&&jt.includes(e)}function he(e,t){return e&&t?"both":e?"start":t?"end":"none"}function Nt(e){let t=new Map,n=J(e);if(!n.size)return t;let r=new Map;for(let o of e){if(o.type!=="row"||!n.has(o.id))continue;let i=o.segmentedRow.groupId,a=r.get(i)??[];a.push(o),r.set(i,a)}for(let o of r.values())o.sort((i,a)=>i.segmentedRow.componentIndex-a.segmentedRow.componentIndex),o.forEach((i,a)=>{let c=o[a+1];t.set(i.id,{start:a>0&&i.segmentedRow.boundaryBefore==="continuous",end:!!c&&c.segmentedRow.boundaryBefore==="continuous"})});return t}function Ft(e,t){let n=Number.isInteger(e.seatCount)&&e.seatCount>0?e.seatCount:0,r=new Set;for(let u of e.overrides??[])u.skip&&r.add(u.index);let o=u=>u>=0&&u<n&&!r.has(u),i=he(!t?.start,!t?.end),a=q(e.aisleSeats)?e.aisleSeats:void 0,c=a??i,d=-1,s=-1;for(let u=0;u<n;u+=1)o(u)&&(d<0&&(d=u),s=u);let l=new Set;if(d>=0){(c==="start"||c==="both")&&l.add(d),(c==="end"||c==="both")&&l.add(s);for(let u of r)o(u-1)&&l.add(u-1),o(u+1)&&l.add(u+1)}return{...a?{override:a}:{},automatic:i,slots:[...l].sort((u,b)=>u-b)}}function Xr(e,t=[e]){return Ft(e,e.segmentedRow?Nt(t).get(e.id):void 0)}function Bt(e){let t=new Set;for(let n of $(e)){let r=Nt(n.objects);for(let o of n.objects)if(o.type==="row")for(let i of Ft(o,r.get(o.id)).slots)t.add(`${o.id}:${i}`)}return t}function Kr(e,t,n){return Bt(e).has(`${t}:${n}`)}function De(e){let t=q(e.aisleSeats)?e.aisleSeats:"both";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function je(e,t){t==="both"?delete e.aisleSeats:e.aisleSeats=t}function Yr(e,t,n){if(!q(e.aisleSeats)){delete t.aisleSeats,delete n.aisleSeats;return}let r=De(e);je(t,he(r.start,!0)),je(n,he(!0,r.end))}function zr(e,t){let n=e[0],r=e[e.length-1];if(!n||!r||!q(n.aisleSeats)&&!q(r.aisleSeats)){delete t.aisleSeats;return}je(t,he(De(n).start,De(r).end))}0&&(module.exports={AUTOMATIC_ROUND_TABLE_RADIUS_MAX,AUTOMATIC_ROUND_TABLE_RADIUS_MIN,CHAIR_NUMBERING_DIRECTIONS,CHAIR_NUMBERING_FORMATS,CHAIR_NUMBERING_START_MAX,DEFAULT_SEAT_RADIUS,FLOOR_STACK_GAP_RATIO,FLOOR_STACK_MIN_SURFACE_PX,TABLE_SEAT_OFFSET,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,aisleSeatIds,allObjects,applyAffine,automaticRoundTableRadius,buildAisleHoles,buildSeatIndex,buildSectionShell,chairNumberingProblem,chartBounds,combinedFloorZoneId,compactChairNumbering,composeAffine,createPerspectiveCamera,cubicPoint,decomposeAffineLinear,distanceToRings,distributeAlongCubic,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorStackPlacements,floorsOf,gridStats,hitTest,initialFloorMode,invertAffine,isAisleSeat,isRowAisleSeats,layoutCombinedFloorPlan,layoutFloorStack,mainFloorId,mergeRowAisleSeats,nearestWithin,objectCenter,owningSectionForObject,perspectiveTangentAffine,pointInPolygon,pointInPolygonWithHoles,pointOnPolygonBoundary,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,projectPerspectivePoint,queryRect,resolveRowAisleSeats,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,splitRowAisleSeats,stackFloors,tableChairBookingLabel,tableChairDisplayLabel,tableChairToken,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject,usableHoles});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as Point,
|
|
2
|
-
export { F as FloorLabelStyle } from '../../types-
|
|
3
|
-
export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as
|
|
4
|
-
export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-
|
|
5
|
-
import { E as ExpandedSeat } from '../../renderer-
|
|
1
|
+
import { P as Point, v as CubicPath, w as TextObject, x as TableChairNumbering, T as TableObject, y as RowAisleSeats, C as ChartDoc, R as RowObject, a as ChartObject } from '../../types-ZviQR7ch.cjs';
|
|
2
|
+
export { F as FloorLabelStyle } from '../../types-ZviQR7ch.cjs';
|
|
3
|
+
export { A as AUTOMATIC_ROUND_TABLE_RADIUS_MAX, a as AUTOMATIC_ROUND_TABLE_RADIUS_MIN, C as ChartBoundsOptions, E as ExpandChartOptions, F as FLOOR_STACK_GAP_RATIO, b as FLOOR_STACK_MIN_SURFACE_PX, c as FloorStackOptions, d as FloorStackPlacement, R as RowSeatSlot, T as TABLE_SEAT_OFFSET, e as TableSeatSlot, f as allObjects, g as automaticRoundTableRadius, h as chartBounds, i as combinedFloorZoneId, j as expandBooth, k as expandChart, l as expandRow, m as expandRowSlots, n as expandTable, o as expandTableSlots, p as floorObjects, q as floorStackPlacements, r as floorsOf, s as initialFloorMode, t as layoutCombinedFloorPlan, u as layoutFloorStack, v as mainFloorId, w as objectCenter, x as owningSectionForObject, y as pointInPolygon, z as pointInPolygonWithHoles, B as pointOnPolygonBoundary, D as polygonLabelPoint, G as rowInventoryCount, H as rowSeatPositions, I as stackFloors, J as tableInventoryCount, K as tableSeatCountsBySide, L as translateObject, M as usableHoles } from '../../tableSizing-Bos5ueqg.cjs';
|
|
4
|
+
export { a as SegmentedRowComponent, S as SegmentedRowPlacement, r as resolveSegmentedRowGroups, s as segmentedRowComponentSeats, b as segmentedRowComponents, c as segmentedRowSeatTotal } from '../../segmentedRowModel-CyW-LFuI.cjs';
|
|
5
|
+
import { E as ExpandedSeat } from '../../renderer-BSjyHBDK.cjs';
|
|
6
6
|
|
|
7
7
|
type SectionShellMode = 'auto' | 'rectangle' | 'tapered' | 'bezier';
|
|
8
8
|
declare function cubicPoint(path: CubicPath, t: number): Point;
|
|
@@ -374,4 +374,61 @@ interface TextLayoutMetrics {
|
|
|
374
374
|
* collision checks. Konva remains authoritative for exact glyph metrics. */
|
|
375
375
|
declare function textLayoutMetrics(text: TextObject): TextLayoutMetrics;
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
/**
|
|
378
|
+
* Buyer-facing chair numbers for a table. DISPLAY ONLY: the booking label of a
|
|
379
|
+
* chair stays `${table.label}-${index + 1}` (see `tableChairBookingLabel`)
|
|
380
|
+
* whatever the numbering says, so no ticket, hold or booking ever moves.
|
|
381
|
+
*
|
|
382
|
+
* Gaps (skipped chairs) keep their number, exactly as a row's seats and as
|
|
383
|
+
* tables always have: a gap at the third chair reads 1, 2, 4.
|
|
384
|
+
* Anticlockwise walks the same physical chairs in the reverse authored order
|
|
385
|
+
* (round tables: back round the ring; rectangular: right → left → bottom → top).
|
|
386
|
+
*/
|
|
387
|
+
declare const CHAIR_NUMBERING_START_MAX = 999;
|
|
388
|
+
declare const CHAIR_NUMBERING_DIRECTIONS: readonly ["clockwise", "anticlockwise"];
|
|
389
|
+
declare const CHAIR_NUMBERING_FORMATS: readonly ["table-number", "number", "letter"];
|
|
390
|
+
/** The stable inventory label of one chair. Never depends on `chairNumbering`. */
|
|
391
|
+
declare function tableChairBookingLabel(table: Pick<TableObject, 'label'>, index: number): string;
|
|
392
|
+
/** The token buyers read for chair `index`: "3", "C" (no table name). */
|
|
393
|
+
declare function tableChairToken(table: Pick<TableObject, 'seatCount' | 'chairNumbering'>, index: number): string;
|
|
394
|
+
/** What buyers read for chair `index` when the chair has no label of its own. */
|
|
395
|
+
declare function tableChairDisplayLabel(table: Pick<TableObject, 'label' | 'displayLabel' | 'seatCount' | 'chairNumbering'>, index: number): string;
|
|
396
|
+
/** Why a stored/proposed numbering is invalid, or null when it is fine. */
|
|
397
|
+
declare function chairNumberingProblem(value: unknown): string | null;
|
|
398
|
+
/** Drops default values so an all-default numbering is stored as absent. */
|
|
399
|
+
declare function compactChairNumbering(numbering: TableChairNumbering): TableChairNumbering | undefined;
|
|
400
|
+
|
|
401
|
+
/** What one row resolves to, for the Designer's aisle-seat control. */
|
|
402
|
+
interface RowAisleResolution {
|
|
403
|
+
/** The author's override, when the row carries one. */
|
|
404
|
+
override?: RowAisleSeats;
|
|
405
|
+
/** The ends the automatic rule marks for this row (before any override). */
|
|
406
|
+
automatic: RowAisleSeats;
|
|
407
|
+
/** Slot indices of the row's aisle seats (present seats only), ascending. */
|
|
408
|
+
slots: number[];
|
|
409
|
+
}
|
|
410
|
+
/** True when `value` is one of the four override values. */
|
|
411
|
+
declare function isRowAisleSeats(value: unknown): value is RowAisleSeats;
|
|
412
|
+
/**
|
|
413
|
+
* One row's aisle seats. `floorObjects` are the objects on the row's floor
|
|
414
|
+
* (segmented-row siblings are found there); omit them for a row on its own.
|
|
415
|
+
*/
|
|
416
|
+
declare function resolveRowAisleSeats(row: RowObject, floorObjects?: readonly ChartObject[]): RowAisleResolution;
|
|
417
|
+
/** Every aisle seat on the chart, as seat ids (`${rowId}:${slot}`), every floor. */
|
|
418
|
+
declare function aisleSeatIds(doc: ChartDoc): Set<string>;
|
|
419
|
+
/** Is slot `slotIndex` of row `rowId` an aisle seat? Convenience; prefer {@link aisleSeatIds} in loops. */
|
|
420
|
+
declare function isAisleSeat(doc: ChartDoc, rowId: string, slotIndex: number): boolean;
|
|
421
|
+
/**
|
|
422
|
+
* Carry an override across a split: each half keeps the original's outer end
|
|
423
|
+
* and gains an aisle at the new cut. Without an override both halves stay
|
|
424
|
+
* automatic, which already says exactly that.
|
|
425
|
+
*/
|
|
426
|
+
declare function splitRowAisleSeats(original: RowObject, first: RowObject, second: RowObject): void;
|
|
427
|
+
/**
|
|
428
|
+
* Carry overrides across a merge (`ordered` in seat order; the survivor is
|
|
429
|
+
* `ordered[0]`): the merged row keeps the first row's start and the last
|
|
430
|
+
* row's end. The old inner ends now continue into each other.
|
|
431
|
+
*/
|
|
432
|
+
declare function mergeRowAisleSeats(ordered: readonly RowObject[], survivor: RowObject): void;
|
|
433
|
+
|
|
434
|
+
export { type Affine2D, type BuildOptions, CHAIR_NUMBERING_DIRECTIONS, CHAIR_NUMBERING_FORMATS, CHAIR_NUMBERING_START_MAX, DEFAULT_SEAT_RADIUS, type InscribedAnchor, type PerspectiveBounds, type PerspectiveCamera, type PerspectivePoint, type QueryOptions, type Rect, type RectQueryOptions, type RowAisleResolution, type SeatIndex, type SeatShape, type SectionShellMode, 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, type TextLayoutMetrics, aisleSeatIds, applyAffine, buildAisleHoles, buildSeatIndex, buildSectionShell, chairNumberingProblem, compactChairNumbering, composeAffine, createPerspectiveCamera, cubicPoint, decomposeAffineLinear, distanceToRings, distributeAlongCubic, gridStats, hitTest, invertAffine, isAisleSeat, isRowAisleSeats, mergeRowAisleSeats, nearestWithin, perspectiveTangentAffine, polygonArea, polygonInscribedAnchor, polygonNetArea, projectPerspectivePoint, queryRect, resolveRowAisleSeats, smoothCubicThroughMiddle, splitRowAisleSeats, tableChairBookingLabel, tableChairDisplayLabel, tableChairToken, textLayoutMetrics };
|