@wix/form-elements 1.98.0 → 1.100.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.
- package/dist/component/{appointment-rac-BKgRKq3j.js → appointment-rac-CP8gfFze.js} +382 -385
- package/dist/component/{bookings-address-rac-C87x19gw.js → bookings-address-rac-CWs0gEUJ.js} +1 -1
- package/dist/component/{bookings-email-rac-f4nuC_pb.js → bookings-email-rac-D-HYHHg-.js} +1 -1
- package/dist/component/{bookings-first-name-rac-BGmuAmbu.js → bookings-first-name-rac-Sk9e2_l9.js} +1 -1
- package/dist/component/{bookings-header-rac-CoyxHljp.js → bookings-header-rac-idz-09i9.js} +1 -1
- package/dist/component/{bookings-last-name-rac-D2mBYwcR.js → bookings-last-name-rac-C4cCmRVy.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-BH2Mi6TR.js → bookings-login-bar-rac-BdVG5M2b.js} +1 -1
- package/dist/component/{bookings-phone-rac-Dz78ybFV.js → bookings-phone-rac-D09RuttH.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-8_h0cOoy.js → bookings-rich-text-rac-Ci26IHTA.js} +1 -1
- package/dist/component/{checkbox-field-rac-CJnegjvL.js → checkbox-field-rac-Blko_wMR.js} +4 -4
- package/dist/component/{checkbox-group-field-headless-CrA7Gx2Y.js → checkbox-group-field-headless-DhV4VwZq.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-DMg75l5Q.js → checkbox-group-field-rac-BtPnVYiW.js} +3 -3
- package/dist/component/{checkbox-group-rac-C9XWlO5D.js → checkbox-group-rac-eyClfhOO.js} +1 -1
- package/dist/component/{checkbox-rac-CrqhH4z9.js → checkbox-rac-I0i6q5tn.js} +1 -1
- package/dist/component/{contacts-address-rac-C2mqTiPg.js → contacts-address-rac-8UPBA_Nx.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-i7_RMona.js → contacts-birthdate-rac-BuMsx4tn.js} +1 -1
- package/dist/component/{contacts-company-rac-7sdIosaG.js → contacts-company-rac-C4GszTsX.js} +1 -1
- package/dist/component/{contacts-email-rac-CrsksJ9G.js → contacts-email-rac-BdNzRUNL.js} +1 -1
- package/dist/component/{contacts-first-name-rac-I5xIYxgD.js → contacts-first-name-rac-D7otJsfF.js} +1 -1
- package/dist/component/{contacts-last-name-rac-DnzJYJh7.js → contacts-last-name-rac-DE2dfvRQ.js} +1 -1
- package/dist/component/{contacts-phone-rac-Cx1jpYmv.js → contacts-phone-rac-C-P4QUzI.js} +1 -1
- package/dist/component/{contacts-position-rac-CxddG_cE.js → contacts-position-rac-CD_mT8at.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-C1nTAhnd.js → contacts-subscribe-rac-CyBwegiP.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-B1lzfrj_.js → contacts-tax-id-rac-BVwa6_pq.js} +1 -1
- package/dist/component/{date-availability-LN33GU7O.js → date-availability-6u7UHGAa.js} +1 -1
- package/dist/component/{date-input-field-rac-zTcw6Mxx.js → date-input-field-rac-Dpb3imSq.js} +98 -101
- package/dist/component/{date-input-rac-NfVbrcoO.js → date-input-rac-CaRUO8qF.js} +1 -1
- package/dist/component/date-picker-field-rac-BuZ2Vdqw.js +311 -0
- package/dist/component/{date-picker-rac-C5iXyKdf.js → date-picker-rac-CQ0HLYC_.js} +1 -1
- package/dist/component/{date-time-input-field-rac-Cp34u7cC.js → date-time-input-field-rac-D-6fSa7K.js} +101 -104
- package/dist/component/{date-time-input-rac-CfFd56Xf.js → date-time-input-rac-DJvGnasb.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BVx7XXwR.js → dext-checkbox-group-rac-4Xv2Yx1Q.js} +2 -2
- package/dist/component/{dext-checkbox-rac-CmUOLx_w.js → dext-checkbox-rac-MUiHjntT.js} +1 -1
- package/dist/component/{dext-date-picker-rac-XDrLGVTQ.js → dext-date-picker-rac-B7V77fPs.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-ZLCq_taK.js → dext-date-time-input-rac-LDrnt4fH.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C74zBq3M.js → dext-dropdown-rac-BP83OElK.js} +1 -1
- package/dist/component/{dext-email-rac-CqS9HcdY.js → dext-email-rac-Bi9qANCo.js} +1 -1
- package/dist/component/{dext-number-input-rac-DszjJDT-.js → dext-number-input-rac-BU4SEily.js} +1 -1
- package/dist/component/{dext-phone-rac-wt7T8hpM.js → dext-phone-rac-D5s8DrCc.js} +1 -1
- package/dist/component/{dext-radio-group-rac-BvRnaWP0.js → dext-radio-group-rac-DaTuyxUL.js} +2 -2
- package/dist/component/{dext-rating-input-rac-D1Lt9M3c.js → dext-rating-input-rac-CfMKqHHZ.js} +1 -1
- package/dist/component/{dext-tags-rac-70YO5CJH.js → dext-tags-rac-CyFzVZFw.js} +2 -2
- package/dist/component/{dext-text-area-rac-CC5RCvWh.js → dext-text-area-rac-D-kfFMUj.js} +1 -1
- package/dist/component/{dext-text-input-rac-s487DzPW.js → dext-text-input-rac-BOFj2FyN.js} +1 -1
- package/dist/component/{dext-url-input-rac-DEKwUh2a.js → dext-url-input-rac-BGPDEwNb.js} +1 -1
- package/dist/component/{donation-rac-C2bCFVHP.js → donation-rac-BMX9KxJP.js} +5 -5
- package/dist/component/{dropdown-field-headless-BMWwkydq.js → dropdown-field-headless-CIXH608w.js} +4 -4
- package/dist/component/{dropdown-field-rac-Cw5Cbpg0.js → dropdown-field-rac-daLrun-E.js} +2 -2
- package/dist/component/{dropdown-rac-CEmlDY3w.js → dropdown-rac-BTYSH3Zy.js} +1 -1
- package/dist/component/{ecom-address-rac-Dv6asnf_.js → ecom-address-rac-BDhiTREn.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-DOwH-Ebd.js → ecom-subscription-checkbox-rac-Dbpa4fFi.js} +2 -2
- package/dist/component/{email-input-field-rac-CeFXPibq.js → email-input-field-rac-BJUszqvR.js} +3 -3
- package/dist/component/{events-repeater-rac-BUk5Qc8n.js → events-repeater-rac-DJrTlOGT.js} +4 -4
- package/dist/component/{events-rsvp-rac-CtFkVzUy.js → events-rsvp-rac-DDASk2XH.js} +2 -2
- package/dist/component/{field-error-headless-B6x_cVEi.js → field-error-headless-DJVkE5yv.js} +1 -1
- package/dist/component/{field-label-headless-BibCD8xx.js → field-label-headless-CyCHxPkd.js} +1 -1
- package/dist/component/{file-upload-rac-BUcktluW.js → file-upload-rac-BOpYihdw.js} +3 -3
- package/dist/component/{fixed-payment-rac-BMSBSo5c.js → fixed-payment-rac-DFi_YPyN.js} +3 -3
- package/dist/component/{form-9WmwgGNc.js → form-CVz1PefD.js} +69 -69
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-CxUuHOic.js → header-field-rac-C2PfSwil.js} +2 -2
- package/dist/component/{header-rac-DejI69X7.js → header-rac-D9YqB-O1.js} +1 -1
- package/dist/component/{image-choice-rac-BjI5a_co.js → image-choice-rac-t_I06vvU.js} +4 -4
- package/dist/component/{index-Dz2hV2_S.js → index-DLjekrTD.js} +4 -4
- package/dist/component/{index-Csso-2QH.js → index-yjAwk9mS.js} +2 -2
- package/dist/component/{isObjectLike-BN_BZMhy.js → isObjectLike-Cgzv4nCC.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CYfphmfr.js → multiline-address-field-rac-Dnjmc0tO.js} +7 -7
- package/dist/component/{multiline-address-rac-Ccujt2bd.js → multiline-address-rac-ByL_NcH7.js} +1 -1
- package/dist/component/{number-input-field-rac-CfnRCRar.js → number-input-field-rac-BPTuhBlo.js} +4 -4
- package/dist/component/{number-input-rac-DnTO9d8P.js → number-input-rac-hLoHm0Ul.js} +1 -1
- package/dist/component/{password-rac-Be_YSb-Q.js → password-rac-DYqRtXl0.js} +4 -4
- package/dist/component/{payment-input-rac-DXUf5iYb.js → payment-input-rac-D9WtGI5n.js} +4 -4
- package/dist/component/{phone-input-field-rac-DYAwLuvJ.js → phone-input-field-rac-D2Emh-lo.js} +6 -6
- package/dist/component/{phone-rac-BlsvDmER.js → phone-rac-B8-6Mw36.js} +1 -1
- package/dist/component/{product-list-rac-DdXwRSc2.js → product-list-rac-B_wLuARQ.js} +4 -4
- package/dist/component/{quiz-radio-group-rac-B0yiKdbu.js → quiz-radio-group-rac-CcnfdObW.js} +1 -1
- package/dist/component/{radio-button-module-classes-t1jsWYpT.js → radio-button-module-classes-CyZYs0BH.js} +3 -3
- package/dist/component/{radio-group-field-rac-Cug1TtSq.js → radio-group-field-rac-BdNA6UOq.js} +3 -3
- package/dist/component/{radio-group-rac-_O5T0Pt8.js → radio-group-rac-CvhHM6v5.js} +1 -1
- package/dist/component/{rating-input-field-rac-BSKzQ3fq.js → rating-input-field-rac-wjWNPfRZ.js} +4 -4
- package/dist/component/{rating-input-rac-B71q44YO.js → rating-input-rac-qqUycDFh.js} +1 -1
- package/dist/component/{rich-content-rac.module-BJuoKIOt.js → rich-content-rac.module-BAMOVeFc.js} +1 -1
- package/dist/component/{rich-text-field-rac-CiSR82Fw.js → rich-text-field-rac-DRC3nap3.js} +2 -2
- package/dist/component/{rich-text-rac-Bo6UBwOg.js → rich-text-rac-DPgt6Zb4.js} +1 -1
- package/dist/component/{service-dropdown-rac-BJ7V-g8M.js → service-dropdown-rac-C79afx6z.js} +4 -4
- package/dist/component/{services-multi-choice-rac-CtBcc9WH.js → services-multi-choice-rac-Dv_3PkqW.js} +5 -5
- package/dist/component/{signature-rac-yvrHr1he.js → signature-rac-D2NLRFu0.js} +3 -3
- package/dist/component/{submit-button-rac-s-JdZgq7.js → submit-button-rac-CnmlHY57.js} +1 -1
- package/dist/component/{tags-field-rac-g_W0RMod.js → tags-field-rac-B5v917df.js} +5 -5
- package/dist/component/{tags-rac-DmvIH6HU.js → tags-rac-DCUcssn5.js} +1 -1
- package/dist/component/{text-area-field-rac-Duja5xOA.js → text-area-field-rac-7YmznS1S.js} +4 -4
- package/dist/component/{text-area-rac-DzRxgG6u.js → text-area-rac-C0Yuh6D2.js} +1 -1
- package/dist/component/{text-input-field-rac-C2eXeoBC.js → text-input-field-rac-Bpmukqyp.js} +2 -2
- package/dist/component/{text-input-headless-d1WK0nqR.js → text-input-headless-Cdpzu_eE.js} +3 -3
- package/dist/component/{text-input-rac-DM9MnoQs.js → text-input-rac-D7zsAary.js} +1 -1
- package/dist/component/{time-input-rac-CxVZ3USX.js → time-input-rac-CDiPbISF.js} +4 -4
- package/dist/component/{url-input-field-rac-4oVJMr1a.js → url-input-field-rac-oi5ViIKm.js} +4 -4
- package/dist/component/{url-input-rac--T-FnskQ.js → url-input-rac-Bs8MYm-g.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-BFHRYpVL.js → use-dropdown-option-class-name-BqtzLp8Y.js} +1 -1
- package/dist/component/{use-element-state-class-name-De5YnxMK.js → use-element-state-class-name-Cego6EXH.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-CWvcd9Ex.js → use-is-forced-open-dropdown-Do-gps07.js} +1 -1
- package/dist/component/{use-service-options-base-CD1EVWRE.js → use-service-options-base-CoXyq3zH.js} +1 -1
- package/dist/component/{use-text-input-class-name-BYwXccvO.js → use-text-input-class-name-BUFPGIgC.js} +2 -2
- package/package.json +2 -2
- package/dist/component/date-picker-field-rac-Cc9hJloJ.js +0 -317
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import o, { useRef as J, useState as j, useEffect as H, createContext as Ge, useContext as Ze, useMemo as P, useCallback as ie } from "react";
|
|
2
2
|
import { RicosViewer as lt } from "@wix/ricos/viewer";
|
|
3
|
-
import
|
|
4
|
-
import { ac as ce, ab as ct, ag as we, af as mt, c as ut, au as dt, at as ft, ak as me, ah as Se, am as Dt, aj as Et, F as St } from "./form-9WmwgGNc.js";
|
|
3
|
+
import w from "classnames";
|
|
5
4
|
import { C as Ce } from "./chevron-down-icon-CcpVm6B-.js";
|
|
6
|
-
import { E as
|
|
7
|
-
import { g as
|
|
8
|
-
import { H as
|
|
9
|
-
import { s as
|
|
10
|
-
import { C as
|
|
11
|
-
import { u as
|
|
12
|
-
import { ListBox as
|
|
5
|
+
import { E as ct } from "./error-icon-hZxQ6DEy.js";
|
|
6
|
+
import { g as ut, c as We } from "./calendar.module-DnhTT4QT.js";
|
|
7
|
+
import { H as de } from "./custom-focus-class-_483Pkwp.js";
|
|
8
|
+
import { s as fe } from "./field-rac.module-DobpyqOd.js";
|
|
9
|
+
import { C as mt, S as dt, a as ft, z as Be, i as Dt, W as Et, r as St, j as pt, a2 as _t } from "./form-element-classes-BtKlobUX.js";
|
|
10
|
+
import { u as Lt } from "./use-element-state-class-name-Cego6EXH.js";
|
|
11
|
+
import { ListBox as yt, Button as he, ListBoxItem as At, RadioGroup as Nt, RadioField as gt, RadioButton as It } from "react-aria-components";
|
|
12
|
+
import { ac as Ee, ab as Ot, ag as ve, af as bt, c as Tt, au as ht, at as vt, ak as ce, ah as Se, am as kt, aj as Rt, F as wt } from "./form-CVz1PefD.js";
|
|
13
13
|
import { f as T, a as le } from "./find-child-C60k4CxG.js";
|
|
14
|
-
import { D as Ft, E as
|
|
15
|
-
import { L as Ct } from "./field-label-headless-
|
|
14
|
+
import { D as Ft, E as Mt } from "./field-error-headless-DJVkE5yv.js";
|
|
15
|
+
import { L as Ct } from "./field-label-headless-CyCHxPkd.js";
|
|
16
16
|
import { F as Wt } from "./fieldset-headless-CD3fds9J.js";
|
|
17
17
|
import "date-fns";
|
|
18
18
|
import { V as Ve } from "./headless-styles-CmcyA_pi.js";
|
|
19
19
|
function Bt(e) {
|
|
20
20
|
return { evid: 40, src: 16, endpoint: "", params: e };
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var Oe = /* @__PURE__ */ (function(e) {
|
|
23
23
|
return e.BOOKING_NOT_INSTALL = "BOOKING_NOT_INSTALL", e.NO_AVAILABILITY_DATES_FOUND = "NO_AVAILABILITY_DATES_FOUND", e.GENERAL = "GENERAL", e;
|
|
24
24
|
})({}), z = /* @__PURE__ */ (function(e) {
|
|
25
25
|
return e.LOADING = "LOADING", e.DONE = "DONE", e.ERROR = "ERROR", e;
|
|
@@ -31,25 +31,25 @@ var Q = /* @__PURE__ */ (function(e) {
|
|
|
31
31
|
return e.LOAD = "load", e.CLICK = "click", e;
|
|
32
32
|
})({});
|
|
33
33
|
const Ut = (e) => {
|
|
34
|
-
var
|
|
34
|
+
var t;
|
|
35
35
|
return {
|
|
36
36
|
bookingsServiceId: e == null ? void 0 : e.id,
|
|
37
|
-
formGuid: (
|
|
37
|
+
formGuid: (t = e == null ? void 0 : e.form) == null ? void 0 : t.id,
|
|
38
38
|
serviceProperties: xt(e)
|
|
39
39
|
};
|
|
40
40
|
}, xt = (e) => {
|
|
41
|
-
var
|
|
41
|
+
var t;
|
|
42
42
|
return JSON.stringify({
|
|
43
43
|
serviceId: e == null ? void 0 : e.id,
|
|
44
44
|
serviceType: e == null ? void 0 : e.type,
|
|
45
|
-
locationIds: (
|
|
45
|
+
locationIds: (t = e == null ? void 0 : e.locations) == null ? void 0 : t.map((n) => n.id).filter((n) => n),
|
|
46
46
|
staffMemberIds: e == null ? void 0 : e.staffMemberIds,
|
|
47
47
|
isOfferedAsPricingPlan: !1
|
|
48
48
|
});
|
|
49
49
|
}, qe = (e) => {
|
|
50
|
-
var
|
|
51
|
-
const { appointmentFieldProps:
|
|
52
|
-
if (!(
|
|
50
|
+
var m;
|
|
51
|
+
const { appointmentFieldProps: t } = ke(), { isEditor: n, isComposer: a } = Ee(), s = Ot(), r = e || ((m = t == null ? void 0 : t.initialData) == null ? void 0 : m.service);
|
|
52
|
+
if (!(n || a))
|
|
53
53
|
return {
|
|
54
54
|
...s,
|
|
55
55
|
report: (i) => s == null ? void 0 : s.report(Bt({
|
|
@@ -58,10 +58,10 @@ const Ut = (e) => {
|
|
|
58
58
|
}))
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
-
var
|
|
61
|
+
var be;
|
|
62
62
|
(function(e) {
|
|
63
63
|
e.UNDEFINED = "UNDEFINED", e.OWNER_BUSINESS = "OWNER_BUSINESS", e.OWNER_CUSTOM = "OWNER_CUSTOM", e.CUSTOM = "CUSTOM";
|
|
64
|
-
})(
|
|
64
|
+
})(be || (be = {}));
|
|
65
65
|
var Ue;
|
|
66
66
|
(function(e) {
|
|
67
67
|
e.UNKNOWN_REQUESTED_GENDER = "UNKNOWN_REQUESTED_GENDER", e.ANY_MALE = "ANY_MALE", e.ANY_FEMALE = "ANY_FEMALE";
|
|
@@ -79,14 +79,14 @@ var ze;
|
|
|
79
79
|
e.ASC = "ASC", e.DESC = "DESC";
|
|
80
80
|
})(ze || (ze = {}));
|
|
81
81
|
const Pt = (e) => {
|
|
82
|
-
const { service:
|
|
83
|
-
return (
|
|
84
|
-
type:
|
|
82
|
+
const { service: t } = e || {};
|
|
83
|
+
return (t == null ? void 0 : t.id) ? null : {
|
|
84
|
+
type: Oe.GENERAL,
|
|
85
85
|
message: "Service ID is missing"
|
|
86
86
|
};
|
|
87
|
-
}, zt = ({ appointmentFieldProps: e, isEditor:
|
|
87
|
+
}, zt = ({ appointmentFieldProps: e, isEditor: t, isComposer: n }) => {
|
|
88
88
|
const { initialData: a } = e, s = Kt();
|
|
89
|
-
if (
|
|
89
|
+
if (t || n)
|
|
90
90
|
return {
|
|
91
91
|
...s,
|
|
92
92
|
timezone: je(),
|
|
@@ -104,36 +104,36 @@ const Pt = (e) => {
|
|
|
104
104
|
...s,
|
|
105
105
|
dataStatus: z.LOADING
|
|
106
106
|
};
|
|
107
|
-
}, Ht = (e,
|
|
108
|
-
const
|
|
107
|
+
}, Ht = (e, t) => {
|
|
108
|
+
const n = /* @__PURE__ */ new Date(), a = new Date(n);
|
|
109
109
|
a.setMonth(a.getMonth() + e);
|
|
110
|
-
const s = new Date(
|
|
111
|
-
timeZone:
|
|
110
|
+
const s = new Date(n.toLocaleString("en-US", {
|
|
111
|
+
timeZone: t
|
|
112
112
|
})), r = new Date(a.toLocaleString("en-US", {
|
|
113
|
-
timeZone:
|
|
113
|
+
timeZone: t
|
|
114
114
|
}));
|
|
115
115
|
return {
|
|
116
116
|
startDate: s,
|
|
117
117
|
endDate: r
|
|
118
118
|
};
|
|
119
119
|
}, je = () => Intl.DateTimeFormat().resolvedOptions().timeZone, Yt = (e) => {
|
|
120
|
-
var
|
|
121
|
-
if ((
|
|
120
|
+
var t, n, a;
|
|
121
|
+
if ((n = (t = e == null ? void 0 : e[0]) == null ? void 0 : t.slot) != null && n.startDate)
|
|
122
122
|
return new Date((a = e[0].slot) == null ? void 0 : a.startDate);
|
|
123
|
-
}, Kt = ({ duration: e = 60, timezone:
|
|
123
|
+
}, Kt = ({ duration: e = 60, timezone: t = "UTC" } = {}) => {
|
|
124
124
|
var E, f;
|
|
125
|
-
const
|
|
126
|
-
let c = /* @__PURE__ */ new Date(`${
|
|
125
|
+
const n = "267d1c11-8019-4e3d-b9c6-cd2b859c69e2", a = /* @__PURE__ */ new Date(), s = [], r = [], m = a.toISOString().split("T")[0], i = 10, l = 18;
|
|
126
|
+
let c = /* @__PURE__ */ new Date(`${m}T${i}:00:00`), d = new Date(c);
|
|
127
127
|
d.setMinutes(d.getMinutes() + e);
|
|
128
128
|
let S = !1;
|
|
129
129
|
for (; d.getHours() < l || d.getHours() === l && d.getMinutes() === 0; ) {
|
|
130
|
-
const
|
|
130
|
+
const b = {
|
|
131
131
|
slot: {
|
|
132
|
-
serviceId:
|
|
132
|
+
serviceId: n,
|
|
133
133
|
startDate: c.toISOString(),
|
|
134
134
|
endDate: d.toISOString(),
|
|
135
135
|
location: {
|
|
136
|
-
locationType:
|
|
136
|
+
locationType: be.CUSTOM
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
139
|
bookable: !0,
|
|
@@ -146,69 +146,69 @@ const Pt = (e) => {
|
|
|
146
146
|
},
|
|
147
147
|
nestedSlots: []
|
|
148
148
|
};
|
|
149
|
-
r.push(
|
|
149
|
+
r.push(b), S || (s.push(b), S = !0), c = new Date(d), d = new Date(c), d.setMinutes(d.getMinutes() + e);
|
|
150
150
|
}
|
|
151
151
|
return {
|
|
152
152
|
availabilitySlots: r,
|
|
153
153
|
availabilityDates: s,
|
|
154
|
-
timezone:
|
|
154
|
+
timezone: t,
|
|
155
155
|
currentSlotBulkSize: V,
|
|
156
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
157
|
};
|
|
158
158
|
};
|
|
159
159
|
function $t(e) {
|
|
160
160
|
var f;
|
|
161
|
-
const { initialData:
|
|
161
|
+
const { initialData: t, onChange: n, value: a } = e, { isEditor: s, isComposer: r } = Ee(), m = (f = t == null ? void 0 : t.service) == null ? void 0 : f.id, { actions: i } = ve(), l = J(i);
|
|
162
162
|
l.current = i;
|
|
163
|
-
const c = !!(i != null && i.getAvailabilityDates && (i != null && i.getAvailabilitySlots)), [d, S] = j(null), E = qe(
|
|
163
|
+
const c = !!(i != null && i.getAvailabilityDates && (i != null && i.getAvailabilitySlots)), [d, S] = j(null), E = qe(t == null ? void 0 : t.service);
|
|
164
164
|
return H(() => {
|
|
165
|
-
|
|
165
|
+
m && !s && !r && c && (async () => {
|
|
166
166
|
var W, A, N, Y, B;
|
|
167
|
-
const
|
|
167
|
+
const h = je(), O = {
|
|
168
168
|
currentSlotBulkSize: V,
|
|
169
|
-
timezone:
|
|
169
|
+
timezone: h,
|
|
170
170
|
dataStatus: z.LOADING
|
|
171
171
|
};
|
|
172
172
|
try {
|
|
173
173
|
const U = async (oe) => {
|
|
174
174
|
var v, p;
|
|
175
|
-
const { startDate: se, endDate: $ } = Ht(oe,
|
|
175
|
+
const { startDate: se, endDate: $ } = Ht(oe, h);
|
|
176
176
|
return (p = (v = l.current) == null ? void 0 : v.getAvailabilityDates) == null ? void 0 : p.call(v, {
|
|
177
|
-
serviceId:
|
|
177
|
+
serviceId: m,
|
|
178
178
|
fromDate: se,
|
|
179
179
|
toDate: $,
|
|
180
|
-
timeZone:
|
|
180
|
+
timeZone: h
|
|
181
181
|
});
|
|
182
182
|
};
|
|
183
|
-
if (
|
|
183
|
+
if (O.availabilityDates = await U(2), (W = O.availabilityDates) != null && W.length || (O.availabilityDates = await U(6)), !((A = O.availabilityDates) != null && A.length)) {
|
|
184
184
|
E == null || E.report({
|
|
185
185
|
action: te.LOAD,
|
|
186
186
|
component: Q.NO_AVAILABILITY_AT_ALL
|
|
187
187
|
}), S({
|
|
188
188
|
dataStatus: z.ERROR,
|
|
189
189
|
error: {
|
|
190
|
-
type:
|
|
190
|
+
type: Oe.NO_AVAILABILITY_DATES_FOUND,
|
|
191
191
|
message: "No availability dates found"
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
|
|
197
|
-
serviceId:
|
|
198
|
-
timeZone:
|
|
199
|
-
selectedDate:
|
|
196
|
+
O.selectedDate = Yt(O.availabilityDates), O.selectedDate && (O.availabilitySlots = await ((Y = (N = l.current) == null ? void 0 : N.getAvailabilitySlots) == null ? void 0 : Y.call(N, {
|
|
197
|
+
serviceId: m,
|
|
198
|
+
timeZone: h,
|
|
199
|
+
selectedDate: O.selectedDate
|
|
200
200
|
}))), E == null || E.report({
|
|
201
201
|
action: te.LOAD,
|
|
202
|
-
component: (B =
|
|
203
|
-
}), a != null && a.startDate ||
|
|
204
|
-
...
|
|
202
|
+
component: (B = O.availabilityDates) != null && B.length ? Q.FORM : Q.NO_AVAILABILITY_FOR_DATE
|
|
203
|
+
}), a != null && a.startDate || n(void 0), S({
|
|
204
|
+
...O,
|
|
205
205
|
dataStatus: z.DONE
|
|
206
206
|
});
|
|
207
207
|
} catch (U) {
|
|
208
208
|
console.error(U), S({
|
|
209
209
|
dataStatus: z.ERROR,
|
|
210
210
|
error: {
|
|
211
|
-
type:
|
|
211
|
+
type: Oe.GENERAL,
|
|
212
212
|
message: "An error occurred in initialAppointmentState"
|
|
213
213
|
}
|
|
214
214
|
});
|
|
@@ -217,7 +217,7 @@ function $t(e) {
|
|
|
217
217
|
}, [
|
|
218
218
|
s,
|
|
219
219
|
r,
|
|
220
|
-
|
|
220
|
+
m,
|
|
221
221
|
c
|
|
222
222
|
]), d;
|
|
223
223
|
}
|
|
@@ -225,19 +225,19 @@ const Qe = /* @__PURE__ */ Ge({
|
|
|
225
225
|
appointmentState: {},
|
|
226
226
|
setAppointmentState: () => {
|
|
227
227
|
}
|
|
228
|
-
}), Gt = ({ appointmentFieldProps: e, children:
|
|
229
|
-
const { isEditor:
|
|
228
|
+
}), Gt = ({ appointmentFieldProps: e, children: t }) => {
|
|
229
|
+
const { isEditor: n, isComposer: a } = Ee(), [s, r] = j(() => zt({
|
|
230
230
|
appointmentFieldProps: e,
|
|
231
|
-
isEditor:
|
|
231
|
+
isEditor: n,
|
|
232
232
|
isComposer: a
|
|
233
|
-
})),
|
|
233
|
+
})), m = $t(e);
|
|
234
234
|
return H(() => {
|
|
235
|
-
|
|
235
|
+
m && r({
|
|
236
236
|
...s,
|
|
237
|
-
...
|
|
237
|
+
...m
|
|
238
238
|
});
|
|
239
239
|
}, [
|
|
240
|
-
|
|
240
|
+
m
|
|
241
241
|
]), /* @__PURE__ */ o.createElement(Qe.Provider, {
|
|
242
242
|
value: {
|
|
243
243
|
appointmentFieldProps: e,
|
|
@@ -247,115 +247,115 @@ const Qe = /* @__PURE__ */ Ge({
|
|
|
247
247
|
...i
|
|
248
248
|
})
|
|
249
249
|
}
|
|
250
|
-
},
|
|
251
|
-
}, ke = () => Ze(Qe), Zt = (e,
|
|
250
|
+
}, t);
|
|
251
|
+
}, ke = () => Ze(Qe), Zt = (e, t) => {
|
|
252
252
|
if (e.startOfWeek.getMonth() === e.endOfWeek.getMonth())
|
|
253
|
-
return new Intl.DateTimeFormat(
|
|
253
|
+
return new Intl.DateTimeFormat(t, {
|
|
254
254
|
month: "long",
|
|
255
255
|
year: "numeric"
|
|
256
256
|
}).format(e.endOfWeek);
|
|
257
|
-
const
|
|
257
|
+
const n = new Intl.DateTimeFormat(t, {
|
|
258
258
|
month: "short"
|
|
259
|
-
}).format(e.startOfWeek), a = new Intl.DateTimeFormat(
|
|
259
|
+
}).format(e.startOfWeek), a = new Intl.DateTimeFormat(t, {
|
|
260
260
|
month: "short",
|
|
261
261
|
year: "numeric"
|
|
262
262
|
}).format(e.endOfWeek);
|
|
263
|
-
return `${
|
|
263
|
+
return `${n} - ${a}`;
|
|
264
264
|
}, Vt = (e) => !(e != null && e.startDate) || !(e != null && e.endDate) || !(e != null && e.timeZone) ? null : {
|
|
265
265
|
startDate: e == null ? void 0 : e.startDate,
|
|
266
266
|
endDate: e == null ? void 0 : e.endDate,
|
|
267
267
|
timeZone: e == null ? void 0 : e.timeZone
|
|
268
|
-
}, He = ({ timezone: e, language:
|
|
268
|
+
}, He = ({ timezone: e, language: t, formatType: n }) => {
|
|
269
269
|
var s;
|
|
270
|
-
return (s = new Intl.DateTimeFormat(
|
|
270
|
+
return (s = new Intl.DateTimeFormat(t, {
|
|
271
271
|
timeZone: e,
|
|
272
|
-
timeZoneName:
|
|
272
|
+
timeZoneName: n === "name" ? "long" : "short"
|
|
273
273
|
}).formatToParts(/* @__PURE__ */ new Date()).find(({ type: r }) => r === "timeZoneName")) == null ? void 0 : s.value;
|
|
274
|
-
}, qt = ({ timezone: e, language:
|
|
275
|
-
const
|
|
274
|
+
}, qt = ({ timezone: e, language: t }) => {
|
|
275
|
+
const n = He({
|
|
276
276
|
timezone: e,
|
|
277
|
-
language:
|
|
277
|
+
language: t,
|
|
278
278
|
formatType: "name"
|
|
279
279
|
}), a = He({
|
|
280
280
|
timezone: e,
|
|
281
|
-
language:
|
|
281
|
+
language: t,
|
|
282
282
|
formatType: "offset"
|
|
283
283
|
});
|
|
284
|
-
return `${
|
|
285
|
-
}, ne = (e,
|
|
286
|
-
const
|
|
287
|
-
|
|
284
|
+
return `${n} (${a})`;
|
|
285
|
+
}, ne = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), jt = (e, t) => {
|
|
286
|
+
const n = new Date(e);
|
|
287
|
+
n.setDate(e.getDate() - t);
|
|
288
288
|
const a = new Date(e);
|
|
289
|
-
return a.setDate(e.getDate() +
|
|
290
|
-
fromDate:
|
|
289
|
+
return a.setDate(e.getDate() + t), {
|
|
290
|
+
fromDate: n,
|
|
291
291
|
toDate: a
|
|
292
292
|
};
|
|
293
293
|
}, Qt = ({ setIsReloadingSlots: e }) => {
|
|
294
|
-
const { appointmentFieldProps:
|
|
294
|
+
const { appointmentFieldProps: t, appointmentState: n, setAppointmentState: a } = ke(), { value: s } = t, { actions: r } = ve();
|
|
295
295
|
H(() => {
|
|
296
296
|
(async () => {
|
|
297
297
|
var i, l;
|
|
298
|
-
if (s != null && s.startDate && (
|
|
298
|
+
if (s != null && s.startDate && (n != null && n.selectedDate) && (n == null ? void 0 : n.dataStatus) === z.DONE && !ne(new Date(s.startDate), n == null ? void 0 : n.selectedDate)) {
|
|
299
299
|
e(!0);
|
|
300
|
-
const d = new Date(s.startDate), { fromDate: S, toDate: E } = jt(d, 8), [f,
|
|
300
|
+
const d = new Date(s.startDate), { fromDate: S, toDate: E } = jt(d, 8), [f, b] = await Promise.all([
|
|
301
301
|
(i = r == null ? void 0 : r.getAvailabilityDates) == null ? void 0 : i.call(r, {
|
|
302
|
-
serviceId:
|
|
303
|
-
timeZone: (
|
|
302
|
+
serviceId: t == null ? void 0 : t.initialData.service.id,
|
|
303
|
+
timeZone: (n == null ? void 0 : n.timezone) || "",
|
|
304
304
|
fromDate: S,
|
|
305
305
|
toDate: E
|
|
306
306
|
}),
|
|
307
307
|
(l = r == null ? void 0 : r.getAvailabilitySlots) == null ? void 0 : l.call(r, {
|
|
308
|
-
serviceId:
|
|
309
|
-
timeZone: (
|
|
308
|
+
serviceId: t == null ? void 0 : t.initialData.service.id,
|
|
309
|
+
timeZone: (n == null ? void 0 : n.timezone) || "",
|
|
310
310
|
selectedDate: d
|
|
311
311
|
})
|
|
312
312
|
]);
|
|
313
313
|
a({
|
|
314
314
|
availabilityDates: f,
|
|
315
315
|
selectedDate: d,
|
|
316
|
-
availabilitySlots:
|
|
316
|
+
availabilitySlots: b
|
|
317
317
|
}), e(!1);
|
|
318
318
|
}
|
|
319
319
|
})();
|
|
320
320
|
}, [
|
|
321
321
|
s,
|
|
322
|
-
|
|
322
|
+
n == null ? void 0 : n.dataStatus
|
|
323
323
|
]);
|
|
324
|
-
}, Jt = (e,
|
|
324
|
+
}, Jt = (e, t) => !e || !t.length ? e : e.filter((n) => {
|
|
325
325
|
var a;
|
|
326
|
-
return !
|
|
327
|
-
}),
|
|
326
|
+
return !t.includes(((a = n == null ? void 0 : n.slot) == null ? void 0 : a.startDate) ?? "");
|
|
327
|
+
}), De = (e) => !(e != null && e.startDate) || !(e != null && e.endDate) ? "" : `${e == null ? void 0 : e.startDate}_${e == null ? void 0 : e.endDate}`, Xt = ({ locale: e, endDate: t, startDate: n, timezone: a }) => {
|
|
328
328
|
const s = {
|
|
329
329
|
hour: "numeric",
|
|
330
330
|
minute: "numeric",
|
|
331
331
|
timeZone: a
|
|
332
|
-
}, r = new Intl.DateTimeFormat(e, s).format(new Date(
|
|
333
|
-
return `${r} - ${
|
|
334
|
-
}, en = ({ selectedDate: e, locale:
|
|
332
|
+
}, r = new Intl.DateTimeFormat(e, s).format(new Date(n)), m = new Intl.DateTimeFormat(e, s).format(new Date(t));
|
|
333
|
+
return `${r} - ${m}`;
|
|
334
|
+
}, en = ({ selectedDate: e, locale: t, timezone: n }) => e ? new Intl.DateTimeFormat(t, {
|
|
335
335
|
weekday: "long",
|
|
336
336
|
month: "short",
|
|
337
337
|
day: "numeric",
|
|
338
|
-
timeZone:
|
|
339
|
-
}).format(e) : "", tn = (e,
|
|
340
|
-
let
|
|
341
|
-
return
|
|
342
|
-
var r,
|
|
343
|
-
|
|
338
|
+
timeZone: n
|
|
339
|
+
}).format(e) : "", tn = (e, t) => {
|
|
340
|
+
let n;
|
|
341
|
+
return t.forEach((a, s) => {
|
|
342
|
+
var r, m;
|
|
343
|
+
De({
|
|
344
344
|
startDate: (r = a == null ? void 0 : a.slot) == null ? void 0 : r.startDate,
|
|
345
|
-
endDate: (
|
|
346
|
-
}) === e && (
|
|
347
|
-
}),
|
|
345
|
+
endDate: (m = a == null ? void 0 : a.slot) == null ? void 0 : m.endDate
|
|
346
|
+
}) === e && (n = s);
|
|
347
|
+
}), n;
|
|
348
348
|
};
|
|
349
349
|
var nn = /* @__PURE__ */ (function(e) {
|
|
350
350
|
return e.OS_LOCATION = "OS_LOCATION", e.CUSTOM_LOCATION = "CUSTOM_LOCATION", e;
|
|
351
351
|
})({});
|
|
352
352
|
const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
353
|
-
var
|
|
354
|
-
return ((
|
|
355
|
-
}, sn = ({ error: e, selectedSlot:
|
|
356
|
-
const { isExperimentEnabled:
|
|
353
|
+
var t;
|
|
354
|
+
return ((t = e == null ? void 0 : e.params) == null ? void 0 : t.reason) === an;
|
|
355
|
+
}, sn = ({ error: e, selectedSlot: t }) => {
|
|
356
|
+
const { isExperimentEnabled: n } = bt(), a = n(Tt.BIF_SLOT_HOLD), [s, r] = j(Ye), m = a && on(e), i = t == null ? void 0 : t.startDate, l = J(!1);
|
|
357
357
|
return H(() => {
|
|
358
|
-
if (!
|
|
358
|
+
if (!m) {
|
|
359
359
|
l.current = !1;
|
|
360
360
|
return;
|
|
361
361
|
}
|
|
@@ -364,42 +364,42 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
364
364
|
i
|
|
365
365
|
]));
|
|
366
366
|
}, [
|
|
367
|
-
|
|
367
|
+
m,
|
|
368
368
|
i
|
|
369
369
|
]), a ? s : Ye;
|
|
370
370
|
}, q = 7, Te = (e) => {
|
|
371
|
-
const
|
|
372
|
-
return
|
|
371
|
+
const t = new Date(e);
|
|
372
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
373
373
|
}, rn = (e) => {
|
|
374
|
-
const n = new Date(e);
|
|
375
|
-
return n.setHours(23, 59, 59, 999), n;
|
|
376
|
-
}, ee = (e, n) => {
|
|
377
374
|
const t = new Date(e);
|
|
378
|
-
return t.
|
|
379
|
-
},
|
|
380
|
-
const
|
|
381
|
-
return
|
|
382
|
-
},
|
|
383
|
-
const a =
|
|
375
|
+
return t.setHours(23, 59, 59, 999), t;
|
|
376
|
+
}, ee = (e, t) => {
|
|
377
|
+
const n = new Date(e);
|
|
378
|
+
return n.setDate(n.getDate() + t), n;
|
|
379
|
+
}, Ke = (e, t) => {
|
|
380
|
+
const n = Te(e), a = (n.getDay() - t + q) % q;
|
|
381
|
+
return ee(n, -a);
|
|
382
|
+
}, ln = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, cn = (e, t, n) => {
|
|
383
|
+
const a = new Intl.DateTimeFormat(n, {
|
|
384
384
|
month: "short",
|
|
385
385
|
day: "numeric"
|
|
386
386
|
});
|
|
387
|
-
return typeof a.formatRange == "function" ? a.formatRange(e,
|
|
388
|
-
},
|
|
387
|
+
return typeof a.formatRange == "function" ? a.formatRange(e, t) : `${a.format(e)} - ${a.format(t)}`;
|
|
388
|
+
}, un = (e, t = []) => t.some((n) => {
|
|
389
389
|
var a;
|
|
390
|
-
return !!((a =
|
|
391
|
-
}),
|
|
392
|
-
var
|
|
393
|
-
const { appointmentFieldProps: e, appointmentState:
|
|
390
|
+
return !!((a = n.slot) != null && a.startDate) && ne(new Date(n.slot.startDate), e);
|
|
391
|
+
}), mn = () => {
|
|
392
|
+
var Me;
|
|
393
|
+
const { appointmentFieldProps: e, appointmentState: t, setAppointmentState: n } = ke(), { language: a, isEditor: s, isComposer: r, isMobile: m } = Ee(), { t: i } = ht(), { actions: l } = ve(), c = qe(), [d, S] = j(!1), [E, f] = j(!1), [b, h] = j(), [O, W] = j();
|
|
394
394
|
Qt({
|
|
395
395
|
setIsReloadingSlots: S
|
|
396
396
|
});
|
|
397
|
-
const { onChange: A, value: N, target: Y, initialData: B, formatDescription: U, locationType: oe, error: se } = e, { availabilityDates: $, availabilitySlots: v, timezone: p = "", selectedDate:
|
|
397
|
+
const { onChange: A, value: N, target: Y, initialData: B, formatDescription: U, locationType: oe, error: se } = e, { availabilityDates: $, availabilitySlots: v, timezone: p = "", selectedDate: _, currentSlotBulkSize: k, dataStatus: G, error: ue } = t, K = (Me = B == null ? void 0 : B.service) == null ? void 0 : Me.id, Z = G === z.LOADING, X = d || E, pe = !!ue, we = sn({
|
|
398
398
|
error: se,
|
|
399
399
|
selectedSlot: N
|
|
400
|
-
}),
|
|
400
|
+
}), L = P(() => Jt(v, we), [
|
|
401
401
|
v,
|
|
402
|
-
|
|
402
|
+
we
|
|
403
403
|
]);
|
|
404
404
|
H(() => {
|
|
405
405
|
A == null || A(Vt(N));
|
|
@@ -407,43 +407,43 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
407
407
|
N == null ? void 0 : N.startDate,
|
|
408
408
|
N == null ? void 0 : N.endDate,
|
|
409
409
|
p
|
|
410
|
-
]),
|
|
411
|
-
const
|
|
412
|
-
v != null && v.length &&
|
|
413
|
-
availabilitySlots: v.filter((
|
|
410
|
+
]), vt((D) => {
|
|
411
|
+
const g = D == null ? void 0 : D[Y];
|
|
412
|
+
v != null && v.length && n({
|
|
413
|
+
availabilitySlots: v.filter((I) => {
|
|
414
414
|
var R;
|
|
415
|
-
return ((R =
|
|
415
|
+
return ((R = I == null ? void 0 : I.slot) == null ? void 0 : R.startDate) !== (g == null ? void 0 : g.startDate);
|
|
416
416
|
})
|
|
417
417
|
});
|
|
418
418
|
}), H(() => {
|
|
419
|
-
if (
|
|
420
|
-
const D = tn(
|
|
421
|
-
D && D + 1 > k &&
|
|
419
|
+
if (L != null && L.length && k) {
|
|
420
|
+
const D = tn(De(N ?? void 0), L);
|
|
421
|
+
D && D + 1 > k && n({
|
|
422
422
|
currentSlotBulkSize: D + 1
|
|
423
423
|
});
|
|
424
|
-
} else !(
|
|
424
|
+
} else !(L != null && L.length) && N && (A == null || A(void 0));
|
|
425
425
|
}, [
|
|
426
426
|
N,
|
|
427
|
-
|
|
427
|
+
L,
|
|
428
428
|
$
|
|
429
429
|
]);
|
|
430
|
-
const _e = P(() =>
|
|
430
|
+
const _e = P(() => ut(a), [
|
|
431
431
|
a
|
|
432
|
-
]), Fe = J(
|
|
432
|
+
]), Fe = J(_);
|
|
433
433
|
H(() => {
|
|
434
434
|
const D = Fe.current;
|
|
435
|
-
Fe.current =
|
|
435
|
+
Fe.current = _, !!_ && (!D || !ne(D, _)) && h(void 0);
|
|
436
436
|
}, [
|
|
437
|
-
|
|
437
|
+
_
|
|
438
438
|
]);
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
|
|
439
|
+
const M = P(() => b ?? Ke(_ ?? /* @__PURE__ */ new Date(), _e), [
|
|
440
|
+
b,
|
|
441
|
+
_,
|
|
442
442
|
_e
|
|
443
443
|
]), et = P(() => {
|
|
444
|
-
const D = Te(/* @__PURE__ */ new Date()),
|
|
445
|
-
weekday:
|
|
446
|
-
}),
|
|
444
|
+
const D = Te(/* @__PURE__ */ new Date()), g = new Intl.DateTimeFormat(a, {
|
|
445
|
+
weekday: m ? "narrow" : "short"
|
|
446
|
+
}), I = new Intl.DateTimeFormat(a, {
|
|
447
447
|
day: "numeric"
|
|
448
448
|
}), R = new Intl.DateTimeFormat(a, {
|
|
449
449
|
weekday: "long",
|
|
@@ -452,46 +452,46 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
452
452
|
});
|
|
453
453
|
return Array.from({
|
|
454
454
|
length: q
|
|
455
|
-
}, (re,
|
|
456
|
-
const x = ee(
|
|
455
|
+
}, (re, ge) => {
|
|
456
|
+
const x = ee(M, ge), Ie = !!_ && ne(x, _), it = Te(x) < D;
|
|
457
457
|
return {
|
|
458
458
|
key: ln(x),
|
|
459
459
|
date: x,
|
|
460
|
-
isSelected:
|
|
461
|
-
isAvailable: !Z && !X && !
|
|
462
|
-
isDisabled: it || X && !
|
|
460
|
+
isSelected: Ie,
|
|
461
|
+
isAvailable: !Z && !X && !Ie && un(x, $),
|
|
462
|
+
isDisabled: it || X && !Ie,
|
|
463
463
|
isToday: ne(x, D),
|
|
464
|
-
dayOfMonthLabel:
|
|
465
|
-
weekdayLabel:
|
|
464
|
+
dayOfMonthLabel: I.format(x),
|
|
465
|
+
weekdayLabel: g.format(x),
|
|
466
466
|
label: R.format(x),
|
|
467
467
|
availabilityLabel: i("form.appointment.accessibility.calendar.has-availability.aria-label")
|
|
468
468
|
};
|
|
469
469
|
});
|
|
470
470
|
}, [
|
|
471
|
-
|
|
472
|
-
|
|
471
|
+
M,
|
|
472
|
+
_,
|
|
473
473
|
$,
|
|
474
474
|
Z,
|
|
475
475
|
X,
|
|
476
476
|
a,
|
|
477
|
-
|
|
477
|
+
m,
|
|
478
478
|
i
|
|
479
|
-
]), Le =
|
|
480
|
-
const { startDate:
|
|
481
|
-
if (!
|
|
479
|
+
]), Le = De(N ?? void 0) || void 0, ye = P(() => Z || d ? [] : (L ?? []).slice(0, k).flatMap((D) => {
|
|
480
|
+
const { startDate: g, endDate: I } = D.slot ?? {};
|
|
481
|
+
if (!g || !I)
|
|
482
482
|
return [];
|
|
483
|
-
const R =
|
|
484
|
-
startDate:
|
|
485
|
-
endDate:
|
|
483
|
+
const R = De({
|
|
484
|
+
startDate: g,
|
|
485
|
+
endDate: I
|
|
486
486
|
});
|
|
487
487
|
return [
|
|
488
488
|
{
|
|
489
489
|
key: R,
|
|
490
|
-
startDate:
|
|
491
|
-
endDate:
|
|
490
|
+
startDate: g,
|
|
491
|
+
endDate: I,
|
|
492
492
|
timeRange: Xt({
|
|
493
|
-
startDate:
|
|
494
|
-
endDate:
|
|
493
|
+
startDate: g,
|
|
494
|
+
endDate: I,
|
|
495
495
|
locale: a,
|
|
496
496
|
timezone: p
|
|
497
497
|
}),
|
|
@@ -499,18 +499,18 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
499
499
|
}
|
|
500
500
|
];
|
|
501
501
|
}), [
|
|
502
|
-
|
|
502
|
+
L,
|
|
503
503
|
k,
|
|
504
504
|
Z,
|
|
505
505
|
d,
|
|
506
506
|
a,
|
|
507
507
|
p,
|
|
508
508
|
Le
|
|
509
|
-
]), Ae = !d && !!(
|
|
509
|
+
]), Ae = !d && !!(L != null && L.length) && (k || V) < L.length, Ne = M > Ke(/* @__PURE__ */ new Date(), _e), tt = ie(
|
|
510
510
|
async (D) => {
|
|
511
|
-
var
|
|
512
|
-
if (!(X ||
|
|
513
|
-
S(!0), A == null || A(void 0),
|
|
511
|
+
var g;
|
|
512
|
+
if (!(X || _ && ne(D, _))) {
|
|
513
|
+
S(!0), A == null || A(void 0), n({
|
|
514
514
|
currentSlotBulkSize: V,
|
|
515
515
|
selectedDate: D,
|
|
516
516
|
availabilitySlots: void 0
|
|
@@ -519,15 +519,15 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
519
519
|
component: Q.DATE
|
|
520
520
|
});
|
|
521
521
|
try {
|
|
522
|
-
const
|
|
522
|
+
const I = await ((g = l == null ? void 0 : l.getAvailabilitySlots) == null ? void 0 : g.call(l, {
|
|
523
523
|
serviceId: K,
|
|
524
524
|
timeZone: p,
|
|
525
525
|
selectedDate: D
|
|
526
526
|
}));
|
|
527
|
-
|
|
527
|
+
n({
|
|
528
528
|
currentSlotBulkSize: V,
|
|
529
529
|
selectedDate: D,
|
|
530
|
-
availabilitySlots:
|
|
530
|
+
availabilitySlots: I
|
|
531
531
|
});
|
|
532
532
|
} catch {
|
|
533
533
|
} finally {
|
|
@@ -538,46 +538,46 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
538
538
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
539
539
|
[
|
|
540
540
|
X,
|
|
541
|
-
|
|
541
|
+
_,
|
|
542
542
|
K,
|
|
543
543
|
p,
|
|
544
544
|
l,
|
|
545
545
|
A,
|
|
546
546
|
c
|
|
547
547
|
]
|
|
548
|
-
),
|
|
548
|
+
), me = J(0), nt = ie(
|
|
549
549
|
async (D) => {
|
|
550
550
|
var re;
|
|
551
551
|
if (D < 0 && !Ne)
|
|
552
552
|
return;
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
553
|
+
const g = M, I = ee(M, D * q);
|
|
554
|
+
if (h(I), s || r)
|
|
555
555
|
return;
|
|
556
|
-
const R = ++
|
|
556
|
+
const R = ++me.current;
|
|
557
557
|
f(!0), c == null || c.report({
|
|
558
558
|
action: te.CLICK,
|
|
559
559
|
component: Q.PAGINATION
|
|
560
560
|
});
|
|
561
561
|
try {
|
|
562
|
-
const
|
|
562
|
+
const ge = await ((re = l == null ? void 0 : l.getAvailabilityDates) == null ? void 0 : re.call(l, {
|
|
563
563
|
serviceId: K,
|
|
564
564
|
timeZone: p,
|
|
565
|
-
fromDate:
|
|
566
|
-
toDate: rn(ee(
|
|
565
|
+
fromDate: I,
|
|
566
|
+
toDate: rn(ee(I, q - 1))
|
|
567
567
|
}));
|
|
568
|
-
R ===
|
|
569
|
-
availabilityDates:
|
|
568
|
+
R === me.current && n({
|
|
569
|
+
availabilityDates: ge
|
|
570
570
|
});
|
|
571
571
|
} catch {
|
|
572
|
-
R ===
|
|
572
|
+
R === me.current && h(g);
|
|
573
573
|
} finally {
|
|
574
|
-
R ===
|
|
574
|
+
R === me.current && f(!1);
|
|
575
575
|
}
|
|
576
576
|
},
|
|
577
577
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
578
578
|
[
|
|
579
579
|
Ne,
|
|
580
|
-
|
|
580
|
+
M,
|
|
581
581
|
s,
|
|
582
582
|
r,
|
|
583
583
|
K,
|
|
@@ -587,17 +587,17 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
587
587
|
]
|
|
588
588
|
), at = ie(
|
|
589
589
|
(D) => {
|
|
590
|
-
const
|
|
591
|
-
if (!
|
|
590
|
+
const g = ye.find((re) => re.key === D);
|
|
591
|
+
if (!g)
|
|
592
592
|
return;
|
|
593
|
-
const { startDate:
|
|
593
|
+
const { startDate: I, endDate: R } = g;
|
|
594
594
|
c == null || c.report({
|
|
595
595
|
action: te.CLICK,
|
|
596
596
|
component: Q.SLOT,
|
|
597
|
-
startTime: new Date(
|
|
597
|
+
startTime: new Date(I).valueOf(),
|
|
598
598
|
endTime: new Date(R).valueOf()
|
|
599
599
|
}), A == null || A({
|
|
600
|
-
startDate:
|
|
600
|
+
startDate: I,
|
|
601
601
|
endDate: R,
|
|
602
602
|
timeZone: p
|
|
603
603
|
});
|
|
@@ -616,7 +616,7 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
616
616
|
c == null || c.report({
|
|
617
617
|
action: te.CLICK,
|
|
618
618
|
component: Q.SHOW_MORE
|
|
619
|
-
}), W(D),
|
|
619
|
+
}), W(D), n({
|
|
620
620
|
currentSlotBulkSize: D + V
|
|
621
621
|
});
|
|
622
622
|
}, [
|
|
@@ -626,13 +626,13 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
626
626
|
]), st = ie(() => W(void 0), []), rt = P(() => {
|
|
627
627
|
if (pe)
|
|
628
628
|
return i("form.appointment.empty-state.notification.text");
|
|
629
|
-
if (!Z && !d && !(
|
|
629
|
+
if (!Z && !d && !(L != null && L.length))
|
|
630
630
|
return i("form.appointment.slots-not-found.text");
|
|
631
631
|
}, [
|
|
632
632
|
pe,
|
|
633
633
|
Z,
|
|
634
634
|
d,
|
|
635
|
-
|
|
635
|
+
L == null ? void 0 : L.length,
|
|
636
636
|
i
|
|
637
637
|
]);
|
|
638
638
|
return {
|
|
@@ -649,13 +649,13 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
649
649
|
isLoading: Z,
|
|
650
650
|
isRefetching: X,
|
|
651
651
|
isReloadingSlots: d,
|
|
652
|
-
weekRangeLabel: cn(
|
|
652
|
+
weekRangeLabel: cn(M, ee(M, q - 1), a),
|
|
653
653
|
weekCaptionLabel: Zt({
|
|
654
|
-
startOfWeek:
|
|
655
|
-
endOfWeek: ee(
|
|
654
|
+
startOfWeek: M,
|
|
655
|
+
endOfWeek: ee(M, q - 1)
|
|
656
656
|
}, a),
|
|
657
657
|
selectedDateLabel: en({
|
|
658
|
-
selectedDate:
|
|
658
|
+
selectedDate: _,
|
|
659
659
|
locale: a,
|
|
660
660
|
timezone: p
|
|
661
661
|
}),
|
|
@@ -668,7 +668,7 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
668
668
|
showMoreSlotsLabel: i("form.appointment.show-more-slots.text"),
|
|
669
669
|
previousWeekLabel: i("form.appointment.accessibility.calendar.previous-week.aria-label"),
|
|
670
670
|
nextWeekLabel: i("form.appointment.accessibility.calendar.next-week.aria-label"),
|
|
671
|
-
pendingFocusIndex:
|
|
671
|
+
pendingFocusIndex: O,
|
|
672
672
|
consumePendingFocusIndex: st
|
|
673
673
|
};
|
|
674
674
|
}, Je = Ge(void 0), Xe = (e) => `${e}-timezone-note`, F = () => {
|
|
@@ -677,37 +677,37 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
677
677
|
throw new Error("Appointment parts must be used inside an <Appointment> component");
|
|
678
678
|
return e;
|
|
679
679
|
}, Re = () => {
|
|
680
|
-
const { disabled: e, readOnly:
|
|
681
|
-
return !!e || !!
|
|
682
|
-
}, C = ({ children: e, className:
|
|
683
|
-
const { days:
|
|
684
|
-
|
|
685
|
-
]), d = Re(), S = P(() =>
|
|
686
|
-
|
|
680
|
+
const { disabled: e, readOnly: t } = ce();
|
|
681
|
+
return !!e || !!t;
|
|
682
|
+
}, C = ({ children: e, className: t }) => {
|
|
683
|
+
const { days: n, selectDate: a, weekRangeLabel: s } = F(), r = T(e, C.PreviousWeek), m = T(e, C.Heading), i = T(e, C.NextWeek), l = T(e, C.Day) ?? /* @__PURE__ */ o.createElement(C.Day, null), c = P(() => n.filter((f) => f.isSelected).map((f) => f.key), [
|
|
684
|
+
n
|
|
685
|
+
]), d = Re(), S = P(() => n.filter((f) => d || f.isDisabled).map((f) => f.key), [
|
|
686
|
+
n,
|
|
687
687
|
d
|
|
688
688
|
]), E = (f) => {
|
|
689
689
|
if (f === "all")
|
|
690
690
|
return;
|
|
691
|
-
const [
|
|
691
|
+
const [b] = [
|
|
692
692
|
...f
|
|
693
|
-
],
|
|
694
|
-
|
|
693
|
+
], h = n.find(({ key: O }) => O === b);
|
|
694
|
+
h && a(h.date);
|
|
695
695
|
};
|
|
696
696
|
return /* @__PURE__ */ o.createElement("div", {
|
|
697
|
-
className:
|
|
698
|
-
}, r,
|
|
697
|
+
className: t
|
|
698
|
+
}, r, m, i, /* @__PURE__ */ o.createElement(yt, {
|
|
699
699
|
"aria-label": s,
|
|
700
700
|
orientation: "horizontal",
|
|
701
701
|
selectionMode: "single",
|
|
702
702
|
selectedKeys: c,
|
|
703
703
|
disabledKeys: S,
|
|
704
704
|
onSelectionChange: E
|
|
705
|
-
},
|
|
705
|
+
}, n.map((f) => le(l, {
|
|
706
706
|
key: f.key,
|
|
707
707
|
day: f
|
|
708
708
|
}))));
|
|
709
|
-
}, dn = ({ children: e, className:
|
|
710
|
-
const { changeWeek:
|
|
709
|
+
}, dn = ({ children: e, className: t }) => {
|
|
710
|
+
const { changeWeek: n, canGoToPreviousWeek: a, previousWeekLabel: s, nextWeekLabel: r } = F(), m = Re(), i = J(null), l = J(!1);
|
|
711
711
|
return H(() => {
|
|
712
712
|
var S, E, f;
|
|
713
713
|
if (a || !l.current)
|
|
@@ -717,45 +717,45 @@ const an = "SLOT_UNAVAILABLE", Ye = [], on = (e) => {
|
|
|
717
717
|
if (c !== document.body && c !== i.current)
|
|
718
718
|
return;
|
|
719
719
|
const d = ((E = (S = i.current) == null ? void 0 : S.closest("fieldset")) == null ? void 0 : E.querySelectorAll("button")) ?? [];
|
|
720
|
-
(f = Array.from(d).find((
|
|
720
|
+
(f = Array.from(d).find((b) => b.getAttribute("aria-label") === r)) == null || f.focus();
|
|
721
721
|
}, [
|
|
722
722
|
a,
|
|
723
723
|
r
|
|
724
|
-
]), /* @__PURE__ */ o.createElement(
|
|
724
|
+
]), /* @__PURE__ */ o.createElement(he, {
|
|
725
725
|
ref: i,
|
|
726
|
-
className:
|
|
726
|
+
className: t,
|
|
727
727
|
"aria-label": s,
|
|
728
|
-
isDisabled: !a ||
|
|
728
|
+
isDisabled: !a || m,
|
|
729
729
|
onPress: () => {
|
|
730
|
-
l.current = !0,
|
|
730
|
+
l.current = !0, n(-1);
|
|
731
731
|
}
|
|
732
732
|
}, e ?? "‹");
|
|
733
|
-
}, fn = ({ children: e, className:
|
|
734
|
-
const { changeWeek:
|
|
735
|
-
return /* @__PURE__ */ o.createElement(
|
|
736
|
-
className:
|
|
733
|
+
}, fn = ({ children: e, className: t }) => {
|
|
734
|
+
const { changeWeek: n, nextWeekLabel: a } = F(), s = Re();
|
|
735
|
+
return /* @__PURE__ */ o.createElement(he, {
|
|
736
|
+
className: t,
|
|
737
737
|
"aria-label": a,
|
|
738
738
|
isDisabled: s,
|
|
739
|
-
onPress: () =>
|
|
739
|
+
onPress: () => n(1)
|
|
740
740
|
}, e ?? "›");
|
|
741
|
-
}, Dn = ({ children: e, className:
|
|
742
|
-
const { weekCaptionLabel:
|
|
741
|
+
}, Dn = ({ children: e, className: t }) => {
|
|
742
|
+
const { weekCaptionLabel: n, weekRangeLabel: a } = F();
|
|
743
743
|
return /* @__PURE__ */ o.createElement("span", {
|
|
744
|
-
className:
|
|
744
|
+
className: t,
|
|
745
745
|
"aria-live": "polite"
|
|
746
746
|
}, e ? e({
|
|
747
|
-
label:
|
|
747
|
+
label: n,
|
|
748
748
|
weekRange: a
|
|
749
749
|
}) : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("span", {
|
|
750
750
|
"aria-hidden": "true"
|
|
751
|
-
},
|
|
751
|
+
}, n), /* @__PURE__ */ o.createElement("span", {
|
|
752
752
|
style: Ve
|
|
753
753
|
}, a)));
|
|
754
|
-
}, En = ({ children: e, className:
|
|
755
|
-
const { day: a } =
|
|
756
|
-
return /* @__PURE__ */ o.createElement(
|
|
754
|
+
}, En = ({ children: e, className: t, ...n }) => {
|
|
755
|
+
const { day: a } = n;
|
|
756
|
+
return /* @__PURE__ */ o.createElement(At, {
|
|
757
757
|
id: a.key,
|
|
758
|
-
className:
|
|
758
|
+
className: t,
|
|
759
759
|
textValue: a.label,
|
|
760
760
|
"aria-label": a.isAvailable ? `${a.label}, ${a.availabilityLabel}` : a.label,
|
|
761
761
|
"data-available": a.isAvailable || void 0,
|
|
@@ -769,21 +769,21 @@ C.PreviousWeek = dn;
|
|
|
769
769
|
C.Heading = Dn;
|
|
770
770
|
C.NextWeek = fn;
|
|
771
771
|
C.Day = En;
|
|
772
|
-
const $e = 'input[type="radio"]', ae = ({ children: e, className:
|
|
773
|
-
const { hasTimezoneNote: a } =
|
|
772
|
+
const $e = 'input[type="radio"]', ae = ({ children: e, className: t, ...n }) => {
|
|
773
|
+
const { hasTimezoneNote: a } = n, { slots: s, selectedSlotKey: r, selectSlot: m, selectedDateLabel: i, isReloadingSlots: l, timezoneLabel: c, pendingFocusIndex: d, consumePendingFocusIndex: S } = F(), { id: E, disabled: f, readOnly: b, required: h, hasError: O } = ce(), { inputId: W, labelId: A, ariaDescribedBy: N } = Se(), Y = J(null), B = `${W}-slots-label`, U = T(e, ae.Label), oe = T(e, ae.Slot) ?? /* @__PURE__ */ o.createElement(ae.Slot, null), se = !!U && !!i, $ = [
|
|
774
774
|
N,
|
|
775
775
|
a && c ? Xe(W) : void 0
|
|
776
776
|
].filter(Boolean).join(" ") || void 0, v = (p) => {
|
|
777
|
-
var
|
|
778
|
-
(G = (k = (
|
|
777
|
+
var _, k, G;
|
|
778
|
+
(G = (k = (_ = Y.current) == null ? void 0 : _.querySelectorAll($e)) == null ? void 0 : k[p]) == null || G.focus();
|
|
779
779
|
};
|
|
780
|
-
return
|
|
780
|
+
return kt(() => {
|
|
781
781
|
var G, ue;
|
|
782
782
|
if (!!((G = Y.current) != null && G.querySelector($e))) {
|
|
783
783
|
v(0);
|
|
784
784
|
return;
|
|
785
785
|
}
|
|
786
|
-
const
|
|
786
|
+
const _ = Array.from(((ue = document.getElementById(W)) == null ? void 0 : ue.querySelectorAll('[role="option"]')) ?? []), k = _.find((K) => K.getAttribute("aria-selected") === "true") ?? _.find((K) => K.getAttribute("aria-disabled") !== "true");
|
|
787
787
|
k == null || k.focus();
|
|
788
788
|
}, E), H(() => {
|
|
789
789
|
d !== void 0 && (v(d), S());
|
|
@@ -793,15 +793,15 @@ const $e = 'input[type="radio"]', ae = ({ children: e, className: n, ...t }) =>
|
|
|
793
793
|
]), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("div", {
|
|
794
794
|
role: "status",
|
|
795
795
|
style: Ve
|
|
796
|
-
}, s.length > 0 ? i : void 0), /* @__PURE__ */ o.createElement(
|
|
796
|
+
}, s.length > 0 ? i : void 0), /* @__PURE__ */ o.createElement(Nt, {
|
|
797
797
|
ref: Y,
|
|
798
|
-
className:
|
|
798
|
+
className: t,
|
|
799
799
|
value: r ?? null,
|
|
800
|
-
onChange:
|
|
800
|
+
onChange: m,
|
|
801
801
|
isDisabled: f,
|
|
802
|
-
isReadOnly:
|
|
803
|
-
isRequired:
|
|
804
|
-
isInvalid:
|
|
802
|
+
isReadOnly: b,
|
|
803
|
+
isRequired: h,
|
|
804
|
+
isInvalid: O,
|
|
805
805
|
"aria-labelledby": se ? B : A,
|
|
806
806
|
"aria-describedby": $,
|
|
807
807
|
"data-refetch": l || void 0
|
|
@@ -811,41 +811,41 @@ const $e = 'input[type="radio"]', ae = ({ children: e, className: n, ...t }) =>
|
|
|
811
811
|
key: p.key,
|
|
812
812
|
slot: p
|
|
813
813
|
}))));
|
|
814
|
-
}, Sn = ({ children: e, className:
|
|
815
|
-
const { selectedDateLabel: a } = F(), { labelId: s } =
|
|
814
|
+
}, Sn = ({ children: e, className: t, ...n }) => {
|
|
815
|
+
const { selectedDateLabel: a } = F(), { labelId: s } = n;
|
|
816
816
|
return a ? /* @__PURE__ */ o.createElement("div", {
|
|
817
817
|
id: s,
|
|
818
|
-
className:
|
|
818
|
+
className: t
|
|
819
819
|
}, e ? e({
|
|
820
820
|
label: a
|
|
821
821
|
}) : a) : null;
|
|
822
|
-
}, pn = ({ children: e, className:
|
|
823
|
-
const { slot: a } =
|
|
824
|
-
return /* @__PURE__ */ o.createElement(
|
|
822
|
+
}, pn = ({ children: e, className: t, ...n }) => {
|
|
823
|
+
const { slot: a } = n;
|
|
824
|
+
return /* @__PURE__ */ o.createElement(gt, {
|
|
825
825
|
value: a.key,
|
|
826
826
|
"aria-label": a.timeRange
|
|
827
|
-
}, /* @__PURE__ */ o.createElement(
|
|
828
|
-
className:
|
|
827
|
+
}, /* @__PURE__ */ o.createElement(It, {
|
|
828
|
+
className: t
|
|
829
829
|
}, e ? e(a) : a.timeRange));
|
|
830
830
|
};
|
|
831
831
|
ae.Label = Sn;
|
|
832
832
|
ae.Slot = pn;
|
|
833
|
-
const
|
|
834
|
-
const
|
|
835
|
-
...
|
|
833
|
+
const u = ({ children: e, className: t }) => {
|
|
834
|
+
const n = ce(), { id: a, FieldLayout: s } = n, { labelId: r, inputId: m, ariaDescribedBy: i } = Se(), l = Rt(wt.APPOINTMENT), c = P(() => ({
|
|
835
|
+
...n,
|
|
836
836
|
initialData: l,
|
|
837
|
-
inputId:
|
|
837
|
+
inputId: m,
|
|
838
838
|
ariaLabelledBy: r,
|
|
839
839
|
ariaDescribedBy: i,
|
|
840
840
|
fieldId: a
|
|
841
841
|
}), [
|
|
842
|
-
|
|
842
|
+
n,
|
|
843
843
|
l,
|
|
844
|
-
|
|
844
|
+
m,
|
|
845
845
|
r,
|
|
846
846
|
i,
|
|
847
847
|
a
|
|
848
|
-
]), d = T(e,
|
|
848
|
+
]), d = T(e, u.Label), S = T(e, u.Description), E = T(e, u.Error);
|
|
849
849
|
return /* @__PURE__ */ o.createElement(s, {
|
|
850
850
|
fieldId: a,
|
|
851
851
|
renderLabel: () => le(d, {
|
|
@@ -854,162 +854,159 @@ const m = ({ children: e, className: n }) => {
|
|
|
854
854
|
renderInput: () => /* @__PURE__ */ o.createElement(Gt, {
|
|
855
855
|
appointmentFieldProps: c
|
|
856
856
|
}, /* @__PURE__ */ o.createElement(Ln, {
|
|
857
|
-
className:
|
|
857
|
+
className: t
|
|
858
858
|
}, e)),
|
|
859
859
|
renderDescription: () => /* @__PURE__ */ o.createElement(o.Fragment, null, E, S)
|
|
860
860
|
});
|
|
861
861
|
}, _n = {
|
|
862
862
|
visibility: "hidden"
|
|
863
|
-
}, Ln = ({ children: e, className:
|
|
864
|
-
const { required:
|
|
863
|
+
}, Ln = ({ children: e, className: t }) => {
|
|
864
|
+
const { required: n, onFocus: a, onBlur: s } = ce(), { inputId: r, labelId: m, ariaDescribedBy: i } = Se(), l = mn(), c = T(e, u.Loader), d = T(e, u.Notification), S = T(e, u.Dates), E = T(e, u.Timezone), f = T(e, u.Format), b = T(e, u.Slots), h = T(e, u.ShowMoreSlots);
|
|
865
865
|
return /* @__PURE__ */ o.createElement(Je.Provider, {
|
|
866
866
|
value: l
|
|
867
867
|
}, /* @__PURE__ */ o.createElement(Wt, {
|
|
868
868
|
id: r,
|
|
869
|
-
className:
|
|
870
|
-
ariaLabelledBy:
|
|
869
|
+
className: t,
|
|
870
|
+
ariaLabelledBy: m,
|
|
871
871
|
ariaDescribedBy: i,
|
|
872
|
-
required:
|
|
872
|
+
required: n,
|
|
873
873
|
onFocus: a,
|
|
874
874
|
onBlur: s
|
|
875
875
|
}, c, l.hasError ? d : /* @__PURE__ */ o.createElement("div", {
|
|
876
876
|
style: l.isLoading ? _n : void 0
|
|
877
|
-
}, S, E, f, le(
|
|
877
|
+
}, S, E, f, le(b, {
|
|
878
878
|
hasTimezoneNote: !!E
|
|
879
|
-
}), d,
|
|
880
|
-
}, yn = ({ children: e, className:
|
|
881
|
-
const { isLoading:
|
|
882
|
-
return !
|
|
883
|
-
className:
|
|
879
|
+
}), d, h)));
|
|
880
|
+
}, yn = ({ children: e, className: t }) => {
|
|
881
|
+
const { isLoading: n, isRefetching: a } = F();
|
|
882
|
+
return !n && !a ? null : /* @__PURE__ */ o.createElement("div", {
|
|
883
|
+
className: t,
|
|
884
884
|
role: "status",
|
|
885
885
|
"aria-live": "polite",
|
|
886
|
-
"data-initial":
|
|
887
|
-
"data-refetch": !
|
|
886
|
+
"data-initial": n || void 0,
|
|
887
|
+
"data-refetch": !n && a || void 0
|
|
888
888
|
}, e);
|
|
889
|
-
}, An = ({ children: e, className:
|
|
890
|
-
const { notificationMessage:
|
|
891
|
-
return
|
|
892
|
-
className:
|
|
889
|
+
}, An = ({ children: e, className: t }) => {
|
|
890
|
+
const { notificationMessage: n } = F();
|
|
891
|
+
return n ? /* @__PURE__ */ o.createElement("div", {
|
|
892
|
+
className: t,
|
|
893
893
|
role: "status"
|
|
894
894
|
}, e ? e({
|
|
895
|
-
message:
|
|
896
|
-
}) :
|
|
897
|
-
}, Nn = ({ children: e, className:
|
|
898
|
-
const { timezoneLabel:
|
|
899
|
-
return
|
|
895
|
+
message: n
|
|
896
|
+
}) : n) : null;
|
|
897
|
+
}, Nn = ({ children: e, className: t }) => {
|
|
898
|
+
const { timezoneLabel: n } = F(), { inputId: a } = Se();
|
|
899
|
+
return n ? /* @__PURE__ */ o.createElement("span", {
|
|
900
900
|
id: Xe(a),
|
|
901
|
-
className:
|
|
901
|
+
className: t
|
|
902
902
|
}, e ? e({
|
|
903
|
-
label:
|
|
904
|
-
}) :
|
|
905
|
-
},
|
|
906
|
-
const { formatLabel:
|
|
907
|
-
return
|
|
908
|
-
className:
|
|
903
|
+
label: n
|
|
904
|
+
}) : n) : null;
|
|
905
|
+
}, gn = ({ children: e, className: t }) => {
|
|
906
|
+
const { formatLabel: n } = F();
|
|
907
|
+
return n ? /* @__PURE__ */ o.createElement("span", {
|
|
908
|
+
className: t
|
|
909
909
|
}, e ? e({
|
|
910
|
-
label:
|
|
911
|
-
}) :
|
|
912
|
-
},
|
|
913
|
-
const { hasMoreSlots:
|
|
914
|
-
return
|
|
915
|
-
className:
|
|
916
|
-
isDisabled: !!r || !!
|
|
910
|
+
label: n
|
|
911
|
+
}) : n) : null;
|
|
912
|
+
}, In = ({ children: e, className: t }) => {
|
|
913
|
+
const { hasMoreSlots: n, showMoreSlots: a, showMoreSlotsLabel: s } = F(), { disabled: r, readOnly: m } = ce();
|
|
914
|
+
return n ? /* @__PURE__ */ o.createElement(he, {
|
|
915
|
+
className: t,
|
|
916
|
+
isDisabled: !!r || !!m,
|
|
917
917
|
onPress: a
|
|
918
918
|
}, e ? e({
|
|
919
919
|
label: s
|
|
920
920
|
}) : s) : null;
|
|
921
921
|
};
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
const
|
|
933
|
-
appointment:
|
|
934
|
-
dates:
|
|
922
|
+
u.Label = Ct;
|
|
923
|
+
u.Loader = yn;
|
|
924
|
+
u.Notification = An;
|
|
925
|
+
u.Dates = C;
|
|
926
|
+
u.Timezone = Nn;
|
|
927
|
+
u.Format = gn;
|
|
928
|
+
u.Slots = ae;
|
|
929
|
+
u.ShowMoreSlots = In;
|
|
930
|
+
u.Description = Ft;
|
|
931
|
+
u.Error = Mt;
|
|
932
|
+
const On = "_appointment_14hug_1", bn = "_dates_14hug_6", Tn = "_weekHeading_14hug_27", hn = "_weekButton_14hug_36", vn = "_previousWeek_14hug_68", kn = "_nextWeek_14hug_72", Rn = "_day_14hug_84", wn = "_weekdayLabel_14hug_96", Fn = "_indicator_14hug_108", Mn = "_hint_14hug_131", Cn = "_slots_14hug_144", Wn = "_slotsLabel_14hug_159", Bn = "_slot_14hug_144", Un = "_slotHover_14hug_198", xn = "_slotSelected_14hug_206", Pn = "_showMoreSlots_14hug_260", zn = "_loader_14hug_290", Hn = "_notification_14hug_326", y = {
|
|
933
|
+
appointment: On,
|
|
934
|
+
dates: bn,
|
|
935
935
|
weekHeading: Tn,
|
|
936
|
-
weekButton:
|
|
936
|
+
weekButton: hn,
|
|
937
937
|
previousWeek: vn,
|
|
938
938
|
nextWeek: kn,
|
|
939
939
|
day: Rn,
|
|
940
|
-
weekdayLabel:
|
|
940
|
+
weekdayLabel: wn,
|
|
941
941
|
indicator: Fn,
|
|
942
|
-
hint:
|
|
942
|
+
hint: Mn,
|
|
943
943
|
slots: Cn,
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
}, Kn = ({ content: e, locale: n }) => /* @__PURE__ */ o.createElement(lt, {
|
|
944
|
+
slotsLabel: Wn,
|
|
945
|
+
slot: Bn,
|
|
946
|
+
slotHover: Un,
|
|
947
|
+
slotSelected: xn,
|
|
948
|
+
showMoreSlots: Pn,
|
|
949
|
+
loader: zn,
|
|
950
|
+
notification: Hn
|
|
951
|
+
}, Yn = ({ content: e, locale: t }) => /* @__PURE__ */ o.createElement(lt, {
|
|
953
952
|
content: e,
|
|
954
|
-
locale:
|
|
955
|
-
}),
|
|
956
|
-
base:
|
|
957
|
-
selected:
|
|
958
|
-
hover:
|
|
959
|
-
},
|
|
960
|
-
const
|
|
961
|
-
globalClasses:
|
|
962
|
-
moduleClasses:
|
|
953
|
+
locale: t
|
|
954
|
+
}), Kn = {
|
|
955
|
+
base: y.slot,
|
|
956
|
+
selected: y.slotSelected,
|
|
957
|
+
hover: y.slotHover
|
|
958
|
+
}, $n = () => {
|
|
959
|
+
const e = Lt({
|
|
960
|
+
globalClasses: _t,
|
|
961
|
+
moduleClasses: Kn
|
|
963
962
|
});
|
|
964
|
-
return /* @__PURE__ */ o.createElement(
|
|
965
|
-
className:
|
|
966
|
-
}, /* @__PURE__ */ o.createElement(
|
|
967
|
-
className:
|
|
968
|
-
}, /* @__PURE__ */ o.createElement(
|
|
969
|
-
className:
|
|
970
|
-
})), /* @__PURE__ */ o.createElement(
|
|
971
|
-
className:
|
|
972
|
-
}), /* @__PURE__ */ o.createElement(
|
|
973
|
-
className:
|
|
974
|
-
}, /* @__PURE__ */ o.createElement(
|
|
975
|
-
className:
|
|
976
|
-
}, /* @__PURE__ */ o.createElement(Ce, null)), /* @__PURE__ */ o.createElement(
|
|
977
|
-
className:
|
|
978
|
-
}), /* @__PURE__ */ o.createElement(
|
|
979
|
-
className:
|
|
980
|
-
}, /* @__PURE__ */ o.createElement(Ce, null)), /* @__PURE__ */ o.createElement(
|
|
981
|
-
className:
|
|
963
|
+
return /* @__PURE__ */ o.createElement(u, {
|
|
964
|
+
className: y.appointment
|
|
965
|
+
}, /* @__PURE__ */ o.createElement(u.Label, {
|
|
966
|
+
className: w(mt, fe.label)
|
|
967
|
+
}, /* @__PURE__ */ o.createElement(u.Label.Required, {
|
|
968
|
+
className: w(dt, fe.requiredMark)
|
|
969
|
+
})), /* @__PURE__ */ o.createElement(u.Loader, {
|
|
970
|
+
className: y.loader
|
|
971
|
+
}), /* @__PURE__ */ o.createElement(u.Dates, {
|
|
972
|
+
className: w(ft, y.dates)
|
|
973
|
+
}, /* @__PURE__ */ o.createElement(u.Dates.PreviousWeek, {
|
|
974
|
+
className: w(de, y.weekButton, y.previousWeek)
|
|
975
|
+
}, /* @__PURE__ */ o.createElement(Ce, null)), /* @__PURE__ */ o.createElement(u.Dates.Heading, {
|
|
976
|
+
className: y.weekHeading
|
|
977
|
+
}), /* @__PURE__ */ o.createElement(u.Dates.NextWeek, {
|
|
978
|
+
className: w(de, y.weekButton, y.nextWeek)
|
|
979
|
+
}, /* @__PURE__ */ o.createElement(Ce, null)), /* @__PURE__ */ o.createElement(u.Dates.Day, {
|
|
980
|
+
className: w(de, We.day, y.day)
|
|
982
981
|
}, (t) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("span", {
|
|
983
|
-
className:
|
|
982
|
+
className: y.weekdayLabel
|
|
984
983
|
}, t.weekdayLabel), /* @__PURE__ */ o.createElement("span", {
|
|
985
984
|
className: We.dayNumber
|
|
986
985
|
}, t.dayOfMonthLabel, /* @__PURE__ */ o.createElement("span", {
|
|
987
|
-
className:
|
|
988
|
-
}))))), /* @__PURE__ */ o.createElement(
|
|
989
|
-
className:
|
|
990
|
-
}), /* @__PURE__ */ o.createElement(
|
|
991
|
-
className:
|
|
992
|
-
}), /* @__PURE__ */ o.createElement(
|
|
993
|
-
className:
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
}, /* @__PURE__ */ o.createElement(
|
|
997
|
-
className:
|
|
998
|
-
}), /* @__PURE__ */ o.createElement(m.Slots.Slot, {
|
|
999
|
-
className: ({ isSelected: t, isHovered: a, isDisabled: s, isReadOnly: r }) => n({
|
|
986
|
+
className: y.indicator
|
|
987
|
+
}))))), /* @__PURE__ */ o.createElement(u.Timezone, {
|
|
988
|
+
className: w(Be, y.hint)
|
|
989
|
+
}), /* @__PURE__ */ o.createElement(u.Format, {
|
|
990
|
+
className: w(Be, y.hint)
|
|
991
|
+
}), /* @__PURE__ */ o.createElement(u.Slots, {
|
|
992
|
+
className: y.slots
|
|
993
|
+
}, /* @__PURE__ */ o.createElement(u.Slots.Label, {
|
|
994
|
+
className: w(Dt, y.slotsLabel)
|
|
995
|
+
}), /* @__PURE__ */ o.createElement(u.Slots.Slot, {
|
|
996
|
+
className: ({ isSelected: t, isHovered: n, isDisabled: a, isReadOnly: s }) => e({
|
|
1000
997
|
isSelected: t,
|
|
1001
|
-
isHovered:
|
|
998
|
+
isHovered: n && !t && !a && !s
|
|
1002
999
|
})
|
|
1003
|
-
}, (t) => t.timeRange)), /* @__PURE__ */ o.createElement(
|
|
1004
|
-
className:
|
|
1005
|
-
}), /* @__PURE__ */ o.createElement(
|
|
1006
|
-
className:
|
|
1007
|
-
}), /* @__PURE__ */ o.createElement(
|
|
1008
|
-
className:
|
|
1009
|
-
}, /* @__PURE__ */ o.createElement(
|
|
1010
|
-
className:
|
|
1011
|
-
},
|
|
1012
|
-
}, ua = () => /* @__PURE__ */ o.createElement(
|
|
1000
|
+
}, (t) => t.timeRange)), /* @__PURE__ */ o.createElement(u.Notification, {
|
|
1001
|
+
className: y.notification
|
|
1002
|
+
}), /* @__PURE__ */ o.createElement(u.ShowMoreSlots, {
|
|
1003
|
+
className: w(Et, de, y.showMoreSlots)
|
|
1004
|
+
}), /* @__PURE__ */ o.createElement(u.Error, {
|
|
1005
|
+
className: w(St, fe.error)
|
|
1006
|
+
}, /* @__PURE__ */ o.createElement(ct, null), /* @__PURE__ */ o.createElement(u.Error.Text, null)), /* @__PURE__ */ o.createElement(u.Description, {
|
|
1007
|
+
className: w(pt, fe.description)
|
|
1008
|
+
}, Yn));
|
|
1009
|
+
}, ua = () => /* @__PURE__ */ o.createElement($n, null);
|
|
1013
1010
|
export {
|
|
1014
1011
|
ua as AppointmentRAC
|
|
1015
1012
|
};
|