@salesgenterp/ui-components 0.4.450 → 0.4.452

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 CHANGED
@@ -1001,25 +1001,50 @@ var getCartDiscountList = function getCartDiscountList(_ref6) {
1001
1001
  var apiEndPoint = _ref6.apiEndPoint,
1002
1002
  token = _ref6.token;
1003
1003
  try {
1004
+ var getStoreIdsData = localStorage.getItem('storeIds');
1005
+ var storeId = (getStoreIdsData === null || getStoreIdsData === void 0 ? void 0 : getStoreIdsData.storeId) || 2;
1004
1006
  return Promise.resolve(API({
1005
1007
  apiEndPoint: apiEndPoint,
1006
1008
  token: token,
1007
- url: "/cartDiscount?storeId=2",
1009
+ url: "/cartDiscount?storeId=" + storeId,
1008
1010
  hideErrorMessage: true
1009
1011
  }));
1010
1012
  } catch (e) {
1011
1013
  return Promise.reject(e);
1012
1014
  }
1013
1015
  };
1014
- var addCartDiscount = function addCartDiscount(_ref8) {
1015
- var apiEndPoint = _ref8.apiEndPoint,
1016
- token = _ref8.token,
1017
- body = _ref8.body;
1016
+ var autoApplyCoupon = function autoApplyCoupon(_ref7) {
1017
+ var apiEndPoint = _ref7.apiEndPoint,
1018
+ token = _ref7.token,
1019
+ subTotal = _ref7.subTotal;
1018
1020
  try {
1021
+ var getStoreIdsData = localStorage.getItem('storeIds');
1022
+ var storeId = (getStoreIdsData === null || getStoreIdsData === void 0 ? void 0 : getStoreIdsData.storeId) || 2;
1019
1023
  return Promise.resolve(API({
1020
1024
  apiEndPoint: apiEndPoint,
1021
1025
  token: token,
1022
- url: "/cartDiscount?storeId=2",
1026
+ url: "/cartDiscount/autoApply",
1027
+ method: 'put',
1028
+ queryParams: {
1029
+ cartTotal: subTotal,
1030
+ storeId: storeId
1031
+ }
1032
+ }));
1033
+ } catch (e) {
1034
+ return Promise.reject(e);
1035
+ }
1036
+ };
1037
+ var addCartDiscount = function addCartDiscount(_ref9) {
1038
+ var apiEndPoint = _ref9.apiEndPoint,
1039
+ token = _ref9.token,
1040
+ body = _ref9.body;
1041
+ try {
1042
+ var getStoreIdsData = localStorage.getItem('storeIds');
1043
+ var storeId = (getStoreIdsData === null || getStoreIdsData === void 0 ? void 0 : getStoreIdsData.storeId) || 2;
1044
+ return Promise.resolve(API({
1045
+ apiEndPoint: apiEndPoint,
1046
+ token: token,
1047
+ url: "/cartDiscount?storeId=" + storeId,
1023
1048
  method: 'post',
1024
1049
  body: body,
1025
1050
  successMessage: 'Discount added successfully.',
@@ -1029,15 +1054,17 @@ var addCartDiscount = function addCartDiscount(_ref8) {
1029
1054
  return Promise.reject(e);
1030
1055
  }
1031
1056
  };
1032
- var deleteCartDiscount = function deleteCartDiscount(_ref9) {
1033
- var apiEndPoint = _ref9.apiEndPoint,
1034
- token = _ref9.token,
1035
- discountId = _ref9.discountId;
1057
+ var deleteCartDiscount = function deleteCartDiscount(_ref10) {
1058
+ var apiEndPoint = _ref10.apiEndPoint,
1059
+ token = _ref10.token,
1060
+ discountId = _ref10.discountId;
1036
1061
  try {
1062
+ var getStoreIdsData = localStorage.getItem('storeIds');
1063
+ var storeId = (getStoreIdsData === null || getStoreIdsData === void 0 ? void 0 : getStoreIdsData.storeId) || 2;
1037
1064
  return Promise.resolve(API({
1038
1065
  apiEndPoint: apiEndPoint,
1039
1066
  token: token,
1040
- url: "/cartDiscount?cartDiscountMapId=" + discountId + "&storeId=2",
1067
+ url: "/cartDiscount?cartDiscountMapId=" + discountId + "&storeId=" + storeId,
1041
1068
  method: 'delete',
1042
1069
  successMessage: 'Discount removed successfully.',
1043
1070
  errorMessage: 'Error in removing discount.'
@@ -1046,6 +1073,93 @@ var deleteCartDiscount = function deleteCartDiscount(_ref9) {
1046
1073
  return Promise.reject(e);
1047
1074
  }
1048
1075
  };
1076
+ var addSalesOrder = function addSalesOrder(_ref12) {
1077
+ var apiEndPoint = _ref12.apiEndPoint,
1078
+ token = _ref12.token,
1079
+ orderDetails = _ref12.orderDetails;
1080
+ try {
1081
+ var getStoreIdsData = localStorage.getItem('storeIds');
1082
+ var storeId = (getStoreIdsData === null || getStoreIdsData === void 0 ? void 0 : getStoreIdsData.storeId) || 2;
1083
+ return Promise.resolve(API({
1084
+ apiEndPoint: apiEndPoint,
1085
+ token: token,
1086
+ body: orderDetails,
1087
+ url: "/ecommerce/salesOrder?storeId=" + storeId,
1088
+ method: 'post',
1089
+ errorMessage: 'unable to complete the order'
1090
+ }));
1091
+ } catch (e) {
1092
+ return Promise.reject(e);
1093
+ }
1094
+ };
1095
+ var getCustomer = function getCustomer(_ref13) {
1096
+ var apiEndPoint = _ref13.apiEndPoint,
1097
+ token = _ref13.token;
1098
+ try {
1099
+ return Promise.resolve(API({
1100
+ apiEndPoint: apiEndPoint,
1101
+ token: token,
1102
+ url: "/ecommerce/customer",
1103
+ hideErrorMessage: true
1104
+ }));
1105
+ } catch (e) {
1106
+ return Promise.reject(e);
1107
+ }
1108
+ };
1109
+ var getDeliveryOption = function getDeliveryOption(_ref14) {
1110
+ var apiEndPoint = _ref14.apiEndPoint,
1111
+ token = _ref14.token;
1112
+ try {
1113
+ return Promise.resolve(API({
1114
+ apiEndPoint: apiEndPoint,
1115
+ token: token,
1116
+ url: "/shipping/options"
1117
+ }));
1118
+ } catch (e) {
1119
+ return Promise.reject(e);
1120
+ }
1121
+ };
1122
+ var getTaxData = function getTaxData(_ref15) {
1123
+ var apiEndPoint = _ref15.apiEndPoint,
1124
+ token = _ref15.token,
1125
+ shippingAddressId = _ref15.shippingAddressId;
1126
+ try {
1127
+ var getStoreIdsData = localStorage.getItem('storeIds');
1128
+ var storeId = (getStoreIdsData === null || getStoreIdsData === void 0 ? void 0 : getStoreIdsData.storeId) || 2;
1129
+ return Promise.resolve(API({
1130
+ apiEndPoint: apiEndPoint,
1131
+ token: token,
1132
+ url: "/cartLineItem/totalTax",
1133
+ queryParams: {
1134
+ storeId: storeId,
1135
+ customerShippingAddressId: shippingAddressId
1136
+ }
1137
+ }));
1138
+ } catch (e) {
1139
+ return Promise.reject(e);
1140
+ }
1141
+ };
1142
+ var createStoreAddress = function createStoreAddress(_ref16) {
1143
+ var apiEndPoint = _ref16.apiEndPoint,
1144
+ token = _ref16.token,
1145
+ data = _ref16.data,
1146
+ customerId = _ref16.customerId;
1147
+ try {
1148
+ return Promise.resolve(API({
1149
+ apiEndPoint: apiEndPoint,
1150
+ token: token,
1151
+ method: 'POST',
1152
+ url: "/ecommerce/customer/" + customerId + "/address",
1153
+ body: _extends({}, data, {
1154
+ customerId: customerId
1155
+ }),
1156
+ successMessage: 'Address added successfully.',
1157
+ errorMessage: 'Error in added the address.'
1158
+ }));
1159
+ } catch (e) {
1160
+ return Promise.reject(e);
1161
+ }
1162
+ };
1049
1163
 
1050
1164
  var Skeleton = function Skeleton(_ref) {
1051
1165
  var _ref$height = _ref.height,
@@ -5085,7 +5199,11 @@ var _templateObject$l, _templateObject2$d, _templateObject3$9;
5085
5199
  var BannerImages = function BannerImages(_ref) {
5086
5200
  var config = _ref.config,
5087
5201
  sliderImages = _ref.sliderImages,
5088
- itemStyle = _ref.itemStyle;
5202
+ itemStyle = _ref.itemStyle,
5203
+ _ref$sliderTypeName = _ref.sliderTypeName,
5204
+ sliderTypeName = _ref$sliderTypeName === void 0 ? '' : _ref$sliderTypeName,
5205
+ _ref$handleBannerClic = _ref.handleBannerClick,
5206
+ handleBannerClick = _ref$handleBannerClic === void 0 ? function () {} : _ref$handleBannerClic;
5089
5207
  var sliderImageList = sliderImages === null || sliderImages === void 0 ? void 0 : sliderImages.sliderImageList;
5090
5208
  var isTablet = material.useMediaQuery('(max-width:768px)');
5091
5209
  var isMobile = material.useMediaQuery('(max-width:480px)');
@@ -5120,6 +5238,12 @@ var BannerImages = function BannerImages(_ref) {
5120
5238
  style: {
5121
5239
  overflow: 'hidden',
5122
5240
  height: '100%'
5241
+ },
5242
+ onClick: function onClick(e) {
5243
+ if ((v === null || v === void 0 ? void 0 : v.sliderType) === sliderTypeName) {
5244
+ e.preventDefault();
5245
+ handleBannerClick(v);
5246
+ }
5123
5247
  }
5124
5248
  }, /*#__PURE__*/React__default.createElement("a", {
5125
5249
  href: (v === null || v === void 0 ? void 0 : v.redirectPath) || ''
@@ -5255,7 +5379,11 @@ var HomeBanner = function HomeBanner(_ref) {
5255
5379
  businessTypeId = _ref$businessTypeId === void 0 ? 1 : _ref$businessTypeId,
5256
5380
  categoryId = _ref.categoryId,
5257
5381
  brandId = _ref.brandId,
5258
- extra = _ref.extra;
5382
+ extra = _ref.extra,
5383
+ _ref$sliderTypeName = _ref.sliderTypeName,
5384
+ sliderTypeName = _ref$sliderTypeName === void 0 ? '' : _ref$sliderTypeName,
5385
+ _ref$handleBannerClic = _ref.handleBannerClick,
5386
+ handleBannerClick = _ref$handleBannerClic === void 0 ? function () {} : _ref$handleBannerClic;
5259
5387
  var _useState = React.useState([]),
5260
5388
  sliderTypes = _useState[0],
5261
5389
  setSliderTypes = _useState[1];
@@ -5409,7 +5537,9 @@ var HomeBanner = function HomeBanner(_ref) {
5409
5537
  }, JUSTIFY === null || JUSTIFY === void 0 ? void 0 : JUSTIFY[config === null || config === void 0 ? void 0 : config.justify])
5410
5538
  }, /*#__PURE__*/React__default.createElement(SingleBanner, {
5411
5539
  config: config,
5412
- sliderImages: sliderImages
5540
+ sliderImages: sliderImages,
5541
+ sliderTypeName: sliderTypeName,
5542
+ handleBannerClick: handleBannerClick
5413
5543
  }));
5414
5544
  }))));
5415
5545
  }), extraExcludeComponents === null || extraExcludeComponents === void 0 ? void 0 : extraExcludeComponents.map(function (item, i) {
@@ -5424,10 +5554,14 @@ var Root$6 = styled__default.div(_templateObject$n || (_templateObject$n = _tagg
5424
5554
  var MainContainer$1 = styled__default.div(_templateObject2$f || (_templateObject2$f = _taggedTemplateLiteralLoose([""])));
5425
5555
  var SingleBanner = function SingleBanner(_ref3) {
5426
5556
  var config = _ref3.config,
5427
- sliderImages = _ref3.sliderImages;
5557
+ sliderImages = _ref3.sliderImages,
5558
+ sliderTypeName = _ref3.sliderTypeName,
5559
+ handleBannerClick = _ref3.handleBannerClick;
5428
5560
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !(config !== null && config !== void 0 && config.isSlider) ? /*#__PURE__*/React__default.createElement(BannerImages, {
5429
5561
  config: config,
5430
- sliderImages: sliderImages
5562
+ sliderImages: sliderImages,
5563
+ sliderTypeName: sliderTypeName,
5564
+ handleBannerClick: handleBannerClick
5431
5565
  }) : /*#__PURE__*/React__default.createElement(LandingCarousel, {
5432
5566
  config: config,
5433
5567
  sliderImages: sliderImages
@@ -5458,7 +5592,13 @@ var LandingCarousel$1 = function LandingCarousel(_ref) {
5458
5592
  isSlider = _ref.isSlider,
5459
5593
  filterNoUrlData = _ref.filterNoUrlData,
5460
5594
  _ref$maxShowItem = _ref.maxShowItem,
5461
- maxShowItem = _ref$maxShowItem === void 0 ? 9 : _ref$maxShowItem;
5595
+ maxShowItem = _ref$maxShowItem === void 0 ? 9 : _ref$maxShowItem,
5596
+ _ref$cssEase = _ref.cssEase,
5597
+ cssEase = _ref$cssEase === void 0 ? '' : _ref$cssEase,
5598
+ _ref$speed = _ref.speed,
5599
+ speed = _ref$speed === void 0 ? 1000 : _ref$speed,
5600
+ _ref$autoplaySpeed = _ref.autoplaySpeed,
5601
+ autoplaySpeed = _ref$autoplaySpeed === void 0 ? 5000 : _ref$autoplaySpeed;
5462
5602
  var isTablet = material.useMediaQuery('(max-width:768px)');
5463
5603
  var isMobile = material.useMediaQuery('(max-width:480px)');
5464
5604
  var brandListData = (brandList === null || brandList === void 0 ? void 0 : brandList.content) || [];
@@ -5480,11 +5620,13 @@ var LandingCarousel$1 = function LandingCarousel(_ref) {
5480
5620
  return {
5481
5621
  dots: true,
5482
5622
  infinite: true,
5623
+ speed: speed,
5483
5624
  slidesToShow: maxShowItem || 9,
5484
5625
  slidesToScroll: 1,
5485
5626
  swipeToSlide: true,
5486
5627
  autoplay: true,
5487
- autoplaySpeed: 5000,
5628
+ autoplaySpeed: autoplaySpeed,
5629
+ cssEase: cssEase,
5488
5630
  arrows: true,
5489
5631
  pauseOnHover: true,
5490
5632
  prevArrow: /*#__PURE__*/React__default.createElement(ai.AiOutlineLeft, null),
@@ -5593,7 +5735,13 @@ var BrandList = function BrandList(_ref) {
5593
5735
  _ref$filterNoUrlData = _ref.filterNoUrlData,
5594
5736
  filterNoUrlData = _ref$filterNoUrlData === void 0 ? false : _ref$filterNoUrlData,
5595
5737
  _ref$maxShowItem = _ref.maxShowItem,
5596
- maxShowItem = _ref$maxShowItem === void 0 ? 9 : _ref$maxShowItem;
5738
+ maxShowItem = _ref$maxShowItem === void 0 ? 9 : _ref$maxShowItem,
5739
+ _ref$cssEase = _ref.cssEase,
5740
+ cssEase = _ref$cssEase === void 0 ? '' : _ref$cssEase,
5741
+ _ref$speed = _ref.speed,
5742
+ speed = _ref$speed === void 0 ? 1000 : _ref$speed,
5743
+ _ref$autoplaySpeed = _ref.autoplaySpeed,
5744
+ autoplaySpeed = _ref$autoplaySpeed === void 0 ? 5000 : _ref$autoplaySpeed;
5597
5745
  var _useState = React.useState(false),
5598
5746
  loading = _useState[0],
5599
5747
  setLoading = _useState[1];
@@ -5628,7 +5776,10 @@ var BrandList = function BrandList(_ref) {
5628
5776
  noImgUrl: noImgUrl,
5629
5777
  isSlider: isSlider,
5630
5778
  filterNoUrlData: filterNoUrlData,
5631
- maxShowItem: maxShowItem
5779
+ maxShowItem: maxShowItem,
5780
+ cssEase: cssEase,
5781
+ speed: speed,
5782
+ autoplaySpeed: autoplaySpeed
5632
5783
  }))));
5633
5784
  };
5634
5785
  var Root$8 = styled__default.div(_templateObject$p || (_templateObject$p = _taggedTemplateLiteralLoose([""])));
@@ -10347,6 +10498,147 @@ var StyledButton = styled__default.button(_templateObject2$u || (_templateObject
10347
10498
  return props.theme.primaryColor;
10348
10499
  });
10349
10500
 
10501
+ var DiscountSummaryModal = function DiscountSummaryModal(_ref) {
10502
+ var discountCoupons = _ref.discountCoupons,
10503
+ orderTotal = _ref.orderTotal,
10504
+ primaryColor = _ref.primaryColor,
10505
+ open = _ref.open,
10506
+ onCancel = _ref.onCancel;
10507
+ return /*#__PURE__*/React__default.createElement(material.Dialog, {
10508
+ open: open,
10509
+ onClose: onCancel,
10510
+ fullWidth: true,
10511
+ maxWidth: "sm"
10512
+ }, /*#__PURE__*/React__default.createElement(material.DialogTitle, null, /*#__PURE__*/React__default.createElement(material.Typography, {
10513
+ variant: "h4",
10514
+ fontWeight: "bold",
10515
+ align: "center",
10516
+ sx: {
10517
+ color: '#000000',
10518
+ fontSize: '1.8rem'
10519
+ }
10520
+ }, "Discount Has Been Applied! \uD83C\uDF89")), /*#__PURE__*/React__default.createElement(material.DialogContent, null, /*#__PURE__*/React__default.createElement(material.Box, {
10521
+ sx: {
10522
+ padding: 2
10523
+ }
10524
+ }, /*#__PURE__*/React__default.createElement(material.TableContainer, {
10525
+ component: material.Box,
10526
+ sx: {
10527
+ border: '1px solid #e0e0e0',
10528
+ borderRadius: 2
10529
+ }
10530
+ }, /*#__PURE__*/React__default.createElement(material.Table, null, /*#__PURE__*/React__default.createElement(material.TableHead, null, /*#__PURE__*/React__default.createElement(material.TableRow, null, /*#__PURE__*/React__default.createElement(material.TableCell, {
10531
+ sx: {
10532
+ fontWeight: 'bold',
10533
+ fontSize: '1.2rem',
10534
+ padding: '12px'
10535
+ }
10536
+ }, "Coupon Code"), /*#__PURE__*/React__default.createElement(material.TableCell, {
10537
+ sx: {
10538
+ fontWeight: 'bold',
10539
+ fontSize: '1.2rem',
10540
+ padding: '12px'
10541
+ }
10542
+ }, "Discount"), /*#__PURE__*/React__default.createElement(material.TableCell, {
10543
+ sx: {
10544
+ fontWeight: 'bold',
10545
+ fontSize: '1.2rem',
10546
+ padding: '12px'
10547
+ }
10548
+ }, "Auto Applied"))), /*#__PURE__*/React__default.createElement(material.TableBody, null, discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.map(function (item, i) {
10549
+ return /*#__PURE__*/React__default.createElement(material.TableRow, {
10550
+ key: i
10551
+ }, /*#__PURE__*/React__default.createElement(material.TableCell, {
10552
+ sx: {
10553
+ fontWeight: 'bold',
10554
+ fontSize: '1.2rem',
10555
+ padding: '12px'
10556
+ }
10557
+ }, (item === null || item === void 0 ? void 0 : item.couponCode) || ''), /*#__PURE__*/React__default.createElement(material.TableCell, {
10558
+ sx: {
10559
+ fontSize: '1.2rem',
10560
+ padding: '12px',
10561
+ color: 'success.main',
10562
+ fontWeight: 'bold'
10563
+ }
10564
+ }, renderMoney(item === null || item === void 0 ? void 0 : item.amount)), /*#__PURE__*/React__default.createElement(material.TableCell, {
10565
+ sx: {
10566
+ fontSize: '1.2rem',
10567
+ padding: '12px'
10568
+ }
10569
+ }, (item === null || item === void 0 ? void 0 : item.autoApplicable) && /*#__PURE__*/React__default.createElement(fa6.FaCheck, {
10570
+ color: "green",
10571
+ style: {
10572
+ fontSize: '1.5rem'
10573
+ }
10574
+ })));
10575
+ })))), /*#__PURE__*/React__default.createElement(material.Divider, {
10576
+ sx: {
10577
+ marginY: 3
10578
+ }
10579
+ }), /*#__PURE__*/React__default.createElement(material.TableContainer, {
10580
+ component: material.Box,
10581
+ sx: {
10582
+ border: '1px solid #e0e0e0',
10583
+ borderRadius: 2
10584
+ }
10585
+ }, /*#__PURE__*/React__default.createElement(material.Table, null, /*#__PURE__*/React__default.createElement(material.TableBody, null, /*#__PURE__*/React__default.createElement(material.TableRow, null, /*#__PURE__*/React__default.createElement(material.TableCell, {
10586
+ sx: {
10587
+ fontWeight: 'bold',
10588
+ fontSize: '1.2rem',
10589
+ padding: '12px'
10590
+ }
10591
+ }, "Sub Total"), /*#__PURE__*/React__default.createElement(material.TableCell, {
10592
+ sx: {
10593
+ fontWeight: 'bold',
10594
+ fontSize: '1.2rem',
10595
+ padding: '12px'
10596
+ }
10597
+ }, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.subTotal))), /*#__PURE__*/React__default.createElement(material.TableRow, null, /*#__PURE__*/React__default.createElement(material.TableCell, {
10598
+ sx: {
10599
+ fontWeight: 'bold',
10600
+ fontSize: '1.2rem',
10601
+ padding: '12px'
10602
+ }
10603
+ }, "Total Discount"), /*#__PURE__*/React__default.createElement(material.TableCell, {
10604
+ sx: {
10605
+ fontWeight: 'bold',
10606
+ fontSize: '1.2rem',
10607
+ padding: '12px',
10608
+ color: 'success.main'
10609
+ }
10610
+ }, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.couponDiscountTotal))), /*#__PURE__*/React__default.createElement(material.TableRow, null, /*#__PURE__*/React__default.createElement(material.TableCell, {
10611
+ sx: {
10612
+ fontWeight: 'bold',
10613
+ fontSize: '1.2rem',
10614
+ padding: '12px'
10615
+ }
10616
+ }, "Order Total"), /*#__PURE__*/React__default.createElement(material.TableCell, {
10617
+ sx: {
10618
+ fontWeight: 'bold',
10619
+ fontSize: '1.2rem',
10620
+ padding: '12px',
10621
+ color: 'primary.main'
10622
+ }
10623
+ }, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount)))))))), /*#__PURE__*/React__default.createElement(material.DialogActions, {
10624
+ sx: {
10625
+ justifyContent: 'center',
10626
+ padding: 2
10627
+ }
10628
+ }, /*#__PURE__*/React__default.createElement(MuiButton, {
10629
+ variant: "contained",
10630
+ onClick: function onClick() {
10631
+ return onCancel(false);
10632
+ },
10633
+ primaryColor: primaryColor,
10634
+ style: {
10635
+ fontSize: '1.1rem',
10636
+ padding: '0.5rem 2rem',
10637
+ fontWeight: 700
10638
+ }
10639
+ }, "Okay")));
10640
+ };
10641
+
10350
10642
  var _templateObject$K, _templateObject2$v, _templateObject3$m, _templateObject4$i, _templateObject5$e, _templateObject6$c, _templateObject7$8, _templateObject8$6;
10351
10643
  var CheckoutRootContainer = styled__default.div(_templateObject$K || (_templateObject$K = _taggedTemplateLiteralLoose(["\n width: 100%;\n padding: 2rem;\n background-color: ", ";\n font-size: 16px;\n\n div,\n button,\n span {\n font-size: 16px;\n }\n @media only screen and (max-width: 1600px) {\n padding: 3em 0.5em;\n }\n @media screen and (max-width: 900px) {\n div,\n button,\n span {\n font-size: 12px;\n }\n padding: 2rem 0.5rem;\n }\n"])), function (props) {
10352
10644
  return props.bg;
@@ -11067,7 +11359,7 @@ var Step2 = function Step2(_ref) {
11067
11359
  if (rangeValue) {
11068
11360
  modifyItem.amount = rangeValue === null || rangeValue === void 0 ? void 0 : rangeValue.value;
11069
11361
  }
11070
- if (item !== null && item !== void 0 && item.freeShippingLimit && (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) > (item === null || item === void 0 ? void 0 : item.freeShippingLimit)) {
11362
+ if (item !== null && item !== void 0 && item.freeShippingLimit && ((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) || 0) - ((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.shippingAmount) || 0) > (item === null || item === void 0 ? void 0 : item.freeShippingLimit)) {
11071
11363
  modifyItem.amount = 0;
11072
11364
  }
11073
11365
  return modifyItem;
@@ -12574,7 +12866,7 @@ var steps = [{
12574
12866
  })
12575
12867
  }];
12576
12868
  var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12577
- var _styles$input, _customer$customerDto12, _customer$customerDto13, _customer$customerDto14, _customer$customerDto15, _styles$checkoutSumma, _styles$checkoutSumma2;
12869
+ var _styles$input, _customer$customerDto11, _customer$customerDto12, _customer$customerDto13, _customer$customerDto14, _styles$checkoutSumma, _styles$checkoutSumma2;
12578
12870
  var apiEndPoint = _ref.apiEndPoint,
12579
12871
  token = _ref.token,
12580
12872
  ccProcessingFees = _ref.ccProcessingFees,
@@ -12582,7 +12874,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12582
12874
  cartData = _ref.cartData,
12583
12875
  handleLogin = _ref.handleLogin,
12584
12876
  clickRedirect = _ref.clickRedirect,
12585
- shippingText = _ref.shippingText;
12877
+ shippingText = _ref.shippingText,
12878
+ fetchCartData = _ref.fetchCartData;
12586
12879
  var _useAllSystemFeatureV = useAllSystemFeatureValues({
12587
12880
  apiEndPoint: apiEndPoint,
12588
12881
  token: token
@@ -12652,6 +12945,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12652
12945
  var _useState19 = React.useState([]),
12653
12946
  discountCoupons = _useState19[0],
12654
12947
  setDiscountCoupons = _useState19[1];
12948
+ var previousSubTotalRef = React.useRef(null);
12949
+ var previousShippingAddressIdRef = React.useRef(null);
12655
12950
  React.useEffect(function () {
12656
12951
  if (apiEndPoint && token) {
12657
12952
  (function () {
@@ -12719,10 +13014,9 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12719
13014
  if (_temp3 && _temp3.then) return _temp3.then(function () {});
12720
13015
  }
12721
13016
  var _temp4 = _catch(function () {
12722
- return Promise.resolve(API({
13017
+ return Promise.resolve(getDeliveryOption({
12723
13018
  apiEndPoint: apiEndPoint,
12724
- token: token,
12725
- url: "/shipping/options"
13019
+ token: token
12726
13020
  })).then(function (data) {
12727
13021
  setDeliveryOptions(data);
12728
13022
  });
@@ -12730,11 +13024,9 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12730
13024
  return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
12731
13025
  };
12732
13026
  var _temp6 = _catch(function () {
12733
- return Promise.resolve(API({
13027
+ return Promise.resolve(getCustomer({
12734
13028
  apiEndPoint: apiEndPoint,
12735
- token: token,
12736
- url: "/ecommerce/customer",
12737
- hideErrorMessage: true
13029
+ token: token
12738
13030
  })).then(function (data) {
12739
13031
  setCustomer(data);
12740
13032
  });
@@ -12755,121 +13047,159 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12755
13047
  setCurrStep(0);
12756
13048
  }
12757
13049
  }, [customer, currStep]);
12758
- var inDebounce;
12759
13050
  React.useEffect(function () {
12760
- if (customer) {
12761
- cartTotalOnChangeData();
12762
- }
13051
+ (function () {
13052
+ try {
13053
+ var _temp9 = function () {
13054
+ if (customer) {
13055
+ return Promise.resolve(taxFunction()).then(function (taxAmount) {
13056
+ return Promise.resolve(discountFunction()).then(function (couponDiscountTotal) {
13057
+ return Promise.resolve(cartTotalOnChangeData({
13058
+ apiCouponDiscountTotal: couponDiscountTotal || 0,
13059
+ apiTaxAmount: taxAmount || 0
13060
+ })).then(function () {});
13061
+ });
13062
+ });
13063
+ }
13064
+ }();
13065
+ return _temp9 && _temp9.then ? _temp9.then(function () {}) : void 0;
13066
+ } catch (e) {
13067
+ Promise.reject(e);
13068
+ }
13069
+ })();
12763
13070
  }, [customer, cartData, shippingMethod, ccProcessingFees, shippingAddressId]);
12764
- var cartTotalOnChangeData = function cartTotalOnChangeData() {
12765
- clearTimeout(inDebounce);
12766
- inDebounce = setTimeout(function () {
12767
- (function () {
12768
- try {
12769
- var _temp14 = function () {
12770
- if (apiEndPoint && token) {
12771
- var _temp13 = function _temp13() {
12772
- function _temp11() {
12773
- var _taxAmount, _ref2, _ref3, _cartData$cartDiscoun, _cartData$cartSubTota, _ref4;
12774
- var totalData = {
12775
- taxAmount: parseFloat((_taxAmount = _taxAmount2) === null || _taxAmount === void 0 ? void 0 : _taxAmount.toFixed(2)),
12776
- shippingAmount: parseFloat((_ref2 = (shippingMethod === null || shippingMethod === void 0 ? void 0 : shippingMethod.amount) || 0) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2)),
12777
- couponDiscountTotal: _couponDiscountTotal,
12778
- 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)),
12779
- cartDiscount: parseFloat(cartData === null || cartData === void 0 ? void 0 : (_cartData$cartDiscoun = cartData.cartDiscount) === null || _cartData$cartDiscoun === void 0 ? void 0 : _cartData$cartDiscoun.toFixed(2)),
12780
- subTotal: parseFloat(cartData === null || cartData === void 0 ? void 0 : (_cartData$cartSubTota = cartData.cartSubTotal) === null || _cartData$cartSubTota === void 0 ? void 0 : _cartData$cartSubTota.toFixed(2)),
12781
- 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)),
12782
- totalQuantity: cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity
12783
- };
12784
- setOrderTotal(totalData);
12785
- }
12786
- var _temp10 = _catch(function () {
12787
- return Promise.resolve(getCartDiscountList({
12788
- apiEndPoint: apiEndPoint,
12789
- token: token
12790
- })).then(function (discountCouponsData) {
12791
- var _ref5;
12792
- _couponDiscountTotal = parseFloat((_ref5 = lodash.sumBy(discountCouponsData, 'amount') || 0) === null || _ref5 === void 0 ? void 0 : _ref5.toFixed(2));
12793
- setDiscountCoupons(discountCouponsData);
13071
+ var taxFunction = function taxFunction() {
13072
+ try {
13073
+ return Promise.resolve(function (_cartData$cartLineIte) {
13074
+ if (shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.length) > 0 && shippingAddressId !== previousShippingAddressIdRef.current) {
13075
+ var taxAmount = 0;
13076
+ return _catch(function () {
13077
+ return Promise.resolve(getTaxData({
13078
+ apiEndPoint: apiEndPoint,
13079
+ token: token,
13080
+ shippingAddressId: shippingAddressId
13081
+ })).then(function (taxData) {
13082
+ var _customer$customerDto;
13083
+ taxAmount = !(customer !== null && customer !== void 0 && (_customer$customerDto = customer.customerDto) !== null && _customer$customerDto !== void 0 && _customer$customerDto.taxable) ? 0 : lodash.sumBy(taxData, 'taxAmount') || 0;
13084
+ previousShippingAddressIdRef.current = shippingAddressId;
13085
+ return taxAmount;
13086
+ });
13087
+ }, function () {});
13088
+ }
13089
+ }());
13090
+ } catch (e) {
13091
+ return Promise.reject(e);
13092
+ }
13093
+ };
13094
+ var discountFunction = function discountFunction() {
13095
+ try {
13096
+ return Promise.resolve(function () {
13097
+ if (!isNullUndefined(cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal) && (cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal) !== previousSubTotalRef.current) {
13098
+ var couponDiscountTotal = 0;
13099
+ return _catch(function () {
13100
+ return Promise.resolve(autoApplyCoupon({
13101
+ apiEndPoint: apiEndPoint,
13102
+ token: token,
13103
+ subTotal: cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal
13104
+ })).then(function () {
13105
+ function _temp10(_fetchCartData) {
13106
+ _fetchCartData;
13107
+ return Promise.resolve(getCartDiscountList({
13108
+ apiEndPoint: apiEndPoint,
13109
+ token: token
13110
+ })).then(function (discountCouponsData) {
13111
+ var _ref2;
13112
+ couponDiscountTotal = parseFloat((_ref2 = lodash.sumBy(discountCouponsData, 'amount') || 0) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2));
13113
+ setDiscountCoupons({
13114
+ openDiscountModal: discountCouponsData === null || discountCouponsData === void 0 ? void 0 : discountCouponsData.some(function (coupon) {
13115
+ return coupon === null || coupon === void 0 ? void 0 : coupon.autoApplicable;
13116
+ }),
13117
+ discountCouponsData: discountCouponsData
12794
13118
  });
12795
- }, function () {});
12796
- return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
12797
- };
12798
- var _taxAmount2 = 0;
12799
- var _couponDiscountTotal = 0;
12800
- var _temp12 = function (_cartData$cartLineIte) {
12801
- if (shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.length) > 0) {
12802
- var _temp9 = _catch(function () {
12803
- return Promise.resolve(API({
12804
- apiEndPoint: apiEndPoint,
12805
- token: token,
12806
- url: "/cartLineItem/totalTax",
12807
- queryParams: {
12808
- storeId: 2,
12809
- customerShippingAddressId: shippingAddressId
12810
- }
12811
- })).then(function (taxData) {
12812
- var _customer$customerDto;
12813
- _taxAmount2 = !(customer !== null && customer !== void 0 && (_customer$customerDto = customer.customerDto) !== null && _customer$customerDto !== void 0 && _customer$customerDto.taxable) ? 0 : lodash.sumBy(taxData, 'taxAmount') || 0;
12814
- });
12815
- }, function () {});
12816
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
12817
- }
12818
- }();
12819
- return _temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12);
12820
- }
12821
- }();
12822
- return _temp14 && _temp14.then ? _temp14.then(function () {}) : void 0;
13119
+ previousSubTotalRef.current = cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal;
13120
+ return couponDiscountTotal;
13121
+ });
13122
+ }
13123
+ return fetchCartData ? Promise.resolve(fetchCartData()).then(_temp10) : _temp10(fetchCartData);
13124
+ });
13125
+ }, function () {});
13126
+ }
13127
+ }());
13128
+ } catch (e) {
13129
+ return Promise.reject(e);
13130
+ }
13131
+ };
13132
+ var inDebounce;
13133
+ var cartTotalOnChangeData = function cartTotalOnChangeData(_ref3) {
13134
+ var apiCouponDiscountTotal = _ref3.apiCouponDiscountTotal,
13135
+ apiTaxAmount = _ref3.apiTaxAmount;
13136
+ try {
13137
+ clearTimeout(inDebounce);
13138
+ inDebounce = setTimeout(function () {
13139
+ try {
13140
+ if (apiEndPoint && token) {
13141
+ var _ref4, _ref5, _cartData$cartDiscoun, _cartData$cartSubTota, _ref6;
13142
+ var taxAmount = apiTaxAmount || 0;
13143
+ var couponDiscountTotal = apiCouponDiscountTotal || 0;
13144
+ var totalData = {
13145
+ taxAmount: parseFloat(taxAmount === null || taxAmount === void 0 ? void 0 : taxAmount.toFixed(2)),
13146
+ shippingAmount: parseFloat((_ref4 = (shippingMethod === null || shippingMethod === void 0 ? void 0 : shippingMethod.amount) || 0) === null || _ref4 === void 0 ? void 0 : _ref4.toFixed(2)),
13147
+ couponDiscountTotal: couponDiscountTotal,
13148
+ adjustmentValue: parseFloat((_ref5 = ccProcessingFees ? (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) * (ccProcessingFees / 100) : 0) === null || _ref5 === void 0 ? void 0 : _ref5.toFixed(2)),
13149
+ cartDiscount: parseFloat(cartData === null || cartData === void 0 ? void 0 : (_cartData$cartDiscoun = cartData.cartDiscount) === null || _cartData$cartDiscoun === void 0 ? void 0 : _cartData$cartDiscoun.toFixed(2)),
13150
+ subTotal: parseFloat(cartData === null || cartData === void 0 ? void 0 : (_cartData$cartSubTota = cartData.cartSubTotal) === null || _cartData$cartSubTota === void 0 ? void 0 : _cartData$cartSubTota.toFixed(2)),
13151
+ totalAmount: parseFloat((_ref6 = (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) + taxAmount + ((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 || _ref6 === void 0 ? void 0 : _ref6.toFixed(2)),
13152
+ totalQuantity: cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity
13153
+ };
13154
+ setOrderTotal(totalData);
13155
+ }
12823
13156
  } catch (e) {
12824
13157
  Promise.reject(e);
12825
13158
  }
12826
- })();
12827
- }, 500);
13159
+ }, 500);
13160
+ return Promise.resolve();
13161
+ } catch (e) {
13162
+ return Promise.reject(e);
13163
+ }
12828
13164
  };
12829
13165
  var onLoginCustomer = function onLoginCustomer(data) {
12830
13166
  try {
12831
- var _temp16 = function _temp16() {
13167
+ var _temp12 = function _temp12() {
12832
13168
  setLoginLoading(false);
12833
13169
  };
12834
13170
  setLoginLoading(true);
12835
- var _temp15 = _catch(function () {
13171
+ var _temp11 = _catch(function () {
12836
13172
  return Promise.resolve(handleLogin(data)).then(function () {});
12837
13173
  }, function () {});
12838
- return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15));
13174
+ return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(_temp12) : _temp12(_temp11));
12839
13175
  } catch (e) {
12840
13176
  return Promise.reject(e);
12841
13177
  }
12842
13178
  };
12843
13179
  var addStoreAddress = function addStoreAddress(data) {
12844
13180
  try {
12845
- var _temp18 = _catch(function () {
12846
- var _customer$customerDto2, _customer$customerDto3;
12847
- return Promise.resolve(API({
13181
+ var _temp14 = _catch(function () {
13182
+ var _customer$customerDto2;
13183
+ return Promise.resolve(createStoreAddress({
12848
13184
  apiEndPoint: apiEndPoint,
12849
13185
  token: token,
12850
- method: 'POST',
12851
- 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",
12852
- body: _extends({}, data, {
12853
- customerId: customer === null || customer === void 0 ? void 0 : (_customer$customerDto3 = customer.customerDto) === null || _customer$customerDto3 === void 0 ? void 0 : _customer$customerDto3.id
12854
- }),
12855
- successMessage: 'Address added successfully.',
12856
- errorMessage: 'Error in added the address.'
13186
+ data: data,
13187
+ customerId: customer === null || customer === void 0 ? void 0 : (_customer$customerDto2 = customer.customerDto) === null || _customer$customerDto2 === void 0 ? void 0 : _customer$customerDto2.id
12857
13188
  })).then(function (result) {
12858
- var _temp17 = function () {
13189
+ var _temp13 = function () {
12859
13190
  if (result) {
12860
- return Promise.resolve(API({
13191
+ return Promise.resolve(getCustomer({
12861
13192
  apiEndPoint: apiEndPoint,
12862
- token: token,
12863
- url: "/ecommerce/customer"
13193
+ token: token
12864
13194
  })).then(function (customerData) {
12865
13195
  setCustomer(customerData);
12866
13196
  });
12867
13197
  }
12868
13198
  }();
12869
- if (_temp17 && _temp17.then) return _temp17.then(function () {});
13199
+ if (_temp13 && _temp13.then) return _temp13.then(function () {});
12870
13200
  });
12871
13201
  }, function () {});
12872
- return Promise.resolve(_temp18 && _temp18.then ? _temp18.then(function () {}) : void 0);
13202
+ return Promise.resolve(_temp14 && _temp14.then ? _temp14.then(function () {}) : void 0);
12873
13203
  } catch (e) {
12874
13204
  return Promise.reject(e);
12875
13205
  }
@@ -12892,12 +13222,12 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12892
13222
  setShippingMethod(shippingMethod);
12893
13223
  };
12894
13224
  var setPaymentDetails = function setPaymentDetails(storeCr, paymentMethod, cr) {
12895
- var _customer$customerDto4;
12896
- if (storeCr && (customer === null || customer === void 0 ? void 0 : (_customer$customerDto4 = customer.customerDto) === null || _customer$customerDto4 === void 0 ? void 0 : _customer$customerDto4.storeCredit) > 0) {
12897
- var _customer$customerDto5;
13225
+ var _customer$customerDto3;
13226
+ if (storeCr && (customer === null || customer === void 0 ? void 0 : (_customer$customerDto3 = customer.customerDto) === null || _customer$customerDto3 === void 0 ? void 0 : _customer$customerDto3.storeCredit) > 0) {
13227
+ var _customer$customerDto4;
12898
13228
  setStoreCredits({
12899
13229
  id: 5,
12900
- amount: customer === null || customer === void 0 ? void 0 : (_customer$customerDto5 = customer.customerDto) === null || _customer$customerDto5 === void 0 ? void 0 : _customer$customerDto5.storeCredit
13230
+ amount: customer === null || customer === void 0 ? void 0 : (_customer$customerDto4 = customer.customerDto) === null || _customer$customerDto4 === void 0 ? void 0 : _customer$customerDto4.storeCredit
12901
13231
  });
12902
13232
  } else {
12903
13233
  setStoreCredits(null);
@@ -12917,15 +13247,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12917
13247
  discountCouponList: []
12918
13248
  }, details);
12919
13249
  return Promise.resolve(_catch(function () {
12920
- var getStoreIdsData = localStorage.getItem('storeIds');
12921
- var storeId = (getStoreIdsData === null || getStoreIdsData === void 0 ? void 0 : getStoreIdsData.storeId) || 2;
12922
- return Promise.resolve(API({
13250
+ return Promise.resolve(addSalesOrder({
12923
13251
  apiEndPoint: apiEndPoint,
12924
13252
  token: token,
12925
- body: orderDetails,
12926
- url: "/ecommerce/salesOrder?storeId=" + storeId,
12927
- method: 'post',
12928
- errorMessage: 'unable to complete the order'
13253
+ orderDetails: orderDetails
12929
13254
  })).then(function (data) {
12930
13255
  var _data$salesOrderDto;
12931
13256
  if (data !== null && data !== void 0 && data.productOutOfStock) {
@@ -12947,11 +13272,11 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
12947
13272
  };
12948
13273
  var onPlaceOrder = function onPlaceOrder(note, transactionId) {
12949
13274
  try {
12950
- var _temp20 = function _temp20() {
13275
+ var _temp16 = function _temp16() {
12951
13276
  setOrdering(false);
12952
13277
  };
12953
13278
  setOrdering(true);
12954
- var _temp19 = _catch(function () {
13279
+ var _temp15 = _catch(function () {
12955
13280
  var authorizeCustomerCardData = {
12956
13281
  authorizeDotNetCustomerProfileId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.authorizeDotNetCustomerProfileId,
12957
13282
  authorizeDotNetCustomerPaymentProfileId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.authorizeDotNetCustomerPaymentProfileId
@@ -13008,12 +13333,12 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13008
13333
  paymentModeId: selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.id
13009
13334
  }];
13010
13335
  } else if (selectedStoreCredits && (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount) < (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount)) {
13011
- var _selectedStoreCredits, _ref6;
13336
+ var _selectedStoreCredits, _ref7;
13012
13337
  orderPaymentList = [{
13013
13338
  amount: parseFloat(selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : (_selectedStoreCredits = selectedStoreCredits.amount) === null || _selectedStoreCredits === void 0 ? void 0 : _selectedStoreCredits.toFixed(2)),
13014
13339
  paymentModeId: selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.id
13015
13340
  }, _extends({
13016
- 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)),
13341
+ amount: parseFloat((_ref7 = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount)) === null || _ref7 === void 0 ? void 0 : _ref7.toFixed(2)),
13017
13342
  paymentModeId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.id,
13018
13343
  customerOrderCard: ecommerceCustomPaymentDto,
13019
13344
  transactionId: transactionId
@@ -13031,14 +13356,14 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13031
13356
  var salesOrderDtoBody = {
13032
13357
  salesOrderDto: orderDto,
13033
13358
  salesOrderPaymentDtoList: paymentDtoList,
13034
- discountCouponList: discountCoupons
13359
+ discountCouponList: discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.discountCouponsData
13035
13360
  };
13036
13361
  if (ecommerceCustomPaymentDto) {
13037
13362
  salesOrderDtoBody.ecommerceCustomPaymentDto;
13038
13363
  }
13039
13364
  return Promise.resolve(createSalesOrder(salesOrderDtoBody)).then(function () {});
13040
13365
  }, function () {});
13041
- return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(_temp20) : _temp20(_temp19));
13366
+ return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15));
13042
13367
  } catch (e) {
13043
13368
  return Promise.reject(e);
13044
13369
  }
@@ -13051,7 +13376,17 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13051
13376
  className: "checkout",
13052
13377
  bg: styles === null || styles === void 0 ? void 0 : styles.bg,
13053
13378
  primaryColor: styles === null || styles === void 0 ? void 0 : styles.primaryColor
13054
- }, /*#__PURE__*/React__default.createElement(material.Stack, {
13379
+ }, (discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.openDiscountModal) && /*#__PURE__*/React__default.createElement(DiscountSummaryModal, {
13380
+ primaryColor: styles === null || styles === void 0 ? void 0 : styles.primaryColor,
13381
+ discountCoupons: discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.discountCouponsData,
13382
+ orderTotal: orderTotal,
13383
+ open: discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.openDiscountModal,
13384
+ onCancel: function onCancel() {
13385
+ return setDiscountCoupons(_extends({}, discountCoupons, {
13386
+ openDiscountModal: false
13387
+ }));
13388
+ }
13389
+ }), /*#__PURE__*/React__default.createElement(material.Stack, {
13055
13390
  flexDirection: "column",
13056
13391
  alignItems: "flex-start",
13057
13392
  style: {
@@ -13081,7 +13416,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13081
13416
  width: '100%'
13082
13417
  }
13083
13418
  }, steps === null || steps === void 0 ? void 0 : steps.map(function (item, index) {
13084
- var _styles$stepperIcon, _styles$stepperIcon2, _customer$customerDto6, _customer$customerDto7, _customer$customerDto8, _customer$customerDto9, _customer$customerDto10, _customer$customerDto11;
13419
+ var _styles$stepperIcon, _styles$stepperIcon2, _customer$customerDto5, _customer$customerDto6, _customer$customerDto7, _customer$customerDto8, _customer$customerDto9, _customer$customerDto10;
13085
13420
  return /*#__PURE__*/React__default.createElement(material.Step, {
13086
13421
  key: index
13087
13422
  }, /*#__PURE__*/React__default.createElement(material.StepLabel, {
@@ -13114,7 +13449,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13114
13449
  text: item.text,
13115
13450
  icon: item.icon,
13116
13451
  single: true,
13117
- username: index === 0 ? customer === null || customer === void 0 ? void 0 : (_customer$customerDto6 = customer.customerDto) === null || _customer$customerDto6 === void 0 ? void 0 : _customer$customerDto6.firstName : '',
13452
+ username: index === 0 ? customer === null || customer === void 0 ? void 0 : (_customer$customerDto5 = customer.customerDto) === null || _customer$customerDto5 === void 0 ? void 0 : _customer$customerDto5.firstName : '',
13118
13453
  primaryColor: styles === null || styles === void 0 ? void 0 : styles.primaryColor,
13119
13454
  closed: true,
13120
13455
  handleClick: function handleClick() {
@@ -13129,7 +13464,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13129
13464
  }, /*#__PURE__*/React__default.createElement(Step0, {
13130
13465
  currStep: currStep,
13131
13466
  loading: loginLoading,
13132
- userName: customer === null || customer === void 0 ? void 0 : (_customer$customerDto7 = customer.customerDto) === null || _customer$customerDto7 === void 0 ? void 0 : _customer$customerDto7.firstName,
13467
+ userName: customer === null || customer === void 0 ? void 0 : (_customer$customerDto6 = customer.customerDto) === null || _customer$customerDto6 === void 0 ? void 0 : _customer$customerDto6.firstName,
13133
13468
  handleBack: handleBack,
13134
13469
  handleNext: handleNext,
13135
13470
  handleLogin: onLoginCustomer,
@@ -13171,8 +13506,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13171
13506
  countries: countries,
13172
13507
  setShipping: setShipping,
13173
13508
  showShipping: showShipping,
13174
- storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto8 = customer.customerDto) === null || _customer$customerDto8 === void 0 ? void 0 : _customer$customerDto8.storeCredit,
13175
- discountCoupons: discountCoupons,
13509
+ storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto7 = customer.customerDto) === null || _customer$customerDto7 === void 0 ? void 0 : _customer$customerDto7.storeCredit,
13510
+ discountCoupons: discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.discountCouponsData,
13176
13511
  addShipping: addStoreAddress,
13177
13512
  setSelectedCountry: setSelectedCountry,
13178
13513
  styles: styles,
@@ -13194,7 +13529,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13194
13529
  payments: paymentMethods,
13195
13530
  states: states,
13196
13531
  countries: countries,
13197
- storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto9 = customer.customerDto) === null || _customer$customerDto9 === void 0 ? void 0 : _customer$customerDto9.storeCredit,
13532
+ storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto8 = customer.customerDto) === null || _customer$customerDto8 === void 0 ? void 0 : _customer$customerDto8.storeCredit,
13198
13533
  orderTotal: orderTotal,
13199
13534
  styles: styles,
13200
13535
  setSelectedCountry: setSelectedCountry,
@@ -13218,10 +13553,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13218
13553
  placeOrder: onPlaceOrder,
13219
13554
  styles: styles,
13220
13555
  storeCredits: (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount) || 0,
13221
- discountCoupons: discountCoupons,
13556
+ discountCoupons: discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.discountCouponsData,
13222
13557
  shippingText: shippingText,
13223
13558
  ccProcessingFees: ccProcessingFees,
13224
- shippingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto10 = customer.customerDto) === null || _customer$customerDto10 === void 0 ? void 0 : (_customer$customerDto11 = _customer$customerDto10.customerStoreAddressList) === null || _customer$customerDto11 === void 0 ? void 0 : _customer$customerDto11.find(function (item) {
13559
+ shippingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto9 = customer.customerDto) === null || _customer$customerDto9 === void 0 ? void 0 : (_customer$customerDto10 = _customer$customerDto9.customerStoreAddressList) === null || _customer$customerDto10 === void 0 ? void 0 : _customer$customerDto10.find(function (item) {
13225
13560
  return (item === null || item === void 0 ? void 0 : item.id) === shippingAddressId;
13226
13561
  }),
13227
13562
  taxExempt: taxExempt,
@@ -13230,10 +13565,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13230
13565
  selectedPaymentMethod: selectedPaymentMethod
13231
13566
  })));
13232
13567
  }))))), /*#__PURE__*/React__default.createElement(CheckoutSummary, {
13233
- billingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto12 = customer.customerDto) === null || _customer$customerDto12 === void 0 ? void 0 : (_customer$customerDto13 = _customer$customerDto12.customerStoreAddressList) === null || _customer$customerDto13 === void 0 ? void 0 : _customer$customerDto13.find(function (item) {
13568
+ billingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto11 = customer.customerDto) === null || _customer$customerDto11 === void 0 ? void 0 : (_customer$customerDto12 = _customer$customerDto11.customerStoreAddressList) === null || _customer$customerDto12 === void 0 ? void 0 : _customer$customerDto12.find(function (item) {
13234
13569
  return (item === null || item === void 0 ? void 0 : item.id) === billingAddressId;
13235
13570
  }),
13236
- shippingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto14 = customer.customerDto) === null || _customer$customerDto14 === void 0 ? void 0 : (_customer$customerDto15 = _customer$customerDto14.customerStoreAddressList) === null || _customer$customerDto15 === void 0 ? void 0 : _customer$customerDto15.find(function (item) {
13571
+ shippingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto13 = customer.customerDto) === null || _customer$customerDto13 === void 0 ? void 0 : (_customer$customerDto14 = _customer$customerDto13.customerStoreAddressList) === null || _customer$customerDto14 === void 0 ? void 0 : _customer$customerDto14.find(function (item) {
13237
13572
  return (item === null || item === void 0 ? void 0 : item.id) === shippingAddressId;
13238
13573
  }),
13239
13574
  shippingMethod: shippingMethod,
@@ -13242,7 +13577,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13242
13577
  } : null),
13243
13578
  bg: styles === null || styles === void 0 ? void 0 : (_styles$checkoutSumma = styles.checkoutSummary) === null || _styles$checkoutSumma === void 0 ? void 0 : _styles$checkoutSumma.bg,
13244
13579
  color: styles === null || styles === void 0 ? void 0 : (_styles$checkoutSumma2 = styles.checkoutSummary) === null || _styles$checkoutSumma2 === void 0 ? void 0 : _styles$checkoutSumma2.color,
13245
- discountCoupons: discountCoupons,
13580
+ discountCoupons: discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.discountCouponsData,
13246
13581
  orderTotal: orderTotal
13247
13582
  }))));
13248
13583
  };