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.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
|
|
@@ -2166,23 +2115,18 @@ const getArrowRotationAngle = props => {
|
|
|
2166
2115
|
switch (true) {
|
|
2167
2116
|
case props.left:
|
|
2168
2117
|
return 180;
|
|
2169
|
-
|
|
2170
2118
|
case props.up:
|
|
2171
2119
|
return 270;
|
|
2172
|
-
|
|
2173
2120
|
case props.down:
|
|
2174
2121
|
return 90;
|
|
2175
|
-
|
|
2176
2122
|
case props.right:
|
|
2177
2123
|
default:
|
|
2178
2124
|
return 0;
|
|
2179
2125
|
}
|
|
2180
2126
|
};
|
|
2181
|
-
|
|
2182
2127
|
const sizeHandler = ({
|
|
2183
2128
|
size
|
|
2184
2129
|
}) => size === 'small' ? '32px' : '48px';
|
|
2185
|
-
|
|
2186
2130
|
const useArrowButtonStyles = createUseStyles(theme => ({
|
|
2187
2131
|
arrowButtonContainer: {
|
|
2188
2132
|
cursor: 'pointer',
|
|
@@ -2222,7 +2166,6 @@ function dotsToShow(i, n) {
|
|
|
2222
2166
|
const leftToShow = i < elementsToShow / 2;
|
|
2223
2167
|
const rightToShow = n - i - 1 < elementsToShow / 2;
|
|
2224
2168
|
let leftCount, rightCount;
|
|
2225
|
-
|
|
2226
2169
|
if (leftToShow) {
|
|
2227
2170
|
leftCount = i;
|
|
2228
2171
|
rightCount = elementsToShow - i - 1;
|
|
@@ -2233,13 +2176,11 @@ function dotsToShow(i, n) {
|
|
|
2233
2176
|
leftCount = 2;
|
|
2234
2177
|
rightCount = 2;
|
|
2235
2178
|
}
|
|
2236
|
-
|
|
2237
2179
|
return {
|
|
2238
2180
|
leftCount,
|
|
2239
2181
|
rightCount
|
|
2240
2182
|
};
|
|
2241
2183
|
}
|
|
2242
|
-
|
|
2243
2184
|
function Carousel({
|
|
2244
2185
|
settings,
|
|
2245
2186
|
children,
|
|
@@ -2293,15 +2234,12 @@ function Carousel({
|
|
|
2293
2234
|
...settings,
|
|
2294
2235
|
className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
|
|
2295
2236
|
};
|
|
2296
|
-
|
|
2297
2237
|
const nextClick = () => {
|
|
2298
2238
|
sliderRef.current.slickNext();
|
|
2299
2239
|
};
|
|
2300
|
-
|
|
2301
2240
|
const previousClick = () => {
|
|
2302
2241
|
sliderRef.current.slickPrev();
|
|
2303
2242
|
};
|
|
2304
|
-
|
|
2305
2243
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Slider, _extends({
|
|
2306
2244
|
ref: sliderRef
|
|
2307
2245
|
}, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React.createElement("div", {
|
|
@@ -2366,7 +2304,6 @@ function Section$4({
|
|
|
2366
2304
|
src: nodeData.image.metadata.value
|
|
2367
2305
|
})));
|
|
2368
2306
|
}
|
|
2369
|
-
|
|
2370
2307
|
function BannerCarouselRight({
|
|
2371
2308
|
sectionData
|
|
2372
2309
|
}) {
|
|
@@ -2392,9 +2329,7 @@ function BannerCarouselRight({
|
|
|
2392
2329
|
className: classes.sectionContainer
|
|
2393
2330
|
}, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$4, {
|
|
2394
2331
|
nodeData: node,
|
|
2395
|
-
key: idx
|
|
2396
|
-
/* or some other unique property */
|
|
2397
|
-
|
|
2332
|
+
key: idx /* or some other unique property */
|
|
2398
2333
|
})))));
|
|
2399
2334
|
}
|
|
2400
2335
|
|
|
@@ -2601,11 +2536,9 @@ function List({
|
|
|
2601
2536
|
containerWidth
|
|
2602
2537
|
});
|
|
2603
2538
|
const [nodeData] = sectionData.components;
|
|
2604
|
-
|
|
2605
2539
|
const getNumber = val => {
|
|
2606
2540
|
return val.toString().length == 1 ? '0' + val : val;
|
|
2607
2541
|
};
|
|
2608
|
-
|
|
2609
2542
|
return /*#__PURE__*/React.createElement("section", {
|
|
2610
2543
|
className: classes.section
|
|
2611
2544
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2797,7 +2730,6 @@ const Section$3 = ({
|
|
|
2797
2730
|
size: isMobile ? 'small' : 'medium'
|
|
2798
2731
|
})))));
|
|
2799
2732
|
};
|
|
2800
|
-
|
|
2801
2733
|
function BannerCarouselCenter({
|
|
2802
2734
|
sectionData
|
|
2803
2735
|
}) {
|
|
@@ -2814,9 +2746,7 @@ function BannerCarouselCenter({
|
|
|
2814
2746
|
className: classes.bannerCarouselCenterSection
|
|
2815
2747
|
}, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$3, {
|
|
2816
2748
|
nodeData: node,
|
|
2817
|
-
key: idx
|
|
2818
|
-
/* or some other unique property */
|
|
2819
|
-
|
|
2749
|
+
key: idx /* or some other unique property */
|
|
2820
2750
|
}))));
|
|
2821
2751
|
}
|
|
2822
2752
|
|
|
@@ -2983,7 +2913,6 @@ function Section$2({
|
|
|
2983
2913
|
size: isMobile ? 'small' : 'medium'
|
|
2984
2914
|
})));
|
|
2985
2915
|
}
|
|
2986
|
-
|
|
2987
2916
|
function BannerCarouselLeft({
|
|
2988
2917
|
sectionData
|
|
2989
2918
|
}) {
|
|
@@ -3005,9 +2934,7 @@ function BannerCarouselLeft({
|
|
|
3005
2934
|
className: classes.sectionContainer
|
|
3006
2935
|
}, /*#__PURE__*/React.createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$2, {
|
|
3007
2936
|
nodeData: node,
|
|
3008
|
-
key: idx
|
|
3009
|
-
/* or some other unique property */
|
|
3010
|
-
|
|
2937
|
+
key: idx /* or some other unique property */
|
|
3011
2938
|
})))));
|
|
3012
2939
|
}
|
|
3013
2940
|
|
|
@@ -3162,7 +3089,6 @@ async function postApiCall(baseURLs, data) {
|
|
|
3162
3089
|
},
|
|
3163
3090
|
data
|
|
3164
3091
|
});
|
|
3165
|
-
|
|
3166
3092
|
if (res) {
|
|
3167
3093
|
return res.data;
|
|
3168
3094
|
}
|
|
@@ -3187,7 +3113,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
|
|
|
3187
3113
|
if (extraProps && extraProps.formSubmitSuccess) {
|
|
3188
3114
|
extraProps.formSubmitSuccess();
|
|
3189
3115
|
}
|
|
3190
|
-
|
|
3191
3116
|
return res.data;
|
|
3192
3117
|
});
|
|
3193
3118
|
} catch (err) {
|
|
@@ -3300,7 +3225,6 @@ function SubscribeToNewsletter({
|
|
|
3300
3225
|
const [inputVal, setInputVal] = useState(formInitialValue);
|
|
3301
3226
|
let [isValid, setIsValid] = useState(true);
|
|
3302
3227
|
let [btnDisabled, setBtnDisabled] = useState(false);
|
|
3303
|
-
|
|
3304
3228
|
const handleSubmit = () => {
|
|
3305
3229
|
let data = {
|
|
3306
3230
|
sectionId: sectionData.sectionId,
|
|
@@ -3316,11 +3240,9 @@ function SubscribeToNewsletter({
|
|
|
3316
3240
|
setBtnDisabled(true);
|
|
3317
3241
|
setInputVal(formInitialValue);
|
|
3318
3242
|
};
|
|
3319
|
-
|
|
3320
3243
|
const checkValidity = () => {
|
|
3321
3244
|
if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
|
|
3322
3245
|
let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
|
|
3323
|
-
|
|
3324
3246
|
if (regex?.test(inputVal)) {
|
|
3325
3247
|
setIsValid(true);
|
|
3326
3248
|
} else {
|
|
@@ -3328,7 +3250,6 @@ function SubscribeToNewsletter({
|
|
|
3328
3250
|
}
|
|
3329
3251
|
}
|
|
3330
3252
|
};
|
|
3331
|
-
|
|
3332
3253
|
useEffect(() => {
|
|
3333
3254
|
if (!isValid) {
|
|
3334
3255
|
setBtnDisabled(true);
|
|
@@ -3656,7 +3577,6 @@ function Section$1({
|
|
|
3656
3577
|
className: classes.contentRow
|
|
3657
3578
|
}, carouselContent))));
|
|
3658
3579
|
}
|
|
3659
|
-
|
|
3660
3580
|
function Testimonials({
|
|
3661
3581
|
sectionData
|
|
3662
3582
|
}) {
|
|
@@ -3721,7 +3641,6 @@ const loaderStyle = theme => ({
|
|
|
3721
3641
|
});
|
|
3722
3642
|
|
|
3723
3643
|
const useStyles = createUseStyles$1(loaderStyle);
|
|
3724
|
-
|
|
3725
3644
|
function Loader({
|
|
3726
3645
|
texts
|
|
3727
3646
|
}) {
|
|
@@ -3733,13 +3652,11 @@ function Loader({
|
|
|
3733
3652
|
useEffect(() => {
|
|
3734
3653
|
if (texts && texts.length) {
|
|
3735
3654
|
let textID = '';
|
|
3736
|
-
|
|
3737
3655
|
for (let i = 0; i < texts.length; i++) {
|
|
3738
3656
|
textID = setTimeout(() => {
|
|
3739
3657
|
setLoaderText(texts[i]);
|
|
3740
3658
|
}, 2000 * i);
|
|
3741
3659
|
}
|
|
3742
|
-
|
|
3743
3660
|
return () => {
|
|
3744
3661
|
clearTimeout(textID);
|
|
3745
3662
|
};
|
|
@@ -3807,18 +3724,15 @@ function VideoPlayer(props) {
|
|
|
3807
3724
|
imageUrl: imageUrl
|
|
3808
3725
|
});
|
|
3809
3726
|
const theme = useTheme();
|
|
3810
|
-
|
|
3811
3727
|
function getId(url) {
|
|
3812
3728
|
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
|
|
3813
3729
|
var match = url?.match(regExp);
|
|
3814
|
-
|
|
3815
3730
|
if (match?.[2].length == 11) {
|
|
3816
3731
|
return 'https://www.youtube.com/embed/' + match[2];
|
|
3817
3732
|
} else {
|
|
3818
3733
|
return url;
|
|
3819
3734
|
}
|
|
3820
3735
|
}
|
|
3821
|
-
|
|
3822
3736
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoaded && /*#__PURE__*/React.createElement("div", {
|
|
3823
3737
|
className: classes.imgContainer
|
|
3824
3738
|
}, isEnabled ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, props.onlyThumbnail ? null : /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -4661,8 +4575,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
4661
4575
|
width: 'calc(100% - 2px)',
|
|
4662
4576
|
position: 'relative',
|
|
4663
4577
|
paddingBottom: '59.83%' // keeping aspect ratio 585x350
|
|
4664
|
-
|
|
4665
4578
|
},
|
|
4579
|
+
|
|
4666
4580
|
contentRow: {
|
|
4667
4581
|
display: 'grid',
|
|
4668
4582
|
gridTemplateColumns: ({
|
|
@@ -4921,7 +4835,6 @@ const FAQListing = ({
|
|
|
4921
4835
|
isSelected: selectedIndex === index
|
|
4922
4836
|
})))));
|
|
4923
4837
|
};
|
|
4924
|
-
|
|
4925
4838
|
const Accordion = ({
|
|
4926
4839
|
item,
|
|
4927
4840
|
isSelected,
|
|
@@ -5206,9 +5119,10 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5206
5119
|
flexGrow: 1,
|
|
5207
5120
|
display: 'flex',
|
|
5208
5121
|
flexDirection: 'column',
|
|
5209
|
-
justifyContent: 'space-between'
|
|
5210
|
-
|
|
5122
|
+
justifyContent: 'space-between'
|
|
5123
|
+
//alignItems: 'center',
|
|
5211
5124
|
},
|
|
5125
|
+
|
|
5212
5126
|
courseCardTags: {
|
|
5213
5127
|
display: 'flex',
|
|
5214
5128
|
justifyContent: 'flex-start',
|
|
@@ -5234,11 +5148,12 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5234
5148
|
wordBreak: 'break-word',
|
|
5235
5149
|
padding: '12px 0px',
|
|
5236
5150
|
textAlign: 'left',
|
|
5237
|
-
display: 'inline-block'
|
|
5151
|
+
display: 'inline-block'
|
|
5152
|
+
// overflow: 'hidden',
|
|
5238
5153
|
// whiteSpace: 'nowrap',
|
|
5239
5154
|
// textOverflow: 'ellipsis'
|
|
5240
|
-
|
|
5241
5155
|
},
|
|
5156
|
+
|
|
5242
5157
|
courseCardDiscount: {
|
|
5243
5158
|
display: 'flex',
|
|
5244
5159
|
justifyContent: 'flex-start',
|
|
@@ -5320,7 +5235,8 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5320
5235
|
}
|
|
5321
5236
|
},
|
|
5322
5237
|
'@media (max-width: 768px)': {
|
|
5323
|
-
coursesContainer: {
|
|
5238
|
+
coursesContainer: {
|
|
5239
|
+
//background: theme?.palette?.background?.primary
|
|
5324
5240
|
},
|
|
5325
5241
|
coursesCardAndText: {
|
|
5326
5242
|
padding: '70px 30px'
|
|
@@ -5352,7 +5268,6 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5352
5268
|
if (!hashToken) {
|
|
5353
5269
|
throw 'Missing hash token';
|
|
5354
5270
|
}
|
|
5355
|
-
|
|
5356
5271
|
const res = await axios({
|
|
5357
5272
|
method: 'get',
|
|
5358
5273
|
baseURL: baseURLs?.API_COURSE_URL,
|
|
@@ -5364,7 +5279,6 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5364
5279
|
requiredFilters: '[10]'
|
|
5365
5280
|
}
|
|
5366
5281
|
});
|
|
5367
|
-
|
|
5368
5282
|
if (res) {
|
|
5369
5283
|
return res.data;
|
|
5370
5284
|
}
|
|
@@ -5376,7 +5290,6 @@ function getShortenedSubstring(name, length, allowDots = true) {
|
|
|
5376
5290
|
if (name) {
|
|
5377
5291
|
return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
|
|
5378
5292
|
}
|
|
5379
|
-
|
|
5380
5293
|
return '';
|
|
5381
5294
|
}
|
|
5382
5295
|
|
|
@@ -5456,13 +5369,11 @@ function courses({
|
|
|
5456
5369
|
containerWidth
|
|
5457
5370
|
});
|
|
5458
5371
|
const [nodeData] = sectionData?.components;
|
|
5459
|
-
|
|
5460
5372
|
const handleApiCall = () => {
|
|
5461
5373
|
if (baseURLs) {
|
|
5462
5374
|
getCourseList(baseURLs, hashToken).then(response => {
|
|
5463
5375
|
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5464
5376
|
const coursesData = response?.data?.coursesData;
|
|
5465
|
-
|
|
5466
5377
|
if (coursesData && coursesData.length) {
|
|
5467
5378
|
setCardList(response?.data?.coursesData);
|
|
5468
5379
|
setShowShimmer(false);
|
|
@@ -5473,12 +5384,12 @@ function courses({
|
|
|
5473
5384
|
setShowShimmer(false);
|
|
5474
5385
|
setFallbackImages(placeholders);
|
|
5475
5386
|
}
|
|
5476
|
-
}
|
|
5387
|
+
}
|
|
5388
|
+
// For User Website & Draft Preview: If no data found, hide section.
|
|
5477
5389
|
else setErrored(true);
|
|
5478
5390
|
}
|
|
5479
5391
|
}).catch(err => {
|
|
5480
5392
|
const errMsg = err?.response?.data?.data?.message;
|
|
5481
|
-
|
|
5482
5393
|
if (errMsg === 'NOT_FOUND') {
|
|
5483
5394
|
if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
|
|
5484
5395
|
setShowShimmer(false);
|
|
@@ -5490,16 +5401,16 @@ function courses({
|
|
|
5490
5401
|
});
|
|
5491
5402
|
}
|
|
5492
5403
|
};
|
|
5493
|
-
|
|
5494
5404
|
useEffect(() => {
|
|
5495
|
-
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5496
|
-
|
|
5405
|
+
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5406
|
+
// For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
|
|
5497
5407
|
if (isMasterTemplate) {
|
|
5498
5408
|
if (placeholders && placeholders.length) {
|
|
5499
5409
|
setShowShimmer(false);
|
|
5500
5410
|
setFallbackImages(placeholders);
|
|
5501
5411
|
}
|
|
5502
|
-
}
|
|
5412
|
+
}
|
|
5413
|
+
// other
|
|
5503
5414
|
else {
|
|
5504
5415
|
handleApiCall();
|
|
5505
5416
|
}
|
|
@@ -5564,7 +5475,6 @@ function courses({
|
|
|
5564
5475
|
});
|
|
5565
5476
|
})))));
|
|
5566
5477
|
}
|
|
5567
|
-
|
|
5568
5478
|
function SimpleCardsContainer({
|
|
5569
5479
|
children,
|
|
5570
5480
|
classes
|
|
@@ -5980,7 +5890,6 @@ function FormEnquiry({
|
|
|
5980
5890
|
setBtnDisabled(true);
|
|
5981
5891
|
}
|
|
5982
5892
|
}, [validData]);
|
|
5983
|
-
|
|
5984
5893
|
const handleSubmit = () => {
|
|
5985
5894
|
let data = {
|
|
5986
5895
|
sectionId: sectionData?._id || null,
|
|
@@ -5991,23 +5900,22 @@ function FormEnquiry({
|
|
|
5991
5900
|
setBtnDisabled(true);
|
|
5992
5901
|
setInputVal(formInitialValue);
|
|
5993
5902
|
};
|
|
5994
|
-
|
|
5995
5903
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
5996
5904
|
if (validations?.[regexField]?.length) {
|
|
5997
5905
|
let regex = new RegExp(validations[regexField]);
|
|
5998
|
-
|
|
5999
5906
|
if (regex?.test(inputVal[fieldname])) {
|
|
6000
|
-
setValidData({
|
|
5907
|
+
setValidData({
|
|
5908
|
+
...validData,
|
|
6001
5909
|
[fieldValidity]: 1
|
|
6002
5910
|
});
|
|
6003
5911
|
} else {
|
|
6004
|
-
setValidData({
|
|
5912
|
+
setValidData({
|
|
5913
|
+
...validData,
|
|
6005
5914
|
[fieldValidity]: 0
|
|
6006
5915
|
});
|
|
6007
5916
|
}
|
|
6008
5917
|
}
|
|
6009
5918
|
};
|
|
6010
|
-
|
|
6011
5919
|
return /*#__PURE__*/React.createElement("section", {
|
|
6012
5920
|
className: classes.section
|
|
6013
5921
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -6087,7 +5995,8 @@ function FormEnquiry({
|
|
|
6087
5995
|
isValid: validData.nameValid,
|
|
6088
5996
|
inputType: 'input',
|
|
6089
5997
|
onChange: e => {
|
|
6090
|
-
setInputVal({
|
|
5998
|
+
setInputVal({
|
|
5999
|
+
...inputVal,
|
|
6091
6000
|
name: e.target.value
|
|
6092
6001
|
});
|
|
6093
6002
|
},
|
|
@@ -6095,7 +6004,8 @@ function FormEnquiry({
|
|
|
6095
6004
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6096
6005
|
},
|
|
6097
6006
|
onFocus: () => {
|
|
6098
|
-
setValidData({
|
|
6007
|
+
setValidData({
|
|
6008
|
+
...validData,
|
|
6099
6009
|
nameValid: 1
|
|
6100
6010
|
});
|
|
6101
6011
|
}
|
|
@@ -6107,7 +6017,8 @@ function FormEnquiry({
|
|
|
6107
6017
|
isValid: validData.phoneValid,
|
|
6108
6018
|
inputType: 'input',
|
|
6109
6019
|
onChange: e => {
|
|
6110
|
-
setInputVal({
|
|
6020
|
+
setInputVal({
|
|
6021
|
+
...inputVal,
|
|
6111
6022
|
phone: e.target.value
|
|
6112
6023
|
});
|
|
6113
6024
|
},
|
|
@@ -6115,7 +6026,8 @@ function FormEnquiry({
|
|
|
6115
6026
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6116
6027
|
},
|
|
6117
6028
|
onFocus: () => {
|
|
6118
|
-
setValidData({
|
|
6029
|
+
setValidData({
|
|
6030
|
+
...validData,
|
|
6119
6031
|
phoneValid: 1
|
|
6120
6032
|
});
|
|
6121
6033
|
}
|
|
@@ -6127,7 +6039,8 @@ function FormEnquiry({
|
|
|
6127
6039
|
isValid: validData.emailValid,
|
|
6128
6040
|
inputType: 'input',
|
|
6129
6041
|
onChange: e => {
|
|
6130
|
-
setInputVal({
|
|
6042
|
+
setInputVal({
|
|
6043
|
+
...inputVal,
|
|
6131
6044
|
email: e.target.value
|
|
6132
6045
|
});
|
|
6133
6046
|
},
|
|
@@ -6135,7 +6048,8 @@ function FormEnquiry({
|
|
|
6135
6048
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6136
6049
|
},
|
|
6137
6050
|
onFocus: () => {
|
|
6138
|
-
setValidData({
|
|
6051
|
+
setValidData({
|
|
6052
|
+
...validData,
|
|
6139
6053
|
emailValid: 1
|
|
6140
6054
|
});
|
|
6141
6055
|
}
|
|
@@ -6147,7 +6061,8 @@ function FormEnquiry({
|
|
|
6147
6061
|
isValid: validData.messageValid,
|
|
6148
6062
|
inputType: 'textarea',
|
|
6149
6063
|
onChange: e => {
|
|
6150
|
-
setInputVal({
|
|
6064
|
+
setInputVal({
|
|
6065
|
+
...inputVal,
|
|
6151
6066
|
message: e.target.value
|
|
6152
6067
|
});
|
|
6153
6068
|
},
|
|
@@ -6155,7 +6070,8 @@ function FormEnquiry({
|
|
|
6155
6070
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6156
6071
|
},
|
|
6157
6072
|
onFocus: () => {
|
|
6158
|
-
setValidData({
|
|
6073
|
+
setValidData({
|
|
6074
|
+
...validData,
|
|
6159
6075
|
messageValid: 1
|
|
6160
6076
|
});
|
|
6161
6077
|
}
|
|
@@ -6386,7 +6302,6 @@ function Contact({
|
|
|
6386
6302
|
phoneValid: 1,
|
|
6387
6303
|
messageValid: 1
|
|
6388
6304
|
});
|
|
6389
|
-
|
|
6390
6305
|
const handleSubmit = () => {
|
|
6391
6306
|
const data = {
|
|
6392
6307
|
sectionId: sectionData?._id || null,
|
|
@@ -6397,7 +6312,6 @@ function Contact({
|
|
|
6397
6312
|
setBtnDisabled(true);
|
|
6398
6313
|
setInputVal(formInitialValue);
|
|
6399
6314
|
};
|
|
6400
|
-
|
|
6401
6315
|
useEffect(() => {
|
|
6402
6316
|
if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
|
|
6403
6317
|
setBtnDisabled(false);
|
|
@@ -6405,23 +6319,22 @@ function Contact({
|
|
|
6405
6319
|
setBtnDisabled(true);
|
|
6406
6320
|
}
|
|
6407
6321
|
}, [validData]);
|
|
6408
|
-
|
|
6409
6322
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
6410
6323
|
if (validations?.[regexField]?.length) {
|
|
6411
6324
|
let regex = new RegExp(validations[regexField]);
|
|
6412
|
-
|
|
6413
6325
|
if (regex?.test(inputVal[fieldname])) {
|
|
6414
|
-
setValidData({
|
|
6326
|
+
setValidData({
|
|
6327
|
+
...validData,
|
|
6415
6328
|
[fieldValidity]: 1
|
|
6416
6329
|
});
|
|
6417
6330
|
} else {
|
|
6418
|
-
setValidData({
|
|
6331
|
+
setValidData({
|
|
6332
|
+
...validData,
|
|
6419
6333
|
[fieldValidity]: 0
|
|
6420
6334
|
});
|
|
6421
6335
|
}
|
|
6422
6336
|
}
|
|
6423
6337
|
};
|
|
6424
|
-
|
|
6425
6338
|
return /*#__PURE__*/React.createElement("section", {
|
|
6426
6339
|
className: classes.section
|
|
6427
6340
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -6463,7 +6376,8 @@ function Contact({
|
|
|
6463
6376
|
isValid: validData.nameValid,
|
|
6464
6377
|
inputType: 'input',
|
|
6465
6378
|
onChange: e => {
|
|
6466
|
-
setInputVal({
|
|
6379
|
+
setInputVal({
|
|
6380
|
+
...inputVal,
|
|
6467
6381
|
name: e.target.value
|
|
6468
6382
|
});
|
|
6469
6383
|
},
|
|
@@ -6471,7 +6385,8 @@ function Contact({
|
|
|
6471
6385
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6472
6386
|
},
|
|
6473
6387
|
onFocus: () => {
|
|
6474
|
-
setValidData({
|
|
6388
|
+
setValidData({
|
|
6389
|
+
...validData,
|
|
6475
6390
|
nameValid: 1
|
|
6476
6391
|
});
|
|
6477
6392
|
}
|
|
@@ -6483,7 +6398,8 @@ function Contact({
|
|
|
6483
6398
|
isValid: validData.phoneValid,
|
|
6484
6399
|
inputType: 'input',
|
|
6485
6400
|
onChange: e => {
|
|
6486
|
-
setInputVal({
|
|
6401
|
+
setInputVal({
|
|
6402
|
+
...inputVal,
|
|
6487
6403
|
phone: e.target.value
|
|
6488
6404
|
});
|
|
6489
6405
|
},
|
|
@@ -6491,7 +6407,8 @@ function Contact({
|
|
|
6491
6407
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6492
6408
|
},
|
|
6493
6409
|
onFocus: () => {
|
|
6494
|
-
setValidData({
|
|
6410
|
+
setValidData({
|
|
6411
|
+
...validData,
|
|
6495
6412
|
phoneValid: 1
|
|
6496
6413
|
});
|
|
6497
6414
|
}
|
|
@@ -6503,7 +6420,8 @@ function Contact({
|
|
|
6503
6420
|
isValid: validData.emailValid,
|
|
6504
6421
|
inputType: 'input',
|
|
6505
6422
|
onChange: e => {
|
|
6506
|
-
setInputVal({
|
|
6423
|
+
setInputVal({
|
|
6424
|
+
...inputVal,
|
|
6507
6425
|
email: e.target.value
|
|
6508
6426
|
});
|
|
6509
6427
|
},
|
|
@@ -6511,7 +6429,8 @@ function Contact({
|
|
|
6511
6429
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6512
6430
|
},
|
|
6513
6431
|
onFocus: () => {
|
|
6514
|
-
setValidData({
|
|
6432
|
+
setValidData({
|
|
6433
|
+
...validData,
|
|
6515
6434
|
emailValid: 1
|
|
6516
6435
|
});
|
|
6517
6436
|
}
|
|
@@ -6523,7 +6442,8 @@ function Contact({
|
|
|
6523
6442
|
isValid: validData.messageValid,
|
|
6524
6443
|
inputType: 'textarea',
|
|
6525
6444
|
onChange: e => {
|
|
6526
|
-
setInputVal({
|
|
6445
|
+
setInputVal({
|
|
6446
|
+
...inputVal,
|
|
6527
6447
|
message: e.target.value
|
|
6528
6448
|
});
|
|
6529
6449
|
},
|
|
@@ -6531,7 +6451,8 @@ function Contact({
|
|
|
6531
6451
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6532
6452
|
},
|
|
6533
6453
|
onFocus: () => {
|
|
6534
|
-
setValidData({
|
|
6454
|
+
setValidData({
|
|
6455
|
+
...validData,
|
|
6535
6456
|
messageValid: 1
|
|
6536
6457
|
});
|
|
6537
6458
|
}
|
|
@@ -6792,7 +6713,8 @@ const useWebinarPromotionPage = createUseStyles(theme => {
|
|
|
6792
6713
|
const SingleVideoSlide$1 = props => {
|
|
6793
6714
|
const [isReadMore, setIsReadMore] = useState(false);
|
|
6794
6715
|
const theme = useTheme();
|
|
6795
|
-
useEffect(() => {
|
|
6716
|
+
useEffect(() => {
|
|
6717
|
+
// remaining days epoch
|
|
6796
6718
|
// current date epoch
|
|
6797
6719
|
// subtract remaining days from current day epoch
|
|
6798
6720
|
// moment the result - and see if there are days
|
|
@@ -6804,7 +6726,6 @@ const SingleVideoSlide$1 = props => {
|
|
|
6804
6726
|
webinarCtaClick,
|
|
6805
6727
|
conversions = 0
|
|
6806
6728
|
} = props;
|
|
6807
|
-
|
|
6808
6729
|
const renderer = ({
|
|
6809
6730
|
days,
|
|
6810
6731
|
hours,
|
|
@@ -6820,9 +6741,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6820
6741
|
return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
|
|
6821
6742
|
}
|
|
6822
6743
|
};
|
|
6823
|
-
|
|
6824
6744
|
const checkIfOfferIsValid = () => moment().diff(moment(props.data.offerPriceEndDate)) < 0;
|
|
6825
|
-
|
|
6826
6745
|
const checkForShowDiscount = () => {
|
|
6827
6746
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
6828
6747
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -6834,19 +6753,16 @@ const SingleVideoSlide$1 = props => {
|
|
|
6834
6753
|
if (data.offerPriceValidFor <= conversions) {
|
|
6835
6754
|
return false;
|
|
6836
6755
|
}
|
|
6837
|
-
|
|
6838
6756
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
6839
6757
|
return false;
|
|
6840
6758
|
} else {
|
|
6841
6759
|
return true;
|
|
6842
6760
|
}
|
|
6843
6761
|
}
|
|
6844
|
-
|
|
6845
6762
|
if (data.discount > 0) {
|
|
6846
6763
|
return true;
|
|
6847
6764
|
}
|
|
6848
6765
|
};
|
|
6849
|
-
|
|
6850
6766
|
const discount = ({
|
|
6851
6767
|
price,
|
|
6852
6768
|
discount
|
|
@@ -6854,7 +6770,6 @@ const SingleVideoSlide$1 = props => {
|
|
|
6854
6770
|
console.log('discountxx', props.data.price, props.data.discount);
|
|
6855
6771
|
return (discount / price * 100).toFixed(2);
|
|
6856
6772
|
};
|
|
6857
|
-
|
|
6858
6773
|
const classes = useWebinarPromotionPage();
|
|
6859
6774
|
return /*#__PURE__*/React.createElement("div", {
|
|
6860
6775
|
className: classes.videoCarouselContainer
|
|
@@ -6866,7 +6781,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6866
6781
|
className: classes.videoDetails
|
|
6867
6782
|
}, data?.isPaid !== 0 && (checkIfOfferIsValid() || data.offerPriceValidFor > 0) && data.offerPriceValidFor > conversions && /*#__PURE__*/React.createElement("div", null, data.offerPriceValidFor - conversions > 0 && data.discount && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) ? /*#__PURE__*/React.createElement("h3", {
|
|
6868
6783
|
className: classes.bannerContainer
|
|
6869
|
-
}, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions,
|
|
6784
|
+
}, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions, ' ', data.offerPriceValidFor - conversions > 1 ? 'users now' : 'user only') : checkIfOfferIsValid() && /*#__PURE__*/React.createElement("h3", {
|
|
6870
6785
|
className: classes.bannerContainer
|
|
6871
6786
|
}, "Hurry up! Offer for limited period only")), /*#__PURE__*/React.createElement("h3", {
|
|
6872
6787
|
ref: data?.videoTextHeading?.refSetter,
|
|
@@ -6950,9 +6865,10 @@ const SingleVideoSlide$1 = props => {
|
|
|
6950
6865
|
data: {
|
|
6951
6866
|
// link: 'headerData?.loginCtaLink',
|
|
6952
6867
|
// isLink: 1,
|
|
6953
|
-
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
6954
|
-
|
|
6868
|
+
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
6869
|
+
// isExternal: 1
|
|
6955
6870
|
},
|
|
6871
|
+
|
|
6956
6872
|
onClick: webinarCtaClick,
|
|
6957
6873
|
type: 'primary',
|
|
6958
6874
|
size: 'medium',
|
|
@@ -7286,14 +7202,14 @@ const SingleVideoSlide = props => {
|
|
|
7286
7202
|
isEdit
|
|
7287
7203
|
} = useContext(PageContext);
|
|
7288
7204
|
console.log(isEdit, 'isEdit');
|
|
7289
|
-
useEffect(() => {
|
|
7205
|
+
useEffect(() => {
|
|
7206
|
+
// remaining days epoch
|
|
7290
7207
|
// current date epoch
|
|
7291
7208
|
// subtract remaining days from current day epoch
|
|
7292
7209
|
// moment the result - and see if there are days
|
|
7293
7210
|
// days is present show days
|
|
7294
7211
|
// else start reverse timer
|
|
7295
7212
|
}, []);
|
|
7296
|
-
|
|
7297
7213
|
const renderer = ({
|
|
7298
7214
|
days,
|
|
7299
7215
|
hours,
|
|
@@ -7309,7 +7225,6 @@ const SingleVideoSlide = props => {
|
|
|
7309
7225
|
return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
|
|
7310
7226
|
}
|
|
7311
7227
|
};
|
|
7312
|
-
|
|
7313
7228
|
const {
|
|
7314
7229
|
data,
|
|
7315
7230
|
courseBuyNow,
|
|
@@ -7318,9 +7233,7 @@ const SingleVideoSlide = props => {
|
|
|
7318
7233
|
} = props;
|
|
7319
7234
|
const showCourseInstallmentData = data?.courseOverviewData;
|
|
7320
7235
|
const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
|
|
7321
|
-
|
|
7322
7236
|
const checkIfOfferIsValid = () => moment().diff(moment(props?.data?.endDate || 0)) < 0;
|
|
7323
|
-
|
|
7324
7237
|
const checkForShowDiscount = () => {
|
|
7325
7238
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
7326
7239
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -7332,28 +7245,23 @@ const SingleVideoSlide = props => {
|
|
|
7332
7245
|
if (data.offerPriceValidFor <= conversions) {
|
|
7333
7246
|
return false;
|
|
7334
7247
|
}
|
|
7335
|
-
|
|
7336
7248
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
7337
7249
|
return false;
|
|
7338
7250
|
} else {
|
|
7339
7251
|
return true;
|
|
7340
7252
|
}
|
|
7341
7253
|
}
|
|
7342
|
-
|
|
7343
7254
|
if (data.discount > 0) {
|
|
7344
7255
|
return true;
|
|
7345
7256
|
}
|
|
7346
7257
|
};
|
|
7347
|
-
|
|
7348
7258
|
const classes = useCoursePromotionPage();
|
|
7349
|
-
|
|
7350
7259
|
const discount = ({
|
|
7351
7260
|
price,
|
|
7352
7261
|
discount
|
|
7353
7262
|
}) => {
|
|
7354
7263
|
return (discount / price * 100).toFixed(2);
|
|
7355
7264
|
};
|
|
7356
|
-
|
|
7357
7265
|
return /*#__PURE__*/React.createElement("div", {
|
|
7358
7266
|
className: classes.videoCarouselContainer
|
|
7359
7267
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7467,15 +7375,16 @@ const SingleVideoSlide = props => {
|
|
|
7467
7375
|
data: {
|
|
7468
7376
|
// link: 'headerData?.loginCtaLink',
|
|
7469
7377
|
// isLink: 1,
|
|
7470
|
-
value: 'BUY NOW'
|
|
7471
|
-
|
|
7378
|
+
value: 'BUY NOW'
|
|
7379
|
+
// isExternal: 1
|
|
7472
7380
|
},
|
|
7381
|
+
|
|
7473
7382
|
onClick: courseBuyNow,
|
|
7474
7383
|
type: 'primary',
|
|
7475
7384
|
size: 'medium',
|
|
7476
7385
|
target: null,
|
|
7477
|
-
rel: null
|
|
7478
|
-
|
|
7386
|
+
rel: null
|
|
7387
|
+
// styling={isMobile ? { margin: '0 40px' } : {}}
|
|
7479
7388
|
})))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React.createElement("div", {
|
|
7480
7389
|
className: classes.payInstallmentContainer,
|
|
7481
7390
|
onClick: showCourseInstallment
|
|
@@ -7680,18 +7589,15 @@ const FormPage = ({
|
|
|
7680
7589
|
_id,
|
|
7681
7590
|
baseURLs
|
|
7682
7591
|
} = useContext(PageContext);
|
|
7683
|
-
|
|
7684
7592
|
const handleSubmit = async e => {
|
|
7685
7593
|
e.preventDefault();
|
|
7686
7594
|
let formResponse = [];
|
|
7687
|
-
|
|
7688
7595
|
for (const [key, value] of Object.entries(formData)) {
|
|
7689
7596
|
if (value.questionType === 'MC') {
|
|
7690
7597
|
if (value.solutionArray.length > 1) {
|
|
7691
7598
|
value.solutionArray.shift();
|
|
7692
7599
|
}
|
|
7693
7600
|
}
|
|
7694
|
-
|
|
7695
7601
|
formResponse.push({
|
|
7696
7602
|
questionId: key,
|
|
7697
7603
|
questionName: value.questionName,
|
|
@@ -7699,7 +7605,6 @@ const FormPage = ({
|
|
|
7699
7605
|
solutionArray: value.solutionArray
|
|
7700
7606
|
});
|
|
7701
7607
|
}
|
|
7702
|
-
|
|
7703
7608
|
const data = {
|
|
7704
7609
|
sectionId: sectionData?.components?.[0]?._id || null,
|
|
7705
7610
|
landingPageId: _id || null,
|
|
@@ -7709,7 +7614,6 @@ const FormPage = ({
|
|
|
7709
7614
|
setFormData({});
|
|
7710
7615
|
setformSubmitted(!formSubmitted);
|
|
7711
7616
|
};
|
|
7712
|
-
|
|
7713
7617
|
useEffect(() => {
|
|
7714
7618
|
//add all questions to formData
|
|
7715
7619
|
let formData = {};
|
|
@@ -7722,23 +7626,26 @@ const FormPage = ({
|
|
|
7722
7626
|
});
|
|
7723
7627
|
setFormData(formData);
|
|
7724
7628
|
}, [metadata, formSubmitted]);
|
|
7725
|
-
|
|
7726
7629
|
const handleOnClick = (e, item, option) => {
|
|
7727
7630
|
// if the checkbox is checked
|
|
7728
7631
|
if (!e.target.checked) {
|
|
7729
7632
|
// if the checkbox is checked and the solution array is empty
|
|
7730
7633
|
if (!formData[item._id]?.solutionArray?.length) {
|
|
7731
|
-
setFormData({
|
|
7634
|
+
setFormData({
|
|
7635
|
+
...formData,
|
|
7732
7636
|
[item._id]: {
|
|
7733
7637
|
questionName: item.text,
|
|
7734
7638
|
solutionArray: [option.value],
|
|
7735
7639
|
questionType: 'MC'
|
|
7736
7640
|
}
|
|
7737
7641
|
});
|
|
7738
|
-
}
|
|
7642
|
+
}
|
|
7643
|
+
// if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
|
|
7739
7644
|
else if (formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7740
7645
|
// if only one value is in the array remove it
|
|
7741
|
-
|
|
7646
|
+
|
|
7647
|
+
setFormData({
|
|
7648
|
+
...formData,
|
|
7742
7649
|
[item._id]: {
|
|
7743
7650
|
questionName: item.text,
|
|
7744
7651
|
solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
|
|
@@ -7746,20 +7653,24 @@ const FormPage = ({
|
|
|
7746
7653
|
}
|
|
7747
7654
|
});
|
|
7748
7655
|
}
|
|
7749
|
-
}
|
|
7656
|
+
}
|
|
7657
|
+
// if the checkbox is unchecked
|
|
7750
7658
|
else {
|
|
7751
7659
|
// if the checkbox is unchecked and the solution array is empty
|
|
7752
7660
|
if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
|
|
7753
|
-
setFormData({
|
|
7661
|
+
setFormData({
|
|
7662
|
+
...formData,
|
|
7754
7663
|
[item._id]: {
|
|
7755
7664
|
questionName: item.text,
|
|
7756
7665
|
solutionArray: [option.value],
|
|
7757
7666
|
questionType: 'MC'
|
|
7758
7667
|
}
|
|
7759
7668
|
});
|
|
7760
|
-
}
|
|
7669
|
+
}
|
|
7670
|
+
// if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
|
|
7761
7671
|
else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7762
|
-
setFormData({
|
|
7672
|
+
setFormData({
|
|
7673
|
+
...formData,
|
|
7763
7674
|
[item._id]: {
|
|
7764
7675
|
questionName: item.text,
|
|
7765
7676
|
solutionArray: [...formData[item._id]?.solutionArray, option.value],
|
|
@@ -7769,7 +7680,6 @@ const FormPage = ({
|
|
|
7769
7680
|
}
|
|
7770
7681
|
}
|
|
7771
7682
|
};
|
|
7772
|
-
|
|
7773
7683
|
return /*#__PURE__*/React.createElement("section", {
|
|
7774
7684
|
className: classes.formPageSection
|
|
7775
7685
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7796,7 +7706,8 @@ const FormPage = ({
|
|
|
7796
7706
|
placeholder: "Short answer",
|
|
7797
7707
|
name: item._id,
|
|
7798
7708
|
onChange: e => {
|
|
7799
|
-
setFormData({
|
|
7709
|
+
setFormData({
|
|
7710
|
+
...formData,
|
|
7800
7711
|
[item._id]: {
|
|
7801
7712
|
index,
|
|
7802
7713
|
questionName: item.text,
|
|
@@ -7836,11 +7747,13 @@ const FormPage = ({
|
|
|
7836
7747
|
name: "text",
|
|
7837
7748
|
required: item.isRequired,
|
|
7838
7749
|
value: option.value,
|
|
7839
|
-
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7750
|
+
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7751
|
+
// name={option.value}
|
|
7840
7752
|
// id={option.value}
|
|
7841
7753
|
,
|
|
7842
7754
|
onClick: e => {
|
|
7843
|
-
setFormData({
|
|
7755
|
+
setFormData({
|
|
7756
|
+
...formData,
|
|
7844
7757
|
[item._id]: {
|
|
7845
7758
|
questionName: item.text,
|
|
7846
7759
|
solutionArray: [option.value],
|
|
@@ -7856,9 +7769,10 @@ const FormPage = ({
|
|
|
7856
7769
|
data: {
|
|
7857
7770
|
// link: 'headerData?.loginCtaLink',
|
|
7858
7771
|
// isLink: 1,
|
|
7859
|
-
value: 'SUBMIT'
|
|
7860
|
-
|
|
7772
|
+
value: 'SUBMIT'
|
|
7773
|
+
// isExternal: 1
|
|
7861
7774
|
},
|
|
7775
|
+
|
|
7862
7776
|
type: 'primary',
|
|
7863
7777
|
size: 'medium',
|
|
7864
7778
|
target: null,
|
|
@@ -7952,7 +7866,6 @@ function Tiles({
|
|
|
7952
7866
|
const nodeData = sectionData.components;
|
|
7953
7867
|
console.log(nodeData);
|
|
7954
7868
|
const tilesList = nodeData[0]?.tilesList.components;
|
|
7955
|
-
|
|
7956
7869
|
const handleClick = value => {
|
|
7957
7870
|
if (!isEdit && value) {
|
|
7958
7871
|
if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
|
|
@@ -7962,7 +7875,6 @@ function Tiles({
|
|
|
7962
7875
|
}
|
|
7963
7876
|
}
|
|
7964
7877
|
};
|
|
7965
|
-
|
|
7966
7878
|
const TileDiv = tilesList?.map((tile, i) => {
|
|
7967
7879
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
7968
7880
|
key: i
|
|
@@ -8025,8 +7937,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8025
7937
|
width: 'auto',
|
|
8026
7938
|
height: '48px'
|
|
8027
7939
|
/* margin: 18px 0px; */
|
|
8028
|
-
|
|
8029
7940
|
},
|
|
7941
|
+
|
|
8030
7942
|
'p-young-guru-title': {
|
|
8031
7943
|
fontFamily: theme?.typography?.fontFamily,
|
|
8032
7944
|
fontStyle: 'normal',
|
|
@@ -8053,8 +7965,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8053
7965
|
fontSize: '0',
|
|
8054
7966
|
textAlign: 'center'
|
|
8055
7967
|
/* padding:35px 0 40px */
|
|
8056
|
-
|
|
8057
7968
|
},
|
|
7969
|
+
|
|
8058
7970
|
'two-columns .column': {
|
|
8059
7971
|
width: '100%',
|
|
8060
7972
|
maxWidth: '275px',
|
|
@@ -8070,9 +7982,10 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8070
7982
|
color: '#030a21',
|
|
8071
7983
|
marginBottom: '5px',
|
|
8072
7984
|
textAlign: 'left'
|
|
8073
|
-
}
|
|
8074
|
-
// }
|
|
7985
|
+
}
|
|
8075
7986
|
|
|
7987
|
+
// @media screen and (max-width: 600px) {
|
|
7988
|
+
// }
|
|
8076
7989
|
}));
|
|
8077
7990
|
|
|
8078
7991
|
function Section({
|
|
@@ -8101,8 +8014,8 @@ function Section({
|
|
|
8101
8014
|
}, /*#__PURE__*/React.createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React.createElement("div", {
|
|
8102
8015
|
className: classes.email_description_para,
|
|
8103
8016
|
dangerouslySetInnerHTML: {
|
|
8104
|
-
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8105
|
-
|
|
8017
|
+
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8018
|
+
// __html: '<div>sdnfksdnflksdnfklsndk</div>'
|
|
8106
8019
|
}
|
|
8107
8020
|
}) : /*#__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", {
|
|
8108
8021
|
style: {
|
|
@@ -8135,7 +8048,8 @@ function Section({
|
|
|
8135
8048
|
textAlign: 'center'
|
|
8136
8049
|
}
|
|
8137
8050
|
}, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React.createElement("img", {
|
|
8138
|
-
src: header?.components[1]?.metadata?.image
|
|
8051
|
+
src: header?.components[1]?.metadata?.image
|
|
8052
|
+
// width={600}
|
|
8139
8053
|
,
|
|
8140
8054
|
alt: "",
|
|
8141
8055
|
style: {
|
|
@@ -8418,14 +8332,12 @@ function Section({
|
|
|
8418
8332
|
}
|
|
8419
8333
|
}, "All rights reserved.")))))))))))))) : null)))));
|
|
8420
8334
|
}
|
|
8421
|
-
|
|
8422
8335
|
function EmailDripMarket({
|
|
8423
8336
|
sectionData,
|
|
8424
8337
|
extraProps = {}
|
|
8425
8338
|
}) {
|
|
8426
8339
|
console.log('extrapropstemplate', extraProps);
|
|
8427
8340
|
const isInitialMount = useRef(true);
|
|
8428
|
-
|
|
8429
8341
|
const convertToHtml = sectionData => {
|
|
8430
8342
|
const html = ReactDOMServer.renderToStaticMarkup( /*#__PURE__*/React.createElement(Section, {
|
|
8431
8343
|
nodeData: sectionData,
|
|
@@ -8435,15 +8347,15 @@ function EmailDripMarket({
|
|
|
8435
8347
|
}));
|
|
8436
8348
|
return html;
|
|
8437
8349
|
};
|
|
8438
|
-
|
|
8439
8350
|
useEffect(() => {
|
|
8440
8351
|
if (isInitialMount.current) {
|
|
8441
8352
|
isInitialMount.current = false;
|
|
8442
8353
|
} else {
|
|
8443
8354
|
extraProps?.callbackHtml(convertToHtml(sectionData));
|
|
8444
8355
|
}
|
|
8445
|
-
}, [extraProps?.convertedHtml]);
|
|
8356
|
+
}, [extraProps?.convertedHtml]);
|
|
8446
8357
|
|
|
8358
|
+
// const mockData = sectionData?.sections[0];
|
|
8447
8359
|
const emailRef = useRef(null);
|
|
8448
8360
|
return /*#__PURE__*/React.createElement("section", {
|
|
8449
8361
|
style: {
|
|
@@ -8453,7 +8365,6 @@ function EmailDripMarket({
|
|
|
8453
8365
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8454
8366
|
onClick: e => {
|
|
8455
8367
|
e.stopPropagation(); // prevent the click from event Capturing, in email onClick events do not work
|
|
8456
|
-
|
|
8457
8368
|
e.preventDefault();
|
|
8458
8369
|
}
|
|
8459
8370
|
}, /*#__PURE__*/React.createElement(Section, {
|
|
@@ -8492,9 +8403,7 @@ const TYPE_TO_COMPONENT_MAP = {
|
|
|
8492
8403
|
TILES_SECTION: Tiles,
|
|
8493
8404
|
EMAIL_DRIP_MARKET: EmailDripMarket
|
|
8494
8405
|
};
|
|
8495
|
-
|
|
8496
8406
|
const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
|
|
8497
|
-
|
|
8498
8407
|
const MemoisedSection = /*#__PURE__*/memo(({
|
|
8499
8408
|
sectionData,
|
|
8500
8409
|
extraProps
|
|
@@ -8607,11 +8516,9 @@ const componentParser = compObj => {
|
|
|
8607
8516
|
});
|
|
8608
8517
|
return component;
|
|
8609
8518
|
}
|
|
8610
|
-
|
|
8611
8519
|
if (Array.isArray(compObj.components)) {
|
|
8612
8520
|
compObj.components = compObj.components.map(componentParser);
|
|
8613
8521
|
}
|
|
8614
|
-
|
|
8615
8522
|
return compObj;
|
|
8616
8523
|
};
|
|
8617
8524
|
const inverseComponentParser = compObj => {
|
|
@@ -8636,7 +8543,6 @@ const inverseComponentParser = compObj => {
|
|
|
8636
8543
|
if (compObj.components) {
|
|
8637
8544
|
compObj.components = compObj.components.map(inverseComponentParser);
|
|
8638
8545
|
}
|
|
8639
|
-
|
|
8640
8546
|
return compObj;
|
|
8641
8547
|
}
|
|
8642
8548
|
};
|