@burdenoff/microfe-calendar 2026.625.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/pages/CalendarPage.js +189 -146
- package/dist/pages/CalendarPage.js.map +1 -1
- package/dist/pages/EventDetailsPage.js +486 -445
- package/dist/pages/EventDetailsPage.js.map +1 -1
- package/dist/pages/ResourcesPage.js +194 -177
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/pages/SettingsPage.js +320 -263
- package/dist/pages/SettingsPage.js.map +1 -1
- package/dist/pages/SubscriptionsPage.js +39 -36
- package/dist/pages/SubscriptionsPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,50 +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
|
|
5
|
-
import { CALENDAR_PERMISSIONS as
|
|
6
|
-
import { useMemo as
|
|
7
|
-
import { AccessDenied as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { CalendarClock as
|
|
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
10
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
|
-
import { GlassCard as p, GradientText as xe } from "@burdenoff/fe-libs/ui";
|
|
12
|
-
import { useMutation as
|
|
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";
|
|
13
13
|
//#region src/pages/SettingsPage.tsx
|
|
14
|
-
function
|
|
14
|
+
function _({ id: e, title: t, description: n, icon: r, children: i, emphasis: a = !1 }) {
|
|
15
15
|
return /* @__PURE__ */ d(p, {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
id: e,
|
|
17
|
+
treatment: a ? "glass" : "metric",
|
|
18
|
+
glow: a,
|
|
19
|
+
className: "scroll-mt-24 p-card-padding",
|
|
18
20
|
children: /* @__PURE__ */ f("div", {
|
|
19
21
|
className: "space-y-4",
|
|
20
22
|
children: [/* @__PURE__ */ f("div", {
|
|
21
23
|
className: "flex items-start gap-3",
|
|
22
|
-
children: [/* @__PURE__ */ d(
|
|
24
|
+
children: [/* @__PURE__ */ d(r, { className: "size-5 text-text-secondary shrink-0" }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("h2", {
|
|
23
25
|
className: "font-heading-sm text-text-primary",
|
|
24
|
-
children: e
|
|
25
|
-
}), t ? /* @__PURE__ */ d("p", {
|
|
26
|
-
className: "font-text-sm text-text-secondary mt-1",
|
|
27
26
|
children: t
|
|
27
|
+
}), n ? /* @__PURE__ */ d("p", {
|
|
28
|
+
className: "font-text-sm text-text-secondary mt-1",
|
|
29
|
+
children: n
|
|
28
30
|
}) : null] })]
|
|
29
|
-
}),
|
|
31
|
+
}), i]
|
|
30
32
|
})
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
function
|
|
35
|
+
function v(e) {
|
|
34
36
|
return e ? new Date(e).toLocaleString() : "—";
|
|
35
37
|
}
|
|
36
|
-
function
|
|
37
|
-
let { hasPermission: p, isLoading:
|
|
38
|
-
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);
|
|
39
41
|
return n === e ? t : n;
|
|
40
|
-
},
|
|
41
|
-
day:
|
|
42
|
-
week:
|
|
43
|
-
month:
|
|
44
|
-
year:
|
|
45
|
-
agenda:
|
|
46
|
-
timeline:
|
|
47
|
-
}, [
|
|
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({
|
|
48
50
|
dayOfWeek: "MONDAY",
|
|
49
51
|
startTime: "09:00",
|
|
50
52
|
endTime: "17:00",
|
|
@@ -53,11 +55,11 @@ function v() {
|
|
|
53
55
|
slotIncrement: "30",
|
|
54
56
|
minNotice: "60",
|
|
55
57
|
maxNotice: "43200"
|
|
56
|
-
}), [
|
|
58
|
+
}), [N, P] = l({
|
|
57
59
|
startDate: "",
|
|
58
60
|
endDate: "",
|
|
59
61
|
reason: ""
|
|
60
|
-
}), [
|
|
62
|
+
}), [F, I] = l({
|
|
61
63
|
name: "",
|
|
62
64
|
slug: "",
|
|
63
65
|
pageType: "ONE_ON_ONE",
|
|
@@ -65,7 +67,7 @@ function v() {
|
|
|
65
67
|
locationType: "ONLINE",
|
|
66
68
|
maxAttendees: "1",
|
|
67
69
|
requireApproval: !1
|
|
68
|
-
}), [
|
|
70
|
+
}), [L, R] = l({
|
|
69
71
|
provider: "GOOGLE_CALENDAR",
|
|
70
72
|
externalCalendarId: "",
|
|
71
73
|
externalCalendarName: "",
|
|
@@ -73,109 +75,143 @@ function v() {
|
|
|
73
75
|
refreshToken: "",
|
|
74
76
|
syncFrequency: "300",
|
|
75
77
|
direction: "TWO_WAY"
|
|
76
|
-
}), { data:
|
|
78
|
+
}), { data: z, loading: ke, refetch: Ae } = e({
|
|
77
79
|
variables: { pagination: { limit: 50 } },
|
|
78
|
-
skip:
|
|
79
|
-
}),
|
|
80
|
-
variables: { id:
|
|
81
|
-
skip: !
|
|
80
|
+
skip: y
|
|
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,
|
|
82
84
|
fetchPolicy: "cache-and-network"
|
|
83
|
-
}), { data:
|
|
84
|
-
variables: { calendarId:
|
|
85
|
-
skip: !
|
|
85
|
+
}), { data: Fe, refetch: Ie } = g(r, {
|
|
86
|
+
variables: { calendarId: V },
|
|
87
|
+
skip: !V,
|
|
86
88
|
fetchPolicy: "cache-and-network"
|
|
87
|
-
}), { data:
|
|
89
|
+
}), { data: Le, refetch: Re } = g(i, {
|
|
88
90
|
variables: {
|
|
89
|
-
calendarId:
|
|
90
|
-
startDate:
|
|
91
|
-
endDate:
|
|
91
|
+
calendarId: V,
|
|
92
|
+
startDate: je,
|
|
93
|
+
endDate: Me
|
|
92
94
|
},
|
|
93
|
-
skip: !
|
|
95
|
+
skip: !V,
|
|
94
96
|
fetchPolicy: "cache-and-network"
|
|
95
|
-
}), { data:
|
|
96
|
-
variables: { calendarId:
|
|
97
|
-
skip: !
|
|
97
|
+
}), { data: ze, refetch: Be } = g(se, {
|
|
98
|
+
variables: { calendarId: V },
|
|
99
|
+
skip: !V,
|
|
98
100
|
fetchPolicy: "cache-and-network"
|
|
99
|
-
}), [
|
|
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 () => {
|
|
100
102
|
await Promise.all([
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
Ae(),
|
|
104
|
+
Pe(),
|
|
105
|
+
Ie(),
|
|
106
|
+
Re(),
|
|
107
|
+
Be()
|
|
106
108
|
]);
|
|
107
109
|
};
|
|
108
|
-
return
|
|
110
|
+
return y || ke ? /* @__PURE__ */ d("div", {
|
|
109
111
|
className: "@container min-h-screen bg-bg-canvas flex items-center justify-center",
|
|
110
112
|
children: /* @__PURE__ */ d("p", {
|
|
111
113
|
className: "font-text-md text-text-secondary",
|
|
112
|
-
children:
|
|
114
|
+
children: S("calendar.loading", "Loading...")
|
|
113
115
|
})
|
|
114
|
-
}) : p(
|
|
116
|
+
}) : p(fe.CALENDAR_READ) ? /* @__PURE__ */ f("div", {
|
|
115
117
|
className: "@container min-h-screen bg-bg-canvas",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ f("header", {
|
|
117
119
|
className: "border-b border-border-seam bg-bg-surface px-page-padding py-element-padding",
|
|
118
|
-
children: /* @__PURE__ */ f("div", {
|
|
120
|
+
children: [/* @__PURE__ */ f("div", {
|
|
119
121
|
className: "flex items-center gap-inline-gap",
|
|
120
122
|
children: [/* @__PURE__ */ d(ve, { className: "size-5 text-text-secondary" }), /* @__PURE__ */ d("h1", {
|
|
121
123
|
className: "font-heading-lg text-text-primary",
|
|
122
|
-
children: /* @__PURE__ */ d(xe, { children:
|
|
124
|
+
children: /* @__PURE__ */ d(xe, { children: S("calendar.calendarSettings", "Calendar Settings") })
|
|
123
125
|
})]
|
|
124
|
-
})
|
|
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
|
+
})]
|
|
125
130
|
}), /* @__PURE__ */ f("div", {
|
|
126
131
|
className: "max-w-5xl mx-auto p-page-padding space-y-6",
|
|
127
132
|
children: [
|
|
128
|
-
/* @__PURE__ */ d(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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,
|
|
132
168
|
children: /* @__PURE__ */ d("select", {
|
|
133
|
-
value:
|
|
134
|
-
onChange: (e) =>
|
|
169
|
+
value: V,
|
|
170
|
+
onChange: (e) => T(e.target.value),
|
|
135
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",
|
|
136
|
-
children:
|
|
172
|
+
children: B.map((e) => /* @__PURE__ */ d("option", {
|
|
137
173
|
value: e.id,
|
|
138
174
|
children: e.name
|
|
139
175
|
}, e.id))
|
|
140
176
|
})
|
|
141
177
|
}),
|
|
142
|
-
/* @__PURE__ */ f(
|
|
143
|
-
title:
|
|
144
|
-
description:
|
|
145
|
-
icon:
|
|
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,
|
|
146
182
|
children: [/* @__PURE__ */ f("div", {
|
|
147
183
|
className: "grid grid-cols-1 gap-4 @md:grid-cols-2",
|
|
148
184
|
children: [/* @__PURE__ */ f("div", {
|
|
149
185
|
className: "space-y-2",
|
|
150
186
|
children: [/* @__PURE__ */ d("p", {
|
|
151
187
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
152
|
-
children:
|
|
188
|
+
children: S("calendar.currentView", "Current view")
|
|
153
189
|
}), /* @__PURE__ */ d("p", {
|
|
154
190
|
className: "font-text-sm text-text-secondary",
|
|
155
|
-
children:
|
|
191
|
+
children: C[b] ?? b
|
|
156
192
|
})]
|
|
157
193
|
}), /* @__PURE__ */ f("div", {
|
|
158
194
|
className: "flex items-center justify-between rounded-radius-md border border-border-subtle px-3 py-2 bg-bg-canvas",
|
|
159
195
|
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
160
196
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
161
|
-
children:
|
|
197
|
+
children: S("calendar.showMiniCalendar", "Show mini calendar")
|
|
162
198
|
}), /* @__PURE__ */ d("p", {
|
|
163
199
|
className: "font-text-xs text-text-tertiary",
|
|
164
|
-
children:
|
|
200
|
+
children: S("calendar.showMiniCalendarDescription", "Display the mini calendar sidebar in calendar views.")
|
|
165
201
|
})] }), /* @__PURE__ */ d("input", {
|
|
166
202
|
type: "checkbox",
|
|
167
|
-
checked:
|
|
168
|
-
onChange: (e) =>
|
|
203
|
+
checked: Te,
|
|
204
|
+
onChange: (e) => Ee(e.target.checked),
|
|
169
205
|
className: "size-4 rounded border-border-default",
|
|
170
|
-
"aria-label":
|
|
206
|
+
"aria-label": S("calendar.showMiniCalendar", "Show mini calendar")
|
|
171
207
|
})]
|
|
172
208
|
})]
|
|
173
209
|
}), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
174
210
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
175
|
-
children:
|
|
211
|
+
children: S("calendar.timezone", "Timezone")
|
|
176
212
|
}), /* @__PURE__ */ d("select", {
|
|
177
|
-
value:
|
|
178
|
-
onChange: (e) =>
|
|
213
|
+
value: x,
|
|
214
|
+
onChange: (e) => we(e.target.value),
|
|
179
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",
|
|
180
216
|
children: Intl.supportedValuesOf("timeZone").map((e) => /* @__PURE__ */ d("option", {
|
|
181
217
|
value: e,
|
|
@@ -183,123 +219,127 @@ function v() {
|
|
|
183
219
|
}, e))
|
|
184
220
|
})] })]
|
|
185
221
|
}),
|
|
186
|
-
/* @__PURE__ */ f(
|
|
187
|
-
|
|
188
|
-
|
|
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."),
|
|
189
226
|
icon: be,
|
|
190
227
|
children: [/* @__PURE__ */ f("form", {
|
|
191
228
|
onSubmit: async (e) => {
|
|
192
|
-
e.preventDefault(), !(!
|
|
193
|
-
calendarId:
|
|
194
|
-
userId:
|
|
195
|
-
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,
|
|
196
233
|
canView: !0,
|
|
197
|
-
canEdit:
|
|
198
|
-
canManage:
|
|
199
|
-
} }),
|
|
234
|
+
canEdit: k !== "VIEW",
|
|
235
|
+
canManage: k === "ADMIN"
|
|
236
|
+
} }), D(""), A("VIEW"), await $());
|
|
200
237
|
},
|
|
201
238
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-4",
|
|
202
239
|
children: [
|
|
203
240
|
/* @__PURE__ */ f("select", {
|
|
204
|
-
value:
|
|
205
|
-
onChange: (e) =>
|
|
241
|
+
value: O,
|
|
242
|
+
onChange: (e) => Oe(e.target.value),
|
|
206
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",
|
|
207
244
|
children: [/* @__PURE__ */ d("option", {
|
|
208
245
|
value: "user",
|
|
209
|
-
children:
|
|
246
|
+
children: S("calendar.shareWithUser", "User")
|
|
210
247
|
}), /* @__PURE__ */ d("option", {
|
|
211
248
|
value: "team",
|
|
212
|
-
children:
|
|
249
|
+
children: S("calendar.shareWithTeam", "Team")
|
|
213
250
|
})]
|
|
214
251
|
}),
|
|
215
252
|
/* @__PURE__ */ d("input", {
|
|
216
|
-
value:
|
|
217
|
-
onChange: (e) =>
|
|
218
|
-
placeholder:
|
|
219
|
-
"aria-label":
|
|
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"),
|
|
220
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"
|
|
221
258
|
}),
|
|
222
259
|
/* @__PURE__ */ f("select", {
|
|
223
|
-
value:
|
|
224
|
-
onChange: (e) =>
|
|
260
|
+
value: k,
|
|
261
|
+
onChange: (e) => A(e.target.value),
|
|
225
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",
|
|
226
263
|
children: [
|
|
227
264
|
/* @__PURE__ */ d("option", {
|
|
228
265
|
value: "VIEW",
|
|
229
|
-
children:
|
|
266
|
+
children: S("calendar.permissionView", "View")
|
|
230
267
|
}),
|
|
231
268
|
/* @__PURE__ */ d("option", {
|
|
232
269
|
value: "EDIT",
|
|
233
|
-
children:
|
|
270
|
+
children: S("calendar.permissionEdit", "Edit")
|
|
234
271
|
}),
|
|
235
272
|
/* @__PURE__ */ d("option", {
|
|
236
273
|
value: "ADMIN",
|
|
237
|
-
children:
|
|
274
|
+
children: S("calendar.permissionAdmin", "Admin")
|
|
238
275
|
})
|
|
239
276
|
]
|
|
240
277
|
}),
|
|
241
278
|
/* @__PURE__ */ d("button", {
|
|
242
279
|
type: "submit",
|
|
243
|
-
disabled: !
|
|
280
|
+
disabled: !V || !E.trim() || U,
|
|
244
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",
|
|
245
|
-
children:
|
|
282
|
+
children: U ? S("calendar.sharing", "Sharing...") : S("calendar.shareCalendar", "Share calendar")
|
|
246
283
|
})
|
|
247
284
|
]
|
|
248
285
|
}), /* @__PURE__ */ d("div", {
|
|
249
286
|
className: "space-y-2",
|
|
250
|
-
children:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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", {
|
|
254
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",
|
|
255
294
|
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
256
295
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
257
|
-
children: e.userId ?? e.teamId ??
|
|
296
|
+
children: e.userId ?? e.teamId ?? S("calendar.unknownShareTarget", "Unknown target")
|
|
258
297
|
}), /* @__PURE__ */ f("p", {
|
|
259
298
|
className: "font-text-xs text-text-tertiary",
|
|
260
299
|
children: [
|
|
261
300
|
e.canManage ? "ADMIN" : e.canEdit ? "EDIT" : "VIEW",
|
|
262
301
|
" •",
|
|
263
302
|
" ",
|
|
264
|
-
|
|
303
|
+
v(e.createdAt)
|
|
265
304
|
]
|
|
266
305
|
})] }), /* @__PURE__ */ d("button", {
|
|
267
306
|
type: "button",
|
|
268
307
|
onClick: async () => {
|
|
269
|
-
await
|
|
308
|
+
await He({ variables: { shareId: e.id } }), await $();
|
|
270
309
|
},
|
|
271
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",
|
|
272
|
-
children:
|
|
311
|
+
children: S("calendar.revokeShare", "Revoke")
|
|
273
312
|
})]
|
|
274
313
|
}, e.id))
|
|
275
314
|
})]
|
|
276
315
|
}),
|
|
277
|
-
/* @__PURE__ */ f(
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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,
|
|
281
321
|
children: [
|
|
282
322
|
/* @__PURE__ */ f("form", {
|
|
283
323
|
onSubmit: async (e) => {
|
|
284
|
-
e.preventDefault(),
|
|
285
|
-
calendarId:
|
|
286
|
-
dayOfWeek:
|
|
324
|
+
e.preventDefault(), V && (await Ue({ variables: { input: {
|
|
325
|
+
calendarId: V,
|
|
326
|
+
dayOfWeek: j.dayOfWeek,
|
|
287
327
|
isAvailable: !0,
|
|
288
|
-
startTime:
|
|
289
|
-
endTime:
|
|
290
|
-
timezone:
|
|
291
|
-
bufferBefore: parseInt(
|
|
292
|
-
bufferAfter: parseInt(
|
|
293
|
-
slotIncrement: parseInt(
|
|
294
|
-
minNotice: parseInt(
|
|
295
|
-
maxNotice: parseInt(
|
|
328
|
+
startTime: j.startTime,
|
|
329
|
+
endTime: j.endTime,
|
|
330
|
+
timezone: x,
|
|
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)
|
|
296
336
|
} } }), await $());
|
|
297
337
|
},
|
|
298
338
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-4",
|
|
299
339
|
children: [
|
|
300
340
|
/* @__PURE__ */ d("select", {
|
|
301
|
-
value:
|
|
302
|
-
onChange: (e) =>
|
|
341
|
+
value: j.dayOfWeek,
|
|
342
|
+
onChange: (e) => M((t) => ({
|
|
303
343
|
...t,
|
|
304
344
|
dayOfWeek: e.target.value
|
|
305
345
|
})),
|
|
@@ -319,35 +359,40 @@ function v() {
|
|
|
319
359
|
}),
|
|
320
360
|
/* @__PURE__ */ d("input", {
|
|
321
361
|
type: "time",
|
|
322
|
-
value:
|
|
323
|
-
onChange: (e) =>
|
|
362
|
+
value: j.startTime,
|
|
363
|
+
onChange: (e) => M((t) => ({
|
|
324
364
|
...t,
|
|
325
365
|
startTime: e.target.value
|
|
326
366
|
})),
|
|
327
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",
|
|
328
|
-
"aria-label":
|
|
368
|
+
"aria-label": S("calendar.availabilityStart", "Availability start time")
|
|
329
369
|
}),
|
|
330
370
|
/* @__PURE__ */ d("input", {
|
|
331
371
|
type: "time",
|
|
332
|
-
value:
|
|
333
|
-
onChange: (e) =>
|
|
372
|
+
value: j.endTime,
|
|
373
|
+
onChange: (e) => M((t) => ({
|
|
334
374
|
...t,
|
|
335
375
|
endTime: e.target.value
|
|
336
376
|
})),
|
|
337
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",
|
|
338
|
-
"aria-label":
|
|
378
|
+
"aria-label": S("calendar.availabilityEnd", "Availability end time")
|
|
339
379
|
}),
|
|
340
380
|
/* @__PURE__ */ d("button", {
|
|
341
381
|
type: "submit",
|
|
342
|
-
disabled: !
|
|
382
|
+
disabled: !V || W,
|
|
343
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",
|
|
344
|
-
children:
|
|
384
|
+
children: W ? S("calendar.savingAvailability", "Saving...") : S("calendar.addAvailabilityRule", "Add availability rule")
|
|
345
385
|
})
|
|
346
386
|
]
|
|
347
387
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ f("div", {
|
|
349
389
|
className: "space-y-2",
|
|
350
|
-
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", {
|
|
351
396
|
className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
|
|
352
397
|
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
|
|
353
398
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
@@ -364,21 +409,21 @@ function v() {
|
|
|
364
409
|
})] }), /* @__PURE__ */ d("button", {
|
|
365
410
|
type: "button",
|
|
366
411
|
onClick: async () => {
|
|
367
|
-
await
|
|
412
|
+
await We({ variables: { id: e.id } }), await $();
|
|
368
413
|
},
|
|
369
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",
|
|
370
|
-
children:
|
|
415
|
+
children: S("calendar.delete", "Delete")
|
|
371
416
|
})]
|
|
372
|
-
}, e.id))
|
|
417
|
+
}, e.id))]
|
|
373
418
|
}),
|
|
374
419
|
/* @__PURE__ */ f("form", {
|
|
375
420
|
onSubmit: async (e) => {
|
|
376
|
-
e.preventDefault(), !(!
|
|
377
|
-
calendarId:
|
|
378
|
-
startDate: new Date(
|
|
379
|
-
endDate: new Date(
|
|
380
|
-
reason:
|
|
381
|
-
} } }),
|
|
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({
|
|
382
427
|
startDate: "",
|
|
383
428
|
endDate: "",
|
|
384
429
|
reason: ""
|
|
@@ -388,52 +433,52 @@ function v() {
|
|
|
388
433
|
children: [
|
|
389
434
|
/* @__PURE__ */ d("input", {
|
|
390
435
|
type: "datetime-local",
|
|
391
|
-
value:
|
|
392
|
-
onChange: (e) =>
|
|
436
|
+
value: N.startDate,
|
|
437
|
+
onChange: (e) => P((t) => ({
|
|
393
438
|
...t,
|
|
394
439
|
startDate: e.target.value
|
|
395
440
|
})),
|
|
396
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",
|
|
397
|
-
"aria-label":
|
|
442
|
+
"aria-label": S("calendar.blackoutStart", "Blackout start")
|
|
398
443
|
}),
|
|
399
444
|
/* @__PURE__ */ d("input", {
|
|
400
445
|
type: "datetime-local",
|
|
401
|
-
value:
|
|
402
|
-
onChange: (e) =>
|
|
446
|
+
value: N.endDate,
|
|
447
|
+
onChange: (e) => P((t) => ({
|
|
403
448
|
...t,
|
|
404
449
|
endDate: e.target.value
|
|
405
450
|
})),
|
|
406
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",
|
|
407
|
-
"aria-label":
|
|
452
|
+
"aria-label": S("calendar.blackoutEnd", "Blackout end")
|
|
408
453
|
}),
|
|
409
454
|
/* @__PURE__ */ d("input", {
|
|
410
|
-
value:
|
|
411
|
-
onChange: (e) =>
|
|
455
|
+
value: N.reason,
|
|
456
|
+
onChange: (e) => P((t) => ({
|
|
412
457
|
...t,
|
|
413
458
|
reason: e.target.value
|
|
414
459
|
})),
|
|
415
|
-
placeholder:
|
|
416
|
-
"aria-label":
|
|
460
|
+
placeholder: S("calendar.blackoutReason", "Reason for block"),
|
|
461
|
+
"aria-label": S("calendar.blackoutReason", "Reason for block"),
|
|
417
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"
|
|
418
463
|
}),
|
|
419
464
|
/* @__PURE__ */ d("button", {
|
|
420
465
|
type: "submit",
|
|
421
|
-
disabled: !
|
|
466
|
+
disabled: !V || G,
|
|
422
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",
|
|
423
|
-
children:
|
|
468
|
+
children: G ? S("calendar.blocking", "Blocking...") : S("calendar.addBlackout", "Add block")
|
|
424
469
|
})
|
|
425
470
|
]
|
|
426
471
|
}),
|
|
427
472
|
/* @__PURE__ */ d("div", {
|
|
428
473
|
className: "space-y-2",
|
|
429
|
-
children:
|
|
474
|
+
children: et.map((e) => /* @__PURE__ */ f("div", {
|
|
430
475
|
className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
|
|
431
476
|
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
|
|
432
477
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
433
478
|
children: [
|
|
434
|
-
|
|
479
|
+
v(e.startDate),
|
|
435
480
|
" → ",
|
|
436
|
-
|
|
481
|
+
v(e.endDate)
|
|
437
482
|
]
|
|
438
483
|
}), /* @__PURE__ */ d("p", {
|
|
439
484
|
className: "font-text-xs text-text-tertiary",
|
|
@@ -441,33 +486,34 @@ function v() {
|
|
|
441
486
|
})] }), /* @__PURE__ */ d("button", {
|
|
442
487
|
type: "button",
|
|
443
488
|
onClick: async () => {
|
|
444
|
-
await
|
|
489
|
+
await Ke({ variables: { id: e.id } }), await $();
|
|
445
490
|
},
|
|
446
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",
|
|
447
|
-
children:
|
|
492
|
+
children: S("calendar.delete", "Delete")
|
|
448
493
|
})]
|
|
449
494
|
}, e.id))
|
|
450
495
|
})
|
|
451
496
|
]
|
|
452
497
|
}),
|
|
453
|
-
/* @__PURE__ */ f(
|
|
454
|
-
|
|
455
|
-
|
|
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."),
|
|
456
502
|
icon: _e,
|
|
457
503
|
children: [/* @__PURE__ */ f("form", {
|
|
458
504
|
onSubmit: async (e) => {
|
|
459
|
-
e.preventDefault(), !(!
|
|
460
|
-
calendarId:
|
|
461
|
-
name:
|
|
462
|
-
slug:
|
|
463
|
-
pageType:
|
|
464
|
-
eventDuration: parseInt(
|
|
465
|
-
locationType:
|
|
466
|
-
maxAttendees: parseInt(
|
|
467
|
-
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,
|
|
468
514
|
isActive: !0,
|
|
469
515
|
isPublic: !0
|
|
470
|
-
} } }),
|
|
516
|
+
} } }), I({
|
|
471
517
|
name: "",
|
|
472
518
|
slug: "",
|
|
473
519
|
pageType: "ONE_ON_ONE",
|
|
@@ -480,40 +526,40 @@ function v() {
|
|
|
480
526
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-3",
|
|
481
527
|
children: [
|
|
482
528
|
/* @__PURE__ */ d("input", {
|
|
483
|
-
"aria-label":
|
|
484
|
-
value:
|
|
485
|
-
onChange: (e) =>
|
|
529
|
+
"aria-label": S("calendar.bookingPageName", "Booking page name"),
|
|
530
|
+
value: F.name,
|
|
531
|
+
onChange: (e) => I((t) => ({
|
|
486
532
|
...t,
|
|
487
533
|
name: e.target.value
|
|
488
534
|
})),
|
|
489
|
-
placeholder:
|
|
535
|
+
placeholder: S("calendar.bookingPageName", "Booking page name"),
|
|
490
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"
|
|
491
537
|
}),
|
|
492
538
|
/* @__PURE__ */ d("input", {
|
|
493
|
-
"aria-label":
|
|
494
|
-
value:
|
|
495
|
-
onChange: (e) =>
|
|
539
|
+
"aria-label": S("calendar.bookingPageSlugLabel", "Booking page slug"),
|
|
540
|
+
value: F.slug,
|
|
541
|
+
onChange: (e) => I((t) => ({
|
|
496
542
|
...t,
|
|
497
543
|
slug: e.target.value
|
|
498
544
|
})),
|
|
499
|
-
placeholder:
|
|
545
|
+
placeholder: S("calendar.bookingPageSlug", "booking-page-slug"),
|
|
500
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"
|
|
501
547
|
}),
|
|
502
548
|
/* @__PURE__ */ d("input", {
|
|
503
|
-
"aria-label":
|
|
549
|
+
"aria-label": S("calendar.bookingPageDuration", "Event duration in minutes"),
|
|
504
550
|
type: "number",
|
|
505
551
|
min: "15",
|
|
506
552
|
step: "15",
|
|
507
|
-
value:
|
|
508
|
-
onChange: (e) =>
|
|
553
|
+
value: F.eventDuration,
|
|
554
|
+
onChange: (e) => I((t) => ({
|
|
509
555
|
...t,
|
|
510
556
|
eventDuration: e.target.value
|
|
511
557
|
})),
|
|
512
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"
|
|
513
559
|
}),
|
|
514
560
|
/* @__PURE__ */ d("select", {
|
|
515
|
-
value:
|
|
516
|
-
onChange: (e) =>
|
|
561
|
+
value: F.pageType,
|
|
562
|
+
onChange: (e) => I((t) => ({
|
|
517
563
|
...t,
|
|
518
564
|
pageType: e.target.value
|
|
519
565
|
})),
|
|
@@ -529,8 +575,8 @@ function v() {
|
|
|
529
575
|
}, e))
|
|
530
576
|
}),
|
|
531
577
|
/* @__PURE__ */ d("select", {
|
|
532
|
-
value:
|
|
533
|
-
onChange: (e) =>
|
|
578
|
+
value: F.locationType,
|
|
579
|
+
onChange: (e) => I((t) => ({
|
|
534
580
|
...t,
|
|
535
581
|
locationType: e.target.value
|
|
536
582
|
})),
|
|
@@ -549,10 +595,10 @@ function v() {
|
|
|
549
595
|
className: "flex items-center gap-3 rounded-radius-md border border-border-subtle bg-bg-canvas px-3 py-2",
|
|
550
596
|
children: [/* @__PURE__ */ d("input", {
|
|
551
597
|
id: "booking-page-approval",
|
|
552
|
-
"aria-label":
|
|
598
|
+
"aria-label": S("calendar.requireApproval", "Require approval"),
|
|
553
599
|
type: "checkbox",
|
|
554
|
-
checked:
|
|
555
|
-
onChange: (e) =>
|
|
600
|
+
checked: F.requireApproval,
|
|
601
|
+
onChange: (e) => I((t) => ({
|
|
556
602
|
...t,
|
|
557
603
|
requireApproval: e.target.checked
|
|
558
604
|
})),
|
|
@@ -560,19 +606,24 @@ function v() {
|
|
|
560
606
|
}), /* @__PURE__ */ d("label", {
|
|
561
607
|
htmlFor: "booking-page-approval",
|
|
562
608
|
className: "font-text-sm text-text-primary",
|
|
563
|
-
children:
|
|
609
|
+
children: S("calendar.requireApproval", "Require approval")
|
|
564
610
|
})]
|
|
565
611
|
}),
|
|
566
612
|
/* @__PURE__ */ d("button", {
|
|
567
613
|
type: "submit",
|
|
568
|
-
disabled: !
|
|
614
|
+
disabled: !V || K,
|
|
569
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",
|
|
570
|
-
children:
|
|
616
|
+
children: K ? S("calendar.creating", "Creating...") : S("calendar.createBookingPage", "Create booking page")
|
|
571
617
|
})
|
|
572
618
|
]
|
|
573
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ f("div", {
|
|
574
620
|
className: "space-y-2",
|
|
575
|
-
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", {
|
|
576
627
|
className: "flex items-center justify-between rounded-radius-md border border-border-subtle bg-bg-canvas p-3",
|
|
577
628
|
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("p", {
|
|
578
629
|
className: "font-text-sm font-weight-medium text-text-primary",
|
|
@@ -595,30 +646,31 @@ function v() {
|
|
|
595
646
|
})] }), /* @__PURE__ */ d("button", {
|
|
596
647
|
type: "button",
|
|
597
648
|
onClick: async () => {
|
|
598
|
-
await
|
|
649
|
+
await Je({ variables: { id: e.id } }), await $();
|
|
599
650
|
},
|
|
600
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",
|
|
601
|
-
children:
|
|
652
|
+
children: S("calendar.delete", "Delete")
|
|
602
653
|
})]
|
|
603
|
-
}, e.id))
|
|
654
|
+
}, e.id))]
|
|
604
655
|
})]
|
|
605
656
|
}),
|
|
606
|
-
/* @__PURE__ */ f(
|
|
607
|
-
|
|
608
|
-
|
|
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."),
|
|
609
661
|
icon: ye,
|
|
610
662
|
children: [/* @__PURE__ */ f("form", {
|
|
611
663
|
onSubmit: async (e) => {
|
|
612
|
-
e.preventDefault(), !(!
|
|
613
|
-
calendarId:
|
|
614
|
-
provider:
|
|
615
|
-
externalCalendarId:
|
|
616
|
-
externalCalendarName:
|
|
617
|
-
accessToken:
|
|
618
|
-
refreshToken:
|
|
619
|
-
syncFrequency: parseInt(
|
|
620
|
-
direction:
|
|
621
|
-
} } }),
|
|
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({
|
|
622
674
|
provider: "GOOGLE_CALENDAR",
|
|
623
675
|
externalCalendarId: "",
|
|
624
676
|
externalCalendarName: "",
|
|
@@ -631,8 +683,8 @@ function v() {
|
|
|
631
683
|
className: "grid grid-cols-1 gap-3 @md:grid-cols-3",
|
|
632
684
|
children: [
|
|
633
685
|
/* @__PURE__ */ f("select", {
|
|
634
|
-
value:
|
|
635
|
-
onChange: (e) =>
|
|
686
|
+
value: L.provider,
|
|
687
|
+
onChange: (e) => R((t) => ({
|
|
636
688
|
...t,
|
|
637
689
|
provider: e.target.value
|
|
638
690
|
})),
|
|
@@ -657,60 +709,60 @@ function v() {
|
|
|
657
709
|
]
|
|
658
710
|
}),
|
|
659
711
|
/* @__PURE__ */ d("input", {
|
|
660
|
-
"aria-label":
|
|
661
|
-
value:
|
|
662
|
-
onChange: (e) =>
|
|
712
|
+
"aria-label": S("calendar.externalCalendarId", "External calendar ID"),
|
|
713
|
+
value: L.externalCalendarId,
|
|
714
|
+
onChange: (e) => R((t) => ({
|
|
663
715
|
...t,
|
|
664
716
|
externalCalendarId: e.target.value
|
|
665
717
|
})),
|
|
666
|
-
placeholder:
|
|
718
|
+
placeholder: S("calendar.externalCalendarId", "External calendar ID"),
|
|
667
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"
|
|
668
720
|
}),
|
|
669
721
|
/* @__PURE__ */ d("input", {
|
|
670
|
-
"aria-label":
|
|
671
|
-
value:
|
|
672
|
-
onChange: (e) =>
|
|
722
|
+
"aria-label": S("calendar.externalCalendarName", "External calendar name"),
|
|
723
|
+
value: L.externalCalendarName,
|
|
724
|
+
onChange: (e) => R((t) => ({
|
|
673
725
|
...t,
|
|
674
726
|
externalCalendarName: e.target.value
|
|
675
727
|
})),
|
|
676
|
-
placeholder:
|
|
728
|
+
placeholder: S("calendar.externalCalendarName", "External calendar name"),
|
|
677
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"
|
|
678
730
|
}),
|
|
679
731
|
/* @__PURE__ */ d("input", {
|
|
680
|
-
"aria-label":
|
|
681
|
-
value:
|
|
682
|
-
onChange: (e) =>
|
|
732
|
+
"aria-label": S("calendar.accessToken", "Access token"),
|
|
733
|
+
value: L.accessToken,
|
|
734
|
+
onChange: (e) => R((t) => ({
|
|
683
735
|
...t,
|
|
684
736
|
accessToken: e.target.value
|
|
685
737
|
})),
|
|
686
|
-
placeholder:
|
|
738
|
+
placeholder: S("calendar.accessToken", "Access token"),
|
|
687
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"
|
|
688
740
|
}),
|
|
689
741
|
/* @__PURE__ */ d("input", {
|
|
690
|
-
"aria-label":
|
|
691
|
-
value:
|
|
692
|
-
onChange: (e) =>
|
|
742
|
+
"aria-label": S("calendar.refreshToken", "Refresh token (optional)"),
|
|
743
|
+
value: L.refreshToken,
|
|
744
|
+
onChange: (e) => R((t) => ({
|
|
693
745
|
...t,
|
|
694
746
|
refreshToken: e.target.value
|
|
695
747
|
})),
|
|
696
|
-
placeholder:
|
|
748
|
+
placeholder: S("calendar.refreshToken", "Refresh token (optional)"),
|
|
697
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"
|
|
698
750
|
}),
|
|
699
751
|
/* @__PURE__ */ d("input", {
|
|
700
|
-
"aria-label":
|
|
752
|
+
"aria-label": S("calendar.syncFrequencyLabel", "Sync frequency in seconds"),
|
|
701
753
|
type: "number",
|
|
702
754
|
min: "60",
|
|
703
755
|
step: "60",
|
|
704
|
-
value:
|
|
705
|
-
onChange: (e) =>
|
|
756
|
+
value: L.syncFrequency,
|
|
757
|
+
onChange: (e) => R((t) => ({
|
|
706
758
|
...t,
|
|
707
759
|
syncFrequency: e.target.value
|
|
708
760
|
})),
|
|
709
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"
|
|
710
762
|
}),
|
|
711
763
|
/* @__PURE__ */ f("select", {
|
|
712
|
-
value:
|
|
713
|
-
onChange: (e) =>
|
|
764
|
+
value: L.direction,
|
|
765
|
+
onChange: (e) => R((t) => ({
|
|
714
766
|
...t,
|
|
715
767
|
direction: e.target.value
|
|
716
768
|
})),
|
|
@@ -718,28 +770,33 @@ function v() {
|
|
|
718
770
|
children: [
|
|
719
771
|
/* @__PURE__ */ d("option", {
|
|
720
772
|
value: "TWO_WAY",
|
|
721
|
-
children:
|
|
773
|
+
children: S("calendar.twoWaySync", "Two-way sync")
|
|
722
774
|
}),
|
|
723
775
|
/* @__PURE__ */ d("option", {
|
|
724
776
|
value: "ONE_WAY_TO_EXTERNAL",
|
|
725
|
-
children:
|
|
777
|
+
children: S("calendar.oneWayToExternal", "One-way to external")
|
|
726
778
|
}),
|
|
727
779
|
/* @__PURE__ */ d("option", {
|
|
728
780
|
value: "ONE_WAY_FROM_EXTERNAL",
|
|
729
|
-
children:
|
|
781
|
+
children: S("calendar.oneWayFromExternal", "One-way from external")
|
|
730
782
|
})
|
|
731
783
|
]
|
|
732
784
|
}),
|
|
733
785
|
/* @__PURE__ */ d("button", {
|
|
734
786
|
type: "submit",
|
|
735
|
-
disabled: !
|
|
787
|
+
disabled: !V || q,
|
|
736
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",
|
|
737
|
-
children:
|
|
789
|
+
children: q ? S("calendar.connecting", "Connecting...") : S("calendar.connectExternalCalendar", "Connect external calendar")
|
|
738
790
|
})
|
|
739
791
|
]
|
|
740
|
-
}), /* @__PURE__ */
|
|
792
|
+
}), /* @__PURE__ */ f("div", {
|
|
741
793
|
className: "space-y-3",
|
|
742
|
-
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", {
|
|
743
800
|
className: "rounded-radius-md border border-border-subtle bg-bg-canvas p-3 space-y-3",
|
|
744
801
|
children: [/* @__PURE__ */ f("div", { children: [
|
|
745
802
|
/* @__PURE__ */ f("p", {
|
|
@@ -756,15 +813,15 @@ function v() {
|
|
|
756
813
|
e.status,
|
|
757
814
|
" •",
|
|
758
815
|
" ",
|
|
759
|
-
|
|
816
|
+
S("calendar.everySeconds", "Every {value} seconds").replace("{value}", String(e.syncFrequency))
|
|
760
817
|
]
|
|
761
818
|
}),
|
|
762
819
|
/* @__PURE__ */ f("p", {
|
|
763
820
|
className: "font-text-xs text-text-tertiary",
|
|
764
821
|
children: [
|
|
765
|
-
|
|
822
|
+
S("calendar.lastSync", "Last sync"),
|
|
766
823
|
": ",
|
|
767
|
-
|
|
824
|
+
v(e.lastSyncAt),
|
|
768
825
|
" •",
|
|
769
826
|
" ",
|
|
770
827
|
e.lastSyncStatus ?? "—"
|
|
@@ -780,40 +837,40 @@ function v() {
|
|
|
780
837
|
/* @__PURE__ */ d("button", {
|
|
781
838
|
type: "button",
|
|
782
839
|
onClick: async () => {
|
|
783
|
-
await
|
|
840
|
+
await Qe({ variables: { syncId: e.id } }), await $();
|
|
784
841
|
},
|
|
785
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",
|
|
786
|
-
children:
|
|
843
|
+
children: S("calendar.triggerSync", "Trigger sync")
|
|
787
844
|
}),
|
|
788
845
|
/* @__PURE__ */ d("button", {
|
|
789
846
|
type: "button",
|
|
790
847
|
onClick: async () => {
|
|
791
|
-
e.syncEnabled ? await
|
|
848
|
+
e.syncEnabled ? await Xe({ variables: { syncId: e.id } }) : await Ze({ variables: { syncId: e.id } }), await $();
|
|
792
849
|
},
|
|
793
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",
|
|
794
|
-
children: e.syncEnabled ?
|
|
851
|
+
children: e.syncEnabled ? S("calendar.pauseSync", "Pause") : S("calendar.resumeSync", "Resume")
|
|
795
852
|
}),
|
|
796
853
|
/* @__PURE__ */ d("button", {
|
|
797
854
|
type: "button",
|
|
798
855
|
onClick: async () => {
|
|
799
|
-
await
|
|
856
|
+
await $e({ variables: { syncId: e.id } }), await $();
|
|
800
857
|
},
|
|
801
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",
|
|
802
|
-
children:
|
|
859
|
+
children: S("calendar.disconnect", "Disconnect")
|
|
803
860
|
})
|
|
804
861
|
]
|
|
805
862
|
})]
|
|
806
|
-
}, e.id))
|
|
863
|
+
}, e.id))]
|
|
807
864
|
})]
|
|
808
865
|
})
|
|
809
866
|
]
|
|
810
867
|
})]
|
|
811
|
-
}) : /* @__PURE__ */ d(
|
|
812
|
-
title:
|
|
813
|
-
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.")
|
|
814
871
|
});
|
|
815
872
|
}
|
|
816
873
|
//#endregion
|
|
817
|
-
export {
|
|
874
|
+
export { y as SettingsPage };
|
|
818
875
|
|
|
819
876
|
//# sourceMappingURL=SettingsPage.js.map
|