@scopetickets/checkout 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,911 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /** `2027-11-28` shifted by whole days, staying a `YYYY-MM-DD` key. */
4
+ export declare function addDays(day: string, count: number): string;
5
+
6
+ /**
7
+ * THE KEY THIS PRODUCT SPENDS FOR THAT TYPE, or `undefined` where it offers none — which
8
+ * is a real answer and not a failure: the head goes without a key, and an ABSENT key is
9
+ * the platform's own way of saying "no user type". A host that keyed its own composition
10
+ * by assignment gets that key back, so its composition keeps working.
11
+ *
12
+ * ABSENT AND NULL ARE NOT THE SAME ANSWER. `Ticket.UserTypes` is documented NULL — not
13
+ * empty — when the product names none, so null and `[]` are both the platform SAYING none
14
+ * and an unmatched key is dropped. A field that is not there at all is nobody having said
15
+ * anything, and guessing "none" from silence would strip a host's working key and charge
16
+ * every head full price.
17
+ */
18
+ export declare function assignmentFor(product: Partial<Pick<Ticket, 'UserTypes'>>, key: string): string | undefined;
19
+
20
+ /**
21
+ * THE RAMP THE REMAINING RING IS DRAWN IN — green while a slot is open, through yellow
22
+ * and red, to a red that has faded out entirely at nothing left.
23
+ *
24
+ * ITS BREAKPOINTS ARE `toAvailabilityLevel`'S OWN, and that is the whole reason this
25
+ * lives here rather than in the component. A ramp with stops of its own would be a
26
+ * second, differently-grouped reading of one number: the ring could be yellow on a slot
27
+ * the announcement calls high, and neither would be wrong on its own terms. Pinned to
28
+ * 2/3 and 1/3, the colour can only ever be inside the band its own level names —
29
+ * `readAvailability`'s note, applied to paint instead of to words.
30
+ *
31
+ * CONTINUOUS BETWEEN THOSE STOPS, because the arc beside it is. The ring draws the raw
32
+ * decimal, so a colour that stepped in three would say the slot had moved when the arc
33
+ * said it had not. The platform quantises `Remaining` to quarters TODAY and does not
34
+ * promise to; interpolating costs nothing if it stops.
35
+ *
36
+ * Returns a `color-mix()` over the ramp's TOKENS rather than a computed hex, so the
37
+ * light appearance swaps underneath it — the ramp is a different three colours there,
38
+ * and a value resolved in JS would be the dark one on both.
39
+ */
40
+ export declare function availabilityColor(remaining: number | null): string;
41
+
42
+ /** How full a day is, as the three buckets the indicator draws. */
43
+ export declare type AvailabilityLevel = 'LOW' | 'MEDIUM' | 'HIGH';
44
+
45
+ /** The weeks of `month`, padded to whole rows.. */
46
+ export declare function buildMonthGrid(series: CalendarSeries, month: CalendarMonthKey, { today, selectedDay }: MonthGridOptions): readonly CalendarWeek[];
47
+
48
+ /**
49
+ * A ticket's slots, gathered under the part of the day they fall in — CHRONOLOGICALLY,
50
+ * from 00:00 onwards, within each part and across them.
51
+ *
52
+ * SORTED HERE RATHER THAN ASSUMED. The order used to be whatever the platform returned:
53
+ * groups appeared in the order their first slot happened to arrive in, and the slots
54
+ * inside them likewise, so a response that listed 20:00 before 09:00 drew Late Evening
55
+ * above Early Morning. Nothing upstream promises an order, and a buyer reading a column
56
+ * of times expects one.
57
+ *
58
+ * `HH:MM` SORTS AS A STRING, which is why this is a plain compare and not a parse: the
59
+ * fields are fixed width and zero-padded, so lexicographic IS chronological. Sorting the
60
+ * SLOTS is also all that is needed for the groups — walking them in order visits the
61
+ * parts in order too, since `partOfDay` cuts the day into contiguous ascending bands.
62
+ */
63
+ export declare function buildTimeslotGroups(slots: readonly Timeslot[], options: TimeslotOptions): readonly TimeslotGroup[];
64
+
65
+ /** One week as SEVEN REAL DAYS, Monday first — never padded. */
66
+ export declare function buildWeekRow(series: CalendarSeries, weekStart: string, { today, selectedDay }: MonthGridOptions): CalendarWeek;
67
+
68
+ /** What a day cell is, as one value rather than a set of flags. */
69
+ export declare type CalendarCell =
70
+ /** Outside the month — renders as an empty container, keeping the columns. */
71
+ {
72
+ readonly kind: 'EMPTY';
73
+ }
74
+ /**
75
+ * Outside the run entirely: before its first day, after its last, or gone without ever
76
+ * having been one of its days. No well at all — transparent fill AND transparent
77
+ * stroke.
78
+ */
79
+ | {
80
+ readonly kind: 'OUT_OF_SERIES';
81
+ readonly day: string;
82
+ readonly dayOfMonth: number;
83
+ }
84
+ /**
85
+ * Already gone, but the series DID run it. Not selectable, and not the same as a day
86
+ * the run never touched: a buyer scanning the month should be able to see where the run
87
+ * has got to, not just where it has yet to reach. Keeps its events so the reason it is
88
+ * marked is not lost — nothing renders them today.
89
+ */
90
+ | {
91
+ readonly kind: 'PAST_BUT_RELEVANT';
92
+ readonly day: string;
93
+ readonly dayOfMonth: number;
94
+ readonly events: readonly CalendarSeriesEvent[];
95
+ }
96
+ /**
97
+ * INSIDE the run's own span and still to come, but not a day it plays — a gap between
98
+ * days it does. Keeps the outline and loses the fill.
99
+ */
100
+ | {
101
+ readonly kind: 'UNAVAILABLE';
102
+ readonly day: string;
103
+ readonly dayOfMonth: number;
104
+ }
105
+ /** In the month and sellable. `events` may hold more than one. */
106
+ | {
107
+ readonly kind: 'AVAILABLE';
108
+ readonly day: string;
109
+ readonly dayOfMonth: number;
110
+ readonly events: readonly CalendarSeriesEvent[];
111
+ }
112
+ /**
113
+ * The one day currently picked. Still shows its availability accessory — selecting a
114
+ * day does not hide how full it is.
115
+ */
116
+ | {
117
+ readonly kind: 'SELECTED';
118
+ readonly day: string;
119
+ readonly dayOfMonth: number;
120
+ readonly events: readonly CalendarSeriesEvent[];
121
+ };
122
+
123
+ /** Which period the pill names — and therefore which picker it opens. */
124
+ export declare type CalendarGrain = 'YEAR' | 'MONTH';
125
+
126
+ /**
127
+ * The period a picker sits inside, as the second pill in its header — the design,
128
+ * inside `IslandHeaderWrapper`'s leading group.
129
+ */
130
+ export declare function CalendarGrainButton({ month, grain, onPress }: CalendarGrainButtonProps): react_jsx_runtime.JSX.Element;
131
+
132
+ export declare type CalendarGrainButtonProps = {
133
+ /**
134
+ * The month ON SCREEN, not the run's first — the pickers publish theirs as they page
135
+ * (`onVisibleMonthChange`), and a run that crosses New Year says 2026 over December and
136
+ * 2027 over January.
137
+ */
138
+ readonly month: CalendarMonthKey;
139
+ /** Which half of that key to say. See `CalendarGrain`. */
140
+ readonly grain: CalendarGrain;
141
+ /** Where pressing it goes — the picker for the period it names. */
142
+ readonly onPress?: () => void;
143
+ };
144
+
145
+ /** Laying a run of days out as a month grid — the day picker's whole domain. */
146
+ /** `YYYY-MM`.. */
147
+ export declare type CalendarMonthKey = string;
148
+
149
+ /** Where a month begins, as a row of the run's week list. */
150
+ export declare type CalendarMonthRow = {
151
+ readonly month: CalendarMonthKey;
152
+ readonly row: number;
153
+ };
154
+
155
+ /** A run of linked events, as the calendar needs it. */
156
+ export declare type CalendarSeries = {
157
+ /** Ordered by day, then start. May hold several entries for one day. */
158
+ readonly events: readonly CalendarSeriesEvent[];
159
+ };
160
+
161
+ /** One event in the run, as the calendar needs it. */
162
+ export declare type CalendarSeriesEvent = {
163
+ readonly eventKey: string;
164
+ readonly name: string;
165
+ /**
166
+ * `YYYY-MM-DD`. The GROUPING day, not the start: an event can run past midnight, so
167
+ * this is what says which day it belongs to.
168
+ */
169
+ readonly day: string;
170
+ };
171
+
172
+ /** Always seven cells, Monday first.. */
173
+ export declare type CalendarWeek = readonly CalendarCell[];
174
+
175
+ declare type CheckoutSchedule = {
176
+ /** The run being picked from. Every month it touches is drawn. */
177
+ readonly series: CalendarSeries;
178
+ /** `YYYY-MM-DD` on the venue's calendar. */
179
+ readonly today: string;
180
+ /** `HH:MM` on the venue's clock — see `timeOfDayInZone`. */
181
+ readonly nowTime: string;
182
+ /** One ticket's slots, by `YYYY-MM-DD`. A day with none simply offers none. */
183
+ readonly slotsByDay?: Readonly<Record<string, readonly Timeslot[]>>;
184
+ /** Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD`. */
185
+ readonly remaining?: Readonly<Record<string, number>>;
186
+ };
187
+
188
+ export declare function ContentFlag({ tone, title }: ContentFlagProps): react_jsx_runtime.JSX.Element;
189
+
190
+ export declare type ContentFlagProps = {
191
+ readonly tone: ContentFlagTone;
192
+ /**
193
+ * An accessible name. Omitted, the mark is decorative and hidden — which is right
194
+ * wherever the field's own text already says what is wrong, and wrong where the mark is
195
+ * the only thing saying it.
196
+ */
197
+ readonly title?: string;
198
+ };
199
+
200
+ /**
201
+ * What a field says about its own contents — Figma's `ContentFlagIcon`, the 16px mark
202
+ * at the trailing end of an `InputTextShort`.
203
+ */
204
+ export declare type ContentFlagTone = 'success' | 'warning' | 'error';
205
+
206
+ /** A progress ring — Figma's `StepCompletionProgressRing`. */
207
+ export declare function CounterRing({ progress, complete, size, title, color, trackColor, direction, track, }: CounterRingProps): react_jsx_runtime.JSX.Element;
208
+
209
+ export declare type CounterRingProps = {
210
+ /**
211
+ * How full the ring is, 0..1. Out-of-range values are clamped by the geometry, because
212
+ * a caller's `count / target` goes out of range in normal use — a confirm field can
213
+ * hold more than the password above it.
214
+ *
215
+ * IT MAY FALL AS READILY AS IT RISES. The arc is a function of this number and of
216
+ * nothing else — no last value is kept anywhere — so a ring counting TOWARDS a target
217
+ * and one counting what is LEFT are the same component handed different numbers.
218
+ */
219
+ readonly progress: number;
220
+ /**
221
+ * What the ring BECOMES once it is full, or absent while it is still filling. Present,
222
+ * the ring gives way to this mark entirely.
223
+ */
224
+ readonly complete?: ContentFlagTone;
225
+ /**
226
+ * The size of the 1:1 box. Any CSS length; a number is taken as px. Default `1em`, so
227
+ * it scales with the row it sits in — `CountdownTimer`'s contract.
228
+ */
229
+ readonly size?: number | string;
230
+ readonly title?: string;
231
+ /**
232
+ * THE ARC'S COLOUR. Any CSS colour, including a `var()` or a `color-mix()` — the value
233
+ * is handed to `IconGlyph` as a fill and this component does not read it.
234
+ *
235
+ * Default is the counter's own token. A caller states one where the ring MEANS
236
+ * something the counter does not: the timeslot's ring runs a green-to-red ramp,
237
+ * because there a filling ring and a draining one are different news.
238
+ */
239
+ readonly color?: string;
240
+ /** The groove's colour, on the same terms. Ignored when `track` is off. */
241
+ readonly trackColor?: string;
242
+ /**
243
+ * WHICH WAY ROUND THE ARC GROWS from 12 o'clock. Default `cw`, the clock's own sense
244
+ * and the design's.
245
+ */
246
+ readonly direction?: RingDirection;
247
+ /**
248
+ * THE GROOVE BEHIND THE ARC. Default on.
249
+ *
250
+ * It is what makes 0% read as EMPTY rather than as absent: with no track, a ring with
251
+ * nothing in it is nothing at all, and a row of them is a row of gaps. Turn it off
252
+ * where something else already draws the whole — an arc on a ground that is itself the
253
+ * track — and never merely because it looks quieter.
254
+ */
255
+ readonly track?: boolean;
256
+ };
257
+
258
+ /** The variant BOTH pickers draw.. */
259
+ export declare const DATE_PICKER_ACCESSORY: DatePickerCellAccessory;
260
+
261
+ /**
262
+ * What a date-picker cell shows BENEATH its own label — a day beneath its number, a
263
+ * timeslot beneath its time..
264
+ */
265
+ export declare type DatePickerCellAccessory = 'NONE' | 'LINE';
266
+
267
+ /** What a pickable date cell is, for ANY grain of date picker. */
268
+ export declare type DatePickerCellState = 'AVAILABLE' | 'SELECTED' | 'UNAVAILABLE' | 'PAST_BUT_RELEVANT' | 'OUT_OF_SERIES';
269
+
270
+ /** The span a calendar opens on, or null when there is nothing to show. */
271
+ export declare function dateRange(series: CalendarSeries): {
272
+ first: string;
273
+ last: string;
274
+ } | null;
275
+
276
+ /** What a day's `Remaining` says — BOTH readings, from one call. */
277
+ export declare type DayAvailability = {
278
+ /** How far the track fills. */
279
+ readonly level: AvailabilityLevel;
280
+ /** What the day says, for the reader who cannot see the track. */
281
+ readonly announcement: string;
282
+ };
283
+
284
+ /** Select Day — the day picker's content. */
285
+ export declare function DayPicker({ series, today, selectedDay, onSelectDay, remaining, accessory, onVisibleMonthChange, }: DayPickerProps): react_jsx_runtime.JSX.Element | null;
286
+
287
+ export declare type DayPickerProps = {
288
+ /** The run being picked from. Every month it touches is drawn. */
289
+ readonly series: CalendarSeries;
290
+ /**
291
+ * `YYYY-MM-DD` in the VENUE's local day, never the device's. Passed in rather than read
292
+ * from a clock — see `MonthGridOptions`.
293
+ */
294
+ readonly today: string;
295
+ readonly selectedDay: string | null;
296
+ readonly onSelectDay: (day: string) => void;
297
+ /** Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD`. */
298
+ readonly remaining?: Readonly<Record<string, number>>;
299
+ /**
300
+ * Defaults to the variant both pickers draw. A prop only so a host can turn the line
301
+ * off; there is no per-cell answer.
302
+ */
303
+ readonly accessory?: DatePickerCellAccessory;
304
+ /**
305
+ * The month CURRENTLY IN VIEW, reported as it changes — including once on mount,
306
+ * because the picker opens on a month the host did not choose (see
307
+ * `soonestRelevantDay`).
308
+ */
309
+ readonly onVisibleMonthChange?: (month: CalendarMonthKey) => void;
310
+ };
311
+
312
+ /**
313
+ * WHICH EVENT A DAY OF A RUN IS. A series sells one event per day and a cart is opened
314
+ * against that event, so a day the buyer picked has to become a key — and the run is what
315
+ * names it. The data layer works the same map out from its own fetch; see the call site
316
+ * for why a schedule that already says it is asked first.
317
+ */
318
+ export declare function eventKeyForDay(series: CalendarSeries | undefined, day: string): string | undefined;
319
+
320
+ /** Every event on a day. The one place that match is expressed. */
321
+ export declare function eventsOn(series: CalendarSeries, day: string): readonly CalendarSeriesEvent[];
322
+
323
+ /** @internal */
324
+ declare interface EventTimeslot {
325
+ LocalStartTime: string;
326
+ LocalEndTime: string;
327
+ Total: number;
328
+ Remaining: number;
329
+ }
330
+
331
+ /** A day key as its date — `2027-12-01` -> `1 December 2027`. */
332
+ export declare function formatDayDate(day: string): string;
333
+
334
+ /** A day key as its weekday — `2027-12-01` -> `Wednesday`. */
335
+ export declare function formatDayWeekday(day: string): string;
336
+
337
+ /** A month key as its name — `2028-06` -> `June`.. */
338
+ export declare function formatMonthName(month: CalendarMonthKey): string;
339
+
340
+ /** A month key as its SHORT name — `2028-06` -> `June`, `2028-12` -> `Dec.` */
341
+ export declare function formatMonthNameShort(month: CalendarMonthKey): string;
342
+
343
+ /**
344
+ * A month key's YEAR — `2028-06` -> `2028`., whose name says `MonthYear` and whose body
345
+ * returns the year alone. Kept under the source's name so the mapping back is
346
+ * greppable.
347
+ */
348
+ export declare function formatMonthYear(month: CalendarMonthKey): string;
349
+
350
+ export declare function formatSlotDuration(startTime: string, endTime: string | null): string | null;
351
+
352
+ /**
353
+ * How long a slot runs, as the words the design sets beside the range — `15m`, `1h`,
354
+ * `1h 30m`.
355
+ */
356
+ /**
357
+ * A SESSION AS ITS TWO ENDS — `12:00 - 12:45`, the design's own separator and spacing. A
358
+ * slot with no stated end is just its start: an open-ended session is not a range.
359
+ */
360
+ export declare function formatSlotRange(startTime: string, endTime: string | null): string;
361
+
362
+ /**
363
+ * A day as the cart writes it — `Saturday, 12 December`, and NO YEAR: the design's own
364
+ * line, on a card about an order whose year nobody is in doubt about.
365
+ */
366
+ export declare function formatWeekdayAndDate(day: string): string;
367
+
368
+ /**
369
+ * WHO THE TICKETS ARE FOR — the party step's rows, and the keys they are spent as.
370
+ *
371
+ * `AssignmentKey` IS NOT A USER TYPE. It identifies one ASSIGNMENT of a type to a product
372
+ * on an event. Measured on sandbox 2026-09-10, TwinkleTown — 38 events × 2 products × 3
373
+ * types — `EventInformation` answers with 228 entries and 228 distinct keys, 76 of them
374
+ * named "Child". So de-duplicating on the key cannot help: every one is already distinct.
375
+ * `Name` is the only field that identifies what a buyer is choosing.
376
+ *
377
+ * THE SAME NAME IS NOT THE SAME OFFER, which is why the assignments are not collapsed
378
+ * away: Child is 550 off Peak and 450 off Off-Peak, and needs ID on one and not the other.
379
+ * The type is what the buyer picks; the assignment is what it costs, and that is not
380
+ * settled until a product is.
381
+ *
382
+ * WHICH IS WHY THE KEY IS RESOLVED LATE. `PARTY` runs before `DATE` and `TIME`, so when
383
+ * the buyer picks "Child" there is no product for an assignment to belong to — the product
384
+ * is `productForSession`, decided by the timeslot. Committing to a key there means sending
385
+ * Peak's against an Off-Peak product, and a bulk add that refuses an unknown key leaves no
386
+ * cart at all. So the composition is keyed by NAME and `assignmentFor` converts it once
387
+ * `useCheckoutOrder` holds the product.
388
+ */
389
+
390
+ /**
391
+ * THE DISTINCT TYPES, in the order the platform first names each — the organiser's own,
392
+ * and re-sorting on every fetch would move the rows under the pointer.
393
+ */
394
+ export declare function groupUserTypes(rows: readonly UserType[]): readonly PartyUserTypeOption[];
395
+
396
+ /**
397
+ * Whether a state can be tapped — exactly the states carrying BOTH a fill and a stroke,
398
+ * i.e. a date the run touches that has not gone..
399
+ */
400
+ export declare function isDatePickerCellSelectable(state: DatePickerCellState): state is 'AVAILABLE' | 'SELECTED';
401
+
402
+ /** The day grain's adapter onto that answer, narrowing as it answers. */
403
+ export declare function isSelectableCalendarCell(cell: CalendarCell): cell is Extract<CalendarCell, {
404
+ kind: 'AVAILABLE' | 'SELECTED';
405
+ }>;
406
+
407
+ /** Find a day in the month stack the day picker draws.. */
408
+ export declare function locateDayInMonthStack(series: CalendarSeries, day: string, { today }: {
409
+ today: string;
410
+ }): MonthStackPosition | null;
411
+
412
+ /**
413
+ * Which month is being shown when `topRow` is at the top of the viewport: the LAST one
414
+ * to have begun at or above it.
415
+ */
416
+ export declare function monthAtRow(starts: readonly CalendarMonthRow[], topRow: number): CalendarMonthKey | null;
417
+
418
+ export declare type MonthGridOptions = {
419
+ /**
420
+ * `YYYY-MM-DD`, in the same basis as an event's `day` — the VENUE's local day, not the
421
+ * device's. Required, not defaulted from a clock: "what is today" is the caller's to
422
+ * decide, and a module that read it itself could not be tested without freezing time.
423
+ */
424
+ readonly today: string;
425
+ /**
426
+ * `YYYY-MM-DD`, or null when nothing is picked yet. A day outside this month, or one
427
+ * the series does not run, simply never matches.
428
+ */
429
+ readonly selectedDay?: string | null;
430
+ };
431
+
432
+ /**
433
+ * `2027-11-28` -> `2027-11`.. Named rather than sliced at each call site so the two key
434
+ * formats stay one vocabulary.
435
+ */
436
+ export declare function monthOfDay(day: string): CalendarMonthKey;
437
+
438
+ /** The month a week belongs to, where it straddles two.. */
439
+ export declare function monthOfWeek(weekStart: string): CalendarMonthKey;
440
+
441
+ /**
442
+ * WHERE THE PICKER OPENS — the first row of the MONTH holding `day`, so a buyer meets that
443
+ * month as a month rather than as a week pinned to the top of the window.
444
+ *
445
+ * IT COSTS NOTHING TO SEE: `CALENDAR_VIEWPORT_ROWS` is 6, and 6 is the most rows a month
446
+ * can touch with Monday-first weeks, so resting on a month's first row always holds the
447
+ * whole of it — `day` included.
448
+ *
449
+ * IT REVERSES AN EARLIER READING, deliberately. This opened on the row holding the day,
450
+ * to avoid a run starting on the 28th opening with three weeks of November nobody can
451
+ * buy; those weeks are drawn either way, and what that bought instead was November's last
452
+ * week at the top of a screen named December. It also matches what the picker already
453
+ * does elsewhere: tapping a day in another month pages to that month's FIRST row.
454
+ */
455
+ export declare function monthOpeningRow(weeks: readonly string[], starts: readonly CalendarMonthRow[], day: string | null): number;
456
+
457
+ /** Every month the series touches, in order — the whole of what the stack draws. */
458
+ export declare function monthsInSeries(series: CalendarSeries): readonly CalendarMonthKey[];
459
+
460
+ /** Where in the month STACK a day sits.. */
461
+ export declare type MonthStackPosition = {
462
+ readonly monthIndex: number;
463
+ readonly weekIndex: number;
464
+ };
465
+
466
+ /** The row each month BEGINS in — the one holding its 1st. */
467
+ export declare function monthStartRows(weeks: readonly string[]): readonly CalendarMonthRow[];
468
+
469
+ /** The month a picker should open on — whichever one holds `soonestRelevantDay`. */
470
+ export declare function openingMonth(series: CalendarSeries, today: string): CalendarMonthKey | null;
471
+
472
+ /**
473
+ * `16:00:00` -> `16:00`. Null for anything that is not a readable clock time, including
474
+ * an hour or minute out of range..
475
+ */
476
+ export declare function parseWallClockTime(value: string | null | undefined): string | null;
477
+
478
+ /** Which part of the day a time falls in — the headings slots are gathered under.. */
479
+ export declare type PartOfDay = 'OVERNIGHT' | 'PRE_DAWN' | 'EARLY_MORNING' | 'LATE_MORNING' | 'EARLY_AFTERNOON' | 'LATE_AFTERNOON' | 'EARLY_EVENING' | 'LATE_EVENING';
480
+
481
+ /** `11:00` -> LATE MORNING.. */
482
+ export declare function partOfDay(time: string): PartOfDay;
483
+
484
+ export declare function partOfDayLabel(part: PartOfDay): string;
485
+
486
+ /** The party step's controls, holding their own counts. */
487
+ /** The step itself: rows when the event names its types, one line when it does not. */
488
+ export declare function PartyStepper({ userTypes, counts, onChange, max, soloName, onRefuse, refused, }: PartyStepperProps): react_jsx_runtime.JSX.Element;
489
+
490
+ export declare type PartyStepperProps = {
491
+ /** What the event offers. EMPTY draws the single unnamed line instead of rows. */
492
+ readonly userTypes: readonly PartyUserTypeOption[];
493
+ /** How many of each, by user-type key. */
494
+ readonly counts: Readonly<Record<string, number>>;
495
+ readonly onChange: (key: string, count: number) => void;
496
+ /** The ticket's ceiling, across every row together. */
497
+ readonly max: number;
498
+ /** What the single line is called when there are no user types. */
499
+ readonly soloName?: string;
500
+ /**
501
+ * A NUMBER OVER THE CEILING WAS ASKED FOR, or `null` once one within it is. The step is
502
+ * not answered while this stands: a card showing a refusal and a live Continue would be
503
+ * telling a buyer both that they cannot have it and that they may proceed.
504
+ */
505
+ readonly onRefuse?: (asked: number | null) => void;
506
+ /**
507
+ * WHAT WAS ASKED FOR, HELD BY THE WIDGET. Controlled rather than kept here, because the
508
+ * step's answered-ness depends on it and that lives up there — two copies of one fact is
509
+ * how the note ends up on screen while Continue is live, or the other way round.
510
+ */
511
+ readonly refused?: number | null;
512
+ };
513
+
514
+ /**
515
+ * THE PARTY STEP — one stepper per user type, or a single line when the event offers
516
+ * none.
517
+ *
518
+ * Controlled: the caller holds the counts, because the composition belongs to the order
519
+ * rather than to the control that edits it. `max` is the ticket's ceiling and is the
520
+ * caller's too — a row has no opinion about how many people a party may hold.
521
+ */
522
+ /** A user type the event offers, as the row needs it. */
523
+ export declare type PartyUserTypeOption = {
524
+ /**
525
+ * WHAT THE COMPOSITION COUNTS UNDER. The platform's types are keyed by NAME, because an
526
+ * assignment key belongs to a product no one has chosen yet — see `user-types`. A host
527
+ * supplying its own may key them however it likes.
528
+ */
529
+ readonly key: string;
530
+ /** Always present: an event with no discount types still offers a default. */
531
+ readonly name: string;
532
+ /** The organiser's own condition on choosing it, or null. */
533
+ readonly note: string | null;
534
+ };
535
+
536
+ /** @internal */
537
+ declare interface QuestionnaireQuestion {
538
+ Question: string;
539
+ QuestionId: number;
540
+ Type: 'text' | 'date' | 'checkbox' | string;
541
+ }
542
+
543
+ /**
544
+ * IT READS THE DECIMAL, NOT THE LEVEL. A second, differently-grouped set of words —
545
+ * "unavailable / under half / available" — would let the colours and the announcement
546
+ * classify the same day differently. Reading the decimal also survives the interval
547
+ * changing: the platform quantises `Remaining` to quarters today and does not promise
548
+ * to keep doing so, where a bucketed phrase would have to be re-decided.
549
+ */
550
+ export declare function readAvailability(remaining: number | null): DayAvailability | null;
551
+
552
+ /**
553
+ * WHICH WAY ROUND AN ARC GROWS FROM 12 O'CLOCK.
554
+ *
555
+ * `cw` is a clock's own sense and the default everywhere — the countdown's hand, the
556
+ * character counter, the design's `StepCompletionProgressRing`. `ccw` is its mirror, and
557
+ * it earns a place because a ring that DEPLETES reads differently unwinding than it does
558
+ * filling backwards: the timeslot's remaining ring runs down, not up.
559
+ */
560
+ export declare type RingDirection = 'cw' | 'ccw';
561
+
562
+ /** Whether two lists of slots say the same thing. */
563
+ export declare function sameTimeslots(a: readonly Timeslot[], b: readonly Timeslot[]): boolean;
564
+
565
+ /** The key the single line counts under when the event names no types. */
566
+ export declare const SOLO_KEY = "default";
567
+
568
+ /** The day a picker should open on: the SOONEST day the run still has. */
569
+ export declare function soonestRelevantDay(series: CalendarSeries, today: string): string | null;
570
+
571
+ /** The MONDAY of the week a day falls in.. */
572
+ export declare function startOfWeek(day: string): string;
573
+
574
+ /** The next or previous month the series RUNS IN, or null at the end. */
575
+ export declare function stepMonth(series: CalendarSeries, month: CalendarMonthKey, step: 1 | -1): CalendarMonthKey | null;
576
+
577
+ /**
578
+ * STui's `Switch` (`11376:2089`) — an on/off control, for a host composing its own rows.
579
+ *
580
+ * CONTROLLED, AND ONLY CONTROLLED. A switch that kept its own state would flip under a
581
+ * finger and then disagree with the host the moment the host refused the change — an
582
+ * opt-in the session could not save, say. So it draws `checked` and asks for the other,
583
+ * and nothing moves until the host says so.
584
+ *
585
+ * A `button` WITH `role="switch"` rather than a hidden checkbox, which is how every other
586
+ * pressable thing in this package is built — the stars are buttons with `role="radio"`.
587
+ * It takes the ELEMENT press: turning something on does not change what the island is.
588
+ */
589
+ export declare function Switch({ checked, onChange, label, size, disabled }: SwitchProps): react_jsx_runtime.JSX.Element;
590
+
591
+ export declare type SwitchProps = {
592
+ /** Whether it is on. The switch keeps no state of its own — see below. */
593
+ readonly checked: boolean;
594
+ /** Called with the state asked for, which is always the opposite of `checked`. */
595
+ readonly onChange: (checked: boolean) => void;
596
+ /**
597
+ * The accessible name. The design draws the switch bare — its label is whatever row it
598
+ * sits in — so without this a screen reader announces an unnamed switch. Pass the row's
599
+ * own text.
600
+ */
601
+ readonly label: string;
602
+ /** Default `wide`. */
603
+ readonly size?: SwitchSize;
604
+ readonly disabled?: boolean;
605
+ };
606
+
607
+ /** STui `Switch`'s two sizes: `wide` is `$12` across with a long thumb, `thin` `$8` with a short upright one. */
608
+ export declare type SwitchSize = 'wide' | 'thin';
609
+
610
+ declare interface Ticket {
611
+ /** @deprecated Legacy numeric ID — populated from v1 for cart compat, remove when v2 cart ships */
612
+ ID?: number;
613
+ Key: string;
614
+ Name: string;
615
+ Note: string | null;
616
+ BasePrice: number;
617
+ SalePrice: number;
618
+ Fees: number;
619
+ Total: number;
620
+ /**
621
+ * The product's own currency, where it states one — the most specific of the three
622
+ * places this is set, above its event's and the run's. Optional because it is not on
623
+ * every response, and a caller that finds it absent falls up rather than guessing.
624
+ */
625
+ Currency?: string | null;
626
+ Remaining: number;
627
+ Available: boolean;
628
+ Status: string | null;
629
+ Starts: string | null;
630
+ Ends: string | null;
631
+ LocalStartTime: string | null;
632
+ LocalEndTime: string | null;
633
+ MinPerTransaction: number;
634
+ MaxPerTransaction: number;
635
+ PaymentsEnabled: boolean;
636
+ AttendeeDetailsRequired: boolean;
637
+ HasTimeslot: boolean;
638
+ Questions: QuestionnaireQuestion[] | null;
639
+ Timeslots: EventTimeslot[] | null;
640
+ UrgencyTags: string[];
641
+ /** Nullable for the same reason as the run's — see `EventInfoResponse`. */
642
+ UserTypes: UserType[] | null;
643
+ }
644
+
645
+ /** The time it is right now on a given zone's clock, as `HH:MM`. */
646
+ export declare function timeOfDayInZone(now: Date, timeZone: string | null): string;
647
+
648
+ /** Select Time — the timeslot picker's content. */
649
+ export declare function TimePicker({ series, today, nowTime, selection, onSelectDay, slots, onSelectTime, remaining, accessory, onVisibleMonthChange, }: TimePickerProps): react_jsx_runtime.JSX.Element;
650
+
651
+ export declare type TimePickerProps = {
652
+ /**
653
+ * The run the chosen day belongs to. The week strip scrolls through all of it,
654
+ * including weeks the run skips.
655
+ */
656
+ readonly series: CalendarSeries;
657
+ /** `YYYY-MM-DD` in the VENUE's local day, never the device's. */
658
+ readonly today: string;
659
+ /** `HH:MM` in the VENUE's local time (`timeOfDayInZone`). */
660
+ readonly nowTime: string;
661
+ /** THE WHOLE ANSWER THIS CARD IS COLLECTING: the day, and the time on it. */
662
+ readonly selection: TimeSelection;
663
+ /**
664
+ * Picking a day in the strip REPLACES the chosen one; it never clears it — and it drops
665
+ * any time chosen on the day before it. See `withSelectedDay`.
666
+ */
667
+ readonly onSelectDay: (day: string) => void;
668
+ /** ONE ticket's slots for `selection.day`, in the order the wire gave them. */
669
+ readonly slots: readonly Timeslot[];
670
+ readonly onSelectTime: (startTime: string) => void;
671
+ /**
672
+ * Per-day `Remaining`, 0..1, keyed by `YYYY-MM-DD` — the RAW signal, exactly as
673
+ * `DayPicker` takes it, for the strip's own seven cells. A slot's own
674
+ * availability rides on the slot and never comes from here.
675
+ */
676
+ readonly remaining?: Readonly<Record<string, number>>;
677
+ /**
678
+ * Defaults to the variant both pickers draw. A prop only so a host can turn the line
679
+ * off; there is no per-cell answer.
680
+ */
681
+ readonly accessory?: DatePickerCellAccessory;
682
+ /**
683
+ * The month the WEEK STRIP is showing, reported as it pages — the same fact
684
+ * `DayPicker` publishes, for the same header pill. The timeslots below never move
685
+ * it: they all belong to one day.
686
+ */
687
+ readonly onVisibleMonthChange?: (month: CalendarMonthKey) => void;
688
+ };
689
+
690
+ /**
691
+ * THE DAY AND THE TIME ON IT, AS ONE VALUE — because they are one answer, and holding
692
+ * them apart is what let a time outlive the day it was chosen on.
693
+ */
694
+ export declare type TimeSelection = {
695
+ /**
696
+ * `YYYY-MM-DD` — the day being bought, on the VENUE's own local calendar. Not nullable:
697
+ * there is no version of Select Time with no day, because the slots on it belong to
698
+ * one.
699
+ */
700
+ readonly day: string;
701
+ /**
702
+ * The picked slot's `startTime`, which is the only identity a slot has, or null for a
703
+ * day whose time has not been chosen yet.
704
+ */
705
+ readonly startTime: string | null;
706
+ };
707
+
708
+ /**
709
+ * The times within one day that a ticket is sold for — the timeslot picker's whole
710
+ * domain.
711
+ */
712
+
713
+ /** One slot a ticket is sold for. */
714
+ export declare type Timeslot = {
715
+ /**
716
+ * `HH:MM` on the VENUE's clock — never the viewer's. Also the slot's IDENTITY: the wire
717
+ * gives no key, so the start time is what a selection points at.
718
+ */
719
+ readonly startTime: string;
720
+ /** `HH:MM` on the VENUE's clock, or null where the slot does not say. */
721
+ readonly endTime: string | null;
722
+ /**
723
+ * How full this slot is, 0..1 — the platform's own `Remaining`, exactly as a day
724
+ * reports it. Null where the slot does not say.
725
+ */
726
+ readonly remaining: number | null;
727
+ };
728
+
729
+ /** One slot, resolved: what it is, when it is, and what it can do. */
730
+ export declare type TimeslotCell = {
731
+ readonly slot: Timeslot;
732
+ readonly part: PartOfDay;
733
+ readonly state: TimeslotState;
734
+ /**
735
+ * How long the slot runs, in the words the row draws — or null where it cannot say.
736
+ * `formatSlotDuration` of the slot's own two times.
737
+ */
738
+ readonly duration: string | null;
739
+ };
740
+
741
+ export declare type TimeslotGroup = {
742
+ /** The part of the day these fall in, or null when the list was not cut by time. */
743
+ readonly part: PartOfDay | null;
744
+ /** The heading to draw above them, or null when there is none. */
745
+ readonly label: string | null;
746
+ readonly cells: readonly TimeslotCell[];
747
+ };
748
+
749
+ /**
750
+ * HOW A TICKET'S SLOTS ARE CUT UP.
751
+ *
752
+ * `PART_OF_DAY` is the island's own: eight contiguous bands, each headed by its name.
753
+ * `NONE` is one chronological list with no heading at all — which is what an
754
+ * implementation wants when the list is ALREADY grouped by something the platform
755
+ * carries and this file does not know about. Slots hang off a TICKET, so "Peak" and
756
+ * "Off-Peak" are a grouping the host has and cutting it again by time of day gives a
757
+ * buyer two headings for one list.
758
+ */
759
+ export declare type TimeslotGrouping = 'PART_OF_DAY' | 'NONE';
760
+
761
+ export declare type TimeslotOptions = {
762
+ /**
763
+ * The day these slots are sold for, and the time picked ON it. One value — see
764
+ * `TimeSelection`, which is where the reason lives.
765
+ */
766
+ readonly selection: TimeSelection;
767
+ /** `YYYY-MM-DD` in the VENUE's zone. */
768
+ readonly today: string;
769
+ /**
770
+ * `HH:MM` in the VENUE's zone (`timeOfDayInZone`). Only consulted when the slots are
771
+ * being sold for today.
772
+ */
773
+ readonly nowTime: string;
774
+ /** Defaults to `PART_OF_DAY`, which is what the island draws. */
775
+ readonly grouping?: TimeslotGrouping;
776
+ };
777
+
778
+ /** Pick a TIMESLOT — one of the times a ticket is sold for on a given day. */
779
+ export declare function TimeslotPicker({ slots, selection, today, nowTime, onSelect, accessory, grouping, }: TimeslotPickerProps): react_jsx_runtime.JSX.Element;
780
+
781
+ export declare type TimeslotPickerProps = {
782
+ /**
783
+ * ONE ticket's slots, in the order the backend gave them. One ticket's, not the day's:
784
+ * slots hang off a ticket, and two tickets on the same day can offer different sets of
785
+ * them.
786
+ */
787
+ readonly slots: readonly Timeslot[];
788
+ /**
789
+ * The day these slots are sold for AND the time picked on it, as one value. See
790
+ * `TimeSelection` — a start time that arrived without its day is how a selection came
791
+ * to outlive the day it was made on.
792
+ */
793
+ readonly selection: TimeSelection;
794
+ /**
795
+ * `YYYY-MM-DD` and `HH:MM` on the VENUE's clock (`timeOfDayInZone`). Passed in rather
796
+ * than read from a clock here, so the picker stays a pure function of its props and an
797
+ * elapsed slot can be tested without freezing time.
798
+ */
799
+ readonly today: string;
800
+ readonly nowTime: string;
801
+ readonly onSelect: (startTime: string) => void;
802
+ /**
803
+ * What every pill shows beneath its time. A property of the PICKER, not of a slot:
804
+ * every pill takes the same variant, so the times stay one size whether or not a given
805
+ * slot has a line to show.
806
+ */
807
+ readonly accessory: DatePickerCellAccessory;
808
+ /**
809
+ * Defaults to the island's own eight bands. `NONE` draws one chronological list with no
810
+ * heading — for a host whose list is already grouped by something this component cannot
811
+ * see, which for a ticket's slots it always is. See `TimeslotGrouping`.
812
+ */
813
+ readonly grouping?: TimeslotGrouping;
814
+ };
815
+
816
+ /**
817
+ * The session an item is bought for. BOTH ENDS ARE TIMES OF DAY — `18:00:00`, which is
818
+ * what the platform deserialises them into (`System.TimeSpan`) and the shape a ticket's
819
+ * own `Timeslots` come back in. A full local timestamp is refused: `The JSON value could
820
+ * not be converted to System.TimeSpan`. The date is not missing from this — it is the
821
+ * event the cart was opened on.
822
+ */
823
+ declare interface TimeslotRequest {
824
+ LocalStartTime: string;
825
+ LocalEndTime: string;
826
+ }
827
+
828
+ /**
829
+ * THE SESSION AS THE CART WANTS IT — A TIME OF DAY, NOT A TIMESTAMP.
830
+ *
831
+ * This sent `2026-12-12T18:00:00`, on the reading that `TimeslotRequest.LocalStartTime`
832
+ * is a local timestamp and the day the buyer chose is half the answer. It is not. The
833
+ * bulk add deserialises both ends into a .NET `System.TimeSpan` and refused every order
834
+ * that carried one: `The JSON value could not be converted to System.TimeSpan. Path: $`,
835
+ * which surfaced as ORDER_NOT_OPENED over a flow whose every step had gone right.
836
+ *
837
+ * THE DAY IS ALREADY SAID, WHICH IS WHY THE FIELD DOES NOT WANT IT: a cart is opened on
838
+ * ONE event and an event is one night, so the item has only to say which session of that
839
+ * night — see `createCart`. The read side knew this and the write side did not: a
840
+ * ticket's own slots come back as bare `15:00:00`, which `parseWallClockTime` has always
841
+ * handled, and the platform is simply asking for its own shape back.
842
+ *
843
+ * NO END INVENTED. A session with no stated end is sent as starting and finishing at the
844
+ * same time rather than given a duration nobody claimed — a guess about when somebody's
845
+ * show finishes is worse than a slot that does not say.
846
+ */
847
+ export declare function timeslotRequest(day: string | undefined, startTime: string | undefined, schedule: Pick<CheckoutSchedule, 'slotsByDay'> | undefined): TimeslotRequest | undefined;
848
+
849
+ /** What a slot is, for colour and for tapping.. */
850
+ export declare type TimeslotState = Extract<DatePickerCellState, 'AVAILABLE' | 'SELECTED' | 'UNAVAILABLE' | 'PAST_BUT_RELEVANT'>;
851
+
852
+ /**
853
+ * `remaining` is 0..1. Returns null at or below 0 — sold out is not a level. Values
854
+ * above 1 are treated as full rather than rejected; the field is approximate and has
855
+ * been seen out of range.
856
+ */
857
+ export declare function toAvailabilityLevel(remaining: number): AvailabilityLevel | null;
858
+
859
+ /**
860
+ * The selection after a day is pressed: the day, or NOTHING if it was already the
861
+ * chosen one.
862
+ */
863
+ export declare function toggleSelectedDay(selected: string | null, day: string): string | null;
864
+
865
+ /**
866
+ * WHO A TICKET IS FOR — "Child", "Student".
867
+ *
868
+ * `AssignmentKey` IDENTIFIES THE ASSIGNMENT, NOT THE TYPE. One entry is this type
869
+ * assigned to one product on one event, so the same "Child" appears once per product per
870
+ * night, each with its own key, its own discount and its own conditions. `Name` is the
871
+ * only field that identifies what a buyer is choosing — see `groupUserTypes`, which is
872
+ * the only thing that should be building rows out of these.
873
+ *
874
+ * @internal
875
+ */
876
+ declare interface UserType {
877
+ AssignmentKey: string;
878
+ Name: string;
879
+ DiscountNominal: number;
880
+ DiscountRate: number;
881
+ /** The organiser's own condition on choosing it, drawn under the name at `PARTY`. */
882
+ Note?: string | null;
883
+ /** Whether the buyer must show ID. Varies BY PRODUCT under one name — see `agreed`. */
884
+ IdRequired?: boolean;
885
+ AgeMinimum?: number | null;
886
+ AgeMaximum?: number | null;
887
+ }
888
+
889
+ /**
890
+ * EVERY ASSIGNMENT KEY TO THE WORD IT STANDS FOR. `attributeCartItems` reads the key back
891
+ * off the REQUEST, where it is the resolved assignment rather than the name the
892
+ * composition held — so this covers every assignment in the run, not the rows drawn.
893
+ */
894
+ export declare function userTypeNames(rows: readonly UserType[]): Record<string, string>;
895
+
896
+ /** The week of a stack that holds a given day, or null.. */
897
+ export declare function weekContainingDay(weeks: readonly CalendarWeek[], day: string): CalendarWeek | null;
898
+
899
+ /** The weeks the CALENDAR draws — every month the run touches, in full. */
900
+ export declare function weeksInCalendar(series: CalendarSeries): readonly string[];
901
+
902
+ /** Every week the run touches, Monday keys, in order.. */
903
+ export declare function weeksInSeries(series: CalendarSeries): readonly string[];
904
+
905
+ /** The selection after a day is picked: the new day, and NO time. */
906
+ export declare function withSelectedDay(selection: TimeSelection, day: string): TimeSelection;
907
+
908
+ /** The selection after a time is picked, on the day already chosen. */
909
+ export declare function withSelectedTime(selection: TimeSelection, startTime: string): TimeSelection;
910
+
911
+ export { }