diy-template-components 0.2.3 → 0.2.5

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
@@ -1,12 +1,12 @@
1
- function ___$insertStyle(css) {
2
- if (!css || !window) {
3
- return;
4
- }
5
- const style = document.createElement('style');
6
- style.setAttribute('type', 'text/css');
7
- style.innerHTML = css;
8
- document.head.appendChild(style);
9
- return css;
1
+ function ___$insertStyle(css) {
2
+ if (!css || typeof window === 'undefined') {
3
+ return;
4
+ }
5
+ const style = document.createElement('style');
6
+ style.setAttribute('type', 'text/css');
7
+ style.innerHTML = css;
8
+ document.head.appendChild(style);
9
+ return css;
10
10
  }
11
11
 
12
12
  import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
@@ -18,20 +18,17 @@ import ReactDOMServer from 'react-dom/server';
18
18
  import { createTheming, createUseStyles as createUseStyles$1, useTheme as useTheme$1 } from 'react-jss';
19
19
 
20
20
  function _extends() {
21
- _extends = Object.assign || function (target) {
21
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
22
22
  for (var i = 1; i < arguments.length; i++) {
23
23
  var source = arguments[i];
24
-
25
24
  for (var key in source) {
26
25
  if (Object.prototype.hasOwnProperty.call(source, key)) {
27
26
  target[key] = source[key];
28
27
  }
29
28
  }
30
29
  }
31
-
32
30
  return target;
33
31
  };
34
-
35
32
  return _extends.apply(this, arguments);
36
33
  }
37
34
 
@@ -287,21 +284,17 @@ const alpha = {
287
284
  seventyPercent: 0.7,
288
285
  eightyPercent: 0.8
289
286
  };
290
-
291
287
  const getRGBFromHex = hex => {
292
288
  const r = parseInt(hex.slice(1, 3), 16);
293
289
  const g = parseInt(hex.slice(3, 5), 16);
294
290
  const b = parseInt(hex.slice(5, 7), 16);
295
291
  return [r, g, b];
296
292
  };
297
-
298
293
  const hexToRgbA = (hex, alpha = null) => {
299
294
  const values = getRGBFromHex(hex);
300
-
301
295
  if (alpha !== null) {
302
296
  values.push(alpha);
303
297
  }
304
-
305
298
  return `rgba(${values.join(',')})`;
306
299
  };
307
300
  const colorMixer = (hex1, weightage = 1, hex2 = colors.white) => {
@@ -441,29 +434,24 @@ function useLinkBuilder(data) {
441
434
  basePath,
442
435
  isMasterTemplate
443
436
  } = useContext(PageContext);
444
-
445
437
  if (isEdit || !data.isLink) {
446
438
  return null;
447
439
  }
448
-
449
440
  if (data?.isExistingLink === false) {
450
441
  return data.link;
451
442
  }
452
-
453
443
  if (data?.isExternal) {
454
444
  return data.link;
455
445
  }
456
-
457
446
  if (!isPreview) {
458
447
  const link = data.link === '/' ? '' : '/' + data.link;
459
448
  return basePath ? `//${basePath}${link}` : null;
460
- } // courses in preview: special case
461
-
449
+ }
462
450
 
451
+ // courses in preview: special case
463
452
  if (data.link === 'courses') {
464
453
  return `//${basePath}/courses`;
465
454
  }
466
-
467
455
  const {
468
456
  pageId
469
457
  } = navList.find(el => el.slug === data?.link) || {};
@@ -639,14 +627,12 @@ var calendar$1 = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%
639
627
  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
628
 
641
629
  /** @returns {import('./types').IconData} */
642
-
643
630
  const getConfiguredIcon1 = url => ({
644
631
  url,
645
632
  svgChildrenConfigs: []
646
633
  });
647
- /** @returns {import('./types').IconData} */
648
-
649
634
 
635
+ /** @returns {import('./types').IconData} */
650
636
  const getConfiguredIcon2 = (url, stroke, fill) => ({
651
637
  url,
652
638
  svgChildrenConfigs: [{
@@ -655,7 +641,6 @@ const getConfiguredIcon2 = (url, stroke, fill) => ({
655
641
  fill
656
642
  }]
657
643
  });
658
-
659
644
  const icons = {
660
645
  'Live class': getConfiguredIcon2(liveTv, false, true),
661
646
  'Recorded videos': getConfiguredIcon2(liveTv2, false, true),
@@ -688,41 +673,51 @@ const icons = {
688
673
  'Video Play': getConfiguredIcon2(videoPlay, false, true),
689
674
  Quote: getConfiguredIcon2(quote, false, true),
690
675
  // Stock
676
+
691
677
  'Stock Growth': getConfiguredIcon2(stockGrowth, false, true),
692
678
  Money: getConfiguredIcon2(money, false, true),
693
679
  Split: getConfiguredIcon2(split, false, true),
694
680
  Chart: getConfiguredIcon2(chart, false, true),
695
681
  // Personality Development
682
+
696
683
  Leaders: getConfiguredIcon2(leaders, false, true),
697
684
  Women: getConfiguredIcon2(women, false, true),
698
685
  Program: getConfiguredIcon2(program, false, true),
699
686
  // Photography
687
+
700
688
  'Video Editing': getConfiguredIcon2(videoEditing, false, true),
701
689
  Editing: getConfiguredIcon2(editing, false, true),
702
690
  Camera: getConfiguredIcon2(camera, false, true),
703
691
  Sessions: getConfiguredIcon2(sessions, false, true),
704
692
  // Computer
693
+
705
694
  'Regular Batches': getConfiguredIcon2(regularBatches, false, true),
706
695
  'Alternate Batches': getConfiguredIcon2(alternateBatches, false, true),
707
696
  'Weekend Batches': getConfiguredIcon2(weekendBatches, false, true),
708
697
  // Life Coach
698
+
709
699
  Girl: getConfiguredIcon2(girl, false, true),
710
700
  Smile: getConfiguredIcon2(smile, false, true),
711
701
  Relationships: getConfiguredIcon2(relationships, false, true),
712
702
  // Music
703
+
713
704
  Vocal: getConfiguredIcon2(vocal, false, true),
714
705
  Instrument: getConfiguredIcon2(instrument, false, true),
715
706
  Music: getConfiguredIcon2(music, false, true),
716
707
  // Fitness
708
+
717
709
  Workout: getConfiguredIcon2(workout, false, true),
718
710
  Barbell: getConfiguredIcon2(barbell, false, true),
719
711
  Trainer: getConfiguredIcon2(trainer, false, true),
720
712
  Report: getConfiguredIcon2(report, false, true),
721
713
  // Govt Exam
714
+
722
715
  'Govt Exam': getConfiguredIcon2(govtExam, false, true),
723
716
  // IIT JEE
717
+
724
718
  College: getConfiguredIcon2(college, false, true),
725
719
  // Others
720
+
726
721
  Teachers: getConfiguredIcon2(teachers, false, true),
727
722
  Learning: getConfiguredIcon2(learning, false, true),
728
723
  Success: getConfiguredIcon2(success, false, true),
@@ -734,12 +729,9 @@ const icons = {
734
729
  Video: getConfiguredIcon2(video, false, true)
735
730
  };
736
731
 
737
- const someMethod1 = (
738
- /** @type {import('./types').IconData["svgChildrenConfigs"]} */
739
- svgChildrenConfigs, color, hoverColor) => {
732
+ const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"]} */svgChildrenConfigs, color, hoverColor) => {
740
733
  /** @type {{ [k:string]:React.CSSProperties; }} */
741
734
  const obj = {};
742
-
743
735
  for (const svgChildConfig of svgChildrenConfigs) {
744
736
  if (color) obj['& ' + svgChildConfig.selector] = {
745
737
  fill: svgChildConfig.fill ? color : undefined,
@@ -750,10 +742,8 @@ svgChildrenConfigs, color, hoverColor) => {
750
742
  stroke: svgChildConfig.stroke ? hoverColor : undefined
751
743
  };
752
744
  }
753
-
754
745
  return obj;
755
746
  };
756
-
757
747
  const useStyles$1 = createUseStyles$1({
758
748
  '@keyframes slideRight': {
759
749
  to: {
@@ -797,8 +787,8 @@ const defaultSvgState = {
797
787
  childrenConfigs: [],
798
788
  attributes: defaultAttributes
799
789
  };
800
- /** @type {import('./props.type').IconProps} */
801
790
 
791
+ /** @type {import('./props.type').IconProps} */
802
792
  const iconDefaultProps = {
803
793
  name: undefined,
804
794
  width: 'auto',
@@ -808,8 +798,8 @@ const iconDefaultProps = {
808
798
  opacity: undefined,
809
799
  className: undefined
810
800
  };
811
- /** @type {import("react").FC<import('./props.type').IconProps>} */
812
801
 
802
+ /** @type {import("react").FC<import('./props.type').IconProps>} */
813
803
  const Icon = ({
814
804
  name,
815
805
  width,
@@ -828,10 +818,8 @@ const Icon = ({
828
818
  }, []);
829
819
  /** */
830
820
 
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
-
821
+ const rootRef = useRef( /** @type {HTMLElement} */null);
822
+ // this ref is used to cancel the fetch promise success callback in case name prop changed
835
823
  const currentName = useRef(name);
836
824
  const [svgState, setSvgState] = useState(defaultSvgState);
837
825
  const styles = useStyles$1({
@@ -842,46 +830,41 @@ const Icon = ({
842
830
  opacity,
843
831
  hoverColor
844
832
  });
845
-
846
833
  const _className = useMemo(() => `${styles.root} ${className || ''}`, [className]);
847
-
848
834
  useEffect(() => {
849
835
  // reset
850
836
  currentName.current = name;
851
837
  setSvgState(defaultSvgState);
852
838
  const icon = icons[name];
853
-
854
839
  if (icon) {
855
840
  /**
856
841
  * retrieve from cache
857
842
  * @type {Promise<string>}
858
843
  */
859
844
  let svgProm = Icon.getCachedSvgPromise(name);
860
-
861
845
  if (!svgProm) {
862
846
  svgProm = fetch(icon.url).then(r => r.text()).catch(() => {
863
847
  // unset in cache
864
848
  Icon.setCachedSvgPromise(name, undefined);
865
849
  return null;
866
- }); //save in cache
867
-
850
+ });
851
+ //save in cache
868
852
  Icon.setCachedSvgPromise(name, svgProm);
869
853
  }
870
-
871
854
  svgProm.then(svg => {
872
855
  if (svg && isMounted.current && name === currentName.current) {
873
856
  const div = document.createElement('div');
874
- div.innerHTML = svg; // set the new attributes
857
+ div.innerHTML = svg;
875
858
 
859
+ // set the new attributes
876
860
  const newAttributes = {};
877
-
878
861
  for (const ob of div.firstElementChild.attributes) {
879
862
  const camelCased = ob.name.replace(/(-|:)([a-z])/g, g => g[1].toUpperCase());
880
863
  newAttributes[camelCased] = ob.value;
881
- } // setting the state in last.
882
- // Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
883
-
864
+ }
884
865
 
866
+ // setting the state in last.
867
+ // Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
885
868
  setSvgState({
886
869
  innerHtml: div.firstElementChild.innerHTML,
887
870
  childrenConfigs: icon.svgChildrenConfigs,
@@ -901,14 +884,11 @@ const Icon = ({
901
884
  onClick: onClick
902
885
  }));
903
886
  };
904
-
905
887
  Icon.defaultProps = iconDefaultProps;
906
- /** static properties for caching */
907
888
 
889
+ /** static properties for caching */
908
890
  Icon.cacheStore = {};
909
-
910
891
  Icon.getCachedSvgPromise = name => Icon.cacheStore[name];
911
-
912
892
  Icon.setCachedSvgPromise = (name, prom) => Icon.cacheStore[name] = prom;
913
893
 
914
894
  const useDropdownStyles = createUseStyles(theme => ({
@@ -1020,7 +1000,6 @@ function OptionList({
1020
1000
  isLandingPages
1021
1001
  }) {
1022
1002
  useContext(PageContext);
1023
-
1024
1003
  const tabsDataModifier = () => {
1025
1004
  return optionsData?.map(dt => {
1026
1005
  return {
@@ -1032,7 +1011,6 @@ function OptionList({
1032
1011
  };
1033
1012
  });
1034
1013
  };
1035
-
1036
1014
  const tabData = tabsDataModifier();
1037
1015
  const classes = useSectionStyles$a();
1038
1016
  return /*#__PURE__*/React.createElement("div", {
@@ -1121,31 +1099,24 @@ function DesktopHeader({
1121
1099
  const classes = useSectionStyles$a({
1122
1100
  isFixed
1123
1101
  });
1124
-
1125
1102
  const optionDataFn = () => {
1126
1103
  let optionsArr = navData;
1127
1104
  let optionsData = [];
1128
-
1129
1105
  if (optionsArr?.length > 5) {
1130
1106
  optionsData = optionsArr?.slice(0, 4);
1131
1107
  } else {
1132
1108
  optionsData = optionsArr;
1133
1109
  }
1134
-
1135
1110
  return optionsData;
1136
1111
  };
1137
-
1138
1112
  const moreContentFn = () => {
1139
1113
  let optionsArr = navData;
1140
1114
  let moreContent = [];
1141
-
1142
1115
  if (optionsArr?.length > 5) {
1143
1116
  moreContent = optionsArr?.slice(4);
1144
1117
  }
1145
-
1146
1118
  return moreContent;
1147
1119
  };
1148
-
1149
1120
  return /*#__PURE__*/React.createElement("nav", {
1150
1121
  className: classes.section
1151
1122
  }, /*#__PURE__*/React.createElement("div", {
@@ -1203,7 +1174,6 @@ function MobileHeader({
1203
1174
  const navEl = useRef(null);
1204
1175
  useLayoutEffect(() => {
1205
1176
  const body = navEl?.current?.ownerDocument?.body;
1206
-
1207
1177
  if (sideMenu) {
1208
1178
  body?.setAttribute('style', 'overflow: hidden;');
1209
1179
  } else {
@@ -1213,7 +1183,6 @@ function MobileHeader({
1213
1183
  let iosUrl = null;
1214
1184
  let androidUrl = null;
1215
1185
  let downloadLink = null;
1216
-
1217
1186
  if (isTutorWebsite) {
1218
1187
  if (header?.iosUrl) {
1219
1188
  iosUrl = /*#__PURE__*/React.createElement(Button, {
@@ -1236,7 +1205,6 @@ function MobileHeader({
1236
1205
  }
1237
1206
  });
1238
1207
  }
1239
-
1240
1208
  if (header?.androidURL) {
1241
1209
  androidUrl = /*#__PURE__*/React.createElement(Button, {
1242
1210
  data: {
@@ -1257,7 +1225,6 @@ function MobileHeader({
1257
1225
  }
1258
1226
  });
1259
1227
  }
1260
-
1261
1228
  if (iosUrl && androidUrl) {
1262
1229
  downloadLink = /*#__PURE__*/React.createElement("div", null, iosUrl, androidUrl);
1263
1230
  } else if (header?.iosUrl) {
@@ -1307,7 +1274,6 @@ function MobileHeader({
1307
1274
  downloadLink = null;
1308
1275
  }
1309
1276
  }
1310
-
1311
1277
  return /*#__PURE__*/React.createElement("nav", {
1312
1278
  ref: navEl,
1313
1279
  className: classes.section
@@ -1364,11 +1330,9 @@ function Header({
1364
1330
  isMobile,
1365
1331
  isTutorWebsite
1366
1332
  } = useContext(PageContext);
1367
-
1368
1333
  const filterHiddenNavs = () => {
1369
1334
  return data?.navs?.filter(dt => !dt.isHiddenNav);
1370
1335
  };
1371
-
1372
1336
  return isMobile ? /*#__PURE__*/React.createElement(MobileHeader, {
1373
1337
  navData: filterHiddenNavs(),
1374
1338
  header: data,
@@ -1724,7 +1688,6 @@ const rustTheme = {
1724
1688
  light: colors.lightRust,
1725
1689
  lightest: colors.lightestRust
1726
1690
  };
1727
-
1728
1691
  const generateThemePalette = themeColors => ({
1729
1692
  primary: themeColors,
1730
1693
  background: {
@@ -1747,7 +1710,6 @@ const generateThemePalette = themeColors => ({
1747
1710
  tertiary: colors.blueGrey
1748
1711
  }
1749
1712
  });
1750
-
1751
1713
  const bluePalette = generateThemePalette(blueTheme);
1752
1714
  const redPalette = generateThemePalette(redTheme);
1753
1715
  const orangePalette = generateThemePalette(orangeTheme);
@@ -1788,9 +1750,7 @@ const fontComponents = {
1788
1750
  'Merriweather Sans': MerriweatherSans,
1789
1751
  'Arima Madurai': ArimaMadurai
1790
1752
  };
1791
-
1792
1753
  const getFontComponent = font => fontComponents[font] || (() => null);
1793
-
1794
1754
  function FontSeeder({
1795
1755
  fontFamily
1796
1756
  }) {
@@ -1800,37 +1760,30 @@ function FontSeeder({
1800
1760
  const useRubikFont = createUseStyles$1({
1801
1761
  '@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
1762
  });
1803
-
1804
1763
  function Rubik() {
1805
1764
  // to import "Rubik" font css
1806
1765
  useRubikFont();
1807
1766
  return null;
1808
1767
  }
1809
-
1810
1768
  const useIbmPlexSansFont = createUseStyles$1({
1811
1769
  '@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
1770
  });
1813
-
1814
1771
  function IbmPlexSans() {
1815
1772
  // to import "Ibm Plex Sans" font css
1816
1773
  useIbmPlexSansFont();
1817
1774
  return null;
1818
1775
  }
1819
-
1820
1776
  const useMerriweatherSansFont = createUseStyles$1({
1821
1777
  '@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
1778
  });
1823
-
1824
1779
  function MerriweatherSans() {
1825
1780
  // to import "Merriweather Sans" font css
1826
1781
  useMerriweatherSansFont();
1827
1782
  return null;
1828
1783
  }
1829
-
1830
1784
  const useArimaMaduraiFont = createUseStyles$1({
1831
1785
  '@import': 'url(https://fonts.googleapis.com/css2?family=Arima+Madurai:wght@400;500;700&display=swap)'
1832
1786
  });
1833
-
1834
1787
  function ArimaMadurai() {
1835
1788
  // to import "Arima Madurai" font css
1836
1789
  useArimaMaduraiFont();
@@ -1861,9 +1814,7 @@ const TYPE_TO_COMPONENT_MAP$1 = {
1861
1814
  TILES_SECTION: /*#__PURE__*/lazy(() => Promise.resolve().then(function () { return index$1; })),
1862
1815
  EMAIL_DRIP_MARKET: /*#__PURE__*/lazy(() => Promise.resolve().then(function () { return index; }))
1863
1816
  };
1864
-
1865
1817
  const getCompToRender$1 = type => TYPE_TO_COMPONENT_MAP$1[type] || (() => null);
1866
-
1867
1818
  const MemoisedSection$1 = /*#__PURE__*/memo(({
1868
1819
  sectionData,
1869
1820
  extraProps
@@ -1880,9 +1831,7 @@ function SectionRenderer$1({
1880
1831
  extraProps
1881
1832
  }) {
1882
1833
  return /*#__PURE__*/React.createElement(Suspense, {
1883
- fallback: null
1884
- /*GIF maybe*/
1885
-
1834
+ fallback: null /*GIF maybe*/
1886
1835
  }, /*#__PURE__*/React.createElement(MemoisedSection$1, {
1887
1836
  sectionData: sectionData,
1888
1837
  extraProps: extraProps
@@ -2166,23 +2115,18 @@ const getArrowRotationAngle = props => {
2166
2115
  switch (true) {
2167
2116
  case props.left:
2168
2117
  return 180;
2169
-
2170
2118
  case props.up:
2171
2119
  return 270;
2172
-
2173
2120
  case props.down:
2174
2121
  return 90;
2175
-
2176
2122
  case props.right:
2177
2123
  default:
2178
2124
  return 0;
2179
2125
  }
2180
2126
  };
2181
-
2182
2127
  const sizeHandler = ({
2183
2128
  size
2184
2129
  }) => size === 'small' ? '32px' : '48px';
2185
-
2186
2130
  const useArrowButtonStyles = createUseStyles(theme => ({
2187
2131
  arrowButtonContainer: {
2188
2132
  cursor: 'pointer',
@@ -2222,7 +2166,6 @@ function dotsToShow(i, n) {
2222
2166
  const leftToShow = i < elementsToShow / 2;
2223
2167
  const rightToShow = n - i - 1 < elementsToShow / 2;
2224
2168
  let leftCount, rightCount;
2225
-
2226
2169
  if (leftToShow) {
2227
2170
  leftCount = i;
2228
2171
  rightCount = elementsToShow - i - 1;
@@ -2233,13 +2176,11 @@ function dotsToShow(i, n) {
2233
2176
  leftCount = 2;
2234
2177
  rightCount = 2;
2235
2178
  }
2236
-
2237
2179
  return {
2238
2180
  leftCount,
2239
2181
  rightCount
2240
2182
  };
2241
2183
  }
2242
-
2243
2184
  function Carousel({
2244
2185
  settings,
2245
2186
  children,
@@ -2293,15 +2234,12 @@ function Carousel({
2293
2234
  ...settings,
2294
2235
  className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
2295
2236
  };
2296
-
2297
2237
  const nextClick = () => {
2298
2238
  sliderRef.current.slickNext();
2299
2239
  };
2300
-
2301
2240
  const previousClick = () => {
2302
2241
  sliderRef.current.slickPrev();
2303
2242
  };
2304
-
2305
2243
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Slider, _extends({
2306
2244
  ref: sliderRef
2307
2245
  }, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React.createElement("div", {
@@ -2366,7 +2304,6 @@ function Section$4({
2366
2304
  src: nodeData.image.metadata.value
2367
2305
  })));
2368
2306
  }
2369
-
2370
2307
  function BannerCarouselRight({
2371
2308
  sectionData
2372
2309
  }) {
@@ -2392,9 +2329,7 @@ function BannerCarouselRight({
2392
2329
  className: classes.sectionContainer
2393
2330
  }, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$4, {
2394
2331
  nodeData: node,
2395
- key: idx
2396
- /* or some other unique property */
2397
-
2332
+ key: idx /* or some other unique property */
2398
2333
  })))));
2399
2334
  }
2400
2335
 
@@ -2601,11 +2536,9 @@ function List({
2601
2536
  containerWidth
2602
2537
  });
2603
2538
  const [nodeData] = sectionData.components;
2604
-
2605
2539
  const getNumber = val => {
2606
2540
  return val.toString().length == 1 ? '0' + val : val;
2607
2541
  };
2608
-
2609
2542
  return /*#__PURE__*/React.createElement("section", {
2610
2543
  className: classes.section
2611
2544
  }, /*#__PURE__*/React.createElement("div", {
@@ -2797,7 +2730,6 @@ const Section$3 = ({
2797
2730
  size: isMobile ? 'small' : 'medium'
2798
2731
  })))));
2799
2732
  };
2800
-
2801
2733
  function BannerCarouselCenter({
2802
2734
  sectionData
2803
2735
  }) {
@@ -2814,9 +2746,7 @@ function BannerCarouselCenter({
2814
2746
  className: classes.bannerCarouselCenterSection
2815
2747
  }, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$3, {
2816
2748
  nodeData: node,
2817
- key: idx
2818
- /* or some other unique property */
2819
-
2749
+ key: idx /* or some other unique property */
2820
2750
  }))));
2821
2751
  }
2822
2752
 
@@ -2983,7 +2913,6 @@ function Section$2({
2983
2913
  size: isMobile ? 'small' : 'medium'
2984
2914
  })));
2985
2915
  }
2986
-
2987
2916
  function BannerCarouselLeft({
2988
2917
  sectionData
2989
2918
  }) {
@@ -3005,9 +2934,7 @@ function BannerCarouselLeft({
3005
2934
  className: classes.sectionContainer
3006
2935
  }, /*#__PURE__*/React.createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$2, {
3007
2936
  nodeData: node,
3008
- key: idx
3009
- /* or some other unique property */
3010
-
2937
+ key: idx /* or some other unique property */
3011
2938
  })))));
3012
2939
  }
3013
2940
 
@@ -3162,7 +3089,6 @@ async function postApiCall(baseURLs, data) {
3162
3089
  },
3163
3090
  data
3164
3091
  });
3165
-
3166
3092
  if (res) {
3167
3093
  return res.data;
3168
3094
  }
@@ -3187,7 +3113,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
3187
3113
  if (extraProps && extraProps.formSubmitSuccess) {
3188
3114
  extraProps.formSubmitSuccess();
3189
3115
  }
3190
-
3191
3116
  return res.data;
3192
3117
  });
3193
3118
  } catch (err) {
@@ -3296,10 +3221,10 @@ function SubscribeToNewsletter({
3296
3221
  const classes = useSectionStyles$4({
3297
3222
  containerWidth
3298
3223
  });
3299
- const [inputVal, setInputVal] = useState(nodeData?.inputField?.metadata?.value);
3224
+ let formInitialValue = nodeData?.inputField?.metadata?.value;
3225
+ const [inputVal, setInputVal] = useState(formInitialValue);
3300
3226
  let [isValid, setIsValid] = useState(true);
3301
3227
  let [btnDisabled, setBtnDisabled] = useState(false);
3302
-
3303
3228
  const handleSubmit = () => {
3304
3229
  let data = {
3305
3230
  sectionId: sectionData.sectionId,
@@ -3313,12 +3238,11 @@ function SubscribeToNewsletter({
3313
3238
  };
3314
3239
  if (!(isPreview || isEdit)) postApiCall(baseURLs, data);
3315
3240
  setBtnDisabled(true);
3241
+ setInputVal(formInitialValue);
3316
3242
  };
3317
-
3318
3243
  const checkValidity = () => {
3319
3244
  if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
3320
3245
  let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
3321
-
3322
3246
  if (regex?.test(inputVal)) {
3323
3247
  setIsValid(true);
3324
3248
  } else {
@@ -3326,7 +3250,6 @@ function SubscribeToNewsletter({
3326
3250
  }
3327
3251
  }
3328
3252
  };
3329
-
3330
3253
  useEffect(() => {
3331
3254
  if (!isValid) {
3332
3255
  setBtnDisabled(true);
@@ -3654,7 +3577,6 @@ function Section$1({
3654
3577
  className: classes.contentRow
3655
3578
  }, carouselContent))));
3656
3579
  }
3657
-
3658
3580
  function Testimonials({
3659
3581
  sectionData
3660
3582
  }) {
@@ -3719,7 +3641,6 @@ const loaderStyle = theme => ({
3719
3641
  });
3720
3642
 
3721
3643
  const useStyles = createUseStyles$1(loaderStyle);
3722
-
3723
3644
  function Loader({
3724
3645
  texts
3725
3646
  }) {
@@ -3731,13 +3652,11 @@ function Loader({
3731
3652
  useEffect(() => {
3732
3653
  if (texts && texts.length) {
3733
3654
  let textID = '';
3734
-
3735
3655
  for (let i = 0; i < texts.length; i++) {
3736
3656
  textID = setTimeout(() => {
3737
3657
  setLoaderText(texts[i]);
3738
3658
  }, 2000 * i);
3739
3659
  }
3740
-
3741
3660
  return () => {
3742
3661
  clearTimeout(textID);
3743
3662
  };
@@ -3805,18 +3724,15 @@ function VideoPlayer(props) {
3805
3724
  imageUrl: imageUrl
3806
3725
  });
3807
3726
  const theme = useTheme();
3808
-
3809
3727
  function getId(url) {
3810
3728
  var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
3811
3729
  var match = url?.match(regExp);
3812
-
3813
3730
  if (match?.[2].length == 11) {
3814
3731
  return 'https://www.youtube.com/embed/' + match[2];
3815
3732
  } else {
3816
3733
  return url;
3817
3734
  }
3818
3735
  }
3819
-
3820
3736
  return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoaded && /*#__PURE__*/React.createElement("div", {
3821
3737
  className: classes.imgContainer
3822
3738
  }, isEnabled ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, props.onlyThumbnail ? null : /*#__PURE__*/React.createElement(Icon, {
@@ -4659,8 +4575,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
4659
4575
  width: 'calc(100% - 2px)',
4660
4576
  position: 'relative',
4661
4577
  paddingBottom: '59.83%' // keeping aspect ratio 585x350
4662
-
4663
4578
  },
4579
+
4664
4580
  contentRow: {
4665
4581
  display: 'grid',
4666
4582
  gridTemplateColumns: ({
@@ -4919,7 +4835,6 @@ const FAQListing = ({
4919
4835
  isSelected: selectedIndex === index
4920
4836
  })))));
4921
4837
  };
4922
-
4923
4838
  const Accordion = ({
4924
4839
  item,
4925
4840
  isSelected,
@@ -5204,9 +5119,10 @@ const useCourseStyles = createUseStyles(theme => {
5204
5119
  flexGrow: 1,
5205
5120
  display: 'flex',
5206
5121
  flexDirection: 'column',
5207
- justifyContent: 'space-between' //alignItems: 'center',
5208
-
5122
+ justifyContent: 'space-between'
5123
+ //alignItems: 'center',
5209
5124
  },
5125
+
5210
5126
  courseCardTags: {
5211
5127
  display: 'flex',
5212
5128
  justifyContent: 'flex-start',
@@ -5232,11 +5148,12 @@ const useCourseStyles = createUseStyles(theme => {
5232
5148
  wordBreak: 'break-word',
5233
5149
  padding: '12px 0px',
5234
5150
  textAlign: 'left',
5235
- display: 'inline-block' // overflow: 'hidden',
5151
+ display: 'inline-block'
5152
+ // overflow: 'hidden',
5236
5153
  // whiteSpace: 'nowrap',
5237
5154
  // textOverflow: 'ellipsis'
5238
-
5239
5155
  },
5156
+
5240
5157
  courseCardDiscount: {
5241
5158
  display: 'flex',
5242
5159
  justifyContent: 'flex-start',
@@ -5318,7 +5235,8 @@ const useCourseStyles = createUseStyles(theme => {
5318
5235
  }
5319
5236
  },
5320
5237
  '@media (max-width: 768px)': {
5321
- coursesContainer: {//background: theme?.palette?.background?.primary
5238
+ coursesContainer: {
5239
+ //background: theme?.palette?.background?.primary
5322
5240
  },
5323
5241
  coursesCardAndText: {
5324
5242
  padding: '70px 30px'
@@ -5350,7 +5268,6 @@ async function getCourseList(baseURLs, hashToken) {
5350
5268
  if (!hashToken) {
5351
5269
  throw 'Missing hash token';
5352
5270
  }
5353
-
5354
5271
  const res = await axios({
5355
5272
  method: 'get',
5356
5273
  baseURL: baseURLs?.API_COURSE_URL,
@@ -5362,7 +5279,6 @@ async function getCourseList(baseURLs, hashToken) {
5362
5279
  requiredFilters: '[10]'
5363
5280
  }
5364
5281
  });
5365
-
5366
5282
  if (res) {
5367
5283
  return res.data;
5368
5284
  }
@@ -5374,7 +5290,6 @@ function getShortenedSubstring(name, length, allowDots = true) {
5374
5290
  if (name) {
5375
5291
  return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
5376
5292
  }
5377
-
5378
5293
  return '';
5379
5294
  }
5380
5295
 
@@ -5454,13 +5369,11 @@ function courses({
5454
5369
  containerWidth
5455
5370
  });
5456
5371
  const [nodeData] = sectionData?.components;
5457
-
5458
5372
  const handleApiCall = () => {
5459
5373
  if (baseURLs) {
5460
5374
  getCourseList(baseURLs, hashToken).then(response => {
5461
5375
  const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
5462
5376
  const coursesData = response?.data?.coursesData;
5463
-
5464
5377
  if (coursesData && coursesData.length) {
5465
5378
  setCardList(response?.data?.coursesData);
5466
5379
  setShowShimmer(false);
@@ -5471,12 +5384,12 @@ function courses({
5471
5384
  setShowShimmer(false);
5472
5385
  setFallbackImages(placeholders);
5473
5386
  }
5474
- } // For User Website & Draft Preview: If no data found, hide section.
5387
+ }
5388
+ // For User Website & Draft Preview: If no data found, hide section.
5475
5389
  else setErrored(true);
5476
5390
  }
5477
5391
  }).catch(err => {
5478
5392
  const errMsg = err?.response?.data?.data?.message;
5479
-
5480
5393
  if (errMsg === 'NOT_FOUND') {
5481
5394
  if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
5482
5395
  setShowShimmer(false);
@@ -5488,16 +5401,16 @@ function courses({
5488
5401
  });
5489
5402
  }
5490
5403
  };
5491
-
5492
5404
  useEffect(() => {
5493
- const placeholders = nodeData?.cardCarousel?.metadata?.placeholders; // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
5494
-
5405
+ const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
5406
+ // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
5495
5407
  if (isMasterTemplate) {
5496
5408
  if (placeholders && placeholders.length) {
5497
5409
  setShowShimmer(false);
5498
5410
  setFallbackImages(placeholders);
5499
5411
  }
5500
- } // other
5412
+ }
5413
+ // other
5501
5414
  else {
5502
5415
  handleApiCall();
5503
5416
  }
@@ -5562,7 +5475,6 @@ function courses({
5562
5475
  });
5563
5476
  })))));
5564
5477
  }
5565
-
5566
5478
  function SimpleCardsContainer({
5567
5479
  children,
5568
5480
  classes
@@ -5958,12 +5870,13 @@ function FormEnquiry({
5958
5870
  const [nodeData] = sectionData.components;
5959
5871
  const theme = useTheme();
5960
5872
  let [btnDisabled, setBtnDisabled] = useState(false);
5961
- const [inputVal, setInputVal] = useState({
5873
+ let formInitialValue = {
5962
5874
  name: nodeData?.nameField?.metadata?.value,
5963
5875
  phone: nodeData?.phoneField?.metadata?.value,
5964
5876
  email: nodeData?.emailField?.metadata?.value,
5965
5877
  message: nodeData?.messageField?.metadata?.value
5966
- });
5878
+ };
5879
+ const [inputVal, setInputVal] = useState(formInitialValue);
5967
5880
  const [validData, setValidData] = useState({
5968
5881
  nameValid: 1,
5969
5882
  emailValid: 1,
@@ -5977,7 +5890,6 @@ function FormEnquiry({
5977
5890
  setBtnDisabled(true);
5978
5891
  }
5979
5892
  }, [validData]);
5980
-
5981
5893
  const handleSubmit = () => {
5982
5894
  let data = {
5983
5895
  sectionId: sectionData?._id || null,
@@ -5986,24 +5898,24 @@ function FormEnquiry({
5986
5898
  };
5987
5899
  if (!(isPreview || isEdit)) postApiCall(baseURLs, data);
5988
5900
  setBtnDisabled(true);
5901
+ setInputVal(formInitialValue);
5989
5902
  };
5990
-
5991
5903
  const checkValidity = (regexField, fieldname, fieldValidity) => {
5992
5904
  if (validations?.[regexField]?.length) {
5993
5905
  let regex = new RegExp(validations[regexField]);
5994
-
5995
5906
  if (regex?.test(inputVal[fieldname])) {
5996
- setValidData({ ...validData,
5907
+ setValidData({
5908
+ ...validData,
5997
5909
  [fieldValidity]: 1
5998
5910
  });
5999
5911
  } else {
6000
- setValidData({ ...validData,
5912
+ setValidData({
5913
+ ...validData,
6001
5914
  [fieldValidity]: 0
6002
5915
  });
6003
5916
  }
6004
5917
  }
6005
5918
  };
6006
-
6007
5919
  return /*#__PURE__*/React.createElement("section", {
6008
5920
  className: classes.section
6009
5921
  }, /*#__PURE__*/React.createElement("div", {
@@ -6083,7 +5995,8 @@ function FormEnquiry({
6083
5995
  isValid: validData.nameValid,
6084
5996
  inputType: 'input',
6085
5997
  onChange: e => {
6086
- setInputVal({ ...inputVal,
5998
+ setInputVal({
5999
+ ...inputVal,
6087
6000
  name: e.target.value
6088
6001
  });
6089
6002
  },
@@ -6091,7 +6004,8 @@ function FormEnquiry({
6091
6004
  checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
6092
6005
  },
6093
6006
  onFocus: () => {
6094
- setValidData({ ...validData,
6007
+ setValidData({
6008
+ ...validData,
6095
6009
  nameValid: 1
6096
6010
  });
6097
6011
  }
@@ -6103,7 +6017,8 @@ function FormEnquiry({
6103
6017
  isValid: validData.phoneValid,
6104
6018
  inputType: 'input',
6105
6019
  onChange: e => {
6106
- setInputVal({ ...inputVal,
6020
+ setInputVal({
6021
+ ...inputVal,
6107
6022
  phone: e.target.value
6108
6023
  });
6109
6024
  },
@@ -6111,7 +6026,8 @@ function FormEnquiry({
6111
6026
  checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
6112
6027
  },
6113
6028
  onFocus: () => {
6114
- setValidData({ ...validData,
6029
+ setValidData({
6030
+ ...validData,
6115
6031
  phoneValid: 1
6116
6032
  });
6117
6033
  }
@@ -6123,7 +6039,8 @@ function FormEnquiry({
6123
6039
  isValid: validData.emailValid,
6124
6040
  inputType: 'input',
6125
6041
  onChange: e => {
6126
- setInputVal({ ...inputVal,
6042
+ setInputVal({
6043
+ ...inputVal,
6127
6044
  email: e.target.value
6128
6045
  });
6129
6046
  },
@@ -6131,7 +6048,8 @@ function FormEnquiry({
6131
6048
  checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
6132
6049
  },
6133
6050
  onFocus: () => {
6134
- setValidData({ ...validData,
6051
+ setValidData({
6052
+ ...validData,
6135
6053
  emailValid: 1
6136
6054
  });
6137
6055
  }
@@ -6143,7 +6061,8 @@ function FormEnquiry({
6143
6061
  isValid: validData.messageValid,
6144
6062
  inputType: 'textarea',
6145
6063
  onChange: e => {
6146
- setInputVal({ ...inputVal,
6064
+ setInputVal({
6065
+ ...inputVal,
6147
6066
  message: e.target.value
6148
6067
  });
6149
6068
  },
@@ -6151,7 +6070,8 @@ function FormEnquiry({
6151
6070
  checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
6152
6071
  },
6153
6072
  onFocus: () => {
6154
- setValidData({ ...validData,
6073
+ setValidData({
6074
+ ...validData,
6155
6075
  messageValid: 1
6156
6076
  });
6157
6077
  }
@@ -6369,19 +6289,19 @@ function Contact({
6369
6289
  const classes = useSectionStyles({
6370
6290
  containerWidth
6371
6291
  });
6372
- const [inputVal, setInputVal] = useState({
6292
+ let formInitialValue = {
6373
6293
  name: nodeData?.nameField?.metadata?.value,
6374
6294
  phone: nodeData?.phoneField?.metadata?.value,
6375
6295
  email: nodeData?.emailField?.metadata?.value,
6376
6296
  message: nodeData?.messageField?.metadata?.value
6377
- });
6297
+ };
6298
+ const [inputVal, setInputVal] = useState(formInitialValue);
6378
6299
  const [validData, setValidData] = useState({
6379
6300
  nameValid: 1,
6380
6301
  emailValid: 1,
6381
6302
  phoneValid: 1,
6382
6303
  messageValid: 1
6383
6304
  });
6384
-
6385
6305
  const handleSubmit = () => {
6386
6306
  const data = {
6387
6307
  sectionId: sectionData?._id || null,
@@ -6390,8 +6310,8 @@ function Contact({
6390
6310
  };
6391
6311
  if (!(isPreview || isEdit)) postApiCall(baseURLs, data);
6392
6312
  setBtnDisabled(true);
6313
+ setInputVal(formInitialValue);
6393
6314
  };
6394
-
6395
6315
  useEffect(() => {
6396
6316
  if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
6397
6317
  setBtnDisabled(false);
@@ -6399,23 +6319,22 @@ function Contact({
6399
6319
  setBtnDisabled(true);
6400
6320
  }
6401
6321
  }, [validData]);
6402
-
6403
6322
  const checkValidity = (regexField, fieldname, fieldValidity) => {
6404
6323
  if (validations?.[regexField]?.length) {
6405
6324
  let regex = new RegExp(validations[regexField]);
6406
-
6407
6325
  if (regex?.test(inputVal[fieldname])) {
6408
- setValidData({ ...validData,
6326
+ setValidData({
6327
+ ...validData,
6409
6328
  [fieldValidity]: 1
6410
6329
  });
6411
6330
  } else {
6412
- setValidData({ ...validData,
6331
+ setValidData({
6332
+ ...validData,
6413
6333
  [fieldValidity]: 0
6414
6334
  });
6415
6335
  }
6416
6336
  }
6417
6337
  };
6418
-
6419
6338
  return /*#__PURE__*/React.createElement("section", {
6420
6339
  className: classes.section
6421
6340
  }, /*#__PURE__*/React.createElement("div", {
@@ -6457,7 +6376,8 @@ function Contact({
6457
6376
  isValid: validData.nameValid,
6458
6377
  inputType: 'input',
6459
6378
  onChange: e => {
6460
- setInputVal({ ...inputVal,
6379
+ setInputVal({
6380
+ ...inputVal,
6461
6381
  name: e.target.value
6462
6382
  });
6463
6383
  },
@@ -6465,7 +6385,8 @@ function Contact({
6465
6385
  checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
6466
6386
  },
6467
6387
  onFocus: () => {
6468
- setValidData({ ...validData,
6388
+ setValidData({
6389
+ ...validData,
6469
6390
  nameValid: 1
6470
6391
  });
6471
6392
  }
@@ -6477,7 +6398,8 @@ function Contact({
6477
6398
  isValid: validData.phoneValid,
6478
6399
  inputType: 'input',
6479
6400
  onChange: e => {
6480
- setInputVal({ ...inputVal,
6401
+ setInputVal({
6402
+ ...inputVal,
6481
6403
  phone: e.target.value
6482
6404
  });
6483
6405
  },
@@ -6485,7 +6407,8 @@ function Contact({
6485
6407
  checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
6486
6408
  },
6487
6409
  onFocus: () => {
6488
- setValidData({ ...validData,
6410
+ setValidData({
6411
+ ...validData,
6489
6412
  phoneValid: 1
6490
6413
  });
6491
6414
  }
@@ -6497,7 +6420,8 @@ function Contact({
6497
6420
  isValid: validData.emailValid,
6498
6421
  inputType: 'input',
6499
6422
  onChange: e => {
6500
- setInputVal({ ...inputVal,
6423
+ setInputVal({
6424
+ ...inputVal,
6501
6425
  email: e.target.value
6502
6426
  });
6503
6427
  },
@@ -6505,7 +6429,8 @@ function Contact({
6505
6429
  checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
6506
6430
  },
6507
6431
  onFocus: () => {
6508
- setValidData({ ...validData,
6432
+ setValidData({
6433
+ ...validData,
6509
6434
  emailValid: 1
6510
6435
  });
6511
6436
  }
@@ -6517,7 +6442,8 @@ function Contact({
6517
6442
  isValid: validData.messageValid,
6518
6443
  inputType: 'textarea',
6519
6444
  onChange: e => {
6520
- setInputVal({ ...inputVal,
6445
+ setInputVal({
6446
+ ...inputVal,
6521
6447
  message: e.target.value
6522
6448
  });
6523
6449
  },
@@ -6525,7 +6451,8 @@ function Contact({
6525
6451
  checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
6526
6452
  },
6527
6453
  onFocus: () => {
6528
- setValidData({ ...validData,
6454
+ setValidData({
6455
+ ...validData,
6529
6456
  messageValid: 1
6530
6457
  });
6531
6458
  }
@@ -6786,7 +6713,8 @@ const useWebinarPromotionPage = createUseStyles(theme => {
6786
6713
  const SingleVideoSlide$1 = props => {
6787
6714
  const [isReadMore, setIsReadMore] = useState(false);
6788
6715
  const theme = useTheme();
6789
- useEffect(() => {// remaining days epoch
6716
+ useEffect(() => {
6717
+ // remaining days epoch
6790
6718
  // current date epoch
6791
6719
  // subtract remaining days from current day epoch
6792
6720
  // moment the result - and see if there are days
@@ -6798,7 +6726,6 @@ const SingleVideoSlide$1 = props => {
6798
6726
  webinarCtaClick,
6799
6727
  conversions = 0
6800
6728
  } = props;
6801
-
6802
6729
  const renderer = ({
6803
6730
  days,
6804
6731
  hours,
@@ -6814,9 +6741,7 @@ const SingleVideoSlide$1 = props => {
6814
6741
  return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
6815
6742
  }
6816
6743
  };
6817
-
6818
6744
  const checkIfOfferIsValid = () => moment().diff(moment(props.data.offerPriceEndDate)) < 0;
6819
-
6820
6745
  const checkForShowDiscount = () => {
6821
6746
  if (props.data.endDate === null || checkIfOfferIsValid()) {
6822
6747
  if (data.discount > 0 && data.offerPriceValidFor === 0) {
@@ -6828,19 +6753,16 @@ const SingleVideoSlide$1 = props => {
6828
6753
  if (data.offerPriceValidFor <= conversions) {
6829
6754
  return false;
6830
6755
  }
6831
-
6832
6756
  if (data.offerPriceValidFor - conversions < 0) {
6833
6757
  return false;
6834
6758
  } else {
6835
6759
  return true;
6836
6760
  }
6837
6761
  }
6838
-
6839
6762
  if (data.discount > 0) {
6840
6763
  return true;
6841
6764
  }
6842
6765
  };
6843
-
6844
6766
  const discount = ({
6845
6767
  price,
6846
6768
  discount
@@ -6848,7 +6770,6 @@ const SingleVideoSlide$1 = props => {
6848
6770
  console.log('discountxx', props.data.price, props.data.discount);
6849
6771
  return (discount / price * 100).toFixed(2);
6850
6772
  };
6851
-
6852
6773
  const classes = useWebinarPromotionPage();
6853
6774
  return /*#__PURE__*/React.createElement("div", {
6854
6775
  className: classes.videoCarouselContainer
@@ -6944,9 +6865,10 @@ const SingleVideoSlide$1 = props => {
6944
6865
  data: {
6945
6866
  // link: 'headerData?.loginCtaLink',
6946
6867
  // isLink: 1,
6947
- value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW' // isExternal: 1
6948
-
6868
+ value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
6869
+ // isExternal: 1
6949
6870
  },
6871
+
6950
6872
  onClick: webinarCtaClick,
6951
6873
  type: 'primary',
6952
6874
  size: 'medium',
@@ -7280,14 +7202,14 @@ const SingleVideoSlide = props => {
7280
7202
  isEdit
7281
7203
  } = useContext(PageContext);
7282
7204
  console.log(isEdit, 'isEdit');
7283
- useEffect(() => {// remaining days epoch
7205
+ useEffect(() => {
7206
+ // remaining days epoch
7284
7207
  // current date epoch
7285
7208
  // subtract remaining days from current day epoch
7286
7209
  // moment the result - and see if there are days
7287
7210
  // days is present show days
7288
7211
  // else start reverse timer
7289
7212
  }, []);
7290
-
7291
7213
  const renderer = ({
7292
7214
  days,
7293
7215
  hours,
@@ -7303,7 +7225,6 @@ const SingleVideoSlide = props => {
7303
7225
  return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
7304
7226
  }
7305
7227
  };
7306
-
7307
7228
  const {
7308
7229
  data,
7309
7230
  courseBuyNow,
@@ -7312,9 +7233,7 @@ const SingleVideoSlide = props => {
7312
7233
  } = props;
7313
7234
  const showCourseInstallmentData = data?.courseOverviewData;
7314
7235
  const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
7315
-
7316
7236
  const checkIfOfferIsValid = () => moment().diff(moment(props?.data?.endDate || 0)) < 0;
7317
-
7318
7237
  const checkForShowDiscount = () => {
7319
7238
  if (props.data.endDate === null || checkIfOfferIsValid()) {
7320
7239
  if (data.discount > 0 && data.offerPriceValidFor === 0) {
@@ -7326,28 +7245,23 @@ const SingleVideoSlide = props => {
7326
7245
  if (data.offerPriceValidFor <= conversions) {
7327
7246
  return false;
7328
7247
  }
7329
-
7330
7248
  if (data.offerPriceValidFor - conversions < 0) {
7331
7249
  return false;
7332
7250
  } else {
7333
7251
  return true;
7334
7252
  }
7335
7253
  }
7336
-
7337
7254
  if (data.discount > 0) {
7338
7255
  return true;
7339
7256
  }
7340
7257
  };
7341
-
7342
7258
  const classes = useCoursePromotionPage();
7343
-
7344
7259
  const discount = ({
7345
7260
  price,
7346
7261
  discount
7347
7262
  }) => {
7348
7263
  return (discount / price * 100).toFixed(2);
7349
7264
  };
7350
-
7351
7265
  return /*#__PURE__*/React.createElement("div", {
7352
7266
  className: classes.videoCarouselContainer
7353
7267
  }, /*#__PURE__*/React.createElement("div", {
@@ -7461,15 +7375,16 @@ const SingleVideoSlide = props => {
7461
7375
  data: {
7462
7376
  // link: 'headerData?.loginCtaLink',
7463
7377
  // isLink: 1,
7464
- value: 'BUY NOW' // isExternal: 1
7465
-
7378
+ value: 'BUY NOW'
7379
+ // isExternal: 1
7466
7380
  },
7381
+
7467
7382
  onClick: courseBuyNow,
7468
7383
  type: 'primary',
7469
7384
  size: 'medium',
7470
7385
  target: null,
7471
- rel: null // styling={isMobile ? { margin: '0 40px' } : {}}
7472
-
7386
+ rel: null
7387
+ // styling={isMobile ? { margin: '0 40px' } : {}}
7473
7388
  })))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React.createElement("div", {
7474
7389
  className: classes.payInstallmentContainer,
7475
7390
  onClick: showCourseInstallment
@@ -7674,18 +7589,15 @@ const FormPage = ({
7674
7589
  _id,
7675
7590
  baseURLs
7676
7591
  } = useContext(PageContext);
7677
-
7678
7592
  const handleSubmit = async e => {
7679
7593
  e.preventDefault();
7680
7594
  let formResponse = [];
7681
-
7682
7595
  for (const [key, value] of Object.entries(formData)) {
7683
7596
  if (value.questionType === 'MC') {
7684
7597
  if (value.solutionArray.length > 1) {
7685
7598
  value.solutionArray.shift();
7686
7599
  }
7687
7600
  }
7688
-
7689
7601
  formResponse.push({
7690
7602
  questionId: key,
7691
7603
  questionName: value.questionName,
@@ -7693,7 +7605,6 @@ const FormPage = ({
7693
7605
  solutionArray: value.solutionArray
7694
7606
  });
7695
7607
  }
7696
-
7697
7608
  const data = {
7698
7609
  sectionId: sectionData?.components?.[0]?._id || null,
7699
7610
  landingPageId: _id || null,
@@ -7703,7 +7614,6 @@ const FormPage = ({
7703
7614
  setFormData({});
7704
7615
  setformSubmitted(!formSubmitted);
7705
7616
  };
7706
-
7707
7617
  useEffect(() => {
7708
7618
  //add all questions to formData
7709
7619
  let formData = {};
@@ -7716,23 +7626,26 @@ const FormPage = ({
7716
7626
  });
7717
7627
  setFormData(formData);
7718
7628
  }, [metadata, formSubmitted]);
7719
-
7720
7629
  const handleOnClick = (e, item, option) => {
7721
7630
  // if the checkbox is checked
7722
7631
  if (!e.target.checked) {
7723
7632
  // if the checkbox is checked and the solution array is empty
7724
7633
  if (!formData[item._id]?.solutionArray?.length) {
7725
- setFormData({ ...formData,
7634
+ setFormData({
7635
+ ...formData,
7726
7636
  [item._id]: {
7727
7637
  questionName: item.text,
7728
7638
  solutionArray: [option.value],
7729
7639
  questionType: 'MC'
7730
7640
  }
7731
7641
  });
7732
- } // if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
7642
+ }
7643
+ // if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
7733
7644
  else if (formData[item._id]?.solutionArray?.includes(option.value)) {
7734
7645
  // if only one value is in the array remove it
7735
- setFormData({ ...formData,
7646
+
7647
+ setFormData({
7648
+ ...formData,
7736
7649
  [item._id]: {
7737
7650
  questionName: item.text,
7738
7651
  solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
@@ -7740,20 +7653,24 @@ const FormPage = ({
7740
7653
  }
7741
7654
  });
7742
7655
  }
7743
- } // if the checkbox is unchecked
7656
+ }
7657
+ // if the checkbox is unchecked
7744
7658
  else {
7745
7659
  // if the checkbox is unchecked and the solution array is empty
7746
7660
  if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
7747
- setFormData({ ...formData,
7661
+ setFormData({
7662
+ ...formData,
7748
7663
  [item._id]: {
7749
7664
  questionName: item.text,
7750
7665
  solutionArray: [option.value],
7751
7666
  questionType: 'MC'
7752
7667
  }
7753
7668
  });
7754
- } // if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
7669
+ }
7670
+ // if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
7755
7671
  else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
7756
- setFormData({ ...formData,
7672
+ setFormData({
7673
+ ...formData,
7757
7674
  [item._id]: {
7758
7675
  questionName: item.text,
7759
7676
  solutionArray: [...formData[item._id]?.solutionArray, option.value],
@@ -7763,7 +7680,6 @@ const FormPage = ({
7763
7680
  }
7764
7681
  }
7765
7682
  };
7766
-
7767
7683
  return /*#__PURE__*/React.createElement("section", {
7768
7684
  className: classes.formPageSection
7769
7685
  }, /*#__PURE__*/React.createElement("div", {
@@ -7790,7 +7706,8 @@ const FormPage = ({
7790
7706
  placeholder: "Short answer",
7791
7707
  name: item._id,
7792
7708
  onChange: e => {
7793
- setFormData({ ...formData,
7709
+ setFormData({
7710
+ ...formData,
7794
7711
  [item._id]: {
7795
7712
  index,
7796
7713
  questionName: item.text,
@@ -7830,11 +7747,13 @@ const FormPage = ({
7830
7747
  name: "text",
7831
7748
  required: item.isRequired,
7832
7749
  value: option.value,
7833
- checked: formData[item._id]?.solutionArray?.[0] === option.value // name={option.value}
7750
+ checked: formData[item._id]?.solutionArray?.[0] === option.value
7751
+ // name={option.value}
7834
7752
  // id={option.value}
7835
7753
  ,
7836
7754
  onClick: e => {
7837
- setFormData({ ...formData,
7755
+ setFormData({
7756
+ ...formData,
7838
7757
  [item._id]: {
7839
7758
  questionName: item.text,
7840
7759
  solutionArray: [option.value],
@@ -7850,9 +7769,10 @@ const FormPage = ({
7850
7769
  data: {
7851
7770
  // link: 'headerData?.loginCtaLink',
7852
7771
  // isLink: 1,
7853
- value: 'SUBMIT' // isExternal: 1
7854
-
7772
+ value: 'SUBMIT'
7773
+ // isExternal: 1
7855
7774
  },
7775
+
7856
7776
  type: 'primary',
7857
7777
  size: 'medium',
7858
7778
  target: null,
@@ -7946,7 +7866,6 @@ function Tiles({
7946
7866
  const nodeData = sectionData.components;
7947
7867
  console.log(nodeData);
7948
7868
  const tilesList = nodeData[0]?.tilesList.components;
7949
-
7950
7869
  const handleClick = value => {
7951
7870
  if (!isEdit && value) {
7952
7871
  if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
@@ -7956,7 +7875,6 @@ function Tiles({
7956
7875
  }
7957
7876
  }
7958
7877
  };
7959
-
7960
7878
  const TileDiv = tilesList?.map((tile, i) => {
7961
7879
  return /*#__PURE__*/React.createElement(Fragment, {
7962
7880
  key: i
@@ -8020,8 +7938,8 @@ const useEmailStyles = createUseStyles(theme => ({
8020
7938
  width: '28px',
8021
7939
  height: '28px'
8022
7940
  /* margin: 18px 0px; */
8023
-
8024
7941
  },
7942
+
8025
7943
  'p-young-guru-title': {
8026
7944
  fontFamily: theme?.typography?.fontFamily,
8027
7945
  fontStyle: 'normal',
@@ -8048,8 +7966,8 @@ const useEmailStyles = createUseStyles(theme => ({
8048
7966
  fontSize: '0',
8049
7967
  textAlign: 'center'
8050
7968
  /* padding:35px 0 40px */
8051
-
8052
7969
  },
7970
+
8053
7971
  'two-columns .column': {
8054
7972
  width: '100%',
8055
7973
  maxWidth: '275px',
@@ -8065,16 +7983,18 @@ const useEmailStyles = createUseStyles(theme => ({
8065
7983
  color: '#030a21',
8066
7984
  marginBottom: '5px',
8067
7985
  textAlign: 'left'
8068
- } // @media screen and (max-width: 600px) {
8069
- // }
7986
+ }
8070
7987
 
7988
+ // @media screen and (max-width: 600px) {
7989
+ // }
8071
7990
  }));
8072
7991
 
8073
7992
  function Section({
8074
7993
  nodeData,
8075
- emailRef
7994
+ emailRef,
7995
+ customHtmlData
8076
7996
  }) {
8077
- console.log('nodedataashu', nodeData);
7997
+ console.log('customHtmlData', customHtmlData);
8078
7998
  const header = nodeData?.components[0];
8079
7999
  const body = nodeData?.components[1];
8080
8000
  const landing = nodeData?.components[2];
@@ -8088,7 +8008,13 @@ function Section({
8088
8008
  style: {
8089
8009
  width: '100%'
8090
8010
  }
8091
- }, /*#__PURE__*/React.createElement("tbody", null, header?.isActive ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("table", {
8011
+ }, /*#__PURE__*/React.createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React.createElement("div", {
8012
+ className: classes.email_description_para,
8013
+ dangerouslySetInnerHTML: {
8014
+ __html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
8015
+ // __html: '<div>sdnfksdnflksdnfklsndk</div>'
8016
+ }
8017
+ }) : /*#__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", {
8092
8018
  style: {
8093
8019
  textAlign: 'center',
8094
8020
  background: '#ffffff',
@@ -8112,7 +8038,8 @@ function Section({
8112
8038
  minHeight: '30px'
8113
8039
  }
8114
8040
  }, "Your logo")))))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React.createElement("img", {
8115
- src: header?.components[1]?.metadata?.image // width={600}
8041
+ src: header?.components[1]?.metadata?.image
8042
+ // width={600}
8116
8043
  ,
8117
8044
  alt: "",
8118
8045
  style: {
@@ -8269,7 +8196,7 @@ function Section({
8269
8196
  textDecoration: 'none'
8270
8197
  }
8271
8198
  }, /*#__PURE__*/React.createElement("img", {
8272
- src: footer?.components[0]?.metadata?.iconUrl,
8199
+ src: footer?.components[0]?.metadata?.text ? footer?.components[0]?.metadata?.iconUrlColor : footer?.components[0]?.metadata?.iconUrl,
8273
8200
  alt: "",
8274
8201
  style: {
8275
8202
  width: '36px',
@@ -8282,7 +8209,7 @@ function Section({
8282
8209
  textDecoration: 'none'
8283
8210
  }
8284
8211
  }, /*#__PURE__*/React.createElement("img", {
8285
- src: footer?.components[1]?.metadata?.iconUrl,
8212
+ src: footer?.components[0]?.metadata?.text ? footer?.components[0]?.metadata?.iconUrlColor : footer?.components[0]?.metadata?.iconUrl,
8286
8213
  alt: "",
8287
8214
  style: {
8288
8215
  width: '36px',
@@ -8296,7 +8223,7 @@ function Section({
8296
8223
  textDecoration: 'none'
8297
8224
  }
8298
8225
  }, /*#__PURE__*/React.createElement("img", {
8299
- src: footer?.components[2]?.metadata?.iconUrl,
8226
+ src: footer?.components[0]?.metadata?.text ? footer?.components[0]?.metadata?.iconUrlColor : footer?.components[0]?.metadata?.iconUrl,
8300
8227
  alt: "",
8301
8228
  style: {
8302
8229
  width: '36px',
@@ -8309,7 +8236,7 @@ function Section({
8309
8236
  textDecoration: 'none'
8310
8237
  }
8311
8238
  }, /*#__PURE__*/React.createElement("img", {
8312
- src: footer?.components[3]?.metadata?.iconUrl,
8239
+ src: footer?.components[0]?.metadata?.text ? footer?.components[0]?.metadata?.iconUrlColor : footer?.components[0]?.metadata?.iconUrl,
8313
8240
  alt: "",
8314
8241
  style: {
8315
8242
  width: '36px',
@@ -8323,7 +8250,7 @@ function Section({
8323
8250
  textDecoration: 'none'
8324
8251
  }
8325
8252
  }, /*#__PURE__*/React.createElement("img", {
8326
- src: footer?.components[4]?.metadata?.iconUrl,
8253
+ src: footer?.components[0]?.metadata?.text ? footer?.components[0]?.metadata?.iconUrlColor : footer?.components[0]?.metadata?.iconUrl,
8327
8254
  alt: "",
8328
8255
  style: {
8329
8256
  width: '36px',
@@ -8344,7 +8271,7 @@ function Section({
8344
8271
  textAlign: 'center',
8345
8272
  color: '#7d8592'
8346
8273
  }
8347
- }, "For any concerns, mail us at", footer?.components[5]?.metaData?.emailId), /*#__PURE__*/React.createElement("p", {
8274
+ }, "For any concerns, mail us at", ' ' + footer?.components[5]?.metadata?.text), /*#__PURE__*/React.createElement("p", {
8348
8275
  style: {
8349
8276
  // fontFamily: 'Roboto',
8350
8277
  fontStyle: 'normal',
@@ -8354,7 +8281,7 @@ function Section({
8354
8281
  textAlign: 'center',
8355
8282
  color: '#7d8592'
8356
8283
  }
8357
- }, "Copyright \xA9 2022 | vaibhavphotography.com"), /*#__PURE__*/React.createElement("p", {
8284
+ }, "Copyright \xA9 2022 |", ' ' + footer?.components[5]?.metadata?.text), /*#__PURE__*/React.createElement("p", {
8358
8285
  style: {
8359
8286
  // fontFamily: 'Roboto',
8360
8287
  fontStyle: 'normal',
@@ -8365,37 +8292,37 @@ function Section({
8365
8292
  color: '#7d8592',
8366
8293
  marginBottom: '22px'
8367
8294
  }
8368
- }, "All rights reserved.")))))))))))))) : null))));
8295
+ }, "All rights reserved.")))))))))))))) : null)))));
8369
8296
  }
8370
-
8371
8297
  function EmailDripMarket({
8372
8298
  sectionData,
8373
8299
  extraProps = {}
8374
8300
  }) {
8375
- // const classes = useSectionStyles({ containerWidth });
8376
- const isInitialMount = useRef(true); // useEffect(() => {
8377
- // convertToHtml(sectionData)
8378
- // }, [sectionData])
8379
-
8301
+ console.log('extrapropstemplate', extraProps);
8302
+ const isInitialMount = useRef(true);
8380
8303
  const convertToHtml = sectionData => {
8381
8304
  const html = ReactDOMServer.renderToStaticMarkup( /*#__PURE__*/React.createElement(Section, {
8382
8305
  nodeData: sectionData
8383
8306
  }));
8384
8307
  return html;
8385
8308
  };
8386
-
8387
8309
  useEffect(() => {
8388
8310
  if (isInitialMount.current) {
8389
8311
  isInitialMount.current = false;
8390
8312
  } else {
8391
8313
  extraProps?.callbackHtml(convertToHtml(sectionData));
8392
8314
  }
8393
- }, [extraProps?.convertedHtml]); // const mockData = sectionData?.sections[0];
8315
+ }, [extraProps?.convertedHtml]);
8394
8316
 
8317
+ // const mockData = sectionData?.sections[0];
8395
8318
  const emailRef = useRef(null);
8396
- console.log('skdjnkdln', extraProps);
8397
- return /*#__PURE__*/React.createElement("section", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Section, {
8319
+ return /*#__PURE__*/React.createElement("section", {
8320
+ style: {
8321
+ width: '95%'
8322
+ }
8323
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Section, {
8398
8324
  sectionRef: emailRef,
8325
+ customHtmlData: extraProps?.customHtmlData,
8399
8326
  nodeData: sectionData
8400
8327
  })));
8401
8328
  }
@@ -8429,9 +8356,7 @@ const TYPE_TO_COMPONENT_MAP = {
8429
8356
  TILES_SECTION: Tiles,
8430
8357
  EMAIL_DRIP_MARKET: EmailDripMarket
8431
8358
  };
8432
-
8433
8359
  const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
8434
-
8435
8360
  const MemoisedSection = /*#__PURE__*/memo(({
8436
8361
  sectionData,
8437
8362
  extraProps
@@ -8544,11 +8469,9 @@ const componentParser = compObj => {
8544
8469
  });
8545
8470
  return component;
8546
8471
  }
8547
-
8548
8472
  if (Array.isArray(compObj.components)) {
8549
8473
  compObj.components = compObj.components.map(componentParser);
8550
8474
  }
8551
-
8552
8475
  return compObj;
8553
8476
  };
8554
8477
  const inverseComponentParser = compObj => {
@@ -8573,7 +8496,6 @@ const inverseComponentParser = compObj => {
8573
8496
  if (compObj.components) {
8574
8497
  compObj.components = compObj.components.map(inverseComponentParser);
8575
8498
  }
8576
-
8577
8499
  return compObj;
8578
8500
  }
8579
8501
  };