@burdenoff/microfe-calendar 2026.610.1 → 2026.625.2
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/components/AgendaView.js +47 -36
- package/dist/components/AgendaView.js.map +1 -1
- package/dist/pages/CalendarPage.js +199 -155
- package/dist/pages/CalendarPage.js.map +1 -1
- package/dist/pages/EventDetailsPage.js +495 -459
- package/dist/pages/EventDetailsPage.js.map +1 -1
- package/dist/pages/ResourcesPage.js +201 -187
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/pages/SettingsPage.js +413 -351
- package/dist/pages/SettingsPage.js.map +1 -1
- package/dist/pages/SubscriptionsPage.js +55 -52
- package/dist/pages/SubscriptionsPage.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,45 +1,52 @@
|
|
|
1
1
|
import { useGetCalendarsQuery as e } from "../generated/wspace-operations.js";
|
|
2
2
|
import { useCalendarStore as t } from "../store/calendarStore.js";
|
|
3
3
|
import { useSafePermissions as n } from "../hooks/useSafePermissions.js";
|
|
4
|
-
import { AVAILABILITY_RULES_QUERY as r, BLACKOUT_DATES_QUERY as i, CALENDAR_DETAILS_QUERY as
|
|
5
|
-
import { CALENDAR_PERMISSIONS as
|
|
6
|
-
import { useMemo as
|
|
7
|
-
import { AccessDenied as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { CalendarClock as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import {
|
|
4
|
+
import { AVAILABILITY_RULES_QUERY as r, BLACKOUT_DATES_QUERY as i, CALENDAR_DETAILS_QUERY as a, CONNECT_EXTERNAL_CALENDAR_MUTATION as ee, CREATE_AVAILABILITY_RULE_MUTATION as te, CREATE_BLACKOUT_DATE_MUTATION as ne, CREATE_BOOKING_PAGE_MUTATION as o, DELETE_AVAILABILITY_RULE_MUTATION as re, DELETE_BLACKOUT_DATE_MUTATION as ie, DELETE_BOOKING_PAGE_MUTATION as ae, DISCONNECT_EXTERNAL_CALENDAR_MUTATION as oe, EXTERNAL_SYNCS_QUERY as se, PAUSE_SYNC_MUTATION as ce, RESUME_SYNC_MUTATION as s, REVOKE_CALENDAR_SHARE_MUTATION as le, SHARE_CALENDAR_MUTATION as ue, TRIGGER_SYNC_MUTATION as de } from "../graphql/calendarDocuments.js";
|
|
5
|
+
import { CALENDAR_PERMISSIONS as fe } from "../constants/permissions.js";
|
|
6
|
+
import { useMemo as c, useState as l } from "react";
|
|
7
|
+
import { AccessDenied as pe } from "@burdenoff/fe-libs/shared/components";
|
|
8
|
+
import { useI18n as me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { CalendarClock as he, CalendarDays as ge, Clock as u, Link2 as _e, Settings as ve, Shield as ye, Users as be } from "lucide-react";
|
|
10
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
|
+
import { GlassCard as p, GradientText as xe, IllustratedEmptyState as m, NextSteps as Se, PagePurpose as Ce } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
import { useMutation as h, useQuery as g } from "@apollo/client/react";
|
|
12
13
|
//#region src/pages/SettingsPage.tsx
|
|
13
|
-
function
|
|
14
|
-
return /* @__PURE__ */ p
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
className: "
|
|
23
|
-
children:
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
function _({ id: e, title: t, description: n, icon: r, children: i, emphasis: a = !1 }) {
|
|
15
|
+
return /* @__PURE__ */ d(p, {
|
|
16
|
+
id: e,
|
|
17
|
+
treatment: a ? "glass" : "metric",
|
|
18
|
+
glow: a,
|
|
19
|
+
className: "scroll-mt-24 p-card-padding",
|
|
20
|
+
children: /* @__PURE__ */ f("div", {
|
|
21
|
+
className: "space-y-4",
|
|
22
|
+
children: [/* @__PURE__ */ f("div", {
|
|
23
|
+
className: "flex items-start gap-3",
|
|
24
|
+
children: [/* @__PURE__ */ d(r, { className: "size-5 text-text-secondary shrink-0" }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h2", {
|
|
25
|
+
className: "font-heading-sm text-text-primary",
|
|
26
|
+
children: t
|
|
27
|
+
}), n ? /* @__PURE__ */ d("p", {
|
|
28
|
+
className: "font-text-sm text-text-secondary mt-1",
|
|
29
|
+
children: n
|
|
30
|
+
}) : null] })]
|
|
31
|
+
}), i]
|
|
32
|
+
})
|
|
26
33
|
});
|
|
27
34
|
}
|
|
28
|
-
function
|
|
35
|
+
function v(e) {
|
|
29
36
|
return e ? new Date(e).toLocaleString() : "—";
|
|
30
37
|
}
|
|
31
|
-
function
|
|
32
|
-
let { hasPermission:
|
|
33
|
-
let n =
|
|
38
|
+
function y() {
|
|
39
|
+
let { hasPermission: p, isLoading: y } = n(), b = t((e) => e.currentView), x = t((e) => e.selectedTimeZone), we = t((e) => e.setTimeZone), Te = t((e) => e.miniCalendarVisible), Ee = t((e) => e.setMiniCalendarVisible), { t: De } = me(), S = (e, t) => {
|
|
40
|
+
let n = De(e);
|
|
34
41
|
return n === e ? t : n;
|
|
35
|
-
},
|
|
36
|
-
day:
|
|
37
|
-
week:
|
|
38
|
-
month:
|
|
39
|
-
year:
|
|
40
|
-
agenda:
|
|
41
|
-
timeline:
|
|
42
|
-
}, [
|
|
42
|
+
}, C = {
|
|
43
|
+
day: S("calendar.day", "Day"),
|
|
44
|
+
week: S("calendar.week", "Week"),
|
|
45
|
+
month: S("calendar.month", "Month"),
|
|
46
|
+
year: S("calendar.year", "Year"),
|
|
47
|
+
agenda: S("calendar.agenda", "Agenda"),
|
|
48
|
+
timeline: S("calendar.timeline", "Timeline")
|
|
49
|
+
}, [w, T] = l(""), [E, D] = l(""), [O, Oe] = l("user"), [k, A] = l("VIEW"), [j, M] = l({
|
|
43
50
|
dayOfWeek: "MONDAY",
|
|
44
51
|
startTime: "09:00",
|
|
45
52
|
endTime: "17:00",
|
|
@@ -48,11 +55,11 @@ function v() {
|
|
|
48
55
|
slotIncrement: "30",
|
|
49
56
|
minNotice: "60",
|
|
50
57
|
maxNotice: "43200"
|
|
51
|
-
}), [
|
|
58
|
+
}), [N, P] = l({
|
|
52
59
|
startDate: "",
|
|
53
60
|
endDate: "",
|
|
54
61
|
reason: ""
|
|
55
|
-
}), [
|
|
62
|
+
}), [F, I] = l({
|
|
56
63
|
name: "",
|
|
57
64
|
slug: "",
|
|
58
65
|
pageType: "ONE_ON_ONE",
|
|
@@ -60,7 +67,7 @@ function v() {
|
|
|
60
67
|
locationType: "ONLINE",
|
|
61
68
|
maxAttendees: "1",
|
|
62
69
|
requireApproval: !1
|
|
63
|
-
}), [
|
|
70
|
+
}), [L, R] = l({
|
|
64
71
|
provider: "GOOGLE_CALENDAR",
|
|
65
72
|
externalCalendarId: "",
|
|
66
73
|
externalCalendarName: "",
|
|
@@ -68,233 +75,271 @@ function v() {
|
|
|
68
75
|
refreshToken: "",
|
|
69
76
|
syncFrequency: "300",
|
|
70
77
|
direction: "TWO_WAY"
|
|
71
|
-
}), { data:
|
|
78
|
+
}), { data: z, loading: ke, refetch: Ae } = e({
|
|
72
79
|
variables: { pagination: { limit: 50 } },
|
|
73
80
|
skip: y
|
|
74
|
-
}),
|
|
75
|
-
variables: { id:
|
|
76
|
-
skip: !
|
|
81
|
+
}), B = c(() => z?.calendars?.calendars ?? [], [z?.calendars?.calendars]), V = c(() => w || ((B.find((e) => e.isDefault) ?? B[0])?.id ?? ""), [B, w]), H = c(() => /* @__PURE__ */ new Date(), []), je = c(() => new Date(H.getFullYear() - 1, H.getMonth(), H.getDate()).toISOString(), [H]), Me = c(() => new Date(H.getFullYear() + 1, H.getMonth(), H.getDate()).toISOString(), [H]), { data: Ne, refetch: Pe } = g(a, {
|
|
82
|
+
variables: { id: V },
|
|
83
|
+
skip: !V,
|
|
77
84
|
fetchPolicy: "cache-and-network"
|
|
78
|
-
}), { data:
|
|
79
|
-
variables: { calendarId:
|
|
80
|
-
skip: !
|
|
85
|
+
}), { data: Fe, refetch: Ie } = g(r, {
|
|
86
|
+
variables: { calendarId: V },
|
|
87
|
+
skip: !V,
|
|
81
88
|
fetchPolicy: "cache-and-network"
|
|
82
|
-
}), { data:
|
|
89
|
+
}), { data: Le, refetch: Re } = g(i, {
|
|
83
90
|
variables: {
|
|
84
|
-
calendarId:
|
|
85
|
-
startDate:
|
|
86
|
-
endDate:
|
|
91
|
+
calendarId: V,
|
|
92
|
+
startDate: je,
|
|
93
|
+
endDate: Me
|
|
87
94
|
},
|
|
88
|
-
skip: !
|
|
95
|
+
skip: !V,
|
|
89
96
|
fetchPolicy: "cache-and-network"
|
|
90
|
-
}), { data:
|
|
91
|
-
variables: { calendarId:
|
|
92
|
-
skip: !
|
|
97
|
+
}), { data: ze, refetch: Be } = g(se, {
|
|
98
|
+
variables: { calendarId: V },
|
|
99
|
+
skip: !V,
|
|
93
100
|
fetchPolicy: "cache-and-network"
|
|
94
|
-
}), [
|
|
101
|
+
}), [Ve, { loading: U }] = h(ue), [He] = h(le), [Ue, { loading: W }] = h(te), [We] = h(re), [Ge, { loading: G }] = h(ne), [Ke] = h(ie), [qe, { loading: K }] = h(o), [Je] = h(ae), [Ye, { loading: q }] = h(ee), [Xe] = h(ce), [Ze] = h(s), [Qe] = h(de), [$e] = h(oe), J = Ne?.calendar, Y = J?.shares ?? [], X = J?.bookingPages ?? [], Z = Fe?.getAvailabilityRules ?? [], et = Le?.getBlackoutDates ?? [], Q = ze?.getExternalCalendarSyncs ?? [], $ = async () => {
|
|
95
102
|
await Promise.all([
|
|
96
|
-
we(),
|
|
97
|
-
Oe(),
|
|
98
103
|
Ae(),
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
Pe(),
|
|
105
|
+
Ie(),
|
|
106
|
+
Re(),
|
|
107
|
+
Be()
|
|
101
108
|
]);
|
|
102
109
|
};
|
|
103
|
-
return y ||
|
|
110
|
+
return y || ke ? /* @__PURE__ */ d("div", {
|
|
104
111
|
className: "@container min-h-screen bg-bg-canvas flex items-center justify-center",
|
|
105
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ d("p", {
|
|
106
113
|
className: "font-text-md text-text-secondary",
|
|
107
|
-
children:
|
|
114
|
+
children: S("calendar.loading", "Loading...")
|
|
108
115
|
})
|
|
109
|
-
}) :
|
|
116
|
+
}) : p(fe.CALENDAR_READ) ? /* @__PURE__ */ f("div", {
|
|
110
117
|
className: "@container min-h-screen bg-bg-canvas",
|
|
111
118
|
children: [/* @__PURE__ */ f("header", {
|
|
112
|
-
className: "border-b border-border-
|
|
113
|
-
children: /* @__PURE__ */
|
|
119
|
+
className: "border-b border-border-seam bg-bg-surface px-page-padding py-element-padding",
|
|
120
|
+
children: [/* @__PURE__ */ f("div", {
|
|
114
121
|
className: "flex items-center gap-inline-gap",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ d(ve, { className: "size-5 text-text-secondary" }), /* @__PURE__ */ d("h1", {
|
|
116
123
|
className: "font-heading-lg text-text-primary",
|
|
117
|
-
children:
|
|
124
|
+
children: /* @__PURE__ */ d(xe, { children: S("calendar.calendarSettings", "Calendar Settings") })
|
|
118
125
|
})]
|
|
119
|
-
})
|
|
120
|
-
|
|
126
|
+
}), /* @__PURE__ */ d(Ce, {
|
|
127
|
+
className: "mt-stack-gap-sm max-w-3xl",
|
|
128
|
+
children: S("calendar.settingsPagePurpose", "The control room for a calendar. Pick the calendar to manage, set how it displays, share it with people or teams, define when you are bookable, publish Calendly-style booking pages, and connect Google, Outlook, or Apple so everything stays in sync.")
|
|
129
|
+
})]
|
|
130
|
+
}), /* @__PURE__ */ f("div", {
|
|
121
131
|
className: "max-w-5xl mx-auto p-page-padding space-y-6",
|
|
122
132
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
/* @__PURE__ */ d(Se, {
|
|
134
|
+
storageKey: "calendar-settings",
|
|
135
|
+
steps: [
|
|
136
|
+
{
|
|
137
|
+
id: "set-availability",
|
|
138
|
+
label: S("calendar.nextStepAvailability", "Set your weekly availability"),
|
|
139
|
+
description: S("calendar.nextStepAvailabilityDesc", "Define the hours you are open for bookings, plus any blackout windows."),
|
|
140
|
+
href: "#settings-availability"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "create-booking-page",
|
|
144
|
+
label: S("calendar.nextStepBookingPage", "Publish a booking page"),
|
|
145
|
+
description: S("calendar.nextStepBookingPageDesc", "Let others self-schedule time with you, Calendly-style."),
|
|
146
|
+
href: "#settings-booking-pages"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: "connect-external",
|
|
150
|
+
label: S("calendar.nextStepExternalSync", "Connect an external calendar"),
|
|
151
|
+
description: S("calendar.nextStepExternalSyncDesc", "Two-way sync with Google, Outlook, or Apple calendars."),
|
|
152
|
+
href: "#settings-external-sync"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: "share-calendar",
|
|
156
|
+
label: S("calendar.nextStepShare", "Share this calendar"),
|
|
157
|
+
description: S("calendar.nextStepShareDesc", "Give teammates view, edit, or admin access."),
|
|
158
|
+
href: "#settings-sharing"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ d(_, {
|
|
163
|
+
id: "settings-active-calendar",
|
|
164
|
+
emphasis: !0,
|
|
165
|
+
title: S("calendar.activeCalendar", "Active calendar"),
|
|
166
|
+
description: S("calendar.activeCalendarDescription", "Choose which calendar to manage for availability, shares, booking pages, and syncs."),
|
|
167
|
+
icon: ge,
|
|
168
|
+
children: /* @__PURE__ */ d("select", {
|
|
169
|
+
value: V,
|
|
170
|
+
onChange: (e) => T(e.target.value),
|
|
130
171
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
131
|
-
children:
|
|
172
|
+
children: B.map((e) => /* @__PURE__ */ d("option", {
|
|
132
173
|
value: e.id,
|
|
133
174
|
children: e.name
|
|
134
175
|
}, e.id))
|
|
135
176
|
})
|
|
136
177
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
title:
|
|
139
|
-
description:
|
|
140
|
-
icon:
|
|
141
|
-
children: [/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ f(_, {
|
|
179
|
+
title: S("calendar.displayPreferences", "Display preferences"),
|
|
180
|
+
description: S("calendar.displayPreferencesDescription", "Personalize your default view, sidebar visibility, and timezone rendering."),
|
|
181
|
+
icon: u,
|
|
182
|
+
children: [/* @__PURE__ */ f("div", {
|
|
142
183
|
className: "grid grid-cols-1 gap-4 @md:grid-cols-2",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ f("div", {
|
|
144
185
|
className: "space-y-2",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ d("p", {
|
|
146
187
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
147
|
-
children:
|
|
148
|
-
}), /* @__PURE__ */
|
|
188
|
+
children: S("calendar.currentView", "Current view")
|
|
189
|
+
}), /* @__PURE__ */ d("p", {
|
|
149
190
|
className: "font-text-sm text-text-secondary",
|
|
150
|
-
children:
|
|
191
|
+
children: C[b] ?? b
|
|
151
192
|
})]
|
|
152
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ f("div", {
|
|
153
194
|
className: "flex items-center justify-between rounded-radius-md border border-border-subtle px-3 py-2 bg-bg-canvas",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
155
196
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
156
|
-
children:
|
|
157
|
-
}), /* @__PURE__ */
|
|
197
|
+
children: S("calendar.showMiniCalendar", "Show mini calendar")
|
|
198
|
+
}), /* @__PURE__ */ d("p", {
|
|
158
199
|
className: "font-text-xs text-text-tertiary",
|
|
159
|
-
children:
|
|
160
|
-
})] }), /* @__PURE__ */
|
|
200
|
+
children: S("calendar.showMiniCalendarDescription", "Display the mini calendar sidebar in calendar views.")
|
|
201
|
+
})] }), /* @__PURE__ */ d("input", {
|
|
161
202
|
type: "checkbox",
|
|
162
|
-
checked:
|
|
163
|
-
onChange: (e) =>
|
|
203
|
+
checked: Te,
|
|
204
|
+
onChange: (e) => Ee(e.target.checked),
|
|
164
205
|
className: "size-4 rounded border-border-default",
|
|
165
|
-
"aria-label":
|
|
206
|
+
"aria-label": S("calendar.showMiniCalendar", "Show mini calendar")
|
|
166
207
|
})]
|
|
167
208
|
})]
|
|
168
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
169
210
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
170
|
-
children:
|
|
171
|
-
}), /* @__PURE__ */
|
|
211
|
+
children: S("calendar.timezone", "Timezone")
|
|
212
|
+
}), /* @__PURE__ */ d("select", {
|
|
172
213
|
value: x,
|
|
173
|
-
onChange: (e) =>
|
|
214
|
+
onChange: (e) => we(e.target.value),
|
|
174
215
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
175
|
-
children: Intl.supportedValuesOf("timeZone").map((e) => /* @__PURE__ */
|
|
216
|
+
children: Intl.supportedValuesOf("timeZone").map((e) => /* @__PURE__ */ d("option", {
|
|
176
217
|
value: e,
|
|
177
218
|
children: e
|
|
178
219
|
}, e))
|
|
179
220
|
})] })]
|
|
180
221
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
222
|
+
/* @__PURE__ */ f(_, {
|
|
223
|
+
id: "settings-sharing",
|
|
224
|
+
title: S("calendar.sharingAndPermissions", "Sharing and permissions"),
|
|
225
|
+
description: S("calendar.sharingAndPermissionsDescription", "Share calendars with users or teams using view, edit, or admin access."),
|
|
226
|
+
icon: be,
|
|
227
|
+
children: [/* @__PURE__ */ f("form", {
|
|
186
228
|
onSubmit: async (e) => {
|
|
187
|
-
e.preventDefault(), !(!
|
|
188
|
-
calendarId:
|
|
189
|
-
userId:
|
|
190
|
-
teamId:
|
|
229
|
+
e.preventDefault(), !(!V || !E.trim()) && (await Ve({ variables: {
|
|
230
|
+
calendarId: V,
|
|
231
|
+
userId: O === "user" ? E.trim() : void 0,
|
|
232
|
+
teamId: O === "team" ? E.trim() : void 0,
|
|
191
233
|
canView: !0,
|
|
192
|
-
canEdit:
|
|
193
|
-
canManage:
|
|
194
|
-
} }),
|
|
234
|
+
canEdit: k !== "VIEW",
|
|
235
|
+
canManage: k === "ADMIN"
|
|
236
|
+
} }), D(""), A("VIEW"), await $());
|
|
195
237
|
},
|
|
196
238
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-4",
|
|
197
239
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
value:
|
|
200
|
-
onChange: (e) =>
|
|
240
|
+
/* @__PURE__ */ f("select", {
|
|
241
|
+
value: O,
|
|
242
|
+
onChange: (e) => Oe(e.target.value),
|
|
201
243
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ d("option", {
|
|
203
245
|
value: "user",
|
|
204
|
-
children:
|
|
205
|
-
}), /* @__PURE__ */
|
|
246
|
+
children: S("calendar.shareWithUser", "User")
|
|
247
|
+
}), /* @__PURE__ */ d("option", {
|
|
206
248
|
value: "team",
|
|
207
|
-
children:
|
|
249
|
+
children: S("calendar.shareWithTeam", "Team")
|
|
208
250
|
})]
|
|
209
251
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
value:
|
|
212
|
-
onChange: (e) =>
|
|
213
|
-
placeholder:
|
|
214
|
-
"aria-label":
|
|
252
|
+
/* @__PURE__ */ d("input", {
|
|
253
|
+
value: E,
|
|
254
|
+
onChange: (e) => D(e.target.value),
|
|
255
|
+
placeholder: S("calendar.shareTargetPlaceholder", "User ID or team ID"),
|
|
256
|
+
"aria-label": S("calendar.shareTarget", "Share target"),
|
|
215
257
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
216
258
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
value:
|
|
219
|
-
onChange: (e) =>
|
|
259
|
+
/* @__PURE__ */ f("select", {
|
|
260
|
+
value: k,
|
|
261
|
+
onChange: (e) => A(e.target.value),
|
|
220
262
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
221
263
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ d("option", {
|
|
223
265
|
value: "VIEW",
|
|
224
|
-
children:
|
|
266
|
+
children: S("calendar.permissionView", "View")
|
|
225
267
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ d("option", {
|
|
227
269
|
value: "EDIT",
|
|
228
|
-
children:
|
|
270
|
+
children: S("calendar.permissionEdit", "Edit")
|
|
229
271
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ d("option", {
|
|
231
273
|
value: "ADMIN",
|
|
232
|
-
children:
|
|
274
|
+
children: S("calendar.permissionAdmin", "Admin")
|
|
233
275
|
})
|
|
234
276
|
]
|
|
235
277
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ d("button", {
|
|
237
279
|
type: "submit",
|
|
238
|
-
disabled: !
|
|
280
|
+
disabled: !V || !E.trim() || U,
|
|
239
281
|
className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
|
|
240
|
-
children:
|
|
282
|
+
children: U ? S("calendar.sharing", "Sharing...") : S("calendar.shareCalendar", "Share calendar")
|
|
241
283
|
})
|
|
242
284
|
]
|
|
243
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ d("div", {
|
|
244
286
|
className: "space-y-2",
|
|
245
|
-
children:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
287
|
+
children: Y.length === 0 ? /* @__PURE__ */ d(m, {
|
|
288
|
+
illustration: "empty-people",
|
|
289
|
+
className: "py-8",
|
|
290
|
+
title: S("calendar.noSharesConfigured", "No calendar shares configured yet."),
|
|
291
|
+
description: S("calendar.noSharesConfiguredDesc", "Use the form above to give a user or team view, edit, or admin access to this calendar.")
|
|
292
|
+
}) : Y.map((e) => /* @__PURE__ */ f("div", {
|
|
249
293
|
className: "flex flex-col gap-2 rounded-radius-md border border-border-subtle bg-bg-canvas p-3 @md:flex-row @md:items-center @md:justify-between",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
251
295
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
252
|
-
children: e.userId ?? e.teamId ??
|
|
253
|
-
}), /* @__PURE__ */
|
|
296
|
+
children: e.userId ?? e.teamId ?? S("calendar.unknownShareTarget", "Unknown target")
|
|
297
|
+
}), /* @__PURE__ */ f("p", {
|
|
254
298
|
className: "font-text-xs text-text-tertiary",
|
|
255
299
|
children: [
|
|
256
300
|
e.canManage ? "ADMIN" : e.canEdit ? "EDIT" : "VIEW",
|
|
257
301
|
" •",
|
|
258
302
|
" ",
|
|
259
|
-
|
|
303
|
+
v(e.createdAt)
|
|
260
304
|
]
|
|
261
|
-
})] }), /* @__PURE__ */
|
|
305
|
+
})] }), /* @__PURE__ */ d("button", {
|
|
262
306
|
type: "button",
|
|
263
307
|
onClick: async () => {
|
|
264
|
-
await
|
|
308
|
+
await He({ variables: { shareId: e.id } }), await $();
|
|
265
309
|
},
|
|
266
310
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
|
|
267
|
-
children:
|
|
311
|
+
children: S("calendar.revokeShare", "Revoke")
|
|
268
312
|
})]
|
|
269
313
|
}, e.id))
|
|
270
314
|
})]
|
|
271
315
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
316
|
+
/* @__PURE__ */ f(_, {
|
|
317
|
+
id: "settings-availability",
|
|
318
|
+
title: S("calendar.availabilityAndBlocking", "Availability and blocking"),
|
|
319
|
+
description: S("calendar.availabilityAndBlockingDescription", "Define recurring availability and create manual blackout windows for booking protection."),
|
|
320
|
+
icon: he,
|
|
276
321
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ f("form", {
|
|
278
323
|
onSubmit: async (e) => {
|
|
279
|
-
e.preventDefault(),
|
|
280
|
-
calendarId:
|
|
281
|
-
dayOfWeek:
|
|
324
|
+
e.preventDefault(), V && (await Ue({ variables: { input: {
|
|
325
|
+
calendarId: V,
|
|
326
|
+
dayOfWeek: j.dayOfWeek,
|
|
282
327
|
isAvailable: !0,
|
|
283
|
-
startTime:
|
|
284
|
-
endTime:
|
|
328
|
+
startTime: j.startTime,
|
|
329
|
+
endTime: j.endTime,
|
|
285
330
|
timezone: x,
|
|
286
|
-
bufferBefore: parseInt(
|
|
287
|
-
bufferAfter: parseInt(
|
|
288
|
-
slotIncrement: parseInt(
|
|
289
|
-
minNotice: parseInt(
|
|
290
|
-
maxNotice: parseInt(
|
|
331
|
+
bufferBefore: parseInt(j.bufferBefore, 10),
|
|
332
|
+
bufferAfter: parseInt(j.bufferAfter, 10),
|
|
333
|
+
slotIncrement: parseInt(j.slotIncrement, 10),
|
|
334
|
+
minNotice: parseInt(j.minNotice, 10),
|
|
335
|
+
maxNotice: parseInt(j.maxNotice, 10)
|
|
291
336
|
} } }), await $());
|
|
292
337
|
},
|
|
293
338
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-4",
|
|
294
339
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
value:
|
|
297
|
-
onChange: (e) =>
|
|
340
|
+
/* @__PURE__ */ d("select", {
|
|
341
|
+
value: j.dayOfWeek,
|
|
342
|
+
onChange: (e) => M((t) => ({
|
|
298
343
|
...t,
|
|
299
344
|
dayOfWeek: e.target.value
|
|
300
345
|
})),
|
|
@@ -307,44 +352,49 @@ function v() {
|
|
|
307
352
|
"FRIDAY",
|
|
308
353
|
"SATURDAY",
|
|
309
354
|
"SUNDAY"
|
|
310
|
-
].map((e) => /* @__PURE__ */
|
|
355
|
+
].map((e) => /* @__PURE__ */ d("option", {
|
|
311
356
|
value: e,
|
|
312
357
|
children: e
|
|
313
358
|
}, e))
|
|
314
359
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ d("input", {
|
|
316
361
|
type: "time",
|
|
317
|
-
value:
|
|
318
|
-
onChange: (e) =>
|
|
362
|
+
value: j.startTime,
|
|
363
|
+
onChange: (e) => M((t) => ({
|
|
319
364
|
...t,
|
|
320
365
|
startTime: e.target.value
|
|
321
366
|
})),
|
|
322
367
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
323
|
-
"aria-label":
|
|
368
|
+
"aria-label": S("calendar.availabilityStart", "Availability start time")
|
|
324
369
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ d("input", {
|
|
326
371
|
type: "time",
|
|
327
|
-
value:
|
|
328
|
-
onChange: (e) =>
|
|
372
|
+
value: j.endTime,
|
|
373
|
+
onChange: (e) => M((t) => ({
|
|
329
374
|
...t,
|
|
330
375
|
endTime: e.target.value
|
|
331
376
|
})),
|
|
332
377
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
333
|
-
"aria-label":
|
|
378
|
+
"aria-label": S("calendar.availabilityEnd", "Availability end time")
|
|
334
379
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ d("button", {
|
|
336
381
|
type: "submit",
|
|
337
|
-
disabled: !
|
|
382
|
+
disabled: !V || W,
|
|
338
383
|
className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
|
|
339
|
-
children:
|
|
384
|
+
children: W ? S("calendar.savingAvailability", "Saving...") : S("calendar.addAvailabilityRule", "Add availability rule")
|
|
340
385
|
})
|
|
341
386
|
]
|
|
342
387
|
}),
|
|
343
388
|
/* @__PURE__ */ f("div", {
|
|
344
389
|
className: "space-y-2",
|
|
345
|
-
children:
|
|
390
|
+
children: [Z.length === 0 ? /* @__PURE__ */ d(m, {
|
|
391
|
+
illustration: "empty-data",
|
|
392
|
+
className: "py-8",
|
|
393
|
+
title: S("calendar.noAvailabilityRules", "No availability rules yet"),
|
|
394
|
+
description: S("calendar.noAvailabilityRulesDesc", "Add a weekly window above to tell booking pages when you can be scheduled.")
|
|
395
|
+
}) : null, Z.map((e) => /* @__PURE__ */ f("div", {
|
|
346
396
|
className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
|
|
348
398
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
349
399
|
children: [
|
|
350
400
|
e.dayOfWeek,
|
|
@@ -353,27 +403,27 @@ function v() {
|
|
|
353
403
|
" - ",
|
|
354
404
|
e.endTime
|
|
355
405
|
]
|
|
356
|
-
}), /* @__PURE__ */
|
|
406
|
+
}), /* @__PURE__ */ d("p", {
|
|
357
407
|
className: "font-text-xs text-text-tertiary",
|
|
358
408
|
children: e.timezone
|
|
359
|
-
})] }), /* @__PURE__ */
|
|
409
|
+
})] }), /* @__PURE__ */ d("button", {
|
|
360
410
|
type: "button",
|
|
361
411
|
onClick: async () => {
|
|
362
|
-
await
|
|
412
|
+
await We({ variables: { id: e.id } }), await $();
|
|
363
413
|
},
|
|
364
414
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
|
|
365
|
-
children:
|
|
415
|
+
children: S("calendar.delete", "Delete")
|
|
366
416
|
})]
|
|
367
|
-
}, e.id))
|
|
417
|
+
}, e.id))]
|
|
368
418
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ f("form", {
|
|
370
420
|
onSubmit: async (e) => {
|
|
371
|
-
e.preventDefault(), !(!
|
|
372
|
-
calendarId:
|
|
373
|
-
startDate: new Date(
|
|
374
|
-
endDate: new Date(
|
|
375
|
-
reason:
|
|
376
|
-
} } }),
|
|
421
|
+
e.preventDefault(), !(!V || !N.startDate || !N.endDate) && (await Ge({ variables: { input: {
|
|
422
|
+
calendarId: V,
|
|
423
|
+
startDate: new Date(N.startDate).toISOString(),
|
|
424
|
+
endDate: new Date(N.endDate).toISOString(),
|
|
425
|
+
reason: N.reason || void 0
|
|
426
|
+
} } }), P({
|
|
377
427
|
startDate: "",
|
|
378
428
|
endDate: "",
|
|
379
429
|
reason: ""
|
|
@@ -381,88 +431,89 @@ function v() {
|
|
|
381
431
|
},
|
|
382
432
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-4",
|
|
383
433
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ d("input", {
|
|
385
435
|
type: "datetime-local",
|
|
386
|
-
value:
|
|
387
|
-
onChange: (e) =>
|
|
436
|
+
value: N.startDate,
|
|
437
|
+
onChange: (e) => P((t) => ({
|
|
388
438
|
...t,
|
|
389
439
|
startDate: e.target.value
|
|
390
440
|
})),
|
|
391
441
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
392
|
-
"aria-label":
|
|
442
|
+
"aria-label": S("calendar.blackoutStart", "Blackout start")
|
|
393
443
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ d("input", {
|
|
395
445
|
type: "datetime-local",
|
|
396
|
-
value:
|
|
397
|
-
onChange: (e) =>
|
|
446
|
+
value: N.endDate,
|
|
447
|
+
onChange: (e) => P((t) => ({
|
|
398
448
|
...t,
|
|
399
449
|
endDate: e.target.value
|
|
400
450
|
})),
|
|
401
451
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
402
|
-
"aria-label":
|
|
452
|
+
"aria-label": S("calendar.blackoutEnd", "Blackout end")
|
|
403
453
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
value:
|
|
406
|
-
onChange: (e) =>
|
|
454
|
+
/* @__PURE__ */ d("input", {
|
|
455
|
+
value: N.reason,
|
|
456
|
+
onChange: (e) => P((t) => ({
|
|
407
457
|
...t,
|
|
408
458
|
reason: e.target.value
|
|
409
459
|
})),
|
|
410
|
-
placeholder:
|
|
411
|
-
"aria-label":
|
|
460
|
+
placeholder: S("calendar.blackoutReason", "Reason for block"),
|
|
461
|
+
"aria-label": S("calendar.blackoutReason", "Reason for block"),
|
|
412
462
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
413
463
|
}),
|
|
414
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ d("button", {
|
|
415
465
|
type: "submit",
|
|
416
|
-
disabled: !
|
|
466
|
+
disabled: !V || G,
|
|
417
467
|
className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
|
|
418
|
-
children:
|
|
468
|
+
children: G ? S("calendar.blocking", "Blocking...") : S("calendar.addBlackout", "Add block")
|
|
419
469
|
})
|
|
420
470
|
]
|
|
421
471
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ d("div", {
|
|
423
473
|
className: "space-y-2",
|
|
424
|
-
children:
|
|
474
|
+
children: et.map((e) => /* @__PURE__ */ f("div", {
|
|
425
475
|
className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
|
|
426
|
-
children: [/* @__PURE__ */
|
|
476
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
|
|
427
477
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
428
478
|
children: [
|
|
429
|
-
|
|
479
|
+
v(e.startDate),
|
|
430
480
|
" → ",
|
|
431
|
-
|
|
481
|
+
v(e.endDate)
|
|
432
482
|
]
|
|
433
|
-
}), /* @__PURE__ */
|
|
483
|
+
}), /* @__PURE__ */ d("p", {
|
|
434
484
|
className: "font-text-xs text-text-tertiary",
|
|
435
485
|
children: e.reason ?? "—"
|
|
436
|
-
})] }), /* @__PURE__ */
|
|
486
|
+
})] }), /* @__PURE__ */ d("button", {
|
|
437
487
|
type: "button",
|
|
438
488
|
onClick: async () => {
|
|
439
|
-
await
|
|
489
|
+
await Ke({ variables: { id: e.id } }), await $();
|
|
440
490
|
},
|
|
441
491
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
|
|
442
|
-
children:
|
|
492
|
+
children: S("calendar.delete", "Delete")
|
|
443
493
|
})]
|
|
444
494
|
}, e.id))
|
|
445
495
|
})
|
|
446
496
|
]
|
|
447
497
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
498
|
+
/* @__PURE__ */ f(_, {
|
|
499
|
+
id: "settings-booking-pages",
|
|
500
|
+
title: S("calendar.bookingPages", "Booking pages"),
|
|
501
|
+
description: S("calendar.bookingPagesDescription", "Create Calendly-style booking pages for appointment scheduling from your calendar availability."),
|
|
502
|
+
icon: _e,
|
|
503
|
+
children: [/* @__PURE__ */ f("form", {
|
|
453
504
|
onSubmit: async (e) => {
|
|
454
|
-
e.preventDefault(), !(!
|
|
455
|
-
calendarId:
|
|
456
|
-
name:
|
|
457
|
-
slug:
|
|
458
|
-
pageType:
|
|
459
|
-
eventDuration: parseInt(
|
|
460
|
-
locationType:
|
|
461
|
-
maxAttendees: parseInt(
|
|
462
|
-
requireApproval:
|
|
505
|
+
e.preventDefault(), !(!V || !F.name.trim() || !F.slug.trim()) && (await qe({ variables: { input: {
|
|
506
|
+
calendarId: V,
|
|
507
|
+
name: F.name.trim(),
|
|
508
|
+
slug: F.slug.trim(),
|
|
509
|
+
pageType: F.pageType,
|
|
510
|
+
eventDuration: parseInt(F.eventDuration, 10),
|
|
511
|
+
locationType: F.locationType,
|
|
512
|
+
maxAttendees: parseInt(F.maxAttendees, 10),
|
|
513
|
+
requireApproval: F.requireApproval,
|
|
463
514
|
isActive: !0,
|
|
464
515
|
isPublic: !0
|
|
465
|
-
} } }),
|
|
516
|
+
} } }), I({
|
|
466
517
|
name: "",
|
|
467
518
|
slug: "",
|
|
468
519
|
pageType: "ONE_ON_ONE",
|
|
@@ -474,41 +525,41 @@ function v() {
|
|
|
474
525
|
},
|
|
475
526
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-3",
|
|
476
527
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
"aria-label":
|
|
479
|
-
value:
|
|
480
|
-
onChange: (e) =>
|
|
528
|
+
/* @__PURE__ */ d("input", {
|
|
529
|
+
"aria-label": S("calendar.bookingPageName", "Booking page name"),
|
|
530
|
+
value: F.name,
|
|
531
|
+
onChange: (e) => I((t) => ({
|
|
481
532
|
...t,
|
|
482
533
|
name: e.target.value
|
|
483
534
|
})),
|
|
484
|
-
placeholder:
|
|
535
|
+
placeholder: S("calendar.bookingPageName", "Booking page name"),
|
|
485
536
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
486
537
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
"aria-label":
|
|
489
|
-
value:
|
|
490
|
-
onChange: (e) =>
|
|
538
|
+
/* @__PURE__ */ d("input", {
|
|
539
|
+
"aria-label": S("calendar.bookingPageSlugLabel", "Booking page slug"),
|
|
540
|
+
value: F.slug,
|
|
541
|
+
onChange: (e) => I((t) => ({
|
|
491
542
|
...t,
|
|
492
543
|
slug: e.target.value
|
|
493
544
|
})),
|
|
494
|
-
placeholder:
|
|
545
|
+
placeholder: S("calendar.bookingPageSlug", "booking-page-slug"),
|
|
495
546
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
496
547
|
}),
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
"aria-label":
|
|
548
|
+
/* @__PURE__ */ d("input", {
|
|
549
|
+
"aria-label": S("calendar.bookingPageDuration", "Event duration in minutes"),
|
|
499
550
|
type: "number",
|
|
500
551
|
min: "15",
|
|
501
552
|
step: "15",
|
|
502
|
-
value:
|
|
503
|
-
onChange: (e) =>
|
|
553
|
+
value: F.eventDuration,
|
|
554
|
+
onChange: (e) => I((t) => ({
|
|
504
555
|
...t,
|
|
505
556
|
eventDuration: e.target.value
|
|
506
557
|
})),
|
|
507
558
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
508
559
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
value:
|
|
511
|
-
onChange: (e) =>
|
|
560
|
+
/* @__PURE__ */ d("select", {
|
|
561
|
+
value: F.pageType,
|
|
562
|
+
onChange: (e) => I((t) => ({
|
|
512
563
|
...t,
|
|
513
564
|
pageType: e.target.value
|
|
514
565
|
})),
|
|
@@ -518,14 +569,14 @@ function v() {
|
|
|
518
569
|
"GROUP",
|
|
519
570
|
"ROUND_ROBIN",
|
|
520
571
|
"COLLECTIVE"
|
|
521
|
-
].map((e) => /* @__PURE__ */
|
|
572
|
+
].map((e) => /* @__PURE__ */ d("option", {
|
|
522
573
|
value: e,
|
|
523
574
|
children: e
|
|
524
575
|
}, e))
|
|
525
576
|
}),
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
value:
|
|
528
|
-
onChange: (e) =>
|
|
577
|
+
/* @__PURE__ */ d("select", {
|
|
578
|
+
value: F.locationType,
|
|
579
|
+
onChange: (e) => I((t) => ({
|
|
529
580
|
...t,
|
|
530
581
|
locationType: e.target.value
|
|
531
582
|
})),
|
|
@@ -535,48 +586,53 @@ function v() {
|
|
|
535
586
|
"PHYSICAL",
|
|
536
587
|
"HYBRID",
|
|
537
588
|
"TBD"
|
|
538
|
-
].map((e) => /* @__PURE__ */
|
|
589
|
+
].map((e) => /* @__PURE__ */ d("option", {
|
|
539
590
|
value: e,
|
|
540
591
|
children: e
|
|
541
592
|
}, e))
|
|
542
593
|
}),
|
|
543
|
-
/* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ f("div", {
|
|
544
595
|
className: "flex items-center gap-3 rounded-radius-md border border-border-subtle bg-bg-canvas px-3 py-2",
|
|
545
|
-
children: [/* @__PURE__ */
|
|
596
|
+
children: [/* @__PURE__ */ d("input", {
|
|
546
597
|
id: "booking-page-approval",
|
|
547
|
-
"aria-label":
|
|
598
|
+
"aria-label": S("calendar.requireApproval", "Require approval"),
|
|
548
599
|
type: "checkbox",
|
|
549
|
-
checked:
|
|
550
|
-
onChange: (e) =>
|
|
600
|
+
checked: F.requireApproval,
|
|
601
|
+
onChange: (e) => I((t) => ({
|
|
551
602
|
...t,
|
|
552
603
|
requireApproval: e.target.checked
|
|
553
604
|
})),
|
|
554
605
|
className: "size-4 rounded border-border-default"
|
|
555
|
-
}), /* @__PURE__ */
|
|
606
|
+
}), /* @__PURE__ */ d("label", {
|
|
556
607
|
htmlFor: "booking-page-approval",
|
|
557
608
|
className: "font-text-sm text-text-primary",
|
|
558
|
-
children:
|
|
609
|
+
children: S("calendar.requireApproval", "Require approval")
|
|
559
610
|
})]
|
|
560
611
|
}),
|
|
561
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ d("button", {
|
|
562
613
|
type: "submit",
|
|
563
|
-
disabled: !
|
|
614
|
+
disabled: !V || K,
|
|
564
615
|
className: "@md:col-span-3 px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
|
|
565
|
-
children:
|
|
616
|
+
children: K ? S("calendar.creating", "Creating...") : S("calendar.createBookingPage", "Create booking page")
|
|
566
617
|
})
|
|
567
618
|
]
|
|
568
619
|
}), /* @__PURE__ */ f("div", {
|
|
569
620
|
className: "space-y-2",
|
|
570
|
-
children:
|
|
621
|
+
children: [X.length === 0 ? /* @__PURE__ */ d(m, {
|
|
622
|
+
illustration: "empty-data",
|
|
623
|
+
className: "py-8",
|
|
624
|
+
title: S("calendar.noBookingPages", "No booking pages yet"),
|
|
625
|
+
description: S("calendar.noBookingPagesDesc", "Create a booking page above to let others self-schedule time with you.")
|
|
626
|
+
}) : null, X.map((e) => /* @__PURE__ */ f("div", {
|
|
571
627
|
className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
|
|
572
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
|
|
573
629
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
574
630
|
children: [
|
|
575
631
|
e.name,
|
|
576
632
|
" • ",
|
|
577
633
|
e.pageType
|
|
578
634
|
]
|
|
579
|
-
}), /* @__PURE__ */
|
|
635
|
+
}), /* @__PURE__ */ f("p", {
|
|
580
636
|
className: "font-text-xs text-text-tertiary",
|
|
581
637
|
children: [
|
|
582
638
|
"/book/",
|
|
@@ -587,33 +643,34 @@ function v() {
|
|
|
587
643
|
" ",
|
|
588
644
|
e.isActive ? "ACTIVE" : "INACTIVE"
|
|
589
645
|
]
|
|
590
|
-
})] }), /* @__PURE__ */
|
|
646
|
+
})] }), /* @__PURE__ */ d("button", {
|
|
591
647
|
type: "button",
|
|
592
648
|
onClick: async () => {
|
|
593
|
-
await
|
|
649
|
+
await Je({ variables: { id: e.id } }), await $();
|
|
594
650
|
},
|
|
595
651
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
|
|
596
|
-
children:
|
|
652
|
+
children: S("calendar.delete", "Delete")
|
|
597
653
|
})]
|
|
598
|
-
}, e.id))
|
|
654
|
+
}, e.id))]
|
|
599
655
|
})]
|
|
600
656
|
}),
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
657
|
+
/* @__PURE__ */ f(_, {
|
|
658
|
+
id: "settings-external-sync",
|
|
659
|
+
title: S("calendar.externalCalendarSync", "External calendar sync"),
|
|
660
|
+
description: S("calendar.externalCalendarSyncDescription", "Configure Google, Outlook, and Apple-compatible sync connections and trigger synchronization cycles."),
|
|
661
|
+
icon: ye,
|
|
662
|
+
children: [/* @__PURE__ */ f("form", {
|
|
606
663
|
onSubmit: async (e) => {
|
|
607
|
-
e.preventDefault(), !(!
|
|
608
|
-
calendarId:
|
|
609
|
-
provider:
|
|
610
|
-
externalCalendarId:
|
|
611
|
-
externalCalendarName:
|
|
612
|
-
accessToken:
|
|
613
|
-
refreshToken:
|
|
614
|
-
syncFrequency: parseInt(
|
|
615
|
-
direction:
|
|
616
|
-
} } }),
|
|
664
|
+
e.preventDefault(), !(!V || !L.externalCalendarId.trim() || !L.accessToken.trim()) && (await Ye({ variables: { input: {
|
|
665
|
+
calendarId: V,
|
|
666
|
+
provider: L.provider,
|
|
667
|
+
externalCalendarId: L.externalCalendarId.trim(),
|
|
668
|
+
externalCalendarName: L.externalCalendarName.trim() || void 0,
|
|
669
|
+
accessToken: L.accessToken.trim(),
|
|
670
|
+
refreshToken: L.refreshToken.trim() || void 0,
|
|
671
|
+
syncFrequency: parseInt(L.syncFrequency, 10),
|
|
672
|
+
direction: L.direction
|
|
673
|
+
} } }), R({
|
|
617
674
|
provider: "GOOGLE_CALENDAR",
|
|
618
675
|
externalCalendarId: "",
|
|
619
676
|
externalCalendarName: "",
|
|
@@ -625,119 +682,124 @@ function v() {
|
|
|
625
682
|
},
|
|
626
683
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-3",
|
|
627
684
|
children: [
|
|
628
|
-
/* @__PURE__ */
|
|
629
|
-
value:
|
|
630
|
-
onChange: (e) =>
|
|
685
|
+
/* @__PURE__ */ f("select", {
|
|
686
|
+
value: L.provider,
|
|
687
|
+
onChange: (e) => R((t) => ({
|
|
631
688
|
...t,
|
|
632
689
|
provider: e.target.value
|
|
633
690
|
})),
|
|
634
691
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
635
692
|
children: [
|
|
636
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ d("option", {
|
|
637
694
|
value: "GOOGLE_CALENDAR",
|
|
638
695
|
children: "Google Calendar"
|
|
639
696
|
}),
|
|
640
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ d("option", {
|
|
641
698
|
value: "OUTLOOK_CALENDAR",
|
|
642
699
|
children: "Outlook Calendar"
|
|
643
700
|
}),
|
|
644
|
-
/* @__PURE__ */
|
|
701
|
+
/* @__PURE__ */ d("option", {
|
|
645
702
|
value: "APPLE_ICAL",
|
|
646
703
|
children: "Apple Calendar"
|
|
647
704
|
}),
|
|
648
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ d("option", {
|
|
649
706
|
value: "CALDAV",
|
|
650
707
|
children: "CalDAV"
|
|
651
708
|
})
|
|
652
709
|
]
|
|
653
710
|
}),
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
"aria-label":
|
|
656
|
-
value:
|
|
657
|
-
onChange: (e) =>
|
|
711
|
+
/* @__PURE__ */ d("input", {
|
|
712
|
+
"aria-label": S("calendar.externalCalendarId", "External calendar ID"),
|
|
713
|
+
value: L.externalCalendarId,
|
|
714
|
+
onChange: (e) => R((t) => ({
|
|
658
715
|
...t,
|
|
659
716
|
externalCalendarId: e.target.value
|
|
660
717
|
})),
|
|
661
|
-
placeholder:
|
|
718
|
+
placeholder: S("calendar.externalCalendarId", "External calendar ID"),
|
|
662
719
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
663
720
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
"aria-label":
|
|
666
|
-
value:
|
|
667
|
-
onChange: (e) =>
|
|
721
|
+
/* @__PURE__ */ d("input", {
|
|
722
|
+
"aria-label": S("calendar.externalCalendarName", "External calendar name"),
|
|
723
|
+
value: L.externalCalendarName,
|
|
724
|
+
onChange: (e) => R((t) => ({
|
|
668
725
|
...t,
|
|
669
726
|
externalCalendarName: e.target.value
|
|
670
727
|
})),
|
|
671
|
-
placeholder:
|
|
728
|
+
placeholder: S("calendar.externalCalendarName", "External calendar name"),
|
|
672
729
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
673
730
|
}),
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
"aria-label":
|
|
676
|
-
value:
|
|
677
|
-
onChange: (e) =>
|
|
731
|
+
/* @__PURE__ */ d("input", {
|
|
732
|
+
"aria-label": S("calendar.accessToken", "Access token"),
|
|
733
|
+
value: L.accessToken,
|
|
734
|
+
onChange: (e) => R((t) => ({
|
|
678
735
|
...t,
|
|
679
736
|
accessToken: e.target.value
|
|
680
737
|
})),
|
|
681
|
-
placeholder:
|
|
738
|
+
placeholder: S("calendar.accessToken", "Access token"),
|
|
682
739
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
683
740
|
}),
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
"aria-label":
|
|
686
|
-
value:
|
|
687
|
-
onChange: (e) =>
|
|
741
|
+
/* @__PURE__ */ d("input", {
|
|
742
|
+
"aria-label": S("calendar.refreshToken", "Refresh token (optional)"),
|
|
743
|
+
value: L.refreshToken,
|
|
744
|
+
onChange: (e) => R((t) => ({
|
|
688
745
|
...t,
|
|
689
746
|
refreshToken: e.target.value
|
|
690
747
|
})),
|
|
691
|
-
placeholder:
|
|
748
|
+
placeholder: S("calendar.refreshToken", "Refresh token (optional)"),
|
|
692
749
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
693
750
|
}),
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
"aria-label":
|
|
751
|
+
/* @__PURE__ */ d("input", {
|
|
752
|
+
"aria-label": S("calendar.syncFrequencyLabel", "Sync frequency in seconds"),
|
|
696
753
|
type: "number",
|
|
697
754
|
min: "60",
|
|
698
755
|
step: "60",
|
|
699
|
-
value:
|
|
700
|
-
onChange: (e) =>
|
|
756
|
+
value: L.syncFrequency,
|
|
757
|
+
onChange: (e) => R((t) => ({
|
|
701
758
|
...t,
|
|
702
759
|
syncFrequency: e.target.value
|
|
703
760
|
})),
|
|
704
761
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
705
762
|
}),
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
value:
|
|
708
|
-
onChange: (e) =>
|
|
763
|
+
/* @__PURE__ */ f("select", {
|
|
764
|
+
value: L.direction,
|
|
765
|
+
onChange: (e) => R((t) => ({
|
|
709
766
|
...t,
|
|
710
767
|
direction: e.target.value
|
|
711
768
|
})),
|
|
712
769
|
className: "@md:col-span-2 px-3 py-2 rounded-radius-md border border-border-default bg-bg-canvas text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
713
770
|
children: [
|
|
714
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ d("option", {
|
|
715
772
|
value: "TWO_WAY",
|
|
716
|
-
children:
|
|
773
|
+
children: S("calendar.twoWaySync", "Two-way sync")
|
|
717
774
|
}),
|
|
718
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ d("option", {
|
|
719
776
|
value: "ONE_WAY_TO_EXTERNAL",
|
|
720
|
-
children:
|
|
777
|
+
children: S("calendar.oneWayToExternal", "One-way to external")
|
|
721
778
|
}),
|
|
722
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ d("option", {
|
|
723
780
|
value: "ONE_WAY_FROM_EXTERNAL",
|
|
724
|
-
children:
|
|
781
|
+
children: S("calendar.oneWayFromExternal", "One-way from external")
|
|
725
782
|
})
|
|
726
783
|
]
|
|
727
784
|
}),
|
|
728
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ d("button", {
|
|
729
786
|
type: "submit",
|
|
730
|
-
disabled: !
|
|
787
|
+
disabled: !V || q,
|
|
731
788
|
className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover disabled:opacity-50",
|
|
732
|
-
children:
|
|
789
|
+
children: q ? S("calendar.connecting", "Connecting...") : S("calendar.connectExternalCalendar", "Connect external calendar")
|
|
733
790
|
})
|
|
734
791
|
]
|
|
735
792
|
}), /* @__PURE__ */ f("div", {
|
|
736
793
|
className: "space-y-3",
|
|
737
|
-
children:
|
|
794
|
+
children: [Q.length === 0 ? /* @__PURE__ */ d(m, {
|
|
795
|
+
illustration: "empty-generic",
|
|
796
|
+
className: "py-8",
|
|
797
|
+
title: S("calendar.noExternalSyncs", "No external calendars connected"),
|
|
798
|
+
description: S("calendar.noExternalSyncsDesc", "Connect Google, Outlook, or Apple above to keep events in sync both ways.")
|
|
799
|
+
}) : null, Q.map((e) => /* @__PURE__ */ f("div", {
|
|
738
800
|
className: "rounded-radius-md border border-border-subtle bg-bg-canvas p-3 space-y-3",
|
|
739
|
-
children: [/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */
|
|
801
|
+
children: [/* @__PURE__ */ f("div", { children: [
|
|
802
|
+
/* @__PURE__ */ f("p", {
|
|
741
803
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
742
804
|
children: [
|
|
743
805
|
e.provider,
|
|
@@ -745,70 +807,70 @@ function v() {
|
|
|
745
807
|
e.externalCalendarName ?? e.externalCalendarId
|
|
746
808
|
]
|
|
747
809
|
}),
|
|
748
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ f("p", {
|
|
749
811
|
className: "font-text-xs text-text-tertiary",
|
|
750
812
|
children: [
|
|
751
813
|
e.status,
|
|
752
814
|
" •",
|
|
753
815
|
" ",
|
|
754
|
-
|
|
816
|
+
S("calendar.everySeconds", "Every {value} seconds").replace("{value}", String(e.syncFrequency))
|
|
755
817
|
]
|
|
756
818
|
}),
|
|
757
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ f("p", {
|
|
758
820
|
className: "font-text-xs text-text-tertiary",
|
|
759
821
|
children: [
|
|
760
|
-
|
|
822
|
+
S("calendar.lastSync", "Last sync"),
|
|
761
823
|
": ",
|
|
762
|
-
|
|
824
|
+
v(e.lastSyncAt),
|
|
763
825
|
" •",
|
|
764
826
|
" ",
|
|
765
827
|
e.lastSyncStatus ?? "—"
|
|
766
828
|
]
|
|
767
829
|
}),
|
|
768
|
-
e.lastSyncError ? /* @__PURE__ */
|
|
830
|
+
e.lastSyncError ? /* @__PURE__ */ d("p", {
|
|
769
831
|
className: "font-text-xs text-text-secondary",
|
|
770
832
|
children: e.lastSyncError
|
|
771
833
|
}) : null
|
|
772
|
-
] }), /* @__PURE__ */
|
|
834
|
+
] }), /* @__PURE__ */ f("div", {
|
|
773
835
|
className: "flex flex-wrap gap-2",
|
|
774
836
|
children: [
|
|
775
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ d("button", {
|
|
776
838
|
type: "button",
|
|
777
839
|
onClick: async () => {
|
|
778
|
-
await
|
|
840
|
+
await Qe({ variables: { syncId: e.id } }), await $();
|
|
779
841
|
},
|
|
780
842
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
|
|
781
|
-
children:
|
|
843
|
+
children: S("calendar.triggerSync", "Trigger sync")
|
|
782
844
|
}),
|
|
783
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ d("button", {
|
|
784
846
|
type: "button",
|
|
785
847
|
onClick: async () => {
|
|
786
|
-
e.syncEnabled ? await
|
|
848
|
+
e.syncEnabled ? await Xe({ variables: { syncId: e.id } }) : await Ze({ variables: { syncId: e.id } }), await $();
|
|
787
849
|
},
|
|
788
850
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
|
|
789
|
-
children: e.syncEnabled ?
|
|
851
|
+
children: e.syncEnabled ? S("calendar.pauseSync", "Pause") : S("calendar.resumeSync", "Resume")
|
|
790
852
|
}),
|
|
791
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ d("button", {
|
|
792
854
|
type: "button",
|
|
793
855
|
onClick: async () => {
|
|
794
|
-
await
|
|
856
|
+
await $e({ variables: { syncId: e.id } }), await $();
|
|
795
857
|
},
|
|
796
858
|
className: "px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated text-text-primary font-text-sm",
|
|
797
|
-
children:
|
|
859
|
+
children: S("calendar.disconnect", "Disconnect")
|
|
798
860
|
})
|
|
799
861
|
]
|
|
800
862
|
})]
|
|
801
|
-
}, e.id))
|
|
863
|
+
}, e.id))]
|
|
802
864
|
})]
|
|
803
865
|
})
|
|
804
866
|
]
|
|
805
867
|
})]
|
|
806
|
-
}) : /* @__PURE__ */
|
|
807
|
-
title:
|
|
808
|
-
description:
|
|
868
|
+
}) : /* @__PURE__ */ d(pe, {
|
|
869
|
+
title: S("calendar.accessDenied", "Access Denied"),
|
|
870
|
+
description: S("calendar.noPermissionViewSettings", "You don't have permission to view calendar settings.")
|
|
809
871
|
});
|
|
810
872
|
}
|
|
811
873
|
//#endregion
|
|
812
|
-
export {
|
|
874
|
+
export { y as SettingsPage };
|
|
813
875
|
|
|
814
876
|
//# sourceMappingURL=SettingsPage.js.map
|