@calcom/atoms 1.7.1 → 1.8.0-booker

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.
Files changed (167) hide show
  1. package/dist/{AddressInput-DR3jIl7N.js → AddressInput-E1ARKDg7.js} +5 -5
  2. package/dist/{AlbyPriceComponent-2k8JXx0O.js → AlbyPriceComponent-jBcuDvZa.js} +24 -24
  3. package/dist/{PhoneInput-Nhiv23jS.js → PhoneInput-qXboae9k.js} +62 -62
  4. package/dist/cal-atoms.js +5 -36
  5. package/dist/index-GQl0OyJB.js +88695 -0
  6. package/dist/index-QBpbC_ZD.js +1957 -0
  7. package/dist/{index-QG3p1fzr.js → index-bGbS5CRI.js} +1 -1
  8. package/dist/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.d.ts.map +1 -1
  9. package/dist/packages/features/bookings/Booker/components/EventMeta.d.ts.map +1 -1
  10. package/dist/packages/features/bookings/Booker/components/Header.d.ts.map +1 -1
  11. package/dist/packages/features/bookings/Booker/components/OverlayCalendar/OverlayCalendar.d.ts.map +1 -1
  12. package/dist/packages/features/bookings/Booker/components/hooks/useBookings.d.ts +1 -1
  13. package/dist/packages/features/bookings/Booker/utils/event.d.ts +33 -33
  14. package/dist/packages/features/bookings/lib/BookingEmailSmsHandler.d.ts +1 -1
  15. package/dist/packages/features/bookings/lib/BookingEmailSmsHandler.d.ts.map +1 -1
  16. package/dist/packages/features/bookings/lib/create-booking.d.ts +91 -91
  17. package/dist/packages/features/bookings/lib/create-recurring-booking.d.ts +91 -91
  18. package/dist/packages/features/bookings/lib/get-booking.d.ts +9 -9
  19. package/dist/packages/features/bookings/lib/getBookingToDelete.d.ts +38 -38
  20. package/dist/packages/features/bookings/lib/getCalendarLinks.d.ts +41 -0
  21. package/dist/packages/features/bookings/lib/getCalendarLinks.d.ts.map +1 -0
  22. package/dist/packages/features/bookings/lib/getCalendarLinks.test.d.ts +2 -0
  23. package/dist/packages/features/bookings/lib/getCalendarLinks.test.d.ts.map +1 -0
  24. package/dist/packages/features/bookings/lib/handleInternalNote.d.ts +2 -2
  25. package/dist/packages/features/bookings/lib/handleNewBooking/createBooking.d.ts +33 -33
  26. package/dist/packages/features/bookings/lib/handleNewBooking/ensureAvailableUsers.d.ts +57 -57
  27. package/dist/packages/features/bookings/lib/handleNewBooking/getEventType.d.ts +57 -57
  28. package/dist/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.d.ts +57 -57
  29. package/dist/packages/features/bookings/lib/handleNewBooking/loadUsers.d.ts +46 -46
  30. package/dist/packages/features/bookings/lib/handleNewBooking/originalRescheduledBookingUtils.d.ts +45 -45
  31. package/dist/packages/features/bookings/lib/handleNewBooking.d.ts +364 -364
  32. package/dist/packages/features/bookings/lib/handleNewBooking.d.ts.map +1 -1
  33. package/dist/packages/features/bookings/lib/handlePayment.d.ts +49 -0
  34. package/dist/packages/features/bookings/lib/handlePayment.d.ts.map +1 -0
  35. package/dist/packages/features/bookings/lib/handleSeats/create/createNewSeat.d.ts +33 -33
  36. package/dist/packages/features/bookings/lib/handleSeats/create/createNewSeat.d.ts.map +1 -1
  37. package/dist/packages/features/bookings/lib/handleSeats/reschedule/owner/ownerRescheduleSeatedBooking.d.ts +33 -33
  38. package/dist/packages/features/bookings/lib/requiresConfirmation/getBookingRequest.d.ts +39 -39
  39. package/dist/packages/features/components/controlled-dialog/index.d.ts.map +1 -1
  40. package/dist/packages/features/components/phone-input/PhoneInput.d.ts.map +1 -1
  41. package/dist/packages/features/ee/billing/organizations/index.d.ts +1 -2
  42. package/dist/packages/features/ee/billing/organizations/index.d.ts.map +1 -1
  43. package/dist/packages/features/ee/billing/organizations/internal-organization-billing.d.ts +2 -2
  44. package/dist/packages/features/ee/billing/organizations/organization-billing.repository.d.ts +32 -4
  45. package/dist/packages/features/ee/billing/organizations/organization-billing.repository.d.ts.map +1 -1
  46. package/dist/packages/features/ee/payments/server/stripe-service.d.ts +23 -0
  47. package/dist/packages/features/ee/payments/server/stripe-service.d.ts.map +1 -0
  48. package/dist/packages/features/ee/round-robin/lib/bookingLocationService.d.ts +125 -0
  49. package/dist/packages/features/ee/round-robin/lib/bookingLocationService.d.ts.map +1 -0
  50. package/dist/packages/features/ee/round-robin/lib/bookingLocationService.test.d.ts +2 -0
  51. package/dist/packages/features/ee/round-robin/lib/bookingLocationService.test.d.ts.map +1 -0
  52. package/dist/packages/features/ee/round-robin/roundRobinManualReassignment.d.ts +30 -30
  53. package/dist/packages/features/ee/round-robin/roundRobinManualReassignment.d.ts.map +1 -1
  54. package/dist/packages/features/ee/round-robin/roundRobinReassignment.d.ts.map +1 -1
  55. package/dist/packages/features/ee/workflows/api/scheduleEmailReminders.d.ts.map +1 -1
  56. package/dist/packages/features/ee/workflows/lib/reminders/emailReminderManager.d.ts.map +1 -1
  57. package/dist/packages/features/ee/workflows/lib/repository/workflowReminder.d.ts +6 -6
  58. package/dist/packages/features/eventtypes/components/AddVerifiedEmail.d.ts +7 -0
  59. package/dist/packages/features/eventtypes/components/AddVerifiedEmail.d.ts.map +1 -0
  60. package/dist/packages/features/eventtypes/components/tabs/advanced/CustomEventTypeModal.d.ts +1 -1
  61. package/dist/packages/features/eventtypes/components/tabs/advanced/CustomEventTypeModal.d.ts.map +1 -1
  62. package/dist/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.d.ts.map +1 -1
  63. package/dist/packages/features/eventtypes/lib/eventNaming.d.ts +28 -0
  64. package/dist/packages/features/eventtypes/lib/eventNaming.d.ts.map +1 -0
  65. package/dist/packages/features/eventtypes/lib/eventNaming.test.d.ts +2 -0
  66. package/dist/packages/features/eventtypes/lib/eventNaming.test.d.ts.map +1 -0
  67. package/dist/packages/features/eventtypes/lib/getPublicEvent.d.ts +33 -33
  68. package/dist/packages/features/eventtypes/lib/getTeamEventType.d.ts +12 -12
  69. package/dist/packages/features/eventtypes/lib/types.d.ts +1 -1
  70. package/dist/packages/features/eventtypes/lib/types.d.ts.map +1 -1
  71. package/dist/packages/features/shell/user-dropdown/UserDropdown.d.ts +2 -2
  72. package/dist/packages/features/shell/user-dropdown/UserDropdown.d.ts.map +1 -1
  73. package/dist/packages/platform/atoms/event-types/hooks/useAddVerifiedEmail.d.ts +15 -0
  74. package/dist/packages/platform/atoms/event-types/hooks/useAddVerifiedEmail.d.ts.map +1 -0
  75. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypeById.d.ts +17 -17
  76. package/dist/packages/platform/atoms/event-types/hooks/useEventTypeForm.d.ts.map +1 -1
  77. package/dist/packages/platform/atoms/event-types/hooks/useGetVerifiedEmails.d.ts +3 -0
  78. package/dist/packages/platform/atoms/event-types/hooks/useGetVerifiedEmails.d.ts.map +1 -0
  79. package/dist/packages/platform/atoms/event-types/wrappers/EventAdvancedPlatformWrapper.d.ts.map +1 -1
  80. package/dist/packages/platform/atoms/hooks/bookings/useCreateBooking.d.ts +91 -91
  81. package/dist/packages/platform/atoms/hooks/bookings/useCreateInstantBooking.d.ts +91 -91
  82. package/dist/packages/platform/atoms/hooks/bookings/useCreateRecurringBooking.d.ts +91 -91
  83. package/dist/packages/platform/atoms/hooks/bookings/useGetBookingForReschedule.d.ts +3 -3
  84. package/dist/packages/platform/atoms/hooks/bookings/useHandleBookEvent.d.ts.map +1 -1
  85. package/dist/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.d.ts +33 -33
  86. package/dist/packages/platform/atoms/hooks/schedules/useAtomSchedule.d.ts +3 -3
  87. package/dist/packages/platform/atoms/hooks/schedules/useAtomUpdateSchedule.d.ts +3 -3
  88. package/dist/packages/platform/atoms/hooks/useConnectedCalendars.d.ts.map +1 -1
  89. package/dist/packages/platform/atoms/index.d.ts +0 -36
  90. package/dist/packages/platform/atoms/index.d.ts.map +1 -1
  91. package/dist/packages/platform/atoms/lib/appendClientIdToEmail.d.ts +2 -0
  92. package/dist/packages/platform/atoms/lib/appendClientIdToEmail.d.ts.map +1 -0
  93. package/dist/packages/platform/libraries/event-types.d.ts +5 -5
  94. package/dist/packages/platform/libraries/event-types.d.ts.map +1 -1
  95. package/dist/packages/platform/libraries/index.d.ts +3 -3
  96. package/dist/packages/platform/libraries/index.d.ts.map +1 -1
  97. package/dist/packages/prisma/zod/impersonations.d.ts +2 -2
  98. package/dist/packages/prisma/zod/ratelimit.d.ts +2 -2
  99. package/dist/packages/prisma/zod/task.d.ts +2 -2
  100. package/dist/packages/prisma/zod/teamfeatures.d.ts +2 -2
  101. package/dist/packages/prisma/zod/userfeatures.d.ts +2 -2
  102. package/dist/packages/prisma/zod/webhookscheduledtriggers.d.ts +2 -2
  103. package/dist/packages/prisma/zod-utils.d.ts +1 -0
  104. package/dist/packages/prisma/zod-utils.d.ts.map +1 -1
  105. package/dist/packages/trpc/react/hooks/useMeQuery.d.ts +2 -2
  106. package/dist/packages/trpc/react/shared.d.ts +1 -1
  107. package/dist/packages/trpc/react/shared.d.ts.map +1 -1
  108. package/dist/packages/trpc/react/trpc.d.ts.map +1 -1
  109. package/dist/style.css +1 -1
  110. package/package.json +1 -1
  111. package/dist/AppCard-bt7zv8gh.js +0 -281
  112. package/dist/AppListCardPlatformWrapper-VhYhJs_R.js +0 -9
  113. package/dist/AppListCardWebWrapper-NUv3j3xt.js +0 -74
  114. package/dist/AppSettingsInterface-buo7m9T8.js +0 -75
  115. package/dist/AppSettingsInterface-pSKkGg41.js +0 -23
  116. package/dist/AppSettingsInterface-zXTKl0m5.js +0 -29
  117. package/dist/DateRangePicker-bTMo0QHP.js +0 -74
  118. package/dist/EventTypeAppCardInterface-09iYOcZc.js +0 -39
  119. package/dist/EventTypeAppCardInterface-22oySUhU.js +0 -42
  120. package/dist/EventTypeAppCardInterface-4J2r0kDm.js +0 -34
  121. package/dist/EventTypeAppCardInterface-6ARDh1hB.js +0 -34
  122. package/dist/EventTypeAppCardInterface-6N-ocotc.js +0 -34
  123. package/dist/EventTypeAppCardInterface-ALjgH4W_.js +0 -34
  124. package/dist/EventTypeAppCardInterface-Ayfx5tRN.js +0 -39
  125. package/dist/EventTypeAppCardInterface-DcTMtSbr.js +0 -24
  126. package/dist/EventTypeAppCardInterface-DqaD8qmA.js +0 -34
  127. package/dist/EventTypeAppCardInterface-KjJnnhe2.js +0 -51
  128. package/dist/EventTypeAppCardInterface-SS33HaLT.js +0 -24
  129. package/dist/EventTypeAppCardInterface-TIEM8D8u.js +0 -41
  130. package/dist/EventTypeAppCardInterface-UIXAwi3z.js +0 -32
  131. package/dist/EventTypeAppCardInterface-UhZiYpC_.js +0 -858
  132. package/dist/EventTypeAppCardInterface-Uv0b0YwY.js +0 -34
  133. package/dist/EventTypeAppCardInterface-WvWtKyzR.js +0 -32
  134. package/dist/EventTypeAppCardInterface-ZTWUUx-j.js +0 -31
  135. package/dist/EventTypeAppCardInterface-Zce0NZR5.js +0 -33
  136. package/dist/EventTypeAppCardInterface-bj9lQhmN.js +0 -24
  137. package/dist/EventTypeAppCardInterface-cWLQDtAR.js +0 -86
  138. package/dist/EventTypeAppCardInterface-fwF9ZNE1.js +0 -42
  139. package/dist/EventTypeAppCardInterface-lLtnjlZW.js +0 -34
  140. package/dist/EventTypeAppCardInterface-oHgBXT0z.js +0 -24
  141. package/dist/EventTypeAppCardInterface-uSw2xD2a.js +0 -41
  142. package/dist/EventTypeAppCardInterface-uaT7p9un.js +0 -24
  143. package/dist/EventTypeAppCardInterface-vmdHhgZV.js +0 -51
  144. package/dist/EventTypeAppCardInterface-zkJKrgZb.js +0 -49
  145. package/dist/EventTypeAppSettingsInterface-108_BODL.js +0 -78
  146. package/dist/EventTypeAppSettingsInterface-Q0ZDtoUj.js +0 -25
  147. package/dist/EventTypeAppSettingsInterface-Qnr0HCO0.js +0 -43
  148. package/dist/EventTypeAppSettingsInterface-VeVCHNBB.js +0 -24
  149. package/dist/EventTypeAppSettingsInterface-_Yc814Cl.js +0 -221
  150. package/dist/EventTypeAppSettingsInterface-gg2Ef5DU.js +0 -48
  151. package/dist/EventTypeAppSettingsInterface-gkHBitj8.js +0 -106
  152. package/dist/EventTypeAppSettingsInterface-jJT8-1ML.js +0 -120
  153. package/dist/EventTypeAppSettingsInterface-lUvYXuGl.js +0 -72
  154. package/dist/EventTypeAppSettingsInterface-mfeygayG.js +0 -343
  155. package/dist/EventTypeAppSettingsInterface-siyUmyxC.js +0 -23
  156. package/dist/EventTypeAppSettingsInterface-u1frTGTk.js +0 -23
  157. package/dist/EventTypeAppSettingsInterface-ykuyZiXU.js +0 -42
  158. package/dist/InstallAppButton-JXhBVaYJ.js +0 -29
  159. package/dist/InstallAppButton-UL42QGKr.js +0 -14
  160. package/dist/InstallAppButton-c2chNE6g.js +0 -14
  161. package/dist/InstallAppButton-rvYPqvGJ.js +0 -58
  162. package/dist/StripePaymentForm-1yTkAicU.js +0 -493
  163. package/dist/currencyOptions-kannG2hu.js +0 -61
  164. package/dist/index-6aqrxRA8.js +0 -166397
  165. package/dist/index-heZJ0K97.js +0 -28
  166. package/dist/index-miF5qVsp.js +0 -518
  167. package/dist/useIsAppEnabled-aAe8QNQ3.js +0 -18
@@ -1,858 +0,0 @@
1
- import { jsxs as r, Fragment as E, jsx as e } from "react/jsx-runtime";
2
- import { w as ae, a1 as h, a2 as $, a3 as J, p, I as b, S as f, B as F, a4 as D, x as te, y as ce, a5 as m, W as se, L as q, a6 as re, J as de } from "./index-6aqrxRA8.js";
3
- import { useState as g } from "react";
4
- import { S as c, A as ue } from "./AppCard-bt7zv8gh.js";
5
- import { u as he } from "./useIsAppEnabled-aAe8QNQ3.js";
6
- var Q = /* @__PURE__ */ ((x) => (x.ON_BOOKING = "on_booking", x.ON_CANCEL = "on_cancel", x))(Q || {});
7
- const le = ({
8
- bookingAction: x,
9
- optionLabel: L,
10
- optionEnabled: W,
11
- optionSwitchOnChange: K,
12
- writeToObjectData: o,
13
- updateWriteToObjectData: s
14
- }) => {
15
- const { t: d } = ae(), O = [
16
- { label: d("text"), value: h.TEXT },
17
- { label: d("date"), value: h.DATE },
18
- { label: d("phone").charAt(0).toUpperCase() + d("phone").slice(1), value: h.PHONE },
19
- { label: d("checkbox"), value: h.CHECKBOX },
20
- { label: d("picklist"), value: h.PICKLIST },
21
- { label: d("custom"), value: h.CUSTOM }
22
- ], T = [
23
- { label: d("only_if_field_is_empty"), value: $.FIELD_EMPTY },
24
- ...x === "on_cancel" ? [{ label: d("salesforce_on_every_cancellation"), value: $.EVERY_BOOKING }] : [{ label: d("on_every_booking"), value: $.EVERY_BOOKING }]
25
- ], C = [
26
- { label: d("true"), value: !0 },
27
- { label: d("false"), value: !1 }
28
- ], k = [
29
- ...x === "on_cancel" ? [{ label: d("booking_cancel_date"), value: J.BOOKING_CANCEL_DATE }] : [],
30
- { label: d("booking_start_date"), value: J.BOOKING_START_DATE },
31
- { label: d("booking_created_date"), value: J.BOOKING_CREATED_DATE }
32
- ], [y, U] = g(O[0]), [I, G] = g(k[0]), [z, H] = g(
33
- C[0]
34
- ), [_, X] = g(T[0]), [A, j] = g({}), [R, S] = g(
35
- {}
36
- ), [u, N] = g({
37
- field: "",
38
- fieldType: y.value,
39
- value: "",
40
- whenToWrite: _.value
41
- }), M = (n) => {
42
- Object.keys(A).forEach((a) => {
43
- A[a] && a !== n && B(a);
44
- }), j((a) => ({ ...a, [n]: !0 })), S((a) => ({
45
- ...a,
46
- [n]: {
47
- field: n,
48
- fieldType: o[n].fieldType,
49
- value: o[n].value,
50
- whenToWrite: o[n].whenToWrite
51
- }
52
- }));
53
- }, B = (n) => {
54
- j((a) => ({ ...a, [n]: !1 })), S((a) => {
55
- const t = { ...a };
56
- return delete t[n], t;
57
- });
58
- }, P = (n) => {
59
- const a = R[n];
60
- if (!a)
61
- return;
62
- if (!a.field.trim()) {
63
- D("Field name cannot be empty", "error");
64
- return;
65
- }
66
- if (a.field !== n && Object.keys(o).includes(a.field.trim())) {
67
- D("Field already exists", "error");
68
- return;
69
- }
70
- const t = { ...o };
71
- a.field !== n && delete t[n], t[a.field.trim()] = {
72
- fieldType: a.fieldType,
73
- value: a.value,
74
- whenToWrite: a.whenToWrite
75
- }, s(t), B(n);
76
- };
77
- return /* @__PURE__ */ r(E, { children: [
78
- /* @__PURE__ */ e(c.SubSectionHeader, { icon: "star", labelFor: "write-to-object-settings", title: L, children: /* @__PURE__ */ e(
79
- p,
80
- {
81
- checked: W,
82
- onCheckedChange: K,
83
- id: "write-to-object-settings",
84
- size: "sm"
85
- }
86
- ) }),
87
- W ? /* @__PURE__ */ r(c.SubSectionContent, { children: [
88
- /* @__PURE__ */ r("div", { className: "text-subtle flex gap-3 px-3 py-[6px] text-sm font-medium", children: [
89
- /* @__PURE__ */ e("div", { className: "flex-1", children: d("field_name") }),
90
- /* @__PURE__ */ e("div", { className: "flex-1", children: d("field_type") }),
91
- /* @__PURE__ */ e("div", { className: "flex-1", children: d("value") }),
92
- /* @__PURE__ */ e("div", { className: "flex-1", children: d("when_to_write") }),
93
- /* @__PURE__ */ e("div", { className: "w-20" })
94
- ] }),
95
- /* @__PURE__ */ r(c.SubSectionNested, { children: [
96
- Object.keys(o).map((n) => {
97
- const a = A[n], t = R[n];
98
- return /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
99
- /* @__PURE__ */ e("div", { className: "flex-1", children: a ? /* @__PURE__ */ e(
100
- b,
101
- {
102
- value: (t == null ? void 0 : t.field) || n,
103
- onChange: (i) => S((v) => ({
104
- ...v,
105
- [n]: { ...t, field: i.target.value }
106
- })),
107
- size: "sm",
108
- className: "w-full"
109
- }
110
- ) : /* @__PURE__ */ e(b, { value: n, readOnly: !0, size: "sm", className: "w-full" }) }),
111
- /* @__PURE__ */ e("div", { className: "flex-1", children: a ? /* @__PURE__ */ e(
112
- f,
113
- {
114
- size: "sm",
115
- className: "w-full",
116
- options: O,
117
- value: O.find((i) => i.value === (t == null ? void 0 : t.fieldType)),
118
- onChange: (i) => {
119
- i && S((v) => ({
120
- ...v,
121
- [n]: {
122
- ...t,
123
- fieldType: i.value,
124
- ...i.value === h.DATE && {
125
- value: k[0].value
126
- },
127
- ...i.value === h.CHECKBOX && {
128
- value: C[0].value
129
- }
130
- }
131
- }));
132
- }
133
- }
134
- ) : /* @__PURE__ */ e(
135
- f,
136
- {
137
- size: "sm",
138
- className: "w-full",
139
- value: O.find(
140
- (i) => i.value === o[n].fieldType
141
- ),
142
- isDisabled: !0
143
- }
144
- ) }),
145
- /* @__PURE__ */ e("div", { className: "flex-1", children: a ? (t == null ? void 0 : t.fieldType) === h.DATE ? /* @__PURE__ */ e(
146
- f,
147
- {
148
- size: "sm",
149
- className: "w-full",
150
- options: k,
151
- value: k.find((i) => i.value === t.value),
152
- onChange: (i) => {
153
- i && S((v) => ({
154
- ...v,
155
- [n]: { ...t, value: i.value }
156
- }));
157
- }
158
- }
159
- ) : (t == null ? void 0 : t.fieldType) === h.CHECKBOX ? /* @__PURE__ */ e(
160
- f,
161
- {
162
- size: "sm",
163
- className: "w-full",
164
- options: C,
165
- value: C.find((i) => i.value === t.value),
166
- onChange: (i) => {
167
- i && S((v) => ({
168
- ...v,
169
- [n]: { ...t, value: i.value }
170
- }));
171
- }
172
- }
173
- ) : /* @__PURE__ */ e(
174
- b,
175
- {
176
- value: (t == null ? void 0 : t.value) || "",
177
- onChange: (i) => S((v) => ({
178
- ...v,
179
- [n]: { ...t, value: i.target.value }
180
- })),
181
- size: "sm",
182
- className: "w-full"
183
- }
184
- ) : o[n].fieldType === h.DATE ? /* @__PURE__ */ e(
185
- f,
186
- {
187
- size: "sm",
188
- className: "w-full",
189
- value: k.find(
190
- (i) => i.value === o[n].value
191
- ),
192
- isDisabled: !0
193
- }
194
- ) : o[n].fieldType === h.CHECKBOX ? /* @__PURE__ */ e(
195
- f,
196
- {
197
- size: "sm",
198
- className: "w-full",
199
- value: C.find(
200
- (i) => i.value === o[n].value
201
- ),
202
- isDisabled: !0
203
- }
204
- ) : /* @__PURE__ */ e(
205
- b,
206
- {
207
- value: o[n].value,
208
- readOnly: !0,
209
- size: "sm",
210
- className: "w-full"
211
- }
212
- ) }),
213
- /* @__PURE__ */ e("div", { className: "flex-1", children: a ? /* @__PURE__ */ e(
214
- f,
215
- {
216
- size: "sm",
217
- className: "w-full",
218
- options: T,
219
- value: T.find(
220
- (i) => i.value === (t == null ? void 0 : t.whenToWrite)
221
- ),
222
- onChange: (i) => {
223
- i && S((v) => ({
224
- ...v,
225
- [n]: { ...t, whenToWrite: i.value }
226
- }));
227
- }
228
- }
229
- ) : /* @__PURE__ */ e(
230
- f,
231
- {
232
- size: "sm",
233
- className: "w-full",
234
- value: T.find(
235
- (i) => i.value === o[n].whenToWrite
236
- ),
237
- isDisabled: !0
238
- }
239
- ) }),
240
- /* @__PURE__ */ e("div", { className: "flex w-20 justify-center gap-1", children: a ? /* @__PURE__ */ r(E, { children: [
241
- /* @__PURE__ */ e(
242
- F,
243
- {
244
- size: "sm",
245
- StartIcon: "check",
246
- variant: "icon",
247
- color: "primary",
248
- onClick: () => P(n)
249
- }
250
- ),
251
- /* @__PURE__ */ e(
252
- F,
253
- {
254
- size: "sm",
255
- StartIcon: "x",
256
- variant: "icon",
257
- color: "secondary",
258
- onClick: () => B(n)
259
- }
260
- )
261
- ] }) : /* @__PURE__ */ r(E, { children: [
262
- /* @__PURE__ */ e(
263
- F,
264
- {
265
- size: "sm",
266
- StartIcon: "pencil",
267
- variant: "icon",
268
- color: "minimal",
269
- onClick: () => M(n)
270
- }
271
- ),
272
- /* @__PURE__ */ e(
273
- F,
274
- {
275
- size: "sm",
276
- StartIcon: "x",
277
- variant: "icon",
278
- color: "minimal",
279
- onClick: () => {
280
- const i = { ...o };
281
- delete i[n], s(i);
282
- }
283
- }
284
- )
285
- ] }) })
286
- ] }, n);
287
- }),
288
- /* @__PURE__ */ r("div", { className: "flex gap-2", children: [
289
- /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
290
- b,
291
- {
292
- size: "sm",
293
- className: "w-full",
294
- value: u.field,
295
- onChange: (n) => N({
296
- ...u,
297
- field: n.target.value
298
- })
299
- }
300
- ) }),
301
- /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
302
- f,
303
- {
304
- size: "sm",
305
- className: "w-full",
306
- options: O,
307
- value: y,
308
- onChange: (n) => {
309
- n && (U(n), N({
310
- ...u,
311
- fieldType: n.value,
312
- ...n.value === h.DATE && { value: I.value },
313
- ...n.value === h.CHECKBOX && {
314
- value: z.value
315
- }
316
- }));
317
- }
318
- }
319
- ) }),
320
- /* @__PURE__ */ e("div", { className: "flex-1", children: u.fieldType === h.DATE ? /* @__PURE__ */ e(
321
- f,
322
- {
323
- size: "sm",
324
- className: "w-full",
325
- options: k,
326
- value: I,
327
- onChange: (n) => {
328
- n && (G(n), N({
329
- ...u,
330
- value: n.value
331
- }));
332
- }
333
- }
334
- ) : u.fieldType === h.CHECKBOX ? /* @__PURE__ */ e(
335
- f,
336
- {
337
- size: "sm",
338
- className: "w-full",
339
- options: C,
340
- value: z,
341
- onChange: (n) => {
342
- n && (H(n), N({
343
- ...u,
344
- value: n.value
345
- }));
346
- }
347
- }
348
- ) : /* @__PURE__ */ e(
349
- b,
350
- {
351
- size: "sm",
352
- className: "w-full",
353
- value: u.value,
354
- onChange: (n) => N({
355
- ...u,
356
- value: n.target.value
357
- })
358
- }
359
- ) }),
360
- /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
361
- f,
362
- {
363
- size: "sm",
364
- className: "w-full",
365
- options: T,
366
- value: _,
367
- onChange: (n) => {
368
- n && (X(n), N({
369
- ...u,
370
- whenToWrite: n.value
371
- }));
372
- }
373
- }
374
- ) }),
375
- /* @__PURE__ */ e("div", { className: "w-20" })
376
- ] })
377
- ] }),
378
- /* @__PURE__ */ e(
379
- F,
380
- {
381
- className: "text-subtle mt-2 w-fit",
382
- StartIcon: "plus",
383
- color: "minimal",
384
- size: "sm",
385
- disabled: !(u.field && u.fieldType && u.value !== "" && u.whenToWrite),
386
- onClick: () => {
387
- if (Object.keys(o).includes(u.field.trim())) {
388
- D("Field already exists", "error");
389
- return;
390
- }
391
- s({
392
- ...o,
393
- [u.field.trim()]: {
394
- fieldType: u.fieldType,
395
- value: u.value,
396
- whenToWrite: u.whenToWrite
397
- }
398
- }), N({
399
- field: "",
400
- fieldType: O[0].value,
401
- value: "",
402
- whenToWrite: T[0].value
403
- });
404
- },
405
- children: d("add_new_field")
406
- }
407
- )
408
- ] }) : null
409
- ] });
410
- }, Ce = function({ app: L, eventType: W }) {
411
- var ne;
412
- const K = te.usePathname(), { getAppData: o, setAppData: s, disabled: d } = ce(), { enabled: O, updateEnabled: T } = he(L), C = o("roundRobinLeadSkip"), k = o("roundRobinSkipCheckRecordOn") ?? m.CONTACT, y = o("ifFreeEmailDomainSkipOwnerCheck") ?? !1, U = o("skipContactCreation"), I = o("createLeadIfAccountNull"), G = o("createNewContactUnderAccount"), z = o("createEventOn") ?? m.CONTACT, H = o("onBookingWriteToEventObject") ?? !1, _ = o("onBookingWriteToEventObjectMap") ?? {}, X = o("createEventOnLeadCheckForContact") ?? !1, A = o("onBookingChangeRecordOwner") ?? !1, j = o("onBookingChangeRecordOwnerName") ?? [], R = o("sendNoShowAttendeeData") ?? !1, S = o("sendNoShowAttendeeDataField") ?? "", u = o("onBookingWriteToRecord") ?? !1, N = o("onBookingWriteToRecordFields") ?? {}, M = o("ignoreGuests") ?? !1, B = o("roundRobinSkipFallbackToLeadOwner") ?? !1, P = o("onCancelWriteToEventRecord") ?? !1, n = o("onCancelWriteToEventRecordFields") ?? {}, { t: a } = ae(), t = [
413
- { label: a("contact"), value: m.CONTACT },
414
- { label: a("salesforce_lead"), value: m.LEAD },
415
- { label: a("salesforce_contact_under_account"), value: m.ACCOUNT }
416
- ], [i, v] = g(
417
- t.find((l) => l.value === z) ?? t[0]
418
- ), V = [
419
- { label: a("contact"), value: m.CONTACT },
420
- { label: a("salesforce_lead"), value: m.LEAD },
421
- { label: a("account"), value: m.ACCOUNT }
422
- ], [Z, ie] = g(
423
- V.find((l) => l.value === k) ?? V[0]
424
- ), [w, Y] = g({
425
- field: "",
426
- value: ""
427
- }), ee = () => /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
428
- c.SubSectionHeader,
429
- {
430
- icon: "at-sign",
431
- title: a("salesforce_create_new_contact_under_account"),
432
- labelFor: "create-new-contact-under-account",
433
- children: /* @__PURE__ */ e(
434
- p,
435
- {
436
- size: "sm",
437
- labelOnLeading: !0,
438
- checked: G,
439
- onCheckedChange: (l) => {
440
- s("createNewContactUnderAccount", l);
441
- }
442
- }
443
- )
444
- }
445
- ) });
446
- return /* @__PURE__ */ e(
447
- ue,
448
- {
449
- returnTo: `${se}${K}?tabName=apps`,
450
- app: L,
451
- teamId: ((ne = W.team) == null ? void 0 : ne.id) || void 0,
452
- switchOnClick: (l) => {
453
- T(l);
454
- },
455
- switchChecked: O,
456
- hideSettingsIcon: !0,
457
- children: /* @__PURE__ */ r(c.Content, { children: [
458
- /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
459
- c.SubSectionHeader,
460
- {
461
- icon: "zap",
462
- title: a("salesforce_add_attendees_as"),
463
- justify: "start",
464
- labelFor: "add-attendees-as",
465
- children: /* @__PURE__ */ e(
466
- f,
467
- {
468
- size: "sm",
469
- id: "add-attendees-as",
470
- className: "w-[200px]",
471
- options: t,
472
- value: i,
473
- onChange: (l) => {
474
- l && (v(l), s("createEventOn", l.value));
475
- }
476
- }
477
- )
478
- }
479
- ) }),
480
- /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
481
- c.SubSectionHeader,
482
- {
483
- icon: "user-plus",
484
- title: a("salesforce_ignore_guests"),
485
- labelFor: "ignore-guests",
486
- children: /* @__PURE__ */ e(
487
- p,
488
- {
489
- size: "sm",
490
- labelOnLeading: !0,
491
- checked: M,
492
- onCheckedChange: (l) => {
493
- s("ignoreGuests", l);
494
- }
495
- }
496
- )
497
- }
498
- ) }),
499
- i.value === m.CONTACT ? /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
500
- c.SubSectionHeader,
501
- {
502
- icon: "user-plus",
503
- title: a("skip_contact_creation", { appName: "Salesforce" }),
504
- labelFor: "skip-contact-creation",
505
- children: /* @__PURE__ */ e(
506
- p,
507
- {
508
- size: "sm",
509
- labelOnLeading: !0,
510
- checked: U,
511
- onCheckedChange: (l) => {
512
- s("skipContactCreation", l);
513
- }
514
- }
515
- )
516
- }
517
- ) }) : null,
518
- i.value === m.LEAD ? /* @__PURE__ */ r(E, { children: [
519
- /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
520
- c.SubSectionHeader,
521
- {
522
- icon: "user-plus",
523
- title: a("salesforce_create_event_on_contact"),
524
- labelFor: "create-event-on-contact",
525
- children: /* @__PURE__ */ e(
526
- p,
527
- {
528
- size: "sm",
529
- labelOnLeading: !0,
530
- checked: X,
531
- onCheckedChange: (l) => {
532
- s("createEventOnLeadCheckForContact", l);
533
- }
534
- }
535
- )
536
- }
537
- ) }),
538
- /* @__PURE__ */ e(ee, {})
539
- ] }) : null,
540
- i.value === m.ACCOUNT ? /* @__PURE__ */ r(E, { children: [
541
- /* @__PURE__ */ e(ee, {}),
542
- /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
543
- c.SubSectionHeader,
544
- {
545
- icon: "user-plus",
546
- title: a("salesforce_if_account_does_not_exist"),
547
- labelFor: "create-lead-if-account-null",
548
- children: /* @__PURE__ */ e(
549
- p,
550
- {
551
- size: "sm",
552
- labelOnLeading: !0,
553
- checked: I,
554
- onCheckedChange: (l) => {
555
- s("createLeadIfAccountNull", l);
556
- }
557
- }
558
- )
559
- }
560
- ) })
561
- ] }) : null,
562
- /* @__PURE__ */ r(c.SubSection, { children: [
563
- /* @__PURE__ */ e(c.SubSectionHeader, { icon: "badge-check", title: a("on_booking_write_to_event_object"), children: /* @__PURE__ */ e(
564
- p,
565
- {
566
- size: "sm",
567
- labelOnLeading: !0,
568
- checked: H,
569
- onCheckedChange: (l) => {
570
- s("onBookingWriteToEventObject", l);
571
- }
572
- }
573
- ) }),
574
- H ? /* @__PURE__ */ r(c.SubSectionContent, { children: [
575
- /* @__PURE__ */ r("div", { className: "text-subtle flex gap-3 px-3 py-[6px] text-sm font-medium", children: [
576
- /* @__PURE__ */ e("div", { className: "flex-1", children: a("field_name") }),
577
- /* @__PURE__ */ e("div", { className: "flex-1", children: a("value") }),
578
- /* @__PURE__ */ e("div", { className: "w-10" })
579
- ] }),
580
- /* @__PURE__ */ r(c.SubSectionNested, { children: [
581
- Object.keys(_).map((l) => /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
582
- /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(b, { value: l, readOnly: !0, size: "sm", className: "w-full" }) }),
583
- /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
584
- b,
585
- {
586
- value: _[l],
587
- readOnly: !0,
588
- size: "sm",
589
- className: "w-full"
590
- }
591
- ) }),
592
- /* @__PURE__ */ e("div", { className: "flex w-10 justify-center", children: /* @__PURE__ */ e(
593
- F,
594
- {
595
- StartIcon: "x",
596
- variant: "icon",
597
- size: "sm",
598
- color: "minimal",
599
- onClick: () => {
600
- const oe = _;
601
- delete _[l], s("onBookingWriteToEventObjectMap", oe);
602
- }
603
- }
604
- ) })
605
- ] }, l)),
606
- /* @__PURE__ */ r("div", { className: "mt-2 flex gap-4", children: [
607
- /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
608
- b,
609
- {
610
- size: "sm",
611
- className: "w-full",
612
- value: w.field,
613
- onChange: (l) => Y({
614
- ...w,
615
- field: l.target.value
616
- })
617
- }
618
- ) }),
619
- /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
620
- b,
621
- {
622
- size: "sm",
623
- className: "w-full",
624
- value: w.value,
625
- onChange: (l) => Y({
626
- ...w,
627
- value: l.target.value
628
- })
629
- }
630
- ) }),
631
- /* @__PURE__ */ e("div", { className: "w-10" })
632
- ] })
633
- ] }),
634
- /* @__PURE__ */ e(
635
- F,
636
- {
637
- className: "text-subtle mt-2 w-fit",
638
- size: "sm",
639
- color: "secondary",
640
- disabled: !(w.field && w.value),
641
- onClick: () => {
642
- if (Object.keys(_).includes(
643
- w.field.trim()
644
- )) {
645
- D("Field already exists", "error");
646
- return;
647
- }
648
- s("onBookingWriteToEventObjectMap", {
649
- ..._,
650
- [w.field.trim()]: w.value.trim()
651
- }), Y({ field: "", value: "" });
652
- },
653
- children: a("add_new_field")
654
- }
655
- )
656
- ] }) : null
657
- ] }),
658
- /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
659
- le,
660
- {
661
- bookingAction: Q.ON_BOOKING,
662
- optionLabel: a("salesforce_on_booking_write_to_record", { record: z }),
663
- optionEnabled: u,
664
- writeToObjectData: N,
665
- optionSwitchOnChange: (l) => {
666
- s("onBookingWriteToRecord", l);
667
- },
668
- updateWriteToObjectData: (l) => s("onBookingWriteToRecordFields", l)
669
- }
670
- ) }),
671
- /* @__PURE__ */ r(c.SubSection, { children: [
672
- /* @__PURE__ */ e(
673
- c.SubSectionHeader,
674
- {
675
- icon: "user-plus",
676
- title: a("salesforce_change_record_owner_on_booking"),
677
- labelFor: "change-record-owner-on-booking",
678
- children: /* @__PURE__ */ e(
679
- p,
680
- {
681
- size: "sm",
682
- labelOnLeading: !0,
683
- checked: A,
684
- onCheckedChange: (l) => {
685
- s("onBookingChangeRecordOwner", l);
686
- }
687
- }
688
- )
689
- }
690
- ),
691
- A ? /* @__PURE__ */ e(c.SubSectionContent, { classNames: { container: "p-3" }, children: /* @__PURE__ */ r("div", { children: [
692
- /* @__PURE__ */ e(
693
- q,
694
- {
695
- htmlFor: "on-booking-change-record-owner-name",
696
- className: "text-subtle text-sm font-medium",
697
- children: a("salesforce_owner_name_to_change")
698
- }
699
- ),
700
- /* @__PURE__ */ e(
701
- b,
702
- {
703
- id: "on-booking-change-record-owner-name",
704
- size: "sm",
705
- value: j,
706
- onChange: (l) => s("onBookingChangeRecordOwnerName", l.target.value)
707
- }
708
- )
709
- ] }) }) : null
710
- ] }),
711
- W.schedulingType === re.ROUND_ROBIN ? /* @__PURE__ */ r(E, { children: [
712
- /* @__PURE__ */ r(c.SubSection, { children: [
713
- /* @__PURE__ */ e(
714
- c.SubSectionHeader,
715
- {
716
- icon: "users",
717
- title: a("salesforce_book_directly_with_attendee_owner"),
718
- labelFor: "book-directly-with-attendee-owner",
719
- children: /* @__PURE__ */ e(
720
- p,
721
- {
722
- size: "sm",
723
- id: "book-directly-witha-attendee-owner",
724
- checked: C,
725
- onCheckedChange: (l) => {
726
- s("roundRobinLeadSkip", l), l && s("enabled", l);
727
- }
728
- }
729
- )
730
- }
731
- ),
732
- C ? /* @__PURE__ */ e(c.SubSectionContent, { classNames: { container: "p-3" }, children: /* @__PURE__ */ r("div", { children: [
733
- /* @__PURE__ */ e(
734
- q,
735
- {
736
- htmlFor: "round-robin-skip-check-record-on",
737
- className: "text-subtle text-sm font-medium",
738
- children: a("salesforce_check_owner_of")
739
- }
740
- ),
741
- /* @__PURE__ */ e(
742
- f,
743
- {
744
- size: "sm",
745
- className: "w-60",
746
- options: V,
747
- value: Z,
748
- onChange: (l) => {
749
- l && (ie(l), s("roundRobinSkipCheckRecordOn", l.value));
750
- }
751
- }
752
- )
753
- ] }) }) : null
754
- ] }),
755
- /* @__PURE__ */ e(E, { children: C ? /* @__PURE__ */ r(E, { children: [
756
- Z.value === m.CONTACT ? /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
757
- c.SubSectionHeader,
758
- {
759
- icon: "users",
760
- title: a("salesforce_round_robin_skip_fallback_to_lead_owner"),
761
- labelFor: "round-robin-skip-fallback-to-lead-owner",
762
- children: /* @__PURE__ */ e(
763
- p,
764
- {
765
- id: "round-robin-skip-fallback-to-lead-owner",
766
- size: "sm",
767
- checked: B,
768
- onCheckedChange: (l) => {
769
- s("roundRobinSkipFallbackToLeadOwner", l);
770
- }
771
- }
772
- )
773
- }
774
- ) }) : null,
775
- /* @__PURE__ */ r(c.SubSection, { children: [
776
- /* @__PURE__ */ e(
777
- c.SubSectionHeader,
778
- {
779
- icon: "users",
780
- title: a("salesforce_if_free_email_domain_skip_owner_check"),
781
- labelFor: "if-free-email-domain-skip-owner-check",
782
- children: /* @__PURE__ */ e(
783
- p,
784
- {
785
- id: "if-free-email-domain-skip-owner-check",
786
- size: "sm",
787
- checked: y,
788
- onCheckedChange: (l) => {
789
- s("ifFreeEmailDomainSkipOwnerCheck", l);
790
- }
791
- }
792
- )
793
- }
794
- ),
795
- /* @__PURE__ */ e(de, { severity: "info", title: a("skip_rr_description") })
796
- ] })
797
- ] }) : null })
798
- ] }) : null,
799
- /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
800
- le,
801
- {
802
- bookingAction: Q.ON_CANCEL,
803
- optionLabel: a("salesforce_on_cancel_write_to_event"),
804
- optionEnabled: P,
805
- writeToObjectData: n,
806
- optionSwitchOnChange: (l) => {
807
- s("onCancelWriteToEventRecord", l);
808
- },
809
- updateWriteToObjectData: (l) => s("onCancelWriteToEventRecordFields", l)
810
- }
811
- ) }),
812
- /* @__PURE__ */ r(c.SubSection, { children: [
813
- /* @__PURE__ */ e(
814
- c.SubSectionHeader,
815
- {
816
- icon: "calendar",
817
- title: "Send no show attendee data to event object",
818
- labelFor: "send-no-show-attendee-data",
819
- children: /* @__PURE__ */ e(
820
- p,
821
- {
822
- id: "send-no-show-attendee-data",
823
- size: "sm",
824
- checked: R,
825
- onCheckedChange: (l) => {
826
- s("sendNoShowAttendeeData", l);
827
- }
828
- }
829
- )
830
- }
831
- ),
832
- R ? /* @__PURE__ */ r(c.SubSectionContent, { classNames: { container: "p-3" }, children: [
833
- /* @__PURE__ */ e(
834
- q,
835
- {
836
- htmlFor: "send-no-show-attendee-data-field-name",
837
- className: "text-subtle text-sm font-medium",
838
- children: "Field name to check (must be checkbox data type)"
839
- }
840
- ),
841
- /* @__PURE__ */ e(
842
- b,
843
- {
844
- id: "send-no-show-attendee-data-field-name",
845
- size: "sm",
846
- value: S,
847
- onChange: (l) => s("sendNoShowAttendeeDataField", l.target.value)
848
- }
849
- )
850
- ] }) : null
851
- ] })
852
- ] })
853
- }
854
- );
855
- };
856
- export {
857
- Ce as default
858
- };