@salesgenterp/ui-components 0.4.366 → 0.4.368
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.
- package/dist/index.js +487 -288
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +489 -290
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -324,29 +324,6 @@ var CARD_METHODS = {
|
|
|
324
324
|
DEBIT_CARD: 3
|
|
325
325
|
};
|
|
326
326
|
|
|
327
|
-
var erLocalStorage = {
|
|
328
|
-
setItem: function setItem(key, value) {
|
|
329
|
-
localStorage.setItem(key, value);
|
|
330
|
-
},
|
|
331
|
-
getItem: function getItem(key) {
|
|
332
|
-
return localStorage.getItem(key);
|
|
333
|
-
},
|
|
334
|
-
removeItem: function removeItem(key) {
|
|
335
|
-
localStorage.removeItem(key);
|
|
336
|
-
},
|
|
337
|
-
setJSONItem: function setJSONItem(key, value) {
|
|
338
|
-
value = JSON.stringify(value);
|
|
339
|
-
localStorage.setItem(key, value);
|
|
340
|
-
},
|
|
341
|
-
getJSONItem: function getJSONItem(key) {
|
|
342
|
-
var returnValue = {};
|
|
343
|
-
try {
|
|
344
|
-
returnValue = localStorage.getItem(key) ? JSON.parse(localStorage.getItem(key)) : {};
|
|
345
|
-
} catch (e) {}
|
|
346
|
-
return returnValue;
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
|
|
350
327
|
var ErCache = /*#__PURE__*/function () {
|
|
351
328
|
function ErCache() {
|
|
352
329
|
this.sessionStorage = typeof window !== 'undefined' ? window.sessionStorage : {};
|
|
@@ -381,6 +358,29 @@ var ErCache = /*#__PURE__*/function () {
|
|
|
381
358
|
}();
|
|
382
359
|
var erCache = new ErCache();
|
|
383
360
|
|
|
361
|
+
var erLocalStorage = {
|
|
362
|
+
setItem: function setItem(key, value) {
|
|
363
|
+
localStorage.setItem(key, value);
|
|
364
|
+
},
|
|
365
|
+
getItem: function getItem(key) {
|
|
366
|
+
return localStorage.getItem(key);
|
|
367
|
+
},
|
|
368
|
+
removeItem: function removeItem(key) {
|
|
369
|
+
localStorage.removeItem(key);
|
|
370
|
+
},
|
|
371
|
+
setJSONItem: function setJSONItem(key, value) {
|
|
372
|
+
value = JSON.stringify(value);
|
|
373
|
+
localStorage.setItem(key, value);
|
|
374
|
+
},
|
|
375
|
+
getJSONItem: function getJSONItem(key) {
|
|
376
|
+
var returnValue = {};
|
|
377
|
+
try {
|
|
378
|
+
returnValue = localStorage.getItem(key) ? JSON.parse(localStorage.getItem(key)) : {};
|
|
379
|
+
} catch (e) {}
|
|
380
|
+
return returnValue;
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
384
384
|
var byPassAuthAPIs = ['/authenticate'];
|
|
385
385
|
var API_CACHE_PREFIX = 'API_CACHE';
|
|
386
386
|
var getKeyFromPath = function getKeyFromPath(_ref) {
|
|
@@ -411,7 +411,7 @@ var setAPIDataToCache = function setAPIDataToCache(_ref3) {
|
|
|
411
411
|
};
|
|
412
412
|
var CancelToken = axios.CancelToken;
|
|
413
413
|
var source;
|
|
414
|
-
var API
|
|
414
|
+
var API = function API(apiData) {
|
|
415
415
|
try {
|
|
416
416
|
var url = apiData.url,
|
|
417
417
|
method = apiData.method,
|
|
@@ -421,32 +421,49 @@ var API$1 = function API(apiData) {
|
|
|
421
421
|
body = apiData.body,
|
|
422
422
|
isCancelToken = apiData.isCancelToken,
|
|
423
423
|
cache = apiData.cache,
|
|
424
|
+
forceUpdateCache = apiData.forceUpdateCache,
|
|
424
425
|
_apiData$headers = apiData.headers,
|
|
425
426
|
headers = _apiData$headers === void 0 ? {} : _apiData$headers,
|
|
426
427
|
successMessage = apiData.successMessage,
|
|
428
|
+
hideSuccessMessage = apiData.hideSuccessMessage,
|
|
427
429
|
hideErrorMessage = apiData.hideErrorMessage,
|
|
428
430
|
responseTypeData = apiData.responseTypeData,
|
|
431
|
+
notAppendApiText = apiData.notAppendApiText,
|
|
432
|
+
getStatusWithData = apiData.getStatusWithData,
|
|
433
|
+
processResponse = apiData.processResponse,
|
|
429
434
|
apiEndPoint = apiData.apiEndPoint,
|
|
430
435
|
token = apiData.token;
|
|
431
436
|
return Promise.resolve(_finallyRethrows(function () {
|
|
432
437
|
return _catch(function () {
|
|
433
438
|
function _temp2() {
|
|
434
|
-
if (
|
|
435
|
-
|
|
439
|
+
if (!hideSuccessMessage) {
|
|
440
|
+
if (successMessage) {
|
|
441
|
+
alert(successMessage);
|
|
442
|
+
}
|
|
436
443
|
}
|
|
444
|
+
var apiResponse;
|
|
437
445
|
if (responseTypeData) {
|
|
438
|
-
|
|
446
|
+
var _response;
|
|
447
|
+
apiResponse = (_response = response) === null || _response === void 0 ? void 0 : _response.data;
|
|
439
448
|
} else {
|
|
440
|
-
|
|
449
|
+
var _response2, _response2$data, _response3, _response3$data, _response4, _response4$data;
|
|
450
|
+
apiResponse = getStatusWithData ? _extends({
|
|
451
|
+
status: (_response2 = response) === null || _response2 === void 0 ? void 0 : (_response2$data = _response2.data) === null || _response2$data === void 0 ? void 0 : _response2$data.status
|
|
452
|
+
}, (_response3 = response) === null || _response3 === void 0 ? void 0 : (_response3$data = _response3.data) === null || _response3$data === void 0 ? void 0 : _response3$data.result) : (_response4 = response) === null || _response4 === void 0 ? void 0 : (_response4$data = _response4.data) === null || _response4$data === void 0 ? void 0 : _response4$data.result;
|
|
441
453
|
}
|
|
454
|
+
return processResponse ? processResponse(apiResponse) : apiResponse;
|
|
442
455
|
}
|
|
443
456
|
var apiUrl = ("/" + url).replace(/\/\//g, '/');
|
|
444
457
|
var accessToken = token;
|
|
445
|
-
var requestHeaders = headers
|
|
458
|
+
var requestHeaders = _extends({}, headers, {
|
|
459
|
+
Accept: "application/json, text/plain"
|
|
460
|
+
});
|
|
461
|
+
if (formData) {
|
|
462
|
+
requestHeaders['Content-Type'] = 'multipart/form-data';
|
|
463
|
+
}
|
|
446
464
|
if (byPassAuthAPIs.indexOf(url) === -1 && accessToken) {
|
|
447
|
-
requestHeaders = _extends({},
|
|
448
|
-
Authorization: "Bearer " + accessToken
|
|
449
|
-
Accept: "application/json, text/plain"
|
|
465
|
+
requestHeaders = _extends({}, requestHeaders, {
|
|
466
|
+
Authorization: "Bearer " + accessToken
|
|
450
467
|
});
|
|
451
468
|
}
|
|
452
469
|
var response;
|
|
@@ -460,7 +477,7 @@ var API$1 = function API(apiData) {
|
|
|
460
477
|
apiUrl = "" + (API_END_POINT || apiEndPoint) + apiUrl;
|
|
461
478
|
}
|
|
462
479
|
var _temp = function () {
|
|
463
|
-
if (cache && getAPICacheData({
|
|
480
|
+
if (!forceUpdateCache && cache && getAPICacheData({
|
|
464
481
|
path: apiUrl,
|
|
465
482
|
queryParams: queryParams
|
|
466
483
|
})) {
|
|
@@ -491,44 +508,17 @@ var API$1 = function API(apiData) {
|
|
|
491
508
|
}();
|
|
492
509
|
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
|
493
510
|
}, function (exception) {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}));
|
|
504
|
-
}
|
|
505
|
-
}();
|
|
506
|
-
}
|
|
507
|
-
var exceptionResponse = exception.response;
|
|
508
|
-
var _temp3 = function () {
|
|
509
|
-
if (exceptionResponse.data.hasError) {
|
|
510
|
-
return function () {
|
|
511
|
-
if (!hideErrorMessage) {
|
|
512
|
-
alert(exceptionResponse.data.error.message);
|
|
513
|
-
return function () {
|
|
514
|
-
if (exceptionResponse.data.exception) {
|
|
515
|
-
return Promise.resolve(handleError({
|
|
516
|
-
exception: exception,
|
|
517
|
-
apiEndPoint: apiEndPoint,
|
|
518
|
-
url: url,
|
|
519
|
-
apiData: apiData,
|
|
520
|
-
hideErrorMessage: true
|
|
521
|
-
})).then(function (_await$handleError) {
|
|
522
|
-
_exit = true;
|
|
523
|
-
return _await$handleError;
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
}();
|
|
527
|
-
}
|
|
528
|
-
}();
|
|
511
|
+
return function () {
|
|
512
|
+
if (axios.isCancel(exception)) {} else {
|
|
513
|
+
return Promise.resolve(handleError({
|
|
514
|
+
exception: exception,
|
|
515
|
+
url: url,
|
|
516
|
+
apiData: apiData,
|
|
517
|
+
hideErrorMessage: hideErrorMessage,
|
|
518
|
+
getStatusWithData: getStatusWithData
|
|
519
|
+
}));
|
|
529
520
|
}
|
|
530
521
|
}();
|
|
531
|
-
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
|
532
522
|
});
|
|
533
523
|
}, function (_wasThrown, _result) {
|
|
534
524
|
if (_wasThrown) throw _result;
|
|
@@ -538,35 +528,35 @@ var API$1 = function API(apiData) {
|
|
|
538
528
|
return Promise.reject(e);
|
|
539
529
|
}
|
|
540
530
|
};
|
|
541
|
-
API
|
|
542
|
-
return API
|
|
531
|
+
API.get = function (url, options) {
|
|
532
|
+
return API(_extends({
|
|
543
533
|
url: url,
|
|
544
534
|
method: 'get'
|
|
545
535
|
}, options));
|
|
546
536
|
};
|
|
547
|
-
API
|
|
548
|
-
return API
|
|
537
|
+
API.put = function (url, body, options) {
|
|
538
|
+
return API(_extends({
|
|
549
539
|
url: url,
|
|
550
540
|
body: body,
|
|
551
541
|
method: 'put'
|
|
552
542
|
}, options));
|
|
553
543
|
};
|
|
554
|
-
API
|
|
555
|
-
return API
|
|
544
|
+
API.patch = function (url, body, options) {
|
|
545
|
+
return API(_extends({
|
|
556
546
|
url: url,
|
|
557
547
|
body: body,
|
|
558
548
|
method: 'patch'
|
|
559
549
|
}, options));
|
|
560
550
|
};
|
|
561
|
-
API
|
|
562
|
-
return API
|
|
551
|
+
API.post = function (url, body, options) {
|
|
552
|
+
return API(_extends({
|
|
563
553
|
url: url,
|
|
564
554
|
body: body,
|
|
565
555
|
method: 'post'
|
|
566
556
|
}, options));
|
|
567
557
|
};
|
|
568
|
-
API
|
|
569
|
-
return API
|
|
558
|
+
API["delete"] = function (url, body, options) {
|
|
559
|
+
return API(_extends({
|
|
570
560
|
url: url,
|
|
571
561
|
body: body,
|
|
572
562
|
method: 'delete'
|
|
@@ -576,32 +566,25 @@ var handleError = function handleError(_ref6) {
|
|
|
576
566
|
var exception = _ref6.exception,
|
|
577
567
|
url = _ref6.url,
|
|
578
568
|
apiData = _ref6.apiData,
|
|
579
|
-
hideErrorMessage = _ref6.hideErrorMessage
|
|
569
|
+
hideErrorMessage = _ref6.hideErrorMessage,
|
|
570
|
+
getStatusWithData = _ref6.getStatusWithData;
|
|
580
571
|
try {
|
|
581
|
-
var
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
showAPIError = apiData.showAPIError;
|
|
585
|
-
if (exception.response && (exception.response.status === 401 || exception.response.status === 403) && url !== '/authenticate' && url !== '/refreshToken') {
|
|
586
|
-
try {} catch (e) {
|
|
587
|
-
alert(e);
|
|
588
|
-
if (throwException) {
|
|
589
|
-
throw exception;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
} else {
|
|
572
|
+
var errorMessage = apiData === null || apiData === void 0 ? void 0 : apiData.errorMessage;
|
|
573
|
+
var exceptionResponse = exception === null || exception === void 0 ? void 0 : exception.response;
|
|
574
|
+
if (url !== '/refreshToken') {
|
|
593
575
|
if (!hideErrorMessage) {
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
errMessage = lodash.get(exception, 'response.data.message');
|
|
597
|
-
}
|
|
598
|
-
alert(errMessage);
|
|
599
|
-
}
|
|
600
|
-
if (throwException) {
|
|
601
|
-
throw exception;
|
|
576
|
+
var _exceptionResponse$da, _exceptionResponse$da2, _exceptionResponse$da3, _exceptionResponse$da4;
|
|
577
|
+
alert((exceptionResponse === null || exceptionResponse === void 0 ? void 0 : (_exceptionResponse$da = exceptionResponse.data) === null || _exceptionResponse$da === void 0 ? void 0 : (_exceptionResponse$da2 = _exceptionResponse$da.error) === null || _exceptionResponse$da2 === void 0 ? void 0 : _exceptionResponse$da2.details) || (exceptionResponse === null || exceptionResponse === void 0 ? void 0 : (_exceptionResponse$da3 = exceptionResponse.data) === null || _exceptionResponse$da3 === void 0 ? void 0 : (_exceptionResponse$da4 = _exceptionResponse$da3.error) === null || _exceptionResponse$da4 === void 0 ? void 0 : _exceptionResponse$da4.message) || errorMessage || 'Something went wrong.');
|
|
602
578
|
}
|
|
603
579
|
}
|
|
604
|
-
|
|
580
|
+
if (getStatusWithData) {
|
|
581
|
+
var _exception$response, _exception$response2, _exception$response2$, _exception$response2$2;
|
|
582
|
+
return Promise.resolve({
|
|
583
|
+
status: exception === null || exception === void 0 ? void 0 : (_exception$response = exception.response) === null || _exception$response === void 0 ? void 0 : _exception$response.status,
|
|
584
|
+
message: exception === null || exception === void 0 ? void 0 : (_exception$response2 = exception.response) === null || _exception$response2 === void 0 ? void 0 : (_exception$response2$ = _exception$response2.data) === null || _exception$response2$ === void 0 ? void 0 : (_exception$response2$2 = _exception$response2$.error) === null || _exception$response2$2 === void 0 ? void 0 : _exception$response2$2.message
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
throw exception;
|
|
605
588
|
} catch (e) {
|
|
606
589
|
return Promise.reject(e);
|
|
607
590
|
}
|
|
@@ -620,7 +603,7 @@ var getcsvData = function getcsvData(_ref3) {
|
|
|
620
603
|
token = _ref3.token;
|
|
621
604
|
try {
|
|
622
605
|
return Promise.resolve(_catch(function () {
|
|
623
|
-
return Promise.resolve(API
|
|
606
|
+
return Promise.resolve(API({
|
|
624
607
|
method: 'GET',
|
|
625
608
|
url: url,
|
|
626
609
|
responseTypeData: 'blob',
|
|
@@ -684,12 +667,28 @@ var MuiButton = function MuiButton(props) {
|
|
|
684
667
|
disabled: loading ? true : disabled
|
|
685
668
|
}), loading ? /*#__PURE__*/React__default.createElement(material.CircularProgress, {
|
|
686
669
|
color: "inherit",
|
|
687
|
-
size:
|
|
670
|
+
size: 20
|
|
688
671
|
}) : children));
|
|
689
672
|
};
|
|
690
673
|
var ButtonContainer = styled__default(material.Button)(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteralLoose(["\n background: ", " !important;\n"])), function (props) {
|
|
691
674
|
return props.primaryColor;
|
|
692
675
|
});
|
|
676
|
+
var MuiIconButton = function MuiIconButton(props) {
|
|
677
|
+
var fontColor = props.fontColor,
|
|
678
|
+
primaryColor = props.primaryColor,
|
|
679
|
+
children = props.children,
|
|
680
|
+
loading = props.loading,
|
|
681
|
+
disabled = props.disabled;
|
|
682
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(material.IconButton, _extends({
|
|
683
|
+
fontColor: fontColor,
|
|
684
|
+
primaryColor: primaryColor
|
|
685
|
+
}, props, {
|
|
686
|
+
disabled: loading ? true : disabled
|
|
687
|
+
}), loading ? /*#__PURE__*/React__default.createElement(material.CircularProgress, {
|
|
688
|
+
color: "inherit",
|
|
689
|
+
size: 16
|
|
690
|
+
}) : children));
|
|
691
|
+
};
|
|
693
692
|
|
|
694
693
|
var convertCamCaseToSnake = function convertCamCaseToSnake(child) {
|
|
695
694
|
var _Object$keys;
|
|
@@ -938,7 +937,7 @@ var ContactUsForm = function ContactUsForm(_ref) {
|
|
|
938
937
|
};
|
|
939
938
|
setIsLoading(true);
|
|
940
939
|
var _temp = _catch(function () {
|
|
941
|
-
return Promise.resolve(API
|
|
940
|
+
return Promise.resolve(API({
|
|
942
941
|
apiEndPoint: apiEndPoint === null || apiEndPoint === void 0 ? void 0 : apiEndPoint.replace('/api', '/services/pdf'),
|
|
943
942
|
method: 'POST',
|
|
944
943
|
url: "/email/customer/contact-us",
|
|
@@ -1083,7 +1082,7 @@ var APIStaticPage = function APIStaticPage(_ref) {
|
|
|
1083
1082
|
setStaticPage(_response3);
|
|
1084
1083
|
var _temp = function (_response, _response$title, _response2, _response2$urlAlias) {
|
|
1085
1084
|
if (((_response = _response3) === null || _response === void 0 ? void 0 : (_response$title = _response.title) === null || _response$title === void 0 ? void 0 : _response$title.toLowerCase()) === 'contact us' || ((_response2 = _response3) === null || _response2 === void 0 ? void 0 : (_response2$urlAlias = _response2.urlAlias) === null || _response2$urlAlias === void 0 ? void 0 : _response2$urlAlias.toLowerCase()) === 'contact-us') {
|
|
1086
|
-
return Promise.resolve(API
|
|
1085
|
+
return Promise.resolve(API({
|
|
1087
1086
|
apiEndPoint: apiEndPoint,
|
|
1088
1087
|
url: "/store"
|
|
1089
1088
|
})).then(function (storeData) {
|
|
@@ -1098,7 +1097,7 @@ var APIStaticPage = function APIStaticPage(_ref) {
|
|
|
1098
1097
|
var _response3;
|
|
1099
1098
|
var _temp2 = function () {
|
|
1100
1099
|
if (id || alias) {
|
|
1101
|
-
return Promise.resolve(API
|
|
1100
|
+
return Promise.resolve(API({
|
|
1102
1101
|
apiEndPoint: apiEndPoint,
|
|
1103
1102
|
url: "/ecommerce/staticPage",
|
|
1104
1103
|
queryParams: {
|
|
@@ -1227,7 +1226,7 @@ var ChangePassword = function ChangePassword(_ref) {
|
|
|
1227
1226
|
};
|
|
1228
1227
|
setIsLoading(true);
|
|
1229
1228
|
var _temp = _catch(function () {
|
|
1230
|
-
return Promise.resolve(API
|
|
1229
|
+
return Promise.resolve(API({
|
|
1231
1230
|
apiEndPoint: apiEndPoint,
|
|
1232
1231
|
token: token,
|
|
1233
1232
|
method: 'POST',
|
|
@@ -1502,7 +1501,7 @@ var APITable = React.forwardRef(function (_ref, ref) {
|
|
|
1502
1501
|
apiResponse = _asyncService;
|
|
1503
1502
|
});
|
|
1504
1503
|
} else {
|
|
1505
|
-
return Promise.resolve(API
|
|
1504
|
+
return Promise.resolve(API(_extends({}, apiData, {
|
|
1506
1505
|
queryParams: queryParams
|
|
1507
1506
|
}))).then(function (_API) {
|
|
1508
1507
|
apiResponse = _API;
|
|
@@ -1677,7 +1676,7 @@ var getPaymentMethods = function getPaymentMethods(_ref) {
|
|
|
1677
1676
|
var apiEndPoint = _ref.apiEndPoint,
|
|
1678
1677
|
token = _ref.token;
|
|
1679
1678
|
try {
|
|
1680
|
-
return Promise.resolve(API
|
|
1679
|
+
return Promise.resolve(API({
|
|
1681
1680
|
apiEndPoint: apiEndPoint,
|
|
1682
1681
|
token: token,
|
|
1683
1682
|
url: "/store/paymentMode"
|
|
@@ -1690,7 +1689,7 @@ var getStoreFeatureDetails = function getStoreFeatureDetails(_ref2) {
|
|
|
1690
1689
|
var apiEndPoint = _ref2.apiEndPoint,
|
|
1691
1690
|
token = _ref2.token;
|
|
1692
1691
|
try {
|
|
1693
|
-
return Promise.resolve(API
|
|
1692
|
+
return Promise.resolve(API({
|
|
1694
1693
|
apiEndPoint: apiEndPoint,
|
|
1695
1694
|
token: token,
|
|
1696
1695
|
url: "/store/feature"
|
|
@@ -1704,7 +1703,7 @@ var getAuthorizeDotNetCreditCards = function getAuthorizeDotNetCreditCards(_ref3
|
|
|
1704
1703
|
token = _ref3.token,
|
|
1705
1704
|
customerId = _ref3.customerId;
|
|
1706
1705
|
try {
|
|
1707
|
-
return Promise.resolve(API
|
|
1706
|
+
return Promise.resolve(API({
|
|
1708
1707
|
apiEndPoint: apiEndPoint,
|
|
1709
1708
|
token: token,
|
|
1710
1709
|
url: "/ecommerce/authoriseDotNet/customerProfile?customerId=" + customerId
|
|
@@ -1718,7 +1717,7 @@ var addAuthoriseDotNetCard = function addAuthoriseDotNetCard(_ref4) {
|
|
|
1718
1717
|
token = _ref4.token,
|
|
1719
1718
|
body = _ref4.body;
|
|
1720
1719
|
try {
|
|
1721
|
-
return Promise.resolve(API
|
|
1720
|
+
return Promise.resolve(API({
|
|
1722
1721
|
apiEndPoint: apiEndPoint,
|
|
1723
1722
|
token: token,
|
|
1724
1723
|
url: "/ecommerce/authoriseDotNet/paymentProfile",
|
|
@@ -1730,6 +1729,54 @@ var addAuthoriseDotNetCard = function addAuthoriseDotNetCard(_ref4) {
|
|
|
1730
1729
|
return Promise.reject(e);
|
|
1731
1730
|
}
|
|
1732
1731
|
};
|
|
1732
|
+
var getCartDiscountList = function getCartDiscountList(_ref5) {
|
|
1733
|
+
var apiEndPoint = _ref5.apiEndPoint,
|
|
1734
|
+
token = _ref5.token;
|
|
1735
|
+
try {
|
|
1736
|
+
return Promise.resolve(API({
|
|
1737
|
+
apiEndPoint: apiEndPoint,
|
|
1738
|
+
token: token,
|
|
1739
|
+
url: "/cartDiscount?storeId=2"
|
|
1740
|
+
}));
|
|
1741
|
+
} catch (e) {
|
|
1742
|
+
return Promise.reject(e);
|
|
1743
|
+
}
|
|
1744
|
+
};
|
|
1745
|
+
var addCartDiscount = function addCartDiscount(_ref7) {
|
|
1746
|
+
var apiEndPoint = _ref7.apiEndPoint,
|
|
1747
|
+
token = _ref7.token,
|
|
1748
|
+
body = _ref7.body;
|
|
1749
|
+
try {
|
|
1750
|
+
return Promise.resolve(API({
|
|
1751
|
+
apiEndPoint: apiEndPoint,
|
|
1752
|
+
token: token,
|
|
1753
|
+
url: "/cartDiscount?storeId=2",
|
|
1754
|
+
method: 'post',
|
|
1755
|
+
body: body,
|
|
1756
|
+
successMessage: 'Discount added successfully.',
|
|
1757
|
+
errorMessage: 'Error in adding discount.'
|
|
1758
|
+
}));
|
|
1759
|
+
} catch (e) {
|
|
1760
|
+
return Promise.reject(e);
|
|
1761
|
+
}
|
|
1762
|
+
};
|
|
1763
|
+
var deleteCartDiscount = function deleteCartDiscount(_ref8) {
|
|
1764
|
+
var apiEndPoint = _ref8.apiEndPoint,
|
|
1765
|
+
token = _ref8.token,
|
|
1766
|
+
discountId = _ref8.discountId;
|
|
1767
|
+
try {
|
|
1768
|
+
return Promise.resolve(API({
|
|
1769
|
+
apiEndPoint: apiEndPoint,
|
|
1770
|
+
token: token,
|
|
1771
|
+
url: "/cartDiscount?cartDiscountMapId=" + discountId + "&storeId=2",
|
|
1772
|
+
method: 'delete',
|
|
1773
|
+
successMessage: 'Discount removed successfully.',
|
|
1774
|
+
errorMessage: 'Error in removing discount.'
|
|
1775
|
+
}));
|
|
1776
|
+
} catch (e) {
|
|
1777
|
+
return Promise.reject(e);
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1733
1780
|
|
|
1734
1781
|
var _templateObject$9;
|
|
1735
1782
|
var _excluded$2 = ["children", "onClose", "fontColor"];
|
|
@@ -1911,7 +1958,7 @@ var getStatesById = function getStatesById(_ref) {
|
|
|
1911
1958
|
token = _ref.token,
|
|
1912
1959
|
id = _ref.id;
|
|
1913
1960
|
try {
|
|
1914
|
-
return Promise.resolve(API
|
|
1961
|
+
return Promise.resolve(API({
|
|
1915
1962
|
apiEndPoint: apiEndPoint,
|
|
1916
1963
|
token: token,
|
|
1917
1964
|
url: "/country/" + id + "/allState",
|
|
@@ -1925,7 +1972,7 @@ var getCountry = function getCountry(_ref2) {
|
|
|
1925
1972
|
var apiEndPoint = _ref2.apiEndPoint,
|
|
1926
1973
|
token = _ref2.token;
|
|
1927
1974
|
try {
|
|
1928
|
-
return Promise.resolve(API
|
|
1975
|
+
return Promise.resolve(API({
|
|
1929
1976
|
apiEndPoint: apiEndPoint,
|
|
1930
1977
|
token: token,
|
|
1931
1978
|
url: "/country/all",
|
|
@@ -2254,7 +2301,7 @@ var PaymentModal = function PaymentModal(_ref) {
|
|
|
2254
2301
|
};
|
|
2255
2302
|
setDataLoading(true);
|
|
2256
2303
|
var _temp = _catch(function () {
|
|
2257
|
-
return Promise.resolve(API
|
|
2304
|
+
return Promise.resolve(API({
|
|
2258
2305
|
url: "/ecommerce/order/" + orderId + "?storeIds=" + storeIdList,
|
|
2259
2306
|
apiEndPoint: apiEndPoint,
|
|
2260
2307
|
token: token
|
|
@@ -2333,7 +2380,7 @@ var PaymentModal = function PaymentModal(_ref) {
|
|
|
2333
2380
|
authorizeDotNetCustomerPaymentProfileId: authorizeDotNetCardData === null || authorizeDotNetCardData === void 0 ? void 0 : authorizeDotNetCardData.customerPaymentProfileId,
|
|
2334
2381
|
authorizeDotNetCustomerProfileId: customerCreditCards === null || customerCreditCards === void 0 ? void 0 : (_customerCreditCards$3 = customerCreditCards.profile) === null || _customerCreditCards$3 === void 0 ? void 0 : _customerCreditCards$3.customerProfileId
|
|
2335
2382
|
}), ['authorizeDotNetCard']));
|
|
2336
|
-
return Promise.resolve(API
|
|
2383
|
+
return Promise.resolve(API({
|
|
2337
2384
|
apiEndPoint: apiEndPoint,
|
|
2338
2385
|
token: token,
|
|
2339
2386
|
method: 'post',
|
|
@@ -2689,14 +2736,14 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
2689
2736
|
(function () {
|
|
2690
2737
|
try {
|
|
2691
2738
|
var _temp = _catch(function () {
|
|
2692
|
-
return Promise.resolve(API
|
|
2739
|
+
return Promise.resolve(API({
|
|
2693
2740
|
url: "/ecommerce/customer",
|
|
2694
2741
|
apiEndPoint: apiEndPoint,
|
|
2695
2742
|
token: token,
|
|
2696
2743
|
hideErrorMessage: true
|
|
2697
2744
|
})).then(function (customerDataResponse) {
|
|
2698
2745
|
setCustomerData(customerDataResponse);
|
|
2699
|
-
return Promise.resolve(API
|
|
2746
|
+
return Promise.resolve(API({
|
|
2700
2747
|
url: "/ecommerce/dashboard",
|
|
2701
2748
|
apiEndPoint: apiEndPoint,
|
|
2702
2749
|
token: token
|
|
@@ -3156,7 +3203,7 @@ var MyProfile = function MyProfile(_ref) {
|
|
|
3156
3203
|
(function () {
|
|
3157
3204
|
try {
|
|
3158
3205
|
var _temp = _catch(function () {
|
|
3159
|
-
return Promise.resolve(API
|
|
3206
|
+
return Promise.resolve(API({
|
|
3160
3207
|
apiEndPoint: apiEndPoint,
|
|
3161
3208
|
token: token,
|
|
3162
3209
|
url: "/ecommerce/customer",
|
|
@@ -3179,7 +3226,7 @@ var MyProfile = function MyProfile(_ref) {
|
|
|
3179
3226
|
};
|
|
3180
3227
|
setIsLoading(true);
|
|
3181
3228
|
var _temp2 = _catch(function () {
|
|
3182
|
-
return Promise.resolve(API
|
|
3229
|
+
return Promise.resolve(API({
|
|
3183
3230
|
apiEndPoint: apiEndPoint,
|
|
3184
3231
|
token: token,
|
|
3185
3232
|
method: 'put',
|
|
@@ -3733,13 +3780,13 @@ var Statement = function Statement(_ref) {
|
|
|
3733
3780
|
var _temp2 = function () {
|
|
3734
3781
|
if (token && apiEndPoint) {
|
|
3735
3782
|
var _temp = _catch(function () {
|
|
3736
|
-
return Promise.resolve(API
|
|
3783
|
+
return Promise.resolve(API({
|
|
3737
3784
|
url: "/ecommerce/customer",
|
|
3738
3785
|
apiEndPoint: apiEndPoint,
|
|
3739
3786
|
token: token
|
|
3740
3787
|
})).then(function (customerDataResponse) {
|
|
3741
3788
|
setCustomerData(customerDataResponse);
|
|
3742
|
-
return Promise.resolve(API
|
|
3789
|
+
return Promise.resolve(API({
|
|
3743
3790
|
apiEndPoint: apiEndPoint,
|
|
3744
3791
|
token: token,
|
|
3745
3792
|
url: "/ecommerce/customer/child"
|
|
@@ -3770,7 +3817,7 @@ var Statement = function Statement(_ref) {
|
|
|
3770
3817
|
var _customerData$custome3, _customerData$custome4;
|
|
3771
3818
|
setLoading(true);
|
|
3772
3819
|
var customerIds = queryParams !== null && queryParams !== void 0 && queryParams.customerIds ? (queryParams === null || queryParams === void 0 ? void 0 : queryParams.customerIds) + "," + (customerData === null || customerData === void 0 ? void 0 : (_customerData$custome3 = customerData.customerDto) === null || _customerData$custome3 === void 0 ? void 0 : _customerData$custome3.id) : customerData === null || customerData === void 0 ? void 0 : (_customerData$custome4 = customerData.customerDto) === null || _customerData$custome4 === void 0 ? void 0 : _customerData$custome4.id;
|
|
3773
|
-
return Promise.resolve(API
|
|
3820
|
+
return Promise.resolve(API({
|
|
3774
3821
|
url: "/ecommerce/customer/report/statement?storeIds=" + storeIdList + "&page=0&size=20",
|
|
3775
3822
|
apiEndPoint: apiEndPoint,
|
|
3776
3823
|
token: token,
|
|
@@ -3996,7 +4043,7 @@ var AddEditAddress = function AddEditAddress(_ref) {
|
|
|
3996
4043
|
setIsLoading(true);
|
|
3997
4044
|
var _temp2 = _catch(function () {
|
|
3998
4045
|
var _customer$customerDto, _customer$customerDto2;
|
|
3999
|
-
return Promise.resolve(API
|
|
4046
|
+
return Promise.resolve(API({
|
|
4000
4047
|
apiEndPoint: apiEndPoint,
|
|
4001
4048
|
token: token,
|
|
4002
4049
|
url: "/ecommerce/customer/" + (customer === null || customer === void 0 ? void 0 : (_customer$customerDto = customer.customerDto) === null || _customer$customerDto === void 0 ? void 0 : _customer$customerDto.id) + "/address",
|
|
@@ -4322,7 +4369,7 @@ var StoreTabs = function StoreTabs(_ref) {
|
|
|
4322
4369
|
try {
|
|
4323
4370
|
var _temp2 = _catch(function () {
|
|
4324
4371
|
var _customer$customerDto2;
|
|
4325
|
-
return Promise.resolve(API
|
|
4372
|
+
return Promise.resolve(API({
|
|
4326
4373
|
apiEndPoint: apiEndPoint,
|
|
4327
4374
|
token: token,
|
|
4328
4375
|
url: "/ecommerce/customer/" + (customer === null || customer === void 0 ? void 0 : (_customer$customerDto2 = customer.customerDto) === null || _customer$customerDto2 === void 0 ? void 0 : _customer$customerDto2.id) + "/address",
|
|
@@ -4389,7 +4436,7 @@ var StoreList = function StoreList(_ref) {
|
|
|
4389
4436
|
setCustomer = _useState[1];
|
|
4390
4437
|
React.useEffect(function () {
|
|
4391
4438
|
try {
|
|
4392
|
-
return Promise.resolve(API
|
|
4439
|
+
return Promise.resolve(API({
|
|
4393
4440
|
apiEndPoint: apiEndPoint,
|
|
4394
4441
|
token: token,
|
|
4395
4442
|
url: "/ecommerce/customer",
|
|
@@ -4528,7 +4575,7 @@ var AccountDetails = function AccountDetails(_ref) {
|
|
|
4528
4575
|
};
|
|
4529
4576
|
setDataLoading(true);
|
|
4530
4577
|
var _temp = _catch(function () {
|
|
4531
|
-
return Promise.resolve(API
|
|
4578
|
+
return Promise.resolve(API({
|
|
4532
4579
|
apiEndPoint: apiEndPoint,
|
|
4533
4580
|
token: token,
|
|
4534
4581
|
url: "/store"
|
|
@@ -4935,7 +4982,7 @@ var BrandList = function BrandList(_ref) {
|
|
|
4935
4982
|
};
|
|
4936
4983
|
setLoading(true);
|
|
4937
4984
|
var _temp = _catch(function () {
|
|
4938
|
-
return Promise.resolve(API
|
|
4985
|
+
return Promise.resolve(API({
|
|
4939
4986
|
apiEndPoint: apiEndPoint,
|
|
4940
4987
|
url: "/ecommerce/brand/list?size=" + (size || 20)
|
|
4941
4988
|
})).then(function (data) {
|
|
@@ -4997,7 +5044,7 @@ var AsyncDataLoad = function AsyncDataLoad(_ref) {
|
|
|
4997
5044
|
data = _asyncService;
|
|
4998
5045
|
});
|
|
4999
5046
|
} else {
|
|
5000
|
-
return Promise.resolve(API
|
|
5047
|
+
return Promise.resolve(API(_extends({
|
|
5001
5048
|
apiEndPoint: apiEndPoint,
|
|
5002
5049
|
token: token,
|
|
5003
5050
|
hideErrorMessage: true
|
|
@@ -5053,7 +5100,7 @@ var BrandStock = function BrandStock(_ref) {
|
|
|
5053
5100
|
(function () {
|
|
5054
5101
|
try {
|
|
5055
5102
|
var _temp = _catch(function () {
|
|
5056
|
-
return Promise.resolve(API
|
|
5103
|
+
return Promise.resolve(API({
|
|
5057
5104
|
apiEndPoint: apiEndPoint,
|
|
5058
5105
|
url: "/ecommerce/brand/list?size=9999"
|
|
5059
5106
|
})).then(function (brandList) {
|
|
@@ -5072,7 +5119,7 @@ var BrandStock = function BrandStock(_ref) {
|
|
|
5072
5119
|
var brand = _ref2.brand;
|
|
5073
5120
|
return Promise.resolve(_catch(function () {
|
|
5074
5121
|
var data = [];
|
|
5075
|
-
return Promise.resolve(API
|
|
5122
|
+
return Promise.resolve(API({
|
|
5076
5123
|
apiEndPoint: apiEndPoint,
|
|
5077
5124
|
url: "/ecommerce/product/brand?brandIdList=" + (brand === null || brand === void 0 ? void 0 : brand.id) + "&storeIds=2&size=9999"
|
|
5078
5125
|
})).then(function (products) {
|
|
@@ -5084,7 +5131,7 @@ var BrandStock = function BrandStock(_ref) {
|
|
|
5084
5131
|
data = products === null || products === void 0 ? void 0 : products.content;
|
|
5085
5132
|
var updatePromises = [];
|
|
5086
5133
|
var _temp2 = _forOf(products === null || products === void 0 ? void 0 : products.content, function (product) {
|
|
5087
|
-
return Promise.resolve(API
|
|
5134
|
+
return Promise.resolve(API({
|
|
5088
5135
|
apiEndPoint: apiEndPoint,
|
|
5089
5136
|
url: "/ecommerce/product/" + (product === null || product === void 0 ? void 0 : product.productId) + "?storeIds=2"
|
|
5090
5137
|
})).then(function (childProducts) {
|
|
@@ -5316,7 +5363,7 @@ var CartPageSection = styled__default.section(_templateObject$s || (_templateObj
|
|
|
5316
5363
|
}, function (props) {
|
|
5317
5364
|
return props.bg || '#FAE8E5';
|
|
5318
5365
|
});
|
|
5319
|
-
var CartPageContainer = styled__default.div(_templateObject2$i || (_templateObject2$i = _taggedTemplateLiteralLoose(["\n max-width: ", ";\n width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n padding: 2rem;\n padding-bottom: 2em;\n border-radius: 12px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n
|
|
5366
|
+
var CartPageContainer = styled__default.div(_templateObject2$i || (_templateObject2$i = _taggedTemplateLiteralLoose(["\n max-width: ", ";\n width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n padding: 2rem;\n padding-bottom: 2em;\n border-radius: 12px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n max-height: 630px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n }\n /* box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05); */\n }\n table {\n border-collapse: separate;\n border-spacing: 0 4px;\n row-gap: 4px;\n }\n\n td {\n /* border: solid 1px #000; */\n border-style: none solid solid none;\n /* padding: 10px; */\n /* margin-bottom:5px; */\n }\n\n tr:first-child td:first-child {\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-top-right-radius: 10px;\n border-bottom-right-radius: 10px;\n }\n\n tr td:first-child {\n border-bottom-left-radius: 10px;\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-bottom-right-radius: 10px;\n }\n\n tr td {\n border-top-style: solid;\n }\n tr td:first-child {\n border-left-style: solid;\n }\n\n @media only screen and (max-width: 1200px) {\n flex-direction: column;\n align-items: center;\n padding: 1rem 0;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n // padding: 0 0.4em;\n }\n }\n"])), function (props) {
|
|
5320
5367
|
return props.maxWidth || '1600px';
|
|
5321
5368
|
}, function (props) {
|
|
5322
5369
|
return "min(" + (props.maxWidth || '1600px') + ",100%)";
|
|
@@ -5345,7 +5392,7 @@ var CartTableCell = styled__default(material.TableCell)(_templateObject6$5 || (_
|
|
|
5345
5392
|
}, function (props) {
|
|
5346
5393
|
return "" + props.color || 'inherit';
|
|
5347
5394
|
});
|
|
5348
|
-
var CartTableContainer = styled__default(material.TableContainer)(_templateObject7$4 || (_templateObject7$4 = _taggedTemplateLiteralLoose(["\n max-height: 580px;\n
|
|
5395
|
+
var CartTableContainer = styled__default(material.TableContainer)(_templateObject7$4 || (_templateObject7$4 = _taggedTemplateLiteralLoose(["\n max-height: 580px;\n padding-right: 1rem;\n\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n width: 100%;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n border-radius: 16px;\n margin: 5px 2px;\n background: ", ";\n }\n @media screen and (max-width: 768px) {\n padding: 0;\n }\n"])), function (props) {
|
|
5349
5396
|
return 'rgba(102, 112, 128, 0.5)';
|
|
5350
5397
|
}, function (props) {
|
|
5351
5398
|
return props.color;
|
|
@@ -6847,7 +6894,7 @@ function EnhancedTable(_ref) {
|
|
|
6847
6894
|
handleIncrementDecrement: handleIncrementDecrement,
|
|
6848
6895
|
handleRemoveProduct: handleRemoveProduct
|
|
6849
6896
|
});
|
|
6850
|
-
}))))), /*#__PURE__*/React.createElement(CartButtonsRow, {
|
|
6897
|
+
}))))), (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length) > 0 && /*#__PURE__*/React.createElement(CartButtonsRow, {
|
|
6851
6898
|
bg: styles === null || styles === void 0 ? void 0 : (_styles$Btn2 = styles.Btn) === null || _styles$Btn2 === void 0 ? void 0 : _styles$Btn2.background,
|
|
6852
6899
|
color: styles === null || styles === void 0 ? void 0 : (_styles$Btn3 = styles.Btn) === null || _styles$Btn3 === void 0 ? void 0 : _styles$Btn3.color
|
|
6853
6900
|
}, /*#__PURE__*/React.createElement("button", {
|
|
@@ -6989,7 +7036,7 @@ var CartPageMainRetail = function CartPageMainRetail(_ref) {
|
|
|
6989
7036
|
};
|
|
6990
7037
|
|
|
6991
7038
|
var _templateObject$v, _templateObject2$l, _templateObject3$f, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$6, _templateObject8$4;
|
|
6992
|
-
var CartSummaryContainer = styled__default.div(_templateObject$v || (_templateObject$v = _taggedTemplateLiteralLoose(["\n width: 25rem;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n border-radius: 20px;\n padding: 2em
|
|
7039
|
+
var CartSummaryContainer = styled__default.div(_templateObject$v || (_templateObject$v = _taggedTemplateLiteralLoose(["\n width: 25rem;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n border-radius: 20px;\n padding: 2em;\n align-items: center;\n /* margin-top: 3em; */\n p {\n font-size: 1.189em;\n font-weight: 600;\n align-self: flex-start;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n .continueShopping {\n font-size: 0.75em;\n color: inherit;\n text-transform: capitalize;\n height: 20px;\n border-bottom: 1px solid;\n border-color: ", ";\n cursor: pointer;\n }\n"])), function (props) {
|
|
6993
7040
|
return props.background || '#667080';
|
|
6994
7041
|
}, function (props) {
|
|
6995
7042
|
return props.color || 'white';
|
|
@@ -7001,10 +7048,10 @@ var CartSummaryRow = styled__default.div(_templateObject2$l || (_templateObject2
|
|
|
7001
7048
|
}, function (props) {
|
|
7002
7049
|
return props.h5 || '1.31em';
|
|
7003
7050
|
});
|
|
7004
|
-
var CartSummaryHr = styled__default.span(_templateObject3$f || (_templateObject3$f = _taggedTemplateLiteralLoose(["\n border: none;\n width: 100%;\n height: 1px;\n background-color: ", ";\n margin:
|
|
7051
|
+
var CartSummaryHr = styled__default.span(_templateObject3$f || (_templateObject3$f = _taggedTemplateLiteralLoose(["\n border: none;\n width: 100%;\n height: 1px;\n background-color: ", ";\n margin: 1em 0;\n"])), function (props) {
|
|
7005
7052
|
return props.color || 'rgba(255, 255, 255, 0.5)';
|
|
7006
7053
|
});
|
|
7007
|
-
var CartSummaryInputBox = styled__default.form(_templateObject4$c || (_templateObject4$c = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding-bottom: ", ";\n background-color: transparent;\n width: 100%;\n input {\n width: 65%;\n height: 2.
|
|
7054
|
+
var CartSummaryInputBox = styled__default.form(_templateObject4$c || (_templateObject4$c = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding-bottom: ", ";\n background-color: transparent;\n width: 100%;\n input {\n width: 65%;\n height: 2.5rem;\n padding: 0.2rem 0.8rem;\n font-size: 0.89rem;\n border: none;\n outline: none;\n background: ", ";\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n }\n button {\n width: 35%;\n height: 2.5rem;\n line-height: 0.8rem;\n background: ", ";\n display: grid;\n color: ", ";\n place-items: center;\n border: none;\n border-radius: 0;\n outline: none;\n text-transform: uppercase;\n cursor: pointer;\n font-size: 0.75em;\n transition: 0.3s;\n &:hover {\n letter-spacing: 1px;\n background: ", ";\n }\n }\n"])), function (props) {
|
|
7008
7055
|
return props.paddingBottom ? '0' : '0';
|
|
7009
7056
|
}, function (props) {
|
|
7010
7057
|
return props.background || '#bfc3ca';
|
|
@@ -7019,8 +7066,8 @@ var CartSummaryInputBox = styled__default.form(_templateObject4$c || (_templateO
|
|
|
7019
7066
|
}, function (props) {
|
|
7020
7067
|
return props.btn || '#393f48';
|
|
7021
7068
|
});
|
|
7022
|
-
var DiscountCouponContainer = styled__default.div(_templateObject5$a || (_templateObject5$a = _taggedTemplateLiteralLoose(["\n padding: 0.
|
|
7023
|
-
var DiscountCouponCard = styled__default.div(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n padding: 0.3rem;\n
|
|
7069
|
+
var DiscountCouponContainer = styled__default.div(_templateObject5$a || (_templateObject5$a = _taggedTemplateLiteralLoose(["\n padding-top: 0.5rem;\n width: 100%;\n max-height: 200px;\n overflow: auto;\n"])));
|
|
7070
|
+
var DiscountCouponCard = styled__default.div(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0.3rem;\n button {\n color: ", ";\n font-size: 1.4rem;\n &:hover {\n color: red;\n }\n }\n"])), function (props) {
|
|
7024
7071
|
return props.btn || '#393f48';
|
|
7025
7072
|
});
|
|
7026
7073
|
var CartSummaryCheckoutBtn = styled__default.button(_templateObject7$6 || (_templateObject7$6 = _taggedTemplateLiteralLoose(["\n font-size: 0.95em;\n font-weight: 600;\n background: ", ";\n color: ", ";\n cursor: pointer;\n text-transform: uppercase;\n border: none;\n outline: none;\n width: 16.81em;\n height: 3.4em;\n display: grid;\n place-items: center;\n font-size: 0.75em;\n padding: 0;\n font-size: 0.94em;\n margin: 1em auto;\n transition: 0.3s;\n margin-top: 3em;\n &:hover {\n opacity: 0.8;\n }\n"])), function (props) {
|
|
@@ -7048,7 +7095,8 @@ var CartSummary = function CartSummary(_ref) {
|
|
|
7048
7095
|
onChangeDiscountCoupon = _ref.onChangeDiscountCoupon,
|
|
7049
7096
|
_ref$discountCoupons = _ref.discountCoupons,
|
|
7050
7097
|
discountCoupons = _ref$discountCoupons === void 0 ? [] : _ref$discountCoupons,
|
|
7051
|
-
cartDiscount = _ref.cartDiscount
|
|
7098
|
+
cartDiscount = _ref.cartDiscount,
|
|
7099
|
+
couponDiscountTotal = _ref.couponDiscountTotal;
|
|
7052
7100
|
var storeIdList = (storeData === null || storeData === void 0 ? void 0 : (_storeData$map = storeData.map(function (data) {
|
|
7053
7101
|
return data === null || data === void 0 ? void 0 : data.id;
|
|
7054
7102
|
})) === null || _storeData$map === void 0 ? void 0 : _storeData$map.join(',')) || 2;
|
|
@@ -7060,39 +7108,26 @@ var CartSummary = function CartSummary(_ref) {
|
|
|
7060
7108
|
var _useState2 = React.useState(''),
|
|
7061
7109
|
couponText = _useState2[0],
|
|
7062
7110
|
setCouponText = _useState2[1];
|
|
7063
|
-
var _useState3 = React.useState(discountCoupons),
|
|
7064
|
-
discountCouponData = _useState3[0],
|
|
7065
|
-
setDiscountCouponData = _useState3[1];
|
|
7066
7111
|
var ValidateDiscountCoupon = function ValidateDiscountCoupon(value) {
|
|
7067
7112
|
try {
|
|
7068
7113
|
var _temp3 = function () {
|
|
7069
7114
|
if (apiEndPoint && token) {
|
|
7070
7115
|
var _temp2 = function _temp2() {
|
|
7116
|
+
setCouponText('');
|
|
7071
7117
|
setButtonLoading(false);
|
|
7072
7118
|
};
|
|
7073
|
-
var
|
|
7074
|
-
|
|
7075
|
-
|
|
7119
|
+
var body = {
|
|
7120
|
+
cartTotal: cartAmount,
|
|
7121
|
+
couponCode: value
|
|
7076
7122
|
};
|
|
7077
7123
|
setButtonLoading(true);
|
|
7078
7124
|
var _temp = _catch(function () {
|
|
7079
|
-
return Promise.resolve(
|
|
7125
|
+
return Promise.resolve(addCartDiscount({
|
|
7080
7126
|
apiEndPoint: apiEndPoint,
|
|
7081
7127
|
token: token,
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
})).then(function (response) {
|
|
7086
|
-
var couponData = response === null || response === void 0 ? void 0 : response.map(function (item) {
|
|
7087
|
-
return {
|
|
7088
|
-
id: item.discountId,
|
|
7089
|
-
discountName: item.discountName,
|
|
7090
|
-
couponCode: item.couponCode,
|
|
7091
|
-
amount: item.amount
|
|
7092
|
-
};
|
|
7093
|
-
});
|
|
7094
|
-
setDiscountCouponData(lodash.uniqBy([].concat(discountCouponData, couponData), 'id'));
|
|
7095
|
-
onChangeDiscountCoupon && onChangeDiscountCoupon(lodash.uniqBy([].concat(discountCouponData, couponData), 'id'));
|
|
7128
|
+
body: body
|
|
7129
|
+
})).then(function () {
|
|
7130
|
+
onChangeDiscountCoupon && onChangeDiscountCoupon();
|
|
7096
7131
|
});
|
|
7097
7132
|
}, function () {});
|
|
7098
7133
|
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
|
@@ -7103,10 +7138,6 @@ var CartSummary = function CartSummary(_ref) {
|
|
|
7103
7138
|
return Promise.reject(e);
|
|
7104
7139
|
}
|
|
7105
7140
|
};
|
|
7106
|
-
var discountTotal = cartDiscount || 0;
|
|
7107
|
-
discountCouponData === null || discountCouponData === void 0 ? void 0 : discountCouponData.forEach(function (element) {
|
|
7108
|
-
discountTotal = discountTotal + element.amount;
|
|
7109
|
-
});
|
|
7110
7141
|
return /*#__PURE__*/React__default.createElement(CartSummaryContainer, {
|
|
7111
7142
|
background: cartSummary.bg,
|
|
7112
7143
|
color: cartSummary.color
|
|
@@ -7114,7 +7145,7 @@ var CartSummary = function CartSummary(_ref) {
|
|
|
7114
7145
|
color: cartSummary.hr
|
|
7115
7146
|
}), /*#__PURE__*/React__default.createElement(CartSummaryRow, null, /*#__PURE__*/React__default.createElement("h6", null, "subtotal"), /*#__PURE__*/React__default.createElement("h5", null, renderMoney(subtotal))), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
7116
7147
|
color: cartSummary.hr
|
|
7117
|
-
}), /*#__PURE__*/React__default.createElement(CartSummaryRow, null, /*#__PURE__*/React__default.createElement("h6", null, "Discount"), /*#__PURE__*/React__default.createElement("h5", null, renderMoney(
|
|
7148
|
+
}), /*#__PURE__*/React__default.createElement(CartSummaryRow, null, /*#__PURE__*/React__default.createElement("h6", null, "Order Discount"), /*#__PURE__*/React__default.createElement("h5", null, renderMoney(cartDiscount))), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
7118
7149
|
color: cartSummary.hr
|
|
7119
7150
|
}), /*#__PURE__*/React__default.createElement(CartSummaryInputBox, {
|
|
7120
7151
|
background: cartSummary === null || cartSummary === void 0 ? void 0 : (_cartSummary$input = cartSummary.input) === null || _cartSummary$input === void 0 ? void 0 : _cartSummary$input.bg,
|
|
@@ -7138,32 +7169,31 @@ var CartSummary = function CartSummary(_ref) {
|
|
|
7138
7169
|
type: "submit",
|
|
7139
7170
|
variant: "contained",
|
|
7140
7171
|
loading: buttonLoading
|
|
7141
|
-
}, "apply coupon")), /*#__PURE__*/React__default.createElement(DiscountCouponContainer, {
|
|
7172
|
+
}, "apply coupon")), (discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.length) > 0 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DiscountCouponContainer, {
|
|
7142
7173
|
background: cartSummary === null || cartSummary === void 0 ? void 0 : (_cartSummary$input3 = cartSummary.input) === null || _cartSummary$input3 === void 0 ? void 0 : _cartSummary$input3.bg,
|
|
7143
7174
|
color: cartSummary === null || cartSummary === void 0 ? void 0 : (_cartSummary$input4 = cartSummary.input) === null || _cartSummary$input4 === void 0 ? void 0 : _cartSummary$input4.color,
|
|
7144
7175
|
btn: Btn === null || Btn === void 0 ? void 0 : Btn.background,
|
|
7145
7176
|
Btncolor: Btn === null || Btn === void 0 ? void 0 : Btn.color
|
|
7146
|
-
},
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
onChangeDiscountCoupon(data);
|
|
7160
|
-
}
|
|
7161
|
-
}));
|
|
7177
|
+
}, discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.map(function (coupon, index) {
|
|
7178
|
+
return /*#__PURE__*/React__default.createElement(DiscountItemCard, {
|
|
7179
|
+
key: index,
|
|
7180
|
+
index: index,
|
|
7181
|
+
discountCoupons: discountCoupons,
|
|
7182
|
+
cartSummary: cartSummary,
|
|
7183
|
+
Btn: Btn,
|
|
7184
|
+
coupon: coupon,
|
|
7185
|
+
deleteCartDiscount: deleteCartDiscount,
|
|
7186
|
+
onChangeDiscountCoupon: onChangeDiscountCoupon,
|
|
7187
|
+
apiEndPoint: apiEndPoint,
|
|
7188
|
+
token: token
|
|
7189
|
+
});
|
|
7162
7190
|
})), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
7163
7191
|
color: cartSummary.hr
|
|
7192
|
+
}), /*#__PURE__*/React__default.createElement(CartSummaryRow, null, /*#__PURE__*/React__default.createElement("h6", null, "Coupon Discount"), /*#__PURE__*/React__default.createElement("h5", null, renderMoney(couponDiscountTotal)))), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
7193
|
+
color: cartSummary.hr
|
|
7164
7194
|
}), /*#__PURE__*/React__default.createElement(CartSummaryRow, {
|
|
7165
7195
|
h5: "1.64em"
|
|
7166
|
-
}, /*#__PURE__*/React__default.createElement("h6", null, "order total"), /*#__PURE__*/React__default.createElement("h5", null, renderMoney(totalCartPrice + ((selectedShipping === null || selectedShipping === void 0 ? void 0 : selectedShipping.amount) || 0) -
|
|
7196
|
+
}, /*#__PURE__*/React__default.createElement("h6", null, "order total"), /*#__PURE__*/React__default.createElement("h5", null, renderMoney(totalCartPrice + ((selectedShipping === null || selectedShipping === void 0 ? void 0 : selectedShipping.amount) || 0) - couponDiscountTotal))), /*#__PURE__*/React__default.createElement(CartSummaryRow, {
|
|
7167
7197
|
justify: "center"
|
|
7168
7198
|
}, /*#__PURE__*/React__default.createElement(CartSummaryCheckoutBtn, {
|
|
7169
7199
|
onClick: function onClick() {
|
|
@@ -7182,6 +7212,62 @@ var CartSummary = function CartSummary(_ref) {
|
|
|
7182
7212
|
}
|
|
7183
7213
|
}, "Continue to shopping")));
|
|
7184
7214
|
};
|
|
7215
|
+
var DiscountItemCard = function DiscountItemCard(_ref2) {
|
|
7216
|
+
var _cartSummary$input5, _cartSummary$input6;
|
|
7217
|
+
var index = _ref2.index,
|
|
7218
|
+
discountCoupons = _ref2.discountCoupons,
|
|
7219
|
+
cartSummary = _ref2.cartSummary,
|
|
7220
|
+
Btn = _ref2.Btn,
|
|
7221
|
+
coupon = _ref2.coupon,
|
|
7222
|
+
deleteCartDiscount = _ref2.deleteCartDiscount,
|
|
7223
|
+
onChangeDiscountCoupon = _ref2.onChangeDiscountCoupon,
|
|
7224
|
+
apiEndPoint = _ref2.apiEndPoint,
|
|
7225
|
+
token = _ref2.token;
|
|
7226
|
+
var _useState3 = React.useState(false),
|
|
7227
|
+
deleteLoading = _useState3[0],
|
|
7228
|
+
setDeleteLoading = _useState3[1];
|
|
7229
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
7230
|
+
style: {
|
|
7231
|
+
display: 'flex',
|
|
7232
|
+
flexDirection: 'column'
|
|
7233
|
+
}
|
|
7234
|
+
}, /*#__PURE__*/React__default.createElement(DiscountCouponCard, {
|
|
7235
|
+
background: cartSummary === null || cartSummary === void 0 ? void 0 : (_cartSummary$input5 = cartSummary.input) === null || _cartSummary$input5 === void 0 ? void 0 : _cartSummary$input5.bg,
|
|
7236
|
+
color: cartSummary === null || cartSummary === void 0 ? void 0 : (_cartSummary$input6 = cartSummary.input) === null || _cartSummary$input6 === void 0 ? void 0 : _cartSummary$input6.color,
|
|
7237
|
+
btn: Btn === null || Btn === void 0 ? void 0 : Btn.background,
|
|
7238
|
+
Btncolor: Btn === null || Btn === void 0 ? void 0 : Btn.color
|
|
7239
|
+
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("span", null, coupon === null || coupon === void 0 ? void 0 : coupon.couponCode)), /*#__PURE__*/React__default.createElement("b", null, renderMoney(coupon === null || coupon === void 0 ? void 0 : coupon.amount))), /*#__PURE__*/React__default.createElement(MuiIconButton, {
|
|
7240
|
+
loading: deleteLoading,
|
|
7241
|
+
onClick: function onClick() {
|
|
7242
|
+
try {
|
|
7243
|
+
var _temp6 = function _temp6() {
|
|
7244
|
+
setDeleteLoading(false);
|
|
7245
|
+
};
|
|
7246
|
+
setDeleteLoading(true);
|
|
7247
|
+
var _temp5 = _catch(function () {
|
|
7248
|
+
return Promise.resolve(deleteCartDiscount({
|
|
7249
|
+
apiEndPoint: apiEndPoint,
|
|
7250
|
+
token: token,
|
|
7251
|
+
discountId: coupon === null || coupon === void 0 ? void 0 : coupon.id
|
|
7252
|
+
})).then(function () {
|
|
7253
|
+
function _temp4(_onChangeDiscountCoup) {
|
|
7254
|
+
_onChangeDiscountCoup;
|
|
7255
|
+
}
|
|
7256
|
+
return onChangeDiscountCoupon ? Promise.resolve(onChangeDiscountCoupon()).then(_temp4) : _temp4(onChangeDiscountCoupon);
|
|
7257
|
+
});
|
|
7258
|
+
}, function () {});
|
|
7259
|
+
return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5));
|
|
7260
|
+
} catch (e) {
|
|
7261
|
+
return Promise.reject(e);
|
|
7262
|
+
}
|
|
7263
|
+
}
|
|
7264
|
+
}, /*#__PURE__*/React__default.createElement(md.MdDelete, null))), (discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.length) - 1 !== index && /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
7265
|
+
color: cartSummary.hr,
|
|
7266
|
+
style: {
|
|
7267
|
+
margin: 0
|
|
7268
|
+
}
|
|
7269
|
+
}));
|
|
7270
|
+
};
|
|
7185
7271
|
|
|
7186
7272
|
var CartPageComponent = function CartPageComponent(_ref) {
|
|
7187
7273
|
var _styles$input;
|
|
@@ -7198,8 +7284,6 @@ var CartPageComponent = function CartPageComponent(_ref) {
|
|
|
7198
7284
|
loading = _ref.loading,
|
|
7199
7285
|
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
7200
7286
|
styles = _ref.styles,
|
|
7201
|
-
onChangeDiscountCoupon = _ref.onChangeDiscountCoupon,
|
|
7202
|
-
discountCoupons = _ref.discountCoupons,
|
|
7203
7287
|
disabledSelectAllProductCheckbox = _ref.disabledSelectAllProductCheckbox;
|
|
7204
7288
|
var _useState = React.useState([]),
|
|
7205
7289
|
storeData = _useState[0],
|
|
@@ -7207,6 +7291,13 @@ var CartPageComponent = function CartPageComponent(_ref) {
|
|
|
7207
7291
|
var _useWindowSize = useWindowSize(),
|
|
7208
7292
|
width = _useWindowSize.width;
|
|
7209
7293
|
var retail = width <= 768;
|
|
7294
|
+
var _useState2 = React.useState([]),
|
|
7295
|
+
discountCoupons = _useState2[0],
|
|
7296
|
+
setDiscountCoupons = _useState2[1];
|
|
7297
|
+
var _useState3 = React.useState(),
|
|
7298
|
+
customer = _useState3[0],
|
|
7299
|
+
setCustomer = _useState3[1];
|
|
7300
|
+
var couponDiscountTotal = lodash.sumBy(discountCoupons, 'amount');
|
|
7210
7301
|
React.useEffect(function () {
|
|
7211
7302
|
(function () {
|
|
7212
7303
|
try {
|
|
@@ -7230,6 +7321,77 @@ var CartPageComponent = function CartPageComponent(_ref) {
|
|
|
7230
7321
|
}
|
|
7231
7322
|
})();
|
|
7232
7323
|
}, []);
|
|
7324
|
+
React.useEffect(function () {
|
|
7325
|
+
(function () {
|
|
7326
|
+
try {
|
|
7327
|
+
var _temp4 = function () {
|
|
7328
|
+
if (apiEndPoint && token) {
|
|
7329
|
+
var _temp3 = _catch(function () {
|
|
7330
|
+
return Promise.resolve(API({
|
|
7331
|
+
apiEndPoint: apiEndPoint,
|
|
7332
|
+
token: token,
|
|
7333
|
+
url: "/ecommerce/customer",
|
|
7334
|
+
hideErrorMessage: true
|
|
7335
|
+
})).then(function (data) {
|
|
7336
|
+
setCustomer(data);
|
|
7337
|
+
});
|
|
7338
|
+
}, function () {});
|
|
7339
|
+
if (_temp3 && _temp3.then) return _temp3.then(function () {});
|
|
7340
|
+
}
|
|
7341
|
+
}();
|
|
7342
|
+
return _temp4 && _temp4.then ? _temp4.then(function () {}) : void 0;
|
|
7343
|
+
} catch (e) {
|
|
7344
|
+
Promise.reject(e);
|
|
7345
|
+
}
|
|
7346
|
+
})();
|
|
7347
|
+
}, [token]);
|
|
7348
|
+
React.useEffect(function () {
|
|
7349
|
+
(function () {
|
|
7350
|
+
try {
|
|
7351
|
+
var _temp5 = function () {
|
|
7352
|
+
if (customer) {
|
|
7353
|
+
return Promise.resolve(getDiscountList()).then(function () {});
|
|
7354
|
+
}
|
|
7355
|
+
}();
|
|
7356
|
+
return _temp5 && _temp5.then ? _temp5.then(function () {}) : void 0;
|
|
7357
|
+
} catch (e) {
|
|
7358
|
+
Promise.reject(e);
|
|
7359
|
+
}
|
|
7360
|
+
})();
|
|
7361
|
+
}, [cartData, customer]);
|
|
7362
|
+
var inDebounce;
|
|
7363
|
+
var getDiscountList = function getDiscountList() {
|
|
7364
|
+
try {
|
|
7365
|
+
inDebounce = setTimeout(function () {
|
|
7366
|
+
(function () {
|
|
7367
|
+
try {
|
|
7368
|
+
var _temp7 = function () {
|
|
7369
|
+
if (apiEndPoint && token) {
|
|
7370
|
+
var _temp6 = _catch(function () {
|
|
7371
|
+
return Promise.resolve(getCartDiscountList({
|
|
7372
|
+
apiEndPoint: apiEndPoint,
|
|
7373
|
+
token: token
|
|
7374
|
+
})).then(function (data) {
|
|
7375
|
+
setDiscountCoupons(data);
|
|
7376
|
+
});
|
|
7377
|
+
}, function () {});
|
|
7378
|
+
if (_temp6 && _temp6.then) return _temp6.then(function () {});
|
|
7379
|
+
}
|
|
7380
|
+
}();
|
|
7381
|
+
return _temp7 && _temp7.then ? _temp7.then(function () {}) : void 0;
|
|
7382
|
+
} catch (e) {
|
|
7383
|
+
Promise.reject(e);
|
|
7384
|
+
}
|
|
7385
|
+
})();
|
|
7386
|
+
}, 500);
|
|
7387
|
+
return Promise.resolve();
|
|
7388
|
+
} catch (e) {
|
|
7389
|
+
return Promise.reject(e);
|
|
7390
|
+
}
|
|
7391
|
+
};
|
|
7392
|
+
var onChangeDiscountCoupon = function onChangeDiscountCoupon() {
|
|
7393
|
+
return Promise.resolve(getDiscountList()).then(function () {});
|
|
7394
|
+
};
|
|
7233
7395
|
var onChangeQuantity = function onChangeQuantity(product) {
|
|
7234
7396
|
handleIncrementDecrement(product, product);
|
|
7235
7397
|
};
|
|
@@ -7277,7 +7439,8 @@ var CartPageComponent = function CartPageComponent(_ref) {
|
|
|
7277
7439
|
loading: loading,
|
|
7278
7440
|
cartDiscount: cartData === null || cartData === void 0 ? void 0 : cartData.cartDiscount,
|
|
7279
7441
|
onChangeDiscountCoupon: onChangeDiscountCoupon,
|
|
7280
|
-
discountCoupons: discountCoupons
|
|
7442
|
+
discountCoupons: discountCoupons,
|
|
7443
|
+
couponDiscountTotal: couponDiscountTotal
|
|
7281
7444
|
})));
|
|
7282
7445
|
};
|
|
7283
7446
|
var checkMinMaxQty = function checkMinMaxQty(_ref2) {
|
|
@@ -7637,7 +7800,7 @@ var HomeBanner = function HomeBanner(_ref) {
|
|
|
7637
7800
|
};
|
|
7638
7801
|
setLoading(true);
|
|
7639
7802
|
var _temp = _catch(function () {
|
|
7640
|
-
return Promise.resolve(API
|
|
7803
|
+
return Promise.resolve(API({
|
|
7641
7804
|
apiEndPoint: apiEndPoint,
|
|
7642
7805
|
token: token,
|
|
7643
7806
|
url: "/home/sliderTypes"
|
|
@@ -7665,7 +7828,7 @@ var HomeBanner = function HomeBanner(_ref) {
|
|
|
7665
7828
|
return Promise.resolve(function () {
|
|
7666
7829
|
if (businessTypeId) {
|
|
7667
7830
|
return _catch(function () {
|
|
7668
|
-
return Promise.resolve(API
|
|
7831
|
+
return Promise.resolve(API({
|
|
7669
7832
|
apiEndPoint: apiEndPoint,
|
|
7670
7833
|
token: token,
|
|
7671
7834
|
url: "/home/sliderImages?sliderTypeId=" + sliderTypeId + "&businessTypeId=" + businessTypeId
|
|
@@ -7826,7 +7989,7 @@ var OutOfStock = function OutOfStock(_ref) {
|
|
|
7826
7989
|
}
|
|
7827
7990
|
var _temp = function () {
|
|
7828
7991
|
if (tag === 'variant') {
|
|
7829
|
-
return Promise.resolve(API
|
|
7992
|
+
return Promise.resolve(API({
|
|
7830
7993
|
apiEndPoint: apiEndPoint,
|
|
7831
7994
|
method: 'POST',
|
|
7832
7995
|
url: "/ecommerce/product/notifyWhenInStock",
|
|
@@ -7835,7 +7998,7 @@ var OutOfStock = function OutOfStock(_ref) {
|
|
|
7835
7998
|
successMessage: 'Created notification successfully.'
|
|
7836
7999
|
})).then(function () {});
|
|
7837
8000
|
} else {
|
|
7838
|
-
return Promise.resolve(API
|
|
8001
|
+
return Promise.resolve(API({
|
|
7839
8002
|
apiEndPoint: apiEndPoint,
|
|
7840
8003
|
method: 'POST',
|
|
7841
8004
|
url: "/ecommerce/product/notifyWhenInStock",
|
|
@@ -8208,7 +8371,7 @@ var AsyncSelectField = function AsyncSelectField(_ref) {
|
|
|
8208
8371
|
if (!(scanningRef !== null && scanningRef !== void 0 && scanningRef.current) && apiData && apiData.url) {
|
|
8209
8372
|
var defaultQueryParams = (apiData.getQueryParams ? apiData.getQueryParams() : apiData.queryParams) || {};
|
|
8210
8373
|
var defaultParam = !apiData.getQueryParams && {};
|
|
8211
|
-
return Promise.resolve(API
|
|
8374
|
+
return Promise.resolve(API(_extends({}, apiData, {
|
|
8212
8375
|
isCancelToken: false,
|
|
8213
8376
|
queryParams: _extends({
|
|
8214
8377
|
size: DEFAULT_SEARCH_RESULT_SIZE
|
|
@@ -8259,7 +8422,7 @@ var AsyncSelectField = function AsyncSelectField(_ref) {
|
|
|
8259
8422
|
var _ref2;
|
|
8260
8423
|
var defaultQueryParams = (apiData.getQueryParams ? apiData.getQueryParams(searchValue) : apiData.queryParams) || {};
|
|
8261
8424
|
var defaultParam = !apiData.getQueryParams && (_ref2 = {}, _ref2[queryParam] = searchValue, _ref2);
|
|
8262
|
-
return Promise.resolve(API
|
|
8425
|
+
return Promise.resolve(API(_extends({}, apiData, {
|
|
8263
8426
|
isCancelToken: true,
|
|
8264
8427
|
queryParams: _extends({
|
|
8265
8428
|
size: DEFAULT_SEARCH_RESULT_SIZE
|
|
@@ -8319,7 +8482,7 @@ var AsyncSelectField = function AsyncSelectField(_ref) {
|
|
|
8319
8482
|
var _temp9 = function () {
|
|
8320
8483
|
if (isSearchProduct && apiData && apiData.url && searchValue.length >= minSearchChar) {
|
|
8321
8484
|
var defaultQueryParams = (apiData.getScanQueryParams ? apiData.getScanQueryParams(searchValue) : apiData.queryParams) || {};
|
|
8322
|
-
return Promise.resolve(API
|
|
8485
|
+
return Promise.resolve(API(_extends({}, apiData, {
|
|
8323
8486
|
url: apiData.scanUrl,
|
|
8324
8487
|
queryParams: _extends({}, defaultQueryParams, {
|
|
8325
8488
|
size: DEFAULT_SEARCH_RESULT_SIZE
|
|
@@ -8632,7 +8795,7 @@ var CartPageSection$1 = styled__default.section(_templateObject$E || (_templateO
|
|
|
8632
8795
|
}, function (props) {
|
|
8633
8796
|
return props.bg || '#FAE8E5';
|
|
8634
8797
|
});
|
|
8635
|
-
var CartPageContainer$1 = styled__default.div(_templateObject2$s || (_templateObject2$s = _taggedTemplateLiteralLoose(["\n max-width: ", ";\n width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n border-radius: 28px 28px 28px 14px;\n padding: 2em 2.5em;\n padding-bottom: 3em;\n border-radius: 28px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n
|
|
8798
|
+
var CartPageContainer$1 = styled__default.div(_templateObject2$s || (_templateObject2$s = _taggedTemplateLiteralLoose(["\n max-width: ", ";\n width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n border-radius: 28px 28px 28px 14px;\n padding: 2em 2.5em;\n padding-bottom: 3em;\n border-radius: 28px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n max-height: 630px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n border: 2px solid;\n }\n /* box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05); */\n }\n table {\n border-collapse: separate;\n border-spacing: 0 4px;\n row-gap: 4px;\n }\n\n td {\n /* border: solid 1px #000; */\n border-style: none solid solid none;\n /* padding: 10px; */\n /* margin-bottom:5px; */\n }\n\n tr:first-child td:first-child {\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-top-right-radius: 10px;\n border-bottom-right-radius: 10px;\n }\n\n tr td:first-child {\n border-bottom-left-radius: 10px;\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-bottom-right-radius: 10px;\n }\n\n tr td {\n border-top-style: solid;\n }\n tr td:first-child {\n border-left-style: solid;\n }\n\n @media only screen and (max-width: 1200px) {\n flex-direction: column;\n align-items: center;\n padding: 0.5em;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n padding: 0 0.4em;\n }\n }\n"])), function (props) {
|
|
8636
8799
|
return props.maxWidth || '1600px';
|
|
8637
8800
|
}, function (props) {
|
|
8638
8801
|
return "min(" + (props.maxWidth || '1600px') + ",100%)";
|
|
@@ -8931,7 +9094,7 @@ var QuickOrder = function QuickOrder(_ref) {
|
|
|
8931
9094
|
(function () {
|
|
8932
9095
|
try {
|
|
8933
9096
|
var _temp = _catch(function () {
|
|
8934
|
-
return Promise.resolve(API
|
|
9097
|
+
return Promise.resolve(API({
|
|
8935
9098
|
apiEndPoint: apiEndPoint,
|
|
8936
9099
|
token: token,
|
|
8937
9100
|
url: "/store"
|
|
@@ -9174,7 +9337,7 @@ var StaticPageList = function StaticPageList(_ref) {
|
|
|
9174
9337
|
};
|
|
9175
9338
|
setLoading(true);
|
|
9176
9339
|
var _temp = _catch(function () {
|
|
9177
|
-
return Promise.resolve(API
|
|
9340
|
+
return Promise.resolve(API({
|
|
9178
9341
|
apiEndPoint: apiEndPoint,
|
|
9179
9342
|
url: "/ecommerce/staticPage/list?page=0&size=9999",
|
|
9180
9343
|
queryParams: queryParams
|
|
@@ -9302,12 +9465,12 @@ var SwitchUser = function SwitchUser(_ref) {
|
|
|
9302
9465
|
try {
|
|
9303
9466
|
if (token && apiEndPoint) {
|
|
9304
9467
|
try {
|
|
9305
|
-
var getCustomer = API
|
|
9468
|
+
var getCustomer = API({
|
|
9306
9469
|
apiEndPoint: apiEndPoint,
|
|
9307
9470
|
token: token,
|
|
9308
9471
|
url: "/ecommerce/customer"
|
|
9309
9472
|
});
|
|
9310
|
-
var getChildCustomer = API
|
|
9473
|
+
var getChildCustomer = API({
|
|
9311
9474
|
apiEndPoint: apiEndPoint,
|
|
9312
9475
|
token: token,
|
|
9313
9476
|
url: "/ecommerce/customer/child"
|
|
@@ -9487,12 +9650,7 @@ var CheckoutSummary = function CheckoutSummary(_ref) {
|
|
|
9487
9650
|
shippingMethod = _ref.shippingMethod,
|
|
9488
9651
|
bg = _ref.bg,
|
|
9489
9652
|
color = _ref.color,
|
|
9490
|
-
discountCoupons = _ref.discountCoupons,
|
|
9491
9653
|
orderTotal = _ref.orderTotal;
|
|
9492
|
-
var discountTotal = 0;
|
|
9493
|
-
discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.forEach(function (element) {
|
|
9494
|
-
discountTotal = discountTotal + element.amount;
|
|
9495
|
-
});
|
|
9496
9654
|
return /*#__PURE__*/React__default.createElement(CheckoutSummaryContainer, {
|
|
9497
9655
|
bg: bg,
|
|
9498
9656
|
color: color
|
|
@@ -9507,14 +9665,21 @@ var CheckoutSummary = function CheckoutSummary(_ref) {
|
|
|
9507
9665
|
style: {
|
|
9508
9666
|
fontSize: '1rem'
|
|
9509
9667
|
}
|
|
9510
|
-
}, renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.taxAmount) || 0))) : null,
|
|
9668
|
+
}, renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.taxAmount) || 0))) : null, (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.cartDiscount) > 0 ? /*#__PURE__*/React__default.createElement(TextRow, null, /*#__PURE__*/React__default.createElement("p", {
|
|
9669
|
+
className: "text"
|
|
9670
|
+
}, "Order Discount:"), /*#__PURE__*/React__default.createElement("h6", {
|
|
9671
|
+
className: "total",
|
|
9672
|
+
style: {
|
|
9673
|
+
fontSize: '1rem'
|
|
9674
|
+
}
|
|
9675
|
+
}, renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.cartDiscount) || 0))) : null, (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.couponDiscountTotal) > 0 ? /*#__PURE__*/React__default.createElement(TextRow, null, /*#__PURE__*/React__default.createElement("p", {
|
|
9511
9676
|
className: "text"
|
|
9512
|
-
}, "Discount
|
|
9677
|
+
}, "Coupon Discount:"), /*#__PURE__*/React__default.createElement("h6", {
|
|
9513
9678
|
className: "total",
|
|
9514
9679
|
style: {
|
|
9515
9680
|
fontSize: '1rem'
|
|
9516
9681
|
}
|
|
9517
|
-
}, renderMoney(
|
|
9682
|
+
}, renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.couponDiscountTotal) || 0))) : null, /*#__PURE__*/React__default.createElement(FilledInfo, null, /*#__PURE__*/React__default.createElement("h6", {
|
|
9518
9683
|
className: "heading"
|
|
9519
9684
|
}, "Billing Information"), billingInformation ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
|
|
9520
9685
|
className: "bold"
|
|
@@ -10149,14 +10314,9 @@ var Step2 = function Step2(_ref) {
|
|
|
10149
10314
|
showShipping = _ref.showShipping,
|
|
10150
10315
|
styles = _ref.styles,
|
|
10151
10316
|
shippingAddressId = _ref.shippingAddressId,
|
|
10152
|
-
discountCoupons = _ref.discountCoupons,
|
|
10153
10317
|
showShippingPriceRangeLimit = _ref.showShippingPriceRangeLimit,
|
|
10154
10318
|
customer = _ref.customer;
|
|
10155
|
-
var
|
|
10156
|
-
discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.forEach(function (element) {
|
|
10157
|
-
discountTotal = discountTotal + element.amount;
|
|
10158
|
-
});
|
|
10159
|
-
var totalCartPrice = ((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) || 0) - discountTotal;
|
|
10319
|
+
var totalCartPrice = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) || 0;
|
|
10160
10320
|
var modifyOptions = (_filter = lodash.filter(options, {
|
|
10161
10321
|
ecommerce: true
|
|
10162
10322
|
})) === null || _filter === void 0 ? void 0 : _filter.map(function (item) {
|
|
@@ -10283,7 +10443,7 @@ var Step2 = function Step2(_ref) {
|
|
|
10283
10443
|
return Promise.resolve(function () {
|
|
10284
10444
|
if (shipStore || shipStore !== null && shipStore !== void 0 && shipStore.showSkuOnSalePage) {
|
|
10285
10445
|
return _catch(function () {
|
|
10286
|
-
return Promise.resolve(API
|
|
10446
|
+
return Promise.resolve(API({
|
|
10287
10447
|
apiEndPoint: apiEndPoint,
|
|
10288
10448
|
token: token,
|
|
10289
10449
|
url: "/shipstation/getShippingRates",
|
|
@@ -10297,7 +10457,7 @@ var Step2 = function Step2(_ref) {
|
|
|
10297
10457
|
return function () {
|
|
10298
10458
|
if (carrier !== null && carrier !== void 0 && carrier.id) {
|
|
10299
10459
|
return _catch(function () {
|
|
10300
|
-
return Promise.resolve(API
|
|
10460
|
+
return Promise.resolve(API({
|
|
10301
10461
|
apiEndPoint: apiEndPoint,
|
|
10302
10462
|
token: token,
|
|
10303
10463
|
url: "/shipping/options/v1?parentShippingId=" + (carrier === null || carrier === void 0 ? void 0 : carrier.id)
|
|
@@ -11027,7 +11187,7 @@ var ConsentForm = function ConsentForm(_ref) {
|
|
|
11027
11187
|
};
|
|
11028
11188
|
setLoadingData(true);
|
|
11029
11189
|
var _temp = _catch(function () {
|
|
11030
|
-
return Promise.resolve(API
|
|
11190
|
+
return Promise.resolve(API({
|
|
11031
11191
|
apiEndPoint: apiEndPoint,
|
|
11032
11192
|
url: "/ecommerce/staticPage/list",
|
|
11033
11193
|
queryParams: {
|
|
@@ -11038,7 +11198,7 @@ var ConsentForm = function ConsentForm(_ref) {
|
|
|
11038
11198
|
})).then(function (staticPageDataResponse) {
|
|
11039
11199
|
var _staticPageDataRespon;
|
|
11040
11200
|
setStaticPageData(staticPageDataResponse === null || staticPageDataResponse === void 0 ? void 0 : (_staticPageDataRespon = staticPageDataResponse.content) === null || _staticPageDataRespon === void 0 ? void 0 : _staticPageDataRespon[0]);
|
|
11041
|
-
return Promise.resolve(API
|
|
11201
|
+
return Promise.resolve(API({
|
|
11042
11202
|
apiEndPoint: apiEndPoint,
|
|
11043
11203
|
token: token,
|
|
11044
11204
|
url: "/cartLineItem/totalTax",
|
|
@@ -11048,7 +11208,7 @@ var ConsentForm = function ConsentForm(_ref) {
|
|
|
11048
11208
|
}
|
|
11049
11209
|
})).then(function (taxDataResponse) {
|
|
11050
11210
|
setTaxData(taxDataResponse);
|
|
11051
|
-
return Promise.resolve(API
|
|
11211
|
+
return Promise.resolve(API({
|
|
11052
11212
|
apiEndPoint: apiEndPoint,
|
|
11053
11213
|
token: token,
|
|
11054
11214
|
url: "/store"
|
|
@@ -11228,7 +11388,7 @@ var PaypalComponent = function PaypalComponent(_ref) {
|
|
|
11228
11388
|
try {
|
|
11229
11389
|
var _temp2 = function () {
|
|
11230
11390
|
if (paymentWithPaypal) {
|
|
11231
|
-
return Promise.resolve(API
|
|
11391
|
+
return Promise.resolve(API({
|
|
11232
11392
|
apiEndPoint: apiEndPoint,
|
|
11233
11393
|
token: token,
|
|
11234
11394
|
url: "/payment/paypal/config"
|
|
@@ -11325,10 +11485,6 @@ var Step4 = function Step4(_ref) {
|
|
|
11325
11485
|
var _React$useState3 = React__default.useState(''),
|
|
11326
11486
|
comments = _React$useState3[0],
|
|
11327
11487
|
setComments = _React$useState3[1];
|
|
11328
|
-
var discountTotal = 0;
|
|
11329
|
-
discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.forEach(function (element) {
|
|
11330
|
-
discountTotal = discountTotal + element.amount;
|
|
11331
|
-
});
|
|
11332
11488
|
var storeCr = storeCredits > (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) ? orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount : storeCredits;
|
|
11333
11489
|
var onSubmitPaypal = function onSubmitPaypal(transactionId) {
|
|
11334
11490
|
try {
|
|
@@ -11442,7 +11598,20 @@ var Step4 = function Step4(_ref) {
|
|
|
11442
11598
|
align: "right"
|
|
11443
11599
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
11444
11600
|
className: "max sm primaryColor"
|
|
11445
|
-
}, renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.taxAmount) || 0)))),
|
|
11601
|
+
}, renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.taxAmount) || 0)))), (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.cartDiscount) > 0 ? /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11602
|
+
colSpan: 1,
|
|
11603
|
+
noSmall: true
|
|
11604
|
+
}), /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11605
|
+
colSpan: 1
|
|
11606
|
+
}), /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11607
|
+
colSpan: 1
|
|
11608
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
11609
|
+
className: "max sm"
|
|
11610
|
+
}, "Order Discount")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11611
|
+
align: "right"
|
|
11612
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
11613
|
+
className: "max sm primaryColor"
|
|
11614
|
+
}, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.cartDiscount)))) : null, discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.map(function (coupon) {
|
|
11446
11615
|
return /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11447
11616
|
colSpan: 1,
|
|
11448
11617
|
noSmall: true
|
|
@@ -11455,7 +11624,7 @@ var Step4 = function Step4(_ref) {
|
|
|
11455
11624
|
style: {
|
|
11456
11625
|
fontSize: '0.8rem'
|
|
11457
11626
|
}
|
|
11458
|
-
}, coupon === null || coupon === void 0 ? void 0 : coupon.
|
|
11627
|
+
}, coupon === null || coupon === void 0 ? void 0 : coupon.name)), /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11459
11628
|
align: "right"
|
|
11460
11629
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
11461
11630
|
className: "max sm primaryColor",
|
|
@@ -11463,7 +11632,7 @@ var Step4 = function Step4(_ref) {
|
|
|
11463
11632
|
fontSize: '0.8rem'
|
|
11464
11633
|
}
|
|
11465
11634
|
}, renderMoney(coupon === null || coupon === void 0 ? void 0 : coupon.amount))));
|
|
11466
|
-
}),
|
|
11635
|
+
}), (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.couponDiscountTotal) > 0 ? /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11467
11636
|
colSpan: 1,
|
|
11468
11637
|
noSmall: true
|
|
11469
11638
|
}), /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
@@ -11472,11 +11641,11 @@ var Step4 = function Step4(_ref) {
|
|
|
11472
11641
|
colSpan: 1
|
|
11473
11642
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
11474
11643
|
className: "max sm"
|
|
11475
|
-
}, "Discount
|
|
11644
|
+
}, "Total Coupon Discount")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11476
11645
|
align: "right"
|
|
11477
11646
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
11478
11647
|
className: "max sm primaryColor"
|
|
11479
|
-
}, renderMoney(
|
|
11648
|
+
}, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.couponDiscountTotal)))) : null, storeCredits && storeCredits > 0 ? /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
11480
11649
|
colSpan: 1,
|
|
11481
11650
|
noSmall: true
|
|
11482
11651
|
}), /*#__PURE__*/React__default.createElement(StyledTableCell, {
|
|
@@ -11673,8 +11842,6 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11673
11842
|
cartData = _ref.cartData,
|
|
11674
11843
|
handleLogin = _ref.handleLogin,
|
|
11675
11844
|
placeOrder = _ref.placeOrder,
|
|
11676
|
-
_ref$discountCoupons = _ref.discountCoupons,
|
|
11677
|
-
discountCoupons = _ref$discountCoupons === void 0 ? [] : _ref$discountCoupons,
|
|
11678
11845
|
clickRedirect = _ref.clickRedirect,
|
|
11679
11846
|
shippingText = _ref.shippingText,
|
|
11680
11847
|
showShippingPriceRangeLimit = _ref.showShippingPriceRangeLimit,
|
|
@@ -11732,10 +11899,9 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11732
11899
|
var _useState17 = React.useState({}),
|
|
11733
11900
|
orderTotal = _useState17[0],
|
|
11734
11901
|
setOrderTotal = _useState17[1];
|
|
11735
|
-
var
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
});
|
|
11902
|
+
var _useState18 = React.useState([]),
|
|
11903
|
+
discountCoupons = _useState18[0],
|
|
11904
|
+
setDiscountCoupons = _useState18[1];
|
|
11739
11905
|
React.useEffect(function () {
|
|
11740
11906
|
if (apiEndPoint && token) {
|
|
11741
11907
|
(function () {
|
|
@@ -11791,7 +11957,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11791
11957
|
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
11792
11958
|
}
|
|
11793
11959
|
var _temp3 = _catch(function () {
|
|
11794
|
-
return Promise.resolve(API
|
|
11960
|
+
return Promise.resolve(API({
|
|
11795
11961
|
apiEndPoint: apiEndPoint,
|
|
11796
11962
|
token: token,
|
|
11797
11963
|
url: "/shipping/options"
|
|
@@ -11802,7 +11968,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11802
11968
|
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
|
11803
11969
|
};
|
|
11804
11970
|
var _temp5 = _catch(function () {
|
|
11805
|
-
return Promise.resolve(API
|
|
11971
|
+
return Promise.resolve(API({
|
|
11806
11972
|
apiEndPoint: apiEndPoint,
|
|
11807
11973
|
token: token,
|
|
11808
11974
|
url: "/ecommerce/customer",
|
|
@@ -11827,63 +11993,96 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11827
11993
|
setCurrStep(0);
|
|
11828
11994
|
}
|
|
11829
11995
|
}, [customer, currStep]);
|
|
11996
|
+
var inDebounce;
|
|
11830
11997
|
React.useEffect(function () {
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11998
|
+
if (customer) {
|
|
11999
|
+
cartTotalOnChangeData();
|
|
12000
|
+
}
|
|
12001
|
+
}, [customer, cartData, shippingMethod, ccProcessingFees, shippingAddressId]);
|
|
12002
|
+
var cartTotalOnChangeData = function cartTotalOnChangeData() {
|
|
12003
|
+
clearTimeout(inDebounce);
|
|
12004
|
+
inDebounce = setTimeout(function () {
|
|
12005
|
+
(function () {
|
|
12006
|
+
try {
|
|
12007
|
+
var _temp13 = function () {
|
|
12008
|
+
if (apiEndPoint && token) {
|
|
12009
|
+
var _temp12 = function _temp12() {
|
|
12010
|
+
function _temp10() {
|
|
12011
|
+
var _taxAmount, _ref2, _ref3, _cartData$cartDiscoun, _cartData$cartSubTota, _ref4;
|
|
12012
|
+
var totalData = {
|
|
12013
|
+
taxAmount: parseFloat((_taxAmount = _taxAmount2) === null || _taxAmount === void 0 ? void 0 : _taxAmount.toFixed(2)),
|
|
12014
|
+
shippingAmount: parseFloat((_ref2 = (shippingMethod === null || shippingMethod === void 0 ? void 0 : shippingMethod.amount) || 0) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2)),
|
|
12015
|
+
couponDiscountTotal: _couponDiscountTotal,
|
|
12016
|
+
adjustmentValue: parseFloat((_ref3 = ccProcessingFees ? (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) * (ccProcessingFees / 100) : 0) === null || _ref3 === void 0 ? void 0 : _ref3.toFixed(2)),
|
|
12017
|
+
cartDiscount: parseFloat(cartData === null || cartData === void 0 ? void 0 : (_cartData$cartDiscoun = cartData.cartDiscount) === null || _cartData$cartDiscoun === void 0 ? void 0 : _cartData$cartDiscoun.toFixed(2)),
|
|
12018
|
+
subTotal: parseFloat(cartData === null || cartData === void 0 ? void 0 : (_cartData$cartSubTota = cartData.cartSubTotal) === null || _cartData$cartSubTota === void 0 ? void 0 : _cartData$cartSubTota.toFixed(2)),
|
|
12019
|
+
totalAmount: parseFloat((_ref4 = (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) + _taxAmount2 + ((shippingMethod === null || shippingMethod === void 0 ? void 0 : shippingMethod.amount) || 0) - _couponDiscountTotal + (ccProcessingFees ? (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) * (ccProcessingFees / 100) : 0)) === null || _ref4 === void 0 ? void 0 : _ref4.toFixed(2)),
|
|
12020
|
+
totalQuantity: cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity
|
|
12021
|
+
};
|
|
12022
|
+
setOrderTotal(totalData);
|
|
12023
|
+
}
|
|
12024
|
+
var _temp9 = _catch(function () {
|
|
12025
|
+
return Promise.resolve(getCartDiscountList({
|
|
12026
|
+
apiEndPoint: apiEndPoint,
|
|
12027
|
+
token: token
|
|
12028
|
+
})).then(function (discountCouponsData) {
|
|
12029
|
+
var _ref5;
|
|
12030
|
+
_couponDiscountTotal = parseFloat((_ref5 = lodash.sumBy(discountCouponsData, 'amount') || 0) === null || _ref5 === void 0 ? void 0 : _ref5.toFixed(2));
|
|
12031
|
+
setDiscountCoupons(discountCouponsData);
|
|
12032
|
+
});
|
|
12033
|
+
}, function () {});
|
|
12034
|
+
return _temp9 && _temp9.then ? _temp9.then(_temp10) : _temp10(_temp9);
|
|
12035
|
+
};
|
|
12036
|
+
var _taxAmount2 = 0;
|
|
12037
|
+
var _couponDiscountTotal = 0;
|
|
12038
|
+
var _temp11 = function (_cartData$cartLineIte) {
|
|
12039
|
+
if (taxExempt && shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.length) > 0) {
|
|
12040
|
+
var _temp8 = _catch(function () {
|
|
12041
|
+
return Promise.resolve(API({
|
|
12042
|
+
apiEndPoint: apiEndPoint,
|
|
12043
|
+
token: token,
|
|
12044
|
+
url: "/cartLineItem/totalTax",
|
|
12045
|
+
queryParams: {
|
|
12046
|
+
storeId: 2,
|
|
12047
|
+
customerShippingAddressId: shippingAddressId
|
|
12048
|
+
}
|
|
12049
|
+
})).then(function (taxData) {
|
|
12050
|
+
var _customer$customerDto;
|
|
12051
|
+
_taxAmount2 = !(customer !== null && customer !== void 0 && (_customer$customerDto = customer.customerDto) !== null && _customer$customerDto !== void 0 && _customer$customerDto.taxable) ? 0 : lodash.sumBy(taxData, 'taxAmount') || 0;
|
|
12052
|
+
});
|
|
12053
|
+
}, function () {});
|
|
12054
|
+
if (_temp8 && _temp8.then) return _temp8.then(function () {});
|
|
12055
|
+
}
|
|
12056
|
+
}();
|
|
12057
|
+
return _temp11 && _temp11.then ? _temp11.then(_temp12) : _temp12(_temp11);
|
|
12058
|
+
}
|
|
12059
|
+
}();
|
|
12060
|
+
return _temp13 && _temp13.then ? _temp13.then(function () {}) : void 0;
|
|
12061
|
+
} catch (e) {
|
|
12062
|
+
Promise.reject(e);
|
|
12063
|
+
}
|
|
12064
|
+
})();
|
|
12065
|
+
}, 500);
|
|
12066
|
+
};
|
|
11868
12067
|
var onLoginCustomer = function onLoginCustomer(data) {
|
|
11869
12068
|
try {
|
|
11870
|
-
var
|
|
12069
|
+
var _temp15 = function _temp15() {
|
|
11871
12070
|
setLoginLoading(false);
|
|
11872
12071
|
};
|
|
11873
12072
|
setLoginLoading(true);
|
|
11874
|
-
var
|
|
12073
|
+
var _temp14 = _catch(function () {
|
|
11875
12074
|
return Promise.resolve(handleLogin(data)).then(function () {});
|
|
11876
12075
|
}, function () {});
|
|
11877
|
-
return Promise.resolve(
|
|
12076
|
+
return Promise.resolve(_temp14 && _temp14.then ? _temp14.then(_temp15) : _temp15(_temp14));
|
|
11878
12077
|
} catch (e) {
|
|
11879
12078
|
return Promise.reject(e);
|
|
11880
12079
|
}
|
|
11881
12080
|
};
|
|
11882
12081
|
var addStoreAddress = function addStoreAddress(data) {
|
|
11883
12082
|
try {
|
|
11884
|
-
var
|
|
12083
|
+
var _temp17 = _catch(function () {
|
|
11885
12084
|
var _customer$customerDto2, _customer$customerDto3;
|
|
11886
|
-
return Promise.resolve(API
|
|
12085
|
+
return Promise.resolve(API({
|
|
11887
12086
|
apiEndPoint: apiEndPoint,
|
|
11888
12087
|
token: token,
|
|
11889
12088
|
method: 'POST',
|
|
@@ -11894,9 +12093,9 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11894
12093
|
successMessage: 'Address added successfully.',
|
|
11895
12094
|
errorMessage: 'Error in added the address.'
|
|
11896
12095
|
})).then(function (result) {
|
|
11897
|
-
var
|
|
12096
|
+
var _temp16 = function () {
|
|
11898
12097
|
if (result) {
|
|
11899
|
-
return Promise.resolve(API
|
|
12098
|
+
return Promise.resolve(API({
|
|
11900
12099
|
apiEndPoint: apiEndPoint,
|
|
11901
12100
|
token: token,
|
|
11902
12101
|
url: "/ecommerce/customer"
|
|
@@ -11905,10 +12104,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11905
12104
|
});
|
|
11906
12105
|
}
|
|
11907
12106
|
}();
|
|
11908
|
-
if (
|
|
12107
|
+
if (_temp16 && _temp16.then) return _temp16.then(function () {});
|
|
11909
12108
|
});
|
|
11910
12109
|
}, function () {});
|
|
11911
|
-
return Promise.resolve(
|
|
12110
|
+
return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
|
|
11912
12111
|
} catch (e) {
|
|
11913
12112
|
return Promise.reject(e);
|
|
11914
12113
|
}
|
|
@@ -11952,11 +12151,11 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11952
12151
|
};
|
|
11953
12152
|
var onPlaceOrder = function onPlaceOrder(note, transactionId) {
|
|
11954
12153
|
try {
|
|
11955
|
-
var
|
|
12154
|
+
var _temp19 = function _temp19() {
|
|
11956
12155
|
setOrdering(false);
|
|
11957
12156
|
};
|
|
11958
12157
|
setOrdering(true);
|
|
11959
|
-
var
|
|
12158
|
+
var _temp18 = _catch(function () {
|
|
11960
12159
|
var authorizeCustomerCardData = {
|
|
11961
12160
|
authorizeDotNetCustomerProfileId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.authorizeDotNetCustomerProfileId,
|
|
11962
12161
|
authorizeDotNetCustomerPaymentProfileId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.authorizeDotNetCustomerPaymentProfileId
|
|
@@ -12013,12 +12212,12 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
12013
12212
|
paymentModeId: selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.id
|
|
12014
12213
|
}];
|
|
12015
12214
|
} else if (selectedStoreCredits && (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount) < (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount)) {
|
|
12016
|
-
var _selectedStoreCredits,
|
|
12215
|
+
var _selectedStoreCredits, _ref6;
|
|
12017
12216
|
orderPaymentList = [{
|
|
12018
12217
|
amount: parseFloat(selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : (_selectedStoreCredits = selectedStoreCredits.amount) === null || _selectedStoreCredits === void 0 ? void 0 : _selectedStoreCredits.toFixed(2)),
|
|
12019
12218
|
paymentModeId: selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.id
|
|
12020
12219
|
}, _extends({
|
|
12021
|
-
amount: parseFloat((
|
|
12220
|
+
amount: parseFloat((_ref6 = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount)) === null || _ref6 === void 0 ? void 0 : _ref6.toFixed(2)),
|
|
12022
12221
|
paymentModeId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.id
|
|
12023
12222
|
}, authorizeCustomerCardData)];
|
|
12024
12223
|
} else {
|
|
@@ -12041,7 +12240,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
12041
12240
|
}
|
|
12042
12241
|
return Promise.resolve(placeOrder(body)).then(function () {});
|
|
12043
12242
|
}, function () {});
|
|
12044
|
-
return Promise.resolve(
|
|
12243
|
+
return Promise.resolve(_temp18 && _temp18.then ? _temp18.then(_temp19) : _temp19(_temp18));
|
|
12045
12244
|
} catch (e) {
|
|
12046
12245
|
return Promise.reject(e);
|
|
12047
12246
|
}
|