tabexseriescomponents 0.0.478 → 0.0.480

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.cjs.js CHANGED
@@ -46515,92 +46515,115 @@ var Newsletterincenter = function Newsletterincenter(props) {
46515
46515
  function ownKeys$1o(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
46516
46516
  function _objectSpread$1o(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1o(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1o(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
46517
46517
  var CardsSection2 = function CardsSection2(props) {
46518
+ var refscr = /*#__PURE__*/React.createRef();
46518
46519
  var _useInView = reactIntersectionObserver.useInView();
46519
46520
  _useInView.ref;
46520
- var inView = _useInView.inView;
46521
+ _useInView.inView;
46521
46522
  var StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
46522
46523
  props.actions.lang;
46523
46524
  var langdetect = props.actions.langdetect;
46524
46525
  var fetchcustomercartQueryContext = props.actions.fetchcustomercartQueryContext;
46525
46526
  var favoriteprojectscountContext = props.actions.favoriteprojectscountContext;
46527
+ props.actions.routingcountext;
46528
+ props.actions.StaticPagesLinksContext;
46526
46529
  var ProductFilterObjContext = props.actions.ProductFilterObjContext;
46527
46530
  var setProductFilterObjContext = props.actions.setProductFilterObjContext;
46528
46531
  var TabexSectionsComponentsContext = props.actions.TabexSectionsComponentsContext;
46529
46532
  var FetchQueriesEngineContext = props.actions.FetchQueriesEngineContext;
46530
46533
  var setFetchQueriesEngineContext = props.actions.setFetchQueriesEngineContext;
46531
- var SearchHeaderMutationContext = props.actions.SearchHeaderMutationContext;
46532
46534
  var fetchProductsQuery = props.actions.fetchProductsQuery;
46533
46535
  var fetchcollectionsQueryContext = props.actions.fetchcollectionsQueryContext;
46534
46536
  var setParentCollectionsForCollectionQueryArr = props.actions.setParentCollectionsForCollectionQueryArr;
46537
+ props.actions.ParentCollectionsForCollectionQueryArr;
46535
46538
  var setfetchingtype = props.actions.setfetchingtype;
46536
46539
  var fetchingtype = props.actions.fetchingtype;
46537
- props.actions.AddtoCartMutationContext;
46538
- props.actions.setShowProductInfoModalContext;
46539
- props.actions.authdetailsContext;
46540
- props.actions.productfiltercontext;
46541
- props.actions.setproductfiltercontext;
46540
+ props.actions.addtofavoritescontext;
46541
+ var fetchAuthorizationQueryContext = props.actions.fetchAuthorizationQueryContext;
46542
+ var fetchCategoriesQueryContext = props.actions.fetchCategoriesQueryContext;
46543
+ var FetchVendorsQuery = props.actions.FetchVendorsQuery;
46544
+ props.actions.ikimagecredcontext;
46545
+ props.actions.sortbycontext;
46546
+ props.actions.setsortbycontext;
46547
+ var _useState = React.useState(false),
46548
+ _useState2 = _slicedToArray__default["default"](_useState, 2);
46549
+ _useState2[0];
46550
+ _useState2[1];
46542
46551
  var actions = props.actions;
46543
- var _useState = React.useState(''),
46544
- _useState2 = _slicedToArray__default["default"](_useState, 2),
46545
- sectionproperties = _useState2[0],
46546
- setsectionproperties = _useState2[1];
46547
- var _useState3 = React.useState([]),
46552
+ var _useState3 = React.useState(''),
46548
46553
  _useState4 = _slicedToArray__default["default"](_useState3, 2),
46549
- cardsarray = _useState4[0],
46550
- setcardsarray = _useState4[1];
46551
- var _useState5 = React.useState(''),
46554
+ sectionproperties = _useState4[0],
46555
+ setsectionproperties = _useState4[1];
46556
+ var _useState5 = React.useState([]),
46552
46557
  _useState6 = _slicedToArray__default["default"](_useState5, 2),
46553
- searchinput = _useState6[0];
46554
- _useState6[1];
46555
- React__default["default"].useEffect(function () {
46556
- if (inView) {
46557
- fetchProductsQuery.fetchNextPage();
46558
- }
46559
- }, [inView]);
46560
- var _useState7 = React.useState({
46558
+ cardsarray = _useState6[0],
46559
+ setcardsarray = _useState6[1];
46560
+ var _useState7 = React.useState(''),
46561
+ _useState8 = _slicedToArray__default["default"](_useState7, 2),
46562
+ sectionitem = _useState8[0],
46563
+ setsectionitem = _useState8[1];
46564
+ var _useState9 = React.useState({
46561
46565
  productfetchingtype: 'Random',
46562
- collectionid: ''
46566
+ collectionid: '',
46567
+ grouptype: ''
46563
46568
  }),
46564
- _useState8 = _slicedToArray__default["default"](_useState7, 2),
46565
- ProductsFetchingTypeSectionObj = _useState8[0],
46566
- setProductsFetchingTypeSectionObj = _useState8[1];
46569
+ _useState10 = _slicedToArray__default["default"](_useState9, 2),
46570
+ ProductsFetchingTypeSectionObj = _useState10[0],
46571
+ setProductsFetchingTypeSectionObj = _useState10[1];
46572
+ var _useState11 = React.useState([]),
46573
+ _useState12 = _slicedToArray__default["default"](_useState11, 2);
46574
+ _useState12[0];
46575
+ var setmaincontainerarrayofobjs = _useState12[1];
46576
+ var _useState13 = React.useState(12),
46577
+ _useState14 = _slicedToArray__default["default"](_useState13, 2);
46578
+ _useState14[0];
46579
+ var setperpageItems = _useState14[1];
46580
+ props.actions.AddtoCartMutationContext;
46567
46581
  React.useEffect(function () {
46582
+ var productfilerobjtemp = ProductFilterObjContext;
46583
+ if (props.filterparamsprops != undefined) {
46584
+ var filterpar = decodeURIComponent(props.filterparamsprops);
46585
+ var filterparsed = JSON.parse(filterpar);
46586
+ if (filterparsed != undefined) {
46587
+ productfilerobjtemp = filterparsed;
46588
+ setProductFilterObjContext(filterparsed);
46589
+ }
46590
+ }
46568
46591
  StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
46569
46592
  if (sectionitem.sectionid == props.sectionidprops) {
46570
46593
  var secpropobj = {};
46594
+ setsectionitem(sectionitem);
46571
46595
  sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
46572
46596
  secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
46573
46597
  });
46574
46598
  setsectionproperties(_objectSpread$1o({}, secpropobj));
46575
46599
  if (props.srcfromprops == 'GeneralProductsComponent') {
46576
46600
  setfetchingtype('products');
46601
+ var lcproductfetchingtype = 'Random';
46602
+ if (productfilerobjtemp.ProductFetchingType != undefined && productfilerobjtemp.ProductFetchingType != null && productfilerobjtemp.ProductFetchingType.length != 0) {
46603
+ lcproductfetchingtype = productfilerobjtemp.ProductFetchingType;
46604
+ }
46577
46605
  setProductsFetchingTypeSectionObj({
46578
- productfetchingtype: 'Random',
46579
- collectionid: props.collectionidprops
46606
+ productfetchingtype: lcproductfetchingtype,
46607
+ collectionid: props.collectionidprops,
46608
+ grouptype: props.grouptypeprops,
46609
+ grouptyperefid: props.grouptyperefidprops
46580
46610
  });
46611
+ } else if (props.srcfromprops == 'InnerGroups' || props.srcfromprops == 'InnerCategory' || props.srcfromprops == 'InnerParentCollection') {
46612
+ setfetchingtype(props.grouptypeprops);
46613
+ } else if (props.srcfromprops == 'Innervendor') {
46614
+ setfetchingtype('vendors');
46581
46615
  } else {
46582
46616
  setfetchingtype(sectionitem.fetchingtype);
46583
46617
  setProductsFetchingTypeSectionObj({
46584
46618
  productfetchingtype: sectionitem.productsfetchingtype,
46585
- collectionid: sectionitem.productsfetchingtypeCollectioncollectionid
46619
+ collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
46620
+ grouptype: props.grouptypeprops,
46621
+ grouptyperefid: props.grouptyperefidprops
46586
46622
  });
46587
46623
  }
46588
46624
  }
46589
46625
  });
46590
46626
  }, [StatePagePropertiesContext]);
46591
- React.useEffect(function () {
46592
- SearchHeaderMutationContext.reset();
46593
- var delayDebounceFn = setTimeout(function () {
46594
- if (searchinput.length != 0) {
46595
- SearchHeaderMutationContext.mutate({
46596
- SearchHeaderValue: searchinput
46597
- });
46598
- }
46599
- }, 1000);
46600
- return function () {
46601
- return clearTimeout(delayDebounceFn);
46602
- };
46603
- }, [searchinput]);
46604
46627
  React.useEffect(function () {
46605
46628
  if (sectionproperties.length != 0) {
46606
46629
  if (cardsarray.length == 0) {
@@ -46617,16 +46640,19 @@ var CardsSection2 = function CardsSection2(props) {
46617
46640
  });
46618
46641
  cardobjassigner(allpagesarr);
46619
46642
  }
46643
+ } else if (fetchingtype == 'vendors') {
46644
+ if (FetchVendorsQuery.isSuccess) {
46645
+ var _FetchVendorsQuery$da;
46646
+ cardobjassigner(FetchVendorsQuery === null || FetchVendorsQuery === void 0 || (_FetchVendorsQuery$da = FetchVendorsQuery.data) === null || _FetchVendorsQuery$da === void 0 || (_FetchVendorsQuery$da = _FetchVendorsQuery$da.data) === null || _FetchVendorsQuery$da === void 0 ? void 0 : _FetchVendorsQuery$da.vendors);
46647
+ }
46620
46648
  }
46621
46649
  }
46622
46650
  }
46623
46651
  }, [sectionproperties]);
46624
46652
  React.useEffect(function () {
46625
- if (fetchingtype.length != 0) {
46653
+ if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
46626
46654
  var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
46627
46655
  if (fetchingtype == 'collections') {
46628
- // tempFetchQueriesEngineContext.collections = true;
46629
-
46630
46656
  if (ProductsFetchingTypeSectionObj.collectionid == 'all' || ProductsFetchingTypeSectionObj.collectionid == null || ProductsFetchingTypeSectionObj.collectionid == undefined) {
46631
46657
  setParentCollectionsForCollectionQueryArr('all');
46632
46658
  } else {
@@ -46636,34 +46662,166 @@ var CardsSection2 = function CardsSection2(props) {
46636
46662
  if (fetchingtype == 'products') {
46637
46663
  var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
46638
46664
  tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
46639
- tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
46665
+ if (ProductsFetchingTypeSectionObj.grouptype == 'collections' || ProductsFetchingTypeSectionObj.grouptype == 'categories' || ProductsFetchingTypeSectionObj.grouptype == 'parentcollections') ; else {
46666
+ if (tempfetchproductsfilerobjcontext.collections != undefined) {
46667
+ tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
46668
+ }
46669
+ }
46670
+ tempfetchproductsfilerobjcontext.grouptype = ProductsFetchingTypeSectionObj.grouptype;
46671
+ tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
46640
46672
  setProductFilterObjContext(_objectSpread$1o({}, tempfetchproductsfilerobjcontext));
46641
46673
  }
46642
46674
  setFetchQueriesEngineContext(_objectSpread$1o({}, tempFetchQueriesEngineContext));
46643
46675
  }
46644
46676
  }, [fetchingtype, ProductsFetchingTypeSectionObj]);
46677
+ React.useEffect(function () {
46678
+ if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
46679
+ if (fetchingtype == 'categories') {
46680
+ var categories = [];
46681
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46682
+ var _fetchCategoriesQuery;
46683
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery === void 0 || (_fetchCategoriesQuery = _fetchCategoriesQuery.data) === null || _fetchCategoriesQuery === void 0 ? void 0 : _fetchCategoriesQuery.categories;
46684
+ }
46685
+ cardobjassigner(categories);
46686
+ }
46687
+ if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
46688
+ var _categories;
46689
+ var categories = [];
46690
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46691
+ var _fetchCategoriesQuery2;
46692
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery2 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery2 === void 0 || (_fetchCategoriesQuery2 = _fetchCategoriesQuery2.data) === null || _fetchCategoriesQuery2 === void 0 ? void 0 : _fetchCategoriesQuery2.categories;
46693
+ }
46694
+ // if (fetchAuthorizationQueryContext?.isSuccess) {
46695
+ // var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
46696
+ // alert(JSON.stringify(categories));
46697
+ var parentcollections = [];
46698
+ (_categories = categories) === null || _categories === void 0 || _categories.forEach(function (catitem, catindex) {
46699
+ catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
46700
+ if (parentcolitem.isshowntocustomers == 1) {
46701
+ parentcolitem.categoryid = catitem.categoryid;
46702
+ parentcollections.push(parentcolitem);
46703
+ }
46704
+ });
46705
+ });
46706
+ if (fetchingtype == 'parentcollections') {
46707
+ if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
46708
+ var arrafterfilter = [];
46709
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46710
+ if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
46711
+ arrafterfilter.push(parentcolitem);
46712
+ }
46713
+ });
46714
+ parentcollections = arrafterfilter;
46715
+ }
46716
+ if (props.collectionidprops != null && props.collectionidprops != undefined && props.collectionidprops != 'all') {
46717
+ var arrafterfilter = [];
46718
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46719
+ if (parentcolitem.categoryid == props.collectionidprops) {
46720
+ arrafterfilter.push(parentcolitem);
46721
+ }
46722
+ });
46723
+ parentcollections = arrafterfilter;
46724
+ }
46725
+ }
46726
+ if (fetchingtype == 'innercategories') {
46727
+ var arrafterfilter = [];
46728
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46729
+ if (parentcolitem.categoryid == props.collectionidprops) {
46730
+ arrafterfilter.push(parentcolitem);
46731
+ }
46732
+ });
46733
+ parentcollections = arrafterfilter;
46734
+ }
46735
+ cardobjassigner(parentcollections);
46736
+ // }
46737
+ } else if (fetchingtype == 'innerparentcollections') {
46738
+ var _categories2;
46739
+ var categories = [];
46740
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46741
+ var _fetchCategoriesQuery3;
46742
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery3 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery3 === void 0 || (_fetchCategoriesQuery3 = _fetchCategoriesQuery3.data) === null || _fetchCategoriesQuery3 === void 0 ? void 0 : _fetchCategoriesQuery3.categories;
46743
+ }
46744
+ // if (fetchAuthorizationQueryContext?.isSuccess) {
46745
+ // var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
46746
+ var collections = [];
46747
+ (_categories2 = categories) === null || _categories2 === void 0 || _categories2.forEach(function (catitem, catindex) {
46748
+ catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
46749
+ var _parentcolitem$collec;
46750
+ parentcolitem.categoryid = catitem.categoryid;
46751
+ parentcolitem === null || parentcolitem === void 0 || (_parentcolitem$collec = parentcolitem.collections) === null || _parentcolitem$collec === void 0 || _parentcolitem$collec.forEach(function (collitem, colindex) {
46752
+ if (collitem.isshowntocustomers == 1) {
46753
+ collitem.parentcollectionid = parentcolitem.parentcollectionid;
46754
+ collections.push(collitem);
46755
+ }
46756
+ });
46757
+ });
46758
+ });
46759
+ if (fetchingtype == 'innerparentcollections') {
46760
+ var collectionsafterfilter = [];
46761
+ collections.forEach(function (colitem, colindex) {
46762
+ if (colitem.parentcollectionid == props.collectionidprops) {
46763
+ var iscollexists = false;
46764
+ collectionsafterfilter.forEach(function (existcolitem) {
46765
+ if (colitem.collectionid == existcolitem.collectionid) {
46766
+ iscollexists = true;
46767
+ }
46768
+ });
46769
+ if (iscollexists == false) {
46770
+ collectionsafterfilter.push(colitem);
46771
+ }
46772
+ }
46773
+ });
46774
+ collections = collectionsafterfilter;
46775
+ }
46776
+ cardobjassigner(collections);
46777
+ // }
46778
+ }
46779
+ }
46780
+ }, [fetchingtype, ProductsFetchingTypeSectionObj, fetchCategoriesQueryContext.isSuccess]);
46645
46781
  React.useEffect(function () {
46646
46782
  if (fetchingtype == 'products') {
46647
46783
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
46648
- var _fetchProductsQuery$d2;
46784
+ var _fetchProductsQuery$d2, _fetchProductsQuery$d3, _fetchProductsQuery$d4, _fetchProductsQuery$d5;
46649
46785
  var allpagesarr = [];
46650
46786
  fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d2 = fetchProductsQuery.data) === null || _fetchProductsQuery$d2 === void 0 || (_fetchProductsQuery$d2 = _fetchProductsQuery$d2.data) === null || _fetchProductsQuery$d2 === void 0 || (_fetchProductsQuery$d2 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d2 === void 0 || _fetchProductsQuery$d2.forEach(function (item) {
46651
46787
  allpagesarr.push(item);
46652
46788
  });
46789
+ if ((fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d3 = fetchProductsQuery.data) === null || _fetchProductsQuery$d3 === void 0 || (_fetchProductsQuery$d3 = _fetchProductsQuery$d3.data) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.PerPageProducts) != undefined && (fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 || (_fetchProductsQuery$d4 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : _fetchProductsQuery$d4.PerPageProducts) != null && (fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d5 = fetchProductsQuery.data) === null || _fetchProductsQuery$d5 === void 0 || (_fetchProductsQuery$d5 = _fetchProductsQuery$d5.data) === null || _fetchProductsQuery$d5 === void 0 || (_fetchProductsQuery$d5 = _fetchProductsQuery$d5.PerPageProducts) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : _fetchProductsQuery$d5.length) != 0) {
46790
+ var _fetchProductsQuery$d6;
46791
+ setperpageItems(fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d6 = fetchProductsQuery.data) === null || _fetchProductsQuery$d6 === void 0 || (_fetchProductsQuery$d6 = _fetchProductsQuery$d6.data) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.PerPageProducts);
46792
+ }
46653
46793
  cardobjassigner(allpagesarr);
46654
46794
  }
46655
46795
  }
46656
- }, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data, fetchcustomercartQueryContext.dataUpdatedAt]);
46796
+ }, [fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.isSuccess, fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.dataUpdatedAt, fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.data, fetchcustomercartQueryContext === null || fetchcustomercartQueryContext === void 0 ? void 0 : fetchcustomercartQueryContext.dataUpdatedAt]);
46657
46797
  React.useEffect(function () {
46658
46798
  if (fetchingtype == 'collections') {
46659
46799
  if (fetchcollectionsQueryContext.isSuccess) {
46660
46800
  cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
46661
46801
  }
46662
46802
  }
46663
- }, [fetchcollectionsQueryContext.isSuccess]);
46803
+ }, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess, fetchcollectionsQueryContext.data]);
46804
+ React.useEffect(function () {
46805
+ if (fetchingtype == 'vendors') {
46806
+ if (FetchVendorsQuery.isSuccess) {
46807
+ if (FetchVendorsQuery.data.data.vendors != undefined && FetchVendorsQuery.data.data.vendors.length != 0) {
46808
+ var _FetchVendorsQuery$da2;
46809
+ cardobjassigner(FetchVendorsQuery === null || FetchVendorsQuery === void 0 || (_FetchVendorsQuery$da2 = FetchVendorsQuery.data) === null || _FetchVendorsQuery$da2 === void 0 || (_FetchVendorsQuery$da2 = _FetchVendorsQuery$da2.data) === null || _FetchVendorsQuery$da2 === void 0 ? void 0 : _FetchVendorsQuery$da2.vendors);
46810
+ }
46811
+ }
46812
+ }
46813
+ }, [FetchVendorsQuery.isSuccess]);
46664
46814
  React.useEffect(function () {
46665
46815
  favassigner();
46666
46816
  }, [favoriteprojectscountContext]);
46817
+ React.useEffect(function () {
46818
+ if (sectionproperties.length != 0 && sectionproperties.maincontainerarrayofobjs != undefined) {
46819
+ var maincontainerarrayofobjsparsed = JSON.parse(sectionproperties.maincontainerarrayofobjs);
46820
+ if (Array.isArray(maincontainerarrayofobjsparsed)) {
46821
+ setmaincontainerarrayofobjs(_toConsumableArray__default["default"](maincontainerarrayofobjsparsed));
46822
+ }
46823
+ }
46824
+ }, [sectionproperties]);
46667
46825
  var favassigner = function favassigner() {
46668
46826
  if (fetchingtype == 'products') {
46669
46827
  if (cardsarray.length != 0) {
@@ -46750,10 +46908,10 @@ var CardsSection2 = function CardsSection2(props) {
46750
46908
  cardobj.sku = arrayItem.productinfo.sku;
46751
46909
  if (langdetect == 'en') {
46752
46910
  var _fetchAuthorizationQu;
46753
- cardobj.currencyname = (_fetchAuthorizationQu = fetchAuthorizationQueryContext) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
46911
+ cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
46754
46912
  } else {
46755
46913
  var _fetchAuthorizationQu2;
46756
- cardobj.currencyname = (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
46914
+ cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
46757
46915
  }
46758
46916
  if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
46759
46917
  favoriteprojectscountContext.forEach(function (favitem, favindex) {
@@ -46988,7 +47146,8 @@ var CardsSection2 = function CardsSection2(props) {
46988
47146
  className: "row m-0 d-flex w-100 justify-content-center mb-md-4 ",
46989
47147
  style: {
46990
47148
  zIndex: 2
46991
- }
47149
+ },
47150
+ ref: refscr
46992
47151
  }, /*#__PURE__*/React__default["default"].createElement("div", {
46993
47152
  className: "col-lg-12 p-0 d-flex justify-content-center"
46994
47153
  }, sectionproperties.length != 0 && /*#__PURE__*/React__default["default"].createElement("div", {
@@ -55537,7 +55696,7 @@ var DynamicForm = function DynamicForm(props) {
55537
55696
  }, "Choose"), decoditems === null || decoditems === void 0 ? void 0 : decoditems.map(function (sitem) {
55538
55697
  return /*#__PURE__*/React__default["default"].createElement("option", {
55539
55698
  value: sitem.optionname_en
55540
- }, sitem.optionname_en);
55699
+ }, langdetect == 'en' ? sitem.optionname_en : sitem.optionname_ar);
55541
55700
  }))));
55542
55701
  }
55543
55702
  }
@@ -64427,7 +64586,7 @@ var Card23 = function Card23(props) {
64427
64586
  publicKey: ikimagecredcontext === null || ikimagecredcontext === void 0 ? void 0 : ikimagecredcontext.ikimagepublickey,
64428
64587
  path: '/tr:w-' + sectionproperties.imagetr_w + ',h-' + sectionproperties.imagetr_h + '/' + item.image,
64429
64588
  style: {
64430
- opacity: item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' && item.hasvariants == 0 ? sectionproperties.outofstockimageopcity : 1,
64589
+ opacity: item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' ? sectionproperties.outofstockimageopcity : 1,
64431
64590
  width: sectionproperties.imageInnerWidth_Height + '%',
64432
64591
  height: sectionproperties.imageInnerWidth_Height + '%',
64433
64592
  objectFit: sectionproperties.bgcovercontain == 'Cover' ? 'cover' : 'contain',
@@ -64505,7 +64664,7 @@ var Card23 = function Card23(props) {
64505
64664
  fontSize: sectionproperties.pillfontSize + 'px',
64506
64665
  direction: 'ltr'
64507
64666
  }
64508
- }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%')), item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' && item.hasvariants == 0 && /*#__PURE__*/React__default["default"].createElement("div", {
64667
+ }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%')), item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' == 0 && /*#__PURE__*/React__default["default"].createElement("div", {
64509
64668
  "class": "".concat(cardsstyles2.outstockbadge) + ' allcentered '
64510
64669
  }, /*#__PURE__*/React__default["default"].createElement("p", {
64511
64670
  "class": "m-0 p-0"
package/dist/index.esm.js CHANGED
@@ -46466,92 +46466,115 @@ var Newsletterincenter = function Newsletterincenter(props) {
46466
46466
  function ownKeys$1o(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
46467
46467
  function _objectSpread$1o(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1o(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1o(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
46468
46468
  var CardsSection2 = function CardsSection2(props) {
46469
+ var refscr = /*#__PURE__*/createRef();
46469
46470
  var _useInView = useInView();
46470
46471
  _useInView.ref;
46471
- var inView = _useInView.inView;
46472
+ _useInView.inView;
46472
46473
  var StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
46473
46474
  props.actions.lang;
46474
46475
  var langdetect = props.actions.langdetect;
46475
46476
  var fetchcustomercartQueryContext = props.actions.fetchcustomercartQueryContext;
46476
46477
  var favoriteprojectscountContext = props.actions.favoriteprojectscountContext;
46478
+ props.actions.routingcountext;
46479
+ props.actions.StaticPagesLinksContext;
46477
46480
  var ProductFilterObjContext = props.actions.ProductFilterObjContext;
46478
46481
  var setProductFilterObjContext = props.actions.setProductFilterObjContext;
46479
46482
  var TabexSectionsComponentsContext = props.actions.TabexSectionsComponentsContext;
46480
46483
  var FetchQueriesEngineContext = props.actions.FetchQueriesEngineContext;
46481
46484
  var setFetchQueriesEngineContext = props.actions.setFetchQueriesEngineContext;
46482
- var SearchHeaderMutationContext = props.actions.SearchHeaderMutationContext;
46483
46485
  var fetchProductsQuery = props.actions.fetchProductsQuery;
46484
46486
  var fetchcollectionsQueryContext = props.actions.fetchcollectionsQueryContext;
46485
46487
  var setParentCollectionsForCollectionQueryArr = props.actions.setParentCollectionsForCollectionQueryArr;
46488
+ props.actions.ParentCollectionsForCollectionQueryArr;
46486
46489
  var setfetchingtype = props.actions.setfetchingtype;
46487
46490
  var fetchingtype = props.actions.fetchingtype;
46488
- props.actions.AddtoCartMutationContext;
46489
- props.actions.setShowProductInfoModalContext;
46490
- props.actions.authdetailsContext;
46491
- props.actions.productfiltercontext;
46492
- props.actions.setproductfiltercontext;
46491
+ props.actions.addtofavoritescontext;
46492
+ var fetchAuthorizationQueryContext = props.actions.fetchAuthorizationQueryContext;
46493
+ var fetchCategoriesQueryContext = props.actions.fetchCategoriesQueryContext;
46494
+ var FetchVendorsQuery = props.actions.FetchVendorsQuery;
46495
+ props.actions.ikimagecredcontext;
46496
+ props.actions.sortbycontext;
46497
+ props.actions.setsortbycontext;
46498
+ var _useState = useState(false),
46499
+ _useState2 = _slicedToArray(_useState, 2);
46500
+ _useState2[0];
46501
+ _useState2[1];
46493
46502
  var actions = props.actions;
46494
- var _useState = useState(''),
46495
- _useState2 = _slicedToArray(_useState, 2),
46496
- sectionproperties = _useState2[0],
46497
- setsectionproperties = _useState2[1];
46498
- var _useState3 = useState([]),
46503
+ var _useState3 = useState(''),
46499
46504
  _useState4 = _slicedToArray(_useState3, 2),
46500
- cardsarray = _useState4[0],
46501
- setcardsarray = _useState4[1];
46502
- var _useState5 = useState(''),
46505
+ sectionproperties = _useState4[0],
46506
+ setsectionproperties = _useState4[1];
46507
+ var _useState5 = useState([]),
46503
46508
  _useState6 = _slicedToArray(_useState5, 2),
46504
- searchinput = _useState6[0];
46505
- _useState6[1];
46506
- React.useEffect(function () {
46507
- if (inView) {
46508
- fetchProductsQuery.fetchNextPage();
46509
- }
46510
- }, [inView]);
46511
- var _useState7 = useState({
46509
+ cardsarray = _useState6[0],
46510
+ setcardsarray = _useState6[1];
46511
+ var _useState7 = useState(''),
46512
+ _useState8 = _slicedToArray(_useState7, 2),
46513
+ sectionitem = _useState8[0],
46514
+ setsectionitem = _useState8[1];
46515
+ var _useState9 = useState({
46512
46516
  productfetchingtype: 'Random',
46513
- collectionid: ''
46517
+ collectionid: '',
46518
+ grouptype: ''
46514
46519
  }),
46515
- _useState8 = _slicedToArray(_useState7, 2),
46516
- ProductsFetchingTypeSectionObj = _useState8[0],
46517
- setProductsFetchingTypeSectionObj = _useState8[1];
46520
+ _useState10 = _slicedToArray(_useState9, 2),
46521
+ ProductsFetchingTypeSectionObj = _useState10[0],
46522
+ setProductsFetchingTypeSectionObj = _useState10[1];
46523
+ var _useState11 = useState([]),
46524
+ _useState12 = _slicedToArray(_useState11, 2);
46525
+ _useState12[0];
46526
+ var setmaincontainerarrayofobjs = _useState12[1];
46527
+ var _useState13 = useState(12),
46528
+ _useState14 = _slicedToArray(_useState13, 2);
46529
+ _useState14[0];
46530
+ var setperpageItems = _useState14[1];
46531
+ props.actions.AddtoCartMutationContext;
46518
46532
  useEffect(function () {
46533
+ var productfilerobjtemp = ProductFilterObjContext;
46534
+ if (props.filterparamsprops != undefined) {
46535
+ var filterpar = decodeURIComponent(props.filterparamsprops);
46536
+ var filterparsed = JSON.parse(filterpar);
46537
+ if (filterparsed != undefined) {
46538
+ productfilerobjtemp = filterparsed;
46539
+ setProductFilterObjContext(filterparsed);
46540
+ }
46541
+ }
46519
46542
  StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
46520
46543
  if (sectionitem.sectionid == props.sectionidprops) {
46521
46544
  var secpropobj = {};
46545
+ setsectionitem(sectionitem);
46522
46546
  sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
46523
46547
  secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
46524
46548
  });
46525
46549
  setsectionproperties(_objectSpread$1o({}, secpropobj));
46526
46550
  if (props.srcfromprops == 'GeneralProductsComponent') {
46527
46551
  setfetchingtype('products');
46552
+ var lcproductfetchingtype = 'Random';
46553
+ if (productfilerobjtemp.ProductFetchingType != undefined && productfilerobjtemp.ProductFetchingType != null && productfilerobjtemp.ProductFetchingType.length != 0) {
46554
+ lcproductfetchingtype = productfilerobjtemp.ProductFetchingType;
46555
+ }
46528
46556
  setProductsFetchingTypeSectionObj({
46529
- productfetchingtype: 'Random',
46530
- collectionid: props.collectionidprops
46557
+ productfetchingtype: lcproductfetchingtype,
46558
+ collectionid: props.collectionidprops,
46559
+ grouptype: props.grouptypeprops,
46560
+ grouptyperefid: props.grouptyperefidprops
46531
46561
  });
46562
+ } else if (props.srcfromprops == 'InnerGroups' || props.srcfromprops == 'InnerCategory' || props.srcfromprops == 'InnerParentCollection') {
46563
+ setfetchingtype(props.grouptypeprops);
46564
+ } else if (props.srcfromprops == 'Innervendor') {
46565
+ setfetchingtype('vendors');
46532
46566
  } else {
46533
46567
  setfetchingtype(sectionitem.fetchingtype);
46534
46568
  setProductsFetchingTypeSectionObj({
46535
46569
  productfetchingtype: sectionitem.productsfetchingtype,
46536
- collectionid: sectionitem.productsfetchingtypeCollectioncollectionid
46570
+ collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
46571
+ grouptype: props.grouptypeprops,
46572
+ grouptyperefid: props.grouptyperefidprops
46537
46573
  });
46538
46574
  }
46539
46575
  }
46540
46576
  });
46541
46577
  }, [StatePagePropertiesContext]);
46542
- useEffect(function () {
46543
- SearchHeaderMutationContext.reset();
46544
- var delayDebounceFn = setTimeout(function () {
46545
- if (searchinput.length != 0) {
46546
- SearchHeaderMutationContext.mutate({
46547
- SearchHeaderValue: searchinput
46548
- });
46549
- }
46550
- }, 1000);
46551
- return function () {
46552
- return clearTimeout(delayDebounceFn);
46553
- };
46554
- }, [searchinput]);
46555
46578
  useEffect(function () {
46556
46579
  if (sectionproperties.length != 0) {
46557
46580
  if (cardsarray.length == 0) {
@@ -46568,16 +46591,19 @@ var CardsSection2 = function CardsSection2(props) {
46568
46591
  });
46569
46592
  cardobjassigner(allpagesarr);
46570
46593
  }
46594
+ } else if (fetchingtype == 'vendors') {
46595
+ if (FetchVendorsQuery.isSuccess) {
46596
+ var _FetchVendorsQuery$da;
46597
+ cardobjassigner(FetchVendorsQuery === null || FetchVendorsQuery === void 0 || (_FetchVendorsQuery$da = FetchVendorsQuery.data) === null || _FetchVendorsQuery$da === void 0 || (_FetchVendorsQuery$da = _FetchVendorsQuery$da.data) === null || _FetchVendorsQuery$da === void 0 ? void 0 : _FetchVendorsQuery$da.vendors);
46598
+ }
46571
46599
  }
46572
46600
  }
46573
46601
  }
46574
46602
  }, [sectionproperties]);
46575
46603
  useEffect(function () {
46576
- if (fetchingtype.length != 0) {
46604
+ if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
46577
46605
  var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
46578
46606
  if (fetchingtype == 'collections') {
46579
- // tempFetchQueriesEngineContext.collections = true;
46580
-
46581
46607
  if (ProductsFetchingTypeSectionObj.collectionid == 'all' || ProductsFetchingTypeSectionObj.collectionid == null || ProductsFetchingTypeSectionObj.collectionid == undefined) {
46582
46608
  setParentCollectionsForCollectionQueryArr('all');
46583
46609
  } else {
@@ -46587,34 +46613,166 @@ var CardsSection2 = function CardsSection2(props) {
46587
46613
  if (fetchingtype == 'products') {
46588
46614
  var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
46589
46615
  tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
46590
- tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
46616
+ if (ProductsFetchingTypeSectionObj.grouptype == 'collections' || ProductsFetchingTypeSectionObj.grouptype == 'categories' || ProductsFetchingTypeSectionObj.grouptype == 'parentcollections') ; else {
46617
+ if (tempfetchproductsfilerobjcontext.collections != undefined) {
46618
+ tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
46619
+ }
46620
+ }
46621
+ tempfetchproductsfilerobjcontext.grouptype = ProductsFetchingTypeSectionObj.grouptype;
46622
+ tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
46591
46623
  setProductFilterObjContext(_objectSpread$1o({}, tempfetchproductsfilerobjcontext));
46592
46624
  }
46593
46625
  setFetchQueriesEngineContext(_objectSpread$1o({}, tempFetchQueriesEngineContext));
46594
46626
  }
46595
46627
  }, [fetchingtype, ProductsFetchingTypeSectionObj]);
46628
+ useEffect(function () {
46629
+ if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
46630
+ if (fetchingtype == 'categories') {
46631
+ var categories = [];
46632
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46633
+ var _fetchCategoriesQuery;
46634
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery === void 0 || (_fetchCategoriesQuery = _fetchCategoriesQuery.data) === null || _fetchCategoriesQuery === void 0 ? void 0 : _fetchCategoriesQuery.categories;
46635
+ }
46636
+ cardobjassigner(categories);
46637
+ }
46638
+ if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
46639
+ var _categories;
46640
+ var categories = [];
46641
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46642
+ var _fetchCategoriesQuery2;
46643
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery2 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery2 === void 0 || (_fetchCategoriesQuery2 = _fetchCategoriesQuery2.data) === null || _fetchCategoriesQuery2 === void 0 ? void 0 : _fetchCategoriesQuery2.categories;
46644
+ }
46645
+ // if (fetchAuthorizationQueryContext?.isSuccess) {
46646
+ // var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
46647
+ // alert(JSON.stringify(categories));
46648
+ var parentcollections = [];
46649
+ (_categories = categories) === null || _categories === void 0 || _categories.forEach(function (catitem, catindex) {
46650
+ catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
46651
+ if (parentcolitem.isshowntocustomers == 1) {
46652
+ parentcolitem.categoryid = catitem.categoryid;
46653
+ parentcollections.push(parentcolitem);
46654
+ }
46655
+ });
46656
+ });
46657
+ if (fetchingtype == 'parentcollections') {
46658
+ if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
46659
+ var arrafterfilter = [];
46660
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46661
+ if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
46662
+ arrafterfilter.push(parentcolitem);
46663
+ }
46664
+ });
46665
+ parentcollections = arrafterfilter;
46666
+ }
46667
+ if (props.collectionidprops != null && props.collectionidprops != undefined && props.collectionidprops != 'all') {
46668
+ var arrafterfilter = [];
46669
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46670
+ if (parentcolitem.categoryid == props.collectionidprops) {
46671
+ arrafterfilter.push(parentcolitem);
46672
+ }
46673
+ });
46674
+ parentcollections = arrafterfilter;
46675
+ }
46676
+ }
46677
+ if (fetchingtype == 'innercategories') {
46678
+ var arrafterfilter = [];
46679
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46680
+ if (parentcolitem.categoryid == props.collectionidprops) {
46681
+ arrafterfilter.push(parentcolitem);
46682
+ }
46683
+ });
46684
+ parentcollections = arrafterfilter;
46685
+ }
46686
+ cardobjassigner(parentcollections);
46687
+ // }
46688
+ } else if (fetchingtype == 'innerparentcollections') {
46689
+ var _categories2;
46690
+ var categories = [];
46691
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46692
+ var _fetchCategoriesQuery3;
46693
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery3 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery3 === void 0 || (_fetchCategoriesQuery3 = _fetchCategoriesQuery3.data) === null || _fetchCategoriesQuery3 === void 0 ? void 0 : _fetchCategoriesQuery3.categories;
46694
+ }
46695
+ // if (fetchAuthorizationQueryContext?.isSuccess) {
46696
+ // var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
46697
+ var collections = [];
46698
+ (_categories2 = categories) === null || _categories2 === void 0 || _categories2.forEach(function (catitem, catindex) {
46699
+ catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
46700
+ var _parentcolitem$collec;
46701
+ parentcolitem.categoryid = catitem.categoryid;
46702
+ parentcolitem === null || parentcolitem === void 0 || (_parentcolitem$collec = parentcolitem.collections) === null || _parentcolitem$collec === void 0 || _parentcolitem$collec.forEach(function (collitem, colindex) {
46703
+ if (collitem.isshowntocustomers == 1) {
46704
+ collitem.parentcollectionid = parentcolitem.parentcollectionid;
46705
+ collections.push(collitem);
46706
+ }
46707
+ });
46708
+ });
46709
+ });
46710
+ if (fetchingtype == 'innerparentcollections') {
46711
+ var collectionsafterfilter = [];
46712
+ collections.forEach(function (colitem, colindex) {
46713
+ if (colitem.parentcollectionid == props.collectionidprops) {
46714
+ var iscollexists = false;
46715
+ collectionsafterfilter.forEach(function (existcolitem) {
46716
+ if (colitem.collectionid == existcolitem.collectionid) {
46717
+ iscollexists = true;
46718
+ }
46719
+ });
46720
+ if (iscollexists == false) {
46721
+ collectionsafterfilter.push(colitem);
46722
+ }
46723
+ }
46724
+ });
46725
+ collections = collectionsafterfilter;
46726
+ }
46727
+ cardobjassigner(collections);
46728
+ // }
46729
+ }
46730
+ }
46731
+ }, [fetchingtype, ProductsFetchingTypeSectionObj, fetchCategoriesQueryContext.isSuccess]);
46596
46732
  useEffect(function () {
46597
46733
  if (fetchingtype == 'products') {
46598
46734
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
46599
- var _fetchProductsQuery$d2;
46735
+ var _fetchProductsQuery$d2, _fetchProductsQuery$d3, _fetchProductsQuery$d4, _fetchProductsQuery$d5;
46600
46736
  var allpagesarr = [];
46601
46737
  fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d2 = fetchProductsQuery.data) === null || _fetchProductsQuery$d2 === void 0 || (_fetchProductsQuery$d2 = _fetchProductsQuery$d2.data) === null || _fetchProductsQuery$d2 === void 0 || (_fetchProductsQuery$d2 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d2 === void 0 || _fetchProductsQuery$d2.forEach(function (item) {
46602
46738
  allpagesarr.push(item);
46603
46739
  });
46740
+ if ((fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d3 = fetchProductsQuery.data) === null || _fetchProductsQuery$d3 === void 0 || (_fetchProductsQuery$d3 = _fetchProductsQuery$d3.data) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.PerPageProducts) != undefined && (fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 || (_fetchProductsQuery$d4 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : _fetchProductsQuery$d4.PerPageProducts) != null && (fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d5 = fetchProductsQuery.data) === null || _fetchProductsQuery$d5 === void 0 || (_fetchProductsQuery$d5 = _fetchProductsQuery$d5.data) === null || _fetchProductsQuery$d5 === void 0 || (_fetchProductsQuery$d5 = _fetchProductsQuery$d5.PerPageProducts) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : _fetchProductsQuery$d5.length) != 0) {
46741
+ var _fetchProductsQuery$d6;
46742
+ setperpageItems(fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d6 = fetchProductsQuery.data) === null || _fetchProductsQuery$d6 === void 0 || (_fetchProductsQuery$d6 = _fetchProductsQuery$d6.data) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.PerPageProducts);
46743
+ }
46604
46744
  cardobjassigner(allpagesarr);
46605
46745
  }
46606
46746
  }
46607
- }, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data, fetchcustomercartQueryContext.dataUpdatedAt]);
46747
+ }, [fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.isSuccess, fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.dataUpdatedAt, fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.data, fetchcustomercartQueryContext === null || fetchcustomercartQueryContext === void 0 ? void 0 : fetchcustomercartQueryContext.dataUpdatedAt]);
46608
46748
  useEffect(function () {
46609
46749
  if (fetchingtype == 'collections') {
46610
46750
  if (fetchcollectionsQueryContext.isSuccess) {
46611
46751
  cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
46612
46752
  }
46613
46753
  }
46614
- }, [fetchcollectionsQueryContext.isSuccess]);
46754
+ }, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess, fetchcollectionsQueryContext.data]);
46755
+ useEffect(function () {
46756
+ if (fetchingtype == 'vendors') {
46757
+ if (FetchVendorsQuery.isSuccess) {
46758
+ if (FetchVendorsQuery.data.data.vendors != undefined && FetchVendorsQuery.data.data.vendors.length != 0) {
46759
+ var _FetchVendorsQuery$da2;
46760
+ cardobjassigner(FetchVendorsQuery === null || FetchVendorsQuery === void 0 || (_FetchVendorsQuery$da2 = FetchVendorsQuery.data) === null || _FetchVendorsQuery$da2 === void 0 || (_FetchVendorsQuery$da2 = _FetchVendorsQuery$da2.data) === null || _FetchVendorsQuery$da2 === void 0 ? void 0 : _FetchVendorsQuery$da2.vendors);
46761
+ }
46762
+ }
46763
+ }
46764
+ }, [FetchVendorsQuery.isSuccess]);
46615
46765
  useEffect(function () {
46616
46766
  favassigner();
46617
46767
  }, [favoriteprojectscountContext]);
46768
+ useEffect(function () {
46769
+ if (sectionproperties.length != 0 && sectionproperties.maincontainerarrayofobjs != undefined) {
46770
+ var maincontainerarrayofobjsparsed = JSON.parse(sectionproperties.maincontainerarrayofobjs);
46771
+ if (Array.isArray(maincontainerarrayofobjsparsed)) {
46772
+ setmaincontainerarrayofobjs(_toConsumableArray(maincontainerarrayofobjsparsed));
46773
+ }
46774
+ }
46775
+ }, [sectionproperties]);
46618
46776
  var favassigner = function favassigner() {
46619
46777
  if (fetchingtype == 'products') {
46620
46778
  if (cardsarray.length != 0) {
@@ -46701,10 +46859,10 @@ var CardsSection2 = function CardsSection2(props) {
46701
46859
  cardobj.sku = arrayItem.productinfo.sku;
46702
46860
  if (langdetect == 'en') {
46703
46861
  var _fetchAuthorizationQu;
46704
- cardobj.currencyname = (_fetchAuthorizationQu = fetchAuthorizationQueryContext) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
46862
+ cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
46705
46863
  } else {
46706
46864
  var _fetchAuthorizationQu2;
46707
- cardobj.currencyname = (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
46865
+ cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
46708
46866
  }
46709
46867
  if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
46710
46868
  favoriteprojectscountContext.forEach(function (favitem, favindex) {
@@ -46939,7 +47097,8 @@ var CardsSection2 = function CardsSection2(props) {
46939
47097
  className: "row m-0 d-flex w-100 justify-content-center mb-md-4 ",
46940
47098
  style: {
46941
47099
  zIndex: 2
46942
- }
47100
+ },
47101
+ ref: refscr
46943
47102
  }, /*#__PURE__*/React.createElement("div", {
46944
47103
  className: "col-lg-12 p-0 d-flex justify-content-center"
46945
47104
  }, sectionproperties.length != 0 && /*#__PURE__*/React.createElement("div", {
@@ -55488,7 +55647,7 @@ var DynamicForm = function DynamicForm(props) {
55488
55647
  }, "Choose"), decoditems === null || decoditems === void 0 ? void 0 : decoditems.map(function (sitem) {
55489
55648
  return /*#__PURE__*/React.createElement("option", {
55490
55649
  value: sitem.optionname_en
55491
- }, sitem.optionname_en);
55650
+ }, langdetect == 'en' ? sitem.optionname_en : sitem.optionname_ar);
55492
55651
  }))));
55493
55652
  }
55494
55653
  }
@@ -64378,7 +64537,7 @@ var Card23 = function Card23(props) {
64378
64537
  publicKey: ikimagecredcontext === null || ikimagecredcontext === void 0 ? void 0 : ikimagecredcontext.ikimagepublickey,
64379
64538
  path: '/tr:w-' + sectionproperties.imagetr_w + ',h-' + sectionproperties.imagetr_h + '/' + item.image,
64380
64539
  style: {
64381
- opacity: item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' && item.hasvariants == 0 ? sectionproperties.outofstockimageopcity : 1,
64540
+ opacity: item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' ? sectionproperties.outofstockimageopcity : 1,
64382
64541
  width: sectionproperties.imageInnerWidth_Height + '%',
64383
64542
  height: sectionproperties.imageInnerWidth_Height + '%',
64384
64543
  objectFit: sectionproperties.bgcovercontain == 'Cover' ? 'cover' : 'contain',
@@ -64456,7 +64615,7 @@ var Card23 = function Card23(props) {
64456
64615
  fontSize: sectionproperties.pillfontSize + 'px',
64457
64616
  direction: 'ltr'
64458
64617
  }
64459
- }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%')), item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' && item.hasvariants == 0 && /*#__PURE__*/React.createElement("div", {
64618
+ }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%')), item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' == 0 && /*#__PURE__*/React.createElement("div", {
64460
64619
  "class": "".concat(cardsstyles2.outstockbadge) + ' allcentered '
64461
64620
  }, /*#__PURE__*/React.createElement("p", {
64462
64621
  "class": "m-0 p-0"
package/dist/index.umd.js CHANGED
@@ -46341,92 +46341,115 @@
46341
46341
  function ownKeys$1o(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
46342
46342
  function _objectSpread$1o(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1o(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1o(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
46343
46343
  var CardsSection2 = function CardsSection2(props) {
46344
+ var refscr = /*#__PURE__*/React.createRef();
46344
46345
  var _useInView = reactIntersectionObserver.useInView();
46345
46346
  _useInView.ref;
46346
- var inView = _useInView.inView;
46347
+ _useInView.inView;
46347
46348
  var StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
46348
46349
  props.actions.lang;
46349
46350
  var langdetect = props.actions.langdetect;
46350
46351
  var fetchcustomercartQueryContext = props.actions.fetchcustomercartQueryContext;
46351
46352
  var favoriteprojectscountContext = props.actions.favoriteprojectscountContext;
46353
+ props.actions.routingcountext;
46354
+ props.actions.StaticPagesLinksContext;
46352
46355
  var ProductFilterObjContext = props.actions.ProductFilterObjContext;
46353
46356
  var setProductFilterObjContext = props.actions.setProductFilterObjContext;
46354
46357
  var TabexSectionsComponentsContext = props.actions.TabexSectionsComponentsContext;
46355
46358
  var FetchQueriesEngineContext = props.actions.FetchQueriesEngineContext;
46356
46359
  var setFetchQueriesEngineContext = props.actions.setFetchQueriesEngineContext;
46357
- var SearchHeaderMutationContext = props.actions.SearchHeaderMutationContext;
46358
46360
  var fetchProductsQuery = props.actions.fetchProductsQuery;
46359
46361
  var fetchcollectionsQueryContext = props.actions.fetchcollectionsQueryContext;
46360
46362
  var setParentCollectionsForCollectionQueryArr = props.actions.setParentCollectionsForCollectionQueryArr;
46363
+ props.actions.ParentCollectionsForCollectionQueryArr;
46361
46364
  var setfetchingtype = props.actions.setfetchingtype;
46362
46365
  var fetchingtype = props.actions.fetchingtype;
46363
- props.actions.AddtoCartMutationContext;
46364
- props.actions.setShowProductInfoModalContext;
46365
- props.actions.authdetailsContext;
46366
- props.actions.productfiltercontext;
46367
- props.actions.setproductfiltercontext;
46366
+ props.actions.addtofavoritescontext;
46367
+ var fetchAuthorizationQueryContext = props.actions.fetchAuthorizationQueryContext;
46368
+ var fetchCategoriesQueryContext = props.actions.fetchCategoriesQueryContext;
46369
+ var FetchVendorsQuery = props.actions.FetchVendorsQuery;
46370
+ props.actions.ikimagecredcontext;
46371
+ props.actions.sortbycontext;
46372
+ props.actions.setsortbycontext;
46373
+ var _useState = React.useState(false),
46374
+ _useState2 = _slicedToArray__default["default"](_useState, 2);
46375
+ _useState2[0];
46376
+ _useState2[1];
46368
46377
  var actions = props.actions;
46369
- var _useState = React.useState(''),
46370
- _useState2 = _slicedToArray__default["default"](_useState, 2),
46371
- sectionproperties = _useState2[0],
46372
- setsectionproperties = _useState2[1];
46373
- var _useState3 = React.useState([]),
46378
+ var _useState3 = React.useState(''),
46374
46379
  _useState4 = _slicedToArray__default["default"](_useState3, 2),
46375
- cardsarray = _useState4[0],
46376
- setcardsarray = _useState4[1];
46377
- var _useState5 = React.useState(''),
46380
+ sectionproperties = _useState4[0],
46381
+ setsectionproperties = _useState4[1];
46382
+ var _useState5 = React.useState([]),
46378
46383
  _useState6 = _slicedToArray__default["default"](_useState5, 2),
46379
- searchinput = _useState6[0];
46380
- _useState6[1];
46381
- React__default["default"].useEffect(function () {
46382
- if (inView) {
46383
- fetchProductsQuery.fetchNextPage();
46384
- }
46385
- }, [inView]);
46386
- var _useState7 = React.useState({
46384
+ cardsarray = _useState6[0],
46385
+ setcardsarray = _useState6[1];
46386
+ var _useState7 = React.useState(''),
46387
+ _useState8 = _slicedToArray__default["default"](_useState7, 2),
46388
+ sectionitem = _useState8[0],
46389
+ setsectionitem = _useState8[1];
46390
+ var _useState9 = React.useState({
46387
46391
  productfetchingtype: 'Random',
46388
- collectionid: ''
46392
+ collectionid: '',
46393
+ grouptype: ''
46389
46394
  }),
46390
- _useState8 = _slicedToArray__default["default"](_useState7, 2),
46391
- ProductsFetchingTypeSectionObj = _useState8[0],
46392
- setProductsFetchingTypeSectionObj = _useState8[1];
46395
+ _useState10 = _slicedToArray__default["default"](_useState9, 2),
46396
+ ProductsFetchingTypeSectionObj = _useState10[0],
46397
+ setProductsFetchingTypeSectionObj = _useState10[1];
46398
+ var _useState11 = React.useState([]),
46399
+ _useState12 = _slicedToArray__default["default"](_useState11, 2);
46400
+ _useState12[0];
46401
+ var setmaincontainerarrayofobjs = _useState12[1];
46402
+ var _useState13 = React.useState(12),
46403
+ _useState14 = _slicedToArray__default["default"](_useState13, 2);
46404
+ _useState14[0];
46405
+ var setperpageItems = _useState14[1];
46406
+ props.actions.AddtoCartMutationContext;
46393
46407
  React.useEffect(function () {
46408
+ var productfilerobjtemp = ProductFilterObjContext;
46409
+ if (props.filterparamsprops != undefined) {
46410
+ var filterpar = decodeURIComponent(props.filterparamsprops);
46411
+ var filterparsed = JSON.parse(filterpar);
46412
+ if (filterparsed != undefined) {
46413
+ productfilerobjtemp = filterparsed;
46414
+ setProductFilterObjContext(filterparsed);
46415
+ }
46416
+ }
46394
46417
  StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
46395
46418
  if (sectionitem.sectionid == props.sectionidprops) {
46396
46419
  var secpropobj = {};
46420
+ setsectionitem(sectionitem);
46397
46421
  sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
46398
46422
  secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
46399
46423
  });
46400
46424
  setsectionproperties(_objectSpread$1o({}, secpropobj));
46401
46425
  if (props.srcfromprops == 'GeneralProductsComponent') {
46402
46426
  setfetchingtype('products');
46427
+ var lcproductfetchingtype = 'Random';
46428
+ if (productfilerobjtemp.ProductFetchingType != undefined && productfilerobjtemp.ProductFetchingType != null && productfilerobjtemp.ProductFetchingType.length != 0) {
46429
+ lcproductfetchingtype = productfilerobjtemp.ProductFetchingType;
46430
+ }
46403
46431
  setProductsFetchingTypeSectionObj({
46404
- productfetchingtype: 'Random',
46405
- collectionid: props.collectionidprops
46432
+ productfetchingtype: lcproductfetchingtype,
46433
+ collectionid: props.collectionidprops,
46434
+ grouptype: props.grouptypeprops,
46435
+ grouptyperefid: props.grouptyperefidprops
46406
46436
  });
46437
+ } else if (props.srcfromprops == 'InnerGroups' || props.srcfromprops == 'InnerCategory' || props.srcfromprops == 'InnerParentCollection') {
46438
+ setfetchingtype(props.grouptypeprops);
46439
+ } else if (props.srcfromprops == 'Innervendor') {
46440
+ setfetchingtype('vendors');
46407
46441
  } else {
46408
46442
  setfetchingtype(sectionitem.fetchingtype);
46409
46443
  setProductsFetchingTypeSectionObj({
46410
46444
  productfetchingtype: sectionitem.productsfetchingtype,
46411
- collectionid: sectionitem.productsfetchingtypeCollectioncollectionid
46445
+ collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
46446
+ grouptype: props.grouptypeprops,
46447
+ grouptyperefid: props.grouptyperefidprops
46412
46448
  });
46413
46449
  }
46414
46450
  }
46415
46451
  });
46416
46452
  }, [StatePagePropertiesContext]);
46417
- React.useEffect(function () {
46418
- SearchHeaderMutationContext.reset();
46419
- var delayDebounceFn = setTimeout(function () {
46420
- if (searchinput.length != 0) {
46421
- SearchHeaderMutationContext.mutate({
46422
- SearchHeaderValue: searchinput
46423
- });
46424
- }
46425
- }, 1000);
46426
- return function () {
46427
- return clearTimeout(delayDebounceFn);
46428
- };
46429
- }, [searchinput]);
46430
46453
  React.useEffect(function () {
46431
46454
  if (sectionproperties.length != 0) {
46432
46455
  if (cardsarray.length == 0) {
@@ -46443,16 +46466,19 @@
46443
46466
  });
46444
46467
  cardobjassigner(allpagesarr);
46445
46468
  }
46469
+ } else if (fetchingtype == 'vendors') {
46470
+ if (FetchVendorsQuery.isSuccess) {
46471
+ var _FetchVendorsQuery$da;
46472
+ cardobjassigner(FetchVendorsQuery === null || FetchVendorsQuery === void 0 || (_FetchVendorsQuery$da = FetchVendorsQuery.data) === null || _FetchVendorsQuery$da === void 0 || (_FetchVendorsQuery$da = _FetchVendorsQuery$da.data) === null || _FetchVendorsQuery$da === void 0 ? void 0 : _FetchVendorsQuery$da.vendors);
46473
+ }
46446
46474
  }
46447
46475
  }
46448
46476
  }
46449
46477
  }, [sectionproperties]);
46450
46478
  React.useEffect(function () {
46451
- if (fetchingtype.length != 0) {
46479
+ if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
46452
46480
  var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
46453
46481
  if (fetchingtype == 'collections') {
46454
- // tempFetchQueriesEngineContext.collections = true;
46455
-
46456
46482
  if (ProductsFetchingTypeSectionObj.collectionid == 'all' || ProductsFetchingTypeSectionObj.collectionid == null || ProductsFetchingTypeSectionObj.collectionid == undefined) {
46457
46483
  setParentCollectionsForCollectionQueryArr('all');
46458
46484
  } else {
@@ -46462,34 +46488,166 @@
46462
46488
  if (fetchingtype == 'products') {
46463
46489
  var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
46464
46490
  tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
46465
- tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
46491
+ if (ProductsFetchingTypeSectionObj.grouptype == 'collections' || ProductsFetchingTypeSectionObj.grouptype == 'categories' || ProductsFetchingTypeSectionObj.grouptype == 'parentcollections') ; else {
46492
+ if (tempfetchproductsfilerobjcontext.collections != undefined) {
46493
+ tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
46494
+ }
46495
+ }
46496
+ tempfetchproductsfilerobjcontext.grouptype = ProductsFetchingTypeSectionObj.grouptype;
46497
+ tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
46466
46498
  setProductFilterObjContext(_objectSpread$1o({}, tempfetchproductsfilerobjcontext));
46467
46499
  }
46468
46500
  setFetchQueriesEngineContext(_objectSpread$1o({}, tempFetchQueriesEngineContext));
46469
46501
  }
46470
46502
  }, [fetchingtype, ProductsFetchingTypeSectionObj]);
46503
+ React.useEffect(function () {
46504
+ if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
46505
+ if (fetchingtype == 'categories') {
46506
+ var categories = [];
46507
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46508
+ var _fetchCategoriesQuery;
46509
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery === void 0 || (_fetchCategoriesQuery = _fetchCategoriesQuery.data) === null || _fetchCategoriesQuery === void 0 ? void 0 : _fetchCategoriesQuery.categories;
46510
+ }
46511
+ cardobjassigner(categories);
46512
+ }
46513
+ if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
46514
+ var _categories;
46515
+ var categories = [];
46516
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46517
+ var _fetchCategoriesQuery2;
46518
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery2 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery2 === void 0 || (_fetchCategoriesQuery2 = _fetchCategoriesQuery2.data) === null || _fetchCategoriesQuery2 === void 0 ? void 0 : _fetchCategoriesQuery2.categories;
46519
+ }
46520
+ // if (fetchAuthorizationQueryContext?.isSuccess) {
46521
+ // var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
46522
+ // alert(JSON.stringify(categories));
46523
+ var parentcollections = [];
46524
+ (_categories = categories) === null || _categories === void 0 || _categories.forEach(function (catitem, catindex) {
46525
+ catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
46526
+ if (parentcolitem.isshowntocustomers == 1) {
46527
+ parentcolitem.categoryid = catitem.categoryid;
46528
+ parentcollections.push(parentcolitem);
46529
+ }
46530
+ });
46531
+ });
46532
+ if (fetchingtype == 'parentcollections') {
46533
+ if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
46534
+ var arrafterfilter = [];
46535
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46536
+ if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
46537
+ arrafterfilter.push(parentcolitem);
46538
+ }
46539
+ });
46540
+ parentcollections = arrafterfilter;
46541
+ }
46542
+ if (props.collectionidprops != null && props.collectionidprops != undefined && props.collectionidprops != 'all') {
46543
+ var arrafterfilter = [];
46544
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46545
+ if (parentcolitem.categoryid == props.collectionidprops) {
46546
+ arrafterfilter.push(parentcolitem);
46547
+ }
46548
+ });
46549
+ parentcollections = arrafterfilter;
46550
+ }
46551
+ }
46552
+ if (fetchingtype == 'innercategories') {
46553
+ var arrafterfilter = [];
46554
+ parentcollections.forEach(function (parentcolitem, parcolindex) {
46555
+ if (parentcolitem.categoryid == props.collectionidprops) {
46556
+ arrafterfilter.push(parentcolitem);
46557
+ }
46558
+ });
46559
+ parentcollections = arrafterfilter;
46560
+ }
46561
+ cardobjassigner(parentcollections);
46562
+ // }
46563
+ } else if (fetchingtype == 'innerparentcollections') {
46564
+ var _categories2;
46565
+ var categories = [];
46566
+ if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
46567
+ var _fetchCategoriesQuery3;
46568
+ categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery3 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery3 === void 0 || (_fetchCategoriesQuery3 = _fetchCategoriesQuery3.data) === null || _fetchCategoriesQuery3 === void 0 ? void 0 : _fetchCategoriesQuery3.categories;
46569
+ }
46570
+ // if (fetchAuthorizationQueryContext?.isSuccess) {
46571
+ // var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
46572
+ var collections = [];
46573
+ (_categories2 = categories) === null || _categories2 === void 0 || _categories2.forEach(function (catitem, catindex) {
46574
+ catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
46575
+ var _parentcolitem$collec;
46576
+ parentcolitem.categoryid = catitem.categoryid;
46577
+ parentcolitem === null || parentcolitem === void 0 || (_parentcolitem$collec = parentcolitem.collections) === null || _parentcolitem$collec === void 0 || _parentcolitem$collec.forEach(function (collitem, colindex) {
46578
+ if (collitem.isshowntocustomers == 1) {
46579
+ collitem.parentcollectionid = parentcolitem.parentcollectionid;
46580
+ collections.push(collitem);
46581
+ }
46582
+ });
46583
+ });
46584
+ });
46585
+ if (fetchingtype == 'innerparentcollections') {
46586
+ var collectionsafterfilter = [];
46587
+ collections.forEach(function (colitem, colindex) {
46588
+ if (colitem.parentcollectionid == props.collectionidprops) {
46589
+ var iscollexists = false;
46590
+ collectionsafterfilter.forEach(function (existcolitem) {
46591
+ if (colitem.collectionid == existcolitem.collectionid) {
46592
+ iscollexists = true;
46593
+ }
46594
+ });
46595
+ if (iscollexists == false) {
46596
+ collectionsafterfilter.push(colitem);
46597
+ }
46598
+ }
46599
+ });
46600
+ collections = collectionsafterfilter;
46601
+ }
46602
+ cardobjassigner(collections);
46603
+ // }
46604
+ }
46605
+ }
46606
+ }, [fetchingtype, ProductsFetchingTypeSectionObj, fetchCategoriesQueryContext.isSuccess]);
46471
46607
  React.useEffect(function () {
46472
46608
  if (fetchingtype == 'products') {
46473
46609
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
46474
- var _fetchProductsQuery$d2;
46610
+ var _fetchProductsQuery$d2, _fetchProductsQuery$d3, _fetchProductsQuery$d4, _fetchProductsQuery$d5;
46475
46611
  var allpagesarr = [];
46476
46612
  fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d2 = fetchProductsQuery.data) === null || _fetchProductsQuery$d2 === void 0 || (_fetchProductsQuery$d2 = _fetchProductsQuery$d2.data) === null || _fetchProductsQuery$d2 === void 0 || (_fetchProductsQuery$d2 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d2 === void 0 || _fetchProductsQuery$d2.forEach(function (item) {
46477
46613
  allpagesarr.push(item);
46478
46614
  });
46615
+ if ((fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d3 = fetchProductsQuery.data) === null || _fetchProductsQuery$d3 === void 0 || (_fetchProductsQuery$d3 = _fetchProductsQuery$d3.data) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.PerPageProducts) != undefined && (fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 || (_fetchProductsQuery$d4 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : _fetchProductsQuery$d4.PerPageProducts) != null && (fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d5 = fetchProductsQuery.data) === null || _fetchProductsQuery$d5 === void 0 || (_fetchProductsQuery$d5 = _fetchProductsQuery$d5.data) === null || _fetchProductsQuery$d5 === void 0 || (_fetchProductsQuery$d5 = _fetchProductsQuery$d5.PerPageProducts) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : _fetchProductsQuery$d5.length) != 0) {
46616
+ var _fetchProductsQuery$d6;
46617
+ setperpageItems(fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d6 = fetchProductsQuery.data) === null || _fetchProductsQuery$d6 === void 0 || (_fetchProductsQuery$d6 = _fetchProductsQuery$d6.data) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.PerPageProducts);
46618
+ }
46479
46619
  cardobjassigner(allpagesarr);
46480
46620
  }
46481
46621
  }
46482
- }, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data, fetchcustomercartQueryContext.dataUpdatedAt]);
46622
+ }, [fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.isSuccess, fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.dataUpdatedAt, fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : fetchProductsQuery.data, fetchcustomercartQueryContext === null || fetchcustomercartQueryContext === void 0 ? void 0 : fetchcustomercartQueryContext.dataUpdatedAt]);
46483
46623
  React.useEffect(function () {
46484
46624
  if (fetchingtype == 'collections') {
46485
46625
  if (fetchcollectionsQueryContext.isSuccess) {
46486
46626
  cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
46487
46627
  }
46488
46628
  }
46489
- }, [fetchcollectionsQueryContext.isSuccess]);
46629
+ }, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess, fetchcollectionsQueryContext.data]);
46630
+ React.useEffect(function () {
46631
+ if (fetchingtype == 'vendors') {
46632
+ if (FetchVendorsQuery.isSuccess) {
46633
+ if (FetchVendorsQuery.data.data.vendors != undefined && FetchVendorsQuery.data.data.vendors.length != 0) {
46634
+ var _FetchVendorsQuery$da2;
46635
+ cardobjassigner(FetchVendorsQuery === null || FetchVendorsQuery === void 0 || (_FetchVendorsQuery$da2 = FetchVendorsQuery.data) === null || _FetchVendorsQuery$da2 === void 0 || (_FetchVendorsQuery$da2 = _FetchVendorsQuery$da2.data) === null || _FetchVendorsQuery$da2 === void 0 ? void 0 : _FetchVendorsQuery$da2.vendors);
46636
+ }
46637
+ }
46638
+ }
46639
+ }, [FetchVendorsQuery.isSuccess]);
46490
46640
  React.useEffect(function () {
46491
46641
  favassigner();
46492
46642
  }, [favoriteprojectscountContext]);
46643
+ React.useEffect(function () {
46644
+ if (sectionproperties.length != 0 && sectionproperties.maincontainerarrayofobjs != undefined) {
46645
+ var maincontainerarrayofobjsparsed = JSON.parse(sectionproperties.maincontainerarrayofobjs);
46646
+ if (Array.isArray(maincontainerarrayofobjsparsed)) {
46647
+ setmaincontainerarrayofobjs(_toConsumableArray__default["default"](maincontainerarrayofobjsparsed));
46648
+ }
46649
+ }
46650
+ }, [sectionproperties]);
46493
46651
  var favassigner = function favassigner() {
46494
46652
  if (fetchingtype == 'products') {
46495
46653
  if (cardsarray.length != 0) {
@@ -46576,10 +46734,10 @@
46576
46734
  cardobj.sku = arrayItem.productinfo.sku;
46577
46735
  if (langdetect == 'en') {
46578
46736
  var _fetchAuthorizationQu;
46579
- cardobj.currencyname = (_fetchAuthorizationQu = fetchAuthorizationQueryContext) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
46737
+ cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
46580
46738
  } else {
46581
46739
  var _fetchAuthorizationQu2;
46582
- cardobj.currencyname = (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
46740
+ cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
46583
46741
  }
46584
46742
  if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
46585
46743
  favoriteprojectscountContext.forEach(function (favitem, favindex) {
@@ -46814,7 +46972,8 @@
46814
46972
  className: "row m-0 d-flex w-100 justify-content-center mb-md-4 ",
46815
46973
  style: {
46816
46974
  zIndex: 2
46817
- }
46975
+ },
46976
+ ref: refscr
46818
46977
  }, /*#__PURE__*/React__default["default"].createElement("div", {
46819
46978
  className: "col-lg-12 p-0 d-flex justify-content-center"
46820
46979
  }, sectionproperties.length != 0 && /*#__PURE__*/React__default["default"].createElement("div", {
@@ -55363,7 +55522,7 @@
55363
55522
  }, "Choose"), decoditems === null || decoditems === void 0 ? void 0 : decoditems.map(function (sitem) {
55364
55523
  return /*#__PURE__*/React__default["default"].createElement("option", {
55365
55524
  value: sitem.optionname_en
55366
- }, sitem.optionname_en);
55525
+ }, langdetect == 'en' ? sitem.optionname_en : sitem.optionname_ar);
55367
55526
  }))));
55368
55527
  }
55369
55528
  }
@@ -64253,7 +64412,7 @@
64253
64412
  publicKey: ikimagecredcontext === null || ikimagecredcontext === void 0 ? void 0 : ikimagecredcontext.ikimagepublickey,
64254
64413
  path: '/tr:w-' + sectionproperties.imagetr_w + ',h-' + sectionproperties.imagetr_h + '/' + item.image,
64255
64414
  style: {
64256
- opacity: item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' && item.hasvariants == 0 ? sectionproperties.outofstockimageopcity : 1,
64415
+ opacity: item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' ? sectionproperties.outofstockimageopcity : 1,
64257
64416
  width: sectionproperties.imageInnerWidth_Height + '%',
64258
64417
  height: sectionproperties.imageInnerWidth_Height + '%',
64259
64418
  objectFit: sectionproperties.bgcovercontain == 'Cover' ? 'cover' : 'contain',
@@ -64331,7 +64490,7 @@
64331
64490
  fontSize: sectionproperties.pillfontSize + 'px',
64332
64491
  direction: 'ltr'
64333
64492
  }
64334
- }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%')), item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' && item.hasvariants == 0 && /*#__PURE__*/React__default["default"].createElement("div", {
64493
+ }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%')), item.currentquantity < 1 && sectionproperties.showoutofstock == 'Show' && item.quantavailtype == 'limit' == 0 && /*#__PURE__*/React__default["default"].createElement("div", {
64335
64494
  "class": "".concat(cardsstyles2.outstockbadge) + ' allcentered '
64336
64495
  }, /*#__PURE__*/React__default["default"].createElement("p", {
64337
64496
  "class": "m-0 p-0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabexseriescomponents",
3
- "version": "0.0.478",
3
+ "version": "0.0.480",
4
4
  "description": "your description",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {