diy-template-components 0.2.32 → 0.2.34

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/build/index.es.js CHANGED
@@ -11,6 +11,7 @@ function ___$insertStyle(css) {
11
11
 
12
12
  import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
13
13
  import Slider from 'react-slick';
14
+ import Image from 'next/image';
14
15
  import axios from 'axios';
15
16
  import moment from 'moment';
16
17
  import Countdown from 'react-countdown';
@@ -18,20 +19,17 @@ import ReactDOMServer from 'react-dom/server';
18
19
  import { createTheming, createUseStyles as createUseStyles$1, useTheme as useTheme$1 } from 'react-jss';
19
20
 
20
21
  function _extends() {
21
- _extends = Object.assign || function (target) {
22
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
22
23
  for (var i = 1; i < arguments.length; i++) {
23
24
  var source = arguments[i];
24
-
25
25
  for (var key in source) {
26
26
  if (Object.prototype.hasOwnProperty.call(source, key)) {
27
27
  target[key] = source[key];
28
28
  }
29
29
  }
30
30
  }
31
-
32
31
  return target;
33
32
  };
34
-
35
33
  return _extends.apply(this, arguments);
36
34
  }
37
35
 
@@ -287,21 +285,17 @@ const alpha = {
287
285
  seventyPercent: 0.7,
288
286
  eightyPercent: 0.8
289
287
  };
290
-
291
288
  const getRGBFromHex = hex => {
292
289
  const r = parseInt(hex.slice(1, 3), 16);
293
290
  const g = parseInt(hex.slice(3, 5), 16);
294
291
  const b = parseInt(hex.slice(5, 7), 16);
295
292
  return [r, g, b];
296
293
  };
297
-
298
294
  const hexToRgbA = (hex, alpha = null) => {
299
295
  const values = getRGBFromHex(hex);
300
-
301
296
  if (alpha !== null) {
302
297
  values.push(alpha);
303
298
  }
304
-
305
299
  return `rgba(${values.join(',')})`;
306
300
  };
307
301
  const colorMixer = (hex1, weightage = 1, hex2 = colors.white) => {
@@ -441,29 +435,24 @@ function useLinkBuilder(data) {
441
435
  basePath,
442
436
  isMasterTemplate
443
437
  } = useContext(PageContext);
444
-
445
438
  if (isEdit || !data.isLink) {
446
439
  return null;
447
440
  }
448
-
449
441
  if (data?.isExistingLink === false) {
450
442
  return data.link;
451
443
  }
452
-
453
444
  if (data?.isExternal) {
454
445
  return data.link;
455
446
  }
456
-
457
447
  if (!isPreview) {
458
448
  const link = data.link === '/' ? '' : '/' + data.link;
459
449
  return basePath ? `//${basePath}${link}` : null;
460
- } // courses in preview: special case
461
-
450
+ }
462
451
 
452
+ // courses in preview: special case
463
453
  if (data.link === 'courses') {
464
454
  return `//${basePath}/courses`;
465
455
  }
466
-
467
456
  const {
468
457
  pageId
469
458
  } = navList.find(el => el.slug === data?.link) || {};
@@ -639,14 +628,12 @@ var calendar$1 = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%
639
628
  var video = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M15.8625%205.1275C15.555%204.9625%2014.91%204.79%2014.0325%205.405L12.93%206.185C12.8475%203.8525%2011.835%202.9375%209.375%202.9375H4.875C2.31%202.9375%201.3125%203.935%201.3125%206.5V12.5C1.3125%2014.225%202.25%2016.0625%204.875%2016.0625H9.375C11.835%2016.0625%2012.8475%2015.1475%2012.93%2012.815L14.0325%2013.595C14.4975%2013.925%2014.9025%2014.03%2015.225%2014.03C15.5025%2014.03%2015.72%2013.9475%2015.8625%2013.8725C16.17%2013.715%2016.6875%2013.2875%2016.6875%2012.215V6.785C16.6875%205.7125%2016.17%205.285%2015.8625%205.1275ZM8.25%209.035C7.4775%209.035%206.84%208.405%206.84%207.625C6.84%206.845%207.4775%206.215%208.25%206.215C9.0225%206.215%209.66%206.845%209.66%207.625C9.66%208.405%209.0225%209.035%208.25%209.035Z%22%20fill%3D%22%23589DF5%22%2F%3E%3C%2Fsvg%3E";
640
629
 
641
630
  /** @returns {import('./types').IconData} */
642
-
643
631
  const getConfiguredIcon1 = url => ({
644
632
  url,
645
633
  svgChildrenConfigs: []
646
634
  });
647
- /** @returns {import('./types').IconData} */
648
-
649
635
 
636
+ /** @returns {import('./types').IconData} */
650
637
  const getConfiguredIcon2 = (url, stroke, fill) => ({
651
638
  url,
652
639
  svgChildrenConfigs: [{
@@ -655,7 +642,6 @@ const getConfiguredIcon2 = (url, stroke, fill) => ({
655
642
  fill
656
643
  }]
657
644
  });
658
-
659
645
  const icons = {
660
646
  'Live class': getConfiguredIcon2(liveTv, false, true),
661
647
  'Recorded videos': getConfiguredIcon2(liveTv2, false, true),
@@ -688,41 +674,51 @@ const icons = {
688
674
  'Video Play': getConfiguredIcon2(videoPlay, false, true),
689
675
  Quote: getConfiguredIcon2(quote, false, true),
690
676
  // Stock
677
+
691
678
  'Stock Growth': getConfiguredIcon2(stockGrowth, false, true),
692
679
  Money: getConfiguredIcon2(money, false, true),
693
680
  Split: getConfiguredIcon2(split, false, true),
694
681
  Chart: getConfiguredIcon2(chart, false, true),
695
682
  // Personality Development
683
+
696
684
  Leaders: getConfiguredIcon2(leaders, false, true),
697
685
  Women: getConfiguredIcon2(women, false, true),
698
686
  Program: getConfiguredIcon2(program, false, true),
699
687
  // Photography
688
+
700
689
  'Video Editing': getConfiguredIcon2(videoEditing, false, true),
701
690
  Editing: getConfiguredIcon2(editing, false, true),
702
691
  Camera: getConfiguredIcon2(camera, false, true),
703
692
  Sessions: getConfiguredIcon2(sessions, false, true),
704
693
  // Computer
694
+
705
695
  'Regular Batches': getConfiguredIcon2(regularBatches, false, true),
706
696
  'Alternate Batches': getConfiguredIcon2(alternateBatches, false, true),
707
697
  'Weekend Batches': getConfiguredIcon2(weekendBatches, false, true),
708
698
  // Life Coach
699
+
709
700
  Girl: getConfiguredIcon2(girl, false, true),
710
701
  Smile: getConfiguredIcon2(smile, false, true),
711
702
  Relationships: getConfiguredIcon2(relationships, false, true),
712
703
  // Music
704
+
713
705
  Vocal: getConfiguredIcon2(vocal, false, true),
714
706
  Instrument: getConfiguredIcon2(instrument, false, true),
715
707
  Music: getConfiguredIcon2(music, false, true),
716
708
  // Fitness
709
+
717
710
  Workout: getConfiguredIcon2(workout, false, true),
718
711
  Barbell: getConfiguredIcon2(barbell, false, true),
719
712
  Trainer: getConfiguredIcon2(trainer, false, true),
720
713
  Report: getConfiguredIcon2(report, false, true),
721
714
  // Govt Exam
715
+
722
716
  'Govt Exam': getConfiguredIcon2(govtExam, false, true),
723
717
  // IIT JEE
718
+
724
719
  College: getConfiguredIcon2(college, false, true),
725
720
  // Others
721
+
726
722
  Teachers: getConfiguredIcon2(teachers, false, true),
727
723
  Learning: getConfiguredIcon2(learning, false, true),
728
724
  Success: getConfiguredIcon2(success, false, true),
@@ -734,12 +730,9 @@ const icons = {
734
730
  Video: getConfiguredIcon2(video, false, true)
735
731
  };
736
732
 
737
- const someMethod1 = (
738
- /** @type {import('./types').IconData["svgChildrenConfigs"]} */
739
- svgChildrenConfigs, color, hoverColor) => {
733
+ const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"]} */svgChildrenConfigs, color, hoverColor) => {
740
734
  /** @type {{ [k:string]:React.CSSProperties; }} */
741
735
  const obj = {};
742
-
743
736
  for (const svgChildConfig of svgChildrenConfigs) {
744
737
  if (color) obj['& ' + svgChildConfig.selector] = {
745
738
  fill: svgChildConfig.fill ? color : undefined,
@@ -750,10 +743,8 @@ svgChildrenConfigs, color, hoverColor) => {
750
743
  stroke: svgChildConfig.stroke ? hoverColor : undefined
751
744
  };
752
745
  }
753
-
754
746
  return obj;
755
747
  };
756
-
757
748
  const useStyles$1 = createUseStyles$1({
758
749
  '@keyframes slideRight': {
759
750
  to: {
@@ -797,8 +788,8 @@ const defaultSvgState = {
797
788
  childrenConfigs: [],
798
789
  attributes: defaultAttributes
799
790
  };
800
- /** @type {import('./props.type').IconProps} */
801
791
 
792
+ /** @type {import('./props.type').IconProps} */
802
793
  const iconDefaultProps = {
803
794
  name: undefined,
804
795
  width: 'auto',
@@ -808,8 +799,8 @@ const iconDefaultProps = {
808
799
  opacity: undefined,
809
800
  className: undefined
810
801
  };
811
- /** @type {import("react").FC<import('./props.type').IconProps>} */
812
802
 
803
+ /** @type {import("react").FC<import('./props.type').IconProps>} */
813
804
  const Icon = ({
814
805
  name,
815
806
  width,
@@ -828,10 +819,8 @@ const Icon = ({
828
819
  }, []);
829
820
  /** */
830
821
 
831
- const rootRef = useRef(
832
- /** @type {HTMLElement} */
833
- null); // this ref is used to cancel the fetch promise success callback in case name prop changed
834
-
822
+ const rootRef = useRef( /** @type {HTMLElement} */null);
823
+ // this ref is used to cancel the fetch promise success callback in case name prop changed
835
824
  const currentName = useRef(name);
836
825
  const [svgState, setSvgState] = useState(defaultSvgState);
837
826
  const styles = useStyles$1({
@@ -842,46 +831,41 @@ const Icon = ({
842
831
  opacity,
843
832
  hoverColor
844
833
  });
845
-
846
834
  const _className = useMemo(() => `${styles.root} ${className || ''}`, [className]);
847
-
848
835
  useEffect(() => {
849
836
  // reset
850
837
  currentName.current = name;
851
838
  setSvgState(defaultSvgState);
852
839
  const icon = icons[name];
853
-
854
840
  if (icon) {
855
841
  /**
856
842
  * retrieve from cache
857
843
  * @type {Promise<string>}
858
844
  */
859
845
  let svgProm = Icon.getCachedSvgPromise(name);
860
-
861
846
  if (!svgProm) {
862
847
  svgProm = fetch(icon.url).then(r => r.text()).catch(() => {
863
848
  // unset in cache
864
849
  Icon.setCachedSvgPromise(name, undefined);
865
850
  return null;
866
- }); //save in cache
867
-
851
+ });
852
+ //save in cache
868
853
  Icon.setCachedSvgPromise(name, svgProm);
869
854
  }
870
-
871
855
  svgProm.then(svg => {
872
856
  if (svg && isMounted.current && name === currentName.current) {
873
857
  const div = document.createElement('div');
874
- div.innerHTML = svg; // set the new attributes
858
+ div.innerHTML = svg;
875
859
 
860
+ // set the new attributes
876
861
  const newAttributes = {};
877
-
878
862
  for (const ob of div.firstElementChild.attributes) {
879
863
  const camelCased = ob.name.replace(/(-|:)([a-z])/g, g => g[1].toUpperCase());
880
864
  newAttributes[camelCased] = ob.value;
881
- } // setting the state in last.
882
- // Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
883
-
865
+ }
884
866
 
867
+ // setting the state in last.
868
+ // Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
885
869
  setSvgState({
886
870
  innerHtml: div.firstElementChild.innerHTML,
887
871
  childrenConfigs: icon.svgChildrenConfigs,
@@ -901,14 +885,11 @@ const Icon = ({
901
885
  onClick: onClick
902
886
  }));
903
887
  };
904
-
905
888
  Icon.defaultProps = iconDefaultProps;
906
- /** static properties for caching */
907
889
 
890
+ /** static properties for caching */
908
891
  Icon.cacheStore = {};
909
-
910
892
  Icon.getCachedSvgPromise = name => Icon.cacheStore[name];
911
-
912
893
  Icon.setCachedSvgPromise = (name, prom) => Icon.cacheStore[name] = prom;
913
894
 
914
895
  const useDropdownStyles = createUseStyles(theme => ({
@@ -1020,7 +1001,6 @@ function OptionList({
1020
1001
  isLandingPages
1021
1002
  }) {
1022
1003
  useContext(PageContext);
1023
-
1024
1004
  const tabsDataModifier = () => {
1025
1005
  return optionsData?.map(dt => {
1026
1006
  return {
@@ -1032,7 +1012,6 @@ function OptionList({
1032
1012
  };
1033
1013
  });
1034
1014
  };
1035
-
1036
1015
  const tabData = tabsDataModifier();
1037
1016
  const classes = useSectionStyles$a();
1038
1017
  return /*#__PURE__*/React.createElement("div", {
@@ -1121,31 +1100,24 @@ function DesktopHeader({
1121
1100
  const classes = useSectionStyles$a({
1122
1101
  isFixed
1123
1102
  });
1124
-
1125
1103
  const optionDataFn = () => {
1126
1104
  let optionsArr = navData;
1127
1105
  let optionsData = [];
1128
-
1129
1106
  if (optionsArr?.length > 5) {
1130
1107
  optionsData = optionsArr?.slice(0, 4);
1131
1108
  } else {
1132
1109
  optionsData = optionsArr;
1133
1110
  }
1134
-
1135
1111
  return optionsData;
1136
1112
  };
1137
-
1138
1113
  const moreContentFn = () => {
1139
1114
  let optionsArr = navData;
1140
1115
  let moreContent = [];
1141
-
1142
1116
  if (optionsArr?.length > 5) {
1143
1117
  moreContent = optionsArr?.slice(4);
1144
1118
  }
1145
-
1146
1119
  return moreContent;
1147
1120
  };
1148
-
1149
1121
  return /*#__PURE__*/React.createElement("nav", {
1150
1122
  className: classes.section
1151
1123
  }, /*#__PURE__*/React.createElement("div", {
@@ -1203,7 +1175,6 @@ function MobileHeader({
1203
1175
  const navEl = useRef(null);
1204
1176
  useLayoutEffect(() => {
1205
1177
  const body = navEl?.current?.ownerDocument?.body;
1206
-
1207
1178
  if (sideMenu) {
1208
1179
  body?.setAttribute('style', 'overflow: hidden;');
1209
1180
  } else {
@@ -1213,7 +1184,6 @@ function MobileHeader({
1213
1184
  let iosUrl = null;
1214
1185
  let androidUrl = null;
1215
1186
  let downloadLink = null;
1216
-
1217
1187
  if (isTutorWebsite) {
1218
1188
  if (header?.iosUrl) {
1219
1189
  iosUrl = /*#__PURE__*/React.createElement(Button, {
@@ -1236,7 +1206,6 @@ function MobileHeader({
1236
1206
  }
1237
1207
  });
1238
1208
  }
1239
-
1240
1209
  if (header?.androidURL) {
1241
1210
  androidUrl = /*#__PURE__*/React.createElement(Button, {
1242
1211
  data: {
@@ -1257,7 +1226,6 @@ function MobileHeader({
1257
1226
  }
1258
1227
  });
1259
1228
  }
1260
-
1261
1229
  if (iosUrl && androidUrl) {
1262
1230
  downloadLink = /*#__PURE__*/React.createElement("div", null, iosUrl, androidUrl);
1263
1231
  } else if (header?.iosUrl) {
@@ -1307,7 +1275,6 @@ function MobileHeader({
1307
1275
  downloadLink = null;
1308
1276
  }
1309
1277
  }
1310
-
1311
1278
  return /*#__PURE__*/React.createElement("nav", {
1312
1279
  ref: navEl,
1313
1280
  className: classes.section
@@ -1364,11 +1331,9 @@ function Header({
1364
1331
  isMobile,
1365
1332
  isTutorWebsite
1366
1333
  } = useContext(PageContext);
1367
-
1368
1334
  const filterHiddenNavs = () => {
1369
1335
  return data?.navs?.filter(dt => !dt.isHiddenNav);
1370
1336
  };
1371
-
1372
1337
  return isMobile ? /*#__PURE__*/React.createElement(MobileHeader, {
1373
1338
  navData: filterHiddenNavs(),
1374
1339
  header: data,
@@ -1724,7 +1689,6 @@ const rustTheme = {
1724
1689
  light: colors.lightRust,
1725
1690
  lightest: colors.lightestRust
1726
1691
  };
1727
-
1728
1692
  const generateThemePalette = themeColors => ({
1729
1693
  primary: themeColors,
1730
1694
  background: {
@@ -1747,7 +1711,6 @@ const generateThemePalette = themeColors => ({
1747
1711
  tertiary: colors.blueGrey
1748
1712
  }
1749
1713
  });
1750
-
1751
1714
  const bluePalette = generateThemePalette(blueTheme);
1752
1715
  const redPalette = generateThemePalette(redTheme);
1753
1716
  const orangePalette = generateThemePalette(orangeTheme);
@@ -1788,9 +1751,7 @@ const fontComponents = {
1788
1751
  'Merriweather Sans': MerriweatherSans,
1789
1752
  'Arima Madurai': ArimaMadurai
1790
1753
  };
1791
-
1792
1754
  const getFontComponent = font => fontComponents[font] || (() => null);
1793
-
1794
1755
  function FontSeeder({
1795
1756
  fontFamily
1796
1757
  }) {
@@ -1800,37 +1761,30 @@ function FontSeeder({
1800
1761
  const useRubikFont = createUseStyles$1({
1801
1762
  '@import': `url('https://fonts.googleapis.com/css2?family=Lato&family=Rubik:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap')`
1802
1763
  });
1803
-
1804
1764
  function Rubik() {
1805
1765
  // to import "Rubik" font css
1806
1766
  useRubikFont();
1807
1767
  return null;
1808
1768
  }
1809
-
1810
1769
  const useIbmPlexSansFont = createUseStyles$1({
1811
1770
  '@import': 'url(https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap)'
1812
1771
  });
1813
-
1814
1772
  function IbmPlexSans() {
1815
1773
  // to import "Ibm Plex Sans" font css
1816
1774
  useIbmPlexSansFont();
1817
1775
  return null;
1818
1776
  }
1819
-
1820
1777
  const useMerriweatherSansFont = createUseStyles$1({
1821
1778
  '@import': 'url(https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap)'
1822
1779
  });
1823
-
1824
1780
  function MerriweatherSans() {
1825
1781
  // to import "Merriweather Sans" font css
1826
1782
  useMerriweatherSansFont();
1827
1783
  return null;
1828
1784
  }
1829
-
1830
1785
  const useArimaMaduraiFont = createUseStyles$1({
1831
1786
  '@import': 'url(https://fonts.googleapis.com/css2?family=Arima+Madurai:wght@400;500;700&display=swap)'
1832
1787
  });
1833
-
1834
1788
  function ArimaMadurai() {
1835
1789
  // to import "Arima Madurai" font css
1836
1790
  useArimaMaduraiFont();
@@ -1861,9 +1815,7 @@ const TYPE_TO_COMPONENT_MAP$1 = {
1861
1815
  TILES_SECTION: /*#__PURE__*/lazy(() => Promise.resolve().then(function () { return index$1; })),
1862
1816
  EMAIL_DRIP_MARKET: /*#__PURE__*/lazy(() => Promise.resolve().then(function () { return index; }))
1863
1817
  };
1864
-
1865
1818
  const getCompToRender$1 = type => TYPE_TO_COMPONENT_MAP$1[type] || (() => null);
1866
-
1867
1819
  const MemoisedSection$1 = /*#__PURE__*/memo(({
1868
1820
  sectionData,
1869
1821
  extraProps
@@ -1880,9 +1832,7 @@ function SectionRenderer$1({
1880
1832
  extraProps
1881
1833
  }) {
1882
1834
  return /*#__PURE__*/React.createElement(Suspense, {
1883
- fallback: null
1884
- /*GIF maybe*/
1885
-
1835
+ fallback: null /*GIF maybe*/
1886
1836
  }, /*#__PURE__*/React.createElement(MemoisedSection$1, {
1887
1837
  sectionData: sectionData,
1888
1838
  extraProps: extraProps
@@ -1954,8 +1904,8 @@ function PageRenderer$1({
1954
1904
  isCustomWebsite,
1955
1905
  _id
1956
1906
  }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
1957
- const Wrapper = SectionWrapper || Fragment; // console.log("CONTEXT______", context)
1958
-
1907
+ const Wrapper = SectionWrapper || Fragment;
1908
+ // console.log("CONTEXT______", context)
1959
1909
  return /*#__PURE__*/React.createElement(ThemeProvider, {
1960
1910
  theme: theme
1961
1911
  }, /*#__PURE__*/React.createElement(PageContext.Provider, {
@@ -2178,23 +2128,18 @@ const getArrowRotationAngle = props => {
2178
2128
  switch (true) {
2179
2129
  case props.left:
2180
2130
  return 180;
2181
-
2182
2131
  case props.up:
2183
2132
  return 270;
2184
-
2185
2133
  case props.down:
2186
2134
  return 90;
2187
-
2188
2135
  case props.right:
2189
2136
  default:
2190
2137
  return 0;
2191
2138
  }
2192
2139
  };
2193
-
2194
2140
  const sizeHandler = ({
2195
2141
  size
2196
2142
  }) => size === 'small' ? '32px' : '48px';
2197
-
2198
2143
  const useArrowButtonStyles = createUseStyles(theme => ({
2199
2144
  arrowButtonContainer: {
2200
2145
  cursor: 'pointer',
@@ -2234,7 +2179,6 @@ function dotsToShow(i, n) {
2234
2179
  const leftToShow = i < elementsToShow / 2;
2235
2180
  const rightToShow = n - i - 1 < elementsToShow / 2;
2236
2181
  let leftCount, rightCount;
2237
-
2238
2182
  if (leftToShow) {
2239
2183
  leftCount = i;
2240
2184
  rightCount = elementsToShow - i - 1;
@@ -2245,13 +2189,11 @@ function dotsToShow(i, n) {
2245
2189
  leftCount = 2;
2246
2190
  rightCount = 2;
2247
2191
  }
2248
-
2249
2192
  return {
2250
2193
  leftCount,
2251
2194
  rightCount
2252
2195
  };
2253
2196
  }
2254
-
2255
2197
  function Carousel({
2256
2198
  settings,
2257
2199
  children,
@@ -2305,15 +2247,12 @@ function Carousel({
2305
2247
  ...settings,
2306
2248
  className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
2307
2249
  };
2308
-
2309
2250
  const nextClick = () => {
2310
2251
  sliderRef.current.slickNext();
2311
2252
  };
2312
-
2313
2253
  const previousClick = () => {
2314
2254
  sliderRef.current.slickPrev();
2315
2255
  };
2316
-
2317
2256
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Slider, _extends({
2318
2257
  ref: sliderRef
2319
2258
  }, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React.createElement("div", {
@@ -2340,21 +2279,21 @@ const NextImageRenderer = ({
2340
2279
  refSetter,
2341
2280
  className
2342
2281
  } = props;
2343
-
2344
2282
  if (isCustomWebsite) {
2345
- return /*#__PURE__*/React.createElement(require.resolve('next/image').default, {
2283
+ // return (React.createElement(require.resolve('next/image').default, {
2284
+ // src: src,
2285
+ // layout: 'fill',
2286
+ // ref: { refSetter },
2287
+ // className: { className },
2288
+ // ...props
2289
+ // });)
2290
+
2291
+ return /*#__PURE__*/React.createElement(Image, _extends({
2346
2292
  src: src,
2347
- // height: "640",
2348
- // width: "959",
2349
2293
  layout: 'fill',
2350
- ref: {
2351
- refSetter
2352
- },
2353
- className: {
2354
- className
2355
- },
2356
- ...props
2357
- });
2294
+ ref: refSetter,
2295
+ className: className
2296
+ }, props));
2358
2297
  } else {
2359
2298
  return /*#__PURE__*/React.createElement("img", {
2360
2299
  ref: refSetter,
@@ -2415,7 +2354,6 @@ function Section$4({
2415
2354
  src: nodeData.image.metadata.value
2416
2355
  }))));
2417
2356
  }
2418
-
2419
2357
  function BannerCarouselRight({
2420
2358
  sectionData
2421
2359
  }) {
@@ -2441,9 +2379,7 @@ function BannerCarouselRight({
2441
2379
  className: classes.sectionContainer
2442
2380
  }, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$4, {
2443
2381
  nodeData: node,
2444
- key: idx
2445
- /* or some other unique property */
2446
-
2382
+ key: idx /* or some other unique property */
2447
2383
  })))));
2448
2384
  }
2449
2385
 
@@ -2650,11 +2586,9 @@ function List({
2650
2586
  containerWidth
2651
2587
  });
2652
2588
  const [nodeData] = sectionData.components;
2653
-
2654
2589
  const getNumber = val => {
2655
2590
  return val.toString().length == 1 ? '0' + val : val;
2656
2591
  };
2657
-
2658
2592
  return /*#__PURE__*/React.createElement("section", {
2659
2593
  className: classes.section
2660
2594
  }, /*#__PURE__*/React.createElement("div", {
@@ -2740,12 +2674,13 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2740
2674
  padding: '100px 0',
2741
2675
  height: '100%',
2742
2676
  display: 'flex',
2743
- alignItems: 'center' // backgroundImage: ({ imageUrl } = {}) =>
2677
+ alignItems: 'center'
2678
+ // backgroundImage: ({ imageUrl } = {}) =>
2744
2679
  // `linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%), url("${imageUrl}")`,
2745
2680
  // backgroundPosition: 'center',
2746
2681
  // backgroundSize: 'cover'
2747
-
2748
2682
  },
2683
+
2749
2684
  centerBgImageContainer: {
2750
2685
  width: '100%',
2751
2686
  position: 'relative',
@@ -2875,7 +2810,6 @@ const Section$3 = ({
2875
2810
  className: classes?.centerBgImage
2876
2811
  }))));
2877
2812
  };
2878
-
2879
2813
  function BannerCarouselCenter({
2880
2814
  sectionData,
2881
2815
  isCustomWebsite
@@ -2895,9 +2829,7 @@ function BannerCarouselCenter({
2895
2829
  }, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$3, {
2896
2830
  nodeData: node,
2897
2831
  isCustomWebsite: isCustomWebsite,
2898
- key: idx
2899
- /* or some other unique property */
2900
-
2832
+ key: idx /* or some other unique property */
2901
2833
  }))));
2902
2834
  }
2903
2835
 
@@ -3067,7 +2999,6 @@ function Section$2({
3067
2999
  size: isMobile ? 'small' : 'medium'
3068
3000
  })));
3069
3001
  }
3070
-
3071
3002
  function BannerCarouselLeft({
3072
3003
  sectionData,
3073
3004
  isCustomWebsite
@@ -3091,9 +3022,7 @@ function BannerCarouselLeft({
3091
3022
  className: classes.sectionContainer
3092
3023
  }, /*#__PURE__*/React.createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$2, {
3093
3024
  nodeData: node,
3094
- key: idx
3095
- /* or some other unique property */
3096
-
3025
+ key: idx /* or some other unique property */
3097
3026
  })))));
3098
3027
  }
3099
3028
 
@@ -3248,7 +3177,6 @@ async function postApiCall(baseURLs, data) {
3248
3177
  },
3249
3178
  data
3250
3179
  });
3251
-
3252
3180
  if (res) {
3253
3181
  return res.data;
3254
3182
  }
@@ -3273,7 +3201,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
3273
3201
  if (extraProps && extraProps.formSubmitSuccess) {
3274
3202
  extraProps.formSubmitSuccess();
3275
3203
  }
3276
-
3277
3204
  return res.data;
3278
3205
  });
3279
3206
  } catch (err) {
@@ -3386,7 +3313,6 @@ function SubscribeToNewsletter({
3386
3313
  const [inputVal, setInputVal] = useState(formInitialValue);
3387
3314
  let [isValid, setIsValid] = useState(true);
3388
3315
  let [btnDisabled, setBtnDisabled] = useState(false);
3389
-
3390
3316
  const handleSubmit = () => {
3391
3317
  let data = {
3392
3318
  sectionId: sectionData.sectionId,
@@ -3402,11 +3328,9 @@ function SubscribeToNewsletter({
3402
3328
  setBtnDisabled(true);
3403
3329
  setInputVal(formInitialValue);
3404
3330
  };
3405
-
3406
3331
  const checkValidity = () => {
3407
3332
  if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
3408
3333
  let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
3409
-
3410
3334
  if (regex?.test(inputVal)) {
3411
3335
  setIsValid(true);
3412
3336
  } else {
@@ -3414,7 +3338,6 @@ function SubscribeToNewsletter({
3414
3338
  }
3415
3339
  }
3416
3340
  };
3417
-
3418
3341
  useEffect(() => {
3419
3342
  if (!isValid) {
3420
3343
  setBtnDisabled(true);
@@ -3764,7 +3687,6 @@ function Section$1({
3764
3687
  className: classes.contentRow
3765
3688
  }, carouselContent))));
3766
3689
  }
3767
-
3768
3690
  function Testimonials({
3769
3691
  sectionData
3770
3692
  }) {
@@ -3829,7 +3751,6 @@ const loaderStyle = theme => ({
3829
3751
  });
3830
3752
 
3831
3753
  const useStyles = createUseStyles$1(loaderStyle);
3832
-
3833
3754
  function Loader({
3834
3755
  texts
3835
3756
  }) {
@@ -3841,13 +3762,11 @@ function Loader({
3841
3762
  useEffect(() => {
3842
3763
  if (texts && texts.length) {
3843
3764
  let textID = '';
3844
-
3845
3765
  for (let i = 0; i < texts.length; i++) {
3846
3766
  textID = setTimeout(() => {
3847
3767
  setLoaderText(texts[i]);
3848
3768
  }, 2000 * i);
3849
3769
  }
3850
-
3851
3770
  return () => {
3852
3771
  clearTimeout(textID);
3853
3772
  };
@@ -3917,18 +3836,15 @@ function VideoPlayer(props) {
3917
3836
  imageUrl: imageUrl
3918
3837
  });
3919
3838
  const theme = useTheme();
3920
-
3921
3839
  function getId(url) {
3922
3840
  var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
3923
3841
  var match = url?.match(regExp);
3924
-
3925
3842
  if (match?.[2].length == 11) {
3926
3843
  return 'https://www.youtube.com/embed/' + match[2];
3927
3844
  } else {
3928
3845
  return url;
3929
3846
  }
3930
3847
  }
3931
-
3932
3848
  return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoaded && /*#__PURE__*/React.createElement("div", {
3933
3849
  className: classes.imgContainer
3934
3850
  }, /*#__PURE__*/React.createElement(NextImageRenderer, {
@@ -4774,8 +4690,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
4774
4690
  width: 'calc(100% - 2px)',
4775
4691
  position: 'relative',
4776
4692
  paddingBottom: '59.83%' // keeping aspect ratio 585x350
4777
-
4778
4693
  },
4694
+
4779
4695
  contentRow: {
4780
4696
  display: 'grid',
4781
4697
  gridTemplateColumns: ({
@@ -5033,7 +4949,6 @@ const FAQListing = ({
5033
4949
  isSelected: selectedIndex === index
5034
4950
  })))));
5035
4951
  };
5036
-
5037
4952
  const Accordion = ({
5038
4953
  item,
5039
4954
  isSelected,
@@ -5320,9 +5235,10 @@ const useCourseStyles = createUseStyles(theme => {
5320
5235
  flexGrow: 1,
5321
5236
  display: 'flex',
5322
5237
  flexDirection: 'column',
5323
- justifyContent: 'space-between' //alignItems: 'center',
5324
-
5238
+ justifyContent: 'space-between'
5239
+ //alignItems: 'center',
5325
5240
  },
5241
+
5326
5242
  courseCardTags: {
5327
5243
  display: 'flex',
5328
5244
  justifyContent: 'flex-start',
@@ -5348,11 +5264,12 @@ const useCourseStyles = createUseStyles(theme => {
5348
5264
  wordBreak: 'break-word',
5349
5265
  padding: '12px 0px',
5350
5266
  textAlign: 'left',
5351
- display: 'inline-block' // overflow: 'hidden',
5267
+ display: 'inline-block'
5268
+ // overflow: 'hidden',
5352
5269
  // whiteSpace: 'nowrap',
5353
5270
  // textOverflow: 'ellipsis'
5354
-
5355
5271
  },
5272
+
5356
5273
  courseCardDiscount: {
5357
5274
  display: 'flex',
5358
5275
  justifyContent: 'flex-start',
@@ -5434,7 +5351,8 @@ const useCourseStyles = createUseStyles(theme => {
5434
5351
  }
5435
5352
  },
5436
5353
  '@media (max-width: 768px)': {
5437
- coursesContainer: {//background: theme?.palette?.background?.primary
5354
+ coursesContainer: {
5355
+ //background: theme?.palette?.background?.primary
5438
5356
  },
5439
5357
  coursesCardAndText: {
5440
5358
  padding: '70px 30px'
@@ -5466,7 +5384,6 @@ async function getCourseList(baseURLs, hashToken) {
5466
5384
  if (!hashToken) {
5467
5385
  throw 'Missing hash token';
5468
5386
  }
5469
-
5470
5387
  const res = await axios({
5471
5388
  method: 'get',
5472
5389
  baseURL: baseURLs?.API_COURSE_URL,
@@ -5478,7 +5395,6 @@ async function getCourseList(baseURLs, hashToken) {
5478
5395
  requiredFilters: '[10]'
5479
5396
  }
5480
5397
  });
5481
-
5482
5398
  if (res) {
5483
5399
  return res.data;
5484
5400
  }
@@ -5490,7 +5406,6 @@ function getShortenedSubstring(name, length, allowDots = true) {
5490
5406
  if (name) {
5491
5407
  return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
5492
5408
  }
5493
-
5494
5409
  return '';
5495
5410
  }
5496
5411
 
@@ -5568,13 +5483,11 @@ function courses({
5568
5483
  containerWidth
5569
5484
  });
5570
5485
  const [nodeData] = sectionData?.components;
5571
-
5572
5486
  const handleApiCall = () => {
5573
5487
  if (baseURLs) {
5574
5488
  getCourseList(baseURLs, hashToken).then(response => {
5575
5489
  const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
5576
5490
  const coursesData = response?.data?.coursesData;
5577
-
5578
5491
  if (coursesData && coursesData.length) {
5579
5492
  setCardList(response?.data?.coursesData);
5580
5493
  setShowShimmer(false);
@@ -5585,12 +5498,12 @@ function courses({
5585
5498
  setShowShimmer(false);
5586
5499
  setFallbackImages(placeholders);
5587
5500
  }
5588
- } // For User Website & Draft Preview: If no data found, hide section.
5501
+ }
5502
+ // For User Website & Draft Preview: If no data found, hide section.
5589
5503
  else setErrored(true);
5590
5504
  }
5591
5505
  }).catch(err => {
5592
5506
  const errMsg = err?.response?.data?.data?.message;
5593
-
5594
5507
  if (errMsg === 'NOT_FOUND') {
5595
5508
  if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
5596
5509
  setShowShimmer(false);
@@ -5602,16 +5515,16 @@ function courses({
5602
5515
  });
5603
5516
  }
5604
5517
  };
5605
-
5606
5518
  useEffect(() => {
5607
- const placeholders = nodeData?.cardCarousel?.metadata?.placeholders; // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
5608
-
5519
+ const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
5520
+ // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
5609
5521
  if (isMasterTemplate) {
5610
5522
  if (placeholders && placeholders.length) {
5611
5523
  setShowShimmer(false);
5612
5524
  setFallbackImages(placeholders);
5613
5525
  }
5614
- } // other
5526
+ }
5527
+ // other
5615
5528
  else {
5616
5529
  handleApiCall();
5617
5530
  }
@@ -5676,7 +5589,6 @@ function courses({
5676
5589
  });
5677
5590
  })))));
5678
5591
  }
5679
-
5680
5592
  function SimpleCardsContainer({
5681
5593
  children,
5682
5594
  classes
@@ -6092,7 +6004,6 @@ function FormEnquiry({
6092
6004
  setBtnDisabled(true);
6093
6005
  }
6094
6006
  }, [validData]);
6095
-
6096
6007
  const handleSubmit = () => {
6097
6008
  let data = {
6098
6009
  sectionId: sectionData?._id || null,
@@ -6103,23 +6014,22 @@ function FormEnquiry({
6103
6014
  setBtnDisabled(true);
6104
6015
  setInputVal(formInitialValue);
6105
6016
  };
6106
-
6107
6017
  const checkValidity = (regexField, fieldname, fieldValidity) => {
6108
6018
  if (validations?.[regexField]?.length) {
6109
6019
  let regex = new RegExp(validations[regexField]);
6110
-
6111
6020
  if (regex?.test(inputVal[fieldname])) {
6112
- setValidData({ ...validData,
6021
+ setValidData({
6022
+ ...validData,
6113
6023
  [fieldValidity]: 1
6114
6024
  });
6115
6025
  } else {
6116
- setValidData({ ...validData,
6026
+ setValidData({
6027
+ ...validData,
6117
6028
  [fieldValidity]: 0
6118
6029
  });
6119
6030
  }
6120
6031
  }
6121
6032
  };
6122
-
6123
6033
  return /*#__PURE__*/React.createElement("section", {
6124
6034
  className: classes.section
6125
6035
  }, /*#__PURE__*/React.createElement("div", {
@@ -6199,7 +6109,8 @@ function FormEnquiry({
6199
6109
  isValid: validData.nameValid,
6200
6110
  inputType: 'input',
6201
6111
  onChange: e => {
6202
- setInputVal({ ...inputVal,
6112
+ setInputVal({
6113
+ ...inputVal,
6203
6114
  name: e.target.value
6204
6115
  });
6205
6116
  },
@@ -6207,7 +6118,8 @@ function FormEnquiry({
6207
6118
  checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
6208
6119
  },
6209
6120
  onFocus: () => {
6210
- setValidData({ ...validData,
6121
+ setValidData({
6122
+ ...validData,
6211
6123
  nameValid: 1
6212
6124
  });
6213
6125
  }
@@ -6219,7 +6131,8 @@ function FormEnquiry({
6219
6131
  isValid: validData.phoneValid,
6220
6132
  inputType: 'input',
6221
6133
  onChange: e => {
6222
- setInputVal({ ...inputVal,
6134
+ setInputVal({
6135
+ ...inputVal,
6223
6136
  phone: e.target.value
6224
6137
  });
6225
6138
  },
@@ -6227,7 +6140,8 @@ function FormEnquiry({
6227
6140
  checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
6228
6141
  },
6229
6142
  onFocus: () => {
6230
- setValidData({ ...validData,
6143
+ setValidData({
6144
+ ...validData,
6231
6145
  phoneValid: 1
6232
6146
  });
6233
6147
  }
@@ -6239,7 +6153,8 @@ function FormEnquiry({
6239
6153
  isValid: validData.emailValid,
6240
6154
  inputType: 'input',
6241
6155
  onChange: e => {
6242
- setInputVal({ ...inputVal,
6156
+ setInputVal({
6157
+ ...inputVal,
6243
6158
  email: e.target.value
6244
6159
  });
6245
6160
  },
@@ -6247,7 +6162,8 @@ function FormEnquiry({
6247
6162
  checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
6248
6163
  },
6249
6164
  onFocus: () => {
6250
- setValidData({ ...validData,
6165
+ setValidData({
6166
+ ...validData,
6251
6167
  emailValid: 1
6252
6168
  });
6253
6169
  }
@@ -6259,7 +6175,8 @@ function FormEnquiry({
6259
6175
  isValid: validData.messageValid,
6260
6176
  inputType: 'textarea',
6261
6177
  onChange: e => {
6262
- setInputVal({ ...inputVal,
6178
+ setInputVal({
6179
+ ...inputVal,
6263
6180
  message: e.target.value
6264
6181
  });
6265
6182
  },
@@ -6267,7 +6184,8 @@ function FormEnquiry({
6267
6184
  checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
6268
6185
  },
6269
6186
  onFocus: () => {
6270
- setValidData({ ...validData,
6187
+ setValidData({
6188
+ ...validData,
6271
6189
  messageValid: 1
6272
6190
  });
6273
6191
  }
@@ -6364,11 +6282,12 @@ const useSectionStyles = createUseStyles(theme => ({
6364
6282
  flexDirection: 'column',
6365
6283
  width: '85%',
6366
6284
  position: 'relative',
6367
- paddingBottom: '55%' // '& img': {
6285
+ paddingBottom: '55%'
6286
+ // '& img': {
6368
6287
  // width: '80%'
6369
6288
  // }
6370
-
6371
6289
  },
6290
+
6372
6291
  telephoneImage: {
6373
6292
  width: '80%'
6374
6293
  },
@@ -6507,7 +6426,6 @@ function Contact({
6507
6426
  phoneValid: 1,
6508
6427
  messageValid: 1
6509
6428
  });
6510
-
6511
6429
  const handleSubmit = () => {
6512
6430
  const data = {
6513
6431
  sectionId: sectionData?._id || null,
@@ -6518,7 +6436,6 @@ function Contact({
6518
6436
  setBtnDisabled(true);
6519
6437
  setInputVal(formInitialValue);
6520
6438
  };
6521
-
6522
6439
  useEffect(() => {
6523
6440
  if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
6524
6441
  setBtnDisabled(false);
@@ -6526,23 +6443,22 @@ function Contact({
6526
6443
  setBtnDisabled(true);
6527
6444
  }
6528
6445
  }, [validData]);
6529
-
6530
6446
  const checkValidity = (regexField, fieldname, fieldValidity) => {
6531
6447
  if (validations?.[regexField]?.length) {
6532
6448
  let regex = new RegExp(validations[regexField]);
6533
-
6534
6449
  if (regex?.test(inputVal[fieldname])) {
6535
- setValidData({ ...validData,
6450
+ setValidData({
6451
+ ...validData,
6536
6452
  [fieldValidity]: 1
6537
6453
  });
6538
6454
  } else {
6539
- setValidData({ ...validData,
6455
+ setValidData({
6456
+ ...validData,
6540
6457
  [fieldValidity]: 0
6541
6458
  });
6542
6459
  }
6543
6460
  }
6544
6461
  };
6545
-
6546
6462
  return /*#__PURE__*/React.createElement("section", {
6547
6463
  className: classes.section
6548
6464
  }, /*#__PURE__*/React.createElement("div", {
@@ -6584,7 +6500,8 @@ function Contact({
6584
6500
  isValid: validData.nameValid,
6585
6501
  inputType: 'input',
6586
6502
  onChange: e => {
6587
- setInputVal({ ...inputVal,
6503
+ setInputVal({
6504
+ ...inputVal,
6588
6505
  name: e.target.value
6589
6506
  });
6590
6507
  },
@@ -6592,7 +6509,8 @@ function Contact({
6592
6509
  checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
6593
6510
  },
6594
6511
  onFocus: () => {
6595
- setValidData({ ...validData,
6512
+ setValidData({
6513
+ ...validData,
6596
6514
  nameValid: 1
6597
6515
  });
6598
6516
  }
@@ -6604,7 +6522,8 @@ function Contact({
6604
6522
  isValid: validData.phoneValid,
6605
6523
  inputType: 'input',
6606
6524
  onChange: e => {
6607
- setInputVal({ ...inputVal,
6525
+ setInputVal({
6526
+ ...inputVal,
6608
6527
  phone: e.target.value
6609
6528
  });
6610
6529
  },
@@ -6612,7 +6531,8 @@ function Contact({
6612
6531
  checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
6613
6532
  },
6614
6533
  onFocus: () => {
6615
- setValidData({ ...validData,
6534
+ setValidData({
6535
+ ...validData,
6616
6536
  phoneValid: 1
6617
6537
  });
6618
6538
  }
@@ -6624,7 +6544,8 @@ function Contact({
6624
6544
  isValid: validData.emailValid,
6625
6545
  inputType: 'input',
6626
6546
  onChange: e => {
6627
- setInputVal({ ...inputVal,
6547
+ setInputVal({
6548
+ ...inputVal,
6628
6549
  email: e.target.value
6629
6550
  });
6630
6551
  },
@@ -6632,7 +6553,8 @@ function Contact({
6632
6553
  checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
6633
6554
  },
6634
6555
  onFocus: () => {
6635
- setValidData({ ...validData,
6556
+ setValidData({
6557
+ ...validData,
6636
6558
  emailValid: 1
6637
6559
  });
6638
6560
  }
@@ -6644,7 +6566,8 @@ function Contact({
6644
6566
  isValid: validData.messageValid,
6645
6567
  inputType: 'textarea',
6646
6568
  onChange: e => {
6647
- setInputVal({ ...inputVal,
6569
+ setInputVal({
6570
+ ...inputVal,
6648
6571
  message: e.target.value
6649
6572
  });
6650
6573
  },
@@ -6652,7 +6575,8 @@ function Contact({
6652
6575
  checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
6653
6576
  },
6654
6577
  onFocus: () => {
6655
- setValidData({ ...validData,
6578
+ setValidData({
6579
+ ...validData,
6656
6580
  messageValid: 1
6657
6581
  });
6658
6582
  }
@@ -6913,7 +6837,8 @@ const useWebinarPromotionPage = createUseStyles(theme => {
6913
6837
  const SingleVideoSlide$1 = props => {
6914
6838
  const [isReadMore, setIsReadMore] = useState(false);
6915
6839
  const theme = useTheme();
6916
- useEffect(() => {// remaining days epoch
6840
+ useEffect(() => {
6841
+ // remaining days epoch
6917
6842
  // current date epoch
6918
6843
  // subtract remaining days from current day epoch
6919
6844
  // moment the result - and see if there are days
@@ -6925,7 +6850,6 @@ const SingleVideoSlide$1 = props => {
6925
6850
  webinarCtaClick,
6926
6851
  conversions = 0
6927
6852
  } = props;
6928
-
6929
6853
  const renderer = ({
6930
6854
  days,
6931
6855
  hours,
@@ -6941,9 +6865,7 @@ const SingleVideoSlide$1 = props => {
6941
6865
  return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
6942
6866
  }
6943
6867
  };
6944
-
6945
6868
  const checkIfOfferIsValid = () => moment().diff(moment(props.data.offerPriceEndDate)) < 0;
6946
-
6947
6869
  const checkForShowDiscount = () => {
6948
6870
  if (props.data.endDate === null || checkIfOfferIsValid()) {
6949
6871
  if (data.discount > 0 && data.offerPriceValidFor === 0) {
@@ -6955,19 +6877,16 @@ const SingleVideoSlide$1 = props => {
6955
6877
  if (data.offerPriceValidFor <= conversions) {
6956
6878
  return false;
6957
6879
  }
6958
-
6959
6880
  if (data.offerPriceValidFor - conversions < 0) {
6960
6881
  return false;
6961
6882
  } else {
6962
6883
  return true;
6963
6884
  }
6964
6885
  }
6965
-
6966
6886
  if (data.discount > 0) {
6967
6887
  return true;
6968
6888
  }
6969
6889
  };
6970
-
6971
6890
  const discount = ({
6972
6891
  price,
6973
6892
  discount
@@ -6975,7 +6894,6 @@ const SingleVideoSlide$1 = props => {
6975
6894
  console.log('discountxx', props.data.price, props.data.discount);
6976
6895
  return (discount / price * 100).toFixed(2);
6977
6896
  };
6978
-
6979
6897
  const classes = useWebinarPromotionPage();
6980
6898
  return /*#__PURE__*/React.createElement("div", {
6981
6899
  className: classes.videoCarouselContainer
@@ -7071,9 +6989,10 @@ const SingleVideoSlide$1 = props => {
7071
6989
  data: {
7072
6990
  // link: 'headerData?.loginCtaLink',
7073
6991
  // isLink: 1,
7074
- value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW' // isExternal: 1
7075
-
6992
+ value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
6993
+ // isExternal: 1
7076
6994
  },
6995
+
7077
6996
  onClick: webinarCtaClick,
7078
6997
  type: 'primary',
7079
6998
  size: 'medium',
@@ -7407,14 +7326,14 @@ const SingleVideoSlide = props => {
7407
7326
  isEdit
7408
7327
  } = useContext(PageContext);
7409
7328
  console.log(isEdit, 'isEdit');
7410
- useEffect(() => {// remaining days epoch
7329
+ useEffect(() => {
7330
+ // remaining days epoch
7411
7331
  // current date epoch
7412
7332
  // subtract remaining days from current day epoch
7413
7333
  // moment the result - and see if there are days
7414
7334
  // days is present show days
7415
7335
  // else start reverse timer
7416
7336
  }, []);
7417
-
7418
7337
  const renderer = ({
7419
7338
  days,
7420
7339
  hours,
@@ -7430,7 +7349,6 @@ const SingleVideoSlide = props => {
7430
7349
  return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
7431
7350
  }
7432
7351
  };
7433
-
7434
7352
  const {
7435
7353
  data,
7436
7354
  courseBuyNow,
@@ -7439,9 +7357,7 @@ const SingleVideoSlide = props => {
7439
7357
  } = props;
7440
7358
  const showCourseInstallmentData = data?.courseOverviewData;
7441
7359
  const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
7442
-
7443
7360
  const checkIfOfferIsValid = () => moment().diff(moment(props?.data?.endDate || 0)) < 0;
7444
-
7445
7361
  const checkForShowDiscount = () => {
7446
7362
  if (props.data.endDate === null || checkIfOfferIsValid()) {
7447
7363
  if (data.discount > 0 && data.offerPriceValidFor === 0) {
@@ -7453,28 +7369,23 @@ const SingleVideoSlide = props => {
7453
7369
  if (data.offerPriceValidFor <= conversions) {
7454
7370
  return false;
7455
7371
  }
7456
-
7457
7372
  if (data.offerPriceValidFor - conversions < 0) {
7458
7373
  return false;
7459
7374
  } else {
7460
7375
  return true;
7461
7376
  }
7462
7377
  }
7463
-
7464
7378
  if (data.discount > 0) {
7465
7379
  return true;
7466
7380
  }
7467
7381
  };
7468
-
7469
7382
  const classes = useCoursePromotionPage();
7470
-
7471
7383
  const discount = ({
7472
7384
  price,
7473
7385
  discount
7474
7386
  }) => {
7475
7387
  return (discount / price * 100).toFixed(2);
7476
7388
  };
7477
-
7478
7389
  return /*#__PURE__*/React.createElement("div", {
7479
7390
  className: classes.videoCarouselContainer
7480
7391
  }, /*#__PURE__*/React.createElement("div", {
@@ -7588,15 +7499,16 @@ const SingleVideoSlide = props => {
7588
7499
  data: {
7589
7500
  // link: 'headerData?.loginCtaLink',
7590
7501
  // isLink: 1,
7591
- value: 'BUY NOW' // isExternal: 1
7592
-
7502
+ value: 'BUY NOW'
7503
+ // isExternal: 1
7593
7504
  },
7505
+
7594
7506
  onClick: courseBuyNow,
7595
7507
  type: 'primary',
7596
7508
  size: 'medium',
7597
7509
  target: null,
7598
- rel: null // styling={isMobile ? { margin: '0 40px' } : {}}
7599
-
7510
+ rel: null
7511
+ // styling={isMobile ? { margin: '0 40px' } : {}}
7600
7512
  })))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React.createElement("div", {
7601
7513
  className: classes.payInstallmentContainer,
7602
7514
  onClick: showCourseInstallment
@@ -7801,18 +7713,15 @@ const FormPage = ({
7801
7713
  _id,
7802
7714
  baseURLs
7803
7715
  } = useContext(PageContext);
7804
-
7805
7716
  const handleSubmit = async e => {
7806
7717
  e.preventDefault();
7807
7718
  let formResponse = [];
7808
-
7809
7719
  for (const [key, value] of Object.entries(formData)) {
7810
7720
  if (value.questionType === 'MC') {
7811
7721
  if (value.solutionArray.length > 1) {
7812
7722
  value.solutionArray.shift();
7813
7723
  }
7814
7724
  }
7815
-
7816
7725
  formResponse.push({
7817
7726
  questionId: key,
7818
7727
  questionName: value.questionName,
@@ -7820,7 +7729,6 @@ const FormPage = ({
7820
7729
  solutionArray: value.solutionArray
7821
7730
  });
7822
7731
  }
7823
-
7824
7732
  const data = {
7825
7733
  sectionId: sectionData?.components?.[0]?._id || null,
7826
7734
  landingPageId: _id || null,
@@ -7830,7 +7738,6 @@ const FormPage = ({
7830
7738
  setFormData({});
7831
7739
  setformSubmitted(!formSubmitted);
7832
7740
  };
7833
-
7834
7741
  useEffect(() => {
7835
7742
  //add all questions to formData
7836
7743
  let formData = {};
@@ -7843,23 +7750,26 @@ const FormPage = ({
7843
7750
  });
7844
7751
  setFormData(formData);
7845
7752
  }, [metadata, formSubmitted]);
7846
-
7847
7753
  const handleOnClick = (e, item, option) => {
7848
7754
  // if the checkbox is checked
7849
7755
  if (!e.target.checked) {
7850
7756
  // if the checkbox is checked and the solution array is empty
7851
7757
  if (!formData[item._id]?.solutionArray?.length) {
7852
- setFormData({ ...formData,
7758
+ setFormData({
7759
+ ...formData,
7853
7760
  [item._id]: {
7854
7761
  questionName: item.text,
7855
7762
  solutionArray: [option.value],
7856
7763
  questionType: 'MC'
7857
7764
  }
7858
7765
  });
7859
- } // if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
7766
+ }
7767
+ // if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
7860
7768
  else if (formData[item._id]?.solutionArray?.includes(option.value)) {
7861
7769
  // if only one value is in the array remove it
7862
- setFormData({ ...formData,
7770
+
7771
+ setFormData({
7772
+ ...formData,
7863
7773
  [item._id]: {
7864
7774
  questionName: item.text,
7865
7775
  solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
@@ -7867,20 +7777,24 @@ const FormPage = ({
7867
7777
  }
7868
7778
  });
7869
7779
  }
7870
- } // if the checkbox is unchecked
7780
+ }
7781
+ // if the checkbox is unchecked
7871
7782
  else {
7872
7783
  // if the checkbox is unchecked and the solution array is empty
7873
7784
  if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
7874
- setFormData({ ...formData,
7785
+ setFormData({
7786
+ ...formData,
7875
7787
  [item._id]: {
7876
7788
  questionName: item.text,
7877
7789
  solutionArray: [option.value],
7878
7790
  questionType: 'MC'
7879
7791
  }
7880
7792
  });
7881
- } // if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
7793
+ }
7794
+ // if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
7882
7795
  else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
7883
- setFormData({ ...formData,
7796
+ setFormData({
7797
+ ...formData,
7884
7798
  [item._id]: {
7885
7799
  questionName: item.text,
7886
7800
  solutionArray: [...formData[item._id]?.solutionArray, option.value],
@@ -7890,7 +7804,6 @@ const FormPage = ({
7890
7804
  }
7891
7805
  }
7892
7806
  };
7893
-
7894
7807
  return /*#__PURE__*/React.createElement("section", {
7895
7808
  className: classes.formPageSection
7896
7809
  }, /*#__PURE__*/React.createElement("div", {
@@ -7917,7 +7830,8 @@ const FormPage = ({
7917
7830
  placeholder: "Short answer",
7918
7831
  name: item._id,
7919
7832
  onChange: e => {
7920
- setFormData({ ...formData,
7833
+ setFormData({
7834
+ ...formData,
7921
7835
  [item._id]: {
7922
7836
  index,
7923
7837
  questionName: item.text,
@@ -7957,11 +7871,13 @@ const FormPage = ({
7957
7871
  name: "text",
7958
7872
  required: item.isRequired,
7959
7873
  value: option.value,
7960
- checked: formData[item._id]?.solutionArray?.[0] === option.value // name={option.value}
7874
+ checked: formData[item._id]?.solutionArray?.[0] === option.value
7875
+ // name={option.value}
7961
7876
  // id={option.value}
7962
7877
  ,
7963
7878
  onClick: e => {
7964
- setFormData({ ...formData,
7879
+ setFormData({
7880
+ ...formData,
7965
7881
  [item._id]: {
7966
7882
  questionName: item.text,
7967
7883
  solutionArray: [option.value],
@@ -7977,9 +7893,10 @@ const FormPage = ({
7977
7893
  data: {
7978
7894
  // link: 'headerData?.loginCtaLink',
7979
7895
  // isLink: 1,
7980
- value: 'SUBMIT' // isExternal: 1
7981
-
7896
+ value: 'SUBMIT'
7897
+ // isExternal: 1
7982
7898
  },
7899
+
7983
7900
  type: 'primary',
7984
7901
  size: 'medium',
7985
7902
  target: null,
@@ -8073,7 +7990,6 @@ function Tiles({
8073
7990
  const nodeData = sectionData.components;
8074
7991
  console.log(nodeData);
8075
7992
  const tilesList = nodeData[0]?.tilesList.components;
8076
-
8077
7993
  const handleClick = value => {
8078
7994
  if (!isEdit && value) {
8079
7995
  if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
@@ -8083,7 +7999,6 @@ function Tiles({
8083
7999
  }
8084
8000
  }
8085
8001
  };
8086
-
8087
8002
  const TileDiv = tilesList?.map((tile, i) => {
8088
8003
  return /*#__PURE__*/React.createElement(Fragment, {
8089
8004
  key: i
@@ -8146,8 +8061,8 @@ const useEmailStyles = createUseStyles(theme => ({
8146
8061
  width: 'auto',
8147
8062
  height: '48px'
8148
8063
  /* margin: 18px 0px; */
8149
-
8150
8064
  },
8065
+
8151
8066
  'p-young-guru-title': {
8152
8067
  fontFamily: theme?.typography?.fontFamily,
8153
8068
  fontStyle: 'normal',
@@ -8174,8 +8089,8 @@ const useEmailStyles = createUseStyles(theme => ({
8174
8089
  fontSize: '0',
8175
8090
  textAlign: 'center'
8176
8091
  /* padding:35px 0 40px */
8177
-
8178
8092
  },
8093
+
8179
8094
  'two-columns .column': {
8180
8095
  width: '100%',
8181
8096
  maxWidth: '275px',
@@ -8191,9 +8106,10 @@ const useEmailStyles = createUseStyles(theme => ({
8191
8106
  color: '#030a21',
8192
8107
  marginBottom: '5px',
8193
8108
  textAlign: 'left'
8194
- } // @media screen and (max-width: 600px) {
8195
- // }
8109
+ }
8196
8110
 
8111
+ // @media screen and (max-width: 600px) {
8112
+ // }
8197
8113
  }));
8198
8114
 
8199
8115
  function Section({
@@ -8222,8 +8138,8 @@ function Section({
8222
8138
  }, /*#__PURE__*/React.createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React.createElement("div", {
8223
8139
  className: classes.email_description_para,
8224
8140
  dangerouslySetInnerHTML: {
8225
- __html: `${customHtmlData?.html ? customHtmlData?.html : ''}` // __html: '<div>sdnfksdnflksdnfklsndk</div>'
8226
-
8141
+ __html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
8142
+ // __html: '<div>sdnfksdnflksdnfklsndk</div>'
8227
8143
  }
8228
8144
  }) : /*#__PURE__*/React.createElement(React.Fragment, null, header?.isActive ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("table", {
8229
8145
  style: {
@@ -8256,7 +8172,8 @@ function Section({
8256
8172
  textAlign: 'center'
8257
8173
  }
8258
8174
  }, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React.createElement("img", {
8259
- src: header?.components[1]?.metadata?.image // width={600}
8175
+ src: header?.components[1]?.metadata?.image
8176
+ // width={600}
8260
8177
  ,
8261
8178
  alt: "",
8262
8179
  style: {
@@ -8542,14 +8459,12 @@ function Section({
8542
8459
  }
8543
8460
  }, "All rights reserved.")))))))))))))) : null)))));
8544
8461
  }
8545
-
8546
8462
  function EmailDripMarket({
8547
8463
  sectionData,
8548
8464
  extraProps = {}
8549
8465
  }) {
8550
8466
  console.log('extrapropstemplate', extraProps);
8551
8467
  const isInitialMount = useRef(true);
8552
-
8553
8468
  const convertToHtml = sectionData => {
8554
8469
  const html = ReactDOMServer.renderToStaticMarkup( /*#__PURE__*/React.createElement(Section, {
8555
8470
  nodeData: sectionData,
@@ -8559,15 +8474,15 @@ function EmailDripMarket({
8559
8474
  }));
8560
8475
  return html;
8561
8476
  };
8562
-
8563
8477
  useEffect(() => {
8564
8478
  if (isInitialMount.current) {
8565
8479
  isInitialMount.current = false;
8566
8480
  } else {
8567
8481
  extraProps?.callbackHtml(convertToHtml(sectionData));
8568
8482
  }
8569
- }, [extraProps?.convertedHtml]); // const mockData = sectionData?.sections[0];
8483
+ }, [extraProps?.convertedHtml]);
8570
8484
 
8485
+ // const mockData = sectionData?.sections[0];
8571
8486
  const emailRef = useRef(null);
8572
8487
  return /*#__PURE__*/React.createElement("section", {
8573
8488
  style: {
@@ -8577,7 +8492,6 @@ function EmailDripMarket({
8577
8492
  }, /*#__PURE__*/React.createElement("div", {
8578
8493
  onClick: e => {
8579
8494
  e.stopPropagation(); // prevent the click from event Capturing, in email onClick events do not work
8580
-
8581
8495
  e.preventDefault();
8582
8496
  }
8583
8497
  }, /*#__PURE__*/React.createElement(Section, {
@@ -8616,9 +8530,7 @@ const TYPE_TO_COMPONENT_MAP = {
8616
8530
  TILES_SECTION: Tiles,
8617
8531
  EMAIL_DRIP_MARKET: EmailDripMarket
8618
8532
  };
8619
-
8620
8533
  const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
8621
-
8622
8534
  const MemoisedSection = /*#__PURE__*/memo(({
8623
8535
  sectionData,
8624
8536
  extraProps,
@@ -8740,11 +8652,9 @@ const componentParser = compObj => {
8740
8652
  });
8741
8653
  return component;
8742
8654
  }
8743
-
8744
8655
  if (Array.isArray(compObj.components)) {
8745
8656
  compObj.components = compObj.components.map(componentParser);
8746
8657
  }
8747
-
8748
8658
  return compObj;
8749
8659
  };
8750
8660
  const inverseComponentParser = compObj => {
@@ -8769,7 +8679,6 @@ const inverseComponentParser = compObj => {
8769
8679
  if (compObj.components) {
8770
8680
  compObj.components = compObj.components.map(inverseComponentParser);
8771
8681
  }
8772
-
8773
8682
  return compObj;
8774
8683
  }
8775
8684
  };