@pisell/pisellos 0.10.53 → 0.10.55

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 (68) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +3 -1
  3. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  4. package/dist/modules/BusinessAvailability/index.d.ts +30 -0
  5. package/dist/modules/BusinessAvailability/index.js +204 -0
  6. package/dist/modules/OpenData/index.js +1 -1
  7. package/dist/modules/OpenData/types.d.ts +2 -0
  8. package/dist/modules/Order/index.d.ts +5 -2
  9. package/dist/modules/Order/index.js +320 -247
  10. package/dist/modules/Order/types.d.ts +8 -0
  11. package/dist/modules/Payment/index.js +9 -10
  12. package/dist/plugins/request.d.ts +3 -0
  13. package/dist/server/utils/small-ticket.d.ts +1 -85
  14. package/dist/server/utils/small-ticket.js +2 -2576
  15. package/dist/shared/payment/loadPaymentMethods.d.ts +9 -0
  16. package/dist/shared/payment/loadPaymentMethods.js +66 -0
  17. package/dist/shared/receipt/small-ticket.d.ts +85 -0
  18. package/dist/shared/receipt/small-ticket.js +2576 -0
  19. package/dist/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
  20. package/dist/shared/sales/loadSalesOrderSnapshot.js +21 -0
  21. package/dist/solution/BaseSales/index.d.ts +4 -15
  22. package/dist/solution/BaseSales/index.js +131 -86
  23. package/dist/solution/BaseSales/types.d.ts +11 -0
  24. package/dist/solution/BookingByStep/index.d.ts +1 -1
  25. package/dist/solution/BookingTicket/index.js +41 -13
  26. package/dist/solution/OrderInvoicePreview/index.d.ts +56 -0
  27. package/dist/solution/OrderInvoicePreview/index.js +269 -0
  28. package/dist/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
  29. package/dist/solution/UnifiedBookingSales/businessAvailability.js +292 -0
  30. package/dist/solution/UnifiedBookingSales/index.d.ts +11 -0
  31. package/dist/solution/UnifiedBookingSales/index.js +154 -75
  32. package/dist/solution/UnifiedBookingSales/types.d.ts +2 -0
  33. package/dist/solution/index.d.ts +1 -0
  34. package/dist/solution/index.js +2 -1
  35. package/lib/index.d.ts +2 -0
  36. package/lib/index.js +21 -1
  37. package/lib/modules/BusinessAvailability/index.d.ts +30 -0
  38. package/lib/modules/BusinessAvailability/index.js +146 -0
  39. package/lib/modules/OpenData/index.js +1 -1
  40. package/lib/modules/OpenData/types.d.ts +2 -0
  41. package/lib/modules/Order/index.d.ts +5 -2
  42. package/lib/modules/Order/index.js +67 -13
  43. package/lib/modules/Order/types.d.ts +8 -0
  44. package/lib/modules/Payment/index.js +3 -4
  45. package/lib/plugins/request.d.ts +3 -0
  46. package/lib/server/utils/small-ticket.d.ts +1 -85
  47. package/lib/server/utils/small-ticket.js +9 -2335
  48. package/lib/shared/payment/loadPaymentMethods.d.ts +9 -0
  49. package/lib/shared/payment/loadPaymentMethods.js +40 -0
  50. package/lib/shared/receipt/small-ticket.d.ts +85 -0
  51. package/lib/shared/receipt/small-ticket.js +2342 -0
  52. package/lib/shared/sales/loadSalesOrderSnapshot.d.ts +9 -0
  53. package/lib/shared/sales/loadSalesOrderSnapshot.js +22 -0
  54. package/lib/solution/BaseSales/index.d.ts +4 -15
  55. package/lib/solution/BaseSales/index.js +45 -24
  56. package/lib/solution/BaseSales/types.d.ts +11 -0
  57. package/lib/solution/BookingByStep/index.d.ts +1 -1
  58. package/lib/solution/BookingTicket/index.js +37 -4
  59. package/lib/solution/OrderInvoicePreview/index.d.ts +56 -0
  60. package/lib/solution/OrderInvoicePreview/index.js +194 -0
  61. package/lib/solution/UnifiedBookingSales/businessAvailability.d.ts +27 -0
  62. package/lib/solution/UnifiedBookingSales/businessAvailability.js +138 -0
  63. package/lib/solution/UnifiedBookingSales/index.d.ts +11 -0
  64. package/lib/solution/UnifiedBookingSales/index.js +54 -0
  65. package/lib/solution/UnifiedBookingSales/types.d.ts +2 -0
  66. package/lib/solution/index.d.ts +1 -0
  67. package/lib/solution/index.js +11 -0
  68. package/package.json +1 -1
@@ -42,6 +42,7 @@ import { getScheduleStartEndTimePoints } from "../../modules/Schedule/getDateIsI
42
42
  import { AvailabilityError, createAvailabilityProjection, getProductTimeRanges as getProjectionProductTimeRanges, queryAvailabilityProjection, validateAvailabilitySelection } from "../../modules/ResourcePlanner";
43
43
  import { UnifiedBookingSalesHooks } from "./types";
44
44
  import { AvailabilityRemoteOccupancyCache } from "./remoteOccupancyCache";
45
+ import { BusinessAvailabilityController } from "./businessAvailability";
45
46
  import { BookingTicket } from "../BookingTicket";
46
47
  import { addLocalCalendarDays, captureRuntimeOffsetMinutes, formatLocalDate, formatLocalDateTime, formatLocalTime, localDateTimeToScalar, localDateToScalar, localDateToScalarStart, parseLocalDate, parseLocalDateTime } from "../../modules/ResourcePlanner/localClock";
47
48
  import { isCustomerUserPlatform, normalizeRuntimePlatform } from "../../utils/platform";
@@ -1314,6 +1315,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1314
1315
  _defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
1315
1316
  _defineProperty(_assertThisInitialized(_this), "store", {});
1316
1317
  _defineProperty(_assertThisInitialized(_this), "pickupTimingEnabled", true);
1318
+ _defineProperty(_assertThisInitialized(_this), "businessAvailabilityController", void 0);
1317
1319
  _defineProperty(_assertThisInitialized(_this), "runtimeOpenDataScope", null);
1318
1320
  _defineProperty(_assertThisInitialized(_this), "runtimeOpenDataSnapshot", null);
1319
1321
  _defineProperty(_assertThisInitialized(_this), "runtimeOpenDataModule", null);
@@ -1386,6 +1388,82 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1386
1388
  var channel = String((_this$otherParams$cha = (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel) !== null && _this$otherParams$cha !== void 0 ? _this$otherParams$cha : '').trim();
1387
1389
  return channel || _get(_getPrototypeOf(UnifiedBookingSalesImpl.prototype), "getSubmitOrderSalesChannel", this).call(this);
1388
1390
  }
1391
+
1392
+ /** Only the explicit Kiosk Sales consumer entry enables this policy; POS stays unchanged. */
1393
+ }, {
1394
+ key: "isBusinessAvailabilityEnabled",
1395
+ value: function isBusinessAvailabilityEnabled() {
1396
+ var _this$otherParams2, _this$otherParams3;
1397
+ return ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.enableBusinessAvailability) === true && ['pc', 'h5', 'kiosk'].includes(normalizeRuntimePlatform((_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.platform));
1398
+ }
1399
+ }, {
1400
+ key: "getBusinessAvailabilityScope",
1401
+ value: function getBusinessAvailabilityScope() {
1402
+ return "".concat(this.getRuntimeOpenDataScope(), ":").concat(this.runtimeOpenDataGeneration);
1403
+ }
1404
+ }, {
1405
+ key: "getBusinessAvailabilityController",
1406
+ value: function getBusinessAvailabilityController() {
1407
+ var _this2 = this;
1408
+ if (!this.businessAvailabilityController) {
1409
+ this.businessAvailabilityController = new BusinessAvailabilityController({
1410
+ loadOpenData: function loadOpenData() {
1411
+ return _this2.loadOpenDataConfig();
1412
+ },
1413
+ getSchedule: function getSchedule() {
1414
+ return _this2.store.schedule;
1415
+ },
1416
+ getTimezone: function getTimezone() {
1417
+ var _this2$otherParams;
1418
+ return String(((_this2$otherParams = _this2.otherParams) === null || _this2$otherParams === void 0 ? void 0 : _this2$otherParams.businessTimezone) || _this2.getPickupTimingContextData('timezone') || '');
1419
+ },
1420
+ getScope: function getScope() {
1421
+ return _this2.getBusinessAvailabilityScope();
1422
+ }
1423
+ });
1424
+ }
1425
+ return this.businessAvailabilityController;
1426
+ }
1427
+ }, {
1428
+ key: "getBusinessAvailability",
1429
+ value: function getBusinessAvailability() {
1430
+ return this.getBusinessAvailabilityController().getAvailability();
1431
+ }
1432
+
1433
+ /** Internal final-write assertion; does not fetch OpenData or Schedule. */
1434
+ }, {
1435
+ key: "assertBusinessAvailability",
1436
+ value: function assertBusinessAvailability() {
1437
+ if (this.isBusinessAvailabilityEnabled()) this.getBusinessAvailabilityController().assertAvailable();
1438
+ }
1439
+ }, {
1440
+ key: "getSubModuleHooks",
1441
+ value: function getSubModuleHooks(moduleName) {
1442
+ var _this3 = this;
1443
+ var hooks = _get(_getPrototypeOf(UnifiedBookingSalesImpl.prototype), "getSubModuleHooks", this).call(this, moduleName);
1444
+ if (moduleName !== 'order' || !this.isBusinessAvailabilityEnabled()) return hooks;
1445
+ var lastScope;
1446
+ var lastExistingScope;
1447
+ var scopeToken = {};
1448
+ return _objectSpread(_objectSpread({}, hooks), {}, {
1449
+ getCartIntentScope: function getCartIntentScope() {
1450
+ var _hooks$getCartIntentS;
1451
+ var scope = _this3.getBusinessAvailabilityScope();
1452
+ var existingScope = hooks === null || hooks === void 0 || (_hooks$getCartIntentS = hooks.getCartIntentScope) === null || _hooks$getCartIntentS === void 0 ? void 0 : _hooks$getCartIntentS.call(hooks);
1453
+ if (scope !== lastScope || !Object.is(existingScope, lastExistingScope)) {
1454
+ lastScope = scope;
1455
+ lastExistingScope = existingScope;
1456
+ scopeToken = {};
1457
+ }
1458
+ return scopeToken;
1459
+ },
1460
+ beforeCartIntentCommit: function beforeCartIntentCommit(context) {
1461
+ var _hooks$beforeCartInte;
1462
+ _this3.assertBusinessAvailability();
1463
+ hooks === null || hooks === void 0 || (_hooks$beforeCartInte = hooks.beforeCartIntentCommit) === null || _hooks$beforeCartInte === void 0 || _hooks$beforeCartInte.call(hooks, context);
1464
+ }
1465
+ });
1466
+ }
1389
1467
  }, {
1390
1468
  key: "createAvailabilityFacadeError",
1391
1469
  value: function createAvailabilityFacadeError(code, message, details) {
@@ -1435,9 +1513,9 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1435
1513
  }, {
1436
1514
  key: "normalizeAvailabilityPrepareDescriptor",
1437
1515
  value: function normalizeAvailabilityPrepareDescriptor(params) {
1438
- var _this$otherParams2;
1516
+ var _this$otherParams4;
1439
1517
  this.assertAvailabilityPrepareParams(params);
1440
- var timezone = String(params.timezone || ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.businessTimezone) || Intl.DateTimeFormat().resolvedOptions().timeZone || 'Asia/Shanghai');
1518
+ var timezone = String(params.timezone || ((_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.businessTimezone) || Intl.DateTimeFormat().resolvedOptions().timeZone || 'Asia/Shanghai');
1441
1519
  assertValidAvailabilityTimezone(timezone);
1442
1520
  var dateRange = this.normalizeAvailabilityDateRange(params, timezone);
1443
1521
  var slotStepMinutes = params.slotStepMinutes || DEFAULT_AVAILABILITY_SLOT_STEP_MINUTES;
@@ -1467,7 +1545,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1467
1545
  key: "resolveAvailabilityPrepareDefaults",
1468
1546
  value: function () {
1469
1547
  var _resolveAvailabilityPrepareDefaults = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
1470
- var _ref30, _this$otherParams$bus, _this$otherParams3, _this$otherParams4, _this$otherParams$cha2, _this$otherParams5, _this$otherParams6, _openData, _openData2, _openData3;
1548
+ var _ref30, _this$otherParams$bus, _this$otherParams5, _this$otherParams6, _this$otherParams$cha2, _this$otherParams7, _this$otherParams8, _openData, _openData2, _openData3;
1471
1549
  var needsOperatingHours, needsTimeSlice, businessCode, channel, currentTarget, openData, operatingScheduleIds, configuredTimeSlice;
1472
1550
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1473
1551
  while (1) switch (_context2.prev = _context2.next) {
@@ -1485,10 +1563,10 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1485
1563
  }
1486
1564
  }));
1487
1565
  case 4:
1488
- businessCode = String((_ref30 = (_this$otherParams$bus = (_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : (_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.business_code) !== null && _ref30 !== void 0 ? _ref30 : '').trim();
1489
- channel = String((_this$otherParams$cha2 = (_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.channel) !== null && _this$otherParams$cha2 !== void 0 ? _this$otherParams$cha2 : '').trim();
1566
+ businessCode = String((_ref30 = (_this$otherParams$bus = (_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.business_code) !== null && _ref30 !== void 0 ? _ref30 : '').trim();
1567
+ channel = String((_this$otherParams$cha2 = (_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.channel) !== null && _this$otherParams$cha2 !== void 0 ? _this$otherParams$cha2 : '').trim();
1490
1568
  currentTarget = businessCode && channel ? "".concat(businessCode, "+").concat(channel) : null;
1491
- openData = (!currentTarget || this.openDataTarget === currentTarget) && (this.runtimeOpenDataScope === null || this.runtimeOpenDataScope === this.getRuntimeOpenDataScope()) ? (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.openData : null;
1569
+ openData = (!currentTarget || this.openDataTarget === currentTarget) && (this.runtimeOpenDataScope === null || this.runtimeOpenDataScope === this.getRuntimeOpenDataScope()) ? (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.openData : null;
1492
1570
  if (!(!openData && this.store.openData)) {
1493
1571
  _context2.next = 20;
1494
1572
  break;
@@ -1578,7 +1656,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1578
1656
  key: "setOtherParams",
1579
1657
  value: function () {
1580
1658
  var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
1581
- var _this$otherParams7, _this$otherParams9;
1659
+ var _this$otherParams9, _this$otherParams11;
1582
1660
  var _ref31,
1583
1661
  _ref31$cover,
1584
1662
  cover,
@@ -1587,7 +1665,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1587
1665
  explicitlySetsOpenData,
1588
1666
  nextParams,
1589
1667
  nextScope,
1590
- _this$otherParams8,
1668
+ _this$otherParams10,
1591
1669
  shouldResetAvailabilityState,
1592
1670
  _args3 = arguments;
1593
1671
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
@@ -1595,7 +1673,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1595
1673
  case 0:
1596
1674
  _ref31 = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {}, _ref31$cover = _ref31.cover, cover = _ref31$cover === void 0 ? false : _ref31$cover;
1597
1675
  previousScope = this.getAvailabilityScopeDescriptor(this.otherParams || {});
1598
- previousItemRuleConfig = (_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.itemRule;
1676
+ previousItemRuleConfig = (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.itemRule;
1599
1677
  explicitlySetsOpenData = Object.prototype.hasOwnProperty.call(params, 'openData');
1600
1678
  nextParams = cover ? params : _objectSpread(_objectSpread({}, this.otherParams), params);
1601
1679
  if (explicitlySetsOpenData || this.getRuntimeOpenDataScope() !== this.getRuntimeOpenDataScope(nextParams)) {
@@ -1608,7 +1686,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1608
1686
  case 8:
1609
1687
  nextScope = this.getAvailabilityScopeDescriptor(this.otherParams || {});
1610
1688
  if (explicitlySetsOpenData) {
1611
- this.openDataTarget = (_this$otherParams8 = this.otherParams) !== null && _this$otherParams8 !== void 0 && _this$otherParams8.openData && nextScope.businessCode && nextScope.channel ? "".concat(nextScope.businessCode, "+").concat(nextScope.channel) : null;
1689
+ this.openDataTarget = (_this$otherParams10 = this.otherParams) !== null && _this$otherParams10 !== void 0 && _this$otherParams10.openData && nextScope.businessCode && nextScope.channel ? "".concat(nextScope.businessCode, "+").concat(nextScope.channel) : null;
1612
1690
  }
1613
1691
  shouldResetAvailabilityState = previousScope.cacheId !== nextScope.cacheId || previousScope.businessCode !== nextScope.businessCode || previousScope.channel !== nextScope.channel || previousScope.platform !== nextScope.platform || previousScope.businessTimezone !== nextScope.businessTimezone;
1614
1692
  if (!shouldResetAvailabilityState) {
@@ -1618,7 +1696,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1618
1696
  _context3.next = 14;
1619
1697
  return this.resetAvailabilityProjectionState('set_other_params_reset');
1620
1698
  case 14:
1621
- if (shouldResetAvailabilityState || explicitlySetsOpenData || previousItemRuleConfig !== ((_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.itemRule)) {
1699
+ if (shouldResetAvailabilityState || explicitlySetsOpenData || previousItemRuleConfig !== ((_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.itemRule)) {
1622
1700
  this.resetAllergyItemRuleState();
1623
1701
  }
1624
1702
  case 15:
@@ -1804,7 +1882,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1804
1882
  }, {
1805
1883
  key: "invalidateAvailabilityContextsAfterCommit",
1806
1884
  value: function invalidateAvailabilityContextsAfterCommit() {
1807
- var _this2 = this;
1885
+ var _this4 = this;
1808
1886
  this.availabilityLifecycleGeneration += 1;
1809
1887
  var nextOrderRevision = this.getCurrentOrderRevision();
1810
1888
  this.availabilityProjectionPool.clear();
@@ -1815,7 +1893,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1815
1893
  context.activeProjectionKey = null;
1816
1894
  context.lastKnownOrderRevision = nextOrderRevision;
1817
1895
  context.refreshNonce += 1;
1818
- context.lifecycleGeneration = _this2.availabilityLifecycleGeneration;
1896
+ context.lifecycleGeneration = _this4.availabilityLifecycleGeneration;
1819
1897
  });
1820
1898
  }
1821
1899
  }, {
@@ -1854,8 +1932,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1854
1932
  }, {
1855
1933
  key: "isSessionStoragePersistEnabled",
1856
1934
  value: function isSessionStoragePersistEnabled() {
1857
- var _this$otherParams10;
1858
- return Boolean(this.cacheId && ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.enableSessionStoragePersist) === true);
1935
+ var _this$otherParams12;
1936
+ return Boolean(this.cacheId && ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.enableSessionStoragePersist) === true);
1859
1937
  }
1860
1938
  }, {
1861
1939
  key: "shouldUseSessionStorageForSubModule",
@@ -1924,10 +2002,10 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
1924
2002
  }, {
1925
2003
  key: "shouldUseCheckoutSyncTask",
1926
2004
  value: function shouldUseCheckoutSyncTask() {
1927
- var _this$otherParams11, _this$otherParams$pla, _this$otherParams12;
1928
- var configured = (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.checkoutSyncTaskEnabled;
2005
+ var _this$otherParams13, _this$otherParams$pla, _this$otherParams14;
2006
+ var configured = (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.checkoutSyncTaskEnabled;
1929
2007
  if (configured === true) return true;
1930
- var platform = String((_this$otherParams$pla = (_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.platform) !== null && _this$otherParams$pla !== void 0 ? _this$otherParams$pla : '').trim().toLowerCase();
2008
+ var platform = String((_this$otherParams$pla = (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.platform) !== null && _this$otherParams$pla !== void 0 ? _this$otherParams$pla : '').trim().toLowerCase();
1931
2009
  return !isCustomerUserPlatform(platform) && platform !== 'kiosk';
1932
2010
  }
1933
2011
 
@@ -2082,8 +2160,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2082
2160
  }, {
2083
2161
  key: "isAuthenticatedCustomerUserPlatform",
2084
2162
  value: function isAuthenticatedCustomerUserPlatform() {
2085
- var _this$otherParams13;
2086
- return isCustomerUserPlatform((_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.platform);
2163
+ var _this$otherParams15;
2164
+ return isCustomerUserPlatform((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.platform);
2087
2165
  }
2088
2166
  }, {
2089
2167
  key: "resolveDiscountOrderIdentity",
@@ -2192,7 +2270,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2192
2270
  }, {
2193
2271
  key: "resetRuntimeOpenData",
2194
2272
  value: function resetRuntimeOpenData() {
2195
- var _this$store$openData, _this$store$openData$;
2273
+ var _this$businessAvailab, _this$store$openData, _this$store$openData$;
2274
+ (_this$businessAvailab = this.businessAvailabilityController) === null || _this$businessAvailab === void 0 || _this$businessAvailab.invalidate();
2196
2275
  this.runtimeOpenDataGeneration += 1;
2197
2276
  this.runtimeOpenDataScope = null;
2198
2277
  this.runtimeOpenDataSnapshot = null;
@@ -2280,7 +2359,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2280
2359
  key: "loadOpenData",
2281
2360
  value: (function () {
2282
2361
  var _loadOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
2283
- var _this3 = this;
2362
+ var _this5 = this;
2284
2363
  var module, businessCode, channel, target, scope, injectedOpenData, generation, core, request;
2285
2364
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
2286
2365
  while (1) switch (_context14.prev = _context14.next) {
@@ -2338,7 +2417,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2338
2417
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
2339
2418
  while (1) switch (_context13.prev = _context13.next) {
2340
2419
  case 0:
2341
- openData = _this3.runtimeOpenDataSnapshot;
2420
+ openData = _this5.runtimeOpenDataSnapshot;
2342
2421
  if (!openData) {
2343
2422
  _context13.next = 6;
2344
2423
  break;
@@ -2358,15 +2437,15 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2358
2437
  case 8:
2359
2438
  openData = _context13.sent;
2360
2439
  case 9:
2361
- if (!(_this3.runtimeOpenDataDestroyed || generation !== _this3.runtimeOpenDataGeneration || scope !== _this3.getRuntimeOpenDataScope() || module !== _this3.store.openData || core !== _this3.core)) {
2440
+ if (!(_this5.runtimeOpenDataDestroyed || generation !== _this5.runtimeOpenDataGeneration || scope !== _this5.getRuntimeOpenDataScope() || module !== _this5.store.openData || core !== _this5.core)) {
2362
2441
  _context13.next = 11;
2363
2442
  break;
2364
2443
  }
2365
2444
  throw new Error('Store settings changed. Please try again.');
2366
2445
  case 11:
2367
- _this3.runtimeOpenDataSnapshot = openData;
2368
- _this3.openDataTarget = target;
2369
- _this3.otherParams.openData = openData;
2446
+ _this5.runtimeOpenDataSnapshot = openData;
2447
+ _this5.openDataTarget = target;
2448
+ _this5.otherParams.openData = openData;
2370
2449
  return _context13.abrupt("return", openData);
2371
2450
  case 15:
2372
2451
  case "end":
@@ -2422,13 +2501,13 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2422
2501
  key: "loadPickupTimingOpenData",
2423
2502
  value: function () {
2424
2503
  var _loadPickupTimingOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_force) {
2425
- var _ref34, _this$otherParams$bus2, _this$otherParams14, _this$otherParams15;
2504
+ var _ref34, _this$otherParams$bus2, _this$otherParams16, _this$otherParams17;
2426
2505
  var scope, businessCode, config;
2427
2506
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
2428
2507
  while (1) switch (_context16.prev = _context16.next) {
2429
2508
  case 0:
2430
2509
  scope = this.getPickupTimingScope();
2431
- businessCode = String((_ref34 = (_this$otherParams$bus2 = (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode) !== null && _this$otherParams$bus2 !== void 0 ? _this$otherParams$bus2 : (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.business_code) !== null && _ref34 !== void 0 ? _ref34 : '').trim();
2510
+ businessCode = String((_ref34 = (_this$otherParams$bus2 = (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.businessCode) !== null && _this$otherParams$bus2 !== void 0 ? _this$otherParams$bus2 : (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.business_code) !== null && _ref34 !== void 0 ? _ref34 : '').trim();
2432
2511
  _context16.next = 4;
2433
2512
  return this.loadOpenData({
2434
2513
  businessCode: businessCode,
@@ -2514,7 +2593,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2514
2593
  key: "ensureAllergyItemRuleConfigsLoaded",
2515
2594
  value: function () {
2516
2595
  var _ensureAllergyItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
2517
- var _this4 = this;
2596
+ var _this6 = this;
2518
2597
  return _regeneratorRuntime().wrap(function _callee19$(_context19) {
2519
2598
  while (1) switch (_context19.prev = _context19.next) {
2520
2599
  case 0:
@@ -2531,22 +2610,22 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2531
2610
  return _context19.abrupt("return", this.allergyItemRuleConfigsPromise);
2532
2611
  case 4:
2533
2612
  this.allergyItemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
2534
- var _this4$otherParams;
2613
+ var _this6$otherParams;
2535
2614
  var staticConfigs, openData, enabled, strategyModelIds, loaded;
2536
2615
  return _regeneratorRuntime().wrap(function _callee18$(_context18) {
2537
2616
  while (1) switch (_context18.prev = _context18.next) {
2538
2617
  case 0:
2539
- staticConfigs = normalizeItemRuleStrategyConfigs((_this4$otherParams = _this4.otherParams) === null || _this4$otherParams === void 0 || (_this4$otherParams = _this4$otherParams.itemRule) === null || _this4$otherParams === void 0 ? void 0 : _this4$otherParams.strategyConfigs);
2618
+ staticConfigs = normalizeItemRuleStrategyConfigs((_this6$otherParams = _this6.otherParams) === null || _this6$otherParams === void 0 || (_this6$otherParams = _this6$otherParams.itemRule) === null || _this6$otherParams === void 0 ? void 0 : _this6$otherParams.strategyConfigs);
2540
2619
  if (!(staticConfigs.length > 0)) {
2541
2620
  _context18.next = 5;
2542
2621
  break;
2543
2622
  }
2544
- _this4.allergyItemRuleConfigs = staticConfigs;
2545
- _this4.allergyItemRuleEvaluator.setStrategyConfigs(staticConfigs);
2623
+ _this6.allergyItemRuleConfigs = staticConfigs;
2624
+ _this6.allergyItemRuleEvaluator.setStrategyConfigs(staticConfigs);
2546
2625
  return _context18.abrupt("return", staticConfigs);
2547
2626
  case 5:
2548
2627
  _context18.next = 7;
2549
- return _this4.getOpenData();
2628
+ return _this6.getOpenData();
2550
2629
  case 7:
2551
2630
  openData = _context18.sent;
2552
2631
  enabled = toConfiguredBoolean(openData === null || openData === void 0 ? void 0 : openData['sale.enable_item_rules']);
@@ -2555,15 +2634,15 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2555
2634
  _context18.next = 13;
2556
2635
  break;
2557
2636
  }
2558
- _this4.allergyItemRuleEvaluator.setStrategyConfigs([]);
2637
+ _this6.allergyItemRuleEvaluator.setStrategyConfigs([]);
2559
2638
  return _context18.abrupt("return", []);
2560
2639
  case 13:
2561
2640
  _context18.next = 15;
2562
- return _this4.fetchAllergyItemRuleConfigs(strategyModelIds);
2641
+ return _this6.fetchAllergyItemRuleConfigs(strategyModelIds);
2563
2642
  case 15:
2564
2643
  loaded = _context18.sent;
2565
- _this4.allergyItemRuleConfigs = loaded;
2566
- _this4.allergyItemRuleEvaluator.setStrategyConfigs(loaded);
2644
+ _this6.allergyItemRuleConfigs = loaded;
2645
+ _this6.allergyItemRuleEvaluator.setStrategyConfigs(loaded);
2567
2646
  return _context18.abrupt("return", loaded);
2568
2647
  case 19:
2569
2648
  case "end":
@@ -2591,7 +2670,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2591
2670
  key: "resolveProductAllergyRequirement",
2592
2671
  value: (function () {
2593
2672
  var _resolveProductAllergyRequirement = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params) {
2594
- var _this$otherParams16, _this$getOrderProduct, _runtimePax$total, _runtimePax$adult, _runtimePax$child, _ref37, _runtimeConfig$servic, _this$otherParams17, _ref38, _ref39, _params$channel, _this$otherParams18, _this$otherParams19, _runtimeConfig$submis;
2673
+ var _this$otherParams18, _this$getOrderProduct, _runtimePax$total, _runtimePax$adult, _runtimePax$child, _ref37, _runtimeConfig$servic, _this$otherParams19, _ref38, _ref39, _params$channel, _this$otherParams20, _this$otherParams21, _runtimeConfig$submis;
2595
2674
  var productId, strategyConfigs, productVariantId, runtimeConfig, runtimePax, cartItems;
2596
2675
  return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2597
2676
  while (1) switch (_context20.prev = _context20.next) {
@@ -2614,7 +2693,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2614
2693
  return _context20.abrupt("return", null);
2615
2694
  case 8:
2616
2695
  productVariantId = normalizePositiveInteger(params.productVariantId);
2617
- runtimeConfig = ((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.itemRule) || {};
2696
+ runtimeConfig = ((_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.itemRule) || {};
2618
2697
  runtimePax = runtimeConfig.pax || {};
2619
2698
  cartItems = (((_this$getOrderProduct = this.getOrderProducts) === null || _this$getOrderProduct === void 0 ? void 0 : _this$getOrderProduct.call(this)) || []).map(function (item) {
2620
2699
  var _item$product_id, _item$product_variant, _ref36, _item$num;
@@ -2633,8 +2712,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2633
2712
  child: Number((_runtimePax$child = runtimePax.child) !== null && _runtimePax$child !== void 0 ? _runtimePax$child : 0) || 0
2634
2713
  },
2635
2714
  cartItems: cartItems,
2636
- serviceType: String((_ref37 = (_runtimeConfig$servic = runtimeConfig.serviceType) !== null && _runtimeConfig$servic !== void 0 ? _runtimeConfig$servic : (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.serviceType) !== null && _ref37 !== void 0 ? _ref37 : ''),
2637
- channel: String((_ref38 = (_ref39 = (_params$channel = params.channel) !== null && _params$channel !== void 0 ? _params$channel : (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.channel) !== null && _ref39 !== void 0 ? _ref39 : (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform) !== null && _ref38 !== void 0 ? _ref38 : ''),
2715
+ serviceType: String((_ref37 = (_runtimeConfig$servic = runtimeConfig.serviceType) !== null && _runtimeConfig$servic !== void 0 ? _runtimeConfig$servic : (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.serviceType) !== null && _ref37 !== void 0 ? _ref37 : ''),
2716
+ channel: String((_ref38 = (_ref39 = (_params$channel = params.channel) !== null && _params$channel !== void 0 ? _params$channel : (_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.channel) !== null && _ref39 !== void 0 ? _ref39 : (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.platform) !== null && _ref38 !== void 0 ? _ref38 : ''),
2638
2717
  currentProduct: _objectSpread({
2639
2718
  product_id: productId
2640
2719
  }, productVariantId ? {
@@ -2724,9 +2803,9 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
2724
2803
  }, {
2725
2804
  key: "isInvoiceOpenDataCacheCurrent",
2726
2805
  value: function isInvoiceOpenDataCacheCurrent() {
2727
- var _this$otherParams20, _this$otherParams21;
2728
- var businessCode = String(((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.businessCode) || '').trim();
2729
- var channel = String(((_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.channel) || '').trim();
2806
+ var _this$otherParams22, _this$otherParams23;
2807
+ var businessCode = String(((_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.businessCode) || '').trim();
2808
+ var channel = String(((_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.channel) || '').trim();
2730
2809
  if (!businessCode || !channel) return false;
2731
2810
  return this.openDataTarget === "".concat(businessCode, "+").concat(channel) && this.runtimeOpenDataScope === this.getRuntimeOpenDataScope();
2732
2811
  }
@@ -3546,7 +3625,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
3546
3625
  }, {
3547
3626
  key: "buildAvailabilityOperatingHoursSnapshot",
3548
3627
  value: function buildAvailabilityOperatingHoursSnapshot(params) {
3549
- var _this5 = this;
3628
+ var _this7 = this;
3550
3629
  var descriptor = params.prepare._availabilityOperatingHours || {
3551
3630
  source: params.prepare.businessHours ? 'prepare_business_hours' : 'default_business_hours',
3552
3631
  scheduleIds: []
@@ -3556,7 +3635,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
3556
3635
  var range = normalizeAvailabilityLocalDateTimeRange({
3557
3636
  startAt: "".concat(date, "T").concat(params.businessHours.startTime, ":00"),
3558
3637
  endAt: "".concat(date, "T").concat(params.businessHours.endTime, ":00"),
3559
- fixedOffsetMinutes: _this5.getAvailabilityRuntimeOffsetMinutes(),
3638
+ fixedOffsetMinutes: _this7.getAvailabilityRuntimeOffsetMinutes(),
3560
3639
  rollOverEnd: true
3561
3640
  });
3562
3641
  return range ? [{
@@ -3591,7 +3670,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
3591
3670
  var range = normalizeAvailabilityLocalDateTimeRange({
3592
3671
  startAt: slot.start_at,
3593
3672
  endAt: slot.end_at,
3594
- fixedOffsetMinutes: _this5.getAvailabilityRuntimeOffsetMinutes(),
3673
+ fixedOffsetMinutes: _this7.getAvailabilityRuntimeOffsetMinutes(),
3595
3674
  rollOverEnd: true
3596
3675
  });
3597
3676
  return range ? [{
@@ -3607,7 +3686,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
3607
3686
  var range = normalizeAvailabilityLocalDateTimeRange({
3608
3687
  startAt: slot.start_at,
3609
3688
  endAt: slot.end_at,
3610
- fixedOffsetMinutes: _this5.getAvailabilityRuntimeOffsetMinutes(),
3689
+ fixedOffsetMinutes: _this7.getAvailabilityRuntimeOffsetMinutes(),
3611
3690
  rollOverEnd: true
3612
3691
  });
3613
3692
  return range ? [{
@@ -3637,7 +3716,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
3637
3716
  var _loadAvailabilityProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(params) {
3638
3717
  var _prepare$catalogScope,
3639
3718
  _prepare$catalogScope2,
3640
- _this6 = this,
3719
+ _this8 = this,
3641
3720
  _prepare$resourceIds;
3642
3721
  var prepare, dateRange, explicitProductIds, rawProducts, _this$store$schedule$6, _this$store$schedule6, _this$store$schedule$7, _this$store$schedule7, dateSet, scheduleProductIds, productIds, normalized, productIdSet;
3643
3722
  return _regeneratorRuntime().wrap(function _callee33$(_context33) {
@@ -3720,7 +3799,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
3720
3799
  rawProducts = _context33.sent;
3721
3800
  case 34:
3722
3801
  normalized = rawProducts.map(function (product) {
3723
- return normalizeProductForAvailability(product, params.scheduleList, _this6.getAvailabilityRuntimeOffsetMinutes());
3802
+ return normalizeProductForAvailability(product, params.scheduleList, _this8.getAvailabilityRuntimeOffsetMinutes());
3724
3803
  });
3725
3804
  if (!(!explicitProductIds.length && (_prepare$resourceIds = prepare.resourceIds) !== null && _prepare$resourceIds !== void 0 && _prepare$resourceIds.length)) {
3726
3805
  _context33.next = 37;
@@ -4081,7 +4160,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4081
4160
  }, {
4082
4161
  key: "collectCartResourceOccupancies",
4083
4162
  value: function collectCartResourceOccupancies(tempOrder, exclusions) {
4084
- var _this7 = this;
4163
+ var _this9 = this;
4085
4164
  var bookings = Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.bookings) ? tempOrder.bookings : [];
4086
4165
  return bookings.flatMap(function (booking) {
4087
4166
  var _ref48, _booking$product_uid2, _booking$metadata2;
@@ -4098,7 +4177,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4098
4177
  var range = normalizeAvailabilityLocalDateTimeRange({
4099
4178
  startAt: startAt,
4100
4179
  endAt: endAt,
4101
- fixedOffsetMinutes: _this7.getAvailabilityRuntimeOffsetMinutes(),
4180
+ fixedOffsetMinutes: _this9.getAvailabilityRuntimeOffsetMinutes(),
4102
4181
  rollOverEnd: false
4103
4182
  });
4104
4183
  if (!range) return [];
@@ -4116,7 +4195,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4116
4195
  resource: resource
4117
4196
  }
4118
4197
  };
4119
- return _this7.occupancyIsExcluded(occupancy, exclusions) ? [] : [occupancy];
4198
+ return _this9.occupancyIsExcluded(occupancy, exclusions) ? [] : [occupancy];
4120
4199
  });
4121
4200
  });
4122
4201
  }
@@ -4183,16 +4262,16 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4183
4262
  }, {
4184
4263
  key: "assertContextualQueryFreshness",
4185
4264
  value: function assertContextualQueryFreshness(context, request) {
4186
- var _this8 = this;
4265
+ var _this10 = this;
4187
4266
  if (request.target === 'time') {
4188
4267
  request.candidates.forEach(function (candidate) {
4189
- _this8.assertAvailabilityCandidateFreshness(context, candidate);
4268
+ _this10.assertAvailabilityCandidateFreshness(context, candidate);
4190
4269
  });
4191
4270
  return;
4192
4271
  }
4193
4272
  if (request.target === 'resource') {
4194
4273
  request.selectedRanges.forEach(function (candidate) {
4195
- _this8.assertAvailabilityCandidateFreshness(context, candidate);
4274
+ _this10.assertAvailabilityCandidateFreshness(context, candidate);
4196
4275
  });
4197
4276
  }
4198
4277
  }
@@ -4240,7 +4319,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4240
4319
  key: "buildAvailabilityProjectionSnapshot",
4241
4320
  value: function () {
4242
4321
  var _buildAvailabilityProjectionSnapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(params) {
4243
- var _this9 = this;
4322
+ var _this11 = this;
4244
4323
  var options,
4245
4324
  normalizedPrepareParams,
4246
4325
  timezoneLabel,
@@ -4306,7 +4385,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4306
4385
  var range = normalizeAvailabilityLocalDateTimeRange({
4307
4386
  startAt: occupancy.startAt,
4308
4387
  endAt: occupancy.endAt,
4309
- fixedOffsetMinutes: _this9.getAvailabilityRuntimeOffsetMinutes(),
4388
+ fixedOffsetMinutes: _this11.getAvailabilityRuntimeOffsetMinutes(),
4310
4389
  rollOverEnd: false
4311
4390
  });
4312
4391
  if (!range) return [];
@@ -4316,7 +4395,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4316
4395
  })];
4317
4396
  });
4318
4397
  remoteOccupancies = [].concat(_toConsumableArray(loadedResources.resourceOccupancies), _toConsumableArray(loadedResources.includesInjectedRawOccupancies ? [] : injectedRawOccupancies)).filter(function (occupancy) {
4319
- return !_this9.occupancyIsExcluded(occupancy, exclusions);
4398
+ return !_this11.occupancyIsExcluded(occupancy, exclusions);
4320
4399
  });
4321
4400
  cartOccupancies = this.collectCartResourceOccupancies(tempOrder, exclusions);
4322
4401
  preparedAt = this.getAvailabilityRuntimeDateTime();
@@ -4458,7 +4537,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4458
4537
  key: "refreshAvailabilityContextProjection",
4459
4538
  value: function () {
4460
4539
  var _refreshAvailabilityContextProjection = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(params) {
4461
- var _this10 = this;
4540
+ var _this12 = this;
4462
4541
  var existingInFlight, context, expectedVersion, expectedRefreshNonce, expectedLifecycleGeneration, refreshPromise, current;
4463
4542
  return _regeneratorRuntime().wrap(function _callee41$(_context41) {
4464
4543
  while (1) switch (_context41.prev = _context41.next) {
@@ -4483,25 +4562,25 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4483
4562
  while (1) switch (_context40.prev = _context40.next) {
4484
4563
  case 0:
4485
4564
  _context40.next = 2;
4486
- return _this10.buildAvailabilityProjectionSnapshot(_this10.cloneAvailabilityPrepareParams(context.prepareParams), {
4565
+ return _this12.buildAvailabilityProjectionSnapshot(_this12.cloneAvailabilityPrepareParams(context.prepareParams), {
4487
4566
  durationCandidateAnchorAt: context.durationCandidateAnchorAt
4488
4567
  });
4489
4568
  case 2:
4490
4569
  snapshot = _context40.sent;
4491
- currentContext = _this10.availabilityContextRegistry.get(params.contextId);
4570
+ currentContext = _this12.availabilityContextRegistry.get(params.contextId);
4492
4571
  if (currentContext) {
4493
4572
  _context40.next = 6;
4494
4573
  break;
4495
4574
  }
4496
4575
  return _context40.abrupt("return", null);
4497
4576
  case 6:
4498
- if (!(expectedLifecycleGeneration !== _this10.availabilityLifecycleGeneration || currentContext.activeVersion !== expectedVersion || currentContext.refreshNonce !== expectedRefreshNonce || currentContext.lifecycleGeneration !== expectedLifecycleGeneration)) {
4577
+ if (!(expectedLifecycleGeneration !== _this12.availabilityLifecycleGeneration || currentContext.activeVersion !== expectedVersion || currentContext.refreshNonce !== expectedRefreshNonce || currentContext.lifecycleGeneration !== expectedLifecycleGeneration)) {
4499
4578
  _context40.next = 8;
4500
4579
  break;
4501
4580
  }
4502
4581
  return _context40.abrupt("return", null);
4503
4582
  case 8:
4504
- projectionEntry = _this10.storeAvailabilityProjectionEntry({
4583
+ projectionEntry = _this12.storeAvailabilityProjectionEntry({
4505
4584
  contextId: currentContext.contextId,
4506
4585
  prepareParams: snapshot.prepareParams,
4507
4586
  prepareKey: currentContext.prepareKey,
@@ -4510,7 +4589,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4510
4589
  incrementVersion: true
4511
4590
  });
4512
4591
  _context40.next = 11;
4513
- return _this10.emitAvailabilityDiagnostic({
4592
+ return _this12.emitAvailabilityDiagnostic({
4514
4593
  action: 'refresh',
4515
4594
  contextId: currentContext.contextId,
4516
4595
  contextVersion: projectionEntry.contextVersion,
@@ -4774,8 +4853,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4774
4853
  value: (function () {
4775
4854
  var _getProductTimeRanges = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(contextId) {
4776
4855
  var _this$otherParams$pla2,
4777
- _this$otherParams22,
4778
- _this11 = this;
4856
+ _this$otherParams24,
4857
+ _this13 = this;
4779
4858
  var request,
4780
4859
  _yield$this$ensureAva,
4781
4860
  context,
@@ -4795,7 +4874,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4795
4874
  context = _yield$this$ensureAva.context;
4796
4875
  projectionEntry = _yield$this$ensureAva.projectionEntry;
4797
4876
  contextVersion = context.activeVersion;
4798
- isPosAvailabilityRequest = String((_this$otherParams$pla2 = (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.platform) !== null && _this$otherParams$pla2 !== void 0 ? _this$otherParams$pla2 : '').trim().toLowerCase() === 'pos';
4877
+ isPosAvailabilityRequest = String((_this$otherParams$pla2 = (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform) !== null && _this$otherParams$pla2 !== void 0 ? _this$otherParams$pla2 : '').trim().toLowerCase() === 'pos';
4799
4878
  allowOutsideOperatingHoursForRequestedStartTimes = isPosAvailabilityRequest && Object.values(request.durationStartTimesByProductId || {}).some(function (startTimes) {
4800
4879
  return Array.isArray(startTimes) && startTimes.length > 0;
4801
4880
  });
@@ -4809,7 +4888,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4809
4888
  }).map(function (group) {
4810
4889
  return _objectSpread(_objectSpread({}, group), {}, {
4811
4890
  ranges: group.ranges.map(function (candidate) {
4812
- return _this11.decorateAvailabilityCandidate(context.contextId, contextVersion, candidate);
4891
+ return _this13.decorateAvailabilityCandidate(context.contextId, contextVersion, candidate);
4813
4892
  })
4814
4893
  });
4815
4894
  }));
@@ -4828,7 +4907,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4828
4907
  key: "queryBookingAvailability",
4829
4908
  value: (function () {
4830
4909
  var _queryBookingAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(contextId, request) {
4831
- var _this$otherParams$pla3, _this$otherParams23;
4910
+ var _this$otherParams$pla3, _this$otherParams25;
4832
4911
  var _yield$this$ensureAva2, context, projectionEntry, refreshed, isPosAvailabilityRequest, result, contextVersion, contextualResult;
4833
4912
  return _regeneratorRuntime().wrap(function _callee47$(_context47) {
4834
4913
  while (1) switch (_context47.prev = _context47.next) {
@@ -4841,7 +4920,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4841
4920
  projectionEntry = _yield$this$ensureAva2.projectionEntry;
4842
4921
  refreshed = _yield$this$ensureAva2.refreshed;
4843
4922
  this.assertContextualQueryFreshness(context, request);
4844
- isPosAvailabilityRequest = String((_this$otherParams$pla3 = (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.platform) !== null && _this$otherParams$pla3 !== void 0 ? _this$otherParams$pla3 : '').trim().toLowerCase() === 'pos';
4923
+ isPosAvailabilityRequest = String((_this$otherParams$pla3 = (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.platform) !== null && _this$otherParams$pla3 !== void 0 ? _this$otherParams$pla3 : '').trim().toLowerCase() === 'pos';
4845
4924
  result = queryAvailabilityProjection(projectionEntry.projection, request, {
4846
4925
  useExactDurationCandidateMinute: isPosAvailabilityRequest,
4847
4926
  allowExcludedScheduleDateOverride: isPosAvailabilityRequest
@@ -4954,7 +5033,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
4954
5033
  key: "commitAvailabilitySelection",
4955
5034
  value: (function () {
4956
5035
  var _commitAvailabilitySelection = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(contextId, params) {
4957
- var normalizedContextId, _params$bookingCount, _ref53, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _baseProjection$meta$, _refreshedProjection$, _baseProjection$meta$2, _this$otherParams$pla4, _this$otherParams24, _ref54, _params$orderProduct$3, _params$orderProduct6, _existingBooking$meta, _ref55, _ref56, _params$orderProduct$4, _params$orderProduct7, _params$orderProduct8, _existingBooking$meta2, _existingBooking$hold, bookingCount, orderProductQuantity, partySize, _yield$this$ensureAva3, context, projectionEntry, refreshed, boundEditingUids, orderProductId, editingLine, _editingLine$product_2, baseProjection, commitWriteGuard, prepareParams, fallbackResources, commitSnapshot, refreshedProjection, _baseProjection$meta$3, latestContext, candidateDurationMinutes, candidateStartTime, allowPosAvailabilityOverride, refreshedRanges, refreshedCandidateBase, product, validation, forced, capacityConflict, revalidationEntry, revalidatedContext, refreshedCandidate, existingBooking, existingBookingUid, booking, transformed, productLineUid, bookingUid, productLineUids, bookingUids, _transformed$product_, _transformed$product_2, _transformed$product_3, _ref57, _transformed$product_4, _this$getTempOrder4, _this$getTempOrder5, _params$salesNotes, _this$getTempOrder6, beforeProductLineUids, beforeBookingUids, products, addedLines, addedBookings, nextContext, result;
5036
+ var normalizedContextId, _params$bookingCount, _ref53, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _baseProjection$meta$, _refreshedProjection$, _baseProjection$meta$2, _this$otherParams$pla4, _this$otherParams26, _ref54, _params$orderProduct$3, _params$orderProduct6, _existingBooking$meta, _ref55, _ref56, _params$orderProduct$4, _params$orderProduct7, _params$orderProduct8, _existingBooking$meta2, _existingBooking$hold, bookingCount, orderProductQuantity, partySize, _yield$this$ensureAva3, context, projectionEntry, refreshed, boundEditingUids, orderProductId, editingLine, _editingLine$product_2, baseProjection, commitWriteGuard, prepareParams, fallbackResources, commitSnapshot, refreshedProjection, _baseProjection$meta$3, latestContext, candidateDurationMinutes, candidateStartTime, allowPosAvailabilityOverride, refreshedRanges, refreshedCandidateBase, product, validation, forced, capacityConflict, revalidationEntry, revalidatedContext, refreshedCandidate, existingBooking, existingBookingUid, booking, transformed, productLineUid, bookingUid, productLineUids, bookingUids, _transformed$product_, _transformed$product_2, _transformed$product_3, _ref57, _transformed$product_4, _this$getTempOrder4, _this$getTempOrder5, _params$salesNotes, _this$getTempOrder6, beforeProductLineUids, beforeBookingUids, products, addedLines, addedBookings, nextContext, result;
4958
5037
  return _regeneratorRuntime().wrap(function _callee48$(_context48) {
4959
5038
  while (1) switch (_context48.prev = _context48.next) {
4960
5039
  case 0:
@@ -5184,7 +5263,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
5184
5263
  this.assertAvailabilityCommitWriteCAS(commitWriteGuard);
5185
5264
  candidateDurationMinutes = getCandidateDurationMinutes(params.candidate);
5186
5265
  candidateStartTime = getCandidateStartTime(params.candidate);
5187
- allowPosAvailabilityOverride = String((_this$otherParams$pla4 = (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform) !== null && _this$otherParams$pla4 !== void 0 ? _this$otherParams$pla4 : '').trim().toLowerCase() === 'pos';
5266
+ allowPosAvailabilityOverride = String((_this$otherParams$pla4 = (_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.platform) !== null && _this$otherParams$pla4 !== void 0 ? _this$otherParams$pla4 : '').trim().toLowerCase() === 'pos';
5188
5267
  refreshedRanges = getProjectionProductTimeRanges(refreshedProjection, _objectSpread({
5189
5268
  productIds: [params.candidate.productId],
5190
5269
  dateRange: {