@burdenoff/microfe-calendar 2026.1124.1 → 2026.1124.3
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/generated/wspace-operations.d.ts +658 -0
- package/dist/generated/wspace-operations.js +179 -6
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +1243 -10
- package/dist/hooks/useSafePermissions.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/providers/CalendarProvider.d.ts +3 -1
- package/dist/providers/CalendarProvider.js +12 -10
- package/dist/providers/CalendarProvider.js.map +1 -1
- package/dist/translations/en.d.ts +291 -1
- package/dist/types/index.d.ts +9 -0
- package/dist/v2/CalendarPageV2.js +44 -39
- package/dist/v2/CalendarPageV2.js.map +1 -1
- package/dist/v2/data/enums.d.ts +1 -0
- package/dist/v2/data/enums.js +6 -2
- package/dist/v2/data/enums.js.map +1 -1
- package/dist/v2/dialogs/CalendarDialogsV2.js +12 -9
- package/dist/v2/dialogs/CalendarDialogsV2.js.map +1 -1
- package/dist/v2/event/CustomRepeat.d.ts +5 -0
- package/dist/v2/event/CustomRepeat.js +246 -0
- package/dist/v2/event/CustomRepeat.js.map +1 -0
- package/dist/v2/event/EventDetailsTab.d.ts +6 -0
- package/dist/v2/event/EventDetailsTab.js +291 -0
- package/dist/v2/event/EventDetailsTab.js.map +1 -0
- package/dist/v2/event/EventDialog.d.ts +25 -0
- package/dist/v2/event/EventDialog.js +365 -0
- package/dist/v2/event/EventDialog.js.map +1 -0
- package/dist/v2/event/EventDialogs.d.ts +3 -0
- package/dist/v2/event/EventDialogs.js +111 -0
- package/dist/v2/event/EventDialogs.js.map +1 -0
- package/dist/v2/event/EventMoreTab.d.ts +4 -0
- package/dist/v2/event/EventMoreTab.js +214 -0
- package/dist/v2/event/EventMoreTab.js.map +1 -0
- package/dist/v2/event/EventPeopleTab.d.ts +8 -0
- package/dist/v2/event/EventPeopleTab.js +422 -0
- package/dist/v2/event/EventPeopleTab.js.map +1 -0
- package/dist/v2/event/EventPlaceTab.d.ts +6 -0
- package/dist/v2/event/EventPlaceTab.js +264 -0
- package/dist/v2/event/EventPlaceTab.js.map +1 -0
- package/dist/v2/event/FindTimeDialog.d.ts +26 -0
- package/dist/v2/event/FindTimeDialog.js +667 -0
- package/dist/v2/event/FindTimeDialog.js.map +1 -0
- package/dist/v2/event/RepeatField.d.ts +5 -0
- package/dist/v2/event/RepeatField.js +88 -0
- package/dist/v2/event/RepeatField.js.map +1 -0
- package/dist/v2/event/dialogLogic.d.ts +87 -0
- package/dist/v2/event/dialogLogic.js +117 -0
- package/dist/v2/event/dialogLogic.js.map +1 -0
- package/dist/v2/event/dialogModel.d.ts +48 -0
- package/dist/v2/event/dialogModel.js +13 -0
- package/dist/v2/event/dialogModel.js.map +1 -0
- package/dist/v2/event/eventForm.d.ts +209 -0
- package/dist/v2/event/eventForm.js +397 -0
- package/dist/v2/event/eventForm.js.map +1 -0
- package/dist/v2/event/findTime.d.ts +120 -0
- package/dist/v2/event/findTime.js +149 -0
- package/dist/v2/event/findTime.js.map +1 -0
- package/dist/v2/event/findTimeSource.d.ts +102 -0
- package/dist/v2/event/findTimeSource.js +107 -0
- package/dist/v2/event/findTimeSource.js.map +1 -0
- package/dist/v2/event/parts.d.ts +46 -0
- package/dist/v2/event/parts.js +124 -0
- package/dist/v2/event/parts.js.map +1 -0
- package/dist/v2/event/place.d.ts +64 -0
- package/dist/v2/event/place.js +48 -0
- package/dist/v2/event/place.js.map +1 -0
- package/dist/v2/event/repeatWords.d.ts +19 -0
- package/dist/v2/event/repeatWords.js +130 -0
- package/dist/v2/event/repeatWords.js.map +1 -0
- package/dist/v2/event/rrule.d.ts +90 -0
- package/dist/v2/event/rrule.js +368 -0
- package/dist/v2/event/rrule.js.map +1 -0
- package/dist/v2/event/savePlan.d.ts +50 -0
- package/dist/v2/event/savePlan.js +125 -0
- package/dist/v2/event/savePlan.js.map +1 -0
- package/dist/v2/event/useEventData.d.ts +91 -0
- package/dist/v2/event/useEventData.js +202 -0
- package/dist/v2/event/useEventData.js.map +1 -0
- package/dist/v2/event/useEventDialogModel.d.ts +37 -0
- package/dist/v2/event/useEventDialogModel.js +129 -0
- package/dist/v2/event/useEventDialogModel.js.map +1 -0
- package/dist/v2/event/useEventSave.d.ts +41 -0
- package/dist/v2/event/useEventSave.js +185 -0
- package/dist/v2/event/useEventSave.js.map +1 -0
- package/dist/v2/format.d.ts +2 -0
- package/dist/v2/format.js +4 -0
- package/dist/v2/format.js.map +1 -1
- package/dist/v2/grid/GridParts.js +100 -94
- package/dist/v2/grid/GridParts.js.map +1 -1
- package/dist/v2/grid/TimeGrid.js +98 -89
- package/dist/v2/grid/TimeGrid.js.map +1 -1
- package/dist/v2/list/ListViewV2.d.ts +6 -2
- package/dist/v2/list/ListViewV2.js +50 -44
- package/dist/v2/list/ListViewV2.js.map +1 -1
- package/dist/v2/month/MonthView.js +130 -126
- package/dist/v2/month/MonthView.js.map +1 -1
- package/dist/v2/peek/EventPeek.js.map +1 -1
- package/dist/v2/peek/PeekEvent.js.map +1 -1
- package/dist/v2/rail/CalendarRail.js +54 -80
- package/dist/v2/rail/CalendarRail.js.map +1 -1
- package/dist/v2/runs/RunPeek.d.ts +2 -0
- package/dist/v2/runs/RunPeek.js +382 -0
- package/dist/v2/runs/RunPeek.js.map +1 -0
- package/dist/v2/runs/RunPills.d.ts +28 -0
- package/dist/v2/runs/RunPills.js +179 -0
- package/dist/v2/runs/RunPills.js.map +1 -0
- package/dist/v2/runs/RunRows.d.ts +21 -0
- package/dist/v2/runs/RunRows.js +140 -0
- package/dist/v2/runs/RunRows.js.map +1 -0
- package/dist/v2/runs/RunsNotices.d.ts +1 -0
- package/dist/v2/runs/RunsNotices.js +37 -0
- package/dist/v2/runs/RunsNotices.js.map +1 -0
- package/dist/v2/runs/RunsSwitch.d.ts +1 -0
- package/dist/v2/runs/RunsSwitch.js +54 -0
- package/dist/v2/runs/RunsSwitch.js.map +1 -0
- package/dist/v2/runs/WorkflowRunsLayer.d.ts +4 -0
- package/dist/v2/runs/WorkflowRunsLayer.js +82 -0
- package/dist/v2/runs/WorkflowRunsLayer.js.map +1 -0
- package/dist/v2/runs/runAccess.d.ts +37 -0
- package/dist/v2/runs/runAccess.js +14 -0
- package/dist/v2/runs/runAccess.js.map +1 -0
- package/dist/v2/runs/runLayout.d.ts +76 -0
- package/dist/v2/runs/runLayout.js +129 -0
- package/dist/v2/runs/runLayout.js.map +1 -0
- package/dist/v2/runs/runLinks.d.ts +32 -0
- package/dist/v2/runs/runLinks.js +50 -0
- package/dist/v2/runs/runLinks.js.map +1 -0
- package/dist/v2/runs/runModel.d.ts +97 -0
- package/dist/v2/runs/runModel.js +132 -0
- package/dist/v2/runs/runModel.js.map +1 -0
- package/dist/v2/runs/runPeekState.d.ts +53 -0
- package/dist/v2/runs/runPeekState.js +62 -0
- package/dist/v2/runs/runPeekState.js.map +1 -0
- package/dist/v2/runs/runTypes.d.ts +60 -0
- package/dist/v2/runs/runWords.d.ts +23 -0
- package/dist/v2/runs/runWords.js +83 -0
- package/dist/v2/runs/runWords.js.map +1 -0
- package/dist/v2/runs/runsLayerContext.d.ts +26 -0
- package/dist/v2/runs/runsLayerContext.js +33 -0
- package/dist/v2/runs/runsLayerContext.js.map +1 -0
- package/dist/v2/runs/useRunHrefs.d.ts +10 -0
- package/dist/v2/runs/useRunHrefs.js +60 -0
- package/dist/v2/runs/useRunHrefs.js.map +1 -0
- package/dist/v2/runs/useRunLabels.d.ts +6 -0
- package/dist/v2/runs/useRunLabels.js +27 -0
- package/dist/v2/runs/useRunLabels.js.map +1 -0
- package/dist/v2/runs/useRunsAccess.d.ts +2 -0
- package/dist/v2/runs/useRunsAccess.js +14 -0
- package/dist/v2/runs/useRunsAccess.js.map +1 -0
- package/dist/v2/runs/useWorkflowRuns.d.ts +61 -0
- package/dist/v2/runs/useWorkflowRuns.js +119 -0
- package/dist/v2/runs/useWorkflowRuns.js.map +1 -0
- package/dist/v2/states/CalendarStates.js.map +1 -1
- package/dist/v2/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { DateValue } from '@burdenoff/fe-libs/ui';
|
|
2
|
+
import { CalendarEventV2, CalendarV2EventDraft, EventResponseV2, EventVisibilityV2 } from '../types';
|
|
3
|
+
import { RepeatPreset, RepeatRule, RuleAnchor, RuleProblem } from './rrule';
|
|
4
|
+
/** The Length chips, in minutes. */
|
|
5
|
+
export declare const LENGTH_CHIPS: readonly number[];
|
|
6
|
+
export interface GuestDraft {
|
|
7
|
+
/** `u:<userId>` for a member, `e:<email>` for anyone else. */
|
|
8
|
+
key: string;
|
|
9
|
+
userId: string | null;
|
|
10
|
+
email: string | null;
|
|
11
|
+
name: string | null;
|
|
12
|
+
optional: boolean;
|
|
13
|
+
/** The guest's row, for someone the event already has. */
|
|
14
|
+
attendeeId: string | null;
|
|
15
|
+
response: EventResponseV2 | null;
|
|
16
|
+
}
|
|
17
|
+
export type ReminderChannelV2 = 'IN_APP' | 'EMAIL' | 'SMS';
|
|
18
|
+
export interface ReminderDraft {
|
|
19
|
+
/** `r:<id>` for a reminder the event has, `<channel>:<minutes>` for a new one. */
|
|
20
|
+
key: string;
|
|
21
|
+
minutesBefore: number;
|
|
22
|
+
channel: ReminderChannelV2;
|
|
23
|
+
/** The reminder's row, for one the event already has. */
|
|
24
|
+
reminderId: string | null;
|
|
25
|
+
}
|
|
26
|
+
export type RepeatState = {
|
|
27
|
+
kind: 'none';
|
|
28
|
+
}
|
|
29
|
+
/** A menu preset, worked out from the start whenever it moves. */
|
|
30
|
+
| {
|
|
31
|
+
kind: 'preset';
|
|
32
|
+
preset: RepeatPreset;
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'custom';
|
|
35
|
+
rule: RepeatRule;
|
|
36
|
+
}
|
|
37
|
+
/** A stored rule the builder can't hold, kept as it is. */
|
|
38
|
+
| {
|
|
39
|
+
kind: 'kept';
|
|
40
|
+
text: string;
|
|
41
|
+
};
|
|
42
|
+
export interface EventForm {
|
|
43
|
+
title: string;
|
|
44
|
+
allDay: boolean;
|
|
45
|
+
/** Timed: when it starts and ends. All-day: the times to go back to when it is switched off. */
|
|
46
|
+
start: Date;
|
|
47
|
+
end: Date;
|
|
48
|
+
/** All-day: the first and last day, both included. */
|
|
49
|
+
firstDay: DateValue;
|
|
50
|
+
lastDay: DateValue;
|
|
51
|
+
timeZone: string;
|
|
52
|
+
repeat: RepeatState;
|
|
53
|
+
description: string;
|
|
54
|
+
guests: GuestDraft[];
|
|
55
|
+
roomId: string | null;
|
|
56
|
+
videoUrl: string;
|
|
57
|
+
address: string;
|
|
58
|
+
calendarId: string | null;
|
|
59
|
+
visibility: EventVisibilityV2;
|
|
60
|
+
reminders: ReminderDraft[];
|
|
61
|
+
}
|
|
62
|
+
/** What a new event starts with besides its draft. */
|
|
63
|
+
export interface NewFormDefaults {
|
|
64
|
+
/** The calendar's zone. */
|
|
65
|
+
timeZone: string;
|
|
66
|
+
today: DateValue;
|
|
67
|
+
/** Minutes. */
|
|
68
|
+
defaultLength: number;
|
|
69
|
+
/** Minutes before, or null for none. */
|
|
70
|
+
defaultReminder: number | null;
|
|
71
|
+
defaultCalendarId: string | null;
|
|
72
|
+
}
|
|
73
|
+
/** A day, and minutes after its midnight on a clock. */
|
|
74
|
+
export interface WallTime {
|
|
75
|
+
date: DateValue;
|
|
76
|
+
minutes: number;
|
|
77
|
+
}
|
|
78
|
+
/** Where the start shows on the event's own clock. */
|
|
79
|
+
export declare function startWall(form: EventForm): WallTime;
|
|
80
|
+
/** Where the end shows on the event's own clock. */
|
|
81
|
+
export declare function endWall(form: EventForm): WallTime;
|
|
82
|
+
/** The event's first day: an all-day event's own, else its start's on its clock. */
|
|
83
|
+
export declare function firstDayOf(form: EventForm): DateValue;
|
|
84
|
+
/** When the event starts: the instant, or the UTC midnight of an all-day event's first day. */
|
|
85
|
+
export declare function startInstant(form: EventForm): Date;
|
|
86
|
+
/** When it ends: the instant, or the UTC midnight after an all-day event's last day. */
|
|
87
|
+
export declare function endInstant(form: EventForm): Date;
|
|
88
|
+
/** How long a timed event lasts, in real minutes. */
|
|
89
|
+
export declare function lengthMinutes(form: EventForm): number;
|
|
90
|
+
/** The Length chip the event's length is, if it is one. */
|
|
91
|
+
export declare function lengthChip(form: EventForm): number | null;
|
|
92
|
+
/** The start on another day, the length kept (all-day: the number of days kept). */
|
|
93
|
+
export declare function withStartDate(form: EventForm, date: DateValue): EventForm;
|
|
94
|
+
/** The start at another time of its day, the length kept. */
|
|
95
|
+
export declare function withStartTime(form: EventForm, minutes: number): EventForm;
|
|
96
|
+
/**
|
|
97
|
+
* The end picked in the end picker beside the start, whose times run on past midnight
|
|
98
|
+
* (`nextDay`): on the start's day, or the day after.
|
|
99
|
+
*/
|
|
100
|
+
export declare function withEndTime(form: EventForm, minutes: number, nextDay: boolean): EventForm;
|
|
101
|
+
/** The end's time on its own day (an event of more than a day has an end date of its own). */
|
|
102
|
+
export declare function withEndClock(form: EventForm, minutes: number): EventForm;
|
|
103
|
+
/** The end's day (timed), or the last day (all-day). */
|
|
104
|
+
export declare function withEndDate(form: EventForm, date: DateValue): EventForm;
|
|
105
|
+
/** The Length chips: the end `minutes` real minutes after the start. */
|
|
106
|
+
export declare function withLength(form: EventForm, minutes: number): EventForm;
|
|
107
|
+
/**
|
|
108
|
+
* All day on or off. On: the days the times touch (an end at midnight doesn't add its day).
|
|
109
|
+
* Off: the times it had, on its first day.
|
|
110
|
+
*/
|
|
111
|
+
export declare function withAllDay(form: EventForm, allDay: boolean): EventForm;
|
|
112
|
+
/** The time zone, keeping the clock times shown (a time the new zone skips moves past the gap). */
|
|
113
|
+
export declare function withTimeZone(form: EventForm, timeZone: string): EventForm;
|
|
114
|
+
/** Where the event's start and end land on another clock (the calendar's: "your time"). */
|
|
115
|
+
export declare function wallIn(form: EventForm, timeZone: string): {
|
|
116
|
+
start: WallTime;
|
|
117
|
+
end: WallTime;
|
|
118
|
+
};
|
|
119
|
+
/** A time from Find a time: `start` minutes on `date` on `timeZone`'s clock, for `length`. */
|
|
120
|
+
export declare function withSlot(form: EventForm, slot: {
|
|
121
|
+
date: DateValue;
|
|
122
|
+
start: number;
|
|
123
|
+
length: number;
|
|
124
|
+
timeZone: string;
|
|
125
|
+
}): EventForm;
|
|
126
|
+
/** What the form's repeat rule is tied to: its start on its own clock. */
|
|
127
|
+
export declare function anchorOf(form: EventForm): RuleAnchor;
|
|
128
|
+
/** The rule the form repeats by; null when it doesn't repeat or keeps a stored rule. */
|
|
129
|
+
export declare function repeatRuleOf(form: EventForm): RepeatRule | null;
|
|
130
|
+
/** The RRULE to store: null when the event doesn't repeat; a kept rule as it was. */
|
|
131
|
+
export declare function rruleOf(form: EventForm): string | null;
|
|
132
|
+
/** A stored rule as the form holds it: a preset when it is one. */
|
|
133
|
+
export declare function repeatStateOf(rrule: string | null, anchor: RuleAnchor): RepeatState;
|
|
134
|
+
/** A plain email address check: something@something.tld, no spaces. */
|
|
135
|
+
export declare function isEmailAddress(text: string): boolean;
|
|
136
|
+
export declare function guestKey(guest: {
|
|
137
|
+
userId: string | null;
|
|
138
|
+
email: string | null;
|
|
139
|
+
}): string;
|
|
140
|
+
/**
|
|
141
|
+
* The form with these people added: each once, never the organiser. A member and their email
|
|
142
|
+
* address are one guest: an address that is a member's isn't added again, and a member found
|
|
143
|
+
* after their address was typed (before the workspace's people loaded, say) takes the place of
|
|
144
|
+
* that address while it isn't saved yet; once saved, the address stays the guest.
|
|
145
|
+
*/
|
|
146
|
+
export declare function withGuests(form: EventForm, people: readonly {
|
|
147
|
+
userId: string | null;
|
|
148
|
+
email: string | null;
|
|
149
|
+
name: string | null;
|
|
150
|
+
}[], organizerId: string | null): EventForm;
|
|
151
|
+
export declare function withoutGuest(form: EventForm, key: string): EventForm;
|
|
152
|
+
/** The form with a reminder added, unless it has one at that time on that channel. */
|
|
153
|
+
export declare function withReminder(form: EventForm, minutesBefore: number, channel: ReminderChannelV2): EventForm;
|
|
154
|
+
export declare function withoutReminder(form: EventForm, key: string): EventForm;
|
|
155
|
+
/** Which of the event's fields the video link lives in. */
|
|
156
|
+
export type VideoField = 'onlineMeetingUrl' | 'locationUrl';
|
|
157
|
+
/** Which of the event's fields the address lives in. */
|
|
158
|
+
export type AddressField = 'location' | 'locationAddress';
|
|
159
|
+
/**
|
|
160
|
+
* An event's video link and the field it is in: the meeting link, else an online event's
|
|
161
|
+
* location link (today's form wrote it there).
|
|
162
|
+
*/
|
|
163
|
+
export declare function videoOf(event: CalendarEventV2): {
|
|
164
|
+
url: string;
|
|
165
|
+
field: VideoField;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* An event's address and the field it is in: the location, unless it is a room's name or a
|
|
169
|
+
* link; else the address field. A new address goes in the location, which every app reads.
|
|
170
|
+
*/
|
|
171
|
+
export declare function addressOf(event: CalendarEventV2): {
|
|
172
|
+
text: string;
|
|
173
|
+
field: AddressField;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* The time a person's availability is checked over: a timed event's instants; an all-day
|
|
177
|
+
* event's days from midnight to midnight on the calendar's clock (its stored UTC midnights would
|
|
178
|
+
* reach into the days either side, where time off is kept on that clock too).
|
|
179
|
+
*/
|
|
180
|
+
export declare function availabilitySpan(form: EventForm, calendarTimeZone: string): {
|
|
181
|
+
start: Date;
|
|
182
|
+
end: Date;
|
|
183
|
+
allDay: boolean;
|
|
184
|
+
};
|
|
185
|
+
/** The event's location is only the name of its booked room (as other apps write it). */
|
|
186
|
+
export declare function locationIsRoomName(event: CalendarEventV2): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* A new event's form from what the view set (`CalendarV2EventDraft`): its day and times on the
|
|
189
|
+
* calendar's clock (an end of 1440 is the next midnight), else 09:00 for the default length.
|
|
190
|
+
*/
|
|
191
|
+
export declare function newEventForm(draft: CalendarV2EventDraft | null, defaults: NewFormDefaults): EventForm;
|
|
192
|
+
/**
|
|
193
|
+
* An existing event's form: its instants on its own zone's clock (else the calendar's), its days
|
|
194
|
+
* when all-day (with 09:00 for an hour on its first day to switch to), its guests but the
|
|
195
|
+
* organiser, its room, link, address and reminders. `draft` may bring a new time on the
|
|
196
|
+
* calendar's clock (Find a time's "Use this time" on a repeating event).
|
|
197
|
+
*/
|
|
198
|
+
export declare function formFromEvent(event: CalendarEventV2, calendarTimeZone: string, draft?: CalendarV2EventDraft | null): EventForm;
|
|
199
|
+
export interface FormIssues {
|
|
200
|
+
title?: 'missing';
|
|
201
|
+
when?: 'endBeforeStart';
|
|
202
|
+
video?: 'notWebAddress';
|
|
203
|
+
repeat?: RuleProblem;
|
|
204
|
+
}
|
|
205
|
+
/** What stops the form from being saved. */
|
|
206
|
+
export declare function formIssues(form: EventForm): FormIssues;
|
|
207
|
+
export declare function hasIssues(issues: FormIssues): boolean;
|
|
208
|
+
/** The two forms hold the same event (the dialog asks before dropping changes). */
|
|
209
|
+
export declare function sameForm(a: EventForm, b: EventForm): boolean;
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { eventRoom as e, safeWebUrl as t } from "../events/eventModel.js";
|
|
2
|
+
import { dayDifference as n, eventDays as r, instantToZoned as i, startOfDayInZone as a, zonedTimeToInstant as o } from "../time/calendarTime.js";
|
|
3
|
+
import { buildRRule as s, followStart as c, parseRRule as l, presetOf as u, presetRule as d, presetsFor as f, ruleProblem as p } from "./rrule.js";
|
|
4
|
+
import { addDays as m } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
// src/v2/event/eventForm.ts
|
|
6
|
+
var h = 6e4, g = [
|
|
7
|
+
30,
|
|
8
|
+
45,
|
|
9
|
+
60,
|
|
10
|
+
90
|
|
11
|
+
];
|
|
12
|
+
function _(e) {
|
|
13
|
+
return i(e.start, e.timeZone);
|
|
14
|
+
}
|
|
15
|
+
function v(e) {
|
|
16
|
+
return i(e.end, e.timeZone);
|
|
17
|
+
}
|
|
18
|
+
function y(e) {
|
|
19
|
+
return e.allDay ? e.firstDay : _(e).date;
|
|
20
|
+
}
|
|
21
|
+
function b(e) {
|
|
22
|
+
return e.allDay ? /* @__PURE__ */ new Date(`${e.firstDay}T00:00:00.000Z`) : e.start;
|
|
23
|
+
}
|
|
24
|
+
function x(e) {
|
|
25
|
+
return e.allDay ? /* @__PURE__ */ new Date(`${m(e.lastDay, 1)}T00:00:00.000Z`) : e.end;
|
|
26
|
+
}
|
|
27
|
+
function S(e) {
|
|
28
|
+
return Math.round((e.end.getTime() - e.start.getTime()) / h);
|
|
29
|
+
}
|
|
30
|
+
function C(e) {
|
|
31
|
+
if (e.allDay) return null;
|
|
32
|
+
let t = S(e);
|
|
33
|
+
return g.includes(t) ? t : null;
|
|
34
|
+
}
|
|
35
|
+
function w(e, t, n) {
|
|
36
|
+
return {
|
|
37
|
+
...e,
|
|
38
|
+
start: t,
|
|
39
|
+
end: new Date(t.getTime() + Math.max(1, n) * h)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function T(e, t) {
|
|
43
|
+
return {
|
|
44
|
+
...t,
|
|
45
|
+
repeat: L(e.repeat, I(e), I(t))
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function E(e, t) {
|
|
49
|
+
if (e.allDay) {
|
|
50
|
+
if (t === e.firstDay) return e;
|
|
51
|
+
let r = Math.max(0, n(e.firstDay, e.lastDay));
|
|
52
|
+
return T(e, {
|
|
53
|
+
...e,
|
|
54
|
+
firstDay: t,
|
|
55
|
+
lastDay: m(t, r)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
let r = _(e);
|
|
59
|
+
return t === r.date ? e : T(e, w(e, o(t, r.minutes, e.timeZone), S(e)));
|
|
60
|
+
}
|
|
61
|
+
function D(e, t) {
|
|
62
|
+
return e.allDay ? e : T(e, w(e, o(_(e).date, t, e.timeZone), S(e)));
|
|
63
|
+
}
|
|
64
|
+
function O(e, t, n) {
|
|
65
|
+
if (e.allDay) return e;
|
|
66
|
+
let r = _(e).date;
|
|
67
|
+
return {
|
|
68
|
+
...e,
|
|
69
|
+
end: o(n ? m(r, 1) : r, t, e.timeZone)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function k(e, t) {
|
|
73
|
+
return e.allDay ? e : {
|
|
74
|
+
...e,
|
|
75
|
+
end: o(v(e).date, t, e.timeZone)
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function A(e, t) {
|
|
79
|
+
return e.allDay ? {
|
|
80
|
+
...e,
|
|
81
|
+
lastDay: t
|
|
82
|
+
} : {
|
|
83
|
+
...e,
|
|
84
|
+
end: o(t, v(e).minutes, e.timeZone)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function j(e, t) {
|
|
88
|
+
return e.allDay ? e : w(e, e.start, t);
|
|
89
|
+
}
|
|
90
|
+
function M(e, t) {
|
|
91
|
+
if (e.allDay === t) return e;
|
|
92
|
+
if (t) {
|
|
93
|
+
let t = _(e).date, n = new Date(Math.max(e.start.getTime(), e.end.getTime() - 1)), r = i(n, e.timeZone).date;
|
|
94
|
+
return {
|
|
95
|
+
...e,
|
|
96
|
+
allDay: !0,
|
|
97
|
+
firstDay: t,
|
|
98
|
+
lastDay: r < t ? t : r
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
let n = o(e.firstDay, _(e).minutes, e.timeZone);
|
|
102
|
+
return T(e, w({
|
|
103
|
+
...e,
|
|
104
|
+
allDay: !1
|
|
105
|
+
}, n, S(e)));
|
|
106
|
+
}
|
|
107
|
+
function N(e, t) {
|
|
108
|
+
if (t === e.timeZone) return e;
|
|
109
|
+
let n = _(e), r = v(e);
|
|
110
|
+
return {
|
|
111
|
+
...e,
|
|
112
|
+
timeZone: t,
|
|
113
|
+
start: o(n.date, n.minutes, t),
|
|
114
|
+
end: o(r.date, r.minutes, t)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function P(e, t) {
|
|
118
|
+
return {
|
|
119
|
+
start: i(b(e), t),
|
|
120
|
+
end: i(x(e), t)
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function F(e, t) {
|
|
124
|
+
let n = o(t.date, t.start, t.timeZone);
|
|
125
|
+
return T(e, w({
|
|
126
|
+
...e,
|
|
127
|
+
allDay: !1
|
|
128
|
+
}, n, t.length));
|
|
129
|
+
}
|
|
130
|
+
function I(e) {
|
|
131
|
+
if (e.allDay) return {
|
|
132
|
+
start: e.firstDay,
|
|
133
|
+
startMinutes: 0,
|
|
134
|
+
timeZone: e.timeZone,
|
|
135
|
+
allDay: !0
|
|
136
|
+
};
|
|
137
|
+
let t = _(e);
|
|
138
|
+
return {
|
|
139
|
+
start: t.date,
|
|
140
|
+
startMinutes: t.minutes,
|
|
141
|
+
timeZone: e.timeZone,
|
|
142
|
+
allDay: !1
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function L(e, t, n) {
|
|
146
|
+
if (e.kind === "custom") return {
|
|
147
|
+
kind: "custom",
|
|
148
|
+
rule: c(e.rule, t, n)
|
|
149
|
+
};
|
|
150
|
+
if (e.kind !== "preset") return e;
|
|
151
|
+
let r = f(n);
|
|
152
|
+
return r.includes(e.preset) ? e : e.preset === "monthlyNth" && r.includes("monthlyLast") ? {
|
|
153
|
+
kind: "preset",
|
|
154
|
+
preset: "monthlyLast"
|
|
155
|
+
} : e.preset === "monthlyLast" && r.includes("monthlyNth") ? {
|
|
156
|
+
kind: "preset",
|
|
157
|
+
preset: "monthlyNth"
|
|
158
|
+
} : {
|
|
159
|
+
kind: "custom",
|
|
160
|
+
rule: c(d(e.preset, t), t, n)
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function R(e) {
|
|
164
|
+
return e.repeat.kind === "preset" ? d(e.repeat.preset, I(e)) : e.repeat.kind === "custom" ? e.repeat.rule : null;
|
|
165
|
+
}
|
|
166
|
+
function z(e) {
|
|
167
|
+
if (e.repeat.kind === "none") return null;
|
|
168
|
+
if (e.repeat.kind === "kept") return e.repeat.text;
|
|
169
|
+
let t = R(e);
|
|
170
|
+
return t ? s(t, I(e)) : null;
|
|
171
|
+
}
|
|
172
|
+
function B(e, t) {
|
|
173
|
+
let n = l(e, t);
|
|
174
|
+
if (n.kind === "none") return { kind: "none" };
|
|
175
|
+
if (n.kind === "kept") return {
|
|
176
|
+
kind: "kept",
|
|
177
|
+
text: n.text
|
|
178
|
+
};
|
|
179
|
+
let r = u(n.rule, t);
|
|
180
|
+
return r ? {
|
|
181
|
+
kind: "preset",
|
|
182
|
+
preset: r
|
|
183
|
+
} : {
|
|
184
|
+
kind: "custom",
|
|
185
|
+
rule: n.rule
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function V(e) {
|
|
189
|
+
return /^[^\s@,;<>]+@[^\s@,;<>]+\.[^\s@,;<>.]{2,}$/.test(e.trim());
|
|
190
|
+
}
|
|
191
|
+
function H(e) {
|
|
192
|
+
return e.userId ? `u:${e.userId}` : `e:${(e.email ?? "").trim().toLowerCase()}`;
|
|
193
|
+
}
|
|
194
|
+
function U(e) {
|
|
195
|
+
return e?.trim().toLowerCase() || null;
|
|
196
|
+
}
|
|
197
|
+
function W(e, t, n) {
|
|
198
|
+
let r = [...e.guests], i = new Set(r.map((e) => e.key)), a = !1;
|
|
199
|
+
for (let e of t) {
|
|
200
|
+
if (e.userId && e.userId === n) continue;
|
|
201
|
+
let t = e.email?.trim() || null, o = H({
|
|
202
|
+
userId: e.userId,
|
|
203
|
+
email: t
|
|
204
|
+
});
|
|
205
|
+
if (o === "e:" || i.has(o)) continue;
|
|
206
|
+
let s = U(t), c = s ? r.findIndex((e) => U(e.email) === s) : -1, l = r[c];
|
|
207
|
+
if (l) {
|
|
208
|
+
if (!e.userId || l.userId || l.attendeeId !== null) continue;
|
|
209
|
+
r.splice(c, 1), i.delete(l.key);
|
|
210
|
+
}
|
|
211
|
+
i.add(o), r.push({
|
|
212
|
+
key: o,
|
|
213
|
+
userId: e.userId,
|
|
214
|
+
email: t,
|
|
215
|
+
name: e.name,
|
|
216
|
+
optional: !1,
|
|
217
|
+
attendeeId: null,
|
|
218
|
+
response: null
|
|
219
|
+
}), a = !0;
|
|
220
|
+
}
|
|
221
|
+
return a ? {
|
|
222
|
+
...e,
|
|
223
|
+
guests: r
|
|
224
|
+
} : e;
|
|
225
|
+
}
|
|
226
|
+
function G(e, t) {
|
|
227
|
+
return {
|
|
228
|
+
...e,
|
|
229
|
+
guests: e.guests.filter((e) => e.key !== t)
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function K(e, t, n) {
|
|
233
|
+
if (e.reminders.some((e) => e.minutesBefore === t && e.channel === n)) return e;
|
|
234
|
+
let r = `${n}:${t}`, i = [...e.reminders, {
|
|
235
|
+
key: r,
|
|
236
|
+
minutesBefore: t,
|
|
237
|
+
channel: n,
|
|
238
|
+
reminderId: null
|
|
239
|
+
}];
|
|
240
|
+
return i.sort((e, t) => e.minutesBefore - t.minutesBefore || e.channel.localeCompare(t.channel)), {
|
|
241
|
+
...e,
|
|
242
|
+
reminders: i
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function q(e, t) {
|
|
246
|
+
return {
|
|
247
|
+
...e,
|
|
248
|
+
reminders: e.reminders.filter((e) => e.key !== t)
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function J(e) {
|
|
252
|
+
return e.meeting?.url ? {
|
|
253
|
+
url: e.meeting.url,
|
|
254
|
+
field: "onlineMeetingUrl"
|
|
255
|
+
} : e.locationType === "ONLINE" && e.locationUrl ? {
|
|
256
|
+
url: e.locationUrl,
|
|
257
|
+
field: "locationUrl"
|
|
258
|
+
} : {
|
|
259
|
+
url: "",
|
|
260
|
+
field: "onlineMeetingUrl"
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function Y(e) {
|
|
264
|
+
let t = e.location?.trim() ?? "";
|
|
265
|
+
return t && !Z(e) && !/^https?:\/\//i.test(t) ? {
|
|
266
|
+
text: t,
|
|
267
|
+
field: "location"
|
|
268
|
+
} : e.locationAddress?.trim() ? {
|
|
269
|
+
text: e.locationAddress,
|
|
270
|
+
field: "locationAddress"
|
|
271
|
+
} : {
|
|
272
|
+
text: "",
|
|
273
|
+
field: "location"
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function X(e, t) {
|
|
277
|
+
return e.allDay ? {
|
|
278
|
+
start: a(e.firstDay, t),
|
|
279
|
+
end: a(m(e.lastDay, 1), t),
|
|
280
|
+
allDay: !0
|
|
281
|
+
} : {
|
|
282
|
+
start: b(e),
|
|
283
|
+
end: x(e),
|
|
284
|
+
allDay: !1
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function Z(t) {
|
|
288
|
+
let n = e(t)?.name?.trim();
|
|
289
|
+
return !!n && t.location?.trim() === n;
|
|
290
|
+
}
|
|
291
|
+
function Q(e) {
|
|
292
|
+
return e.defaultReminder === null ? [] : [{
|
|
293
|
+
key: `IN_APP:${e.defaultReminder}`,
|
|
294
|
+
minutesBefore: e.defaultReminder,
|
|
295
|
+
channel: "IN_APP",
|
|
296
|
+
reminderId: null
|
|
297
|
+
}];
|
|
298
|
+
}
|
|
299
|
+
function $(e, t, n, r) {
|
|
300
|
+
if (n === void 0 || n <= t) return null;
|
|
301
|
+
let i = o(e, t, r).getTime(), a = Math.round((o(e, n, r).getTime() - i) / h);
|
|
302
|
+
return a > 0 ? a : null;
|
|
303
|
+
}
|
|
304
|
+
function ee(e, t) {
|
|
305
|
+
let n = e?.date ?? t.today, r = Math.max(0, Math.round(e?.start ?? 540)), i = $(n, r, e?.end, t.timeZone) ?? t.defaultLength, a = o(n, r, t.timeZone), s = {
|
|
306
|
+
title: e?.title ?? "",
|
|
307
|
+
allDay: !1,
|
|
308
|
+
start: a,
|
|
309
|
+
end: new Date(a.getTime() + Math.max(1, i) * h),
|
|
310
|
+
firstDay: n,
|
|
311
|
+
lastDay: n,
|
|
312
|
+
timeZone: t.timeZone,
|
|
313
|
+
repeat: { kind: "none" },
|
|
314
|
+
description: "",
|
|
315
|
+
guests: [],
|
|
316
|
+
roomId: e?.resourceIds?.[0] ?? null,
|
|
317
|
+
videoUrl: "",
|
|
318
|
+
address: "",
|
|
319
|
+
calendarId: e?.calendarId ?? t.defaultCalendarId,
|
|
320
|
+
visibility: "PUBLIC",
|
|
321
|
+
reminders: Q(t)
|
|
322
|
+
};
|
|
323
|
+
return e?.allDay ? M(s, !0) : s;
|
|
324
|
+
}
|
|
325
|
+
function te(t, n, i = null) {
|
|
326
|
+
let a = t.timeZone ?? n, s = e(t), c = s && (s.status === "APPROVED" || s.status === "PENDING") ? s : null, l = r(t, n), u = t.allDay ? o(l.start, 540, a) : t.start, d = t.allDay ? new Date(u.getTime() + 60 * h) : t.end, f = {
|
|
327
|
+
title: t.title,
|
|
328
|
+
allDay: t.allDay,
|
|
329
|
+
start: u,
|
|
330
|
+
end: d,
|
|
331
|
+
firstDay: l.start,
|
|
332
|
+
lastDay: l.end,
|
|
333
|
+
timeZone: a,
|
|
334
|
+
repeat: { kind: "none" },
|
|
335
|
+
description: t.description ?? "",
|
|
336
|
+
guests: t.guests.filter((e) => !e.organizer && e.userId !== t.organizerId).map((e) => ({
|
|
337
|
+
key: H(e),
|
|
338
|
+
userId: e.userId,
|
|
339
|
+
email: e.email,
|
|
340
|
+
name: e.name,
|
|
341
|
+
optional: e.optional,
|
|
342
|
+
attendeeId: e.id,
|
|
343
|
+
response: e.response
|
|
344
|
+
})),
|
|
345
|
+
roomId: c?.resourceId ?? null,
|
|
346
|
+
videoUrl: J(t).url,
|
|
347
|
+
address: Y(t).text,
|
|
348
|
+
calendarId: t.calendarId,
|
|
349
|
+
visibility: t.visibility,
|
|
350
|
+
reminders: t.reminders.map((e) => ({
|
|
351
|
+
key: `r:${e.id}`,
|
|
352
|
+
minutesBefore: e.minutesBefore,
|
|
353
|
+
channel: e.channel,
|
|
354
|
+
reminderId: e.id
|
|
355
|
+
}))
|
|
356
|
+
};
|
|
357
|
+
if (t.isRecurring && t.rrule ? f = {
|
|
358
|
+
...f,
|
|
359
|
+
repeat: B(t.rrule, I(f))
|
|
360
|
+
} : t.rrule && (f = {
|
|
361
|
+
...f,
|
|
362
|
+
repeat: {
|
|
363
|
+
kind: "kept",
|
|
364
|
+
text: t.rrule
|
|
365
|
+
}
|
|
366
|
+
}), i?.date !== void 0 && i.start !== void 0) {
|
|
367
|
+
let e = $(i.date, i.start, i.end, n) ?? S(f);
|
|
368
|
+
f = F(f, {
|
|
369
|
+
date: i.date,
|
|
370
|
+
start: i.start,
|
|
371
|
+
length: e,
|
|
372
|
+
timeZone: n
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return f;
|
|
376
|
+
}
|
|
377
|
+
function ne(e) {
|
|
378
|
+
let n = {};
|
|
379
|
+
if (e.title.trim() === "" && (n.title = "missing"), (e.allDay ? e.lastDay >= e.firstDay : e.end.getTime() > e.start.getTime()) || (n.when = "endBeforeStart"), e.videoUrl.trim() !== "" && !t(e.videoUrl) && (n.video = "notWebAddress"), e.repeat.kind === "custom") {
|
|
380
|
+
let t = p(e.repeat.rule, I(e));
|
|
381
|
+
t && (n.repeat = t);
|
|
382
|
+
}
|
|
383
|
+
return n;
|
|
384
|
+
}
|
|
385
|
+
function re(e) {
|
|
386
|
+
return Object.keys(e).length > 0;
|
|
387
|
+
}
|
|
388
|
+
function ie(e, t) {
|
|
389
|
+
let n = (e) => JSON.stringify({
|
|
390
|
+
...e,
|
|
391
|
+
title: e.title.trim()
|
|
392
|
+
});
|
|
393
|
+
return n(e) === n(t);
|
|
394
|
+
}
|
|
395
|
+
export { g as LENGTH_CHIPS, Y as addressOf, I as anchorOf, X as availabilitySpan, x as endInstant, v as endWall, y as firstDayOf, te as formFromEvent, ne as formIssues, H as guestKey, re as hasIssues, V as isEmailAddress, C as lengthChip, S as lengthMinutes, Z as locationIsRoomName, ee as newEventForm, R as repeatRuleOf, B as repeatStateOf, z as rruleOf, ie as sameForm, b as startInstant, _ as startWall, J as videoOf, P as wallIn, M as withAllDay, k as withEndClock, A as withEndDate, O as withEndTime, W as withGuests, j as withLength, K as withReminder, F as withSlot, E as withStartDate, D as withStartTime, N as withTimeZone, G as withoutGuest, q as withoutReminder };
|
|
396
|
+
|
|
397
|
+
//# sourceMappingURL=eventForm.js.map
|