diy-template-components 0.2.22 → 0.2.23
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 +143 -237
- package/build/index.es.js.map +1 -1
- package/build/index.js +143 -237
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/build/650233e8e2d7dfee.png +0 -0
- package/build/d15660fcfffcc0c8.png +0 -0
package/build/index.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
function ___$insertStyle(css) {
|
|
6
|
-
if (!css ||
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const style = document.createElement('style');
|
|
10
|
-
style.setAttribute('type', 'text/css');
|
|
11
|
-
style.innerHTML = css;
|
|
12
|
-
document.head.appendChild(style);
|
|
13
|
-
return css;
|
|
5
|
+
function ___$insertStyle(css) {
|
|
6
|
+
if (!css || typeof window === 'undefined') {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const style = document.createElement('style');
|
|
10
|
+
style.setAttribute('type', 'text/css');
|
|
11
|
+
style.innerHTML = css;
|
|
12
|
+
document.head.appendChild(style);
|
|
13
|
+
return css;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -33,20 +33,17 @@ var Countdown__default = /*#__PURE__*/_interopDefaultLegacy(Countdown);
|
|
|
33
33
|
var ReactDOMServer__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOMServer);
|
|
34
34
|
|
|
35
35
|
function _extends() {
|
|
36
|
-
_extends = Object.assign
|
|
36
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
37
37
|
for (var i = 1; i < arguments.length; i++) {
|
|
38
38
|
var source = arguments[i];
|
|
39
|
-
|
|
40
39
|
for (var key in source) {
|
|
41
40
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
42
41
|
target[key] = source[key];
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
return target;
|
|
48
46
|
};
|
|
49
|
-
|
|
50
47
|
return _extends.apply(this, arguments);
|
|
51
48
|
}
|
|
52
49
|
|
|
@@ -302,21 +299,17 @@ const alpha = {
|
|
|
302
299
|
seventyPercent: 0.7,
|
|
303
300
|
eightyPercent: 0.8
|
|
304
301
|
};
|
|
305
|
-
|
|
306
302
|
const getRGBFromHex = hex => {
|
|
307
303
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
308
304
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
309
305
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
310
306
|
return [r, g, b];
|
|
311
307
|
};
|
|
312
|
-
|
|
313
308
|
const hexToRgbA = (hex, alpha = null) => {
|
|
314
309
|
const values = getRGBFromHex(hex);
|
|
315
|
-
|
|
316
310
|
if (alpha !== null) {
|
|
317
311
|
values.push(alpha);
|
|
318
312
|
}
|
|
319
|
-
|
|
320
313
|
return `rgba(${values.join(',')})`;
|
|
321
314
|
};
|
|
322
315
|
const colorMixer = (hex1, weightage = 1, hex2 = colors.white) => {
|
|
@@ -456,29 +449,24 @@ function useLinkBuilder(data) {
|
|
|
456
449
|
basePath,
|
|
457
450
|
isMasterTemplate
|
|
458
451
|
} = React.useContext(PageContext);
|
|
459
|
-
|
|
460
452
|
if (isEdit || !data.isLink) {
|
|
461
453
|
return null;
|
|
462
454
|
}
|
|
463
|
-
|
|
464
455
|
if (data?.isExistingLink === false) {
|
|
465
456
|
return data.link;
|
|
466
457
|
}
|
|
467
|
-
|
|
468
458
|
if (data?.isExternal) {
|
|
469
459
|
return data.link;
|
|
470
460
|
}
|
|
471
|
-
|
|
472
461
|
if (!isPreview) {
|
|
473
462
|
const link = data.link === '/' ? '' : '/' + data.link;
|
|
474
463
|
return basePath ? `//${basePath}${link}` : null;
|
|
475
|
-
}
|
|
476
|
-
|
|
464
|
+
}
|
|
477
465
|
|
|
466
|
+
// courses in preview: special case
|
|
478
467
|
if (data.link === 'courses') {
|
|
479
468
|
return `//${basePath}/courses`;
|
|
480
469
|
}
|
|
481
|
-
|
|
482
470
|
const {
|
|
483
471
|
pageId
|
|
484
472
|
} = navList.find(el => el.slug === data?.link) || {};
|
|
@@ -654,14 +642,12 @@ var calendar$1 = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%
|
|
|
654
642
|
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";
|
|
655
643
|
|
|
656
644
|
/** @returns {import('./types').IconData} */
|
|
657
|
-
|
|
658
645
|
const getConfiguredIcon1 = url => ({
|
|
659
646
|
url,
|
|
660
647
|
svgChildrenConfigs: []
|
|
661
648
|
});
|
|
662
|
-
/** @returns {import('./types').IconData} */
|
|
663
|
-
|
|
664
649
|
|
|
650
|
+
/** @returns {import('./types').IconData} */
|
|
665
651
|
const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
666
652
|
url,
|
|
667
653
|
svgChildrenConfigs: [{
|
|
@@ -670,7 +656,6 @@ const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
|
670
656
|
fill
|
|
671
657
|
}]
|
|
672
658
|
});
|
|
673
|
-
|
|
674
659
|
const icons = {
|
|
675
660
|
'Live class': getConfiguredIcon2(liveTv, false, true),
|
|
676
661
|
'Recorded videos': getConfiguredIcon2(liveTv2, false, true),
|
|
@@ -703,41 +688,51 @@ const icons = {
|
|
|
703
688
|
'Video Play': getConfiguredIcon2(videoPlay, false, true),
|
|
704
689
|
Quote: getConfiguredIcon2(quote, false, true),
|
|
705
690
|
// Stock
|
|
691
|
+
|
|
706
692
|
'Stock Growth': getConfiguredIcon2(stockGrowth, false, true),
|
|
707
693
|
Money: getConfiguredIcon2(money, false, true),
|
|
708
694
|
Split: getConfiguredIcon2(split, false, true),
|
|
709
695
|
Chart: getConfiguredIcon2(chart, false, true),
|
|
710
696
|
// Personality Development
|
|
697
|
+
|
|
711
698
|
Leaders: getConfiguredIcon2(leaders, false, true),
|
|
712
699
|
Women: getConfiguredIcon2(women, false, true),
|
|
713
700
|
Program: getConfiguredIcon2(program, false, true),
|
|
714
701
|
// Photography
|
|
702
|
+
|
|
715
703
|
'Video Editing': getConfiguredIcon2(videoEditing, false, true),
|
|
716
704
|
Editing: getConfiguredIcon2(editing, false, true),
|
|
717
705
|
Camera: getConfiguredIcon2(camera, false, true),
|
|
718
706
|
Sessions: getConfiguredIcon2(sessions, false, true),
|
|
719
707
|
// Computer
|
|
708
|
+
|
|
720
709
|
'Regular Batches': getConfiguredIcon2(regularBatches, false, true),
|
|
721
710
|
'Alternate Batches': getConfiguredIcon2(alternateBatches, false, true),
|
|
722
711
|
'Weekend Batches': getConfiguredIcon2(weekendBatches, false, true),
|
|
723
712
|
// Life Coach
|
|
713
|
+
|
|
724
714
|
Girl: getConfiguredIcon2(girl, false, true),
|
|
725
715
|
Smile: getConfiguredIcon2(smile, false, true),
|
|
726
716
|
Relationships: getConfiguredIcon2(relationships, false, true),
|
|
727
717
|
// Music
|
|
718
|
+
|
|
728
719
|
Vocal: getConfiguredIcon2(vocal, false, true),
|
|
729
720
|
Instrument: getConfiguredIcon2(instrument, false, true),
|
|
730
721
|
Music: getConfiguredIcon2(music, false, true),
|
|
731
722
|
// Fitness
|
|
723
|
+
|
|
732
724
|
Workout: getConfiguredIcon2(workout, false, true),
|
|
733
725
|
Barbell: getConfiguredIcon2(barbell, false, true),
|
|
734
726
|
Trainer: getConfiguredIcon2(trainer, false, true),
|
|
735
727
|
Report: getConfiguredIcon2(report, false, true),
|
|
736
728
|
// Govt Exam
|
|
729
|
+
|
|
737
730
|
'Govt Exam': getConfiguredIcon2(govtExam, false, true),
|
|
738
731
|
// IIT JEE
|
|
732
|
+
|
|
739
733
|
College: getConfiguredIcon2(college, false, true),
|
|
740
734
|
// Others
|
|
735
|
+
|
|
741
736
|
Teachers: getConfiguredIcon2(teachers, false, true),
|
|
742
737
|
Learning: getConfiguredIcon2(learning, false, true),
|
|
743
738
|
Success: getConfiguredIcon2(success, false, true),
|
|
@@ -749,12 +744,9 @@ const icons = {
|
|
|
749
744
|
Video: getConfiguredIcon2(video, false, true)
|
|
750
745
|
};
|
|
751
746
|
|
|
752
|
-
const someMethod1 = (
|
|
753
|
-
/** @type {import('./types').IconData["svgChildrenConfigs"]} */
|
|
754
|
-
svgChildrenConfigs, color, hoverColor) => {
|
|
747
|
+
const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"]} */svgChildrenConfigs, color, hoverColor) => {
|
|
755
748
|
/** @type {{ [k:string]:React.CSSProperties; }} */
|
|
756
749
|
const obj = {};
|
|
757
|
-
|
|
758
750
|
for (const svgChildConfig of svgChildrenConfigs) {
|
|
759
751
|
if (color) obj['& ' + svgChildConfig.selector] = {
|
|
760
752
|
fill: svgChildConfig.fill ? color : undefined,
|
|
@@ -765,10 +757,8 @@ svgChildrenConfigs, color, hoverColor) => {
|
|
|
765
757
|
stroke: svgChildConfig.stroke ? hoverColor : undefined
|
|
766
758
|
};
|
|
767
759
|
}
|
|
768
|
-
|
|
769
760
|
return obj;
|
|
770
761
|
};
|
|
771
|
-
|
|
772
762
|
const useStyles$1 = reactJss.createUseStyles({
|
|
773
763
|
'@keyframes slideRight': {
|
|
774
764
|
to: {
|
|
@@ -812,8 +802,8 @@ const defaultSvgState = {
|
|
|
812
802
|
childrenConfigs: [],
|
|
813
803
|
attributes: defaultAttributes
|
|
814
804
|
};
|
|
815
|
-
/** @type {import('./props.type').IconProps} */
|
|
816
805
|
|
|
806
|
+
/** @type {import('./props.type').IconProps} */
|
|
817
807
|
const iconDefaultProps = {
|
|
818
808
|
name: undefined,
|
|
819
809
|
width: 'auto',
|
|
@@ -823,8 +813,8 @@ const iconDefaultProps = {
|
|
|
823
813
|
opacity: undefined,
|
|
824
814
|
className: undefined
|
|
825
815
|
};
|
|
826
|
-
/** @type {import("react").FC<import('./props.type').IconProps>} */
|
|
827
816
|
|
|
817
|
+
/** @type {import("react").FC<import('./props.type').IconProps>} */
|
|
828
818
|
const Icon = ({
|
|
829
819
|
name,
|
|
830
820
|
width,
|
|
@@ -843,10 +833,8 @@ const Icon = ({
|
|
|
843
833
|
}, []);
|
|
844
834
|
/** */
|
|
845
835
|
|
|
846
|
-
const rootRef = React.useRef(
|
|
847
|
-
|
|
848
|
-
null); // this ref is used to cancel the fetch promise success callback in case name prop changed
|
|
849
|
-
|
|
836
|
+
const rootRef = React.useRef( /** @type {HTMLElement} */null);
|
|
837
|
+
// this ref is used to cancel the fetch promise success callback in case name prop changed
|
|
850
838
|
const currentName = React.useRef(name);
|
|
851
839
|
const [svgState, setSvgState] = React.useState(defaultSvgState);
|
|
852
840
|
const styles = useStyles$1({
|
|
@@ -857,46 +845,41 @@ const Icon = ({
|
|
|
857
845
|
opacity,
|
|
858
846
|
hoverColor
|
|
859
847
|
});
|
|
860
|
-
|
|
861
848
|
const _className = React.useMemo(() => `${styles.root} ${className || ''}`, [className]);
|
|
862
|
-
|
|
863
849
|
React.useEffect(() => {
|
|
864
850
|
// reset
|
|
865
851
|
currentName.current = name;
|
|
866
852
|
setSvgState(defaultSvgState);
|
|
867
853
|
const icon = icons[name];
|
|
868
|
-
|
|
869
854
|
if (icon) {
|
|
870
855
|
/**
|
|
871
856
|
* retrieve from cache
|
|
872
857
|
* @type {Promise<string>}
|
|
873
858
|
*/
|
|
874
859
|
let svgProm = Icon.getCachedSvgPromise(name);
|
|
875
|
-
|
|
876
860
|
if (!svgProm) {
|
|
877
861
|
svgProm = fetch(icon.url).then(r => r.text()).catch(() => {
|
|
878
862
|
// unset in cache
|
|
879
863
|
Icon.setCachedSvgPromise(name, undefined);
|
|
880
864
|
return null;
|
|
881
|
-
});
|
|
882
|
-
|
|
865
|
+
});
|
|
866
|
+
//save in cache
|
|
883
867
|
Icon.setCachedSvgPromise(name, svgProm);
|
|
884
868
|
}
|
|
885
|
-
|
|
886
869
|
svgProm.then(svg => {
|
|
887
870
|
if (svg && isMounted.current && name === currentName.current) {
|
|
888
871
|
const div = document.createElement('div');
|
|
889
|
-
div.innerHTML = svg;
|
|
872
|
+
div.innerHTML = svg;
|
|
890
873
|
|
|
874
|
+
// set the new attributes
|
|
891
875
|
const newAttributes = {};
|
|
892
|
-
|
|
893
876
|
for (const ob of div.firstElementChild.attributes) {
|
|
894
877
|
const camelCased = ob.name.replace(/(-|:)([a-z])/g, g => g[1].toUpperCase());
|
|
895
878
|
newAttributes[camelCased] = ob.value;
|
|
896
|
-
}
|
|
897
|
-
// Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
|
|
898
|
-
|
|
879
|
+
}
|
|
899
880
|
|
|
881
|
+
// setting the state in last.
|
|
882
|
+
// Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
|
|
900
883
|
setSvgState({
|
|
901
884
|
innerHtml: div.firstElementChild.innerHTML,
|
|
902
885
|
childrenConfigs: icon.svgChildrenConfigs,
|
|
@@ -916,14 +899,11 @@ const Icon = ({
|
|
|
916
899
|
onClick: onClick
|
|
917
900
|
}));
|
|
918
901
|
};
|
|
919
|
-
|
|
920
902
|
Icon.defaultProps = iconDefaultProps;
|
|
921
|
-
/** static properties for caching */
|
|
922
903
|
|
|
904
|
+
/** static properties for caching */
|
|
923
905
|
Icon.cacheStore = {};
|
|
924
|
-
|
|
925
906
|
Icon.getCachedSvgPromise = name => Icon.cacheStore[name];
|
|
926
|
-
|
|
927
907
|
Icon.setCachedSvgPromise = (name, prom) => Icon.cacheStore[name] = prom;
|
|
928
908
|
|
|
929
909
|
const useDropdownStyles = createUseStyles(theme => ({
|
|
@@ -1035,7 +1015,6 @@ function OptionList({
|
|
|
1035
1015
|
isLandingPages
|
|
1036
1016
|
}) {
|
|
1037
1017
|
React.useContext(PageContext);
|
|
1038
|
-
|
|
1039
1018
|
const tabsDataModifier = () => {
|
|
1040
1019
|
return optionsData?.map(dt => {
|
|
1041
1020
|
return {
|
|
@@ -1047,7 +1026,6 @@ function OptionList({
|
|
|
1047
1026
|
};
|
|
1048
1027
|
});
|
|
1049
1028
|
};
|
|
1050
|
-
|
|
1051
1029
|
const tabData = tabsDataModifier();
|
|
1052
1030
|
const classes = useSectionStyles$a();
|
|
1053
1031
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -1136,31 +1114,24 @@ function DesktopHeader({
|
|
|
1136
1114
|
const classes = useSectionStyles$a({
|
|
1137
1115
|
isFixed
|
|
1138
1116
|
});
|
|
1139
|
-
|
|
1140
1117
|
const optionDataFn = () => {
|
|
1141
1118
|
let optionsArr = navData;
|
|
1142
1119
|
let optionsData = [];
|
|
1143
|
-
|
|
1144
1120
|
if (optionsArr?.length > 5) {
|
|
1145
1121
|
optionsData = optionsArr?.slice(0, 4);
|
|
1146
1122
|
} else {
|
|
1147
1123
|
optionsData = optionsArr;
|
|
1148
1124
|
}
|
|
1149
|
-
|
|
1150
1125
|
return optionsData;
|
|
1151
1126
|
};
|
|
1152
|
-
|
|
1153
1127
|
const moreContentFn = () => {
|
|
1154
1128
|
let optionsArr = navData;
|
|
1155
1129
|
let moreContent = [];
|
|
1156
|
-
|
|
1157
1130
|
if (optionsArr?.length > 5) {
|
|
1158
1131
|
moreContent = optionsArr?.slice(4);
|
|
1159
1132
|
}
|
|
1160
|
-
|
|
1161
1133
|
return moreContent;
|
|
1162
1134
|
};
|
|
1163
|
-
|
|
1164
1135
|
return /*#__PURE__*/React__default["default"].createElement("nav", {
|
|
1165
1136
|
className: classes.section
|
|
1166
1137
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -1218,7 +1189,6 @@ function MobileHeader({
|
|
|
1218
1189
|
const navEl = React.useRef(null);
|
|
1219
1190
|
React.useLayoutEffect(() => {
|
|
1220
1191
|
const body = navEl?.current?.ownerDocument?.body;
|
|
1221
|
-
|
|
1222
1192
|
if (sideMenu) {
|
|
1223
1193
|
body?.setAttribute('style', 'overflow: hidden;');
|
|
1224
1194
|
} else {
|
|
@@ -1228,7 +1198,6 @@ function MobileHeader({
|
|
|
1228
1198
|
let iosUrl = null;
|
|
1229
1199
|
let androidUrl = null;
|
|
1230
1200
|
let downloadLink = null;
|
|
1231
|
-
|
|
1232
1201
|
if (isTutorWebsite) {
|
|
1233
1202
|
if (header?.iosUrl) {
|
|
1234
1203
|
iosUrl = /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
@@ -1251,7 +1220,6 @@ function MobileHeader({
|
|
|
1251
1220
|
}
|
|
1252
1221
|
});
|
|
1253
1222
|
}
|
|
1254
|
-
|
|
1255
1223
|
if (header?.androidURL) {
|
|
1256
1224
|
androidUrl = /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
1257
1225
|
data: {
|
|
@@ -1272,7 +1240,6 @@ function MobileHeader({
|
|
|
1272
1240
|
}
|
|
1273
1241
|
});
|
|
1274
1242
|
}
|
|
1275
|
-
|
|
1276
1243
|
if (iosUrl && androidUrl) {
|
|
1277
1244
|
downloadLink = /*#__PURE__*/React__default["default"].createElement("div", null, iosUrl, androidUrl);
|
|
1278
1245
|
} else if (header?.iosUrl) {
|
|
@@ -1322,7 +1289,6 @@ function MobileHeader({
|
|
|
1322
1289
|
downloadLink = null;
|
|
1323
1290
|
}
|
|
1324
1291
|
}
|
|
1325
|
-
|
|
1326
1292
|
return /*#__PURE__*/React__default["default"].createElement("nav", {
|
|
1327
1293
|
ref: navEl,
|
|
1328
1294
|
className: classes.section
|
|
@@ -1379,11 +1345,9 @@ function Header({
|
|
|
1379
1345
|
isMobile,
|
|
1380
1346
|
isTutorWebsite
|
|
1381
1347
|
} = React.useContext(PageContext);
|
|
1382
|
-
|
|
1383
1348
|
const filterHiddenNavs = () => {
|
|
1384
1349
|
return data?.navs?.filter(dt => !dt.isHiddenNav);
|
|
1385
1350
|
};
|
|
1386
|
-
|
|
1387
1351
|
return isMobile ? /*#__PURE__*/React__default["default"].createElement(MobileHeader, {
|
|
1388
1352
|
navData: filterHiddenNavs(),
|
|
1389
1353
|
header: data,
|
|
@@ -1739,7 +1703,6 @@ const rustTheme = {
|
|
|
1739
1703
|
light: colors.lightRust,
|
|
1740
1704
|
lightest: colors.lightestRust
|
|
1741
1705
|
};
|
|
1742
|
-
|
|
1743
1706
|
const generateThemePalette = themeColors => ({
|
|
1744
1707
|
primary: themeColors,
|
|
1745
1708
|
background: {
|
|
@@ -1762,7 +1725,6 @@ const generateThemePalette = themeColors => ({
|
|
|
1762
1725
|
tertiary: colors.blueGrey
|
|
1763
1726
|
}
|
|
1764
1727
|
});
|
|
1765
|
-
|
|
1766
1728
|
const bluePalette = generateThemePalette(blueTheme);
|
|
1767
1729
|
const redPalette = generateThemePalette(redTheme);
|
|
1768
1730
|
const orangePalette = generateThemePalette(orangeTheme);
|
|
@@ -1803,9 +1765,7 @@ const fontComponents = {
|
|
|
1803
1765
|
'Merriweather Sans': MerriweatherSans,
|
|
1804
1766
|
'Arima Madurai': ArimaMadurai
|
|
1805
1767
|
};
|
|
1806
|
-
|
|
1807
1768
|
const getFontComponent = font => fontComponents[font] || (() => null);
|
|
1808
|
-
|
|
1809
1769
|
function FontSeeder({
|
|
1810
1770
|
fontFamily
|
|
1811
1771
|
}) {
|
|
@@ -1815,37 +1775,30 @@ function FontSeeder({
|
|
|
1815
1775
|
const useRubikFont = reactJss.createUseStyles({
|
|
1816
1776
|
'@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')`
|
|
1817
1777
|
});
|
|
1818
|
-
|
|
1819
1778
|
function Rubik() {
|
|
1820
1779
|
// to import "Rubik" font css
|
|
1821
1780
|
useRubikFont();
|
|
1822
1781
|
return null;
|
|
1823
1782
|
}
|
|
1824
|
-
|
|
1825
1783
|
const useIbmPlexSansFont = reactJss.createUseStyles({
|
|
1826
1784
|
'@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)'
|
|
1827
1785
|
});
|
|
1828
|
-
|
|
1829
1786
|
function IbmPlexSans() {
|
|
1830
1787
|
// to import "Ibm Plex Sans" font css
|
|
1831
1788
|
useIbmPlexSansFont();
|
|
1832
1789
|
return null;
|
|
1833
1790
|
}
|
|
1834
|
-
|
|
1835
1791
|
const useMerriweatherSansFont = reactJss.createUseStyles({
|
|
1836
1792
|
'@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)'
|
|
1837
1793
|
});
|
|
1838
|
-
|
|
1839
1794
|
function MerriweatherSans() {
|
|
1840
1795
|
// to import "Merriweather Sans" font css
|
|
1841
1796
|
useMerriweatherSansFont();
|
|
1842
1797
|
return null;
|
|
1843
1798
|
}
|
|
1844
|
-
|
|
1845
1799
|
const useArimaMaduraiFont = reactJss.createUseStyles({
|
|
1846
1800
|
'@import': 'url(https://fonts.googleapis.com/css2?family=Arima+Madurai:wght@400;500;700&display=swap)'
|
|
1847
1801
|
});
|
|
1848
|
-
|
|
1849
1802
|
function ArimaMadurai() {
|
|
1850
1803
|
// to import "Arima Madurai" font css
|
|
1851
1804
|
useArimaMaduraiFont();
|
|
@@ -1876,9 +1829,7 @@ const TYPE_TO_COMPONENT_MAP$1 = {
|
|
|
1876
1829
|
TILES_SECTION: /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return index$1; })),
|
|
1877
1830
|
EMAIL_DRIP_MARKET: /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return index; }))
|
|
1878
1831
|
};
|
|
1879
|
-
|
|
1880
1832
|
const getCompToRender$1 = type => TYPE_TO_COMPONENT_MAP$1[type] || (() => null);
|
|
1881
|
-
|
|
1882
1833
|
const MemoisedSection$1 = /*#__PURE__*/React.memo(({
|
|
1883
1834
|
sectionData,
|
|
1884
1835
|
extraProps
|
|
@@ -1895,9 +1846,7 @@ function SectionRenderer$1({
|
|
|
1895
1846
|
extraProps
|
|
1896
1847
|
}) {
|
|
1897
1848
|
return /*#__PURE__*/React__default["default"].createElement(React.Suspense, {
|
|
1898
|
-
fallback: null
|
|
1899
|
-
/*GIF maybe*/
|
|
1900
|
-
|
|
1849
|
+
fallback: null /*GIF maybe*/
|
|
1901
1850
|
}, /*#__PURE__*/React__default["default"].createElement(MemoisedSection$1, {
|
|
1902
1851
|
sectionData: sectionData,
|
|
1903
1852
|
extraProps: extraProps
|
|
@@ -2181,23 +2130,18 @@ const getArrowRotationAngle = props => {
|
|
|
2181
2130
|
switch (true) {
|
|
2182
2131
|
case props.left:
|
|
2183
2132
|
return 180;
|
|
2184
|
-
|
|
2185
2133
|
case props.up:
|
|
2186
2134
|
return 270;
|
|
2187
|
-
|
|
2188
2135
|
case props.down:
|
|
2189
2136
|
return 90;
|
|
2190
|
-
|
|
2191
2137
|
case props.right:
|
|
2192
2138
|
default:
|
|
2193
2139
|
return 0;
|
|
2194
2140
|
}
|
|
2195
2141
|
};
|
|
2196
|
-
|
|
2197
2142
|
const sizeHandler = ({
|
|
2198
2143
|
size
|
|
2199
2144
|
}) => size === 'small' ? '32px' : '48px';
|
|
2200
|
-
|
|
2201
2145
|
const useArrowButtonStyles = createUseStyles(theme => ({
|
|
2202
2146
|
arrowButtonContainer: {
|
|
2203
2147
|
cursor: 'pointer',
|
|
@@ -2237,7 +2181,6 @@ function dotsToShow(i, n) {
|
|
|
2237
2181
|
const leftToShow = i < elementsToShow / 2;
|
|
2238
2182
|
const rightToShow = n - i - 1 < elementsToShow / 2;
|
|
2239
2183
|
let leftCount, rightCount;
|
|
2240
|
-
|
|
2241
2184
|
if (leftToShow) {
|
|
2242
2185
|
leftCount = i;
|
|
2243
2186
|
rightCount = elementsToShow - i - 1;
|
|
@@ -2248,13 +2191,11 @@ function dotsToShow(i, n) {
|
|
|
2248
2191
|
leftCount = 2;
|
|
2249
2192
|
rightCount = 2;
|
|
2250
2193
|
}
|
|
2251
|
-
|
|
2252
2194
|
return {
|
|
2253
2195
|
leftCount,
|
|
2254
2196
|
rightCount
|
|
2255
2197
|
};
|
|
2256
2198
|
}
|
|
2257
|
-
|
|
2258
2199
|
function Carousel({
|
|
2259
2200
|
settings,
|
|
2260
2201
|
children,
|
|
@@ -2308,15 +2249,12 @@ function Carousel({
|
|
|
2308
2249
|
...settings,
|
|
2309
2250
|
className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
|
|
2310
2251
|
};
|
|
2311
|
-
|
|
2312
2252
|
const nextClick = () => {
|
|
2313
2253
|
sliderRef.current.slickNext();
|
|
2314
2254
|
};
|
|
2315
|
-
|
|
2316
2255
|
const previousClick = () => {
|
|
2317
2256
|
sliderRef.current.slickPrev();
|
|
2318
2257
|
};
|
|
2319
|
-
|
|
2320
2258
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Slider__default["default"], _extends({
|
|
2321
2259
|
ref: sliderRef
|
|
2322
2260
|
}, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2381,7 +2319,6 @@ function Section$4({
|
|
|
2381
2319
|
src: nodeData.image.metadata.value
|
|
2382
2320
|
})));
|
|
2383
2321
|
}
|
|
2384
|
-
|
|
2385
2322
|
function BannerCarouselRight({
|
|
2386
2323
|
sectionData
|
|
2387
2324
|
}) {
|
|
@@ -2407,9 +2344,7 @@ function BannerCarouselRight({
|
|
|
2407
2344
|
className: classes.sectionContainer
|
|
2408
2345
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$4, {
|
|
2409
2346
|
nodeData: node,
|
|
2410
|
-
key: idx
|
|
2411
|
-
/* or some other unique property */
|
|
2412
|
-
|
|
2347
|
+
key: idx /* or some other unique property */
|
|
2413
2348
|
})))));
|
|
2414
2349
|
}
|
|
2415
2350
|
|
|
@@ -2616,11 +2551,9 @@ function List({
|
|
|
2616
2551
|
containerWidth
|
|
2617
2552
|
});
|
|
2618
2553
|
const [nodeData] = sectionData.components;
|
|
2619
|
-
|
|
2620
2554
|
const getNumber = val => {
|
|
2621
2555
|
return val.toString().length == 1 ? '0' + val : val;
|
|
2622
2556
|
};
|
|
2623
|
-
|
|
2624
2557
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
2625
2558
|
className: classes.section
|
|
2626
2559
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2812,7 +2745,6 @@ const Section$3 = ({
|
|
|
2812
2745
|
size: isMobile ? 'small' : 'medium'
|
|
2813
2746
|
})))));
|
|
2814
2747
|
};
|
|
2815
|
-
|
|
2816
2748
|
function BannerCarouselCenter({
|
|
2817
2749
|
sectionData
|
|
2818
2750
|
}) {
|
|
@@ -2829,9 +2761,7 @@ function BannerCarouselCenter({
|
|
|
2829
2761
|
className: classes.bannerCarouselCenterSection
|
|
2830
2762
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$3, {
|
|
2831
2763
|
nodeData: node,
|
|
2832
|
-
key: idx
|
|
2833
|
-
/* or some other unique property */
|
|
2834
|
-
|
|
2764
|
+
key: idx /* or some other unique property */
|
|
2835
2765
|
}))));
|
|
2836
2766
|
}
|
|
2837
2767
|
|
|
@@ -2998,7 +2928,6 @@ function Section$2({
|
|
|
2998
2928
|
size: isMobile ? 'small' : 'medium'
|
|
2999
2929
|
})));
|
|
3000
2930
|
}
|
|
3001
|
-
|
|
3002
2931
|
function BannerCarouselLeft({
|
|
3003
2932
|
sectionData
|
|
3004
2933
|
}) {
|
|
@@ -3020,9 +2949,7 @@ function BannerCarouselLeft({
|
|
|
3020
2949
|
className: classes.sectionContainer
|
|
3021
2950
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$2, {
|
|
3022
2951
|
nodeData: node,
|
|
3023
|
-
key: idx
|
|
3024
|
-
/* or some other unique property */
|
|
3025
|
-
|
|
2952
|
+
key: idx /* or some other unique property */
|
|
3026
2953
|
})))));
|
|
3027
2954
|
}
|
|
3028
2955
|
|
|
@@ -3177,7 +3104,6 @@ async function postApiCall(baseURLs, data) {
|
|
|
3177
3104
|
},
|
|
3178
3105
|
data
|
|
3179
3106
|
});
|
|
3180
|
-
|
|
3181
3107
|
if (res) {
|
|
3182
3108
|
return res.data;
|
|
3183
3109
|
}
|
|
@@ -3202,7 +3128,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
|
|
|
3202
3128
|
if (extraProps && extraProps.formSubmitSuccess) {
|
|
3203
3129
|
extraProps.formSubmitSuccess();
|
|
3204
3130
|
}
|
|
3205
|
-
|
|
3206
3131
|
return res.data;
|
|
3207
3132
|
});
|
|
3208
3133
|
} catch (err) {
|
|
@@ -3315,7 +3240,6 @@ function SubscribeToNewsletter({
|
|
|
3315
3240
|
const [inputVal, setInputVal] = React.useState(formInitialValue);
|
|
3316
3241
|
let [isValid, setIsValid] = React.useState(true);
|
|
3317
3242
|
let [btnDisabled, setBtnDisabled] = React.useState(false);
|
|
3318
|
-
|
|
3319
3243
|
const handleSubmit = () => {
|
|
3320
3244
|
let data = {
|
|
3321
3245
|
sectionId: sectionData.sectionId,
|
|
@@ -3331,11 +3255,9 @@ function SubscribeToNewsletter({
|
|
|
3331
3255
|
setBtnDisabled(true);
|
|
3332
3256
|
setInputVal(formInitialValue);
|
|
3333
3257
|
};
|
|
3334
|
-
|
|
3335
3258
|
const checkValidity = () => {
|
|
3336
3259
|
if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
|
|
3337
3260
|
let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
|
|
3338
|
-
|
|
3339
3261
|
if (regex?.test(inputVal)) {
|
|
3340
3262
|
setIsValid(true);
|
|
3341
3263
|
} else {
|
|
@@ -3343,7 +3265,6 @@ function SubscribeToNewsletter({
|
|
|
3343
3265
|
}
|
|
3344
3266
|
}
|
|
3345
3267
|
};
|
|
3346
|
-
|
|
3347
3268
|
React.useEffect(() => {
|
|
3348
3269
|
if (!isValid) {
|
|
3349
3270
|
setBtnDisabled(true);
|
|
@@ -3671,7 +3592,6 @@ function Section$1({
|
|
|
3671
3592
|
className: classes.contentRow
|
|
3672
3593
|
}, carouselContent))));
|
|
3673
3594
|
}
|
|
3674
|
-
|
|
3675
3595
|
function Testimonials({
|
|
3676
3596
|
sectionData
|
|
3677
3597
|
}) {
|
|
@@ -3736,7 +3656,6 @@ const loaderStyle = theme => ({
|
|
|
3736
3656
|
});
|
|
3737
3657
|
|
|
3738
3658
|
const useStyles = reactJss.createUseStyles(loaderStyle);
|
|
3739
|
-
|
|
3740
3659
|
function Loader({
|
|
3741
3660
|
texts
|
|
3742
3661
|
}) {
|
|
@@ -3748,13 +3667,11 @@ function Loader({
|
|
|
3748
3667
|
React.useEffect(() => {
|
|
3749
3668
|
if (texts && texts.length) {
|
|
3750
3669
|
let textID = '';
|
|
3751
|
-
|
|
3752
3670
|
for (let i = 0; i < texts.length; i++) {
|
|
3753
3671
|
textID = setTimeout(() => {
|
|
3754
3672
|
setLoaderText(texts[i]);
|
|
3755
3673
|
}, 2000 * i);
|
|
3756
3674
|
}
|
|
3757
|
-
|
|
3758
3675
|
return () => {
|
|
3759
3676
|
clearTimeout(textID);
|
|
3760
3677
|
};
|
|
@@ -3822,18 +3739,15 @@ function VideoPlayer(props) {
|
|
|
3822
3739
|
imageUrl: imageUrl
|
|
3823
3740
|
});
|
|
3824
3741
|
const theme = useTheme();
|
|
3825
|
-
|
|
3826
3742
|
function getId(url) {
|
|
3827
3743
|
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
|
|
3828
3744
|
var match = url?.match(regExp);
|
|
3829
|
-
|
|
3830
3745
|
if (match?.[2].length == 11) {
|
|
3831
3746
|
return 'https://www.youtube.com/embed/' + match[2];
|
|
3832
3747
|
} else {
|
|
3833
3748
|
return url;
|
|
3834
3749
|
}
|
|
3835
3750
|
}
|
|
3836
|
-
|
|
3837
3751
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isLoaded && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3838
3752
|
className: classes.imgContainer
|
|
3839
3753
|
}, isEnabled ? /*#__PURE__*/React__default["default"].createElement(Loader, null) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, props.onlyThumbnail ? null : /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
@@ -4676,8 +4590,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
4676
4590
|
width: 'calc(100% - 2px)',
|
|
4677
4591
|
position: 'relative',
|
|
4678
4592
|
paddingBottom: '59.83%' // keeping aspect ratio 585x350
|
|
4679
|
-
|
|
4680
4593
|
},
|
|
4594
|
+
|
|
4681
4595
|
contentRow: {
|
|
4682
4596
|
display: 'grid',
|
|
4683
4597
|
gridTemplateColumns: ({
|
|
@@ -4936,7 +4850,6 @@ const FAQListing = ({
|
|
|
4936
4850
|
isSelected: selectedIndex === index
|
|
4937
4851
|
})))));
|
|
4938
4852
|
};
|
|
4939
|
-
|
|
4940
4853
|
const Accordion = ({
|
|
4941
4854
|
item,
|
|
4942
4855
|
isSelected,
|
|
@@ -5221,9 +5134,10 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5221
5134
|
flexGrow: 1,
|
|
5222
5135
|
display: 'flex',
|
|
5223
5136
|
flexDirection: 'column',
|
|
5224
|
-
justifyContent: 'space-between'
|
|
5225
|
-
|
|
5137
|
+
justifyContent: 'space-between'
|
|
5138
|
+
//alignItems: 'center',
|
|
5226
5139
|
},
|
|
5140
|
+
|
|
5227
5141
|
courseCardTags: {
|
|
5228
5142
|
display: 'flex',
|
|
5229
5143
|
justifyContent: 'flex-start',
|
|
@@ -5249,11 +5163,12 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5249
5163
|
wordBreak: 'break-word',
|
|
5250
5164
|
padding: '12px 0px',
|
|
5251
5165
|
textAlign: 'left',
|
|
5252
|
-
display: 'inline-block'
|
|
5166
|
+
display: 'inline-block'
|
|
5167
|
+
// overflow: 'hidden',
|
|
5253
5168
|
// whiteSpace: 'nowrap',
|
|
5254
5169
|
// textOverflow: 'ellipsis'
|
|
5255
|
-
|
|
5256
5170
|
},
|
|
5171
|
+
|
|
5257
5172
|
courseCardDiscount: {
|
|
5258
5173
|
display: 'flex',
|
|
5259
5174
|
justifyContent: 'flex-start',
|
|
@@ -5335,7 +5250,8 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5335
5250
|
}
|
|
5336
5251
|
},
|
|
5337
5252
|
'@media (max-width: 768px)': {
|
|
5338
|
-
coursesContainer: {
|
|
5253
|
+
coursesContainer: {
|
|
5254
|
+
//background: theme?.palette?.background?.primary
|
|
5339
5255
|
},
|
|
5340
5256
|
coursesCardAndText: {
|
|
5341
5257
|
padding: '70px 30px'
|
|
@@ -5367,7 +5283,6 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5367
5283
|
if (!hashToken) {
|
|
5368
5284
|
throw 'Missing hash token';
|
|
5369
5285
|
}
|
|
5370
|
-
|
|
5371
5286
|
const res = await axios__default["default"]({
|
|
5372
5287
|
method: 'get',
|
|
5373
5288
|
baseURL: baseURLs?.API_COURSE_URL,
|
|
@@ -5379,7 +5294,6 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5379
5294
|
requiredFilters: '[10]'
|
|
5380
5295
|
}
|
|
5381
5296
|
});
|
|
5382
|
-
|
|
5383
5297
|
if (res) {
|
|
5384
5298
|
return res.data;
|
|
5385
5299
|
}
|
|
@@ -5391,7 +5305,6 @@ function getShortenedSubstring(name, length, allowDots = true) {
|
|
|
5391
5305
|
if (name) {
|
|
5392
5306
|
return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
|
|
5393
5307
|
}
|
|
5394
|
-
|
|
5395
5308
|
return '';
|
|
5396
5309
|
}
|
|
5397
5310
|
|
|
@@ -5471,13 +5384,11 @@ function courses({
|
|
|
5471
5384
|
containerWidth
|
|
5472
5385
|
});
|
|
5473
5386
|
const [nodeData] = sectionData?.components;
|
|
5474
|
-
|
|
5475
5387
|
const handleApiCall = () => {
|
|
5476
5388
|
if (baseURLs) {
|
|
5477
5389
|
getCourseList(baseURLs, hashToken).then(response => {
|
|
5478
5390
|
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5479
5391
|
const coursesData = response?.data?.coursesData;
|
|
5480
|
-
|
|
5481
5392
|
if (coursesData && coursesData.length) {
|
|
5482
5393
|
setCardList(response?.data?.coursesData);
|
|
5483
5394
|
setShowShimmer(false);
|
|
@@ -5488,12 +5399,12 @@ function courses({
|
|
|
5488
5399
|
setShowShimmer(false);
|
|
5489
5400
|
setFallbackImages(placeholders);
|
|
5490
5401
|
}
|
|
5491
|
-
}
|
|
5402
|
+
}
|
|
5403
|
+
// For User Website & Draft Preview: If no data found, hide section.
|
|
5492
5404
|
else setErrored(true);
|
|
5493
5405
|
}
|
|
5494
5406
|
}).catch(err => {
|
|
5495
5407
|
const errMsg = err?.response?.data?.data?.message;
|
|
5496
|
-
|
|
5497
5408
|
if (errMsg === 'NOT_FOUND') {
|
|
5498
5409
|
if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
|
|
5499
5410
|
setShowShimmer(false);
|
|
@@ -5505,16 +5416,16 @@ function courses({
|
|
|
5505
5416
|
});
|
|
5506
5417
|
}
|
|
5507
5418
|
};
|
|
5508
|
-
|
|
5509
5419
|
React.useEffect(() => {
|
|
5510
|
-
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5511
|
-
|
|
5420
|
+
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5421
|
+
// For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
|
|
5512
5422
|
if (isMasterTemplate) {
|
|
5513
5423
|
if (placeholders && placeholders.length) {
|
|
5514
5424
|
setShowShimmer(false);
|
|
5515
5425
|
setFallbackImages(placeholders);
|
|
5516
5426
|
}
|
|
5517
|
-
}
|
|
5427
|
+
}
|
|
5428
|
+
// other
|
|
5518
5429
|
else {
|
|
5519
5430
|
handleApiCall();
|
|
5520
5431
|
}
|
|
@@ -5579,7 +5490,6 @@ function courses({
|
|
|
5579
5490
|
});
|
|
5580
5491
|
})))));
|
|
5581
5492
|
}
|
|
5582
|
-
|
|
5583
5493
|
function SimpleCardsContainer({
|
|
5584
5494
|
children,
|
|
5585
5495
|
classes
|
|
@@ -5995,7 +5905,6 @@ function FormEnquiry({
|
|
|
5995
5905
|
setBtnDisabled(true);
|
|
5996
5906
|
}
|
|
5997
5907
|
}, [validData]);
|
|
5998
|
-
|
|
5999
5908
|
const handleSubmit = () => {
|
|
6000
5909
|
let data = {
|
|
6001
5910
|
sectionId: sectionData?._id || null,
|
|
@@ -6006,23 +5915,22 @@ function FormEnquiry({
|
|
|
6006
5915
|
setBtnDisabled(true);
|
|
6007
5916
|
setInputVal(formInitialValue);
|
|
6008
5917
|
};
|
|
6009
|
-
|
|
6010
5918
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
6011
5919
|
if (validations?.[regexField]?.length) {
|
|
6012
5920
|
let regex = new RegExp(validations[regexField]);
|
|
6013
|
-
|
|
6014
5921
|
if (regex?.test(inputVal[fieldname])) {
|
|
6015
|
-
setValidData({
|
|
5922
|
+
setValidData({
|
|
5923
|
+
...validData,
|
|
6016
5924
|
[fieldValidity]: 1
|
|
6017
5925
|
});
|
|
6018
5926
|
} else {
|
|
6019
|
-
setValidData({
|
|
5927
|
+
setValidData({
|
|
5928
|
+
...validData,
|
|
6020
5929
|
[fieldValidity]: 0
|
|
6021
5930
|
});
|
|
6022
5931
|
}
|
|
6023
5932
|
}
|
|
6024
5933
|
};
|
|
6025
|
-
|
|
6026
5934
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
6027
5935
|
className: classes.section
|
|
6028
5936
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -6102,7 +6010,8 @@ function FormEnquiry({
|
|
|
6102
6010
|
isValid: validData.nameValid,
|
|
6103
6011
|
inputType: 'input',
|
|
6104
6012
|
onChange: e => {
|
|
6105
|
-
setInputVal({
|
|
6013
|
+
setInputVal({
|
|
6014
|
+
...inputVal,
|
|
6106
6015
|
name: e.target.value
|
|
6107
6016
|
});
|
|
6108
6017
|
},
|
|
@@ -6110,7 +6019,8 @@ function FormEnquiry({
|
|
|
6110
6019
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6111
6020
|
},
|
|
6112
6021
|
onFocus: () => {
|
|
6113
|
-
setValidData({
|
|
6022
|
+
setValidData({
|
|
6023
|
+
...validData,
|
|
6114
6024
|
nameValid: 1
|
|
6115
6025
|
});
|
|
6116
6026
|
}
|
|
@@ -6122,7 +6032,8 @@ function FormEnquiry({
|
|
|
6122
6032
|
isValid: validData.phoneValid,
|
|
6123
6033
|
inputType: 'input',
|
|
6124
6034
|
onChange: e => {
|
|
6125
|
-
setInputVal({
|
|
6035
|
+
setInputVal({
|
|
6036
|
+
...inputVal,
|
|
6126
6037
|
phone: e.target.value
|
|
6127
6038
|
});
|
|
6128
6039
|
},
|
|
@@ -6130,7 +6041,8 @@ function FormEnquiry({
|
|
|
6130
6041
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6131
6042
|
},
|
|
6132
6043
|
onFocus: () => {
|
|
6133
|
-
setValidData({
|
|
6044
|
+
setValidData({
|
|
6045
|
+
...validData,
|
|
6134
6046
|
phoneValid: 1
|
|
6135
6047
|
});
|
|
6136
6048
|
}
|
|
@@ -6142,7 +6054,8 @@ function FormEnquiry({
|
|
|
6142
6054
|
isValid: validData.emailValid,
|
|
6143
6055
|
inputType: 'input',
|
|
6144
6056
|
onChange: e => {
|
|
6145
|
-
setInputVal({
|
|
6057
|
+
setInputVal({
|
|
6058
|
+
...inputVal,
|
|
6146
6059
|
email: e.target.value
|
|
6147
6060
|
});
|
|
6148
6061
|
},
|
|
@@ -6150,7 +6063,8 @@ function FormEnquiry({
|
|
|
6150
6063
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6151
6064
|
},
|
|
6152
6065
|
onFocus: () => {
|
|
6153
|
-
setValidData({
|
|
6066
|
+
setValidData({
|
|
6067
|
+
...validData,
|
|
6154
6068
|
emailValid: 1
|
|
6155
6069
|
});
|
|
6156
6070
|
}
|
|
@@ -6162,7 +6076,8 @@ function FormEnquiry({
|
|
|
6162
6076
|
isValid: validData.messageValid,
|
|
6163
6077
|
inputType: 'textarea',
|
|
6164
6078
|
onChange: e => {
|
|
6165
|
-
setInputVal({
|
|
6079
|
+
setInputVal({
|
|
6080
|
+
...inputVal,
|
|
6166
6081
|
message: e.target.value
|
|
6167
6082
|
});
|
|
6168
6083
|
},
|
|
@@ -6170,7 +6085,8 @@ function FormEnquiry({
|
|
|
6170
6085
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6171
6086
|
},
|
|
6172
6087
|
onFocus: () => {
|
|
6173
|
-
setValidData({
|
|
6088
|
+
setValidData({
|
|
6089
|
+
...validData,
|
|
6174
6090
|
messageValid: 1
|
|
6175
6091
|
});
|
|
6176
6092
|
}
|
|
@@ -6401,7 +6317,6 @@ function Contact({
|
|
|
6401
6317
|
phoneValid: 1,
|
|
6402
6318
|
messageValid: 1
|
|
6403
6319
|
});
|
|
6404
|
-
|
|
6405
6320
|
const handleSubmit = () => {
|
|
6406
6321
|
const data = {
|
|
6407
6322
|
sectionId: sectionData?._id || null,
|
|
@@ -6412,7 +6327,6 @@ function Contact({
|
|
|
6412
6327
|
setBtnDisabled(true);
|
|
6413
6328
|
setInputVal(formInitialValue);
|
|
6414
6329
|
};
|
|
6415
|
-
|
|
6416
6330
|
React.useEffect(() => {
|
|
6417
6331
|
if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
|
|
6418
6332
|
setBtnDisabled(false);
|
|
@@ -6420,23 +6334,22 @@ function Contact({
|
|
|
6420
6334
|
setBtnDisabled(true);
|
|
6421
6335
|
}
|
|
6422
6336
|
}, [validData]);
|
|
6423
|
-
|
|
6424
6337
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
6425
6338
|
if (validations?.[regexField]?.length) {
|
|
6426
6339
|
let regex = new RegExp(validations[regexField]);
|
|
6427
|
-
|
|
6428
6340
|
if (regex?.test(inputVal[fieldname])) {
|
|
6429
|
-
setValidData({
|
|
6341
|
+
setValidData({
|
|
6342
|
+
...validData,
|
|
6430
6343
|
[fieldValidity]: 1
|
|
6431
6344
|
});
|
|
6432
6345
|
} else {
|
|
6433
|
-
setValidData({
|
|
6346
|
+
setValidData({
|
|
6347
|
+
...validData,
|
|
6434
6348
|
[fieldValidity]: 0
|
|
6435
6349
|
});
|
|
6436
6350
|
}
|
|
6437
6351
|
}
|
|
6438
6352
|
};
|
|
6439
|
-
|
|
6440
6353
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
6441
6354
|
className: classes.section
|
|
6442
6355
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -6478,7 +6391,8 @@ function Contact({
|
|
|
6478
6391
|
isValid: validData.nameValid,
|
|
6479
6392
|
inputType: 'input',
|
|
6480
6393
|
onChange: e => {
|
|
6481
|
-
setInputVal({
|
|
6394
|
+
setInputVal({
|
|
6395
|
+
...inputVal,
|
|
6482
6396
|
name: e.target.value
|
|
6483
6397
|
});
|
|
6484
6398
|
},
|
|
@@ -6486,7 +6400,8 @@ function Contact({
|
|
|
6486
6400
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6487
6401
|
},
|
|
6488
6402
|
onFocus: () => {
|
|
6489
|
-
setValidData({
|
|
6403
|
+
setValidData({
|
|
6404
|
+
...validData,
|
|
6490
6405
|
nameValid: 1
|
|
6491
6406
|
});
|
|
6492
6407
|
}
|
|
@@ -6498,7 +6413,8 @@ function Contact({
|
|
|
6498
6413
|
isValid: validData.phoneValid,
|
|
6499
6414
|
inputType: 'input',
|
|
6500
6415
|
onChange: e => {
|
|
6501
|
-
setInputVal({
|
|
6416
|
+
setInputVal({
|
|
6417
|
+
...inputVal,
|
|
6502
6418
|
phone: e.target.value
|
|
6503
6419
|
});
|
|
6504
6420
|
},
|
|
@@ -6506,7 +6422,8 @@ function Contact({
|
|
|
6506
6422
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6507
6423
|
},
|
|
6508
6424
|
onFocus: () => {
|
|
6509
|
-
setValidData({
|
|
6425
|
+
setValidData({
|
|
6426
|
+
...validData,
|
|
6510
6427
|
phoneValid: 1
|
|
6511
6428
|
});
|
|
6512
6429
|
}
|
|
@@ -6518,7 +6435,8 @@ function Contact({
|
|
|
6518
6435
|
isValid: validData.emailValid,
|
|
6519
6436
|
inputType: 'input',
|
|
6520
6437
|
onChange: e => {
|
|
6521
|
-
setInputVal({
|
|
6438
|
+
setInputVal({
|
|
6439
|
+
...inputVal,
|
|
6522
6440
|
email: e.target.value
|
|
6523
6441
|
});
|
|
6524
6442
|
},
|
|
@@ -6526,7 +6444,8 @@ function Contact({
|
|
|
6526
6444
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6527
6445
|
},
|
|
6528
6446
|
onFocus: () => {
|
|
6529
|
-
setValidData({
|
|
6447
|
+
setValidData({
|
|
6448
|
+
...validData,
|
|
6530
6449
|
emailValid: 1
|
|
6531
6450
|
});
|
|
6532
6451
|
}
|
|
@@ -6538,7 +6457,8 @@ function Contact({
|
|
|
6538
6457
|
isValid: validData.messageValid,
|
|
6539
6458
|
inputType: 'textarea',
|
|
6540
6459
|
onChange: e => {
|
|
6541
|
-
setInputVal({
|
|
6460
|
+
setInputVal({
|
|
6461
|
+
...inputVal,
|
|
6542
6462
|
message: e.target.value
|
|
6543
6463
|
});
|
|
6544
6464
|
},
|
|
@@ -6546,7 +6466,8 @@ function Contact({
|
|
|
6546
6466
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6547
6467
|
},
|
|
6548
6468
|
onFocus: () => {
|
|
6549
|
-
setValidData({
|
|
6469
|
+
setValidData({
|
|
6470
|
+
...validData,
|
|
6550
6471
|
messageValid: 1
|
|
6551
6472
|
});
|
|
6552
6473
|
}
|
|
@@ -6807,7 +6728,8 @@ const useWebinarPromotionPage = createUseStyles(theme => {
|
|
|
6807
6728
|
const SingleVideoSlide$1 = props => {
|
|
6808
6729
|
const [isReadMore, setIsReadMore] = React.useState(false);
|
|
6809
6730
|
const theme = useTheme();
|
|
6810
|
-
React.useEffect(() => {
|
|
6731
|
+
React.useEffect(() => {
|
|
6732
|
+
// remaining days epoch
|
|
6811
6733
|
// current date epoch
|
|
6812
6734
|
// subtract remaining days from current day epoch
|
|
6813
6735
|
// moment the result - and see if there are days
|
|
@@ -6819,7 +6741,6 @@ const SingleVideoSlide$1 = props => {
|
|
|
6819
6741
|
webinarCtaClick,
|
|
6820
6742
|
conversions = 0
|
|
6821
6743
|
} = props;
|
|
6822
|
-
|
|
6823
6744
|
const renderer = ({
|
|
6824
6745
|
days,
|
|
6825
6746
|
hours,
|
|
@@ -6835,9 +6756,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6835
6756
|
return /*#__PURE__*/React__default["default"].createElement("span", null, Math.floor(moment__default["default"].duration(given.diff(current)).asDays()), " day(s)");
|
|
6836
6757
|
}
|
|
6837
6758
|
};
|
|
6838
|
-
|
|
6839
6759
|
const checkIfOfferIsValid = () => moment__default["default"]().diff(moment__default["default"](props.data.offerPriceEndDate)) < 0;
|
|
6840
|
-
|
|
6841
6760
|
const checkForShowDiscount = () => {
|
|
6842
6761
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
6843
6762
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -6849,19 +6768,16 @@ const SingleVideoSlide$1 = props => {
|
|
|
6849
6768
|
if (data.offerPriceValidFor <= conversions) {
|
|
6850
6769
|
return false;
|
|
6851
6770
|
}
|
|
6852
|
-
|
|
6853
6771
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
6854
6772
|
return false;
|
|
6855
6773
|
} else {
|
|
6856
6774
|
return true;
|
|
6857
6775
|
}
|
|
6858
6776
|
}
|
|
6859
|
-
|
|
6860
6777
|
if (data.discount > 0) {
|
|
6861
6778
|
return true;
|
|
6862
6779
|
}
|
|
6863
6780
|
};
|
|
6864
|
-
|
|
6865
6781
|
const discount = ({
|
|
6866
6782
|
price,
|
|
6867
6783
|
discount
|
|
@@ -6869,7 +6785,6 @@ const SingleVideoSlide$1 = props => {
|
|
|
6869
6785
|
console.log('discountxx', props.data.price, props.data.discount);
|
|
6870
6786
|
return (discount / price * 100).toFixed(2);
|
|
6871
6787
|
};
|
|
6872
|
-
|
|
6873
6788
|
const classes = useWebinarPromotionPage();
|
|
6874
6789
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
6875
6790
|
className: classes.videoCarouselContainer
|
|
@@ -6881,7 +6796,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6881
6796
|
className: classes.videoDetails
|
|
6882
6797
|
}, data?.isPaid !== 0 && (checkIfOfferIsValid() || data.offerPriceValidFor > 0) && data.offerPriceValidFor > conversions && /*#__PURE__*/React__default["default"].createElement("div", null, data.offerPriceValidFor - conversions > 0 && data.discount && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) ? /*#__PURE__*/React__default["default"].createElement("h3", {
|
|
6883
6798
|
className: classes.bannerContainer
|
|
6884
|
-
}, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions,
|
|
6799
|
+
}, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions, ' ', data.offerPriceValidFor - conversions > 1 ? 'users now' : 'user only') : checkIfOfferIsValid() && /*#__PURE__*/React__default["default"].createElement("h3", {
|
|
6885
6800
|
className: classes.bannerContainer
|
|
6886
6801
|
}, "Hurry up! Offer for limited period only")), /*#__PURE__*/React__default["default"].createElement("h3", {
|
|
6887
6802
|
ref: data?.videoTextHeading?.refSetter,
|
|
@@ -6965,9 +6880,10 @@ const SingleVideoSlide$1 = props => {
|
|
|
6965
6880
|
data: {
|
|
6966
6881
|
// link: 'headerData?.loginCtaLink',
|
|
6967
6882
|
// isLink: 1,
|
|
6968
|
-
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
6969
|
-
|
|
6883
|
+
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
6884
|
+
// isExternal: 1
|
|
6970
6885
|
},
|
|
6886
|
+
|
|
6971
6887
|
onClick: webinarCtaClick,
|
|
6972
6888
|
type: 'primary',
|
|
6973
6889
|
size: 'medium',
|
|
@@ -7301,14 +7217,14 @@ const SingleVideoSlide = props => {
|
|
|
7301
7217
|
isEdit
|
|
7302
7218
|
} = React.useContext(PageContext);
|
|
7303
7219
|
console.log(isEdit, 'isEdit');
|
|
7304
|
-
React.useEffect(() => {
|
|
7220
|
+
React.useEffect(() => {
|
|
7221
|
+
// remaining days epoch
|
|
7305
7222
|
// current date epoch
|
|
7306
7223
|
// subtract remaining days from current day epoch
|
|
7307
7224
|
// moment the result - and see if there are days
|
|
7308
7225
|
// days is present show days
|
|
7309
7226
|
// else start reverse timer
|
|
7310
7227
|
}, []);
|
|
7311
|
-
|
|
7312
7228
|
const renderer = ({
|
|
7313
7229
|
days,
|
|
7314
7230
|
hours,
|
|
@@ -7324,7 +7240,6 @@ const SingleVideoSlide = props => {
|
|
|
7324
7240
|
return /*#__PURE__*/React__default["default"].createElement("span", null, Math.floor(moment__default["default"].duration(given.diff(current)).asDays()), " day(s)");
|
|
7325
7241
|
}
|
|
7326
7242
|
};
|
|
7327
|
-
|
|
7328
7243
|
const {
|
|
7329
7244
|
data,
|
|
7330
7245
|
courseBuyNow,
|
|
@@ -7333,9 +7248,7 @@ const SingleVideoSlide = props => {
|
|
|
7333
7248
|
} = props;
|
|
7334
7249
|
const showCourseInstallmentData = data?.courseOverviewData;
|
|
7335
7250
|
const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
|
|
7336
|
-
|
|
7337
7251
|
const checkIfOfferIsValid = () => moment__default["default"]().diff(moment__default["default"](props?.data?.endDate || 0)) < 0;
|
|
7338
|
-
|
|
7339
7252
|
const checkForShowDiscount = () => {
|
|
7340
7253
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
7341
7254
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -7347,28 +7260,23 @@ const SingleVideoSlide = props => {
|
|
|
7347
7260
|
if (data.offerPriceValidFor <= conversions) {
|
|
7348
7261
|
return false;
|
|
7349
7262
|
}
|
|
7350
|
-
|
|
7351
7263
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
7352
7264
|
return false;
|
|
7353
7265
|
} else {
|
|
7354
7266
|
return true;
|
|
7355
7267
|
}
|
|
7356
7268
|
}
|
|
7357
|
-
|
|
7358
7269
|
if (data.discount > 0) {
|
|
7359
7270
|
return true;
|
|
7360
7271
|
}
|
|
7361
7272
|
};
|
|
7362
|
-
|
|
7363
7273
|
const classes = useCoursePromotionPage();
|
|
7364
|
-
|
|
7365
7274
|
const discount = ({
|
|
7366
7275
|
price,
|
|
7367
7276
|
discount
|
|
7368
7277
|
}) => {
|
|
7369
7278
|
return (discount / price * 100).toFixed(2);
|
|
7370
7279
|
};
|
|
7371
|
-
|
|
7372
7280
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
7373
7281
|
className: classes.videoCarouselContainer
|
|
7374
7282
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -7482,15 +7390,16 @@ const SingleVideoSlide = props => {
|
|
|
7482
7390
|
data: {
|
|
7483
7391
|
// link: 'headerData?.loginCtaLink',
|
|
7484
7392
|
// isLink: 1,
|
|
7485
|
-
value: 'BUY NOW'
|
|
7486
|
-
|
|
7393
|
+
value: 'BUY NOW'
|
|
7394
|
+
// isExternal: 1
|
|
7487
7395
|
},
|
|
7396
|
+
|
|
7488
7397
|
onClick: courseBuyNow,
|
|
7489
7398
|
type: 'primary',
|
|
7490
7399
|
size: 'medium',
|
|
7491
7400
|
target: null,
|
|
7492
|
-
rel: null
|
|
7493
|
-
|
|
7401
|
+
rel: null
|
|
7402
|
+
// styling={isMobile ? { margin: '0 40px' } : {}}
|
|
7494
7403
|
})))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
7495
7404
|
className: classes.payInstallmentContainer,
|
|
7496
7405
|
onClick: showCourseInstallment
|
|
@@ -7695,18 +7604,15 @@ const FormPage = ({
|
|
|
7695
7604
|
_id,
|
|
7696
7605
|
baseURLs
|
|
7697
7606
|
} = React.useContext(PageContext);
|
|
7698
|
-
|
|
7699
7607
|
const handleSubmit = async e => {
|
|
7700
7608
|
e.preventDefault();
|
|
7701
7609
|
let formResponse = [];
|
|
7702
|
-
|
|
7703
7610
|
for (const [key, value] of Object.entries(formData)) {
|
|
7704
7611
|
if (value.questionType === 'MC') {
|
|
7705
7612
|
if (value.solutionArray.length > 1) {
|
|
7706
7613
|
value.solutionArray.shift();
|
|
7707
7614
|
}
|
|
7708
7615
|
}
|
|
7709
|
-
|
|
7710
7616
|
formResponse.push({
|
|
7711
7617
|
questionId: key,
|
|
7712
7618
|
questionName: value.questionName,
|
|
@@ -7714,7 +7620,6 @@ const FormPage = ({
|
|
|
7714
7620
|
solutionArray: value.solutionArray
|
|
7715
7621
|
});
|
|
7716
7622
|
}
|
|
7717
|
-
|
|
7718
7623
|
const data = {
|
|
7719
7624
|
sectionId: sectionData?.components?.[0]?._id || null,
|
|
7720
7625
|
landingPageId: _id || null,
|
|
@@ -7724,7 +7629,6 @@ const FormPage = ({
|
|
|
7724
7629
|
setFormData({});
|
|
7725
7630
|
setformSubmitted(!formSubmitted);
|
|
7726
7631
|
};
|
|
7727
|
-
|
|
7728
7632
|
React.useEffect(() => {
|
|
7729
7633
|
//add all questions to formData
|
|
7730
7634
|
let formData = {};
|
|
@@ -7737,23 +7641,26 @@ const FormPage = ({
|
|
|
7737
7641
|
});
|
|
7738
7642
|
setFormData(formData);
|
|
7739
7643
|
}, [metadata, formSubmitted]);
|
|
7740
|
-
|
|
7741
7644
|
const handleOnClick = (e, item, option) => {
|
|
7742
7645
|
// if the checkbox is checked
|
|
7743
7646
|
if (!e.target.checked) {
|
|
7744
7647
|
// if the checkbox is checked and the solution array is empty
|
|
7745
7648
|
if (!formData[item._id]?.solutionArray?.length) {
|
|
7746
|
-
setFormData({
|
|
7649
|
+
setFormData({
|
|
7650
|
+
...formData,
|
|
7747
7651
|
[item._id]: {
|
|
7748
7652
|
questionName: item.text,
|
|
7749
7653
|
solutionArray: [option.value],
|
|
7750
7654
|
questionType: 'MC'
|
|
7751
7655
|
}
|
|
7752
7656
|
});
|
|
7753
|
-
}
|
|
7657
|
+
}
|
|
7658
|
+
// if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
|
|
7754
7659
|
else if (formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7755
7660
|
// if only one value is in the array remove it
|
|
7756
|
-
|
|
7661
|
+
|
|
7662
|
+
setFormData({
|
|
7663
|
+
...formData,
|
|
7757
7664
|
[item._id]: {
|
|
7758
7665
|
questionName: item.text,
|
|
7759
7666
|
solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
|
|
@@ -7761,20 +7668,24 @@ const FormPage = ({
|
|
|
7761
7668
|
}
|
|
7762
7669
|
});
|
|
7763
7670
|
}
|
|
7764
|
-
}
|
|
7671
|
+
}
|
|
7672
|
+
// if the checkbox is unchecked
|
|
7765
7673
|
else {
|
|
7766
7674
|
// if the checkbox is unchecked and the solution array is empty
|
|
7767
7675
|
if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
|
|
7768
|
-
setFormData({
|
|
7676
|
+
setFormData({
|
|
7677
|
+
...formData,
|
|
7769
7678
|
[item._id]: {
|
|
7770
7679
|
questionName: item.text,
|
|
7771
7680
|
solutionArray: [option.value],
|
|
7772
7681
|
questionType: 'MC'
|
|
7773
7682
|
}
|
|
7774
7683
|
});
|
|
7775
|
-
}
|
|
7684
|
+
}
|
|
7685
|
+
// if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
|
|
7776
7686
|
else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7777
|
-
setFormData({
|
|
7687
|
+
setFormData({
|
|
7688
|
+
...formData,
|
|
7778
7689
|
[item._id]: {
|
|
7779
7690
|
questionName: item.text,
|
|
7780
7691
|
solutionArray: [...formData[item._id]?.solutionArray, option.value],
|
|
@@ -7784,7 +7695,6 @@ const FormPage = ({
|
|
|
7784
7695
|
}
|
|
7785
7696
|
}
|
|
7786
7697
|
};
|
|
7787
|
-
|
|
7788
7698
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
7789
7699
|
className: classes.formPageSection
|
|
7790
7700
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -7811,7 +7721,8 @@ const FormPage = ({
|
|
|
7811
7721
|
placeholder: "Short answer",
|
|
7812
7722
|
name: item._id,
|
|
7813
7723
|
onChange: e => {
|
|
7814
|
-
setFormData({
|
|
7724
|
+
setFormData({
|
|
7725
|
+
...formData,
|
|
7815
7726
|
[item._id]: {
|
|
7816
7727
|
index,
|
|
7817
7728
|
questionName: item.text,
|
|
@@ -7851,11 +7762,13 @@ const FormPage = ({
|
|
|
7851
7762
|
name: "text",
|
|
7852
7763
|
required: item.isRequired,
|
|
7853
7764
|
value: option.value,
|
|
7854
|
-
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7765
|
+
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7766
|
+
// name={option.value}
|
|
7855
7767
|
// id={option.value}
|
|
7856
7768
|
,
|
|
7857
7769
|
onClick: e => {
|
|
7858
|
-
setFormData({
|
|
7770
|
+
setFormData({
|
|
7771
|
+
...formData,
|
|
7859
7772
|
[item._id]: {
|
|
7860
7773
|
questionName: item.text,
|
|
7861
7774
|
solutionArray: [option.value],
|
|
@@ -7871,9 +7784,10 @@ const FormPage = ({
|
|
|
7871
7784
|
data: {
|
|
7872
7785
|
// link: 'headerData?.loginCtaLink',
|
|
7873
7786
|
// isLink: 1,
|
|
7874
|
-
value: 'SUBMIT'
|
|
7875
|
-
|
|
7787
|
+
value: 'SUBMIT'
|
|
7788
|
+
// isExternal: 1
|
|
7876
7789
|
},
|
|
7790
|
+
|
|
7877
7791
|
type: 'primary',
|
|
7878
7792
|
size: 'medium',
|
|
7879
7793
|
target: null,
|
|
@@ -7967,7 +7881,6 @@ function Tiles({
|
|
|
7967
7881
|
const nodeData = sectionData.components;
|
|
7968
7882
|
console.log(nodeData);
|
|
7969
7883
|
const tilesList = nodeData[0]?.tilesList.components;
|
|
7970
|
-
|
|
7971
7884
|
const handleClick = value => {
|
|
7972
7885
|
if (!isEdit && value) {
|
|
7973
7886
|
if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
|
|
@@ -7977,7 +7890,6 @@ function Tiles({
|
|
|
7977
7890
|
}
|
|
7978
7891
|
}
|
|
7979
7892
|
};
|
|
7980
|
-
|
|
7981
7893
|
const TileDiv = tilesList?.map((tile, i) => {
|
|
7982
7894
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
|
7983
7895
|
key: i
|
|
@@ -8040,8 +7952,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8040
7952
|
width: 'auto',
|
|
8041
7953
|
height: '48px'
|
|
8042
7954
|
/* margin: 18px 0px; */
|
|
8043
|
-
|
|
8044
7955
|
},
|
|
7956
|
+
|
|
8045
7957
|
'p-young-guru-title': {
|
|
8046
7958
|
fontFamily: theme?.typography?.fontFamily,
|
|
8047
7959
|
fontStyle: 'normal',
|
|
@@ -8068,8 +7980,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8068
7980
|
fontSize: '0',
|
|
8069
7981
|
textAlign: 'center'
|
|
8070
7982
|
/* padding:35px 0 40px */
|
|
8071
|
-
|
|
8072
7983
|
},
|
|
7984
|
+
|
|
8073
7985
|
'two-columns .column': {
|
|
8074
7986
|
width: '100%',
|
|
8075
7987
|
maxWidth: '275px',
|
|
@@ -8085,9 +7997,10 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8085
7997
|
color: '#030a21',
|
|
8086
7998
|
marginBottom: '5px',
|
|
8087
7999
|
textAlign: 'left'
|
|
8088
|
-
}
|
|
8089
|
-
// }
|
|
8000
|
+
}
|
|
8090
8001
|
|
|
8002
|
+
// @media screen and (max-width: 600px) {
|
|
8003
|
+
// }
|
|
8091
8004
|
}));
|
|
8092
8005
|
|
|
8093
8006
|
function Section({
|
|
@@ -8116,8 +8029,8 @@ function Section({
|
|
|
8116
8029
|
}, /*#__PURE__*/React__default["default"].createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8117
8030
|
className: classes.email_description_para,
|
|
8118
8031
|
dangerouslySetInnerHTML: {
|
|
8119
|
-
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8120
|
-
|
|
8032
|
+
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8033
|
+
// __html: '<div>sdnfksdnflksdnfklsndk</div>'
|
|
8121
8034
|
}
|
|
8122
8035
|
}) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, header?.isActive ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", null, /*#__PURE__*/React__default["default"].createElement("table", {
|
|
8123
8036
|
style: {
|
|
@@ -8150,7 +8063,8 @@ function Section({
|
|
|
8150
8063
|
textAlign: 'center'
|
|
8151
8064
|
}
|
|
8152
8065
|
}, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React__default["default"].createElement("img", {
|
|
8153
|
-
src: header?.components[1]?.metadata?.image
|
|
8066
|
+
src: header?.components[1]?.metadata?.image
|
|
8067
|
+
// width={600}
|
|
8154
8068
|
,
|
|
8155
8069
|
alt: "",
|
|
8156
8070
|
style: {
|
|
@@ -8433,14 +8347,12 @@ function Section({
|
|
|
8433
8347
|
}
|
|
8434
8348
|
}, "All rights reserved.")))))))))))))) : null)))));
|
|
8435
8349
|
}
|
|
8436
|
-
|
|
8437
8350
|
function EmailDripMarket({
|
|
8438
8351
|
sectionData,
|
|
8439
8352
|
extraProps = {}
|
|
8440
8353
|
}) {
|
|
8441
8354
|
console.log('extrapropstemplate', extraProps);
|
|
8442
8355
|
const isInitialMount = React.useRef(true);
|
|
8443
|
-
|
|
8444
8356
|
const convertToHtml = sectionData => {
|
|
8445
8357
|
const html = ReactDOMServer__default["default"].renderToStaticMarkup( /*#__PURE__*/React__default["default"].createElement(Section, {
|
|
8446
8358
|
nodeData: sectionData,
|
|
@@ -8450,15 +8362,15 @@ function EmailDripMarket({
|
|
|
8450
8362
|
}));
|
|
8451
8363
|
return html;
|
|
8452
8364
|
};
|
|
8453
|
-
|
|
8454
8365
|
React.useEffect(() => {
|
|
8455
8366
|
if (isInitialMount.current) {
|
|
8456
8367
|
isInitialMount.current = false;
|
|
8457
8368
|
} else {
|
|
8458
8369
|
extraProps?.callbackHtml(convertToHtml(sectionData));
|
|
8459
8370
|
}
|
|
8460
|
-
}, [extraProps?.convertedHtml]);
|
|
8371
|
+
}, [extraProps?.convertedHtml]);
|
|
8461
8372
|
|
|
8373
|
+
// const mockData = sectionData?.sections[0];
|
|
8462
8374
|
const emailRef = React.useRef(null);
|
|
8463
8375
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
8464
8376
|
style: {
|
|
@@ -8468,7 +8380,6 @@ function EmailDripMarket({
|
|
|
8468
8380
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8469
8381
|
onClick: e => {
|
|
8470
8382
|
e.stopPropagation(); // prevent the click from event Capturing, in email onClick events do not work
|
|
8471
|
-
|
|
8472
8383
|
e.preventDefault();
|
|
8473
8384
|
}
|
|
8474
8385
|
}, /*#__PURE__*/React__default["default"].createElement(Section, {
|
|
@@ -8507,9 +8418,7 @@ const TYPE_TO_COMPONENT_MAP = {
|
|
|
8507
8418
|
TILES_SECTION: Tiles,
|
|
8508
8419
|
EMAIL_DRIP_MARKET: EmailDripMarket
|
|
8509
8420
|
};
|
|
8510
|
-
|
|
8511
8421
|
const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
|
|
8512
|
-
|
|
8513
8422
|
const MemoisedSection = /*#__PURE__*/React.memo(({
|
|
8514
8423
|
sectionData,
|
|
8515
8424
|
extraProps
|
|
@@ -8622,11 +8531,9 @@ const componentParser = compObj => {
|
|
|
8622
8531
|
});
|
|
8623
8532
|
return component;
|
|
8624
8533
|
}
|
|
8625
|
-
|
|
8626
8534
|
if (Array.isArray(compObj.components)) {
|
|
8627
8535
|
compObj.components = compObj.components.map(componentParser);
|
|
8628
8536
|
}
|
|
8629
|
-
|
|
8630
8537
|
return compObj;
|
|
8631
8538
|
};
|
|
8632
8539
|
const inverseComponentParser = compObj => {
|
|
@@ -8651,7 +8558,6 @@ const inverseComponentParser = compObj => {
|
|
|
8651
8558
|
if (compObj.components) {
|
|
8652
8559
|
compObj.components = compObj.components.map(inverseComponentParser);
|
|
8653
8560
|
}
|
|
8654
|
-
|
|
8655
8561
|
return compObj;
|
|
8656
8562
|
}
|
|
8657
8563
|
};
|