ordering-ui-external 14.1.49 → 14.1.52

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 (126) hide show
  1. package/_bundles/{7.ordering-ui.697d19ddfcc29dfbeb52.js → 7.ordering-ui.746cebc54de638e8e528.js} +1 -1
  2. package/_bundles/ordering-ui.746cebc54de638e8e528.js +2 -0
  3. package/_modules/components/GoogleGpsButton/index.js +11 -3
  4. package/_modules/components/VerticalOrdersLayout/styles.js +1 -1
  5. package/_modules/themes/callcenterOriginal/index.js +7 -0
  6. package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +22 -5
  7. package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +10 -7
  8. package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +59 -19
  9. package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +10 -4
  10. package/_modules/themes/callcenterOriginal/src/components/ConfirmAddressForm/index.js +638 -0
  11. package/_modules/themes/callcenterOriginal/src/components/ConfirmAddressForm/styles.js +50 -0
  12. package/_modules/themes/callcenterOriginal/src/components/Header/index.js +33 -4
  13. package/_modules/themes/callcenterOriginal/src/components/InputPhoneNumber/index.js +17 -10
  14. package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +58 -106
  15. package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +6 -29
  16. package/_modules/themes/callcenterOriginal/src/components/SearchBar/index.js +2 -2
  17. package/_modules/themes/callcenterOriginal/src/components/SignUpForm/index.js +21 -1
  18. package/_modules/themes/callcenterOriginal/src/components/UserDetails/index.js +49 -8
  19. package/_modules/themes/callcenterOriginal/src/components/UserDetails/styles.js +12 -9
  20. package/_modules/themes/callcenterOriginal/src/components/UserFormDetails/index.js +30 -12
  21. package/_modules/themes/callcenterOriginal/src/components/UserFormDetails/styles.js +11 -5
  22. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
  23. package/_modules/themes/five/src/components/BusinessController/franchises/OloBusinessController/index.js +192 -0
  24. package/_modules/themes/five/src/components/BusinessController/franchises/OloBusinessController/styles.js +114 -0
  25. package/_modules/themes/five/src/components/BusinessesListing/franchises/OloBusinessesListing/index.js +572 -0
  26. package/_modules/themes/five/src/components/BusinessesListing/franchises/OloBusinessesListing/styles.js +89 -0
  27. package/_modules/themes/five/src/components/BusinessesListing/index.js +6 -2
  28. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +31 -118
  29. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
  30. package/_modules/themes/five/src/components/Checkout/OrderDetail.js +1 -3
  31. package/_modules/themes/five/src/components/Checkout/index.js +22 -4
  32. package/_modules/themes/five/src/components/DriverTips/styles.js +1 -1
  33. package/_modules/themes/five/src/components/Header/index.js +8 -7
  34. package/_modules/themes/five/src/components/Header/styles.js +28 -25
  35. package/_modules/themes/five/src/components/HighestRated/franchises/OloHighestRated/index.js +116 -0
  36. package/_modules/themes/five/src/components/HighestRated/franchises/OloHighestRated/styles.js +22 -0
  37. package/_modules/themes/five/src/components/HomeHero/franchises/OloHomeHero/index.js +136 -0
  38. package/_modules/themes/five/src/components/HomeHero/franchises/OloHomeHero/styles.js +46 -0
  39. package/_modules/themes/five/src/components/HomeHero/index.js +5 -2
  40. package/_modules/themes/five/src/components/InputPhoneNumber/index.js +19 -12
  41. package/_modules/themes/five/src/components/LogoutPopup/index.js +2 -1
  42. package/_modules/themes/five/src/components/Modal/index.js +6 -3
  43. package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +2 -2
  44. package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +2 -1
  45. package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
  46. package/_modules/themes/five/src/components/OrderTypesSquares/index.js +160 -0
  47. package/_modules/themes/five/src/components/OrderTypesSquares/styles.js +39 -0
  48. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +4 -4
  49. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +1 -1
  50. package/_modules/themes/five/src/components/SearchBar/index.js +2 -2
  51. package/_modules/themes/five/src/components/SignUpForm/index.js +11 -8
  52. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  53. package/_modules/themes/five/src/components/UserDetails/index.js +5 -2
  54. package/_modules/themes/five/src/styles/Buttons/index.js +1 -1
  55. package/index-template.js +9 -1
  56. package/package.json +2 -2
  57. package/src/components/GoogleGpsButton/index.js +10 -2
  58. package/src/components/VerticalOrdersLayout/styles.js +2 -2
  59. package/src/themes/callcenterOriginal/index.js +2 -0
  60. package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +44 -23
  61. package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +8 -0
  62. package/src/themes/callcenterOriginal/src/components/AddressList/index.js +67 -22
  63. package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +16 -1
  64. package/src/themes/callcenterOriginal/src/components/ConfirmAddressForm/index.js +579 -0
  65. package/src/themes/callcenterOriginal/src/components/ConfirmAddressForm/styles.js +275 -0
  66. package/src/themes/callcenterOriginal/src/components/Header/index.js +22 -0
  67. package/src/themes/callcenterOriginal/src/components/InputPhoneNumber/index.js +13 -8
  68. package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +34 -100
  69. package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +0 -52
  70. package/src/themes/callcenterOriginal/src/components/SearchBar/index.js +2 -2
  71. package/src/themes/callcenterOriginal/src/components/SignUpForm/index.js +19 -1
  72. package/src/themes/callcenterOriginal/src/components/UserDetails/index.js +45 -11
  73. package/src/themes/callcenterOriginal/src/components/UserDetails/styles.js +3 -1
  74. package/src/themes/callcenterOriginal/src/components/UserFormDetails/index.js +40 -14
  75. package/src/themes/callcenterOriginal/src/components/UserFormDetails/styles.js +19 -1
  76. package/src/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
  77. package/src/themes/five/src/components/BusinessController/franchises/OloBusinessController/index.js +237 -0
  78. package/src/themes/five/src/components/BusinessController/franchises/OloBusinessController/styles.js +367 -0
  79. package/src/themes/five/src/components/BusinessesListing/franchises/OloBusinessesListing/index.js +582 -0
  80. package/src/themes/five/src/components/BusinessesListing/franchises/OloBusinessesListing/styles.js +307 -0
  81. package/src/themes/five/src/components/BusinessesListing/index.js +19 -4
  82. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +7 -104
  83. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +2 -2
  84. package/src/themes/five/src/components/Checkout/OrderDetail.js +1 -5
  85. package/src/themes/five/src/components/Checkout/index.js +20 -2
  86. package/src/themes/five/src/components/DriverTips/styles.js +1 -0
  87. package/src/themes/five/src/components/Header/index.js +17 -12
  88. package/src/themes/five/src/components/Header/styles.js +51 -4
  89. package/src/themes/five/src/components/HighestRated/franchises/OloHighestRated/index.js +114 -0
  90. package/src/themes/five/src/components/HighestRated/franchises/OloHighestRated/styles.js +57 -0
  91. package/src/themes/five/src/components/HomeHero/franchises/OloHomeHero/index.js +122 -0
  92. package/src/themes/five/src/components/HomeHero/franchises/OloHomeHero/styles.js +125 -0
  93. package/src/themes/five/src/components/HomeHero/index.js +16 -3
  94. package/src/themes/five/src/components/InputPhoneNumber/index.js +14 -9
  95. package/src/themes/five/src/components/LogoutPopup/index.js +3 -1
  96. package/src/themes/five/src/components/Modal/index.js +6 -3
  97. package/src/themes/five/src/components/MultiOrdersDetails/styles.js +3 -3
  98. package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +3 -1
  99. package/src/themes/five/src/components/OrderItAgain/styles.js +2 -0
  100. package/src/themes/five/src/components/OrderTypesSquares/index.js +157 -0
  101. package/src/themes/five/src/components/OrderTypesSquares/styles.js +62 -0
  102. package/src/themes/five/src/components/ProductItemAccordion/index.js +2 -2
  103. package/src/themes/five/src/components/RenderProductsLayout/styles.js +2 -0
  104. package/src/themes/five/src/components/SearchBar/index.js +2 -2
  105. package/src/themes/five/src/components/SignUpForm/index.js +5 -3
  106. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  107. package/src/themes/five/src/components/UserDetails/index.js +3 -1
  108. package/src/themes/five/src/styles/Buttons/index.js +2 -2
  109. package/template/app.js +14 -11
  110. package/template/assets/images/catering.svg +13 -0
  111. package/template/assets/images/curbside.svg +19 -0
  112. package/template/assets/images/drivethru.svg +19 -0
  113. package/template/assets/images/eatin.svg +17 -0
  114. package/template/components/SubdomainComponent/index.js +4 -8
  115. package/template/pages/BusinessesList/index.js +1 -1
  116. package/_bundles/ordering-ui.697d19ddfcc29dfbeb52.js +0 -2
  117. /package/_bundles/{0.ordering-ui.697d19ddfcc29dfbeb52.js → 0.ordering-ui.746cebc54de638e8e528.js} +0 -0
  118. /package/_bundles/{1.ordering-ui.697d19ddfcc29dfbeb52.js → 1.ordering-ui.746cebc54de638e8e528.js} +0 -0
  119. /package/_bundles/{2.ordering-ui.697d19ddfcc29dfbeb52.js → 2.ordering-ui.746cebc54de638e8e528.js} +0 -0
  120. /package/_bundles/{4.ordering-ui.697d19ddfcc29dfbeb52.js → 4.ordering-ui.746cebc54de638e8e528.js} +0 -0
  121. /package/_bundles/{5.ordering-ui.697d19ddfcc29dfbeb52.js → 5.ordering-ui.746cebc54de638e8e528.js} +0 -0
  122. /package/_bundles/{6.ordering-ui.697d19ddfcc29dfbeb52.js → 6.ordering-ui.746cebc54de638e8e528.js} +0 -0
  123. /package/_bundles/{7.ordering-ui.697d19ddfcc29dfbeb52.js.LICENSE.txt → 7.ordering-ui.746cebc54de638e8e528.js.LICENSE.txt} +0 -0
  124. /package/_bundles/{8.ordering-ui.697d19ddfcc29dfbeb52.js → 8.ordering-ui.746cebc54de638e8e528.js} +0 -0
  125. /package/_bundles/{9.ordering-ui.697d19ddfcc29dfbeb52.js → 9.ordering-ui.746cebc54de638e8e528.js} +0 -0
  126. /package/_bundles/{ordering-ui.697d19ddfcc29dfbeb52.js.LICENSE.txt → ordering-ui.746cebc54de638e8e528.js.LICENSE.txt} +0 -0
@@ -0,0 +1,572 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.OloBusinessesListing = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _styledComponents = require("styled-components");
10
+ var _orderingComponentsExternal = require("ordering-components-external");
11
+ var _styles = require("./styles");
12
+ var _Buttons = require("../../../../styles/Buttons");
13
+ var _NotFoundSource = require("../../../NotFoundSource");
14
+ var _Modal = require("../../../Modal");
15
+ var _Confirm = require("../../../Confirm");
16
+ var _OloBusinessController = require("../../../BusinessController/franchises/OloBusinessController");
17
+ var _OloHighestRated = require("../../../HighestRated/franchises/OloHighestRated");
18
+ var _BusinessPreorder = require("../../../BusinessPreorder");
19
+ var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
20
+ var _CitiesControl = require("../../../CitiesControl");
21
+ var _utils = require("../../../../../../../utils");
22
+ var _AddressList = require("../../../AddressList");
23
+ var _AddressForm = require("../../../AddressForm");
24
+ var _Pagination = require("../../../Pagination");
25
+ var _HiOutlineLocationMarker = _interopRequireDefault(require("@meronex/icons/hi/HiOutlineLocationMarker"));
26
+ var _RiArrowDropDownLine = _interopRequireDefault(require("@meronex/icons/ri/RiArrowDropDownLine"));
27
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
29
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
30
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
31
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
32
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
34
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
35
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
37
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
38
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
39
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
40
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
41
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
42
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
43
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
44
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
45
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
46
+ var OloBusinessesListingUI = function OloBusinessesListingUI(props) {
47
+ var _orderState$options, _orderState$options2, _theme$business_listi, _theme$header, _orderState$options3, _orderState$options4, _configs$order_types_, _configs$google_maps_, _configs$unaddressed_, _orderState$options5, _businessesList$busin2, _orderState$options9, _theme$images2, _theme$images3, _theme$images4, _orderState$options12, _theme$defaultLanguag, _citiesState$cities4, _orderState$options14, _orderState$options15, _orderState$options16, _businessesList$busin6, _orderState$options18, _orderState$options20, _orderState$options21, _orderState$options22, _configs$meters_to_ch, _orderState$options23;
48
+ var businessesList = props.businessesList,
49
+ paginationProps = props.paginationProps,
50
+ getBusinesses = props.getBusinesses,
51
+ isCustomLayout = props.isCustomLayout,
52
+ isCustomerMode = props.isCustomerMode,
53
+ handleBusinessClick = props.handleBusinessClick,
54
+ _onBusinessClick = props.onBusinessClick,
55
+ handleUpdateBusinessList = props.handleUpdateBusinessList,
56
+ getCities = props.getCities,
57
+ citiesState = props.citiesState,
58
+ orderTypes = props.orderTypes,
59
+ franchiseId = props.franchiseId;
60
+ var allOrderTypes = [1, 2, 3, 4, 5, 7, 8];
61
+ var pickupTypes = [2, 3, 4, 5];
62
+ var cateringTypes = [7, 8];
63
+ var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
64
+ _useLanguage2 = _slicedToArray(_useLanguage, 2),
65
+ t = _useLanguage2[1];
66
+ var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
67
+ _useOrder2 = _slicedToArray(_useOrder, 2),
68
+ orderState = _useOrder2[0],
69
+ _useOrder2$ = _useOrder2[1],
70
+ changeCityFilter = _useOrder2$.changeCityFilter,
71
+ changeType = _useOrder2$.changeType;
72
+ var _useSession = (0, _orderingComponentsExternal.useSession)(),
73
+ _useSession2 = _slicedToArray(_useSession, 1),
74
+ auth = _useSession2[0].auth;
75
+ var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
76
+ _useConfig2 = _slicedToArray(_useConfig, 1),
77
+ configs = _useConfig2[0].configs;
78
+ var theme = (0, _styledComponents.useTheme)();
79
+ var _useState = (0, _react.useState)({
80
+ listOpen: false,
81
+ formOpen: false,
82
+ citiesOpen: false
83
+ }),
84
+ _useState2 = _slicedToArray(_useState, 2),
85
+ modals = _useState2[0],
86
+ setModals = _useState2[1];
87
+ var _useState3 = (0, _react.useState)({
88
+ open: false,
89
+ content: []
90
+ }),
91
+ _useState4 = _slicedToArray(_useState3, 2),
92
+ alertState = _useState4[0],
93
+ setAlertState = _useState4[1];
94
+ var _useState5 = (0, _react.useState)(''),
95
+ _useState6 = _slicedToArray(_useState5, 2),
96
+ mapErrors = _useState6[0],
97
+ setMapErrors = _useState6[1];
98
+ var _useState7 = (0, _react.useState)(false),
99
+ _useState8 = _slicedToArray(_useState7, 2),
100
+ isPreorder = _useState8[0],
101
+ setIsPreorder = _useState8[1];
102
+ var _useState9 = (0, _react.useState)(null),
103
+ _useState10 = _slicedToArray(_useState9, 2),
104
+ preorderBusiness = _useState10[0],
105
+ setPreorderBusiness = _useState10[1];
106
+ var _useState11 = (0, _react.useState)(true),
107
+ _useState12 = _slicedToArray(_useState11, 2),
108
+ hasHighRatedBusiness = _useState12[0],
109
+ setHasHighRatedBusiness = _useState12[1];
110
+ var _useState13 = (0, _react.useState)(pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type)),
111
+ _useState14 = _slicedToArray(_useState13, 2),
112
+ isPickupSelected = _useState14[0],
113
+ setIsPickupSelected = _useState14[1];
114
+ var _useState15 = (0, _react.useState)(cateringTypes.includes(orderState === null || orderState === void 0 || (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type)),
115
+ _useState16 = _slicedToArray(_useState15, 2),
116
+ isCateringSelected = _useState16[0],
117
+ setIsCateringSelected = _useState16[1];
118
+ var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
119
+ var _useState17 = (0, _react.useState)([]),
120
+ _useState18 = _slicedToArray(_useState17, 2),
121
+ favoriteIds = _useState18[0],
122
+ setFavoriteIds = _useState18[1];
123
+ var _useState19 = (0, _react.useState)([]),
124
+ _useState20 = _slicedToArray(_useState19, 2),
125
+ businessesLocations = _useState20[0],
126
+ setBusinessesLocations = _useState20[1];
127
+ var _useState21 = (0, _react.useState)(false),
128
+ _useState22 = _slicedToArray(_useState21, 2),
129
+ filterByCity = _useState22[0],
130
+ setFilterByCity = _useState22[1];
131
+ var _useState23 = (0, _react.useState)(null),
132
+ _useState24 = _slicedToArray(_useState23, 2),
133
+ citySelected = _useState24[0],
134
+ setCitySelected = _useState24[1];
135
+ var hideHighestBusiness = theme === null || theme === void 0 || (_theme$business_listi = theme.business_listing_view) === null || _theme$business_listi === void 0 || (_theme$business_listi = _theme$business_listi.components) === null || _theme$business_listi === void 0 || (_theme$business_listi = _theme$business_listi.highest_rated_business_block) === null || _theme$business_listi === void 0 ? void 0 : _theme$business_listi.hidden;
136
+ var isChew = (theme === null || theme === void 0 || (_theme$header = theme.header) === null || _theme$header === void 0 || (_theme$header = _theme$header.components) === null || _theme$header === void 0 || (_theme$header = _theme$header.layout) === null || _theme$header === void 0 || (_theme$header = _theme$header.type) === null || _theme$header === void 0 ? void 0 : _theme$header.toLowerCase()) === 'chew';
137
+ var cateringTypeString = (orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type) === 7 ? 'catering_delivery' : (orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type) === 8 ? 'catering_pickup' : null;
138
+ var configTypes = (configs === null || configs === void 0 || (_configs$order_types_ = configs.order_types_allowed) === null || _configs$order_types_ === void 0 ? void 0 : _configs$order_types_.value.split('|').filter(function (value) {
139
+ return allOrderTypes.includes(Number(value));
140
+ }).map(function (value) {
141
+ return Number(value);
142
+ })) || [];
143
+ var cateringValues = (preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs) && (0, _utils.getCateringValues)(cateringTypeString, preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs);
144
+ var googleMapsApiKey = configs === null || configs === void 0 || (_configs$google_maps_ = configs.google_maps_api_key) === null || _configs$google_maps_ === void 0 ? void 0 : _configs$google_maps_.value;
145
+ var unaddressedTypes = (configs === null || configs === void 0 || (_configs$unaddressed_ = configs.unaddressed_order_types_allowed) === null || _configs$unaddressed_ === void 0 ? void 0 : _configs$unaddressed_.value.split('|').map(function (value) {
146
+ return Number(value);
147
+ })) || [];
148
+ var isAllowUnaddressOrderType = unaddressedTypes.includes(orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type);
149
+ var defaultLocation = {
150
+ lat: 40.7744146,
151
+ lng: -73.9678064
152
+ };
153
+ var handleClickAddress = function handleClickAddress(e) {
154
+ if (auth) {
155
+ setModals(_objectSpread(_objectSpread({}, modals), {}, {
156
+ listOpen: true
157
+ }));
158
+ } else {
159
+ setModals(_objectSpread(_objectSpread({}, modals), {}, {
160
+ formOpen: true
161
+ }));
162
+ }
163
+ };
164
+ var handleCloseAlerts = function handleCloseAlerts() {
165
+ setAlertState({
166
+ open: false,
167
+ content: []
168
+ });
169
+ setMapErrors('');
170
+ };
171
+ var handleClosePreorder = function handleClosePreorder() {
172
+ setIsPreorder(false);
173
+ setPreorderBusiness(null);
174
+ };
175
+ var handleOpenCities = function handleOpenCities(value) {
176
+ var _citiesState$cities;
177
+ if (!(citiesState !== null && citiesState !== void 0 && (_citiesState$cities = citiesState.cities) !== null && _citiesState$cities !== void 0 && _citiesState$cities.length)) {
178
+ getCities();
179
+ }
180
+ setFilterByCity(value);
181
+ };
182
+ var handleChangeCity = function handleChangeCity(cityId) {
183
+ var _orderState$options6;
184
+ changeCityFilter(cityId === (orderState === null || orderState === void 0 || (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.city_id) ? null : cityId);
185
+ };
186
+ var handleChangeType = function handleChangeType(value) {
187
+ if (!(orderState !== null && orderState !== void 0 && orderState.loading)) {
188
+ changeType(value);
189
+ if (value === 1) {
190
+ setIsPickupSelected(false);
191
+ setIsCateringSelected(false);
192
+ }
193
+ }
194
+ };
195
+ var handleChangeOrderTypes = function handleChangeOrderTypes(configTypes, isPickup) {
196
+ var _orderTypes$find;
197
+ var firstEnabledPickupType = (_orderTypes$find = orderTypes.find(function (type) {
198
+ return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
199
+ })) === null || _orderTypes$find === void 0 ? void 0 : _orderTypes$find.value;
200
+ handleChangeType(firstEnabledPickupType);
201
+ if (isPickup) {
202
+ setIsPickupSelected(true);
203
+ setIsCateringSelected(false);
204
+ } else {
205
+ setIsCateringSelected(true);
206
+ setIsPickupSelected(false);
207
+ }
208
+ };
209
+ (0, _react.useEffect)(function () {
210
+ if (preorderBusiness) setIsPreorder(true);
211
+ }, [preorderBusiness]);
212
+ (0, _react.useEffect)(function () {
213
+ var _businessesList$busin;
214
+ if (!(businessesList !== null && businessesList !== void 0 && (_businessesList$busin = businessesList.businesses) !== null && _businessesList$busin !== void 0 && _businessesList$busin.length)) return;
215
+ var ids = _toConsumableArray(favoriteIds);
216
+ businessesList.businesses.forEach(function (business) {
217
+ if (business !== null && business !== void 0 && business.favorite) {
218
+ ids.push(business.id);
219
+ }
220
+ });
221
+ setFavoriteIds(_toConsumableArray(new Set(ids)));
222
+ }, [businessesList === null || businessesList === void 0 || (_businessesList$busin2 = businessesList.businesses) === null || _businessesList$busin2 === void 0 ? void 0 : _businessesList$busin2.length]);
223
+ (0, _react.useEffect)(function () {
224
+ var _citiesState$cities2, _orderState$options7, _citiesState$cities3;
225
+ if (!(citiesState !== null && citiesState !== void 0 && (_citiesState$cities2 = citiesState.cities) !== null && _citiesState$cities2 !== void 0 && _citiesState$cities2.length) || !(orderState !== null && orderState !== void 0 && (_orderState$options7 = orderState.options) !== null && _orderState$options7 !== void 0 && _orderState$options7.city_id)) return;
226
+ var selectedCity = citiesState === null || citiesState === void 0 || (_citiesState$cities3 = citiesState.cities) === null || _citiesState$cities3 === void 0 ? void 0 : _citiesState$cities3.find(function (city) {
227
+ var _orderState$options8;
228
+ return (city === null || city === void 0 ? void 0 : city.id) === (orderState === null || orderState === void 0 || (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.city_id);
229
+ });
230
+ if (!selectedCity || !(selectedCity !== null && selectedCity !== void 0 && selectedCity.enabled)) changeCityFilter(null);
231
+ }, [citiesState, orderState === null || orderState === void 0 || (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.city_id]);
232
+ (0, _react.useEffect)(function () {
233
+ var _businessesList$busin3;
234
+ setBusinessesLocations(businessesList === null || businessesList === void 0 || (_businessesList$busin3 = businessesList.businesses) === null || _businessesList$busin3 === void 0 ? void 0 : _businessesList$busin3.map(function (business) {
235
+ var _theme$images;
236
+ return _objectSpread(_objectSpread({}, business === null || business === void 0 ? void 0 : business.location), {}, {
237
+ icon: (business === null || business === void 0 ? void 0 : business.logo) || (theme === null || theme === void 0 || (_theme$images = theme.images) === null || _theme$images === void 0 || (_theme$images = _theme$images.dummies) === null || _theme$images === void 0 ? void 0 : _theme$images.businessLogo),
238
+ slug: business === null || business === void 0 ? void 0 : business.slug,
239
+ id: business === null || business === void 0 ? void 0 : business.id,
240
+ address: business === null || business === void 0 ? void 0 : business.address
241
+ });
242
+ }));
243
+ }, [businessesList === null || businessesList === void 0 ? void 0 : businessesList.businesses]);
244
+ var googleMapsControls = {
245
+ defaultZoom: 17,
246
+ zoomControl: true,
247
+ streetViewControl: false,
248
+ fullscreenControl: false,
249
+ mapTypeId: 'roadmap',
250
+ // 'roadmap', 'satellite', 'hybrid', 'terrain'
251
+ mapTypeControl: true,
252
+ mapTypeControlOptions: {
253
+ mapTypeIds: ['roadmap', 'satellite']
254
+ },
255
+ isMarkerDraggable: false
256
+ };
257
+ var OrderTypesComponent = function OrderTypesComponent(_ref) {
258
+ var title = _ref.title,
259
+ configTypes = _ref.configTypes;
260
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.AdditionalTypesWrapper, null, /*#__PURE__*/_react.default.createElement("p", null, title), /*#__PURE__*/_react.default.createElement(_styles.AdditionalTypesContainer, null, orderTypes && (configTypes ? orderTypes.filter(function (type) {
261
+ return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
262
+ }) : orderTypes).map(function (item, i) {
263
+ var _orderState$options10, _orderState$options11;
264
+ return /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
265
+ key: item.value,
266
+ onClick: function onClick() {
267
+ return handleChangeType(item.value);
268
+ },
269
+ color: (orderState === null || orderState === void 0 || (_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.type) === (item === null || item === void 0 ? void 0 : item.value) ? 'primary' : 'secondary',
270
+ disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
271
+ className: (orderState === null || orderState === void 0 || (_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : _orderState$options11.type) !== (item === null || item === void 0 ? void 0 : item.value) ? 'activated' : ''
272
+ }, item.text);
273
+ }))));
274
+ };
275
+ return /*#__PURE__*/_react.default.createElement(_styles.BusinessContainer, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessListContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('SELECT_YOUR_DELIVERY_TYPE', 'Select your Delivery type')), /*#__PURE__*/_react.default.createElement(_styles.Subtitle, null, t('SELECT_YOUR_DELIVERY_TYPE_DESCRIPTION', 'Please select the type of delivery for your order.')), /*#__PURE__*/_react.default.createElement(_styles.TypesContainer, null, configTypes.includes(1) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
276
+ onClick: function onClick() {
277
+ return handleChangeType(1);
278
+ },
279
+ disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
280
+ activated: !isPickupSelected && !isCateringSelected
281
+ }, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
282
+ activated: !isPickupSelected && !isCateringSelected
283
+ }, /*#__PURE__*/_react.default.createElement("img", {
284
+ src: theme === null || theme === void 0 || (_theme$images2 = theme.images) === null || _theme$images2 === void 0 || (_theme$images2 = _theme$images2.general) === null || _theme$images2 === void 0 ? void 0 : _theme$images2.deliveryIco,
285
+ width: 20,
286
+ height: 20
287
+ })), /*#__PURE__*/_react.default.createElement("p", null, t('DELIVERY', 'Delivery'))), configTypes.some(function (type) {
288
+ return pickupTypes.includes(type);
289
+ }) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
290
+ disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
291
+ activated: isPickupSelected,
292
+ onClick: function onClick() {
293
+ return handleChangeOrderTypes(pickupTypes, true);
294
+ }
295
+ }, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
296
+ activated: isPickupSelected
297
+ }, /*#__PURE__*/_react.default.createElement("img", {
298
+ src: theme === null || theme === void 0 || (_theme$images3 = theme.images) === null || _theme$images3 === void 0 || (_theme$images3 = _theme$images3.general) === null || _theme$images3 === void 0 ? void 0 : _theme$images3.pickupIco,
299
+ width: 22,
300
+ height: 22
301
+ })), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup'))), configTypes.some(function (type) {
302
+ return cateringTypes.includes(type);
303
+ }) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
304
+ disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
305
+ activated: isCateringSelected,
306
+ onClick: function onClick() {
307
+ return handleChangeOrderTypes(cateringTypes);
308
+ }
309
+ }, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
310
+ activated: isCateringSelected
311
+ }, /*#__PURE__*/_react.default.createElement("img", {
312
+ src: theme === null || theme === void 0 || (_theme$images4 = theme.images) === null || _theme$images4 === void 0 || (_theme$images4 = _theme$images4.general) === null || _theme$images4 === void 0 ? void 0 : _theme$images4.cateringIco,
313
+ width: 22,
314
+ height: 22
315
+ })), /*#__PURE__*/_react.default.createElement("p", null, t('CATERING', 'Catering')))), isPickupSelected && /*#__PURE__*/_react.default.createElement(OrderTypesComponent, {
316
+ title: t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?'),
317
+ configTypes: pickupTypes
318
+ }), isCateringSelected && /*#__PURE__*/_react.default.createElement(OrderTypesComponent, {
319
+ title: t('WHAT_CATERING_YOU_NEED', 'What kind of catering do you need?'),
320
+ configTypes: cateringTypes
321
+ }), /*#__PURE__*/_react.default.createElement(_styles.WrapInput, {
322
+ onClick: handleClickAddress,
323
+ withIcon: true
324
+ }, /*#__PURE__*/_react.default.createElement(_HiOutlineLocationMarker.default, null), /*#__PURE__*/_react.default.createElement("p", null, (orderState === null || orderState === void 0 || (_orderState$options12 = orderState.options) === null || _orderState$options12 === void 0 || (_orderState$options12 = _orderState$options12.address) === null || _orderState$options12 === void 0 ? void 0 : _orderState$options12.address) || t('WHERE_DO_WE_DELIVERY', (theme === null || theme === void 0 || (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.WHERE_DO_WE_DELIVERY) || 'Where do we delivery?'))), /*#__PURE__*/_react.default.createElement(_styles.ViewLocations, null, /*#__PURE__*/_react.default.createElement("p", {
325
+ onClick: function onClick() {
326
+ return filterByCity ? handleOpenCities(false) : handleOpenCities(true);
327
+ }
328
+ }, filterByCity ? t('HIDE_LOCATIONS', 'Hide locations') : t('VIEW_ALL_LOCATIONS', 'View all locations'))), filterByCity && /*#__PURE__*/_react.default.createElement(_styles.CitiesContainer, null, citiesState === null || citiesState === void 0 || (_citiesState$cities4 = citiesState.cities) === null || _citiesState$cities4 === void 0 || (_citiesState$cities4 = _citiesState$cities4.filter(function (city) {
329
+ var _businessesList$busin4;
330
+ return (_businessesList$busin4 = businessesList.businesses) === null || _businessesList$busin4 === void 0 ? void 0 : _businessesList$busin4.some(function (business) {
331
+ return (business === null || business === void 0 ? void 0 : business.city_id) === (city === null || city === void 0 ? void 0 : city.id);
332
+ });
333
+ })) === null || _citiesState$cities4 === void 0 ? void 0 : _citiesState$cities4.map(function (city, i, hash) {
334
+ var _businessesList$busin5;
335
+ return /*#__PURE__*/_react.default.createElement("div", {
336
+ key: city === null || city === void 0 ? void 0 : city.id
337
+ }, /*#__PURE__*/_react.default.createElement(_styles.CityContainer, {
338
+ isSelected: (citySelected === null || citySelected === void 0 ? void 0 : citySelected.id) === (city === null || city === void 0 ? void 0 : city.id),
339
+ onClick: function onClick() {
340
+ return setCitySelected((citySelected === null || citySelected === void 0 ? void 0 : citySelected.id) === (city === null || city === void 0 ? void 0 : city.id) ? null : city);
341
+ }
342
+ }, /*#__PURE__*/_react.default.createElement("h3", null, city === null || city === void 0 ? void 0 : city.name), /*#__PURE__*/_react.default.createElement(_RiArrowDropDownLine.default, {
343
+ size: 18
344
+ })), (citySelected === null || citySelected === void 0 ? void 0 : citySelected.id) === (city === null || city === void 0 ? void 0 : city.id) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_businessesList$busin5 = businessesList.businesses) === null || _businessesList$busin5 === void 0 || (_businessesList$busin5 = _businessesList$busin5.filter(function (business) {
345
+ return (business === null || business === void 0 ? void 0 : business.city_id) === (city === null || city === void 0 ? void 0 : city.id);
346
+ })) === null || _businessesList$busin5 === void 0 ? void 0 : _businessesList$busin5.map(function (business) {
347
+ var _orderState$options13, _business$reviews;
348
+ return /*#__PURE__*/_react.default.createElement(_OloBusinessController.BusinessController, {
349
+ key: business.id,
350
+ className: "card",
351
+ business: business,
352
+ isBusinessOpen: business.open,
353
+ handleCustomClick: handleBusinessClick,
354
+ orderType: orderState === null || orderState === void 0 || (_orderState$options13 = orderState.options) === null || _orderState$options13 === void 0 ? void 0 : _orderState$options13.type,
355
+ isCustomLayout: isCustomLayout,
356
+ isCustomerMode: isCustomerMode,
357
+ onPreorderBusiness: setPreorderBusiness,
358
+ businessHeader: business === null || business === void 0 ? void 0 : business.header,
359
+ businessFeatured: business === null || business === void 0 ? void 0 : business.featured,
360
+ businessOffers: business === null || business === void 0 ? void 0 : business.offers,
361
+ businessLogo: business === null || business === void 0 ? void 0 : business.logo,
362
+ businessReviews: business === null || business === void 0 || (_business$reviews = business.reviews) === null || _business$reviews === void 0 ? void 0 : _business$reviews.total,
363
+ businessDeliveryPrice: business === null || business === void 0 ? void 0 : business.delivery_price,
364
+ businessDeliveryTime: business === null || business === void 0 ? void 0 : business.delivery_time,
365
+ businessPickupTime: business === null || business === void 0 ? void 0 : business.pickup_time,
366
+ businessDistance: business === null || business === void 0 ? void 0 : business.distance,
367
+ handleUpdateBusinessList: handleUpdateBusinessList,
368
+ favoriteIds: favoriteIds,
369
+ setFavoriteIds: setFavoriteIds
370
+ });
371
+ }), (paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.totalPages) && (paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.currentPage) < (paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.totalPages) && /*#__PURE__*/_react.default.createElement(_styles.LoadMoreButtonCityWrap, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
372
+ onClick: function onClick() {
373
+ return getBusinesses();
374
+ },
375
+ color: "primary"
376
+ }, t('LOAD_MORE_BUSINESSES', 'Load more businesses')))), i + 1 !== (hash === null || hash === void 0 ? void 0 : hash.length) && /*#__PURE__*/_react.default.createElement(_styles.Separator, null));
377
+ })), filterByCity && (citiesState === null || citiesState === void 0 ? void 0 : citiesState.loading) && _toConsumableArray(Array(4)).map(function (_, i) {
378
+ return /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
379
+ height: 70,
380
+ style: {
381
+ marginBottom: 5
382
+ },
383
+ key: i
384
+ });
385
+ }), !filterByCity && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (isAllowUnaddressOrderType || (orderState === null || orderState === void 0 || (_orderState$options14 = orderState.options) === null || _orderState$options14 === void 0 || (_orderState$options14 = _orderState$options14.address) === null || _orderState$options14 === void 0 ? void 0 : _orderState$options14.location)) && !isChew && hasHighRatedBusiness && !hideHighestBusiness && /*#__PURE__*/_react.default.createElement(_styles.HightestRatedWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_OloHighestRated.HighestRated, {
386
+ propsToFetch: props.propsToFetch,
387
+ handleClickAddress: handleClickAddress,
388
+ setHasHighRatedBusiness: setHasHighRatedBusiness,
389
+ onBusinessClick: _onBusinessClick,
390
+ isCustomerMode: isCustomerMode,
391
+ favoriteIds: favoriteIds,
392
+ setFavoriteIds: setFavoriteIds,
393
+ disabledCities: true,
394
+ franchiseId: franchiseId
395
+ }), /*#__PURE__*/_react.default.createElement(_styles.Divider, null)), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessList, null, (isAllowUnaddressOrderType || (orderState === null || orderState === void 0 || (_orderState$options15 = orderState.options) === null || _orderState$options15 === void 0 || (_orderState$options15 = _orderState$options15.address) === null || _orderState$options15 === void 0 ? void 0 : _orderState$options15.location)) && !businessesList.loading && businessesList.businesses.length === 0 && (businessesList === null || businessesList === void 0 ? void 0 : businessesList.fetched) && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
396
+ content: t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')
397
+ }, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
398
+ outline: true,
399
+ color: "primary",
400
+ onClick: function onClick() {
401
+ return handleClickAddress();
402
+ },
403
+ style: {
404
+ height: '44px'
405
+ }
406
+ }, t('CHANGE_ADDRESS', 'Select other Address'))), isAllowUnaddressOrderType || orderState !== null && orderState !== void 0 && (_orderState$options16 = orderState.options) !== null && _orderState$options16 !== void 0 && (_orderState$options16 = _orderState$options16.address) !== null && _orderState$options16 !== void 0 && _orderState$options16.location ? (_businessesList$busin6 = businessesList.businesses) === null || _businessesList$busin6 === void 0 ? void 0 : _businessesList$busin6.map(function (business) {
407
+ var _orderState$options17, _business$reviews2;
408
+ return /*#__PURE__*/_react.default.createElement(_OloBusinessController.BusinessController, {
409
+ key: business.id,
410
+ className: "card",
411
+ business: business,
412
+ isBusinessOpen: business.open,
413
+ handleCustomClick: handleBusinessClick,
414
+ orderType: orderState === null || orderState === void 0 || (_orderState$options17 = orderState.options) === null || _orderState$options17 === void 0 ? void 0 : _orderState$options17.type,
415
+ isCustomLayout: isCustomLayout,
416
+ isCustomerMode: isCustomerMode,
417
+ onPreorderBusiness: setPreorderBusiness,
418
+ businessHeader: business === null || business === void 0 ? void 0 : business.header,
419
+ businessFeatured: business === null || business === void 0 ? void 0 : business.featured,
420
+ businessOffers: business === null || business === void 0 ? void 0 : business.offers,
421
+ businessLogo: business === null || business === void 0 ? void 0 : business.logo,
422
+ businessReviews: business === null || business === void 0 || (_business$reviews2 = business.reviews) === null || _business$reviews2 === void 0 ? void 0 : _business$reviews2.total,
423
+ businessDeliveryPrice: business === null || business === void 0 ? void 0 : business.delivery_price,
424
+ businessDeliveryTime: business === null || business === void 0 ? void 0 : business.delivery_time,
425
+ businessPickupTime: business === null || business === void 0 ? void 0 : business.pickup_time,
426
+ businessDistance: business === null || business === void 0 ? void 0 : business.distance,
427
+ handleUpdateBusinessList: handleUpdateBusinessList,
428
+ favoriteIds: favoriteIds,
429
+ setFavoriteIds: setFavoriteIds
430
+ });
431
+ }) : /*#__PURE__*/_react.default.createElement("p", null, t('ENTER_FULL_ADDRESS_TO_ORDER', 'Enter your full street address to start your delivery order.')), (isAllowUnaddressOrderType || (orderState === null || orderState === void 0 || (_orderState$options18 = orderState.options) === null || _orderState$options18 === void 0 || (_orderState$options18 = _orderState$options18.address) === null || _orderState$options18 === void 0 ? void 0 : _orderState$options18.location)) && (businessesList.loading || !(businessesList !== null && businessesList !== void 0 && businessesList.fetched)) && _toConsumableArray(Array((paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.nextPageItems) > 4 ? paginationProps.nextPageItems : 8).keys()).map(function (i) {
432
+ var _orderState$options19;
433
+ return /*#__PURE__*/_react.default.createElement(_OloBusinessController.BusinessController, {
434
+ key: i,
435
+ className: "card",
436
+ business: {},
437
+ isSkeleton: true,
438
+ orderType: orderState === null || orderState === void 0 || (_orderState$options19 = orderState.options) === null || _orderState$options19 === void 0 ? void 0 : _orderState$options19.type
439
+ });
440
+ }), (isAllowUnaddressOrderType || (orderState === null || orderState === void 0 || (_orderState$options20 = orderState.options) === null || _orderState$options20 === void 0 || (_orderState$options20 = _orderState$options20.address) === null || _orderState$options20 === void 0 ? void 0 : _orderState$options20.location)) && /*#__PURE__*/_react.default.createElement(_styles.PaginationContainer, null, /*#__PURE__*/_react.default.createElement(_Pagination.Pagination, {
441
+ currentPage: paginationProps.currentPage,
442
+ totalPages: Math.ceil(paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.totalPages),
443
+ handleChangePage: function handleChangePage(page) {
444
+ return getBusinesses(true, page);
445
+ }
446
+ })))))), !!googleMapsApiKey && ((orderState === null || orderState === void 0 || (_orderState$options21 = orderState.options) === null || _orderState$options21 === void 0 || (_orderState$options21 = _orderState$options21.address) === null || _orderState$options21 === void 0 ? void 0 : _orderState$options21.location) || isAllowUnaddressOrderType) && /*#__PURE__*/_react.default.createElement(_styles.WrapperMap, null, /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.GoogleMapsMap, {
447
+ apiKey: googleMapsApiKey,
448
+ location: (orderState === null || orderState === void 0 || (_orderState$options22 = orderState.options) === null || _orderState$options22 === void 0 || (_orderState$options22 = _orderState$options22.address) === null || _orderState$options22 === void 0 ? void 0 : _orderState$options22.location) || defaultLocation,
449
+ locations: businessesLocations,
450
+ onBusinessClick: function onBusinessClick(slug) {
451
+ return _onBusinessClick({
452
+ slug: slug
453
+ });
454
+ },
455
+ businessMap: true,
456
+ noDistanceValidation: true,
457
+ mapControls: googleMapsControls,
458
+ maxLimitLocation: parseInt(configs === null || configs === void 0 || (_configs$meters_to_ch = configs.meters_to_change_address) === null || _configs$meters_to_ch === void 0 ? void 0 : _configs$meters_to_ch.value)
459
+ })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
460
+ open: isPreorder,
461
+ width: "760px",
462
+ onClose: function onClose() {
463
+ return handleClosePreorder();
464
+ }
465
+ }, /*#__PURE__*/_react.default.createElement(_BusinessPreorder.BusinessPreorder, _extends({
466
+ business: preorderBusiness,
467
+ handleClick: handleBusinessClick,
468
+ showButton: true,
469
+ cateringPreorder: !!cateringTypeString
470
+ }, cateringValues))), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
471
+ open: modals.citiesOpen,
472
+ width: "70%",
473
+ onClose: function onClose() {
474
+ return setModals(_objectSpread(_objectSpread({}, modals), {}, {
475
+ citiesOpen: false
476
+ }));
477
+ },
478
+ padding: "0px",
479
+ hideCloseDefault: true
480
+ }, /*#__PURE__*/_react.default.createElement(_CitiesControl.CitiesControl, {
481
+ cities: citiesState === null || citiesState === void 0 ? void 0 : citiesState.cities,
482
+ handleChangeCity: handleChangeCity,
483
+ onClose: function onClose() {
484
+ return setModals(_objectSpread(_objectSpread({}, modals), {}, {
485
+ citiesOpen: false
486
+ }));
487
+ }
488
+ })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, _extends({}, !auth && {
489
+ title: t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')
490
+ }, {
491
+ open: modals.formOpen || modals.listOpen,
492
+ width: "70%",
493
+ onClose: function onClose() {
494
+ return setModals(_objectSpread(_objectSpread({}, modals), {}, {
495
+ formOpen: false,
496
+ listOpen: false
497
+ }));
498
+ }
499
+ }), modals.listOpen ? /*#__PURE__*/_react.default.createElement(_AddressList.AddressList, {
500
+ isModal: true,
501
+ changeOrderAddressWithDefault: true,
502
+ userId: isNaN(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id) ? null : userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id,
503
+ onCancel: function onCancel() {
504
+ return setModals(_objectSpread(_objectSpread({}, modals), {}, {
505
+ listOpen: false
506
+ }));
507
+ },
508
+ isCustomerMode: isCustomerMode
509
+ }) : /*#__PURE__*/_react.default.createElement(_styles.AddressFormWrapper, null, /*#__PURE__*/_react.default.createElement(_AddressForm.AddressForm, {
510
+ useValidationFileds: true,
511
+ address: (orderState === null || orderState === void 0 || (_orderState$options23 = orderState.options) === null || _orderState$options23 === void 0 ? void 0 : _orderState$options23.address) || {},
512
+ onCancel: function onCancel() {
513
+ return setModals(_objectSpread(_objectSpread({}, modals), {}, {
514
+ formOpen: false
515
+ }));
516
+ },
517
+ onSaveAddress: function onSaveAddress() {
518
+ return setModals(_objectSpread(_objectSpread({}, modals), {}, {
519
+ formOpen: false
520
+ }));
521
+ },
522
+ isCustomerMode: isCustomerMode
523
+ }))), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
524
+ title: !mapErrors ? t('SEARCH', 'Search') : t('BUSINESSES_MAP', 'Businesses Map'),
525
+ content: alertState.content,
526
+ acceptText: t('ACCEPT', 'Accept'),
527
+ open: alertState.open,
528
+ onClose: function onClose() {
529
+ return handleCloseAlerts();
530
+ },
531
+ onAccept: function onAccept() {
532
+ return handleCloseAlerts();
533
+ },
534
+ closeOnBackdrop: false
535
+ }));
536
+ };
537
+ var OloBusinessesListing = exports.OloBusinessesListing = function OloBusinessesListing(props) {
538
+ var _useLanguage3 = (0, _orderingComponentsExternal.useLanguage)(),
539
+ _useLanguage4 = _slicedToArray(_useLanguage3, 2),
540
+ t = _useLanguage4[1];
541
+ var businessListingProps = _objectSpread(_objectSpread({}, props), {}, {
542
+ UIComponent: OloBusinessesListingUI,
543
+ paginationSettings: {
544
+ initialPage: 1,
545
+ pageSize: 25,
546
+ controlType: 'infinity'
547
+ },
548
+ orderTypes: props.orderTypes || [{
549
+ value: 1,
550
+ text: t('DELIVERY', 'Delivery')
551
+ }, {
552
+ value: 2,
553
+ text: t('PICKUP', 'Pickup')
554
+ }, {
555
+ value: 3,
556
+ text: t('EAT_IN', 'Eat in')
557
+ }, {
558
+ value: 4,
559
+ text: t('CURBSIDE', 'Curbside')
560
+ }, {
561
+ value: 5,
562
+ text: t('DRIVE_THRU', 'Drive thru')
563
+ }, {
564
+ value: 7,
565
+ text: t('CATERING_DELIVERY', 'Catering delivery')
566
+ }, {
567
+ value: 8,
568
+ text: t('CATERING_PICKUP', 'Catering pickup')
569
+ }]
570
+ });
571
+ return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.BusinessList, businessListingProps);
572
+ };