diy-template-components 0.2.9 → 0.2.11
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 +241 -150
- package/build/index.es.js.map +1 -1
- package/build/index.js +241 -150
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function ___$insertStyle(css) {
|
|
2
|
-
if (!css ||
|
|
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 || !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;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
|
|
@@ -18,17 +18,20 @@ 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
|
|
21
|
+
_extends = Object.assign || function (target) {
|
|
22
22
|
for (var i = 1; i < arguments.length; i++) {
|
|
23
23
|
var source = arguments[i];
|
|
24
|
+
|
|
24
25
|
for (var key in source) {
|
|
25
26
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
26
27
|
target[key] = source[key];
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
|
|
30
32
|
return target;
|
|
31
33
|
};
|
|
34
|
+
|
|
32
35
|
return _extends.apply(this, arguments);
|
|
33
36
|
}
|
|
34
37
|
|
|
@@ -284,17 +287,21 @@ const alpha = {
|
|
|
284
287
|
seventyPercent: 0.7,
|
|
285
288
|
eightyPercent: 0.8
|
|
286
289
|
};
|
|
290
|
+
|
|
287
291
|
const getRGBFromHex = hex => {
|
|
288
292
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
289
293
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
290
294
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
291
295
|
return [r, g, b];
|
|
292
296
|
};
|
|
297
|
+
|
|
293
298
|
const hexToRgbA = (hex, alpha = null) => {
|
|
294
299
|
const values = getRGBFromHex(hex);
|
|
300
|
+
|
|
295
301
|
if (alpha !== null) {
|
|
296
302
|
values.push(alpha);
|
|
297
303
|
}
|
|
304
|
+
|
|
298
305
|
return `rgba(${values.join(',')})`;
|
|
299
306
|
};
|
|
300
307
|
const colorMixer = (hex1, weightage = 1, hex2 = colors.white) => {
|
|
@@ -434,24 +441,29 @@ function useLinkBuilder(data) {
|
|
|
434
441
|
basePath,
|
|
435
442
|
isMasterTemplate
|
|
436
443
|
} = useContext(PageContext);
|
|
444
|
+
|
|
437
445
|
if (isEdit || !data.isLink) {
|
|
438
446
|
return null;
|
|
439
447
|
}
|
|
448
|
+
|
|
440
449
|
if (data?.isExistingLink === false) {
|
|
441
450
|
return data.link;
|
|
442
451
|
}
|
|
452
|
+
|
|
443
453
|
if (data?.isExternal) {
|
|
444
454
|
return data.link;
|
|
445
455
|
}
|
|
456
|
+
|
|
446
457
|
if (!isPreview) {
|
|
447
458
|
const link = data.link === '/' ? '' : '/' + data.link;
|
|
448
459
|
return basePath ? `//${basePath}${link}` : null;
|
|
449
|
-
}
|
|
460
|
+
} // courses in preview: special case
|
|
461
|
+
|
|
450
462
|
|
|
451
|
-
// courses in preview: special case
|
|
452
463
|
if (data.link === 'courses') {
|
|
453
464
|
return `//${basePath}/courses`;
|
|
454
465
|
}
|
|
466
|
+
|
|
455
467
|
const {
|
|
456
468
|
pageId
|
|
457
469
|
} = navList.find(el => el.slug === data?.link) || {};
|
|
@@ -627,12 +639,14 @@ var calendar$1 = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%
|
|
|
627
639
|
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";
|
|
628
640
|
|
|
629
641
|
/** @returns {import('./types').IconData} */
|
|
642
|
+
|
|
630
643
|
const getConfiguredIcon1 = url => ({
|
|
631
644
|
url,
|
|
632
645
|
svgChildrenConfigs: []
|
|
633
646
|
});
|
|
634
|
-
|
|
635
647
|
/** @returns {import('./types').IconData} */
|
|
648
|
+
|
|
649
|
+
|
|
636
650
|
const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
637
651
|
url,
|
|
638
652
|
svgChildrenConfigs: [{
|
|
@@ -641,6 +655,7 @@ const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
|
641
655
|
fill
|
|
642
656
|
}]
|
|
643
657
|
});
|
|
658
|
+
|
|
644
659
|
const icons = {
|
|
645
660
|
'Live class': getConfiguredIcon2(liveTv, false, true),
|
|
646
661
|
'Recorded videos': getConfiguredIcon2(liveTv2, false, true),
|
|
@@ -673,51 +688,41 @@ const icons = {
|
|
|
673
688
|
'Video Play': getConfiguredIcon2(videoPlay, false, true),
|
|
674
689
|
Quote: getConfiguredIcon2(quote, false, true),
|
|
675
690
|
// Stock
|
|
676
|
-
|
|
677
691
|
'Stock Growth': getConfiguredIcon2(stockGrowth, false, true),
|
|
678
692
|
Money: getConfiguredIcon2(money, false, true),
|
|
679
693
|
Split: getConfiguredIcon2(split, false, true),
|
|
680
694
|
Chart: getConfiguredIcon2(chart, false, true),
|
|
681
695
|
// Personality Development
|
|
682
|
-
|
|
683
696
|
Leaders: getConfiguredIcon2(leaders, false, true),
|
|
684
697
|
Women: getConfiguredIcon2(women, false, true),
|
|
685
698
|
Program: getConfiguredIcon2(program, false, true),
|
|
686
699
|
// Photography
|
|
687
|
-
|
|
688
700
|
'Video Editing': getConfiguredIcon2(videoEditing, false, true),
|
|
689
701
|
Editing: getConfiguredIcon2(editing, false, true),
|
|
690
702
|
Camera: getConfiguredIcon2(camera, false, true),
|
|
691
703
|
Sessions: getConfiguredIcon2(sessions, false, true),
|
|
692
704
|
// Computer
|
|
693
|
-
|
|
694
705
|
'Regular Batches': getConfiguredIcon2(regularBatches, false, true),
|
|
695
706
|
'Alternate Batches': getConfiguredIcon2(alternateBatches, false, true),
|
|
696
707
|
'Weekend Batches': getConfiguredIcon2(weekendBatches, false, true),
|
|
697
708
|
// Life Coach
|
|
698
|
-
|
|
699
709
|
Girl: getConfiguredIcon2(girl, false, true),
|
|
700
710
|
Smile: getConfiguredIcon2(smile, false, true),
|
|
701
711
|
Relationships: getConfiguredIcon2(relationships, false, true),
|
|
702
712
|
// Music
|
|
703
|
-
|
|
704
713
|
Vocal: getConfiguredIcon2(vocal, false, true),
|
|
705
714
|
Instrument: getConfiguredIcon2(instrument, false, true),
|
|
706
715
|
Music: getConfiguredIcon2(music, false, true),
|
|
707
716
|
// Fitness
|
|
708
|
-
|
|
709
717
|
Workout: getConfiguredIcon2(workout, false, true),
|
|
710
718
|
Barbell: getConfiguredIcon2(barbell, false, true),
|
|
711
719
|
Trainer: getConfiguredIcon2(trainer, false, true),
|
|
712
720
|
Report: getConfiguredIcon2(report, false, true),
|
|
713
721
|
// Govt Exam
|
|
714
|
-
|
|
715
722
|
'Govt Exam': getConfiguredIcon2(govtExam, false, true),
|
|
716
723
|
// IIT JEE
|
|
717
|
-
|
|
718
724
|
College: getConfiguredIcon2(college, false, true),
|
|
719
725
|
// Others
|
|
720
|
-
|
|
721
726
|
Teachers: getConfiguredIcon2(teachers, false, true),
|
|
722
727
|
Learning: getConfiguredIcon2(learning, false, true),
|
|
723
728
|
Success: getConfiguredIcon2(success, false, true),
|
|
@@ -729,9 +734,12 @@ const icons = {
|
|
|
729
734
|
Video: getConfiguredIcon2(video, false, true)
|
|
730
735
|
};
|
|
731
736
|
|
|
732
|
-
const someMethod1 = (
|
|
737
|
+
const someMethod1 = (
|
|
738
|
+
/** @type {import('./types').IconData["svgChildrenConfigs"]} */
|
|
739
|
+
svgChildrenConfigs, color, hoverColor) => {
|
|
733
740
|
/** @type {{ [k:string]:React.CSSProperties; }} */
|
|
734
741
|
const obj = {};
|
|
742
|
+
|
|
735
743
|
for (const svgChildConfig of svgChildrenConfigs) {
|
|
736
744
|
if (color) obj['& ' + svgChildConfig.selector] = {
|
|
737
745
|
fill: svgChildConfig.fill ? color : undefined,
|
|
@@ -742,8 +750,10 @@ const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"
|
|
|
742
750
|
stroke: svgChildConfig.stroke ? hoverColor : undefined
|
|
743
751
|
};
|
|
744
752
|
}
|
|
753
|
+
|
|
745
754
|
return obj;
|
|
746
755
|
};
|
|
756
|
+
|
|
747
757
|
const useStyles$1 = createUseStyles$1({
|
|
748
758
|
'@keyframes slideRight': {
|
|
749
759
|
to: {
|
|
@@ -787,8 +797,8 @@ const defaultSvgState = {
|
|
|
787
797
|
childrenConfigs: [],
|
|
788
798
|
attributes: defaultAttributes
|
|
789
799
|
};
|
|
790
|
-
|
|
791
800
|
/** @type {import('./props.type').IconProps} */
|
|
801
|
+
|
|
792
802
|
const iconDefaultProps = {
|
|
793
803
|
name: undefined,
|
|
794
804
|
width: 'auto',
|
|
@@ -798,8 +808,8 @@ const iconDefaultProps = {
|
|
|
798
808
|
opacity: undefined,
|
|
799
809
|
className: undefined
|
|
800
810
|
};
|
|
801
|
-
|
|
802
811
|
/** @type {import("react").FC<import('./props.type').IconProps>} */
|
|
812
|
+
|
|
803
813
|
const Icon = ({
|
|
804
814
|
name,
|
|
805
815
|
width,
|
|
@@ -818,8 +828,10 @@ const Icon = ({
|
|
|
818
828
|
}, []);
|
|
819
829
|
/** */
|
|
820
830
|
|
|
821
|
-
const rootRef = useRef(
|
|
822
|
-
|
|
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
|
+
|
|
823
835
|
const currentName = useRef(name);
|
|
824
836
|
const [svgState, setSvgState] = useState(defaultSvgState);
|
|
825
837
|
const styles = useStyles$1({
|
|
@@ -830,41 +842,46 @@ const Icon = ({
|
|
|
830
842
|
opacity,
|
|
831
843
|
hoverColor
|
|
832
844
|
});
|
|
845
|
+
|
|
833
846
|
const _className = useMemo(() => `${styles.root} ${className || ''}`, [className]);
|
|
847
|
+
|
|
834
848
|
useEffect(() => {
|
|
835
849
|
// reset
|
|
836
850
|
currentName.current = name;
|
|
837
851
|
setSvgState(defaultSvgState);
|
|
838
852
|
const icon = icons[name];
|
|
853
|
+
|
|
839
854
|
if (icon) {
|
|
840
855
|
/**
|
|
841
856
|
* retrieve from cache
|
|
842
857
|
* @type {Promise<string>}
|
|
843
858
|
*/
|
|
844
859
|
let svgProm = Icon.getCachedSvgPromise(name);
|
|
860
|
+
|
|
845
861
|
if (!svgProm) {
|
|
846
862
|
svgProm = fetch(icon.url).then(r => r.text()).catch(() => {
|
|
847
863
|
// unset in cache
|
|
848
864
|
Icon.setCachedSvgPromise(name, undefined);
|
|
849
865
|
return null;
|
|
850
|
-
});
|
|
851
|
-
|
|
866
|
+
}); //save in cache
|
|
867
|
+
|
|
852
868
|
Icon.setCachedSvgPromise(name, svgProm);
|
|
853
869
|
}
|
|
870
|
+
|
|
854
871
|
svgProm.then(svg => {
|
|
855
872
|
if (svg && isMounted.current && name === currentName.current) {
|
|
856
873
|
const div = document.createElement('div');
|
|
857
|
-
div.innerHTML = svg;
|
|
874
|
+
div.innerHTML = svg; // set the new attributes
|
|
858
875
|
|
|
859
|
-
// set the new attributes
|
|
860
876
|
const newAttributes = {};
|
|
877
|
+
|
|
861
878
|
for (const ob of div.firstElementChild.attributes) {
|
|
862
879
|
const camelCased = ob.name.replace(/(-|:)([a-z])/g, g => g[1].toUpperCase());
|
|
863
880
|
newAttributes[camelCased] = ob.value;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
// setting the state in last.
|
|
881
|
+
} // setting the state in last.
|
|
867
882
|
// Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
|
|
883
|
+
|
|
884
|
+
|
|
868
885
|
setSvgState({
|
|
869
886
|
innerHtml: div.firstElementChild.innerHTML,
|
|
870
887
|
childrenConfigs: icon.svgChildrenConfigs,
|
|
@@ -884,11 +901,14 @@ const Icon = ({
|
|
|
884
901
|
onClick: onClick
|
|
885
902
|
}));
|
|
886
903
|
};
|
|
887
|
-
Icon.defaultProps = iconDefaultProps;
|
|
888
904
|
|
|
905
|
+
Icon.defaultProps = iconDefaultProps;
|
|
889
906
|
/** static properties for caching */
|
|
907
|
+
|
|
890
908
|
Icon.cacheStore = {};
|
|
909
|
+
|
|
891
910
|
Icon.getCachedSvgPromise = name => Icon.cacheStore[name];
|
|
911
|
+
|
|
892
912
|
Icon.setCachedSvgPromise = (name, prom) => Icon.cacheStore[name] = prom;
|
|
893
913
|
|
|
894
914
|
const useDropdownStyles = createUseStyles(theme => ({
|
|
@@ -1000,6 +1020,7 @@ function OptionList({
|
|
|
1000
1020
|
isLandingPages
|
|
1001
1021
|
}) {
|
|
1002
1022
|
useContext(PageContext);
|
|
1023
|
+
|
|
1003
1024
|
const tabsDataModifier = () => {
|
|
1004
1025
|
return optionsData?.map(dt => {
|
|
1005
1026
|
return {
|
|
@@ -1011,6 +1032,7 @@ function OptionList({
|
|
|
1011
1032
|
};
|
|
1012
1033
|
});
|
|
1013
1034
|
};
|
|
1035
|
+
|
|
1014
1036
|
const tabData = tabsDataModifier();
|
|
1015
1037
|
const classes = useSectionStyles$a();
|
|
1016
1038
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1099,24 +1121,31 @@ function DesktopHeader({
|
|
|
1099
1121
|
const classes = useSectionStyles$a({
|
|
1100
1122
|
isFixed
|
|
1101
1123
|
});
|
|
1124
|
+
|
|
1102
1125
|
const optionDataFn = () => {
|
|
1103
1126
|
let optionsArr = navData;
|
|
1104
1127
|
let optionsData = [];
|
|
1128
|
+
|
|
1105
1129
|
if (optionsArr?.length > 5) {
|
|
1106
1130
|
optionsData = optionsArr?.slice(0, 4);
|
|
1107
1131
|
} else {
|
|
1108
1132
|
optionsData = optionsArr;
|
|
1109
1133
|
}
|
|
1134
|
+
|
|
1110
1135
|
return optionsData;
|
|
1111
1136
|
};
|
|
1137
|
+
|
|
1112
1138
|
const moreContentFn = () => {
|
|
1113
1139
|
let optionsArr = navData;
|
|
1114
1140
|
let moreContent = [];
|
|
1141
|
+
|
|
1115
1142
|
if (optionsArr?.length > 5) {
|
|
1116
1143
|
moreContent = optionsArr?.slice(4);
|
|
1117
1144
|
}
|
|
1145
|
+
|
|
1118
1146
|
return moreContent;
|
|
1119
1147
|
};
|
|
1148
|
+
|
|
1120
1149
|
return /*#__PURE__*/React.createElement("nav", {
|
|
1121
1150
|
className: classes.section
|
|
1122
1151
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1174,6 +1203,7 @@ function MobileHeader({
|
|
|
1174
1203
|
const navEl = useRef(null);
|
|
1175
1204
|
useLayoutEffect(() => {
|
|
1176
1205
|
const body = navEl?.current?.ownerDocument?.body;
|
|
1206
|
+
|
|
1177
1207
|
if (sideMenu) {
|
|
1178
1208
|
body?.setAttribute('style', 'overflow: hidden;');
|
|
1179
1209
|
} else {
|
|
@@ -1183,6 +1213,7 @@ function MobileHeader({
|
|
|
1183
1213
|
let iosUrl = null;
|
|
1184
1214
|
let androidUrl = null;
|
|
1185
1215
|
let downloadLink = null;
|
|
1216
|
+
|
|
1186
1217
|
if (isTutorWebsite) {
|
|
1187
1218
|
if (header?.iosUrl) {
|
|
1188
1219
|
iosUrl = /*#__PURE__*/React.createElement(Button, {
|
|
@@ -1205,6 +1236,7 @@ function MobileHeader({
|
|
|
1205
1236
|
}
|
|
1206
1237
|
});
|
|
1207
1238
|
}
|
|
1239
|
+
|
|
1208
1240
|
if (header?.androidURL) {
|
|
1209
1241
|
androidUrl = /*#__PURE__*/React.createElement(Button, {
|
|
1210
1242
|
data: {
|
|
@@ -1225,6 +1257,7 @@ function MobileHeader({
|
|
|
1225
1257
|
}
|
|
1226
1258
|
});
|
|
1227
1259
|
}
|
|
1260
|
+
|
|
1228
1261
|
if (iosUrl && androidUrl) {
|
|
1229
1262
|
downloadLink = /*#__PURE__*/React.createElement("div", null, iosUrl, androidUrl);
|
|
1230
1263
|
} else if (header?.iosUrl) {
|
|
@@ -1274,6 +1307,7 @@ function MobileHeader({
|
|
|
1274
1307
|
downloadLink = null;
|
|
1275
1308
|
}
|
|
1276
1309
|
}
|
|
1310
|
+
|
|
1277
1311
|
return /*#__PURE__*/React.createElement("nav", {
|
|
1278
1312
|
ref: navEl,
|
|
1279
1313
|
className: classes.section
|
|
@@ -1330,9 +1364,11 @@ function Header({
|
|
|
1330
1364
|
isMobile,
|
|
1331
1365
|
isTutorWebsite
|
|
1332
1366
|
} = useContext(PageContext);
|
|
1367
|
+
|
|
1333
1368
|
const filterHiddenNavs = () => {
|
|
1334
1369
|
return data?.navs?.filter(dt => !dt.isHiddenNav);
|
|
1335
1370
|
};
|
|
1371
|
+
|
|
1336
1372
|
return isMobile ? /*#__PURE__*/React.createElement(MobileHeader, {
|
|
1337
1373
|
navData: filterHiddenNavs(),
|
|
1338
1374
|
header: data,
|
|
@@ -1688,6 +1724,7 @@ const rustTheme = {
|
|
|
1688
1724
|
light: colors.lightRust,
|
|
1689
1725
|
lightest: colors.lightestRust
|
|
1690
1726
|
};
|
|
1727
|
+
|
|
1691
1728
|
const generateThemePalette = themeColors => ({
|
|
1692
1729
|
primary: themeColors,
|
|
1693
1730
|
background: {
|
|
@@ -1710,6 +1747,7 @@ const generateThemePalette = themeColors => ({
|
|
|
1710
1747
|
tertiary: colors.blueGrey
|
|
1711
1748
|
}
|
|
1712
1749
|
});
|
|
1750
|
+
|
|
1713
1751
|
const bluePalette = generateThemePalette(blueTheme);
|
|
1714
1752
|
const redPalette = generateThemePalette(redTheme);
|
|
1715
1753
|
const orangePalette = generateThemePalette(orangeTheme);
|
|
@@ -1750,7 +1788,9 @@ const fontComponents = {
|
|
|
1750
1788
|
'Merriweather Sans': MerriweatherSans,
|
|
1751
1789
|
'Arima Madurai': ArimaMadurai
|
|
1752
1790
|
};
|
|
1791
|
+
|
|
1753
1792
|
const getFontComponent = font => fontComponents[font] || (() => null);
|
|
1793
|
+
|
|
1754
1794
|
function FontSeeder({
|
|
1755
1795
|
fontFamily
|
|
1756
1796
|
}) {
|
|
@@ -1760,30 +1800,37 @@ function FontSeeder({
|
|
|
1760
1800
|
const useRubikFont = createUseStyles$1({
|
|
1761
1801
|
'@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')`
|
|
1762
1802
|
});
|
|
1803
|
+
|
|
1763
1804
|
function Rubik() {
|
|
1764
1805
|
// to import "Rubik" font css
|
|
1765
1806
|
useRubikFont();
|
|
1766
1807
|
return null;
|
|
1767
1808
|
}
|
|
1809
|
+
|
|
1768
1810
|
const useIbmPlexSansFont = createUseStyles$1({
|
|
1769
1811
|
'@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)'
|
|
1770
1812
|
});
|
|
1813
|
+
|
|
1771
1814
|
function IbmPlexSans() {
|
|
1772
1815
|
// to import "Ibm Plex Sans" font css
|
|
1773
1816
|
useIbmPlexSansFont();
|
|
1774
1817
|
return null;
|
|
1775
1818
|
}
|
|
1819
|
+
|
|
1776
1820
|
const useMerriweatherSansFont = createUseStyles$1({
|
|
1777
1821
|
'@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)'
|
|
1778
1822
|
});
|
|
1823
|
+
|
|
1779
1824
|
function MerriweatherSans() {
|
|
1780
1825
|
// to import "Merriweather Sans" font css
|
|
1781
1826
|
useMerriweatherSansFont();
|
|
1782
1827
|
return null;
|
|
1783
1828
|
}
|
|
1829
|
+
|
|
1784
1830
|
const useArimaMaduraiFont = createUseStyles$1({
|
|
1785
1831
|
'@import': 'url(https://fonts.googleapis.com/css2?family=Arima+Madurai:wght@400;500;700&display=swap)'
|
|
1786
1832
|
});
|
|
1833
|
+
|
|
1787
1834
|
function ArimaMadurai() {
|
|
1788
1835
|
// to import "Arima Madurai" font css
|
|
1789
1836
|
useArimaMaduraiFont();
|
|
@@ -1814,7 +1861,9 @@ const TYPE_TO_COMPONENT_MAP$1 = {
|
|
|
1814
1861
|
TILES_SECTION: /*#__PURE__*/lazy(() => Promise.resolve().then(function () { return index$1; })),
|
|
1815
1862
|
EMAIL_DRIP_MARKET: /*#__PURE__*/lazy(() => Promise.resolve().then(function () { return index; }))
|
|
1816
1863
|
};
|
|
1864
|
+
|
|
1817
1865
|
const getCompToRender$1 = type => TYPE_TO_COMPONENT_MAP$1[type] || (() => null);
|
|
1866
|
+
|
|
1818
1867
|
const MemoisedSection$1 = /*#__PURE__*/memo(({
|
|
1819
1868
|
sectionData,
|
|
1820
1869
|
extraProps
|
|
@@ -1831,7 +1880,9 @@ function SectionRenderer$1({
|
|
|
1831
1880
|
extraProps
|
|
1832
1881
|
}) {
|
|
1833
1882
|
return /*#__PURE__*/React.createElement(Suspense, {
|
|
1834
|
-
fallback: null
|
|
1883
|
+
fallback: null
|
|
1884
|
+
/*GIF maybe*/
|
|
1885
|
+
|
|
1835
1886
|
}, /*#__PURE__*/React.createElement(MemoisedSection$1, {
|
|
1836
1887
|
sectionData: sectionData,
|
|
1837
1888
|
extraProps: extraProps
|
|
@@ -2115,18 +2166,23 @@ const getArrowRotationAngle = props => {
|
|
|
2115
2166
|
switch (true) {
|
|
2116
2167
|
case props.left:
|
|
2117
2168
|
return 180;
|
|
2169
|
+
|
|
2118
2170
|
case props.up:
|
|
2119
2171
|
return 270;
|
|
2172
|
+
|
|
2120
2173
|
case props.down:
|
|
2121
2174
|
return 90;
|
|
2175
|
+
|
|
2122
2176
|
case props.right:
|
|
2123
2177
|
default:
|
|
2124
2178
|
return 0;
|
|
2125
2179
|
}
|
|
2126
2180
|
};
|
|
2181
|
+
|
|
2127
2182
|
const sizeHandler = ({
|
|
2128
2183
|
size
|
|
2129
2184
|
}) => size === 'small' ? '32px' : '48px';
|
|
2185
|
+
|
|
2130
2186
|
const useArrowButtonStyles = createUseStyles(theme => ({
|
|
2131
2187
|
arrowButtonContainer: {
|
|
2132
2188
|
cursor: 'pointer',
|
|
@@ -2166,6 +2222,7 @@ function dotsToShow(i, n) {
|
|
|
2166
2222
|
const leftToShow = i < elementsToShow / 2;
|
|
2167
2223
|
const rightToShow = n - i - 1 < elementsToShow / 2;
|
|
2168
2224
|
let leftCount, rightCount;
|
|
2225
|
+
|
|
2169
2226
|
if (leftToShow) {
|
|
2170
2227
|
leftCount = i;
|
|
2171
2228
|
rightCount = elementsToShow - i - 1;
|
|
@@ -2176,11 +2233,13 @@ function dotsToShow(i, n) {
|
|
|
2176
2233
|
leftCount = 2;
|
|
2177
2234
|
rightCount = 2;
|
|
2178
2235
|
}
|
|
2236
|
+
|
|
2179
2237
|
return {
|
|
2180
2238
|
leftCount,
|
|
2181
2239
|
rightCount
|
|
2182
2240
|
};
|
|
2183
2241
|
}
|
|
2242
|
+
|
|
2184
2243
|
function Carousel({
|
|
2185
2244
|
settings,
|
|
2186
2245
|
children,
|
|
@@ -2234,12 +2293,15 @@ function Carousel({
|
|
|
2234
2293
|
...settings,
|
|
2235
2294
|
className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
|
|
2236
2295
|
};
|
|
2296
|
+
|
|
2237
2297
|
const nextClick = () => {
|
|
2238
2298
|
sliderRef.current.slickNext();
|
|
2239
2299
|
};
|
|
2300
|
+
|
|
2240
2301
|
const previousClick = () => {
|
|
2241
2302
|
sliderRef.current.slickPrev();
|
|
2242
2303
|
};
|
|
2304
|
+
|
|
2243
2305
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Slider, _extends({
|
|
2244
2306
|
ref: sliderRef
|
|
2245
2307
|
}, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React.createElement("div", {
|
|
@@ -2304,6 +2366,7 @@ function Section$4({
|
|
|
2304
2366
|
src: nodeData.image.metadata.value
|
|
2305
2367
|
})));
|
|
2306
2368
|
}
|
|
2369
|
+
|
|
2307
2370
|
function BannerCarouselRight({
|
|
2308
2371
|
sectionData
|
|
2309
2372
|
}) {
|
|
@@ -2329,7 +2392,9 @@ function BannerCarouselRight({
|
|
|
2329
2392
|
className: classes.sectionContainer
|
|
2330
2393
|
}, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$4, {
|
|
2331
2394
|
nodeData: node,
|
|
2332
|
-
key: idx
|
|
2395
|
+
key: idx
|
|
2396
|
+
/* or some other unique property */
|
|
2397
|
+
|
|
2333
2398
|
})))));
|
|
2334
2399
|
}
|
|
2335
2400
|
|
|
@@ -2536,9 +2601,11 @@ function List({
|
|
|
2536
2601
|
containerWidth
|
|
2537
2602
|
});
|
|
2538
2603
|
const [nodeData] = sectionData.components;
|
|
2604
|
+
|
|
2539
2605
|
const getNumber = val => {
|
|
2540
2606
|
return val.toString().length == 1 ? '0' + val : val;
|
|
2541
2607
|
};
|
|
2608
|
+
|
|
2542
2609
|
return /*#__PURE__*/React.createElement("section", {
|
|
2543
2610
|
className: classes.section
|
|
2544
2611
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2730,6 +2797,7 @@ const Section$3 = ({
|
|
|
2730
2797
|
size: isMobile ? 'small' : 'medium'
|
|
2731
2798
|
})))));
|
|
2732
2799
|
};
|
|
2800
|
+
|
|
2733
2801
|
function BannerCarouselCenter({
|
|
2734
2802
|
sectionData
|
|
2735
2803
|
}) {
|
|
@@ -2746,7 +2814,9 @@ function BannerCarouselCenter({
|
|
|
2746
2814
|
className: classes.bannerCarouselCenterSection
|
|
2747
2815
|
}, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$3, {
|
|
2748
2816
|
nodeData: node,
|
|
2749
|
-
key: idx
|
|
2817
|
+
key: idx
|
|
2818
|
+
/* or some other unique property */
|
|
2819
|
+
|
|
2750
2820
|
}))));
|
|
2751
2821
|
}
|
|
2752
2822
|
|
|
@@ -2913,6 +2983,7 @@ function Section$2({
|
|
|
2913
2983
|
size: isMobile ? 'small' : 'medium'
|
|
2914
2984
|
})));
|
|
2915
2985
|
}
|
|
2986
|
+
|
|
2916
2987
|
function BannerCarouselLeft({
|
|
2917
2988
|
sectionData
|
|
2918
2989
|
}) {
|
|
@@ -2934,7 +3005,9 @@ function BannerCarouselLeft({
|
|
|
2934
3005
|
className: classes.sectionContainer
|
|
2935
3006
|
}, /*#__PURE__*/React.createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$2, {
|
|
2936
3007
|
nodeData: node,
|
|
2937
|
-
key: idx
|
|
3008
|
+
key: idx
|
|
3009
|
+
/* or some other unique property */
|
|
3010
|
+
|
|
2938
3011
|
})))));
|
|
2939
3012
|
}
|
|
2940
3013
|
|
|
@@ -3089,6 +3162,7 @@ async function postApiCall(baseURLs, data) {
|
|
|
3089
3162
|
},
|
|
3090
3163
|
data
|
|
3091
3164
|
});
|
|
3165
|
+
|
|
3092
3166
|
if (res) {
|
|
3093
3167
|
return res.data;
|
|
3094
3168
|
}
|
|
@@ -3113,6 +3187,7 @@ async function postApiCallForm(baseURLs, data, extraProps) {
|
|
|
3113
3187
|
if (extraProps && extraProps.formSubmitSuccess) {
|
|
3114
3188
|
extraProps.formSubmitSuccess();
|
|
3115
3189
|
}
|
|
3190
|
+
|
|
3116
3191
|
return res.data;
|
|
3117
3192
|
});
|
|
3118
3193
|
} catch (err) {
|
|
@@ -3225,6 +3300,7 @@ function SubscribeToNewsletter({
|
|
|
3225
3300
|
const [inputVal, setInputVal] = useState(formInitialValue);
|
|
3226
3301
|
let [isValid, setIsValid] = useState(true);
|
|
3227
3302
|
let [btnDisabled, setBtnDisabled] = useState(false);
|
|
3303
|
+
|
|
3228
3304
|
const handleSubmit = () => {
|
|
3229
3305
|
let data = {
|
|
3230
3306
|
sectionId: sectionData.sectionId,
|
|
@@ -3240,9 +3316,11 @@ function SubscribeToNewsletter({
|
|
|
3240
3316
|
setBtnDisabled(true);
|
|
3241
3317
|
setInputVal(formInitialValue);
|
|
3242
3318
|
};
|
|
3319
|
+
|
|
3243
3320
|
const checkValidity = () => {
|
|
3244
3321
|
if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
|
|
3245
3322
|
let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
|
|
3323
|
+
|
|
3246
3324
|
if (regex?.test(inputVal)) {
|
|
3247
3325
|
setIsValid(true);
|
|
3248
3326
|
} else {
|
|
@@ -3250,6 +3328,7 @@ function SubscribeToNewsletter({
|
|
|
3250
3328
|
}
|
|
3251
3329
|
}
|
|
3252
3330
|
};
|
|
3331
|
+
|
|
3253
3332
|
useEffect(() => {
|
|
3254
3333
|
if (!isValid) {
|
|
3255
3334
|
setBtnDisabled(true);
|
|
@@ -3577,6 +3656,7 @@ function Section$1({
|
|
|
3577
3656
|
className: classes.contentRow
|
|
3578
3657
|
}, carouselContent))));
|
|
3579
3658
|
}
|
|
3659
|
+
|
|
3580
3660
|
function Testimonials({
|
|
3581
3661
|
sectionData
|
|
3582
3662
|
}) {
|
|
@@ -3641,6 +3721,7 @@ const loaderStyle = theme => ({
|
|
|
3641
3721
|
});
|
|
3642
3722
|
|
|
3643
3723
|
const useStyles = createUseStyles$1(loaderStyle);
|
|
3724
|
+
|
|
3644
3725
|
function Loader({
|
|
3645
3726
|
texts
|
|
3646
3727
|
}) {
|
|
@@ -3652,11 +3733,13 @@ function Loader({
|
|
|
3652
3733
|
useEffect(() => {
|
|
3653
3734
|
if (texts && texts.length) {
|
|
3654
3735
|
let textID = '';
|
|
3736
|
+
|
|
3655
3737
|
for (let i = 0; i < texts.length; i++) {
|
|
3656
3738
|
textID = setTimeout(() => {
|
|
3657
3739
|
setLoaderText(texts[i]);
|
|
3658
3740
|
}, 2000 * i);
|
|
3659
3741
|
}
|
|
3742
|
+
|
|
3660
3743
|
return () => {
|
|
3661
3744
|
clearTimeout(textID);
|
|
3662
3745
|
};
|
|
@@ -3724,15 +3807,18 @@ function VideoPlayer(props) {
|
|
|
3724
3807
|
imageUrl: imageUrl
|
|
3725
3808
|
});
|
|
3726
3809
|
const theme = useTheme();
|
|
3810
|
+
|
|
3727
3811
|
function getId(url) {
|
|
3728
3812
|
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
|
|
3729
3813
|
var match = url?.match(regExp);
|
|
3814
|
+
|
|
3730
3815
|
if (match?.[2].length == 11) {
|
|
3731
3816
|
return 'https://www.youtube.com/embed/' + match[2];
|
|
3732
3817
|
} else {
|
|
3733
3818
|
return url;
|
|
3734
3819
|
}
|
|
3735
3820
|
}
|
|
3821
|
+
|
|
3736
3822
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoaded && /*#__PURE__*/React.createElement("div", {
|
|
3737
3823
|
className: classes.imgContainer
|
|
3738
3824
|
}, isEnabled ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, props.onlyThumbnail ? null : /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -4575,8 +4661,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
4575
4661
|
width: 'calc(100% - 2px)',
|
|
4576
4662
|
position: 'relative',
|
|
4577
4663
|
paddingBottom: '59.83%' // keeping aspect ratio 585x350
|
|
4578
|
-
},
|
|
4579
4664
|
|
|
4665
|
+
},
|
|
4580
4666
|
contentRow: {
|
|
4581
4667
|
display: 'grid',
|
|
4582
4668
|
gridTemplateColumns: ({
|
|
@@ -4835,6 +4921,7 @@ const FAQListing = ({
|
|
|
4835
4921
|
isSelected: selectedIndex === index
|
|
4836
4922
|
})))));
|
|
4837
4923
|
};
|
|
4924
|
+
|
|
4838
4925
|
const Accordion = ({
|
|
4839
4926
|
item,
|
|
4840
4927
|
isSelected,
|
|
@@ -5119,10 +5206,9 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5119
5206
|
flexGrow: 1,
|
|
5120
5207
|
display: 'flex',
|
|
5121
5208
|
flexDirection: 'column',
|
|
5122
|
-
justifyContent: 'space-between'
|
|
5123
|
-
//alignItems: 'center',
|
|
5124
|
-
},
|
|
5209
|
+
justifyContent: 'space-between' //alignItems: 'center',
|
|
5125
5210
|
|
|
5211
|
+
},
|
|
5126
5212
|
courseCardTags: {
|
|
5127
5213
|
display: 'flex',
|
|
5128
5214
|
justifyContent: 'flex-start',
|
|
@@ -5148,12 +5234,11 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5148
5234
|
wordBreak: 'break-word',
|
|
5149
5235
|
padding: '12px 0px',
|
|
5150
5236
|
textAlign: 'left',
|
|
5151
|
-
display: 'inline-block'
|
|
5152
|
-
// overflow: 'hidden',
|
|
5237
|
+
display: 'inline-block' // overflow: 'hidden',
|
|
5153
5238
|
// whiteSpace: 'nowrap',
|
|
5154
5239
|
// textOverflow: 'ellipsis'
|
|
5155
|
-
},
|
|
5156
5240
|
|
|
5241
|
+
},
|
|
5157
5242
|
courseCardDiscount: {
|
|
5158
5243
|
display: 'flex',
|
|
5159
5244
|
justifyContent: 'flex-start',
|
|
@@ -5235,8 +5320,7 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5235
5320
|
}
|
|
5236
5321
|
},
|
|
5237
5322
|
'@media (max-width: 768px)': {
|
|
5238
|
-
coursesContainer: {
|
|
5239
|
-
//background: theme?.palette?.background?.primary
|
|
5323
|
+
coursesContainer: {//background: theme?.palette?.background?.primary
|
|
5240
5324
|
},
|
|
5241
5325
|
coursesCardAndText: {
|
|
5242
5326
|
padding: '70px 30px'
|
|
@@ -5268,6 +5352,7 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5268
5352
|
if (!hashToken) {
|
|
5269
5353
|
throw 'Missing hash token';
|
|
5270
5354
|
}
|
|
5355
|
+
|
|
5271
5356
|
const res = await axios({
|
|
5272
5357
|
method: 'get',
|
|
5273
5358
|
baseURL: baseURLs?.API_COURSE_URL,
|
|
@@ -5279,6 +5364,7 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5279
5364
|
requiredFilters: '[10]'
|
|
5280
5365
|
}
|
|
5281
5366
|
});
|
|
5367
|
+
|
|
5282
5368
|
if (res) {
|
|
5283
5369
|
return res.data;
|
|
5284
5370
|
}
|
|
@@ -5290,6 +5376,7 @@ function getShortenedSubstring(name, length, allowDots = true) {
|
|
|
5290
5376
|
if (name) {
|
|
5291
5377
|
return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
|
|
5292
5378
|
}
|
|
5379
|
+
|
|
5293
5380
|
return '';
|
|
5294
5381
|
}
|
|
5295
5382
|
|
|
@@ -5369,11 +5456,13 @@ function courses({
|
|
|
5369
5456
|
containerWidth
|
|
5370
5457
|
});
|
|
5371
5458
|
const [nodeData] = sectionData?.components;
|
|
5459
|
+
|
|
5372
5460
|
const handleApiCall = () => {
|
|
5373
5461
|
if (baseURLs) {
|
|
5374
5462
|
getCourseList(baseURLs, hashToken).then(response => {
|
|
5375
5463
|
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5376
5464
|
const coursesData = response?.data?.coursesData;
|
|
5465
|
+
|
|
5377
5466
|
if (coursesData && coursesData.length) {
|
|
5378
5467
|
setCardList(response?.data?.coursesData);
|
|
5379
5468
|
setShowShimmer(false);
|
|
@@ -5384,12 +5473,12 @@ function courses({
|
|
|
5384
5473
|
setShowShimmer(false);
|
|
5385
5474
|
setFallbackImages(placeholders);
|
|
5386
5475
|
}
|
|
5387
|
-
}
|
|
5388
|
-
// For User Website & Draft Preview: If no data found, hide section.
|
|
5476
|
+
} // For User Website & Draft Preview: If no data found, hide section.
|
|
5389
5477
|
else setErrored(true);
|
|
5390
5478
|
}
|
|
5391
5479
|
}).catch(err => {
|
|
5392
5480
|
const errMsg = err?.response?.data?.data?.message;
|
|
5481
|
+
|
|
5393
5482
|
if (errMsg === 'NOT_FOUND') {
|
|
5394
5483
|
if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
|
|
5395
5484
|
setShowShimmer(false);
|
|
@@ -5401,16 +5490,16 @@ function courses({
|
|
|
5401
5490
|
});
|
|
5402
5491
|
}
|
|
5403
5492
|
};
|
|
5493
|
+
|
|
5404
5494
|
useEffect(() => {
|
|
5405
|
-
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5406
|
-
|
|
5495
|
+
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders; // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
|
|
5496
|
+
|
|
5407
5497
|
if (isMasterTemplate) {
|
|
5408
5498
|
if (placeholders && placeholders.length) {
|
|
5409
5499
|
setShowShimmer(false);
|
|
5410
5500
|
setFallbackImages(placeholders);
|
|
5411
5501
|
}
|
|
5412
|
-
}
|
|
5413
|
-
// other
|
|
5502
|
+
} // other
|
|
5414
5503
|
else {
|
|
5415
5504
|
handleApiCall();
|
|
5416
5505
|
}
|
|
@@ -5475,6 +5564,7 @@ function courses({
|
|
|
5475
5564
|
});
|
|
5476
5565
|
})))));
|
|
5477
5566
|
}
|
|
5567
|
+
|
|
5478
5568
|
function SimpleCardsContainer({
|
|
5479
5569
|
children,
|
|
5480
5570
|
classes
|
|
@@ -5890,6 +5980,7 @@ function FormEnquiry({
|
|
|
5890
5980
|
setBtnDisabled(true);
|
|
5891
5981
|
}
|
|
5892
5982
|
}, [validData]);
|
|
5983
|
+
|
|
5893
5984
|
const handleSubmit = () => {
|
|
5894
5985
|
let data = {
|
|
5895
5986
|
sectionId: sectionData?._id || null,
|
|
@@ -5900,22 +5991,23 @@ function FormEnquiry({
|
|
|
5900
5991
|
setBtnDisabled(true);
|
|
5901
5992
|
setInputVal(formInitialValue);
|
|
5902
5993
|
};
|
|
5994
|
+
|
|
5903
5995
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
5904
5996
|
if (validations?.[regexField]?.length) {
|
|
5905
5997
|
let regex = new RegExp(validations[regexField]);
|
|
5998
|
+
|
|
5906
5999
|
if (regex?.test(inputVal[fieldname])) {
|
|
5907
|
-
setValidData({
|
|
5908
|
-
...validData,
|
|
6000
|
+
setValidData({ ...validData,
|
|
5909
6001
|
[fieldValidity]: 1
|
|
5910
6002
|
});
|
|
5911
6003
|
} else {
|
|
5912
|
-
setValidData({
|
|
5913
|
-
...validData,
|
|
6004
|
+
setValidData({ ...validData,
|
|
5914
6005
|
[fieldValidity]: 0
|
|
5915
6006
|
});
|
|
5916
6007
|
}
|
|
5917
6008
|
}
|
|
5918
6009
|
};
|
|
6010
|
+
|
|
5919
6011
|
return /*#__PURE__*/React.createElement("section", {
|
|
5920
6012
|
className: classes.section
|
|
5921
6013
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -5995,8 +6087,7 @@ function FormEnquiry({
|
|
|
5995
6087
|
isValid: validData.nameValid,
|
|
5996
6088
|
inputType: 'input',
|
|
5997
6089
|
onChange: e => {
|
|
5998
|
-
setInputVal({
|
|
5999
|
-
...inputVal,
|
|
6090
|
+
setInputVal({ ...inputVal,
|
|
6000
6091
|
name: e.target.value
|
|
6001
6092
|
});
|
|
6002
6093
|
},
|
|
@@ -6004,8 +6095,7 @@ function FormEnquiry({
|
|
|
6004
6095
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6005
6096
|
},
|
|
6006
6097
|
onFocus: () => {
|
|
6007
|
-
setValidData({
|
|
6008
|
-
...validData,
|
|
6098
|
+
setValidData({ ...validData,
|
|
6009
6099
|
nameValid: 1
|
|
6010
6100
|
});
|
|
6011
6101
|
}
|
|
@@ -6017,8 +6107,7 @@ function FormEnquiry({
|
|
|
6017
6107
|
isValid: validData.phoneValid,
|
|
6018
6108
|
inputType: 'input',
|
|
6019
6109
|
onChange: e => {
|
|
6020
|
-
setInputVal({
|
|
6021
|
-
...inputVal,
|
|
6110
|
+
setInputVal({ ...inputVal,
|
|
6022
6111
|
phone: e.target.value
|
|
6023
6112
|
});
|
|
6024
6113
|
},
|
|
@@ -6026,8 +6115,7 @@ function FormEnquiry({
|
|
|
6026
6115
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6027
6116
|
},
|
|
6028
6117
|
onFocus: () => {
|
|
6029
|
-
setValidData({
|
|
6030
|
-
...validData,
|
|
6118
|
+
setValidData({ ...validData,
|
|
6031
6119
|
phoneValid: 1
|
|
6032
6120
|
});
|
|
6033
6121
|
}
|
|
@@ -6039,8 +6127,7 @@ function FormEnquiry({
|
|
|
6039
6127
|
isValid: validData.emailValid,
|
|
6040
6128
|
inputType: 'input',
|
|
6041
6129
|
onChange: e => {
|
|
6042
|
-
setInputVal({
|
|
6043
|
-
...inputVal,
|
|
6130
|
+
setInputVal({ ...inputVal,
|
|
6044
6131
|
email: e.target.value
|
|
6045
6132
|
});
|
|
6046
6133
|
},
|
|
@@ -6048,8 +6135,7 @@ function FormEnquiry({
|
|
|
6048
6135
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6049
6136
|
},
|
|
6050
6137
|
onFocus: () => {
|
|
6051
|
-
setValidData({
|
|
6052
|
-
...validData,
|
|
6138
|
+
setValidData({ ...validData,
|
|
6053
6139
|
emailValid: 1
|
|
6054
6140
|
});
|
|
6055
6141
|
}
|
|
@@ -6061,8 +6147,7 @@ function FormEnquiry({
|
|
|
6061
6147
|
isValid: validData.messageValid,
|
|
6062
6148
|
inputType: 'textarea',
|
|
6063
6149
|
onChange: e => {
|
|
6064
|
-
setInputVal({
|
|
6065
|
-
...inputVal,
|
|
6150
|
+
setInputVal({ ...inputVal,
|
|
6066
6151
|
message: e.target.value
|
|
6067
6152
|
});
|
|
6068
6153
|
},
|
|
@@ -6070,8 +6155,7 @@ function FormEnquiry({
|
|
|
6070
6155
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6071
6156
|
},
|
|
6072
6157
|
onFocus: () => {
|
|
6073
|
-
setValidData({
|
|
6074
|
-
...validData,
|
|
6158
|
+
setValidData({ ...validData,
|
|
6075
6159
|
messageValid: 1
|
|
6076
6160
|
});
|
|
6077
6161
|
}
|
|
@@ -6302,6 +6386,7 @@ function Contact({
|
|
|
6302
6386
|
phoneValid: 1,
|
|
6303
6387
|
messageValid: 1
|
|
6304
6388
|
});
|
|
6389
|
+
|
|
6305
6390
|
const handleSubmit = () => {
|
|
6306
6391
|
const data = {
|
|
6307
6392
|
sectionId: sectionData?._id || null,
|
|
@@ -6312,6 +6397,7 @@ function Contact({
|
|
|
6312
6397
|
setBtnDisabled(true);
|
|
6313
6398
|
setInputVal(formInitialValue);
|
|
6314
6399
|
};
|
|
6400
|
+
|
|
6315
6401
|
useEffect(() => {
|
|
6316
6402
|
if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
|
|
6317
6403
|
setBtnDisabled(false);
|
|
@@ -6319,22 +6405,23 @@ function Contact({
|
|
|
6319
6405
|
setBtnDisabled(true);
|
|
6320
6406
|
}
|
|
6321
6407
|
}, [validData]);
|
|
6408
|
+
|
|
6322
6409
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
6323
6410
|
if (validations?.[regexField]?.length) {
|
|
6324
6411
|
let regex = new RegExp(validations[regexField]);
|
|
6412
|
+
|
|
6325
6413
|
if (regex?.test(inputVal[fieldname])) {
|
|
6326
|
-
setValidData({
|
|
6327
|
-
...validData,
|
|
6414
|
+
setValidData({ ...validData,
|
|
6328
6415
|
[fieldValidity]: 1
|
|
6329
6416
|
});
|
|
6330
6417
|
} else {
|
|
6331
|
-
setValidData({
|
|
6332
|
-
...validData,
|
|
6418
|
+
setValidData({ ...validData,
|
|
6333
6419
|
[fieldValidity]: 0
|
|
6334
6420
|
});
|
|
6335
6421
|
}
|
|
6336
6422
|
}
|
|
6337
6423
|
};
|
|
6424
|
+
|
|
6338
6425
|
return /*#__PURE__*/React.createElement("section", {
|
|
6339
6426
|
className: classes.section
|
|
6340
6427
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -6376,8 +6463,7 @@ function Contact({
|
|
|
6376
6463
|
isValid: validData.nameValid,
|
|
6377
6464
|
inputType: 'input',
|
|
6378
6465
|
onChange: e => {
|
|
6379
|
-
setInputVal({
|
|
6380
|
-
...inputVal,
|
|
6466
|
+
setInputVal({ ...inputVal,
|
|
6381
6467
|
name: e.target.value
|
|
6382
6468
|
});
|
|
6383
6469
|
},
|
|
@@ -6385,8 +6471,7 @@ function Contact({
|
|
|
6385
6471
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6386
6472
|
},
|
|
6387
6473
|
onFocus: () => {
|
|
6388
|
-
setValidData({
|
|
6389
|
-
...validData,
|
|
6474
|
+
setValidData({ ...validData,
|
|
6390
6475
|
nameValid: 1
|
|
6391
6476
|
});
|
|
6392
6477
|
}
|
|
@@ -6398,8 +6483,7 @@ function Contact({
|
|
|
6398
6483
|
isValid: validData.phoneValid,
|
|
6399
6484
|
inputType: 'input',
|
|
6400
6485
|
onChange: e => {
|
|
6401
|
-
setInputVal({
|
|
6402
|
-
...inputVal,
|
|
6486
|
+
setInputVal({ ...inputVal,
|
|
6403
6487
|
phone: e.target.value
|
|
6404
6488
|
});
|
|
6405
6489
|
},
|
|
@@ -6407,8 +6491,7 @@ function Contact({
|
|
|
6407
6491
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6408
6492
|
},
|
|
6409
6493
|
onFocus: () => {
|
|
6410
|
-
setValidData({
|
|
6411
|
-
...validData,
|
|
6494
|
+
setValidData({ ...validData,
|
|
6412
6495
|
phoneValid: 1
|
|
6413
6496
|
});
|
|
6414
6497
|
}
|
|
@@ -6420,8 +6503,7 @@ function Contact({
|
|
|
6420
6503
|
isValid: validData.emailValid,
|
|
6421
6504
|
inputType: 'input',
|
|
6422
6505
|
onChange: e => {
|
|
6423
|
-
setInputVal({
|
|
6424
|
-
...inputVal,
|
|
6506
|
+
setInputVal({ ...inputVal,
|
|
6425
6507
|
email: e.target.value
|
|
6426
6508
|
});
|
|
6427
6509
|
},
|
|
@@ -6429,8 +6511,7 @@ function Contact({
|
|
|
6429
6511
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6430
6512
|
},
|
|
6431
6513
|
onFocus: () => {
|
|
6432
|
-
setValidData({
|
|
6433
|
-
...validData,
|
|
6514
|
+
setValidData({ ...validData,
|
|
6434
6515
|
emailValid: 1
|
|
6435
6516
|
});
|
|
6436
6517
|
}
|
|
@@ -6442,8 +6523,7 @@ function Contact({
|
|
|
6442
6523
|
isValid: validData.messageValid,
|
|
6443
6524
|
inputType: 'textarea',
|
|
6444
6525
|
onChange: e => {
|
|
6445
|
-
setInputVal({
|
|
6446
|
-
...inputVal,
|
|
6526
|
+
setInputVal({ ...inputVal,
|
|
6447
6527
|
message: e.target.value
|
|
6448
6528
|
});
|
|
6449
6529
|
},
|
|
@@ -6451,8 +6531,7 @@ function Contact({
|
|
|
6451
6531
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6452
6532
|
},
|
|
6453
6533
|
onFocus: () => {
|
|
6454
|
-
setValidData({
|
|
6455
|
-
...validData,
|
|
6534
|
+
setValidData({ ...validData,
|
|
6456
6535
|
messageValid: 1
|
|
6457
6536
|
});
|
|
6458
6537
|
}
|
|
@@ -6713,8 +6792,7 @@ const useWebinarPromotionPage = createUseStyles(theme => {
|
|
|
6713
6792
|
const SingleVideoSlide$1 = props => {
|
|
6714
6793
|
const [isReadMore, setIsReadMore] = useState(false);
|
|
6715
6794
|
const theme = useTheme();
|
|
6716
|
-
useEffect(() => {
|
|
6717
|
-
// remaining days epoch
|
|
6795
|
+
useEffect(() => {// remaining days epoch
|
|
6718
6796
|
// current date epoch
|
|
6719
6797
|
// subtract remaining days from current day epoch
|
|
6720
6798
|
// moment the result - and see if there are days
|
|
@@ -6726,6 +6804,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6726
6804
|
webinarCtaClick,
|
|
6727
6805
|
conversions = 0
|
|
6728
6806
|
} = props;
|
|
6807
|
+
|
|
6729
6808
|
const renderer = ({
|
|
6730
6809
|
days,
|
|
6731
6810
|
hours,
|
|
@@ -6741,7 +6820,9 @@ const SingleVideoSlide$1 = props => {
|
|
|
6741
6820
|
return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
|
|
6742
6821
|
}
|
|
6743
6822
|
};
|
|
6823
|
+
|
|
6744
6824
|
const checkIfOfferIsValid = () => moment().diff(moment(props.data.offerPriceEndDate)) < 0;
|
|
6825
|
+
|
|
6745
6826
|
const checkForShowDiscount = () => {
|
|
6746
6827
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
6747
6828
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -6753,16 +6834,19 @@ const SingleVideoSlide$1 = props => {
|
|
|
6753
6834
|
if (data.offerPriceValidFor <= conversions) {
|
|
6754
6835
|
return false;
|
|
6755
6836
|
}
|
|
6837
|
+
|
|
6756
6838
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
6757
6839
|
return false;
|
|
6758
6840
|
} else {
|
|
6759
6841
|
return true;
|
|
6760
6842
|
}
|
|
6761
6843
|
}
|
|
6844
|
+
|
|
6762
6845
|
if (data.discount > 0) {
|
|
6763
6846
|
return true;
|
|
6764
6847
|
}
|
|
6765
6848
|
};
|
|
6849
|
+
|
|
6766
6850
|
const discount = ({
|
|
6767
6851
|
price,
|
|
6768
6852
|
discount
|
|
@@ -6770,6 +6854,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6770
6854
|
console.log('discountxx', props.data.price, props.data.discount);
|
|
6771
6855
|
return (discount / price * 100).toFixed(2);
|
|
6772
6856
|
};
|
|
6857
|
+
|
|
6773
6858
|
const classes = useWebinarPromotionPage();
|
|
6774
6859
|
return /*#__PURE__*/React.createElement("div", {
|
|
6775
6860
|
className: classes.videoCarouselContainer
|
|
@@ -6865,10 +6950,9 @@ const SingleVideoSlide$1 = props => {
|
|
|
6865
6950
|
data: {
|
|
6866
6951
|
// link: 'headerData?.loginCtaLink',
|
|
6867
6952
|
// isLink: 1,
|
|
6868
|
-
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
6869
|
-
// isExternal: 1
|
|
6870
|
-
},
|
|
6953
|
+
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW' // isExternal: 1
|
|
6871
6954
|
|
|
6955
|
+
},
|
|
6872
6956
|
onClick: webinarCtaClick,
|
|
6873
6957
|
type: 'primary',
|
|
6874
6958
|
size: 'medium',
|
|
@@ -7202,14 +7286,14 @@ const SingleVideoSlide = props => {
|
|
|
7202
7286
|
isEdit
|
|
7203
7287
|
} = useContext(PageContext);
|
|
7204
7288
|
console.log(isEdit, 'isEdit');
|
|
7205
|
-
useEffect(() => {
|
|
7206
|
-
// remaining days epoch
|
|
7289
|
+
useEffect(() => {// remaining days epoch
|
|
7207
7290
|
// current date epoch
|
|
7208
7291
|
// subtract remaining days from current day epoch
|
|
7209
7292
|
// moment the result - and see if there are days
|
|
7210
7293
|
// days is present show days
|
|
7211
7294
|
// else start reverse timer
|
|
7212
7295
|
}, []);
|
|
7296
|
+
|
|
7213
7297
|
const renderer = ({
|
|
7214
7298
|
days,
|
|
7215
7299
|
hours,
|
|
@@ -7225,6 +7309,7 @@ const SingleVideoSlide = props => {
|
|
|
7225
7309
|
return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
|
|
7226
7310
|
}
|
|
7227
7311
|
};
|
|
7312
|
+
|
|
7228
7313
|
const {
|
|
7229
7314
|
data,
|
|
7230
7315
|
courseBuyNow,
|
|
@@ -7233,7 +7318,9 @@ const SingleVideoSlide = props => {
|
|
|
7233
7318
|
} = props;
|
|
7234
7319
|
const showCourseInstallmentData = data?.courseOverviewData;
|
|
7235
7320
|
const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
|
|
7321
|
+
|
|
7236
7322
|
const checkIfOfferIsValid = () => moment().diff(moment(props?.data?.endDate || 0)) < 0;
|
|
7323
|
+
|
|
7237
7324
|
const checkForShowDiscount = () => {
|
|
7238
7325
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
7239
7326
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -7245,23 +7332,28 @@ const SingleVideoSlide = props => {
|
|
|
7245
7332
|
if (data.offerPriceValidFor <= conversions) {
|
|
7246
7333
|
return false;
|
|
7247
7334
|
}
|
|
7335
|
+
|
|
7248
7336
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
7249
7337
|
return false;
|
|
7250
7338
|
} else {
|
|
7251
7339
|
return true;
|
|
7252
7340
|
}
|
|
7253
7341
|
}
|
|
7342
|
+
|
|
7254
7343
|
if (data.discount > 0) {
|
|
7255
7344
|
return true;
|
|
7256
7345
|
}
|
|
7257
7346
|
};
|
|
7347
|
+
|
|
7258
7348
|
const classes = useCoursePromotionPage();
|
|
7349
|
+
|
|
7259
7350
|
const discount = ({
|
|
7260
7351
|
price,
|
|
7261
7352
|
discount
|
|
7262
7353
|
}) => {
|
|
7263
7354
|
return (discount / price * 100).toFixed(2);
|
|
7264
7355
|
};
|
|
7356
|
+
|
|
7265
7357
|
return /*#__PURE__*/React.createElement("div", {
|
|
7266
7358
|
className: classes.videoCarouselContainer
|
|
7267
7359
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7375,16 +7467,15 @@ const SingleVideoSlide = props => {
|
|
|
7375
7467
|
data: {
|
|
7376
7468
|
// link: 'headerData?.loginCtaLink',
|
|
7377
7469
|
// isLink: 1,
|
|
7378
|
-
value: 'BUY NOW'
|
|
7379
|
-
// isExternal: 1
|
|
7380
|
-
},
|
|
7470
|
+
value: 'BUY NOW' // isExternal: 1
|
|
7381
7471
|
|
|
7472
|
+
},
|
|
7382
7473
|
onClick: courseBuyNow,
|
|
7383
7474
|
type: 'primary',
|
|
7384
7475
|
size: 'medium',
|
|
7385
7476
|
target: null,
|
|
7386
|
-
rel: null
|
|
7387
|
-
|
|
7477
|
+
rel: null // styling={isMobile ? { margin: '0 40px' } : {}}
|
|
7478
|
+
|
|
7388
7479
|
})))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React.createElement("div", {
|
|
7389
7480
|
className: classes.payInstallmentContainer,
|
|
7390
7481
|
onClick: showCourseInstallment
|
|
@@ -7589,15 +7680,18 @@ const FormPage = ({
|
|
|
7589
7680
|
_id,
|
|
7590
7681
|
baseURLs
|
|
7591
7682
|
} = useContext(PageContext);
|
|
7683
|
+
|
|
7592
7684
|
const handleSubmit = async e => {
|
|
7593
7685
|
e.preventDefault();
|
|
7594
7686
|
let formResponse = [];
|
|
7687
|
+
|
|
7595
7688
|
for (const [key, value] of Object.entries(formData)) {
|
|
7596
7689
|
if (value.questionType === 'MC') {
|
|
7597
7690
|
if (value.solutionArray.length > 1) {
|
|
7598
7691
|
value.solutionArray.shift();
|
|
7599
7692
|
}
|
|
7600
7693
|
}
|
|
7694
|
+
|
|
7601
7695
|
formResponse.push({
|
|
7602
7696
|
questionId: key,
|
|
7603
7697
|
questionName: value.questionName,
|
|
@@ -7605,6 +7699,7 @@ const FormPage = ({
|
|
|
7605
7699
|
solutionArray: value.solutionArray
|
|
7606
7700
|
});
|
|
7607
7701
|
}
|
|
7702
|
+
|
|
7608
7703
|
const data = {
|
|
7609
7704
|
sectionId: sectionData?.components?.[0]?._id || null,
|
|
7610
7705
|
landingPageId: _id || null,
|
|
@@ -7614,6 +7709,7 @@ const FormPage = ({
|
|
|
7614
7709
|
setFormData({});
|
|
7615
7710
|
setformSubmitted(!formSubmitted);
|
|
7616
7711
|
};
|
|
7712
|
+
|
|
7617
7713
|
useEffect(() => {
|
|
7618
7714
|
//add all questions to formData
|
|
7619
7715
|
let formData = {};
|
|
@@ -7626,26 +7722,23 @@ const FormPage = ({
|
|
|
7626
7722
|
});
|
|
7627
7723
|
setFormData(formData);
|
|
7628
7724
|
}, [metadata, formSubmitted]);
|
|
7725
|
+
|
|
7629
7726
|
const handleOnClick = (e, item, option) => {
|
|
7630
7727
|
// if the checkbox is checked
|
|
7631
7728
|
if (!e.target.checked) {
|
|
7632
7729
|
// if the checkbox is checked and the solution array is empty
|
|
7633
7730
|
if (!formData[item._id]?.solutionArray?.length) {
|
|
7634
|
-
setFormData({
|
|
7635
|
-
...formData,
|
|
7731
|
+
setFormData({ ...formData,
|
|
7636
7732
|
[item._id]: {
|
|
7637
7733
|
questionName: item.text,
|
|
7638
7734
|
solutionArray: [option.value],
|
|
7639
7735
|
questionType: 'MC'
|
|
7640
7736
|
}
|
|
7641
7737
|
});
|
|
7642
|
-
}
|
|
7643
|
-
// if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
|
|
7738
|
+
} // if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
|
|
7644
7739
|
else if (formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7645
7740
|
// if only one value is in the array remove it
|
|
7646
|
-
|
|
7647
|
-
setFormData({
|
|
7648
|
-
...formData,
|
|
7741
|
+
setFormData({ ...formData,
|
|
7649
7742
|
[item._id]: {
|
|
7650
7743
|
questionName: item.text,
|
|
7651
7744
|
solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
|
|
@@ -7653,24 +7746,20 @@ const FormPage = ({
|
|
|
7653
7746
|
}
|
|
7654
7747
|
});
|
|
7655
7748
|
}
|
|
7656
|
-
}
|
|
7657
|
-
// if the checkbox is unchecked
|
|
7749
|
+
} // if the checkbox is unchecked
|
|
7658
7750
|
else {
|
|
7659
7751
|
// if the checkbox is unchecked and the solution array is empty
|
|
7660
7752
|
if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
|
|
7661
|
-
setFormData({
|
|
7662
|
-
...formData,
|
|
7753
|
+
setFormData({ ...formData,
|
|
7663
7754
|
[item._id]: {
|
|
7664
7755
|
questionName: item.text,
|
|
7665
7756
|
solutionArray: [option.value],
|
|
7666
7757
|
questionType: 'MC'
|
|
7667
7758
|
}
|
|
7668
7759
|
});
|
|
7669
|
-
}
|
|
7670
|
-
// if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
|
|
7760
|
+
} // if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
|
|
7671
7761
|
else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7672
|
-
setFormData({
|
|
7673
|
-
...formData,
|
|
7762
|
+
setFormData({ ...formData,
|
|
7674
7763
|
[item._id]: {
|
|
7675
7764
|
questionName: item.text,
|
|
7676
7765
|
solutionArray: [...formData[item._id]?.solutionArray, option.value],
|
|
@@ -7680,6 +7769,7 @@ const FormPage = ({
|
|
|
7680
7769
|
}
|
|
7681
7770
|
}
|
|
7682
7771
|
};
|
|
7772
|
+
|
|
7683
7773
|
return /*#__PURE__*/React.createElement("section", {
|
|
7684
7774
|
className: classes.formPageSection
|
|
7685
7775
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7706,8 +7796,7 @@ const FormPage = ({
|
|
|
7706
7796
|
placeholder: "Short answer",
|
|
7707
7797
|
name: item._id,
|
|
7708
7798
|
onChange: e => {
|
|
7709
|
-
setFormData({
|
|
7710
|
-
...formData,
|
|
7799
|
+
setFormData({ ...formData,
|
|
7711
7800
|
[item._id]: {
|
|
7712
7801
|
index,
|
|
7713
7802
|
questionName: item.text,
|
|
@@ -7747,13 +7836,11 @@ const FormPage = ({
|
|
|
7747
7836
|
name: "text",
|
|
7748
7837
|
required: item.isRequired,
|
|
7749
7838
|
value: option.value,
|
|
7750
|
-
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7751
|
-
// name={option.value}
|
|
7839
|
+
checked: formData[item._id]?.solutionArray?.[0] === option.value // name={option.value}
|
|
7752
7840
|
// id={option.value}
|
|
7753
7841
|
,
|
|
7754
7842
|
onClick: e => {
|
|
7755
|
-
setFormData({
|
|
7756
|
-
...formData,
|
|
7843
|
+
setFormData({ ...formData,
|
|
7757
7844
|
[item._id]: {
|
|
7758
7845
|
questionName: item.text,
|
|
7759
7846
|
solutionArray: [option.value],
|
|
@@ -7769,10 +7856,9 @@ const FormPage = ({
|
|
|
7769
7856
|
data: {
|
|
7770
7857
|
// link: 'headerData?.loginCtaLink',
|
|
7771
7858
|
// isLink: 1,
|
|
7772
|
-
value: 'SUBMIT'
|
|
7773
|
-
// isExternal: 1
|
|
7774
|
-
},
|
|
7859
|
+
value: 'SUBMIT' // isExternal: 1
|
|
7775
7860
|
|
|
7861
|
+
},
|
|
7776
7862
|
type: 'primary',
|
|
7777
7863
|
size: 'medium',
|
|
7778
7864
|
target: null,
|
|
@@ -7866,6 +7952,7 @@ function Tiles({
|
|
|
7866
7952
|
const nodeData = sectionData.components;
|
|
7867
7953
|
console.log(nodeData);
|
|
7868
7954
|
const tilesList = nodeData[0]?.tilesList.components;
|
|
7955
|
+
|
|
7869
7956
|
const handleClick = value => {
|
|
7870
7957
|
if (!isEdit && value) {
|
|
7871
7958
|
if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
|
|
@@ -7875,6 +7962,7 @@ function Tiles({
|
|
|
7875
7962
|
}
|
|
7876
7963
|
}
|
|
7877
7964
|
};
|
|
7965
|
+
|
|
7878
7966
|
const TileDiv = tilesList?.map((tile, i) => {
|
|
7879
7967
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
7880
7968
|
key: i
|
|
@@ -7938,8 +8026,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
7938
8026
|
width: '78px',
|
|
7939
8027
|
height: '48px'
|
|
7940
8028
|
/* margin: 18px 0px; */
|
|
7941
|
-
},
|
|
7942
8029
|
|
|
8030
|
+
},
|
|
7943
8031
|
'p-young-guru-title': {
|
|
7944
8032
|
fontFamily: theme?.typography?.fontFamily,
|
|
7945
8033
|
fontStyle: 'normal',
|
|
@@ -7966,8 +8054,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
7966
8054
|
fontSize: '0',
|
|
7967
8055
|
textAlign: 'center'
|
|
7968
8056
|
/* padding:35px 0 40px */
|
|
7969
|
-
},
|
|
7970
8057
|
|
|
8058
|
+
},
|
|
7971
8059
|
'two-columns .column': {
|
|
7972
8060
|
width: '100%',
|
|
7973
8061
|
maxWidth: '275px',
|
|
@@ -7983,10 +8071,9 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
7983
8071
|
color: '#030a21',
|
|
7984
8072
|
marginBottom: '5px',
|
|
7985
8073
|
textAlign: 'left'
|
|
7986
|
-
}
|
|
7987
|
-
|
|
7988
|
-
// @media screen and (max-width: 600px) {
|
|
8074
|
+
} // @media screen and (max-width: 600px) {
|
|
7989
8075
|
// }
|
|
8076
|
+
|
|
7990
8077
|
}));
|
|
7991
8078
|
|
|
7992
8079
|
function Section({
|
|
@@ -7997,7 +8084,6 @@ function Section({
|
|
|
7997
8084
|
const {
|
|
7998
8085
|
isEdit
|
|
7999
8086
|
} = useContext(PageContext);
|
|
8000
|
-
console.log('customHtmlData', isEdit);
|
|
8001
8087
|
const header = nodeData?.components[0];
|
|
8002
8088
|
const body = nodeData?.components[1];
|
|
8003
8089
|
const landing = nodeData?.components[2];
|
|
@@ -8014,8 +8100,8 @@ function Section({
|
|
|
8014
8100
|
}, /*#__PURE__*/React.createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React.createElement("div", {
|
|
8015
8101
|
className: classes.email_description_para,
|
|
8016
8102
|
dangerouslySetInnerHTML: {
|
|
8017
|
-
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8018
|
-
|
|
8103
|
+
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}` // __html: '<div>sdnfksdnflksdnfklsndk</div>'
|
|
8104
|
+
|
|
8019
8105
|
}
|
|
8020
8106
|
}) : /*#__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", {
|
|
8021
8107
|
style: {
|
|
@@ -8030,8 +8116,7 @@ function Section({
|
|
|
8030
8116
|
}
|
|
8031
8117
|
}, header?.components[0]?.metadata?.image?.length ? /*#__PURE__*/React.createElement("img", {
|
|
8032
8118
|
src: header?.components[0]?.metadata?.image,
|
|
8033
|
-
alt: ""
|
|
8034
|
-
// className={classes.logoimg}
|
|
8119
|
+
alt: "" // className={classes.logoimg}
|
|
8035
8120
|
,
|
|
8036
8121
|
style: {
|
|
8037
8122
|
width: '60px'
|
|
@@ -8045,8 +8130,7 @@ function Section({
|
|
|
8045
8130
|
minHeight: '30px'
|
|
8046
8131
|
}
|
|
8047
8132
|
}, "Your logo")))))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React.createElement("img", {
|
|
8048
|
-
src: header?.components[1]?.metadata?.image
|
|
8049
|
-
// width={600}
|
|
8133
|
+
src: header?.components[1]?.metadata?.image // width={600}
|
|
8050
8134
|
,
|
|
8051
8135
|
alt: "",
|
|
8052
8136
|
style: {
|
|
@@ -8211,7 +8295,7 @@ function Section({
|
|
|
8211
8295
|
},
|
|
8212
8296
|
ref: footer?.components[0]?.refSetter,
|
|
8213
8297
|
onClick: () => {
|
|
8214
|
-
|
|
8298
|
+
isEdit ? null : window.open(footer?.components[0]?.metadata?.text, '_blank');
|
|
8215
8299
|
}
|
|
8216
8300
|
}), /*#__PURE__*/React.createElement("img", {
|
|
8217
8301
|
src: footer?.components[1]?.metadata?.text ? footer?.components[1]?.metadata?.iconUrlColor : footer?.components[1]?.metadata?.iconUrl,
|
|
@@ -8223,7 +8307,7 @@ function Section({
|
|
|
8223
8307
|
cursor: 'pointer'
|
|
8224
8308
|
},
|
|
8225
8309
|
onClick: () => {
|
|
8226
|
-
|
|
8310
|
+
isEdit ? null : window.open(footer?.components[1]?.metadata?.text, '_blank');
|
|
8227
8311
|
},
|
|
8228
8312
|
ref: footer?.components[1]?.refSetter
|
|
8229
8313
|
}), /*#__PURE__*/React.createElement("img", {
|
|
@@ -8235,7 +8319,7 @@ function Section({
|
|
|
8235
8319
|
cursor: 'pointer'
|
|
8236
8320
|
},
|
|
8237
8321
|
onClick: () => {
|
|
8238
|
-
|
|
8322
|
+
isEdit ? null : window.open(footer?.components[2]?.metadata?.text, '_blank');
|
|
8239
8323
|
},
|
|
8240
8324
|
ref: footer?.components[2]?.refSetter
|
|
8241
8325
|
}), /*#__PURE__*/React.createElement("img", {
|
|
@@ -8249,7 +8333,7 @@ function Section({
|
|
|
8249
8333
|
},
|
|
8250
8334
|
ref: footer?.components[3]?.refSetter,
|
|
8251
8335
|
onClick: () => {
|
|
8252
|
-
|
|
8336
|
+
isEdit ? null : window.open(footer?.components[3]?.metadata?.text, '_blank');
|
|
8253
8337
|
}
|
|
8254
8338
|
}), /*#__PURE__*/React.createElement("img", {
|
|
8255
8339
|
src: footer?.components[4]?.metadata?.text ? footer?.components[4]?.metadata?.iconUrlColor : footer?.components[4]?.metadata?.iconUrl,
|
|
@@ -8261,7 +8345,7 @@ function Section({
|
|
|
8261
8345
|
},
|
|
8262
8346
|
ref: footer?.components[4]?.refSetter,
|
|
8263
8347
|
onClick: () => {
|
|
8264
|
-
|
|
8348
|
+
isEdit ? null : window.open(footer?.components[4]?.metadata?.text, '_blank');
|
|
8265
8349
|
}
|
|
8266
8350
|
}), /*#__PURE__*/React.createElement("table", {
|
|
8267
8351
|
style: {
|
|
@@ -8301,27 +8385,29 @@ function Section({
|
|
|
8301
8385
|
}
|
|
8302
8386
|
}, "All rights reserved.")))))))))))))) : null)))));
|
|
8303
8387
|
}
|
|
8388
|
+
|
|
8304
8389
|
function EmailDripMarket({
|
|
8305
8390
|
sectionData,
|
|
8306
8391
|
extraProps = {}
|
|
8307
8392
|
}) {
|
|
8308
8393
|
console.log('extrapropstemplate', extraProps);
|
|
8309
8394
|
const isInitialMount = useRef(true);
|
|
8395
|
+
|
|
8310
8396
|
const convertToHtml = sectionData => {
|
|
8311
8397
|
const html = ReactDOMServer.renderToStaticMarkup( /*#__PURE__*/React.createElement(Section, {
|
|
8312
8398
|
nodeData: sectionData
|
|
8313
8399
|
}));
|
|
8314
8400
|
return html;
|
|
8315
8401
|
};
|
|
8402
|
+
|
|
8316
8403
|
useEffect(() => {
|
|
8317
8404
|
if (isInitialMount.current) {
|
|
8318
8405
|
isInitialMount.current = false;
|
|
8319
8406
|
} else {
|
|
8320
8407
|
extraProps?.callbackHtml(convertToHtml(sectionData));
|
|
8321
8408
|
}
|
|
8322
|
-
}, [extraProps?.convertedHtml]);
|
|
8409
|
+
}, [extraProps?.convertedHtml]); // const mockData = sectionData?.sections[0];
|
|
8323
8410
|
|
|
8324
|
-
// const mockData = sectionData?.sections[0];
|
|
8325
8411
|
const emailRef = useRef(null);
|
|
8326
8412
|
return /*#__PURE__*/React.createElement("section", {
|
|
8327
8413
|
style: {
|
|
@@ -8364,7 +8450,9 @@ const TYPE_TO_COMPONENT_MAP = {
|
|
|
8364
8450
|
TILES_SECTION: Tiles,
|
|
8365
8451
|
EMAIL_DRIP_MARKET: EmailDripMarket
|
|
8366
8452
|
};
|
|
8453
|
+
|
|
8367
8454
|
const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
|
|
8455
|
+
|
|
8368
8456
|
const MemoisedSection = /*#__PURE__*/memo(({
|
|
8369
8457
|
sectionData,
|
|
8370
8458
|
extraProps
|
|
@@ -8477,9 +8565,11 @@ const componentParser = compObj => {
|
|
|
8477
8565
|
});
|
|
8478
8566
|
return component;
|
|
8479
8567
|
}
|
|
8568
|
+
|
|
8480
8569
|
if (Array.isArray(compObj.components)) {
|
|
8481
8570
|
compObj.components = compObj.components.map(componentParser);
|
|
8482
8571
|
}
|
|
8572
|
+
|
|
8483
8573
|
return compObj;
|
|
8484
8574
|
};
|
|
8485
8575
|
const inverseComponentParser = compObj => {
|
|
@@ -8504,6 +8594,7 @@ const inverseComponentParser = compObj => {
|
|
|
8504
8594
|
if (compObj.components) {
|
|
8505
8595
|
compObj.components = compObj.components.map(inverseComponentParser);
|
|
8506
8596
|
}
|
|
8597
|
+
|
|
8507
8598
|
return compObj;
|
|
8508
8599
|
}
|
|
8509
8600
|
};
|