ordering-ui-external 2.6.5 → 2.6.8

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 (97) hide show
  1. package/_bundles/0.ordering-ui.ba64d5c9c7490676feb5.js +1 -0
  2. package/_bundles/{5.ordering-ui.80bc71775c11b08c37b2.js → 5.ordering-ui.ba64d5c9c7490676feb5.js} +1 -1
  3. package/_bundles/{7.ordering-ui.80bc71775c11b08c37b2.js → 7.ordering-ui.ba64d5c9c7490676feb5.js} +2 -2
  4. package/_bundles/ordering-ui.ba64d5c9c7490676feb5.js +2 -0
  5. package/_modules/components/LanguageSelector/index.js +1 -0
  6. package/_modules/components/OrderTypeSelectorHeader/index.js +3 -1
  7. package/_modules/components/SmartAppBanner/index.js +5 -2
  8. package/_modules/contexts/ThemeContext/index.js +1 -1
  9. package/_modules/styles/Select/index.js +14 -2
  10. package/_modules/styles/Selects/index.js +11 -8
  11. package/_modules/themes/callcenterOriginal/src/components/Orders/OrderMetaFields/index.js +1 -1
  12. package/_modules/themes/eight/src/components/AddressForm/index.js +4 -1
  13. package/_modules/themes/eight/src/components/SingleProductCard/index.js +1 -1
  14. package/_modules/themes/five/src/components/BusinessBasicInformation/BusinessInfoComponent.js +168 -0
  15. package/_modules/themes/five/src/components/BusinessBasicInformation/SearchComponent.js +39 -0
  16. package/_modules/themes/five/src/components/BusinessBasicInformation/SocialNetWork.js +19 -0
  17. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +35 -156
  18. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +45 -35
  19. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +1 -1
  20. package/_modules/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/index.js +1 -1
  21. package/_modules/themes/five/src/components/CardForm/index.js +16 -3
  22. package/_modules/themes/five/src/components/CardForm/styles.js +13 -9
  23. package/_modules/themes/five/src/components/CardFormCustom/cardUtils.js +102 -0
  24. package/_modules/themes/five/src/components/CardFormCustom/index.js +148 -0
  25. package/_modules/themes/five/src/components/CardFormCustom/styles.js +16 -0
  26. package/_modules/themes/five/src/components/CartPopover/styles.js +1 -1
  27. package/_modules/themes/five/src/components/Checkout/index.js +31 -22
  28. package/_modules/themes/five/src/components/LanguageSelector/index.js +4 -1
  29. package/_modules/themes/five/src/components/LoginForm/index.js +11 -8
  30. package/_modules/themes/five/src/components/Modal/styles.js +1 -1
  31. package/_modules/themes/five/src/components/OrderContextUI/index.js +13 -1
  32. package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +7 -3
  33. package/_modules/themes/five/src/components/OrderDetails/index.js +4 -2
  34. package/_modules/themes/five/src/components/PaymentOptionCard/index.js +84 -0
  35. package/_modules/themes/five/src/components/PaymentOptionStripe/index.js +48 -22
  36. package/_modules/themes/five/src/components/PaymentOptionStripe/styles.js +3 -1
  37. package/_modules/themes/five/src/components/PaymentOptions/index.js +46 -24
  38. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +1 -1
  39. package/_modules/themes/five/src/components/SearchProducts/styles.js +1 -1
  40. package/_modules/themes/five/src/components/UserDetails/index.js +1 -1
  41. package/_modules/themes/five/src/components/UserPopover/styles.js +1 -1
  42. package/_modules/themes/five/src/styles/Select/index.js +4 -2
  43. package/_modules/themes/five/src/styles/Selects/index.js +7 -4
  44. package/_modules/themes/four/src/components/LoginForm/index.js +1 -1
  45. package/_modules/themes/pwa/src/components/MomentPopover/styles.js +1 -1
  46. package/_modules/themes/seven/src/components/ProductForm/productForm.js +3 -1
  47. package/_modules/themes/six/src/components/BusinessesListing/index.js +1 -1
  48. package/index.html +1 -1
  49. package/package.json +4 -2
  50. package/src/components/LanguageSelector/index.js +1 -0
  51. package/src/components/OrderTypeSelectorHeader/index.js +3 -1
  52. package/src/components/SmartAppBanner/index.js +4 -2
  53. package/src/contexts/ThemeContext/index.js +1 -1
  54. package/src/styles/Select/index.js +11 -2
  55. package/src/styles/Selects/index.js +1 -1
  56. package/src/themes/five/src/components/BusinessBasicInformation/BusinessInfoComponent.js +230 -0
  57. package/src/themes/five/src/components/BusinessBasicInformation/SearchComponent.js +40 -0
  58. package/src/themes/five/src/components/BusinessBasicInformation/SocialNetWork.js +10 -0
  59. package/src/themes/five/src/components/BusinessBasicInformation/index.js +39 -247
  60. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +14 -4
  61. package/src/themes/five/src/components/BusinessProductsCategories/index.js +1 -1
  62. package/src/themes/five/src/components/CardForm/index.js +25 -4
  63. package/src/themes/five/src/components/CardForm/styles.js +35 -0
  64. package/src/themes/five/src/components/CardFormCustom/cardUtils.js +111 -0
  65. package/src/themes/five/src/components/CardFormCustom/index.js +161 -0
  66. package/src/themes/five/src/components/CardFormCustom/styles.js +20 -0
  67. package/src/themes/five/src/components/CartPopover/styles.js +1 -1
  68. package/src/themes/five/src/components/Checkout/index.js +34 -25
  69. package/src/themes/five/src/components/LanguageSelector/index.js +2 -1
  70. package/src/themes/five/src/components/LoginForm/index.js +6 -4
  71. package/src/themes/five/src/components/Modal/styles.js +1 -0
  72. package/src/themes/five/src/components/OrderContextUI/index.js +10 -3
  73. package/src/themes/five/src/components/OrderDetails/OrderHistory.js +4 -3
  74. package/src/themes/five/src/components/OrderDetails/index.js +1 -1
  75. package/src/themes/five/src/components/PaymentOptionCard/index.js +70 -0
  76. package/src/themes/five/src/components/PaymentOptionStripe/index.js +46 -20
  77. package/src/themes/five/src/components/PaymentOptionStripe/styles.js +6 -1
  78. package/src/themes/five/src/components/PaymentOptions/index.js +28 -3
  79. package/src/themes/five/src/components/ProductForm/index.js +0 -1
  80. package/src/themes/five/src/components/RenderProductsLayout/index.js +1 -1
  81. package/src/themes/five/src/components/SearchProducts/styles.js +1 -1
  82. package/src/themes/five/src/components/UserDetails/index.js +1 -1
  83. package/src/themes/five/src/components/UserPopover/styles.js +1 -1
  84. package/src/themes/five/src/styles/Select/index.js +3 -2
  85. package/src/themes/five/src/styles/Selects/index.js +1 -1
  86. package/src/themes/pwa/src/components/MomentPopover/styles.js +4 -1
  87. package/template/theme.json +3 -1
  88. package/_bundles/0.ordering-ui.80bc71775c11b08c37b2.js +0 -1
  89. package/_bundles/ordering-ui.80bc71775c11b08c37b2.js +0 -2
  90. /package/_bundles/{1.ordering-ui.80bc71775c11b08c37b2.js → 1.ordering-ui.ba64d5c9c7490676feb5.js} +0 -0
  91. /package/_bundles/{2.ordering-ui.80bc71775c11b08c37b2.js → 2.ordering-ui.ba64d5c9c7490676feb5.js} +0 -0
  92. /package/_bundles/{4.ordering-ui.80bc71775c11b08c37b2.js → 4.ordering-ui.ba64d5c9c7490676feb5.js} +0 -0
  93. /package/_bundles/{6.ordering-ui.80bc71775c11b08c37b2.js → 6.ordering-ui.ba64d5c9c7490676feb5.js} +0 -0
  94. /package/_bundles/{7.ordering-ui.80bc71775c11b08c37b2.js.LICENSE.txt → 7.ordering-ui.ba64d5c9c7490676feb5.js.LICENSE.txt} +0 -0
  95. /package/_bundles/{8.ordering-ui.80bc71775c11b08c37b2.js → 8.ordering-ui.ba64d5c9c7490676feb5.js} +0 -0
  96. /package/_bundles/{9.ordering-ui.80bc71775c11b08c37b2.js → 9.ordering-ui.ba64d5c9c7490676feb5.js} +0 -0
  97. /package/_bundles/{ordering-ui.80bc71775c11b08c37b2.js.LICENSE.txt → ordering-ui.ba64d5c9c7490676feb5.js.LICENSE.txt} +0 -0
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getCardType = exports.formatExpirationDate = exports.formatCreditCardNumber = exports.formatCVC = void 0;
7
+ var _payment = _interopRequireDefault(require("payment"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ var clearNumber = function clearNumber() {
10
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11
+ return value.replace(/\D+/g, '');
12
+ };
13
+ var formatCreditCardNumber = function formatCreditCardNumber(value) {
14
+ if (!value) {
15
+ return value;
16
+ }
17
+ var issuer = _payment.default.fns.cardType(value);
18
+ var clearValue = clearNumber(value);
19
+ var nextValue;
20
+ switch (issuer) {
21
+ case 'amex':
22
+ nextValue = "".concat(clearValue.slice(0, 4), " ").concat(clearValue.slice(4, 10), " ").concat(clearValue.slice(10, 15));
23
+ break;
24
+ case 'dinersclub':
25
+ nextValue = "".concat(clearValue.slice(0, 4), " ").concat(clearValue.slice(4, 10), " ").concat(clearValue.slice(10, 14));
26
+ break;
27
+ default:
28
+ nextValue = "".concat(clearValue.slice(0, 4), " ").concat(clearValue.slice(4, 8), " ").concat(clearValue.slice(8, 12), " ").concat(clearValue.slice(12, 19));
29
+ break;
30
+ }
31
+ return nextValue.trim();
32
+ };
33
+ exports.formatCreditCardNumber = formatCreditCardNumber;
34
+ var formatCVC = function formatCVC(value, prevValue) {
35
+ var allValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
36
+ var clearValue = clearNumber(value);
37
+ var maxLength = 4;
38
+ if (allValues.number) {
39
+ var issuer = _payment.default.fns.cardType(allValues.number);
40
+ maxLength = issuer === 'amex' ? 4 : 3;
41
+ }
42
+ return clearValue.slice(0, maxLength);
43
+ };
44
+ exports.formatCVC = formatCVC;
45
+ var formatExpirationDate = function formatExpirationDate(value) {
46
+ var clearValue = clearNumber(value);
47
+ if (clearValue.length >= 3) {
48
+ return "".concat(clearValue.slice(0, 2), "/").concat(clearValue.slice(2, 4));
49
+ }
50
+ return clearValue;
51
+ };
52
+ exports.formatExpirationDate = formatExpirationDate;
53
+ var getCardType = function getCardType(number) {
54
+ // visa
55
+ var re = new RegExp('^4');
56
+ if (number.match(re) != null) {
57
+ return 'Visa';
58
+ }
59
+
60
+ // Mastercard
61
+ // Updated for Mastercard 2017 BINs expansion
62
+ if (/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(number)) {
63
+ return 'Mastercard';
64
+ }
65
+ // AMEX
66
+ re = new RegExp('^3[47]');
67
+ if (number.match(re) != null) {
68
+ return 'AMEX';
69
+ }
70
+
71
+ // Discover
72
+ re = new RegExp('^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)');
73
+ if (number.match(re) != null) {
74
+ return 'Discover';
75
+ }
76
+
77
+ // Diners
78
+ re = new RegExp('^36');
79
+ if (number.match(re) != null) {
80
+ return 'Diners';
81
+ }
82
+
83
+ // Diners - Carte Blanche
84
+ re = new RegExp('^30[0-5]');
85
+ if (number.match(re) != null) {
86
+ return 'Diners - Carte Blanche';
87
+ }
88
+
89
+ // JCB
90
+ re = new RegExp('^35(2[89]|[3-8][0-9])');
91
+ if (number.match(re) != null) {
92
+ return 'JCB';
93
+ }
94
+
95
+ // Visa Electron
96
+ re = new RegExp('^(4026|417500|4508|4844|491(3|7))');
97
+ if (number.match(re) != null) {
98
+ return 'Visa Electron';
99
+ }
100
+ return '';
101
+ };
102
+ exports.getCardType = getCardType;
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.CardFormCustom = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactCreditCards = _interopRequireDefault(require("react-credit-cards-2"));
10
+ require("react-credit-cards-2/es/styles-compiled.css");
11
+ var _cardUtils = require("./cardUtils");
12
+ var _reactHookForm = require("react-hook-form");
13
+ var _Inputs = require("../../styles/Inputs");
14
+ var _orderingComponentsExternal = require("ordering-components-external");
15
+ var _Buttons = _interopRequireDefault(require("../../styles/Buttons"));
16
+ var _styles = require("./styles");
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
+ 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; }
23
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
24
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
25
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
+ 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."); }
27
+ 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); }
28
+ 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; }
29
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
30
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
+ var CardFormCustom = function CardFormCustom(props) {
32
+ var _Object$keys;
33
+ var handleNewCard = props.handleNewCard,
34
+ setAddCardOpen = props.setAddCardOpen;
35
+ var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
36
+ _useLanguage2 = _slicedToArray(_useLanguage, 2),
37
+ t = _useLanguage2[1];
38
+ var _useState = (0, _react.useState)({
39
+ cvc: '',
40
+ expiry: '',
41
+ focus: '',
42
+ name: '',
43
+ number: ''
44
+ }),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ formState = _useState2[0],
47
+ setFormState = _useState2[1];
48
+ var formMethods = (0, _reactHookForm.useForm)();
49
+ var handleInputFocus = function handleInputFocus(e) {
50
+ setFormState(_objectSpread(_objectSpread({}, formState), {}, {
51
+ focus: e.target.name
52
+ }));
53
+ };
54
+ var handleInputChange = function handleInputChange(_ref) {
55
+ var target = _ref.target;
56
+ if (target.name === 'number') {
57
+ target.value = (0, _cardUtils.formatCreditCardNumber)(target.value);
58
+ } else if (target.name === 'expiry') {
59
+ target.value = (0, _cardUtils.formatExpirationDate)(target.value);
60
+ } else if (target.name === 'cvc') {
61
+ target.value = (0, _cardUtils.formatCVC)(target.value);
62
+ }
63
+ setFormState(_objectSpread(_objectSpread({}, formState), {}, _defineProperty({}, target.name, target.value)));
64
+ };
65
+ var onSubmit = function onSubmit(values) {
66
+ var _values$number, _values$expiry;
67
+ var cardBrand = (0, _cardUtils.getCardType)(values === null || values === void 0 ? void 0 : values.number);
68
+ var lastFourDigits = values === null || values === void 0 ? void 0 : values.number.substr(-4);
69
+ var card = {
70
+ type: 'card',
71
+ brand: cardBrand,
72
+ last4: lastFourDigits,
73
+ ccnumber: values === null || values === void 0 ? void 0 : (_values$number = values.number) === null || _values$number === void 0 ? void 0 : _values$number.replace(/\s/g, ''),
74
+ ccexp: values === null || values === void 0 ? void 0 : (_values$expiry = values.expiry) === null || _values$expiry === void 0 ? void 0 : _values$expiry.replace('/', ''),
75
+ cvv: values === null || values === void 0 ? void 0 : values.cvc
76
+ };
77
+ handleNewCard(card);
78
+ setAddCardOpen(false);
79
+ };
80
+ return /*#__PURE__*/_react.default.createElement(_styles.FormContainer, {
81
+ id: "PaymentForm"
82
+ }, /*#__PURE__*/_react.default.createElement(_reactCreditCards.default, {
83
+ cvc: formState.cvc,
84
+ expiry: formState.expiry,
85
+ focused: formState.focus,
86
+ name: formState.name,
87
+ number: formState.number,
88
+ placeholders: {
89
+ name: t('YOUR_NAME_HERE', 'Your name here')
90
+ }
91
+ }), /*#__PURE__*/_react.default.createElement("form", {
92
+ onSubmit: formMethods.handleSubmit(onSubmit)
93
+ }, /*#__PURE__*/_react.default.createElement(_styles.InputContainer, null, /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
94
+ type: "tel",
95
+ name: "number",
96
+ placeholder: t('CARD_NUMBER', 'Card number'),
97
+ inputMode: "numeric",
98
+ onChange: handleInputChange,
99
+ onFocus: handleInputFocus,
100
+ pattern: "[\\d| ]{16,22}",
101
+ format: _cardUtils.formatCreditCardNumber,
102
+ maxLength: 19,
103
+ ref: formMethods.register({
104
+ required: t('CARD_NUMBER_REQUIRED', 'Card number is required'),
105
+ pattern: /^[\d| ]{16,22}$/i
106
+ }),
107
+ isError: formMethods.errors.number
108
+ })), /*#__PURE__*/_react.default.createElement(_styles.InputContainer, null, /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
109
+ type: "text",
110
+ name: "name",
111
+ placeholder: t('NAME', 'Name'),
112
+ onChange: handleInputChange,
113
+ onFocus: handleInputFocus,
114
+ ref: formMethods.register({
115
+ required: t('NAME_REQUIRED', 'Name is required')
116
+ }),
117
+ isError: formMethods.errors.name
118
+ })), /*#__PURE__*/_react.default.createElement(_styles.InputContainer, null, /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
119
+ type: "text",
120
+ name: "expiry",
121
+ pattern: "\\d\\d/\\d\\d",
122
+ placeholder: t('EXPIRY', 'Expiry'),
123
+ onChange: handleInputChange,
124
+ onFocus: handleInputFocus,
125
+ format: _cardUtils.formatExpirationDate,
126
+ ref: formMethods.register({
127
+ required: t('EXPIRY_DATE_REQUIRED', 'Expiry date required')
128
+ }),
129
+ isError: formMethods.errors.expiry
130
+ }), /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
131
+ type: "text",
132
+ name: "cvc",
133
+ placeholder: t('CVC', 'CVC'),
134
+ pattern: "\\d{3,4}",
135
+ onChange: handleInputChange,
136
+ onFocus: handleInputFocus,
137
+ format: _cardUtils.formatCVC,
138
+ ref: formMethods.register({
139
+ required: t('CVC_REQUIRED', 'CVC is required')
140
+ }),
141
+ isError: formMethods.errors.cvc
142
+ })), /*#__PURE__*/_react.default.createElement(_Buttons.default, {
143
+ type: "submit",
144
+ color: "primary",
145
+ disabled: ((_Object$keys = Object.keys(formMethods.errors)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0
146
+ }, t('SAVE', 'Save'))));
147
+ };
148
+ exports.CardFormCustom = CardFormCustom;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.InputContainer = exports.FormContainer = void 0;
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+ var _templateObject, _templateObject2;
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
+ var InputContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n justify-content: space-between;\n\n input{\n box-sizing: border-box;\n width: 100%;\n margin: 10px;\n }\n"])));
14
+ exports.InputContainer = InputContainer;
15
+ var FormContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n button{\n width: 100%;\n margin: 10px;\n }\n"])));
16
+ exports.FormContainer = FormContainer;
@@ -19,7 +19,7 @@ var HeaderItem = _styledComponents.default.div(_templateObject || (_templateObje
19
19
  return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.rtl ? (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-left: 10px;\n "])));
20
20
  });
21
21
  exports.HeaderItem = HeaderItem;
22
- var PopoverBody = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: #FFF;\n color: #333;\n padding: 15px;\n border-radius: 10px;\n max-width: 500px;\n z-index: 2000;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 8px 24px;\n"])));
22
+ var PopoverBody = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: #FFF;\n color: #333;\n padding: 15px;\n border-radius: 10px;\n max-width: 500px;\n z-index: 10002;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 8px 24px;\n"])));
23
23
  exports.PopoverBody = PopoverBody;
24
24
  var PopoverArrow = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 0;\n height: 0;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 8px solid #FFF;\n top: -8px;\n"])));
25
25
  exports.PopoverArrow = PopoverArrow;
@@ -167,6 +167,7 @@ var CheckoutUI = function CheckoutUI(props) {
167
167
  _useState22 = _slicedToArray(_useState21, 2),
168
168
  cardList = _useState22[0],
169
169
  setCardList = _useState22[1];
170
+ var cardsMethods = ['stripe', 'credomatic'];
170
171
  var businessConfigs = (_businessDetails$busi = businessDetails === null || businessDetails === void 0 ? void 0 : (_businessDetails$busi2 = businessDetails.business) === null || _businessDetails$busi2 === void 0 ? void 0 : _businessDetails$busi2.configs) !== null && _businessDetails$busi !== void 0 ? _businessDetails$busi : [];
171
172
  var isTableNumberEnabled = configs === null || configs === void 0 ? void 0 : (_configs$table_numer_ = configs.table_numer_enabled) === null || _configs$table_numer_ === void 0 ? void 0 : _configs$table_numer_.value;
172
173
  var isWalletCashEnabled = ((_businessConfigs$find = businessConfigs.find(function (config) {
@@ -183,7 +184,7 @@ var CheckoutUI = function CheckoutUI(props) {
183
184
  // const [hasBusinessPlaces, setHasBusinessPlaces] = useState(null)
184
185
 
185
186
  var validateCommentsCartField = (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie = validationFields.fields) === null || _validationFields$fie === void 0 ? void 0 : (_validationFields$fie2 = _validationFields$fie.checkout) === null || _validationFields$fie2 === void 0 ? void 0 : (_validationFields$fie3 = _validationFields$fie2.comments) === null || _validationFields$fie3 === void 0 ? void 0 : _validationFields$fie3.enabled) && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie4 = validationFields.fields) === null || _validationFields$fie4 === void 0 ? void 0 : (_validationFields$fie5 = _validationFields$fie4.checkout) === null || _validationFields$fie5 === void 0 ? void 0 : (_validationFields$fie6 = _validationFields$fie5.comments) === null || _validationFields$fie6 === void 0 ? void 0 : _validationFields$fie6.required) && ((cart === null || cart === void 0 ? void 0 : cart.comment) === null || (cart === null || cart === void 0 ? void 0 : (_cart$comment = cart.comment) === null || _cart$comment === void 0 ? void 0 : _cart$comment.trim().length) === 0);
186
- var isDisablePlaceOrderButton = !(cart !== null && cart !== void 0 && cart.valid) || !paymethodSelected && (cart === null || cart === void 0 ? void 0 : cart.balance) > 0 || (paymethodSelected === null || paymethodSelected === void 0 ? void 0 : paymethodSelected.gateway) === 'stripe' && (cardList === null || cardList === void 0 ? void 0 : (_cardList$cards = cardList.cards) === null || _cardList$cards === void 0 ? void 0 : _cardList$cards.length) === 0 || placing || errorCash || loading || isTableNumberEnabled === '1' && (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cartState !== null && cartState !== void 0 && (_cartState$cart = cartState.cart) !== null && _cartState$cart !== void 0 && _cartState$cart.spot_number || cart !== null && cart !== void 0 && cart.spot_number || placeSpotNumber) || !(cart !== null && cart !== void 0 && cart.valid_maximum) || !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ||
187
+ var isDisablePlaceOrderButton = !(cart !== null && cart !== void 0 && cart.valid) || !paymethodSelected && (cart === null || cart === void 0 ? void 0 : cart.balance) > 0 || cardsMethods.includes(paymethodSelected === null || paymethodSelected === void 0 ? void 0 : paymethodSelected.gateway) && (cardList === null || cardList === void 0 ? void 0 : (_cardList$cards = cardList.cards) === null || _cardList$cards === void 0 ? void 0 : _cardList$cards.length) === 0 || placing || errorCash || loading || isTableNumberEnabled === '1' && (options === null || options === void 0 ? void 0 : options.type) === 3 && !(cartState !== null && cartState !== void 0 && (_cartState$cart = cartState.cart) !== null && _cartState$cart !== void 0 && _cartState$cart.spot_number || cart !== null && cart !== void 0 && cart.spot_number || placeSpotNumber) || !(cart !== null && cart !== void 0 && cart.valid_maximum) || !(cart !== null && cart !== void 0 && cart.valid_minimum) && !((cart === null || cart === void 0 ? void 0 : cart.discount_type) === 1 && (cart === null || cart === void 0 ? void 0 : cart.discount_rate) === 100) ||
187
188
  // (((placeSpotTypes.includes(options?.type) && !cart?.place) && hasBusinessPlaces)) ||
188
189
  options.type === 1 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie7 = validationFields.fields) === null || _validationFields$fie7 === void 0 ? void 0 : (_validationFields$fie8 = _validationFields$fie7.checkout) === null || _validationFields$fie8 === void 0 ? void 0 : (_validationFields$fie9 = _validationFields$fie8.driver_tip) === null || _validationFields$fie9 === void 0 ? void 0 : _validationFields$fie9.enabled) && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie10 = validationFields.fields) === null || _validationFields$fie10 === void 0 ? void 0 : (_validationFields$fie11 = _validationFields$fie10.checkout) === null || _validationFields$fie11 === void 0 ? void 0 : (_validationFields$fie12 = _validationFields$fie11.driver_tip) === null || _validationFields$fie12 === void 0 ? void 0 : _validationFields$fie12.required) && Number(cart === null || cart === void 0 ? void 0 : cart.driver_tip) <= 0 || validateCommentsCartField;
189
190
  var driverTipsOptions = typeof (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o = configs.driver_tip_options) === null || _configs$driver_tip_o === void 0 ? void 0 : _configs$driver_tip_o.value) === 'string' ? JSON.parse(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o2 = configs.driver_tip_options) === null || _configs$driver_tip_o2 === void 0 ? void 0 : _configs$driver_tip_o2.value) || [] : (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o3 = configs.driver_tip_options) === null || _configs$driver_tip_o3 === void 0 ? void 0 : _configs$driver_tip_o3.value) || [];
@@ -264,7 +265,7 @@ var CheckoutUI = function CheckoutUI(props) {
264
265
  if (userSelected && userSelected !== null && userSelected !== void 0 && userSelected.cellphone) {
265
266
  if (userSelected !== null && userSelected !== void 0 && userSelected.country_phone_code) {
266
267
  var phone = null;
267
- phone = "+".concat(userSelected === null || userSelected === void 0 ? void 0 : userSelected.country_phone_code).concat(userSelected === null || userSelected === void 0 ? void 0 : userSelected.cellphone);
268
+ phone = "+".concat(userSelected === null || userSelected === void 0 ? void 0 : userSelected.country_phone_code).concat(userSelected === null || userSelected === void 0 ? void 0 : userSelected.cellphone.replace("+".concat(userSelected === null || userSelected === void 0 ? void 0 : userSelected.country_phone_code), ''));
268
269
  var phoneNumber = (0, _libphonenumberJs.default)(phone);
269
270
  if (!(phoneNumber !== null && phoneNumber !== void 0 && phoneNumber.isValid())) {
270
271
  errors.push(t('VALIDATION_ERROR_MOBILE_PHONE_INVALID', 'The field Phone number is invalid.'));
@@ -706,7 +707,7 @@ var Checkout = function Checkout(props) {
706
707
  }, [errors]);
707
708
  var getOrder = /*#__PURE__*/function () {
708
709
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(cartId) {
709
- var _result$order, result, cart, userCustomer, url, response, content, _confirmCartRes$resul, confirmCartRes, _cart, spotNumberFromStorage, _JSON$parse, _JSON$parse2, _cart2, _cart2$business, spotNumber, slug;
710
+ var _result$order, result, cart, userCustomer, url, response, content, _result, _result$paymethod_dat, credomaticData, urlParams, paramsObj, _confirmCartRes$resul, confirmCartRes, _cart, spotNumberFromStorage, _JSON$parse, _JSON$parse2, _cart2, _cart2$business, spotNumber, slug;
710
711
  return _regeneratorRuntime().wrap(function _callee$(_context) {
711
712
  while (1) switch (_context.prev = _context.next) {
712
713
  case 0:
@@ -753,17 +754,25 @@ var Checkout = function Checkout(props) {
753
754
  setCartState(_objectSpread(_objectSpread({}, cartState), {}, {
754
755
  loading: false
755
756
  }));
756
- _context.next = 41;
757
+ _context.next = 43;
757
758
  break;
758
759
  case 22:
759
760
  if (!(result.status === 2)) {
760
- _context.next = 37;
761
+ _context.next = 39;
761
762
  break;
762
763
  }
763
- _context.prev = 23;
764
- _context.next = 26;
765
- return confirmCart(cartUuid);
766
- case 26:
764
+ credomaticData = null;
765
+ if (((_result = result) === null || _result === void 0 ? void 0 : (_result$paymethod_dat = _result.paymethod_data) === null || _result$paymethod_dat === void 0 ? void 0 : _result$paymethod_dat.gateway) === 'credomatic') {
766
+ urlParams = new URLSearchParams(window.location.search);
767
+ paramsObj = Object.fromEntries(urlParams.entries());
768
+ credomaticData = {
769
+ credomatic: _objectSpread({}, paramsObj)
770
+ };
771
+ }
772
+ _context.prev = 25;
773
+ _context.next = 28;
774
+ return confirmCart(cartUuid, credomaticData);
775
+ case 28:
767
776
  confirmCartRes = _context.sent;
768
777
  if (confirmCartRes.error) {
769
778
  setAlertState({
@@ -779,19 +788,19 @@ var Checkout = function Checkout(props) {
779
788
  loading: false,
780
789
  cart: result
781
790
  }));
782
- _context.next = 35;
791
+ _context.next = 37;
783
792
  break;
784
- case 32:
785
- _context.prev = 32;
786
- _context.t0 = _context["catch"](23);
793
+ case 34:
794
+ _context.prev = 34;
795
+ _context.t0 = _context["catch"](25);
787
796
  setAlertState({
788
797
  open: true,
789
798
  content: [_context.t0.message]
790
799
  });
791
- case 35:
792
- _context.next = 41;
793
- break;
794
800
  case 37:
801
+ _context.next = 43;
802
+ break;
803
+ case 39:
795
804
  _cart = Array.isArray(result) ? null : result;
796
805
  spotNumberFromStorage = window.localStorage.getItem('table_number');
797
806
  if (spotNumberFromStorage) {
@@ -808,21 +817,21 @@ var Checkout = function Checkout(props) {
808
817
  cart: _cart,
809
818
  error: _cart ? null : result
810
819
  }));
811
- case 41:
812
- _context.next = 46;
813
- break;
814
820
  case 43:
815
- _context.prev = 43;
821
+ _context.next = 48;
822
+ break;
823
+ case 45:
824
+ _context.prev = 45;
816
825
  _context.t1 = _context["catch"](0);
817
826
  setCartState(_objectSpread(_objectSpread({}, cartState), {}, {
818
827
  loading: false,
819
828
  error: [_context.t1.toString()]
820
829
  }));
821
- case 46:
830
+ case 48:
822
831
  case "end":
823
832
  return _context.stop();
824
833
  }
825
- }, _callee, null, [[0, 43], [23, 32]]);
834
+ }, _callee, null, [[0, 45], [25, 34]]);
826
835
  }));
827
836
  return function getOrder(_x2) {
828
837
  return _ref2.apply(this, arguments);
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.LanguageSelector = void 0;
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _orderingComponentsExternal = require("ordering-components-external");
9
9
  var _Select = require("../../styles/Select");
10
10
  var _styles = require("./styles");
11
11
  var _BisDownArrow = _interopRequireDefault(require("@meronex/icons/bi/BisDownArrow"));
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
15
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
14
16
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -48,6 +50,7 @@ var LanguageSelectorUI = function LanguageSelectorUI(props) {
48
50
  alt: currentLanguage,
49
51
  src: "http://purecatamphetamine.github.io/country-flag-icons/3x2/".concat(transformLanguageToCountry(currentLanguage), ".svg")
50
52
  }), /*#__PURE__*/_react.default.createElement(_Select.Select, {
53
+ zIndex: 20000,
51
54
  isHomeStyle: true,
52
55
  options: languagesState !== null && languagesState !== void 0 && languagesState.loading ? defaultLanguages : _languages,
53
56
  defaultValue: languagesState !== null && languagesState !== void 0 && languagesState.loading ? defaultCurrentLanguage : currentLanguage,
@@ -46,7 +46,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
46
46
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
47
47
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
48
48
  var LoginFormUI = function LoginFormUI(props) {
49
- var _configs$google_login, _configs$google_login2, _configs$google_login3, _configs$facebook_log, _configs$facebook_log2, _configs$apple_login_, _configs$apple_login_2, _configs$spoonity_tit, _configs$facebook_log3, _configs$facebook_log4, _configs$facebook_id, _configs$google_login4, _configs$google_login5, _configs$google_login6, _configs$apple_login_3, _configs$twilio_servi, _configs$twilio_servi2, _props$beforeElements, _props$beforeComponen, _theme$images, _theme$images$general, _theme$images2, _theme$images2$logos, _props$beforeMidEleme, _props$beforeMidCompo, _formMethods$errors, _formMethods$errors$e, _formMethods$errors2, _formMethods$errors2$, _formMethods$errors3, _formMethods$errors3$, _formMethods$errors4, _formMethods$errors5, _formMethods$errors6, _formMethods$errors6$, _formMethods$errors7, _formMethods$errors7$, _formMethods$errors8, _formMethods$errors9, _formMethods$errors10, _formMethods$errors11, _formMethods$errors12, _formMethods$errors13, _formMethods$errors14, _props$afterMidElemen, _props$afterMidCompon, _theme$defaultLanguag, _configs$facebook_log5, _configs$facebook_log6, _configs$facebook_id2, _configs$facebook_id3, _configs$google_login7, _configs$google_login8, _configs$google_login9, _configs$apple_login_4, _configs$twilio_servi3, _configs$twilio_servi4, _props$afterComponent, _props$afterElements;
49
+ var _configs$google_login, _optimizationLoad$res, _optimizationLoad$res2, _optimizationLoad$res3, _optimizationLoad$res4, _optimizationLoad$res5, _optimizationLoad$res6, _optimizationLoad$res7, _optimizationLoad$res8, _optimizationLoad$res9, _configs$spoonity_tit, _configs$facebook_log, _configs$facebook_log2, _configs$facebook_id, _configs$google_login2, _configs$google_login3, _configs$google_login4, _configs$apple_login_, _configs$twilio_servi, _configs$twilio_servi2, _props$beforeElements, _props$beforeComponen, _theme$images, _theme$images$general, _theme$images2, _theme$images2$logos, _props$beforeMidEleme, _props$beforeMidCompo, _formMethods$errors, _formMethods$errors$e, _formMethods$errors2, _formMethods$errors2$, _formMethods$errors3, _formMethods$errors3$, _formMethods$errors4, _formMethods$errors5, _formMethods$errors6, _formMethods$errors6$, _formMethods$errors7, _formMethods$errors7$, _formMethods$errors8, _formMethods$errors9, _formMethods$errors10, _formMethods$errors11, _formMethods$errors12, _formMethods$errors13, _formMethods$errors14, _props$afterMidElemen, _props$afterMidCompon, _theme$defaultLanguag, _configs$facebook_log3, _configs$facebook_log4, _configs$facebook_id2, _configs$facebook_id3, _configs$google_login5, _configs$google_login6, _configs$google_login7, _configs$apple_login_2, _configs$twilio_servi3, _configs$twilio_servi4, _props$afterComponent, _props$afterElements;
50
50
  var useLoginByEmail = props.useLoginByEmail,
51
51
  useLoginByCellphone = props.useLoginByCellphone,
52
52
  handleChangeInput = props.handleChangeInput,
@@ -90,6 +90,9 @@ var LoginFormUI = function LoginFormUI(props) {
90
90
  var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
91
91
  _useConfig2 = _slicedToArray(_useConfig, 1),
92
92
  configs = _useConfig2[0].configs;
93
+ var _useOptimizationLoad = (0, _orderingComponentsExternal.useOptimizationLoad)(),
94
+ _useOptimizationLoad2 = _slicedToArray(_useOptimizationLoad, 1),
95
+ optimizationLoad = _useOptimizationLoad2[0];
93
96
  var formMethods = (0, _reactHookForm.useForm)();
94
97
  var _useRecaptcha = (0, _useRecaptcha3.useRecaptcha)(enableReCaptcha),
95
98
  _useRecaptcha2 = _slicedToArray(_useRecaptcha, 1),
@@ -146,11 +149,11 @@ var LoginFormUI = function LoginFormUI(props) {
146
149
  cookiepolicy: 'single_host_origin',
147
150
  scope: 'profile'
148
151
  };
149
- var googleLoginEnabled = (configs === null || configs === void 0 ? void 0 : (_configs$google_login2 = configs.google_login_enabled) === null || _configs$google_login2 === void 0 ? void 0 : _configs$google_login2.value) === '1' || !(configs !== null && configs !== void 0 && (_configs$google_login3 = configs.google_login_enabled) !== null && _configs$google_login3 !== void 0 && _configs$google_login3.enabled);
150
- var facebookLoginEnabled = (configs === null || configs === void 0 ? void 0 : (_configs$facebook_log = configs.facebook_login_enabled) === null || _configs$facebook_log === void 0 ? void 0 : _configs$facebook_log.value) === '1' || !(configs !== null && configs !== void 0 && (_configs$facebook_log2 = configs.facebook_login_enabled) !== null && _configs$facebook_log2 !== void 0 && _configs$facebook_log2.enabled);
151
- var appleLoginEnabled = (configs === null || configs === void 0 ? void 0 : (_configs$apple_login_ = configs.apple_login_enabled) === null || _configs$apple_login_ === void 0 ? void 0 : _configs$apple_login_.value) === '1' || !(configs !== null && configs !== void 0 && (_configs$apple_login_2 = configs.apple_login_enabled) !== null && _configs$apple_login_2 !== void 0 && _configs$apple_login_2.enabled);
152
+ var googleLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 ? void 0 : (_optimizationLoad$res = optimizationLoad.result) === null || _optimizationLoad$res === void 0 ? void 0 : (_optimizationLoad$res2 = _optimizationLoad$res.configs) === null || _optimizationLoad$res2 === void 0 ? void 0 : (_optimizationLoad$res3 = _optimizationLoad$res2.google_login_enabled) === null || _optimizationLoad$res3 === void 0 ? void 0 : _optimizationLoad$res3.value) === '1';
153
+ var facebookLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 ? void 0 : (_optimizationLoad$res4 = optimizationLoad.result) === null || _optimizationLoad$res4 === void 0 ? void 0 : (_optimizationLoad$res5 = _optimizationLoad$res4.configs) === null || _optimizationLoad$res5 === void 0 ? void 0 : (_optimizationLoad$res6 = _optimizationLoad$res5.facebook_login_enabled) === null || _optimizationLoad$res6 === void 0 ? void 0 : _optimizationLoad$res6.value) === '1';
154
+ var appleLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 ? void 0 : (_optimizationLoad$res7 = optimizationLoad.result) === null || _optimizationLoad$res7 === void 0 ? void 0 : (_optimizationLoad$res8 = _optimizationLoad$res7.configs) === null || _optimizationLoad$res8 === void 0 ? void 0 : (_optimizationLoad$res9 = _optimizationLoad$res8.apple_login_enabled) === null || _optimizationLoad$res9 === void 0 ? void 0 : _optimizationLoad$res9.value) === '1';
152
155
  var spoonityTitle = configs === null || configs === void 0 ? void 0 : (_configs$spoonity_tit = configs.spoonity_title) === null || _configs$spoonity_tit === void 0 ? void 0 : _configs$spoonity_tit.value;
153
- var hasSocialLogin = ((configs === null || configs === void 0 ? void 0 : (_configs$facebook_log3 = configs.facebook_login) === null || _configs$facebook_log3 === void 0 ? void 0 : _configs$facebook_log3.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$facebook_log4 = configs.facebook_login) === null || _configs$facebook_log4 === void 0 ? void 0 : _configs$facebook_log4.value) === '1') && (configs === null || configs === void 0 ? void 0 : (_configs$facebook_id = configs.facebook_id) === null || _configs$facebook_id === void 0 ? void 0 : _configs$facebook_id.value) || (configs === null || configs === void 0 ? void 0 : (_configs$google_login4 = configs.google_login_client_id) === null || _configs$google_login4 === void 0 ? void 0 : _configs$google_login4.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login5 = configs.google_login_auth_domain) === null || _configs$google_login5 === void 0 ? void 0 : _configs$google_login5.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login6 = configs.google_login_api_key) === null || _configs$google_login6 === void 0 ? void 0 : _configs$google_login6.value) && googleLoginEnabled || (configs === null || configs === void 0 ? void 0 : (_configs$apple_login_3 = configs.apple_login_client_id) === null || _configs$apple_login_3 === void 0 ? void 0 : _configs$apple_login_3.value) && appleLoginEnabled || loginTab === 'cellphone' && ((configs === null || configs === void 0 ? void 0 : (_configs$twilio_servi = configs.twilio_service_enabled) === null || _configs$twilio_servi === void 0 ? void 0 : _configs$twilio_servi.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$twilio_servi2 = configs.twilio_service_enabled) === null || _configs$twilio_servi2 === void 0 ? void 0 : _configs$twilio_servi2.value) === '1');
156
+ var hasSocialLogin = ((configs === null || configs === void 0 ? void 0 : (_configs$facebook_log = configs.facebook_login) === null || _configs$facebook_log === void 0 ? void 0 : _configs$facebook_log.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$facebook_log2 = configs.facebook_login) === null || _configs$facebook_log2 === void 0 ? void 0 : _configs$facebook_log2.value) === '1') && (configs === null || configs === void 0 ? void 0 : (_configs$facebook_id = configs.facebook_id) === null || _configs$facebook_id === void 0 ? void 0 : _configs$facebook_id.value) || (configs === null || configs === void 0 ? void 0 : (_configs$google_login2 = configs.google_login_client_id) === null || _configs$google_login2 === void 0 ? void 0 : _configs$google_login2.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login3 = configs.google_login_auth_domain) === null || _configs$google_login3 === void 0 ? void 0 : _configs$google_login3.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login4 = configs.google_login_api_key) === null || _configs$google_login4 === void 0 ? void 0 : _configs$google_login4.value) && googleLoginEnabled || (configs === null || configs === void 0 ? void 0 : (_configs$apple_login_ = configs.apple_login_client_id) === null || _configs$apple_login_ === void 0 ? void 0 : _configs$apple_login_.value) && appleLoginEnabled || loginTab === 'cellphone' && ((configs === null || configs === void 0 ? void 0 : (_configs$twilio_servi = configs.twilio_service_enabled) === null || _configs$twilio_servi === void 0 ? void 0 : _configs$twilio_servi.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$twilio_servi2 = configs.twilio_service_enabled) === null || _configs$twilio_servi2 === void 0 ? void 0 : _configs$twilio_servi2.value) === '1');
154
157
  var hasSocialEnabled = googleLoginEnabled || facebookLoginEnabled || appleLoginEnabled;
155
158
  var onSubmit = /*#__PURE__*/function () {
156
159
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
@@ -588,13 +591,13 @@ var LoginFormUI = function LoginFormUI(props) {
588
591
  isPopup: isPopup
589
592
  }, /*#__PURE__*/_react.default.createElement(_styles.DividerLine, null), /*#__PURE__*/_react.default.createElement("p", null, t('OR', 'or')), /*#__PURE__*/_react.default.createElement(_styles.DividerLine, null)), !props.isDisableButtons && !loginWithOtpState && (Object.keys(configs).length > 0 ? /*#__PURE__*/_react.default.createElement(_styles.SocialButtons, {
590
593
  isPopup: isPopup
591
- }, ((configs === null || configs === void 0 ? void 0 : (_configs$facebook_log5 = configs.facebook_login) === null || _configs$facebook_log5 === void 0 ? void 0 : _configs$facebook_log5.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$facebook_log6 = configs.facebook_login) === null || _configs$facebook_log6 === void 0 ? void 0 : _configs$facebook_log6.value) === '1') && (configs === null || configs === void 0 ? void 0 : (_configs$facebook_id2 = configs.facebook_id) === null || _configs$facebook_id2 === void 0 ? void 0 : _configs$facebook_id2.value) && facebookLoginEnabled && /*#__PURE__*/_react.default.createElement(_FacebookLogin.FacebookLoginButton, {
594
+ }, ((configs === null || configs === void 0 ? void 0 : (_configs$facebook_log3 = configs.facebook_login) === null || _configs$facebook_log3 === void 0 ? void 0 : _configs$facebook_log3.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$facebook_log4 = configs.facebook_login) === null || _configs$facebook_log4 === void 0 ? void 0 : _configs$facebook_log4.value) === '1') && (configs === null || configs === void 0 ? void 0 : (_configs$facebook_id2 = configs.facebook_id) === null || _configs$facebook_id2 === void 0 ? void 0 : _configs$facebook_id2.value) && facebookLoginEnabled && /*#__PURE__*/_react.default.createElement(_FacebookLogin.FacebookLoginButton, {
592
595
  appId: configs === null || configs === void 0 ? void 0 : (_configs$facebook_id3 = configs.facebook_id) === null || _configs$facebook_id3 === void 0 ? void 0 : _configs$facebook_id3.value,
593
596
  handleSuccessFacebookLogin: handleSuccessFacebook
594
- }), (configs === null || configs === void 0 ? void 0 : (_configs$google_login7 = configs.google_login_client_id) === null || _configs$google_login7 === void 0 ? void 0 : _configs$google_login7.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login8 = configs.google_login_auth_domain) === null || _configs$google_login8 === void 0 ? void 0 : _configs$google_login8.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login9 = configs.google_login_api_key) === null || _configs$google_login9 === void 0 ? void 0 : _configs$google_login9.value) && googleLoginEnabled && /*#__PURE__*/_react.default.createElement(_GoogleLogin.GoogleLoginButton, {
597
+ }), (configs === null || configs === void 0 ? void 0 : (_configs$google_login5 = configs.google_login_client_id) === null || _configs$google_login5 === void 0 ? void 0 : _configs$google_login5.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login6 = configs.google_login_auth_domain) === null || _configs$google_login6 === void 0 ? void 0 : _configs$google_login6.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login7 = configs.google_login_api_key) === null || _configs$google_login7 === void 0 ? void 0 : _configs$google_login7.value) && googleLoginEnabled && /*#__PURE__*/_react.default.createElement(_GoogleLogin.GoogleLoginButton, {
595
598
  initParams: initParams,
596
599
  handleSuccessGoogleLogin: handleSuccessGoogle
597
- }), (configs === null || configs === void 0 ? void 0 : (_configs$apple_login_4 = configs.apple_login_client_id) === null || _configs$apple_login_4 === void 0 ? void 0 : _configs$apple_login_4.value) && appleLoginEnabled && /*#__PURE__*/_react.default.createElement(_AppleLogin.AppleLogin, {
600
+ }), (configs === null || configs === void 0 ? void 0 : (_configs$apple_login_2 = configs.apple_login_client_id) === null || _configs$apple_login_2 === void 0 ? void 0 : _configs$apple_login_2.value) && appleLoginEnabled && /*#__PURE__*/_react.default.createElement(_AppleLogin.AppleLogin, {
598
601
  onSuccess: handleSuccessApple,
599
602
  onFailure: function onFailure(data) {
600
603
  return setAlertState({
@@ -16,7 +16,7 @@ var Container = _styledComponents.default.div(_templateObject || (_templateObjec
16
16
  return zx && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .popup {\n z-index: ", " !important;\n }\n "])), zx);
17
17
  });
18
18
  exports.Container = Container;
19
- var ModalDialog = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n background-color: ", ";\n padding: ", ";\n width: 100vw;\n border-radius: 0px;\n box-sizing: border-box;\n margin-top: auto;\n margin-bottom: auto;\n height: ", ";;\n max-height: 100vh;\n overflow: auto;\n overflow-x: ", ";\n @media (min-width: 769px) {\n width: ", ";\n max-height: 90vh;\n border-radius: 10px;\n height: auto;\n ", "\n }\n"])), function (_ref2) {
19
+ var ModalDialog = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n background-color: ", ";\n padding: ", ";\n width: 100vw;\n border-radius: 0px;\n box-sizing: border-box;\n margin-top: auto;\n margin-bottom: auto;\n height: ", ";;\n max-height: 100vh;\n overflow: auto;\n overflow-x: ", ";\n z-index: 10001;\n @media (min-width: 769px) {\n width: ", ";\n max-height: 90vh;\n border-radius: 10px;\n height: auto;\n ", "\n }\n"])), function (_ref2) {
20
20
  var isTransparent = _ref2.isTransparent;
21
21
  return isTransparent ? 'transparent' : '#FFF';
22
22
  }, function (_ref3) {
@@ -15,6 +15,7 @@ var _AddressForm = require("../AddressForm");
15
15
  var _AddressList = require("../AddressList");
16
16
  var _Confirm = require("../Confirm");
17
17
  var _styles = require("./styles");
18
+ var _useWindowSize = require("../../../../../hooks/useWindowSize");
18
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -66,6 +67,7 @@ var OrderContextUI = function OrderContextUI(props) {
66
67
  _useState6 = _slicedToArray(_useState5, 2),
67
68
  alertState = _useState6[0],
68
69
  setAlertState = _useState6[1];
70
+ var windowSize = (0, _useWindowSize.useWindowSize)();
69
71
  var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
70
72
  var configTypes = (configState === null || configState === void 0 ? void 0 : (_configState$configs = configState.configs) === null || _configState$configs === void 0 ? void 0 : (_configState$configs$ = _configState$configs.order_types_allowed) === null || _configState$configs$ === void 0 ? void 0 : _configState$configs$.value.split('|').map(function (value) {
71
73
  return Number(value);
@@ -109,6 +111,15 @@ var OrderContextUI = function OrderContextUI(props) {
109
111
  }));
110
112
  }
111
113
  };
114
+ (0, _react.useEffect)(function () {
115
+ var handleCloseallPopovers = function handleCloseallPopovers() {
116
+ return handleClosePopover('moment');
117
+ };
118
+ window.addEventListener('scroll', handleCloseallPopovers);
119
+ return function () {
120
+ return window.removeEventListener('scroll', handleCloseallPopovers);
121
+ };
122
+ }, []);
112
123
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Container, {
113
124
  isBusinessList: isBusinessList,
114
125
  hero: props.hideHero,
@@ -119,7 +130,8 @@ var OrderContextUI = function OrderContextUI(props) {
119
130
  },
120
131
  isCheckOut: isCheckOut
121
132
  }, /*#__PURE__*/_react.default.createElement(_FaMapMarkerAlt.default, null), /*#__PURE__*/_react.default.createElement("span", null, ((_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : (_orderState$options2$ = _orderState$options2.address) === null || _orderState$options2$ === void 0 ? void 0 : _orderState$options2$.address) || t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?'))), /*#__PURE__*/_react.default.createElement(_styles.FeatureItems, null, /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorHeader.OrderTypeSelectorHeader, {
122
- configTypes: configTypes
133
+ configTypes: configTypes,
134
+ autoCloseWhenScroll: windowSize.width < 576
123
135
  })), isPreOrderSetting && /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_MomentPopover.MomentPopover, {
124
136
  open: openPopover.moment,
125
137
  onClick: function onClick() {
@@ -18,6 +18,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
18
18
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
19
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
20
  var OrderHistory = function OrderHistory(props) {
21
+ var _configs$general_hour;
21
22
  var messages = props.messages,
22
23
  order = props.order,
23
24
  handleOpenReview = props.handleOpenReview,
@@ -29,6 +30,9 @@ var OrderHistory = function OrderHistory(props) {
29
30
  var _useUtils = (0, _orderingComponentsExternal.useUtils)(),
30
31
  _useUtils2 = _slicedToArray(_useUtils, 1),
31
32
  parseDate = _useUtils2[0].parseDate;
33
+ var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
34
+ _useConfig2 = _slicedToArray(_useConfig, 1),
35
+ configs = _useConfig2[0].configs;
32
36
  var getLogisticTagStatus = function getLogisticTagStatus(status) {
33
37
  switch (status) {
34
38
  case 0:
@@ -107,13 +111,13 @@ var OrderHistory = function OrderHistory(props) {
107
111
  }
108
112
  };
109
113
  return /*#__PURE__*/_react.default.createElement(_styles.OrderHistoryContainer, null, !(messages !== null && messages !== void 0 && messages.loading) && order && /*#__PURE__*/_react.default.createElement(_styles.HistoryItemWrapper, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckCircleFill, null), /*#__PURE__*/_react.default.createElement(_styles.DetailWrapper, null, /*#__PURE__*/_react.default.createElement("h3", null, t('ORDER_PLACED', 'Order placed'), " ", ' ', t('VIA', 'Via'), ' ', order.app_id ? t(order.app_id.toUpperCase(), order.app_id) : t('OTHER', 'Other')), /*#__PURE__*/_react.default.createElement("p", null, parseDate(order.created_at, {
110
- outputFormat: 'MMM DD, hh:mm A'
114
+ outputFormat: "MMM DD, ".concat(configs === null || configs === void 0 ? void 0 : (_configs$general_hour = configs.general_hour_format) === null || _configs$general_hour === void 0 ? void 0 : _configs$general_hour.value)
111
115
  })))), messages && (messages === null || messages === void 0 ? void 0 : messages.messages.map(function (message, i) {
112
- var _message$change, _message$change2, _message$change3, _message$change4, _message$driver, _message$driver2;
116
+ var _message$change, _message$change2, _message$change3, _message$change4, _message$driver, _message$driver2, _configs$general_hour2;
113
117
  return message.type === 1 && /*#__PURE__*/_react.default.createElement(_styles.HistoryItemWrapper, {
114
118
  key: i
115
119
  }, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckCircleFill, null), /*#__PURE__*/_react.default.createElement(_styles.DetailWrapper, null, ((_message$change = message.change) === null || _message$change === void 0 ? void 0 : _message$change.attribute) !== 'driver_id' ? /*#__PURE__*/_react.default.createElement("h3", null, ((_message$change2 = message.change) === null || _message$change2 === void 0 ? void 0 : _message$change2.attribute) === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.new, 10)) : ((_message$change3 = message.change) === null || _message$change3 === void 0 ? void 0 : _message$change3.attribute) === 'delivered_in' ? /*#__PURE__*/_react.default.createElement("h3", null, /*#__PURE__*/_react.default.createElement("strong", null, t('TIME_ADDED_BY_DRIVER', 'Time added by driver')), /*#__PURE__*/_react.default.createElement("br", null), (0, _utils.formatSeconds)(parseInt(message.change.new, 10))) : ((_message$change4 = message.change) === null || _message$change4 === void 0 ? void 0 : _message$change4.attribute) === 'prepared_in' ? /*#__PURE__*/_react.default.createElement("h3", null, /*#__PURE__*/_react.default.createElement("strong", null, t('TIME_ADDED_BY_BUSINESS', 'Time added by business')), /*#__PURE__*/_react.default.createElement("br", null), (0, _utils.formatSeconds)(parseInt(message.change.new, 10))) : t(getStatus(parseInt(message.change.new, 10)))) : /*#__PURE__*/_react.default.createElement("h3", null, message.change.new ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("strong", null, (_message$driver = message.driver) === null || _message$driver === void 0 ? void 0 : _message$driver.name, " ", ' ', " ", ((_message$driver2 = message.driver) === null || _message$driver2 === void 0 ? void 0 : _message$driver2.lastname) && message.driver.lastname, " "), t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, t('DRIVER_UNASSIGNED', 'Driver unassigned'))), /*#__PURE__*/_react.default.createElement("p", null, parseDate(message.created_at, {
116
- outputFormat: 'MMM DD, hh:mm A'
120
+ outputFormat: "MMM DD, ".concat(configs === null || configs === void 0 ? void 0 : (_configs$general_hour2 = configs.general_hour_format) === null || _configs$general_hour2 === void 0 ? void 0 : _configs$general_hour2.value)
117
121
  }))));
118
122
  })), /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
119
123
  onClick: handleReview,