@wix/form-elements 1.104.0 → 1.105.0

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 (109) hide show
  1. package/dist/component/appointment-rac-DaBg4fM3.js +1011 -0
  2. package/dist/component/{bookings-address-rac-bOPrbrFn.js → bookings-address-rac-CkCIr0yY.js} +1 -1
  3. package/dist/component/{bookings-email-rac-DSpy4yfX.js → bookings-email-rac--o2G6bDi.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-Dw0U4kHG.js → bookings-first-name-rac-KilnnzGd.js} +1 -1
  5. package/dist/component/{bookings-header-rac-Czrqn8yy.js → bookings-header-rac-D9PwyQVM.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-CVxRqG5b.js → bookings-last-name-rac-qWHHoFsL.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-s_2BlBcX.js → bookings-login-bar-rac-CA9lwDip.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-B2SgZsIb.js → bookings-phone-rac-CJwbY3yf.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-b3K__6c9.js → bookings-rich-text-rac-B-7cedEB.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-Gt2JioDC.js → checkbox-field-rac-D5YjimAI.js} +6 -6
  11. package/dist/component/{checkbox-group-field-headless-cKefepGi.js → checkbox-group-field-headless-BJl8C2Lz.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-B14obB-6.js → checkbox-group-field-rac-CLDKYOsh.js} +5 -5
  13. package/dist/component/{checkbox-group-rac-B6cixM2X.js → checkbox-group-rac-DfOsQWr7.js} +1 -1
  14. package/dist/component/{checkbox-indicator-module-classes-DhbNznSB.js → checkbox-indicator-module-classes-BpeSpGsW.js} +1 -1
  15. package/dist/component/{checkbox-rac-COwblKlm.js → checkbox-rac-DMDIZxxN.js} +1 -1
  16. package/dist/component/{contacts-address-rac-BJrwGPo4.js → contacts-address-rac-CrpSPX3x.js} +1 -1
  17. package/dist/component/{contacts-birthdate-rac-BaotTtEN.js → contacts-birthdate-rac-B3vrz3B5.js} +1 -1
  18. package/dist/component/{contacts-company-rac-BjTc-e_S.js → contacts-company-rac-Nd4-07pv.js} +1 -1
  19. package/dist/component/{contacts-email-rac-DVFF485m.js → contacts-email-rac-DlKJXGue.js} +1 -1
  20. package/dist/component/{contacts-first-name-rac-C4Fht3FS.js → contacts-first-name-rac-CgfaCG0O.js} +1 -1
  21. package/dist/component/{contacts-last-name-rac-BTbOJedX.js → contacts-last-name-rac-DmSqTPzC.js} +1 -1
  22. package/dist/component/{contacts-phone-rac-GePv5BT7.js → contacts-phone-rac-C9X_5axq.js} +1 -1
  23. package/dist/component/{contacts-position-rac-BZ1ASqF_.js → contacts-position-rac-DeJrqxtm.js} +1 -1
  24. package/dist/component/{contacts-subscribe-rac-CmyBcsLP.js → contacts-subscribe-rac-Dv-QNZZc.js} +1 -1
  25. package/dist/component/{contacts-tax-id-rac-A2tdbIvB.js → contacts-tax-id-rac-6pMwtJyC.js} +1 -1
  26. package/dist/component/{date-availability-b1h4CrSQ.js → date-availability-DfL_xDci.js} +1 -1
  27. package/dist/component/{date-input-field-rac-moOjGzUv.js → date-input-field-rac-DvlY0Ffu.js} +7 -7
  28. package/dist/component/{date-input-rac-DTqZCOqB.js → date-input-rac-Dr_MtbFO.js} +1 -1
  29. package/dist/component/{date-picker-field-rac-flB4Hw18.js → date-picker-field-rac-D42hJF0j.js} +56 -56
  30. package/dist/component/{date-picker-rac-B2fqOP6H.js → date-picker-rac-CtoqWMPa.js} +1 -1
  31. package/dist/component/{date-time-input-field-rac-BtLGRGf5.js → date-time-input-field-rac-C1rf0_aD.js} +7 -7
  32. package/dist/component/{date-time-input-rac-CRfUmOim.js → date-time-input-rac-gFwBZVcJ.js} +1 -1
  33. package/dist/component/{dext-checkbox-group-rac-Ds4t475J.js → dext-checkbox-group-rac-B0dh55yz.js} +2 -2
  34. package/dist/component/{dext-checkbox-rac-BC6EGH5R.js → dext-checkbox-rac-RQ7hpkFn.js} +1 -1
  35. package/dist/component/{dext-date-picker-rac-DyydPJyC.js → dext-date-picker-rac-sJEfD5E6.js} +1 -1
  36. package/dist/component/{dext-date-time-input-rac-DhssYv6t.js → dext-date-time-input-rac-BxPE1oVN.js} +1 -1
  37. package/dist/component/{dext-dropdown-rac-Bn0C1Ry8.js → dext-dropdown-rac-BimIan_Z.js} +1 -1
  38. package/dist/component/{dext-email-rac-DKhk_v_w.js → dext-email-rac-CjrC85Va.js} +1 -1
  39. package/dist/component/{dext-number-input-rac-u92WD8VD.js → dext-number-input-rac-CkMRmcJQ.js} +1 -1
  40. package/dist/component/{dext-phone-rac-DTzdQAe9.js → dext-phone-rac-DO3qV3WL.js} +1 -1
  41. package/dist/component/{dext-radio-group-rac-CoOYhInI.js → dext-radio-group-rac-CUaqRQSf.js} +2 -2
  42. package/dist/component/{dext-rating-input-rac-DPdyJsCZ.js → dext-rating-input-rac-CIRU2af7.js} +1 -1
  43. package/dist/component/{dext-tags-rac-Bh3pQ-Ck.js → dext-tags-rac-DHqXtqOo.js} +2 -2
  44. package/dist/component/{dext-text-area-rac-Cefsz8ct.js → dext-text-area-rac-yBONPzSt.js} +1 -1
  45. package/dist/component/{dext-text-input-rac-Bj_pAChP.js → dext-text-input-rac-CdhAUC2i.js} +1 -1
  46. package/dist/component/{dext-url-input-rac-Bk_kwZzM.js → dext-url-input-rac-B4IQEsp2.js} +1 -1
  47. package/dist/component/{donation-rac-wRWkCjYg.js → donation-rac-D-rWK7OY.js} +6 -6
  48. package/dist/component/{dropdown-field-headless-CedOXKAH.js → dropdown-field-headless-CeDAK-PU.js} +4 -4
  49. package/dist/component/{dropdown-field-rac-CENh9Khw.js → dropdown-field-rac-BzqUmKJ1.js} +3 -3
  50. package/dist/component/{dropdown-rac-CeCNULzS.js → dropdown-rac-CHO-8WoH.js} +1 -1
  51. package/dist/component/{ecom-address-rac-BLJ0UHrV.js → ecom-address-rac-BZVqOncl.js} +1 -1
  52. package/dist/component/{ecom-subscription-checkbox-rac-xJDzCasS.js → ecom-subscription-checkbox-rac-BpILYYtb.js} +2 -2
  53. package/dist/component/{email-input-field-rac-CeTVUWeX.js → email-input-field-rac-Cb6ECUnT.js} +5 -5
  54. package/dist/component/{events-repeater-rac-CT9LAF22.js → events-repeater-rac-BaYgjHjJ.js} +6 -6
  55. package/dist/component/{events-rsvp-rac-Bu8tqcVi.js → events-rsvp-rac-CK0hpQKD.js} +3 -3
  56. package/dist/component/{field-error-headless-gLZVlnQV.js → field-error-headless-CN2-F78X.js} +1 -1
  57. package/dist/component/{field-label-headless-yc46NPmu.js → field-label-headless-Ca6NcX2l.js} +1 -1
  58. package/dist/component/field-rac.module-B4l_0KRU.js +26 -0
  59. package/dist/component/{file-upload-rac-LkVTFtZb.js → file-upload-rac-C0DqDLp2.js} +4 -4
  60. package/dist/component/{fixed-payment-rac-DEbV0w-8.js → fixed-payment-rac-C5qNAT_7.js} +4 -4
  61. package/dist/component/{form-DV231fmJ.js → form-D1xJH87b.js} +69 -69
  62. package/dist/component/form.css +1 -1
  63. package/dist/component/form.js +1 -1
  64. package/dist/component/{header-field-rac-BzB5dm6C.js → header-field-rac-BN-Ib7VY.js} +2 -2
  65. package/dist/component/{header-rac-BzS5HfUt.js → header-rac-CE0NjfoF.js} +1 -1
  66. package/dist/component/{image-choice-rac-8YqUqetS.js → image-choice-rac-D6dIXR_x.js} +5 -5
  67. package/dist/component/{index-CMtf-So7.js → index-CcsZgBFf.js} +4 -4
  68. package/dist/component/{index-BzRG28bH.js → index-DOd4eW8z.js} +2 -2
  69. package/dist/component/{isObjectLike--gPCPyGa.js → isObjectLike-DfUDKPeo.js} +1 -1
  70. package/dist/component/{multiline-address-field-rac-CJWdu5LV.js → multiline-address-field-rac-jJ5HMakk.js} +8 -8
  71. package/dist/component/{multiline-address-rac-Cw5VweB0.js → multiline-address-rac-GQF9HaNq.js} +1 -1
  72. package/dist/component/{number-input-field-rac-D8NRpCCM.js → number-input-field-rac-DRgq3Ll0.js} +5 -5
  73. package/dist/component/{number-input-rac-CM_CQHE_.js → number-input-rac-C2VoBZeq.js} +1 -1
  74. package/dist/component/{password-rac-I6vynKG4.js → password-rac-DP8d_92z.js} +5 -5
  75. package/dist/component/{payment-input-rac-B4rXCs7V.js → payment-input-rac-BycHF-zC.js} +5 -5
  76. package/dist/component/{phone-input-field-rac-B-k2e0Np.js → phone-input-field-rac-C3_-Dc35.js} +7 -7
  77. package/dist/component/{phone-rac-D443psAx.js → phone-rac-DAxScWRl.js} +1 -1
  78. package/dist/component/{product-list-rac-B6qUWxkz.js → product-list-rac-Bxdu4NFP.js} +6 -6
  79. package/dist/component/{quiz-radio-group-rac-DdPJQmV5.js → quiz-radio-group-rac-mAn0MuPW.js} +1 -1
  80. package/dist/component/{radio-button-module-classes--on7xGzb.js → radio-button-module-classes-D71u96Y9.js} +28 -28
  81. package/dist/component/{radio-group-field-rac-CjiGr1rO.js → radio-group-field-rac-eij4o0_R.js} +4 -4
  82. package/dist/component/{radio-group-rac-CjbSQydw.js → radio-group-rac-DqdjCYmd.js} +1 -1
  83. package/dist/component/{rating-input-field-rac-yVgqxBKi.js → rating-input-field-rac-C4Ztlh1u.js} +5 -5
  84. package/dist/component/{rating-input-rac-D6BKC4oS.js → rating-input-rac-B4lF_LX7.js} +1 -1
  85. package/dist/component/{rich-content-rac.module-Ca4LYv7k.js → rich-content-rac.module-CmW7FwmQ.js} +1 -1
  86. package/dist/component/{rich-text-field-rac-DIeBS-ux.js → rich-text-field-rac-MwKpKbvj.js} +2 -2
  87. package/dist/component/{rich-text-rac-BgjP0ngh.js → rich-text-rac-DcMBqEFb.js} +1 -1
  88. package/dist/component/{service-dropdown-rac-DjOMT7dx.js → service-dropdown-rac-CZWVFnR8.js} +5 -5
  89. package/dist/component/{services-multi-choice-rac-C0Rp9Sng.js → services-multi-choice-rac-DvHcWQHS.js} +7 -7
  90. package/dist/component/{signature-rac-CFT-Fni_.js → signature-rac-CMTAWkaY.js} +4 -4
  91. package/dist/component/{submit-button-rac-BOluGZI0.js → submit-button-rac-HnfWQ8wg.js} +1 -1
  92. package/dist/component/{tags-field-rac-CP0RS4SG.js → tags-field-rac-BuqOeG7-.js} +6 -6
  93. package/dist/component/{tags-rac-Dtp3VCKk.js → tags-rac-FbHwPPKs.js} +1 -1
  94. package/dist/component/{text-area-field-rac-DUKg8kgN.js → text-area-field-rac-Bq224M1o.js} +5 -5
  95. package/dist/component/{text-area-rac-Clh7zMTL.js → text-area-rac-COcGlAYk.js} +1 -1
  96. package/dist/component/{text-input-field-rac-DY60Q6da.js → text-input-field-rac-CTS4jFhC.js} +3 -3
  97. package/dist/component/{text-input-headless-BBv0nukI.js → text-input-headless-QVLKSgJE.js} +3 -3
  98. package/dist/component/{text-input-rac-FVD6iJ1i.js → text-input-rac-BCCkVVG9.js} +1 -1
  99. package/dist/component/{time-input-rac-DsctZB28.js → time-input-rac-7n8d5ppJ.js} +5 -5
  100. package/dist/component/{url-input-field-rac-Du4HlhH3.js → url-input-field-rac-ChPfhq6I.js} +5 -5
  101. package/dist/component/{url-input-rac-3QPdK0xz.js → url-input-rac-cFZ8HC3U.js} +1 -1
  102. package/dist/component/{use-dropdown-option-class-name-Bze6ghRl.js → use-dropdown-option-class-name-Cf2B9xAE.js} +2 -2
  103. package/dist/component/{use-element-state-class-name-4CDAF1S-.js → use-element-state-class-name-DF2VZawA.js} +1 -1
  104. package/dist/component/{use-is-forced-open-dropdown--w4f5dWP.js → use-is-forced-open-dropdown-B_knxuKJ.js} +1 -1
  105. package/dist/component/{use-service-options-base-9vUuIThY.js → use-service-options-base-Clx3S0du.js} +1 -1
  106. package/dist/component/{use-text-input-class-name-Ch91llI_.js → use-text-input-class-name-MbmOF6tH.js} +3 -3
  107. package/package.json +5 -5
  108. package/dist/component/appointment-rac-CCciYQ_h.js +0 -1012
  109. package/dist/component/field-rac.module-DobpyqOd.js +0 -26
@@ -0,0 +1,1011 @@
1
+ import o, { useRef as X, useState as Q, useEffect as H, createContext as $e, useContext as Ge, useMemo as P, useCallback as ie } from "react";
2
+ import { RicosViewer as it } from "@wix/ricos/viewer";
3
+ import R from "classnames";
4
+ import { C as Me } from "./chevron-down-icon-CcpVm6B-.js";
5
+ import { E as lt } from "./error-icon-hZxQ6DEy.js";
6
+ import { g as ct, c as Ce } from "./calendar.module-DnhTT4QT.js";
7
+ import { H as me } from "./custom-focus-class-_483Pkwp.js";
8
+ import { s as de } from "./field-rac.module-B4l_0KRU.js";
9
+ import { C as ut, S as mt, a as dt, z as We, i as ft, W as Dt, r as Et, j as St, a2 as pt } from "./form-element-classes-BtKlobUX.js";
10
+ import { u as _t } from "./use-element-state-class-name-DF2VZawA.js";
11
+ import { ListBox as Lt, Button as Te, ListBoxItem as yt, RadioGroup as At, RadioField as Nt, RadioButton as gt } from "react-aria-components";
12
+ import { ac as De, ab as It, ag as he, af as Ot, c as bt, au as Tt, at as ht, ak as ce, ah as Ee, am as vt, aj as kt, F as Rt } from "./form-D1xJH87b.js";
13
+ import { f as T, a as le } from "./find-child-C60k4CxG.js";
14
+ import { D as wt, E as Ft } from "./field-error-headless-CN2-F78X.js";
15
+ import { L as Mt } from "./field-label-headless-Ca6NcX2l.js";
16
+ import { F as Ct } from "./fieldset-headless-CD3fds9J.js";
17
+ import "date-fns";
18
+ import { V as Ze } from "./headless-styles-CmcyA_pi.js";
19
+ function Wt(e) {
20
+ return { evid: 40, src: 16, endpoint: "", params: e };
21
+ }
22
+ var Ie = /* @__PURE__ */ (function(e) {
23
+ return e.BOOKING_NOT_INSTALL = "BOOKING_NOT_INSTALL", e.NO_AVAILABILITY_DATES_FOUND = "NO_AVAILABILITY_DATES_FOUND", e.GENERAL = "GENERAL", e;
24
+ })({}), z = /* @__PURE__ */ (function(e) {
25
+ return e.LOADING = "LOADING", e.DONE = "DONE", e.ERROR = "ERROR", e;
26
+ })({});
27
+ const q = 4;
28
+ var J = /* @__PURE__ */ (function(e) {
29
+ return e.FORM = "form", e.NO_AVAILABILITY_FOR_DATE = "no availability for date empty state", e.NO_AVAILABILITY_AT_ALL = "no availability at all empty state", e.SLOT = "slot", e.DATE = "date", e.PAGINATION = "pagination", e.SHOW_MORE = "show more", e;
30
+ })({}), ne = /* @__PURE__ */ (function(e) {
31
+ return e.LOAD = "load", e.CLICK = "click", e;
32
+ })({});
33
+ const Bt = (e) => {
34
+ var t;
35
+ return {
36
+ bookingsServiceId: e == null ? void 0 : e.id,
37
+ formGuid: (t = e == null ? void 0 : e.form) == null ? void 0 : t.id,
38
+ serviceProperties: Ut(e)
39
+ };
40
+ }, Ut = (e) => {
41
+ var t;
42
+ return JSON.stringify({
43
+ serviceId: e == null ? void 0 : e.id,
44
+ serviceType: e == null ? void 0 : e.type,
45
+ locationIds: (t = e == null ? void 0 : e.locations) == null ? void 0 : t.map((n) => n.id).filter((n) => n),
46
+ staffMemberIds: e == null ? void 0 : e.staffMemberIds,
47
+ isOfferedAsPricingPlan: !1
48
+ });
49
+ }, Ve = (e) => {
50
+ var l;
51
+ const { appointmentFieldProps: t } = ve(), { isEditor: n, isComposer: a } = De(), s = It(), r = e || ((l = t == null ? void 0 : t.initialData) == null ? void 0 : l.service);
52
+ if (!(n || a))
53
+ return {
54
+ ...s,
55
+ report: (i) => s == null ? void 0 : s.report(Wt({
56
+ ...Bt(r),
57
+ ...i
58
+ }))
59
+ };
60
+ };
61
+ var Oe;
62
+ (function(e) {
63
+ e.UNDEFINED = "UNDEFINED", e.OWNER_BUSINESS = "OWNER_BUSINESS", e.OWNER_CUSTOM = "OWNER_CUSTOM", e.CUSTOM = "CUSTOM";
64
+ })(Oe || (Oe = {}));
65
+ var Be;
66
+ (function(e) {
67
+ e.UNKNOWN_REQUESTED_GENDER = "UNKNOWN_REQUESTED_GENDER", e.ANY_MALE = "ANY_MALE", e.ANY_FEMALE = "ANY_FEMALE";
68
+ })(Be || (Be = {}));
69
+ var Ue;
70
+ (function(e) {
71
+ e.UNKNOWN_LOCATION_TYPE = "UNKNOWN_LOCATION_TYPE", e.BUSINESS = "BUSINESS", e.CUSTOM = "CUSTOM", e.CUSTOMER = "CUSTOMER";
72
+ })(Ue || (Ue = {}));
73
+ var xe;
74
+ (function(e) {
75
+ e.UNKNOWN_REQUESTED_GENDER = "UNKNOWN_REQUESTED_GENDER", e.ANY_MALE = "ANY_MALE", e.ANY_FEMALE = "ANY_FEMALE";
76
+ })(xe || (xe = {}));
77
+ var Pe;
78
+ (function(e) {
79
+ e.ASC = "ASC", e.DESC = "DESC";
80
+ })(Pe || (Pe = {}));
81
+ const xt = (e) => {
82
+ const { service: t } = e || {};
83
+ return (t == null ? void 0 : t.id) ? null : {
84
+ type: Ie.GENERAL,
85
+ message: "Service ID is missing"
86
+ };
87
+ }, Pt = ({ appointmentFieldProps: e, isEditor: t, isComposer: n }) => {
88
+ const { initialData: a } = e, s = Yt();
89
+ if (t || n)
90
+ return {
91
+ ...s,
92
+ timezone: qe(),
93
+ dataStatus: z.DONE
94
+ };
95
+ {
96
+ const r = xt(a);
97
+ if (r)
98
+ return {
99
+ dataStatus: z.ERROR,
100
+ error: r
101
+ };
102
+ }
103
+ return {
104
+ ...s,
105
+ dataStatus: z.LOADING
106
+ };
107
+ }, zt = (e, t) => {
108
+ const n = /* @__PURE__ */ new Date(), a = new Date(n);
109
+ a.setMonth(a.getMonth() + e);
110
+ const s = new Date(n.toLocaleString("en-US", {
111
+ timeZone: t
112
+ })), r = new Date(a.toLocaleString("en-US", {
113
+ timeZone: t
114
+ }));
115
+ return {
116
+ startDate: s,
117
+ endDate: r
118
+ };
119
+ }, qe = () => Intl.DateTimeFormat().resolvedOptions().timeZone, Ht = (e) => {
120
+ var t, n, a;
121
+ if ((n = (t = e == null ? void 0 : e[0]) == null ? void 0 : t.slot) != null && n.startDate)
122
+ return new Date((a = e[0].slot) == null ? void 0 : a.startDate);
123
+ }, Yt = ({ duration: e = 60, timezone: t = "UTC" } = {}) => {
124
+ var E, f;
125
+ const n = "267d1c11-8019-4e3d-b9c6-cd2b859c69e2", a = /* @__PURE__ */ new Date(), s = [], r = [], l = a.toISOString().split("T")[0], i = 10, c = 18;
126
+ let d = /* @__PURE__ */ new Date(`${l}T${i}:00:00`), m = new Date(d);
127
+ m.setMinutes(m.getMinutes() + e);
128
+ let p = !1;
129
+ for (; m.getHours() < c || m.getHours() === c && m.getMinutes() === 0; ) {
130
+ const O = {
131
+ slot: {
132
+ serviceId: n,
133
+ startDate: d.toISOString(),
134
+ endDate: m.toISOString(),
135
+ location: {
136
+ locationType: Oe.CUSTOM
137
+ }
138
+ },
139
+ bookable: !0,
140
+ totalSpots: 1,
141
+ openSpots: 1,
142
+ bookingPolicyViolations: {
143
+ tooEarlyToBook: !1,
144
+ tooLateToBook: !1,
145
+ bookOnlineDisabled: !1
146
+ },
147
+ nestedSlots: []
148
+ };
149
+ r.push(O), p || (s.push(O), p = !0), d = new Date(m), m = new Date(d), m.setMinutes(m.getMinutes() + e);
150
+ }
151
+ return {
152
+ availabilitySlots: r,
153
+ availabilityDates: s,
154
+ timezone: t,
155
+ currentSlotBulkSize: q,
156
+ selectedDate: s.length > 0 && ((f = (E = s[0]) == null ? void 0 : E.slot) != null && f.startDate) ? new Date(s[0].slot.startDate) : void 0
157
+ };
158
+ };
159
+ function Kt(e) {
160
+ var f;
161
+ const { initialData: t, onChange: n, value: a } = e, { isEditor: s, isComposer: r } = De(), l = (f = t == null ? void 0 : t.service) == null ? void 0 : f.id, { actions: i } = he(), c = X(i);
162
+ c.current = i;
163
+ const d = !!(i != null && i.getAvailabilityDates && (i != null && i.getAvailabilitySlots)), [m, p] = Q(null), E = Ve(t == null ? void 0 : t.service);
164
+ return H(() => {
165
+ l && !s && !r && d && (async () => {
166
+ var _, b, Y, M, $;
167
+ const v = qe(), I = {
168
+ currentSlotBulkSize: q,
169
+ timezone: v,
170
+ dataStatus: z.LOADING
171
+ };
172
+ try {
173
+ const U = async (se) => {
174
+ var L, S;
175
+ const { startDate: G, endDate: C } = zt(se, v);
176
+ return (S = (L = c.current) == null ? void 0 : L.getAvailabilityDates) == null ? void 0 : S.call(L, {
177
+ serviceId: l,
178
+ fromDate: G,
179
+ toDate: C,
180
+ timeZone: v
181
+ });
182
+ };
183
+ if (I.availabilityDates = await U(2), (_ = I.availabilityDates) != null && _.length || (I.availabilityDates = await U(6)), !((b = I.availabilityDates) != null && b.length)) {
184
+ E == null || E.report({
185
+ action: ne.LOAD,
186
+ component: J.NO_AVAILABILITY_AT_ALL
187
+ }), p({
188
+ dataStatus: z.ERROR,
189
+ error: {
190
+ type: Ie.NO_AVAILABILITY_DATES_FOUND,
191
+ message: "No availability dates found"
192
+ }
193
+ });
194
+ return;
195
+ }
196
+ I.selectedDate = Ht(I.availabilityDates), I.selectedDate && (I.availabilitySlots = await ((M = (Y = c.current) == null ? void 0 : Y.getAvailabilitySlots) == null ? void 0 : M.call(Y, {
197
+ serviceId: l,
198
+ timeZone: v,
199
+ selectedDate: I.selectedDate
200
+ }))), E == null || E.report({
201
+ action: ne.LOAD,
202
+ component: ($ = I.availabilityDates) != null && $.length ? J.FORM : J.NO_AVAILABILITY_FOR_DATE
203
+ }), a != null && a.startDate || n(void 0), p({
204
+ ...I,
205
+ dataStatus: z.DONE
206
+ });
207
+ } catch (U) {
208
+ console.error(U), p({
209
+ dataStatus: z.ERROR,
210
+ error: {
211
+ type: Ie.GENERAL,
212
+ message: "An error occurred in initialAppointmentState"
213
+ }
214
+ });
215
+ }
216
+ })();
217
+ }, [
218
+ s,
219
+ r,
220
+ l,
221
+ d
222
+ ]), m;
223
+ }
224
+ const je = /* @__PURE__ */ $e({
225
+ appointmentState: {},
226
+ setAppointmentState: () => {
227
+ }
228
+ }), $t = ({ appointmentFieldProps: e, children: t }) => {
229
+ const { isEditor: n, isComposer: a } = De(), [s, r] = Q(() => Pt({
230
+ appointmentFieldProps: e,
231
+ isEditor: n,
232
+ isComposer: a
233
+ })), l = Kt(e);
234
+ return H(() => {
235
+ l && r({
236
+ ...s,
237
+ ...l
238
+ });
239
+ }, [
240
+ l
241
+ ]), /* @__PURE__ */ o.createElement(je.Provider, {
242
+ value: {
243
+ appointmentFieldProps: e,
244
+ appointmentState: s,
245
+ setAppointmentState: (i) => r({
246
+ ...s,
247
+ ...i
248
+ })
249
+ }
250
+ }, t);
251
+ }, ve = () => Ge(je), Gt = (e, t) => {
252
+ if (e.startOfWeek.getMonth() === e.endOfWeek.getMonth())
253
+ return new Intl.DateTimeFormat(t, {
254
+ month: "long",
255
+ year: "numeric"
256
+ }).format(e.endOfWeek);
257
+ const n = new Intl.DateTimeFormat(t, {
258
+ month: "short"
259
+ }).format(e.startOfWeek), a = new Intl.DateTimeFormat(t, {
260
+ month: "short",
261
+ year: "numeric"
262
+ }).format(e.endOfWeek);
263
+ return `${n} - ${a}`;
264
+ }, Zt = (e) => !(e != null && e.startDate) || !(e != null && e.endDate) || !(e != null && e.timeZone) ? null : {
265
+ startDate: e == null ? void 0 : e.startDate,
266
+ endDate: e == null ? void 0 : e.endDate,
267
+ timeZone: e == null ? void 0 : e.timeZone
268
+ }, ze = ({ timezone: e, language: t, formatType: n }) => {
269
+ var s;
270
+ return (s = new Intl.DateTimeFormat(t, {
271
+ timeZone: e,
272
+ timeZoneName: n === "name" ? "long" : "short"
273
+ }).formatToParts(/* @__PURE__ */ new Date()).find(({ type: r }) => r === "timeZoneName")) == null ? void 0 : s.value;
274
+ }, Vt = ({ timezone: e, language: t }) => {
275
+ const n = ze({
276
+ timezone: e,
277
+ language: t,
278
+ formatType: "name"
279
+ }), a = ze({
280
+ timezone: e,
281
+ language: t,
282
+ formatType: "offset"
283
+ });
284
+ return `${n} (${a})`;
285
+ }, ae = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), qt = (e, t) => {
286
+ const n = new Date(e);
287
+ n.setDate(e.getDate() - t);
288
+ const a = new Date(e);
289
+ return a.setDate(e.getDate() + t), {
290
+ fromDate: n,
291
+ toDate: a
292
+ };
293
+ }, jt = ({ setIsReloadingSlots: e }) => {
294
+ const { appointmentFieldProps: t, appointmentState: n, setAppointmentState: a } = ve(), { value: s } = t, { actions: r } = he();
295
+ H(() => {
296
+ (async () => {
297
+ var i, c;
298
+ if (s != null && s.startDate && (n != null && n.selectedDate) && (n == null ? void 0 : n.dataStatus) === z.DONE && !ae(new Date(s.startDate), n == null ? void 0 : n.selectedDate)) {
299
+ e(!0);
300
+ const m = new Date(s.startDate), { fromDate: p, toDate: E } = qt(m, 8), [f, O] = await Promise.all([
301
+ (i = r == null ? void 0 : r.getAvailabilityDates) == null ? void 0 : i.call(r, {
302
+ serviceId: t == null ? void 0 : t.initialData.service.id,
303
+ timeZone: (n == null ? void 0 : n.timezone) || "",
304
+ fromDate: p,
305
+ toDate: E
306
+ }),
307
+ (c = r == null ? void 0 : r.getAvailabilitySlots) == null ? void 0 : c.call(r, {
308
+ serviceId: t == null ? void 0 : t.initialData.service.id,
309
+ timeZone: (n == null ? void 0 : n.timezone) || "",
310
+ selectedDate: m
311
+ })
312
+ ]);
313
+ a({
314
+ availabilityDates: f,
315
+ selectedDate: m,
316
+ availabilitySlots: O
317
+ }), e(!1);
318
+ }
319
+ })();
320
+ }, [
321
+ s,
322
+ n == null ? void 0 : n.dataStatus
323
+ ]);
324
+ }, Qt = (e, t) => !e || !t.length ? e : e.filter((n) => {
325
+ var a;
326
+ return !t.includes(((a = n == null ? void 0 : n.slot) == null ? void 0 : a.startDate) ?? "");
327
+ }), fe = (e) => !(e != null && e.startDate) || !(e != null && e.endDate) ? "" : `${e == null ? void 0 : e.startDate}_${e == null ? void 0 : e.endDate}`, Jt = ({ locale: e, endDate: t, startDate: n, timezone: a }) => {
328
+ const s = {
329
+ hour: "numeric",
330
+ minute: "numeric",
331
+ timeZone: a
332
+ }, r = new Intl.DateTimeFormat(e, s).format(new Date(n)), l = new Intl.DateTimeFormat(e, s).format(new Date(t));
333
+ return `${r} - ${l}`;
334
+ }, Xt = ({ selectedDate: e, locale: t, timezone: n }) => e ? new Intl.DateTimeFormat(t, {
335
+ weekday: "long",
336
+ month: "short",
337
+ day: "numeric",
338
+ timeZone: n
339
+ }).format(e) : "", en = (e, t) => {
340
+ let n;
341
+ return t.forEach((a, s) => {
342
+ var r, l;
343
+ fe({
344
+ startDate: (r = a == null ? void 0 : a.slot) == null ? void 0 : r.startDate,
345
+ endDate: (l = a == null ? void 0 : a.slot) == null ? void 0 : l.endDate
346
+ }) === e && (n = s);
347
+ }), n;
348
+ };
349
+ var tn = /* @__PURE__ */ (function(e) {
350
+ return e.OS_LOCATION = "OS_LOCATION", e.CUSTOM_LOCATION = "CUSTOM_LOCATION", e;
351
+ })({});
352
+ const nn = "SLOT_UNAVAILABLE", He = [], an = (e) => {
353
+ var t;
354
+ return ((t = e == null ? void 0 : e.params) == null ? void 0 : t.reason) === nn;
355
+ }, on = ({ error: e, selectedSlot: t }) => {
356
+ const { isExperimentEnabled: n } = Ot(), a = n(bt.BIF_SLOT_HOLD), [s, r] = Q(He), l = a && an(e), i = t == null ? void 0 : t.startDate, c = X(!1);
357
+ return H(() => {
358
+ if (!l) {
359
+ c.current = !1;
360
+ return;
361
+ }
362
+ c.current || (c.current = !0, i && r((d) => d.includes(i) ? d : [
363
+ ...d,
364
+ i
365
+ ]));
366
+ }, [
367
+ l,
368
+ i
369
+ ]), a ? s : He;
370
+ }, j = 7, be = (e) => {
371
+ const t = new Date(e);
372
+ return t.setHours(0, 0, 0, 0), t;
373
+ }, sn = (e) => {
374
+ const t = new Date(e);
375
+ return t.setHours(23, 59, 59, 999), t;
376
+ }, te = (e, t) => {
377
+ const n = new Date(e);
378
+ return n.setDate(n.getDate() + t), n;
379
+ }, Ye = (e, t) => {
380
+ const n = be(e), a = (n.getDay() - t + j) % j;
381
+ return te(n, -a);
382
+ }, rn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, ln = (e, t, n) => {
383
+ const a = new Intl.DateTimeFormat(n, {
384
+ month: "short",
385
+ day: "numeric"
386
+ });
387
+ return typeof a.formatRange == "function" ? a.formatRange(e, t) : `${a.format(e)} - ${a.format(t)}`;
388
+ }, cn = (e, t = []) => t.some((n) => {
389
+ var a;
390
+ return !!((a = n.slot) != null && a.startDate) && ae(new Date(n.slot.startDate), e);
391
+ }), un = () => {
392
+ var Fe;
393
+ const { appointmentFieldProps: e, appointmentState: t, setAppointmentState: n } = ve(), { language: a, isEditor: s, isComposer: r } = De(), { t: l } = Tt(), { actions: i } = he(), c = Ve(), [d, m] = Q(!1), [p, E] = Q(!1), [f, O] = Q(), [v, I] = Q();
394
+ jt({
395
+ setIsReloadingSlots: m
396
+ });
397
+ const { onChange: _, value: b, target: Y, initialData: M, formatDescription: $, locationType: U, error: se } = e, { availabilityDates: G, availabilitySlots: C, timezone: L = "", selectedDate: S, currentSlotBulkSize: k, dataStatus: K, error: Z } = t, V = (Fe = M == null ? void 0 : M.service) == null ? void 0 : Fe.id, w = K === z.LOADING, ee = d || p, Se = !!Z, Re = on({
398
+ error: se,
399
+ selectedSlot: b
400
+ }), y = P(() => Qt(C, Re), [
401
+ C,
402
+ Re
403
+ ]);
404
+ H(() => {
405
+ _ == null || _(Zt(b));
406
+ }, [
407
+ b == null ? void 0 : b.startDate,
408
+ b == null ? void 0 : b.endDate,
409
+ L
410
+ ]), ht((D) => {
411
+ const N = D == null ? void 0 : D[Y];
412
+ C != null && C.length && n({
413
+ availabilitySlots: C.filter((g) => {
414
+ var h;
415
+ return ((h = g == null ? void 0 : g.slot) == null ? void 0 : h.startDate) !== (N == null ? void 0 : N.startDate);
416
+ })
417
+ });
418
+ }), H(() => {
419
+ if (y != null && y.length && k) {
420
+ const D = en(fe(b ?? void 0), y);
421
+ D && D + 1 > k && n({
422
+ currentSlotBulkSize: D + 1
423
+ });
424
+ } else !(y != null && y.length) && b && (_ == null || _(void 0));
425
+ }, [
426
+ b,
427
+ y,
428
+ G
429
+ ]);
430
+ const pe = P(() => ct(a), [
431
+ a
432
+ ]), we = X(S);
433
+ H(() => {
434
+ const D = we.current;
435
+ we.current = S, !!S && (!D || !ae(D, S)) && O(void 0);
436
+ }, [
437
+ S
438
+ ]);
439
+ const W = P(() => f ?? Ye(S ?? /* @__PURE__ */ new Date(), pe), [
440
+ f,
441
+ S,
442
+ pe
443
+ ]), Xe = P(() => {
444
+ const D = be(/* @__PURE__ */ new Date()), N = new Intl.DateTimeFormat(a, {
445
+ weekday: "short"
446
+ }), g = new Intl.DateTimeFormat(a, {
447
+ day: "numeric"
448
+ }), h = new Intl.DateTimeFormat(a, {
449
+ weekday: "long",
450
+ month: "long",
451
+ day: "numeric"
452
+ });
453
+ return Array.from({
454
+ length: j
455
+ }, (re, Ne) => {
456
+ const x = te(W, Ne), ge = !!S && ae(x, S), rt = be(x) < D;
457
+ return {
458
+ key: rn(x),
459
+ date: x,
460
+ isSelected: ge,
461
+ isAvailable: !w && !ee && !ge && cn(x, G),
462
+ isDisabled: rt || ee && !ge,
463
+ isToday: ae(x, D),
464
+ dayOfMonthLabel: g.format(x),
465
+ weekdayLabel: N.format(x),
466
+ label: h.format(x),
467
+ availabilityLabel: l("form.appointment.accessibility.calendar.has-availability.aria-label")
468
+ };
469
+ });
470
+ }, [
471
+ W,
472
+ S,
473
+ G,
474
+ w,
475
+ ee,
476
+ a,
477
+ l
478
+ ]), _e = fe(b ?? void 0) || void 0, Le = P(() => w || d ? [] : (y ?? []).slice(0, k).flatMap((D) => {
479
+ const { startDate: N, endDate: g } = D.slot ?? {};
480
+ if (!N || !g)
481
+ return [];
482
+ const h = fe({
483
+ startDate: N,
484
+ endDate: g
485
+ });
486
+ return [
487
+ {
488
+ key: h,
489
+ startDate: N,
490
+ endDate: g,
491
+ timeRange: Jt({
492
+ startDate: N,
493
+ endDate: g,
494
+ locale: a,
495
+ timezone: L
496
+ }),
497
+ isSelected: h === _e
498
+ }
499
+ ];
500
+ }), [
501
+ y,
502
+ k,
503
+ w,
504
+ d,
505
+ a,
506
+ L,
507
+ _e
508
+ ]), ye = !d && !!(y != null && y.length) && (k || q) < y.length, Ae = W > Ye(/* @__PURE__ */ new Date(), pe), et = ie(
509
+ async (D) => {
510
+ var N;
511
+ if (!(ee || S && ae(D, S))) {
512
+ m(!0), _ == null || _(void 0), n({
513
+ currentSlotBulkSize: q,
514
+ selectedDate: D,
515
+ availabilitySlots: void 0
516
+ }), c == null || c.report({
517
+ action: ne.CLICK,
518
+ component: J.DATE
519
+ });
520
+ try {
521
+ const g = await ((N = i == null ? void 0 : i.getAvailabilitySlots) == null ? void 0 : N.call(i, {
522
+ serviceId: V,
523
+ timeZone: L,
524
+ selectedDate: D
525
+ }));
526
+ n({
527
+ currentSlotBulkSize: q,
528
+ selectedDate: D,
529
+ availabilitySlots: g
530
+ });
531
+ } catch {
532
+ } finally {
533
+ m(!1);
534
+ }
535
+ }
536
+ },
537
+ // eslint-disable-next-line react-hooks/exhaustive-deps
538
+ [
539
+ ee,
540
+ S,
541
+ V,
542
+ L,
543
+ i,
544
+ _,
545
+ c
546
+ ]
547
+ ), ue = X(0), tt = ie(
548
+ async (D) => {
549
+ var re;
550
+ if (D < 0 && !Ae)
551
+ return;
552
+ const N = W, g = te(W, D * j);
553
+ if (O(g), s || r)
554
+ return;
555
+ const h = ++ue.current;
556
+ E(!0), c == null || c.report({
557
+ action: ne.CLICK,
558
+ component: J.PAGINATION
559
+ });
560
+ try {
561
+ const Ne = await ((re = i == null ? void 0 : i.getAvailabilityDates) == null ? void 0 : re.call(i, {
562
+ serviceId: V,
563
+ timeZone: L,
564
+ fromDate: g,
565
+ toDate: sn(te(g, j - 1))
566
+ }));
567
+ h === ue.current && n({
568
+ availabilityDates: Ne
569
+ });
570
+ } catch {
571
+ h === ue.current && O(N);
572
+ } finally {
573
+ h === ue.current && E(!1);
574
+ }
575
+ },
576
+ // eslint-disable-next-line react-hooks/exhaustive-deps
577
+ [
578
+ Ae,
579
+ W,
580
+ s,
581
+ r,
582
+ V,
583
+ L,
584
+ i,
585
+ c
586
+ ]
587
+ ), nt = ie(
588
+ (D) => {
589
+ const N = Le.find((re) => re.key === D);
590
+ if (!N)
591
+ return;
592
+ const { startDate: g, endDate: h } = N;
593
+ c == null || c.report({
594
+ action: ne.CLICK,
595
+ component: J.SLOT,
596
+ startTime: new Date(g).valueOf(),
597
+ endTime: new Date(h).valueOf()
598
+ }), _ == null || _({
599
+ startDate: g,
600
+ endDate: h,
601
+ timeZone: L
602
+ });
603
+ },
604
+ // eslint-disable-next-line react-hooks/exhaustive-deps
605
+ [
606
+ Le,
607
+ L,
608
+ _,
609
+ c
610
+ ]
611
+ ), at = ie(() => {
612
+ if (!ye)
613
+ return;
614
+ const D = k || q;
615
+ c == null || c.report({
616
+ action: ne.CLICK,
617
+ component: J.SHOW_MORE
618
+ }), I(D), n({
619
+ currentSlotBulkSize: D + q
620
+ });
621
+ }, [
622
+ ye,
623
+ k,
624
+ c
625
+ ]), ot = ie(() => I(void 0), []), st = P(() => {
626
+ if (Se)
627
+ return l("form.appointment.empty-state.notification.text");
628
+ if (!w && !d && !(y != null && y.length))
629
+ return l("form.appointment.slots-not-found.text");
630
+ }, [
631
+ Se,
632
+ w,
633
+ d,
634
+ y == null ? void 0 : y.length,
635
+ l
636
+ ]);
637
+ return {
638
+ days: Xe,
639
+ slots: Le,
640
+ selectedSlotKey: _e,
641
+ selectDate: et,
642
+ selectSlot: nt,
643
+ changeWeek: tt,
644
+ showMoreSlots: at,
645
+ canGoToPreviousWeek: Ae,
646
+ hasMoreSlots: ye,
647
+ hasError: Se,
648
+ isLoading: w,
649
+ isRefetching: ee,
650
+ isReloadingSlots: d,
651
+ weekRangeLabel: ln(W, te(W, j - 1), a),
652
+ weekCaptionLabel: Gt({
653
+ startOfWeek: W,
654
+ endOfWeek: te(W, j - 1)
655
+ }, a),
656
+ selectedDateLabel: Xt({
657
+ selectedDate: S,
658
+ locale: a,
659
+ timezone: L
660
+ }),
661
+ timezoneLabel: L ? `${l("form.appointment.timezone.label")}: ${Vt({
662
+ timezone: L,
663
+ language: a
664
+ })}` : "",
665
+ formatLabel: U === tn.OS_LOCATION ? l("form.appointment.meeting-format.in-person-location-method-os-location") : $,
666
+ notificationMessage: st,
667
+ showMoreSlotsLabel: l("form.appointment.show-more-slots.text"),
668
+ previousWeekLabel: l("form.appointment.accessibility.calendar.previous-week.aria-label"),
669
+ nextWeekLabel: l("form.appointment.accessibility.calendar.next-week.aria-label"),
670
+ pendingFocusIndex: v,
671
+ consumePendingFocusIndex: ot
672
+ };
673
+ }, Qe = $e(void 0), Je = (e) => `${e}-timezone-note`, F = () => {
674
+ const e = Ge(Qe);
675
+ if (typeof e > "u")
676
+ throw new Error("Appointment parts must be used inside an <Appointment> component");
677
+ return e;
678
+ }, ke = () => {
679
+ const { disabled: e, readOnly: t } = ce();
680
+ return !!e || !!t;
681
+ }, B = ({ children: e, className: t }) => {
682
+ const { days: n, selectDate: a, weekRangeLabel: s } = F(), r = T(e, B.PreviousWeek), l = T(e, B.Heading), i = T(e, B.NextWeek), c = T(e, B.Day) ?? /* @__PURE__ */ o.createElement(B.Day, null), d = P(() => n.filter((f) => f.isSelected).map((f) => f.key), [
683
+ n
684
+ ]), m = ke(), p = P(() => n.filter((f) => m || f.isDisabled).map((f) => f.key), [
685
+ n,
686
+ m
687
+ ]), E = (f) => {
688
+ if (f === "all")
689
+ return;
690
+ const [O] = [
691
+ ...f
692
+ ], v = n.find(({ key: I }) => I === O);
693
+ v && a(v.date);
694
+ };
695
+ return /* @__PURE__ */ o.createElement("div", {
696
+ className: t
697
+ }, r, l, i, /* @__PURE__ */ o.createElement(Lt, {
698
+ "aria-label": s,
699
+ orientation: "horizontal",
700
+ selectionMode: "single",
701
+ selectedKeys: d,
702
+ disabledKeys: p,
703
+ onSelectionChange: E
704
+ }, n.map((f) => le(c, {
705
+ key: f.key,
706
+ day: f
707
+ }))));
708
+ }, mn = ({ children: e, className: t }) => {
709
+ const { changeWeek: n, canGoToPreviousWeek: a, previousWeekLabel: s, nextWeekLabel: r } = F(), l = ke(), i = X(null), c = X(!1);
710
+ return H(() => {
711
+ var p, E, f;
712
+ if (a || !c.current)
713
+ return;
714
+ c.current = !1;
715
+ const d = document.activeElement;
716
+ if (d !== document.body && d !== i.current)
717
+ return;
718
+ const m = ((E = (p = i.current) == null ? void 0 : p.closest("fieldset")) == null ? void 0 : E.querySelectorAll("button")) ?? [];
719
+ (f = Array.from(m).find((O) => O.getAttribute("aria-label") === r)) == null || f.focus();
720
+ }, [
721
+ a,
722
+ r
723
+ ]), /* @__PURE__ */ o.createElement(Te, {
724
+ ref: i,
725
+ className: t,
726
+ "aria-label": s,
727
+ isDisabled: !a || l,
728
+ onPress: () => {
729
+ c.current = !0, n(-1);
730
+ }
731
+ }, e ?? "‹");
732
+ }, dn = ({ children: e, className: t }) => {
733
+ const { changeWeek: n, nextWeekLabel: a } = F(), s = ke();
734
+ return /* @__PURE__ */ o.createElement(Te, {
735
+ className: t,
736
+ "aria-label": a,
737
+ isDisabled: s,
738
+ onPress: () => n(1)
739
+ }, e ?? "›");
740
+ }, fn = ({ children: e, className: t }) => {
741
+ const { weekCaptionLabel: n, weekRangeLabel: a } = F();
742
+ return /* @__PURE__ */ o.createElement("span", {
743
+ className: t,
744
+ "aria-live": "polite"
745
+ }, e ? e({
746
+ label: n,
747
+ weekRange: a
748
+ }) : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("span", {
749
+ "aria-hidden": "true"
750
+ }, n), /* @__PURE__ */ o.createElement("span", {
751
+ style: Ze
752
+ }, a)));
753
+ }, Dn = ({ children: e, className: t, ...n }) => {
754
+ const { day: a } = n;
755
+ return /* @__PURE__ */ o.createElement(yt, {
756
+ id: a.key,
757
+ className: t,
758
+ textValue: a.label,
759
+ "aria-label": a.isAvailable ? `${a.label}, ${a.availabilityLabel}` : a.label,
760
+ "data-available": a.isAvailable || void 0,
761
+ "data-today": a.isToday || void 0
762
+ }, e ? e({
763
+ ...a,
764
+ date: new Date(a.date)
765
+ }) : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("span", null, a.weekdayLabel), /* @__PURE__ */ o.createElement("span", null, a.dayOfMonthLabel)));
766
+ };
767
+ B.PreviousWeek = mn;
768
+ B.Heading = fn;
769
+ B.NextWeek = dn;
770
+ B.Day = Dn;
771
+ const Ke = 'input[type="radio"]', oe = ({ children: e, className: t, ...n }) => {
772
+ const { hasTimezoneNote: a } = n, { slots: s, selectedSlotKey: r, selectSlot: l, selectedDateLabel: i, isReloadingSlots: c, timezoneLabel: d, pendingFocusIndex: m, consumePendingFocusIndex: p } = F(), { id: E, disabled: f, readOnly: O, required: v, hasError: I } = ce(), { inputId: _, labelId: b, ariaDescribedBy: Y } = Ee(), M = X(null), $ = `${_}-slots-label`, U = T(e, oe.Label), se = T(e, oe.Slot) ?? /* @__PURE__ */ o.createElement(oe.Slot, null), G = !!U && !!i, C = [
773
+ Y,
774
+ a && d ? Je(_) : void 0
775
+ ].filter(Boolean).join(" ") || void 0, L = (S) => {
776
+ var k, K, Z;
777
+ (Z = (K = (k = M.current) == null ? void 0 : k.querySelectorAll(Ke)) == null ? void 0 : K[S]) == null || Z.focus();
778
+ };
779
+ return vt(() => {
780
+ var Z, V;
781
+ if (!!((Z = M.current) != null && Z.querySelector(Ke))) {
782
+ L(0);
783
+ return;
784
+ }
785
+ const k = Array.from(((V = document.getElementById(_)) == null ? void 0 : V.querySelectorAll('[role="option"]')) ?? []), K = k.find((w) => w.getAttribute("aria-selected") === "true") ?? k.find((w) => w.getAttribute("aria-disabled") !== "true");
786
+ K == null || K.focus();
787
+ }, E), H(() => {
788
+ m !== void 0 && (L(m), p());
789
+ }, [
790
+ m,
791
+ s.length
792
+ ]), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("div", {
793
+ role: "status",
794
+ style: Ze
795
+ }, s.length > 0 ? i : void 0), /* @__PURE__ */ o.createElement(At, {
796
+ ref: M,
797
+ className: t,
798
+ value: r ?? null,
799
+ onChange: l,
800
+ isDisabled: f,
801
+ isReadOnly: O,
802
+ isRequired: v,
803
+ isInvalid: I,
804
+ "aria-labelledby": G ? $ : b,
805
+ "aria-describedby": C,
806
+ "data-refetch": c || void 0
807
+ }, le(U, {
808
+ labelId: $
809
+ }), s.map((S) => le(se, {
810
+ key: S.key,
811
+ slot: S
812
+ }))));
813
+ }, En = ({ children: e, className: t, ...n }) => {
814
+ const { selectedDateLabel: a } = F(), { labelId: s } = n;
815
+ return a ? /* @__PURE__ */ o.createElement("div", {
816
+ id: s,
817
+ className: t
818
+ }, e ? e({
819
+ label: a
820
+ }) : a) : null;
821
+ }, Sn = ({ children: e, className: t, ...n }) => {
822
+ const { slot: a } = n;
823
+ return /* @__PURE__ */ o.createElement(Nt, {
824
+ value: a.key,
825
+ "aria-label": a.timeRange
826
+ }, /* @__PURE__ */ o.createElement(gt, {
827
+ className: t
828
+ }, e ? e(a) : a.timeRange));
829
+ };
830
+ oe.Label = En;
831
+ oe.Slot = Sn;
832
+ const u = ({ children: e, className: t }) => {
833
+ const n = ce(), { id: a, FieldLayout: s } = n, { labelId: r, inputId: l, ariaDescribedBy: i } = Ee(), c = kt(Rt.APPOINTMENT), d = P(() => ({
834
+ ...n,
835
+ initialData: c,
836
+ inputId: l,
837
+ ariaLabelledBy: r,
838
+ ariaDescribedBy: i,
839
+ fieldId: a
840
+ }), [
841
+ n,
842
+ c,
843
+ l,
844
+ r,
845
+ i,
846
+ a
847
+ ]), m = T(e, u.Label), p = T(e, u.Description), E = T(e, u.Error);
848
+ return /* @__PURE__ */ o.createElement(s, {
849
+ fieldId: a,
850
+ renderLabel: () => le(m, {
851
+ as: "div"
852
+ }),
853
+ renderInput: () => /* @__PURE__ */ o.createElement($t, {
854
+ appointmentFieldProps: d
855
+ }, /* @__PURE__ */ o.createElement(_n, {
856
+ className: t
857
+ }, e)),
858
+ renderDescription: () => /* @__PURE__ */ o.createElement(o.Fragment, null, E, p)
859
+ });
860
+ }, pn = {
861
+ visibility: "hidden"
862
+ }, _n = ({ children: e, className: t }) => {
863
+ const { required: n, onFocus: a, onBlur: s } = ce(), { inputId: r, labelId: l, ariaDescribedBy: i } = Ee(), c = un(), d = T(e, u.Loader), m = T(e, u.Notification), p = T(e, u.Dates), E = T(e, u.Timezone), f = T(e, u.Format), O = T(e, u.Slots), v = T(e, u.ShowMoreSlots);
864
+ return /* @__PURE__ */ o.createElement(Qe.Provider, {
865
+ value: c
866
+ }, /* @__PURE__ */ o.createElement(Ct, {
867
+ id: r,
868
+ className: t,
869
+ ariaLabelledBy: l,
870
+ ariaDescribedBy: i,
871
+ required: n,
872
+ onFocus: a,
873
+ onBlur: s
874
+ }, d, c.hasError ? m : /* @__PURE__ */ o.createElement("div", {
875
+ style: c.isLoading ? pn : void 0
876
+ }, p, E, f, le(O, {
877
+ hasTimezoneNote: !!E
878
+ }), m, v)));
879
+ }, Ln = ({ children: e, className: t }) => {
880
+ const { isLoading: n, isRefetching: a } = F();
881
+ return !n && !a ? null : /* @__PURE__ */ o.createElement("div", {
882
+ className: t,
883
+ role: "status",
884
+ "aria-live": "polite",
885
+ "data-initial": n || void 0,
886
+ "data-refetch": !n && a || void 0
887
+ }, e);
888
+ }, yn = ({ children: e, className: t }) => {
889
+ const { notificationMessage: n } = F();
890
+ return n ? /* @__PURE__ */ o.createElement("div", {
891
+ className: t,
892
+ role: "status"
893
+ }, e ? e({
894
+ message: n
895
+ }) : n) : null;
896
+ }, An = ({ children: e, className: t }) => {
897
+ const { timezoneLabel: n } = F(), { inputId: a } = Ee();
898
+ return n ? /* @__PURE__ */ o.createElement("span", {
899
+ id: Je(a),
900
+ className: t
901
+ }, e ? e({
902
+ label: n
903
+ }) : n) : null;
904
+ }, Nn = ({ children: e, className: t }) => {
905
+ const { formatLabel: n } = F();
906
+ return n ? /* @__PURE__ */ o.createElement("span", {
907
+ className: t
908
+ }, e ? e({
909
+ label: n
910
+ }) : n) : null;
911
+ }, gn = ({ children: e, className: t }) => {
912
+ const { hasMoreSlots: n, showMoreSlots: a, showMoreSlotsLabel: s } = F(), { disabled: r, readOnly: l } = ce();
913
+ return n ? /* @__PURE__ */ o.createElement(Te, {
914
+ className: t,
915
+ isDisabled: !!r || !!l,
916
+ onPress: a
917
+ }, e ? e({
918
+ label: s
919
+ }) : s) : null;
920
+ };
921
+ u.Label = Mt;
922
+ u.Loader = Ln;
923
+ u.Notification = yn;
924
+ u.Dates = B;
925
+ u.Timezone = An;
926
+ u.Format = Nn;
927
+ u.Slots = oe;
928
+ u.ShowMoreSlots = gn;
929
+ u.Description = wt;
930
+ u.Error = Ft;
931
+ const In = "_appointment_14hug_1", On = "_dates_14hug_6", bn = "_weekHeading_14hug_27", Tn = "_weekButton_14hug_36", hn = "_previousWeek_14hug_68", vn = "_nextWeek_14hug_72", kn = "_day_14hug_84", Rn = "_weekdayLabel_14hug_96", wn = "_indicator_14hug_108", Fn = "_hint_14hug_131", Mn = "_slots_14hug_144", Cn = "_slotsLabel_14hug_159", Wn = "_slot_14hug_144", Bn = "_slotHover_14hug_198", Un = "_slotSelected_14hug_206", xn = "_showMoreSlots_14hug_260", Pn = "_loader_14hug_290", zn = "_notification_14hug_326", A = {
932
+ appointment: In,
933
+ dates: On,
934
+ weekHeading: bn,
935
+ weekButton: Tn,
936
+ previousWeek: hn,
937
+ nextWeek: vn,
938
+ day: kn,
939
+ weekdayLabel: Rn,
940
+ indicator: wn,
941
+ hint: Fn,
942
+ slots: Mn,
943
+ slotsLabel: Cn,
944
+ slot: Wn,
945
+ slotHover: Bn,
946
+ slotSelected: Un,
947
+ showMoreSlots: xn,
948
+ loader: Pn,
949
+ notification: zn
950
+ }, Hn = ({ content: e, locale: t }) => /* @__PURE__ */ o.createElement(it, {
951
+ content: e,
952
+ locale: t
953
+ }), Yn = {
954
+ base: A.slot,
955
+ selected: A.slotSelected,
956
+ hover: A.slotHover
957
+ }, Kn = () => {
958
+ const e = _t({
959
+ globalClasses: pt,
960
+ moduleClasses: Yn
961
+ });
962
+ return /* @__PURE__ */ o.createElement(u, {
963
+ className: A.appointment
964
+ }, /* @__PURE__ */ o.createElement(u.Label, {
965
+ className: R(ut, de.label)
966
+ }, /* @__PURE__ */ o.createElement(u.Label.Required, {
967
+ className: R(mt, de.requiredMark)
968
+ })), /* @__PURE__ */ o.createElement(u.Loader, {
969
+ className: A.loader
970
+ }), /* @__PURE__ */ o.createElement(u.Dates, {
971
+ className: R(dt, A.dates)
972
+ }, /* @__PURE__ */ o.createElement(u.Dates.PreviousWeek, {
973
+ className: R(me, A.weekButton, A.previousWeek)
974
+ }, /* @__PURE__ */ o.createElement(Me, null)), /* @__PURE__ */ o.createElement(u.Dates.Heading, {
975
+ className: A.weekHeading
976
+ }), /* @__PURE__ */ o.createElement(u.Dates.NextWeek, {
977
+ className: R(me, A.weekButton, A.nextWeek)
978
+ }, /* @__PURE__ */ o.createElement(Me, null)), /* @__PURE__ */ o.createElement(u.Dates.Day, {
979
+ className: R(me, Ce.day, A.day)
980
+ }, (t) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("span", {
981
+ className: A.weekdayLabel
982
+ }, t.weekdayLabel), /* @__PURE__ */ o.createElement("span", {
983
+ className: Ce.dayNumber
984
+ }, t.dayOfMonthLabel, /* @__PURE__ */ o.createElement("span", {
985
+ className: A.indicator
986
+ }))))), /* @__PURE__ */ o.createElement(u.Timezone, {
987
+ className: R(We, A.hint)
988
+ }), /* @__PURE__ */ o.createElement(u.Format, {
989
+ className: R(We, A.hint)
990
+ }), /* @__PURE__ */ o.createElement(u.Slots, {
991
+ className: A.slots
992
+ }, /* @__PURE__ */ o.createElement(u.Slots.Label, {
993
+ className: R(ft, A.slotsLabel)
994
+ }), /* @__PURE__ */ o.createElement(u.Slots.Slot, {
995
+ className: ({ isSelected: t, isHovered: n, isDisabled: a, isReadOnly: s }) => e({
996
+ isSelected: t,
997
+ isHovered: n && !t && !a && !s
998
+ })
999
+ }, (t) => t.timeRange)), /* @__PURE__ */ o.createElement(u.Notification, {
1000
+ className: A.notification
1001
+ }), /* @__PURE__ */ o.createElement(u.ShowMoreSlots, {
1002
+ className: R(Dt, me, A.showMoreSlots)
1003
+ }), /* @__PURE__ */ o.createElement(u.Error, {
1004
+ className: R(Et, de.error)
1005
+ }, /* @__PURE__ */ o.createElement(lt, null), /* @__PURE__ */ o.createElement(u.Error.Text, null)), /* @__PURE__ */ o.createElement(u.Description, {
1006
+ className: R(St, de.description)
1007
+ }, Hn));
1008
+ }, ca = () => /* @__PURE__ */ o.createElement(Kn, null);
1009
+ export {
1010
+ ca as AppointmentRAC
1011
+ };