@salesgenterp/ui-components 0.4.533 → 0.4.540

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.
@@ -58,6 +58,9 @@ import { paramCase } from 'param-case';
58
58
  import { CgProfile } from 'react-icons/cg';
59
59
  import { FiTruck } from 'react-icons/fi';
60
60
  import { FaCheck, FaRegNoteSticky } from 'react-icons/fa6';
61
+ import Image$3 from 'next/image';
62
+ import debounce$1 from 'lodash/debounce';
63
+ import omit$1 from 'lodash/omit';
61
64
 
62
65
  function _extends() {
63
66
  return _extends = Object.assign ? Object.assign.bind() : function (n) {
@@ -4948,9 +4951,9 @@ var AccountDetails = function AccountDetails(_ref) {
4948
4951
  var _useState4 = useState([]),
4949
4952
  storeData = _useState4[0],
4950
4953
  setStoreData = _useState4[1];
4951
- var _useState5 = useState((storeData === null || storeData === void 0 ? void 0 : (_storeData$map = storeData.map(function (data) {
4952
- return data === null || data === void 0 ? void 0 : data.id;
4953
- })) === null || _storeData$map === void 0 ? void 0 : _storeData$map.join(',')) || 1),
4954
+ var _useState5 = useState(Array.isArray(storeData) && (storeData === null || storeData === void 0 ? void 0 : storeData.length) > 0 ? storeData === null || storeData === void 0 ? void 0 : (_storeData$map = storeData.map(function (store) {
4955
+ return store === null || store === void 0 ? void 0 : store.id;
4956
+ })) === null || _storeData$map === void 0 ? void 0 : _storeData$map.join(',') : '1'),
4954
4957
  storeIdList = _useState5[0],
4955
4958
  setSoreIdList = _useState5[1];
4956
4959
  var _useState6 = useState((storeData === null || storeData === void 0 ? void 0 : (_storeData$find = storeData.find(function (data) {
@@ -5012,10 +5015,12 @@ var AccountDetails = function AccountDetails(_ref) {
5012
5015
  return Promise.resolve(API({
5013
5016
  apiEndPoint: apiEndPoint,
5014
5017
  token: token,
5015
- url: "store/store-ids"
5018
+ url: "store"
5016
5019
  })).then(function (data) {
5017
- var _data$find;
5018
- var storeIds = Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.join(',') : '1';
5020
+ var _data$map, _data$find;
5021
+ var storeIds = Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : (_data$map = data.map(function (store) {
5022
+ return store === null || store === void 0 ? void 0 : store.id;
5023
+ })) === null || _data$map === void 0 ? void 0 : _data$map.join(',') : '1';
5019
5024
  setStoreData(data);
5020
5025
  setSoreIdList(storeIds);
5021
5026
  setDefaultStoreId((data === null || data === void 0 ? void 0 : (_data$find = data.find(function (data) {
@@ -13561,6 +13566,12 @@ var CheckoutPageComponentWrapper = function CheckoutPageComponentWrapper(_ref) {
13561
13566
  setTotalTaxAmount = _useState21[1];
13562
13567
  var previousSubTotalRef = useRef(null);
13563
13568
  var previousShippingAddressIdRef = useRef(null);
13569
+ useEffect(function () {
13570
+ var _cartData$cartLineIte;
13571
+ if (cartData && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.length) > 0 && currStep !== 1) {
13572
+ setCurrStep(1);
13573
+ }
13574
+ }, [cartData]);
13564
13575
  useEffect(function () {
13565
13576
  if (apiEndPoint && token) {
13566
13577
  (function () {
@@ -13685,8 +13696,8 @@ var CheckoutPageComponentWrapper = function CheckoutPageComponentWrapper(_ref) {
13685
13696
  useEffect(function () {
13686
13697
  (function () {
13687
13698
  try {
13688
- var _cartData$cartLineIte;
13689
- var isQuantityZero = cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.some(function (data) {
13699
+ var _cartData$cartLineIte2;
13700
+ var isQuantityZero = cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte2 = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte2 === void 0 ? void 0 : _cartData$cartLineIte2.some(function (data) {
13690
13701
  return (data === null || data === void 0 ? void 0 : data.quantity) <= 0;
13691
13702
  });
13692
13703
  if (isQuantityZero) {
@@ -13725,8 +13736,8 @@ var CheckoutPageComponentWrapper = function CheckoutPageComponentWrapper(_ref) {
13725
13736
  var taxFunction = function taxFunction() {
13726
13737
  try {
13727
13738
  var taxAmount = totalTaxAmount || 0;
13728
- var _temp10 = function (_cartData$cartLineIte2) {
13729
- if (shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte2 = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte2 === void 0 ? void 0 : _cartData$cartLineIte2.length) > 0 && shippingAddressId && (shippingAddressId !== previousShippingAddressIdRef.current || (cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal) !== previousSubTotalRef.current)) {
13739
+ var _temp10 = function (_cartData$cartLineIte3) {
13740
+ if (shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte3 = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte3 === void 0 ? void 0 : _cartData$cartLineIte3.length) > 0 && shippingAddressId && (shippingAddressId !== previousShippingAddressIdRef.current || (cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal) !== previousSubTotalRef.current)) {
13730
13741
  previousShippingAddressIdRef.current = shippingAddressId;
13731
13742
  var _temp9 = _catch(function () {
13732
13743
  return Promise.resolve(getTaxData({
@@ -15831,5 +15842,342 @@ function CustomTabPanel(props) {
15831
15842
  }, children));
15832
15843
  }
15833
15844
 
15834
- export { APIStaticPage, AccountDetails, BrandList, BrandStock, Breakpoint, CartDrawer, CartPageComponent, CheckoutPageComponent, ContactUsForm, GTagManager, HomeBanner, MaintenancePage, NewArrivalPage, OutOfStock, QuickOrder, RenderTawk, SingleBanner, SnowfallComponent as Snowfall, StaticPage, StaticPageList, SwitchUser, ThankYou, Variant, VendorAccountDetails as VendorAccount, useGridSize, useWindowSize };
15845
+ var cardStyle = {
15846
+ border: '1px solid #d3d3d3',
15847
+ borderRadius: '10px',
15848
+ display: 'flex',
15849
+ flexDirection: 'column',
15850
+ justifyContent: 'center',
15851
+ alignItems: 'center',
15852
+ padding: '10px',
15853
+ gap: '10px',
15854
+ backgroundColor: '#ffffff'
15855
+ };
15856
+ var WishlistProductCardSkeleton = function WishlistProductCardSkeleton(_ref) {
15857
+ var span = _ref.span,
15858
+ _ref$count = _ref.count,
15859
+ count = _ref$count === void 0 ? 18 : _ref$count;
15860
+ return /*#__PURE__*/React__default.createElement(Grid, {
15861
+ container: true,
15862
+ spacing: 2
15863
+ }, Array.from({
15864
+ length: count
15865
+ }).map(function (_, i) {
15866
+ var _span$xs, _span$sm, _span$md, _span$lg;
15867
+ return /*#__PURE__*/React__default.createElement(Grid, {
15868
+ item: true,
15869
+ xs: (_span$xs = span === null || span === void 0 ? void 0 : span.xs) != null ? _span$xs : 12,
15870
+ sm: (_span$sm = span === null || span === void 0 ? void 0 : span.sm) != null ? _span$sm : 6,
15871
+ md: (_span$md = span === null || span === void 0 ? void 0 : span.md) != null ? _span$md : 4,
15872
+ lg: (_span$lg = span === null || span === void 0 ? void 0 : span.lg) != null ? _span$lg : 2,
15873
+ key: i
15874
+ }, /*#__PURE__*/React__default.createElement("div", {
15875
+ style: cardStyle
15876
+ }, /*#__PURE__*/React__default.createElement(Skeleton$1, {
15877
+ variant: "rectangular",
15878
+ width: 160,
15879
+ height: 160,
15880
+ animation: "wave"
15881
+ }), /*#__PURE__*/React__default.createElement(Skeleton$1, {
15882
+ variant: "text",
15883
+ width: 80,
15884
+ height: 24,
15885
+ animation: "wave"
15886
+ }), /*#__PURE__*/React__default.createElement(Skeleton$1, {
15887
+ variant: "text",
15888
+ width: "90%",
15889
+ height: 43,
15890
+ animation: "wave"
15891
+ }), /*#__PURE__*/React__default.createElement(Skeleton$1, {
15892
+ variant: "rectangular",
15893
+ width: 120,
15894
+ height: 36,
15895
+ animation: "wave",
15896
+ sx: {
15897
+ borderRadius: '10px'
15898
+ }
15899
+ })));
15900
+ }));
15901
+ };
15902
+
15903
+ var _templateObject$S, _templateObject2$C, _templateObject3$s, _templateObject4$m, _templateObject5$h, _templateObject6$f, _templateObject7$b, _templateObject8$9, _templateObject9$6, _templateObject10$4, _templateObject11$3;
15904
+ var getProductImage = function getProductImage(imageUrl, imgNotFoundUrl) {
15905
+ return imageUrl && imageUrl !== 'null' ? imageUrl : imgNotFoundUrl != null ? imgNotFoundUrl : '/images/products/imgnotfound.png';
15906
+ };
15907
+ var DEFAULT_GRID_SPAN = {
15908
+ lg: 3,
15909
+ md: 4,
15910
+ sm: 6,
15911
+ xs: 6
15912
+ };
15913
+ var WISHLIST_ITEM_OMIT_KEYS = ['id', 'createdBy', 'insertedTimestamp', 'updatedBy', 'updatedTimestamp'];
15914
+ var getStyleOverride = function getStyleOverride(styleOverrides) {
15915
+ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
15916
+ keys[_key - 1] = arguments[_key];
15917
+ }
15918
+ for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
15919
+ var key = _keys[_i];
15920
+ if (styleOverrides !== null && styleOverrides !== void 0 && styleOverrides[key]) return styleOverrides[key];
15921
+ }
15922
+ return undefined;
15923
+ };
15924
+ var WishlistComponent = function WishlistComponent(_ref) {
15925
+ var style = _ref.style,
15926
+ imgNotFoundUrl = _ref.imgNotFoundUrl,
15927
+ token = _ref.token,
15928
+ _ref$isLoading = _ref.isLoading,
15929
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
15930
+ _ref$wishlistData = _ref.wishlistData,
15931
+ wishlistData = _ref$wishlistData === void 0 ? [] : _ref$wishlistData,
15932
+ onRemoveFromWishlist = _ref.onRemoveFromWishlist,
15933
+ onSearch = _ref.onSearch,
15934
+ _ref$span = _ref.span,
15935
+ span = _ref$span === void 0 ? DEFAULT_GRID_SPAN : _ref$span,
15936
+ primaryColor = _ref.primaryColor,
15937
+ apiEndPoint = _ref.apiEndPoint,
15938
+ onAddToCart = _ref.onAddToCart,
15939
+ _ref$doNotShowPrice = _ref.doNotShowPrice,
15940
+ doNotShowPrice = _ref$doNotShowPrice === void 0 ? false : _ref$doNotShowPrice;
15941
+ var _useAllSystemFeatureV = useAllSystemFeatureValues({
15942
+ apiEndPoint: apiEndPoint,
15943
+ token: token
15944
+ }),
15945
+ allowToProcessInvoiceForOutOfStockProductsEcommerce = _useAllSystemFeatureV.allowToProcessInvoiceForOutOfStockProductsEcommerce;
15946
+ var styleOverrides = useMemo(function () {
15947
+ return _extends({}, style || {});
15948
+ }, [style]);
15949
+ var _useState = useState(''),
15950
+ searchInput = _useState[0],
15951
+ setSearchInput = _useState[1];
15952
+ var items = useMemo(function () {
15953
+ var _wishlistData$content;
15954
+ if (Array.isArray(wishlistData)) return wishlistData;
15955
+ return (_wishlistData$content = wishlistData === null || wishlistData === void 0 ? void 0 : wishlistData.content) != null ? _wishlistData$content : [];
15956
+ }, [wishlistData]);
15957
+ var gridSpan = useMemo(function () {
15958
+ return _extends({}, DEFAULT_GRID_SPAN, span || {});
15959
+ }, [span]);
15960
+ var totalItems = useMemo(function () {
15961
+ if (typeof (wishlistData === null || wishlistData === void 0 ? void 0 : wishlistData.totalElements) === 'number') {
15962
+ return wishlistData === null || wishlistData === void 0 ? void 0 : wishlistData.totalElements;
15963
+ }
15964
+ return items === null || items === void 0 ? void 0 : items.length;
15965
+ }, [wishlistData, items === null || items === void 0 ? void 0 : items.length]);
15966
+ var debouncedSearch = useMemo(function () {
15967
+ return debounce$1(function (value) {
15968
+ return onSearch === null || onSearch === void 0 ? void 0 : onSearch(value);
15969
+ }, 500);
15970
+ }, [onSearch]);
15971
+ useEffect(function () {
15972
+ return function () {
15973
+ debouncedSearch.cancel();
15974
+ };
15975
+ }, [debouncedSearch]);
15976
+ if (!token) {
15977
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h1", null, "Wishlist"), /*#__PURE__*/React__default.createElement("p", null, "Please log in to view your wishlist."));
15978
+ }
15979
+ if (!isLoading && items.length === 0) {
15980
+ return /*#__PURE__*/React__default.createElement(EmptyStateText, {
15981
+ style: getStyleOverride(styleOverrides, 'emptyStateText', 'EmptyStateText')
15982
+ }, "no products added to wishlist");
15983
+ }
15984
+ return /*#__PURE__*/React__default.createElement("div", {
15985
+ style: {
15986
+ marginTop: '1rem',
15987
+ height: '100%',
15988
+ width: '100%'
15989
+ }
15990
+ }, /*#__PURE__*/React__default.createElement(TopBar, {
15991
+ style: getStyleOverride(styleOverrides, 'topBar', 'TopBar')
15992
+ }, /*#__PURE__*/React__default.createElement(SearchWrapper, {
15993
+ style: getStyleOverride(styleOverrides, 'searchWrapper', 'SearchWrapper')
15994
+ }, /*#__PURE__*/React__default.createElement(TextField, {
15995
+ placeholder: "Type minimum 3 characters to search...",
15996
+ value: searchInput,
15997
+ onChange: function onChange(e) {
15998
+ var value = e.target.value;
15999
+ setSearchInput(value);
16000
+ if (!token || typeof onSearch !== 'function') return;
16001
+ debouncedSearch(value);
16002
+ },
16003
+ size: "small",
16004
+ fullWidth: true,
16005
+ sx: {
16006
+ '& .MuiOutlinedInput-root': {
16007
+ borderRadius: '8px'
16008
+ }
16009
+ }
16010
+ })), /*#__PURE__*/React__default.createElement(TotalItemsText, {
16011
+ style: getStyleOverride(styleOverrides, 'totalItemsText', 'TotalItemsText')
16012
+ }, "Total " + totalItems + " item" + (totalItems === 1 ? '' : 's'))), isLoading ? /*#__PURE__*/React__default.createElement(WishlistProductCardSkeleton, {
16013
+ span: span
16014
+ }) : /*#__PURE__*/React__default.createElement(Grid, {
16015
+ container: true,
16016
+ spacing: 2
16017
+ }, items === null || items === void 0 ? void 0 : items.map(function (product) {
16018
+ return /*#__PURE__*/React__default.createElement(Grid, {
16019
+ item: true,
16020
+ xs: gridSpan.xs,
16021
+ sm: gridSpan.sm,
16022
+ md: gridSpan.md,
16023
+ lg: gridSpan.lg,
16024
+ key: product === null || product === void 0 ? void 0 : product.id
16025
+ }, /*#__PURE__*/React__default.createElement(ProductCard, {
16026
+ product: product,
16027
+ styleOverrides: styleOverrides,
16028
+ onRemoveFromWishlist: onRemoveFromWishlist,
16029
+ primaryColor: primaryColor,
16030
+ imgNotFoundUrl: imgNotFoundUrl,
16031
+ onAddToCart: onAddToCart,
16032
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
16033
+ doNotShowPrice: doNotShowPrice
16034
+ }));
16035
+ })));
16036
+ };
16037
+ var ProductCardWrapper = styled.div(_templateObject$S || (_templateObject$S = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: #ffffff;\n border: 1px solid #d3d3d3;\n border-radius: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 10px;\n gap: 10px;\n cursor: pointer;\n"])));
16038
+ var TopBar = styled.div(_templateObject2$C || (_templateObject2$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n"])));
16039
+ var SearchWrapper = styled(Box)(_templateObject3$s || (_templateObject3$s = _taggedTemplateLiteralLoose(["\n && {\n margin-bottom: 24px;\n max-width: 400px;\n width: 100%;\n }\n"])));
16040
+ var TotalItemsText = styled.div(_templateObject4$m || (_templateObject4$m = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n font-weight: 500;\n color: #4b4b4b;\n margin-bottom: 24px;\n white-space: nowrap;\n"])));
16041
+ var EmptyStateText = styled.p(_templateObject5$h || (_templateObject5$h = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n color: #4b4b4b;\n margin: 16px 0;\n"])));
16042
+ var DeleteButton = styled.button(_templateObject6$f || (_templateObject6$f = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 8px;\n right: 8px;\n opacity: 1;\n pointer-events: auto;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background-color: #ffffff;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n color: #ff0000;\n"])));
16043
+ var PriceContainer = styled.div(_templateObject7$b || (_templateObject7$b = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
16044
+ var DiscountPriceRow = styled.div(_templateObject8$9 || (_templateObject8$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])));
16045
+ var ProductName$2 = styled.div(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n font-weight: 500;\n color: #000000;\n text-align: center;\n height: 40px;\n overflow: hidden;\n width: 100%;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n"])));
16046
+ var ProductActionButton = styled(Button)(_templateObject10$4 || (_templateObject10$4 = _taggedTemplateLiteralLoose(["\n && {\n background-color: ", ";\n color: #ffffff;\n border-radius: 10px;\n font-weight: 500;\n }\n"])), function (_ref2) {
16047
+ var primaryColor = _ref2.primaryColor;
16048
+ return primaryColor != null ? primaryColor : '#000000';
16049
+ });
16050
+ var OutOfStockButton = styled(Button)(_templateObject11$3 || (_templateObject11$3 = _taggedTemplateLiteralLoose(["\n && {\n color: #ffffff;\n border-radius: 10px;\n font-weight: 500;\n }\n"])));
16051
+ var ProductCard = function ProductCard(_ref3) {
16052
+ var _product$standardPric, _product$retailPrice, _product$standardPric2;
16053
+ var product = _ref3.product,
16054
+ styleOverrides = _ref3.styleOverrides,
16055
+ onRemoveFromWishlist = _ref3.onRemoveFromWishlist,
16056
+ primaryColor = _ref3.primaryColor,
16057
+ imgNotFoundUrl = _ref3.imgNotFoundUrl,
16058
+ allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref3.allowToProcessInvoiceForOutOfStockProductsEcommerce,
16059
+ onAddToCart = _ref3.onAddToCart,
16060
+ doNotShowPrice = _ref3.doNotShowPrice;
16061
+ var router = useRouter();
16062
+ var _useState2 = useState(false),
16063
+ deleteLoading = _useState2[0],
16064
+ setDeleteLoading = _useState2[1];
16065
+ var _useState3 = useState(false),
16066
+ addToCartLoading = _useState3[0],
16067
+ setAddToCartLoading = _useState3[1];
16068
+ var removeFromWishlist = function removeFromWishlist(productId) {
16069
+ try {
16070
+ if (typeof onRemoveFromWishlist !== 'function') return Promise.resolve();
16071
+ setDeleteLoading(true);
16072
+ var _temp = _finallyRethrows(function () {
16073
+ return _catch(function () {
16074
+ return Promise.resolve(onRemoveFromWishlist(productId)).then(function () {});
16075
+ }, function (error) {
16076
+ console.log('error', error);
16077
+ });
16078
+ }, function (_wasThrown, _result) {
16079
+ setDeleteLoading(false);
16080
+ if (_wasThrown) throw _result;
16081
+ return _result;
16082
+ });
16083
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
16084
+ } catch (e) {
16085
+ return Promise.reject(e);
16086
+ }
16087
+ };
16088
+ var onChangeQuantity = function onChangeQuantity(product) {
16089
+ try {
16090
+ if (!onAddToCart || typeof onAddToCart !== 'function') return Promise.resolve();
16091
+ var _temp2 = _finallyRethrows(function () {
16092
+ return _catch(function () {
16093
+ setAddToCartLoading(true);
16094
+ return Promise.resolve(onAddToCart(omit$1(product, WISHLIST_ITEM_OMIT_KEYS))).then(function () {});
16095
+ }, function () {});
16096
+ }, function (_wasThrown2, _result2) {
16097
+ setAddToCartLoading(false);
16098
+ if (_wasThrown2) throw _result2;
16099
+ return _result2;
16100
+ });
16101
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
16102
+ } catch (e) {
16103
+ return Promise.reject(e);
16104
+ }
16105
+ };
16106
+ return /*#__PURE__*/React__default.createElement(ProductCardWrapper, {
16107
+ style: getStyleOverride(styleOverrides, 'productCardWrapper', 'ProductCardWrapper'),
16108
+ onClick: function onClick() {
16109
+ var _ref4, _product$urlAlias;
16110
+ router.push("/product-details/" + paramCase((_ref4 = (_product$urlAlias = product.urlAlias) != null ? _product$urlAlias : product.alias) != null ? _ref4 : product.productName) + "?id=" + (product === null || product === void 0 ? void 0 : product.productId));
16111
+ }
16112
+ }, /*#__PURE__*/React__default.createElement(DeleteButton, {
16113
+ type: "button",
16114
+ className: "wishlist-delete-btn",
16115
+ "aria-label": "Remove from wishlist",
16116
+ style: getStyleOverride(styleOverrides, 'deleteButton', 'DeleteButton'),
16117
+ onClick: function onClick(e) {
16118
+ try {
16119
+ var _temp3 = _catch(function () {
16120
+ e.stopPropagation();
16121
+ return Promise.resolve(removeFromWishlist(product === null || product === void 0 ? void 0 : product.productId)).then(function () {});
16122
+ }, function (error) {
16123
+ console.log('error', error);
16124
+ });
16125
+ return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
16126
+ } catch (e) {
16127
+ return Promise.reject(e);
16128
+ }
16129
+ }
16130
+ }, deleteLoading ? /*#__PURE__*/React__default.createElement(CircularProgress, {
16131
+ size: 20
16132
+ }) : /*#__PURE__*/React__default.createElement(AiOutlineDelete, {
16133
+ style: {
16134
+ fontSize: 18
16135
+ }
16136
+ })), /*#__PURE__*/React__default.createElement(Image$3, {
16137
+ src: getProductImage(product === null || product === void 0 ? void 0 : product.imageUrl, imgNotFoundUrl),
16138
+ alt: (product === null || product === void 0 ? void 0 : product.productName) || 'Product',
16139
+ width: 160,
16140
+ height: 160,
16141
+ objectFit: "contain"
16142
+ }), !doNotShowPrice ? /*#__PURE__*/React__default.createElement(PriceContainer, {
16143
+ style: getStyleOverride(styleOverrides, 'priceContainer', 'PriceContainer')
16144
+ }, (product === null || product === void 0 ? void 0 : product.standardPrice) > (product === null || product === void 0 ? void 0 : product.retailPrice) ? /*#__PURE__*/React__default.createElement(DiscountPriceRow, {
16145
+ style: getStyleOverride(styleOverrides, 'discountPriceRow', 'DiscountPriceRow')
16146
+ }, /*#__PURE__*/React__default.createElement("del", null, "$" + (product === null || product === void 0 ? void 0 : (_product$standardPric = product.standardPrice) === null || _product$standardPric === void 0 ? void 0 : _product$standardPric.toFixed(2))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", null, "$" + (product === null || product === void 0 ? void 0 : (_product$retailPrice = product.retailPrice) === null || _product$retailPrice === void 0 ? void 0 : _product$retailPrice.toFixed(2))))) : /*#__PURE__*/React__default.createElement("div", null, "$" + (product === null || product === void 0 ? void 0 : (_product$standardPric2 = product.standardPrice) === null || _product$standardPric2 === void 0 ? void 0 : _product$standardPric2.toFixed(2)))) : /*#__PURE__*/React__default.createElement("div", null), /*#__PURE__*/React__default.createElement(ProductName$2, {
16147
+ style: getStyleOverride(styleOverrides, 'productName', 'ProductName')
16148
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("div", null, (product === null || product === void 0 ? void 0 : product.productStock) > 0 || product !== null && product !== void 0 && product.hasChildProduct ? /*#__PURE__*/React__default.createElement(ProductActionButton, {
16149
+ variant: "contained",
16150
+ color: "primary",
16151
+ primaryColor: primaryColor,
16152
+ style: getStyleOverride(styleOverrides, 'productActionButton', 'ProductActionButton'),
16153
+ onClick: function onClick(e) {
16154
+ e.stopPropagation();
16155
+ e.preventDefault();
16156
+ if (product !== null && product !== void 0 && product.hasChildProducts) {
16157
+ router.push("/products/" + (product === null || product === void 0 ? void 0 : product.productId));
16158
+ } else {
16159
+ if (onAddToCart) {
16160
+ var _product$quantity;
16161
+ onChangeQuantity(_extends({}, product, {
16162
+ quantity: checkMinMaxQty({
16163
+ quantity: (_product$quantity = product === null || product === void 0 ? void 0 : product.quantity) != null ? _product$quantity : 1,
16164
+ product: product,
16165
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
16166
+ })
16167
+ }));
16168
+ }
16169
+ }
16170
+ }
16171
+ }, product !== null && product !== void 0 && product.hasChildProduct ? 'Select Options' : addToCartLoading ? 'Adding...' : 'Add to Cart') : /*#__PURE__*/React__default.createElement(OutOfStockButton, {
16172
+ variant: "contained",
16173
+ color: "primary",
16174
+ disabled: true,
16175
+ style: getStyleOverride(styleOverrides, 'outOfStockButton', 'OutOfStockButton'),
16176
+ onClick: function onClick(e) {
16177
+ return e.stopPropagation();
16178
+ }
16179
+ }, "Out Of stock")));
16180
+ };
16181
+
16182
+ export { APIStaticPage, AccountDetails, BrandList, BrandStock, Breakpoint, CartDrawer, CartPageComponent, CheckoutPageComponent, ContactUsForm, GTagManager, HomeBanner, MaintenancePage, NewArrivalPage, OutOfStock, QuickOrder, RenderTawk, SingleBanner, SnowfallComponent as Snowfall, StaticPage, StaticPageList, SwitchUser, ThankYou, Variant, VendorAccountDetails as VendorAccount, WishlistComponent as Wishlist, useGridSize, useWindowSize };
15835
16183
  //# sourceMappingURL=index.modern.js.map