@wix/bookings 1.0.1779 → 1.0.1780

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.
@@ -2825,7 +2825,7 @@ function $l({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone:
2825
2825
  (e3 === null || at2.some((t3) => t3.id === e3)) && (tt2(false), $e2(e3), St2 !== null && e3 !== null && !dt2(St2, e3) && (yt2(null), xt2(false)));
2826
2826
  }, [at2, St2, dt2]), Kt2 = !!(i2 && !Te2.isLoading && Te2.displayTimeZonePolicy.customerCanChange && g2 && Fe2 && g2 !== Fe2), H2 = i2 ? Kt2 && t2 && (t2 === g2 || t2 === Fe2) ? t2 : we2 ?? g2 ?? Fe2 : null, qt2 = (0, import_react.useCallback)((e3) => {
2827
2827
  Kt2 && (e3 === g2 || e3 === Fe2) && n2(e3);
2828
- }, [Kt2, g2, Fe2, n2]), Jt2 = (0, import_react.useMemo)(() => i2 && !M2 && xe2 ? Date.now() : void 0, [i2, M2, P2, be2, H2]), Yt2 = Jt2 !== void 0 && H2 ? Ao(new Date(Jt2), H2) : null, { range: Xt2, daysAvailability: Zt2, isLoading: Qt2, hasError: $t2, setRange: en2, nextRange: tn2, previousRange: nn2 } = tl({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: H2, today: Yt2, locationId: B2, staffId: V2, customerChoices: Bt2, minRemainingCapacity: Nt2, loadInitially: d2, onlyAvailableSlots: e2 }), rn2 = fe2?.slice(0, 10) ?? null, an2 = (0, import_react.useMemo)(() => rn2 ? Zt2.map((e3) => e3.date > rn2 ? { ...e3, availability: `none` } : e3) : Zt2, [Zt2, rn2]), on2 = fe2 && H2 ? No(new Date(fe2), H2) : null, { query: U2, selectedDate: sn2, timeSlots: cn2, isLoading: ln2, error: un2, selectDate: dn2, findNextAvailableDate: fn2 } = nl({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: H2, today: Yt2, locationId: B2, staffId: V2, customerChoices: Bt2, minRemainingCapacity: Nt2, onlyAvailableSlots: e2, serviceLoading: M2 }), pn2 = (0, import_react.useRef)(true), mn2 = (0, import_react.useRef)(null);
2828
+ }, [Kt2, g2, Fe2, n2]), Jt2 = (0, import_react.useMemo)(() => i2 && !M2 && xe2 ? Date.now() : void 0, [i2, M2, P2, be2, H2]), Yt2 = Jt2 !== void 0 && H2 ? Ao(new Date(Jt2), H2) : null, { range: Xt2, daysAvailability: Zt2, isLoading: Qt2, hasError: $t2, setRange: en2, nextRange: tn2, previousRange: nn2 } = tl({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: H2, today: Yt2, locationId: B2, staffId: V2, customerChoices: Bt2, minRemainingCapacity: Nt2, loadInitially: d2, onlyAvailableSlots: e2 }), rn2 = fe2?.slice(0, 10) ?? null, an2 = (0, import_react.useMemo)(() => rn2 ? Zt2.map((e3) => e3.date > rn2 ? { ...e3, availability: `none` } : e3) : Zt2, [Zt2, rn2]), on2 = fe2 && H2 ? No(new Date(fe2), H2) : null, { query: U2, selectedDate: sn2, timeSlots: cn2, isLoading: ln2, error: un2, selectDate: dn2, findNextAvailableDate: fn2 } = nl({ enabled: i2, serviceId: P2, serviceType: C2, multiServiceRequest: be2, timeZone: H2, today: Yt2, locationId: B2, staffId: V2, customerChoices: Bt2, minRemainingCapacity: Nt2, onlyAvailableSlots: e2, serviceLoading: M2 || le2 }), pn2 = (0, import_react.useRef)(true), mn2 = (0, import_react.useRef)(null);
2829
2829
  (0, import_react.useEffect)(() => {
2830
2830
  if (pn2.current) {
2831
2831
  pn2.current = false;
@@ -2836,7 +2836,7 @@ function $l({ onlyAvailableSlots: e2, selectedTimeZone: t2, setSelectedTimeZone:
2836
2836
  let hn2 = (0, import_react.useCallback)(async () => {
2837
2837
  let e3 = await fn2();
2838
2838
  return e3.outcome === `found` ? rn2 && e3.date > rn2 ? `none` : (await Promise.all([dn2(e3.date), Xt2 && Wo(e3.date, Xt2) ? Promise.resolve() : en2(Vo(e3.date))]), `found`) : e3.outcome;
2839
- }, [fn2, rn2, dn2, Xt2, en2]), gn2 = !!(i2 && !M2 && xe2 && H2 && Yt2), W2 = i2 && !M2 && !xe2, [_n2, vn2] = (0, import_react.useState)(false), [yn2, bn2] = (0, import_react.useState)(0), xn2 = (0, import_react.useRef)(false), Sn2 = (0, import_react.useRef)([]), Cn2 = (0, import_react.useRef)(0), wn2 = (0, import_react.useCallback)(() => {
2839
+ }, [fn2, rn2, dn2, Xt2, en2]), gn2 = !!(i2 && !M2 && xe2 && H2 && Yt2), W2 = i2 && !M2 && !le2 && !xe2, [_n2, vn2] = (0, import_react.useState)(false), [yn2, bn2] = (0, import_react.useState)(0), xn2 = (0, import_react.useRef)(false), Sn2 = (0, import_react.useRef)([]), Cn2 = (0, import_react.useRef)(0), wn2 = (0, import_react.useCallback)(() => {
2840
2840
  vn2(false);
2841
2841
  let e3 = Sn2.current;
2842
2842
  return Sn2.current = [], e3;