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