@wix/bookings 1.0.1795 → 1.0.1797

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 (71) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +3 -37
  2. package/build/cjs/context-booking-checkout.js +1350 -1340
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-categories.d.ts +1 -3
  5. package/build/cjs/context-categories.js +20 -43
  6. package/build/cjs/context-categories.js.map +1 -1
  7. package/build/cjs/context-locations.d.ts +1 -1
  8. package/build/cjs/context-locations.js +20 -43
  9. package/build/cjs/context-locations.js.map +1 -1
  10. package/build/cjs/context-service-addons.d.ts +1 -15
  11. package/build/cjs/context-service-addons.js +20 -43
  12. package/build/cjs/context-service-addons.js.map +1 -1
  13. package/build/cjs/context-service.d.ts +1 -65
  14. package/build/cjs/context-service.js +363 -386
  15. package/build/cjs/context-service.js.map +1 -1
  16. package/build/cjs/context-services.d.ts +1 -23
  17. package/build/cjs/context-services.js +542 -566
  18. package/build/cjs/context-services.js.map +1 -1
  19. package/build/cjs/context-time-slots.d.ts +1 -21
  20. package/build/cjs/context-time-slots.js +588 -615
  21. package/build/cjs/context-time-slots.js.map +1 -1
  22. package/build/es/context-booking-checkout.d.mts +3 -37
  23. package/build/es/context-booking-checkout.mjs +1350 -1340
  24. package/build/es/context-booking-checkout.mjs.map +1 -1
  25. package/build/es/context-categories.d.mts +1 -3
  26. package/build/es/context-categories.mjs +20 -43
  27. package/build/es/context-categories.mjs.map +1 -1
  28. package/build/es/context-locations.d.mts +1 -1
  29. package/build/es/context-locations.mjs +20 -43
  30. package/build/es/context-locations.mjs.map +1 -1
  31. package/build/es/context-service-addons.d.mts +1 -15
  32. package/build/es/context-service-addons.mjs +20 -43
  33. package/build/es/context-service-addons.mjs.map +1 -1
  34. package/build/es/context-service.d.mts +1 -65
  35. package/build/es/context-service.mjs +363 -386
  36. package/build/es/context-service.mjs.map +1 -1
  37. package/build/es/context-services.d.mts +1 -23
  38. package/build/es/context-services.mjs +542 -566
  39. package/build/es/context-services.mjs.map +1 -1
  40. package/build/es/context-time-slots.d.mts +1 -21
  41. package/build/es/context-time-slots.mjs +588 -615
  42. package/build/es/context-time-slots.mjs.map +1 -1
  43. package/build/internal/cjs/context-booking-checkout.d.ts +3 -37
  44. package/build/internal/cjs/context-categories.d.ts +1 -3
  45. package/build/internal/cjs/context-locations.d.ts +1 -1
  46. package/build/internal/cjs/context-service-addons.d.ts +1 -15
  47. package/build/internal/cjs/context-service.d.ts +1 -65
  48. package/build/internal/cjs/context-services.d.ts +1 -23
  49. package/build/internal/cjs/context-time-slots.d.ts +1 -21
  50. package/build/internal/es/context-booking-checkout.d.mts +3 -37
  51. package/build/internal/es/context-categories.d.mts +1 -3
  52. package/build/internal/es/context-locations.d.mts +1 -1
  53. package/build/internal/es/context-service-addons.d.mts +1 -15
  54. package/build/internal/es/context-service.d.mts +1 -65
  55. package/build/internal/es/context-services.d.mts +1 -23
  56. package/build/internal/es/context-time-slots.d.mts +1 -21
  57. package/context-runtime/context-booking-checkout/runtime.d.ts +3 -38
  58. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  59. package/context-runtime/context-categories/runtime.d.ts +1 -4
  60. package/context-runtime/context-categories/runtime.js +2 -2
  61. package/context-runtime/context-locations/runtime.d.ts +1 -2
  62. package/context-runtime/context-locations/runtime.js +2 -2
  63. package/context-runtime/context-service/runtime.d.ts +1 -66
  64. package/context-runtime/context-service/runtime.js +3 -3
  65. package/context-runtime/context-service-addons/runtime.d.ts +1 -16
  66. package/context-runtime/context-service-addons/runtime.js +2 -2
  67. package/context-runtime/context-services/runtime.d.ts +1 -24
  68. package/context-runtime/context-services/runtime.js +3 -3
  69. package/context-runtime/context-time-slots/runtime.d.ts +1 -22
  70. package/context-runtime/context-time-slots/runtime.js +3 -3
  71. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
 
3
- //#region src/extensions/contexts/locations-context/locations-context.d.ts
3
+ // src/extensions/contexts/locations-context/locations-context.d.ts
4
4
  /** A business location as shown in a location list, with its selected state. */
5
5
  interface LocationItem {
6
6
  /**
@@ -191,7 +191,7 @@ function Te(e5, t2, n2) {
191
191
  break;
192
192
  }
193
193
  let a2 = r2[e6 + 1];
194
- (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
194
+ t3 in i2 && i2[t3] != null && typeof i2[t3] == `object` && i2[t3] !== null || (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
195
195
  }
196
196
  return e5;
197
197
  }
@@ -258,11 +258,8 @@ var Ae = class {
258
258
  return;
259
259
  }
260
260
  let a3 = Pe(e6);
261
- if (a3 && a3 in t3) {
262
- r2.push(a3), n2 = t3[a3];
263
- return;
264
- }
265
- throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
261
+ if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
262
+ else throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
266
263
  }, o2 = (e6, t3) => {
267
264
  r2.push(e6), n2 = t3[e6];
268
265
  };
@@ -273,11 +270,7 @@ var Ae = class {
273
270
  }
274
271
  if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e6}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
275
272
  let t3 = n2;
276
- if (e6 in n2) {
277
- o2(e6, t3);
278
- continue;
279
- }
280
- a2(e6, t3);
273
+ e6 in n2 ? o2(e6, t3) : a2(e6, t3);
281
274
  }
282
275
  return { [this.buildPathString(r2)]: n2 };
283
276
  }
@@ -1118,13 +1111,7 @@ var G = class {
1118
1111
  }), this;
1119
1112
  }
1120
1113
  off(e5, t2) {
1121
- if (this.observers[e5]) {
1122
- if (!t2) {
1123
- delete this.observers[e5];
1124
- return;
1125
- }
1126
- this.observers[e5].delete(t2);
1127
- }
1114
+ this.observers[e5] && (t2 ? this.observers[e5].delete(t2) : delete this.observers[e5]);
1128
1115
  }
1129
1116
  emit(e5, ...t2) {
1130
1117
  this.observers[e5] && Array.from(this.observers[e5].entries()).forEach(([e6, n2]) => {
@@ -1651,24 +1638,17 @@ var dr = class extends G {
1651
1638
  let e6 = this.waitingReads.shift();
1652
1639
  this.read(e6.lng, e6.ns, e6.fcName, e6.tried, e6.wait, e6.callback);
1653
1640
  }
1654
- if (o3 && s3 && r2 < this.maxRetries) {
1655
- setTimeout(() => {
1656
- this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
1657
- }, i2);
1658
- return;
1659
- }
1660
- a2(o3, s3);
1641
+ o3 && s3 && r2 < this.maxRetries ? setTimeout(() => {
1642
+ this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
1643
+ }, i2) : a2(o3, s3);
1661
1644
  }, s2 = this.backend[n2].bind(this.backend);
1662
- if (s2.length === 2) {
1663
- try {
1664
- let n3 = s2(e5, t2);
1665
- n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
1666
- } catch (e6) {
1667
- o2(e6);
1668
- }
1669
- return;
1645
+ if (s2.length === 2) try {
1646
+ let n3 = s2(e5, t2);
1647
+ n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
1648
+ } catch (e6) {
1649
+ o2(e6);
1670
1650
  }
1671
- return s2(e5, t2, o2);
1651
+ else return s2(e5, t2, o2);
1672
1652
  }
1673
1653
  prepareLoading(e5, t2, n2 = {}, r2) {
1674
1654
  if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
@@ -1693,11 +1673,8 @@ var dr = class extends G {
1693
1673
  }
1694
1674
  saveMissing(e5, t2, n2, r2, i2, a2 = {}, o2 = () => {
1695
1675
  }) {
1696
- if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) {
1697
- this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);
1698
- return;
1699
- }
1700
- if (n2 != null && n2 !== ``) {
1676
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);
1677
+ else if (n2 != null && n2 !== ``) {
1701
1678
  if (this.backend?.create) {
1702
1679
  let s2 = { ...a2, isUpdate: i2 }, c2 = this.backend.create.bind(this.backend);
1703
1680
  if (c2.length < 6) try {
@@ -2009,7 +1986,7 @@ var Ir = class {
2009
1986
  };
2010
1987
  var Lr = (e5) => new Ir(e5);
2011
1988
  var Rr = kn({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : Lr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
2012
- var zr = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule` };
1989
+ var zr = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule`, intakeForms: `intake-forms` };
2013
1990
  function Br(e5) {
2014
1991
  try {
2015
1992
  let t2 = Rr.getMonitoringClient?.();
@@ -2155,7 +2132,7 @@ function ci(e5) {
2155
2132
  }
2156
2133
  function li() {
2157
2134
  let e5 = ci(si()), t2 = typeof window > `u`;
2158
- return { scope: e5 ?? void 0, get: async (n2) => {
2135
+ return o(() => ({ scope: e5 ?? void 0, get: async (n2) => {
2159
2136
  if (t2 || !e5) return null;
2160
2137
  try {
2161
2138
  return await e5.get(n2);
@@ -2167,7 +2144,7 @@ function li() {
2167
2144
  e5.set(n2, r2);
2168
2145
  } catch {
2169
2146
  }
2170
- } };
2147
+ } }), [e5, t2]);
2171
2148
  }
2172
2149
  var ui = Z(`@wix/site-service-locale`);
2173
2150
  var di = Z;
@@ -2354,7 +2331,7 @@ function na({ locationsPromise: e5, refetch: t2, children: n2 }) {
2354
2331
  }
2355
2332
  function ra({ children: e5 }) {
2356
2333
  Xi(qi.LOCATIONS);
2357
- let n2 = li(), i2 = hi(), [a2, s2] = c(0), l2 = o(() => Jr(Oi({ key: _i(i2), refresh: a2 !== 0, warmupData: n2, fetchData: () => Hr(`locations-context-load`, { feature: zr.locations }, Vi()) }), ea, ta), [a2, i2]), u2 = r(() => s2((e6) => e6 + 1), []);
2334
+ let n2 = li(), i2 = hi(), [a2, s2] = c(0), l2 = o(() => Jr(Oi({ key: _i(i2), refresh: a2 !== 0, warmupData: n2, fetchData: () => Hr(`locations-context-load`, { feature: zr.locations }, Vi()) }), ea, ta), [a2, i2, n2]), u2 = r(() => s2((e6) => e6 + 1), []);
2358
2335
  return f(Ur, { fallback: f(Wi, { refetch: u2, children: e5 }), feature: zr.locations, children: f(t, { fallback: f(Ui, { refetch: u2, children: e5 }), children: f(na, { locationsPromise: l2, refetch: u2, children: e5 }) }) });
2359
2336
  }
2360
2337
  var ia = En(`c151d9f7-1582-407c-bb59-59030f244b47`);