diy-template-components 5.1.4 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.es.js CHANGED
@@ -881,7 +881,7 @@ const someMethod1 = (/** @type {import('./types').IconData["svgChildrenConfigs"]
881
881
  }
882
882
  return obj;
883
883
  };
884
- const useStyles$1 = createUseStyles$1({
884
+ const useStyles$2 = createUseStyles$1({
885
885
  '@keyframes slideRight': {
886
886
  to: {
887
887
  backgroundPosition: '1250% 0, 0 0'
@@ -959,7 +959,7 @@ const Icon = ({
959
959
  // this ref is used to cancel the fetch promise success callback in case name prop changed
960
960
  const currentName = useRef(name);
961
961
  const [svgState, setSvgState] = useState(defaultSvgState);
962
- const styles = useStyles$1({
962
+ const styles = useStyles$2({
963
963
  width,
964
964
  height,
965
965
  color,
@@ -2548,7 +2548,87 @@ function FontSeeder({
2548
2548
  return null;
2549
2549
  }
2550
2550
 
2551
- insertStyle("@charset \"UTF-8\";\n/* Wrapper: no height/min-height – height comes only from section content, not from HOC */\n.sectionBackgroundWrapper {\n position: relative;\n width: 100%;\n overflow: hidden;\n}\n\n/* Section root transparent so background (image/color/gradient/video) shows through */\n.sectionBackgroundWrapper > .sectionBackgroundContent > * {\n background: transparent !important;\n}\n\n/* Video: absolute so it does not affect wrapper height; height follows section */\n.sectionBackgroundVideo {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n z-index: 0;\n pointer-events: none;\n}\n\n/* YouTube embed: cover background, no UI interaction, minimal branding via URL params */\n.sectionBackgroundYoutube {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100vw;\n min-width: 100%;\n min-height: 100%;\n height: 56.25vw; /* 16:9 */\n min-height: 100vh;\n transform: translate(-50%, -50%);\n border: none;\n z-index: 0;\n pointer-events: none;\n}\n\n@media (min-aspect-ratio: 16/9) {\n .sectionBackgroundYoutube {\n width: 177.78vh;\n height: 100vh;\n min-width: 100%;\n min-height: 100%;\n }\n}\n/* Blur overlay: frosted glass so content stays readable over video/image/gradient */\n.sectionBackgroundBlur {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n pointer-events: none;\n /* backdrop-filter: blur(2px);\n -webkit-backdrop-filter: blur(2px); */\n /* background: rgba(255, 255, 255, 0.08); */\n}\n\n/* Content wrapper: above blur so component items are clear */\n.sectionBackgroundContent {\n position: relative;\n z-index: 2;\n}\n\n/* Background layer: fills wrapper only (absolute), does not affect wrapper height */\n.sectionBackgroundLayer {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 0;\n pointer-events: none;\n}\n\n.sectionBackgroundLayer.sectionBackgroundImage {\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n}");
2551
+ /**
2552
+ * JSS styles for section background wrapper (replaces styles.css).
2553
+ * Used with react-jss createUseStyles.
2554
+ */
2555
+ const sectionBackgroundStyles = () => ({
2556
+ /* Wrapper: no height/min-height – height comes only from section content */
2557
+ sectionBackgroundWrapper: {
2558
+ position: 'relative',
2559
+ width: '100%',
2560
+ overflow: 'hidden',
2561
+ '& > $sectionBackgroundContent > *': {
2562
+ background: 'transparent !important'
2563
+ }
2564
+ },
2565
+ /* Section root transparent so background (image/color/gradient/video) shows through */
2566
+ sectionBackgroundContent: {
2567
+ position: 'relative',
2568
+ zIndex: 2
2569
+ },
2570
+ /* Video: absolute so it does not affect wrapper height; height follows section */
2571
+ sectionBackgroundVideo: {
2572
+ position: 'absolute',
2573
+ top: 0,
2574
+ left: 0,
2575
+ width: '100%',
2576
+ height: '100%',
2577
+ objectFit: 'cover',
2578
+ zIndex: 0,
2579
+ pointerEvents: 'none'
2580
+ },
2581
+ /* YouTube embed: cover background, no UI interaction */
2582
+ sectionBackgroundYoutube: {
2583
+ position: 'absolute',
2584
+ top: '50%',
2585
+ left: '50%',
2586
+ width: '100vw',
2587
+ minWidth: '100%',
2588
+ minHeight: '100vh',
2589
+ height: '56.25vw' /* 16:9 */,
2590
+ transform: 'translate(-50%, -50%)',
2591
+ border: 'none',
2592
+ zIndex: 0,
2593
+ pointerEvents: 'none',
2594
+ '@media (min-aspect-ratio: 16/9)': {
2595
+ width: '177.78vh',
2596
+ height: '100vh',
2597
+ minWidth: '100%',
2598
+ minHeight: '100%'
2599
+ }
2600
+ },
2601
+ /* Blur overlay: frosted glass so content stays readable */
2602
+ sectionBackgroundBlur: {
2603
+ position: 'absolute',
2604
+ top: 0,
2605
+ left: 0,
2606
+ width: '100%',
2607
+ height: '100%',
2608
+ zIndex: 1,
2609
+ pointerEvents: 'none'
2610
+ },
2611
+ /* Background layer: fills wrapper only (absolute), does not affect wrapper height */
2612
+ sectionBackgroundLayer: {
2613
+ position: 'absolute',
2614
+ top: 0,
2615
+ left: 0,
2616
+ width: '100%',
2617
+ height: '100%',
2618
+ zIndex: 0,
2619
+ pointerEvents: 'none'
2620
+ },
2621
+ sectionBackgroundImage: {
2622
+ backgroundSize: 'cover',
2623
+ backgroundPosition: 'center',
2624
+ backgroundRepeat: 'no-repeat'
2625
+ },
2626
+ sectionBackgroundGradient: {
2627
+ /* inherits from sectionBackgroundLayer; gradient value comes from inline style */
2628
+ }
2629
+ });
2630
+
2631
+ const useStyles$1 = createUseStyles$1(sectionBackgroundStyles);
2552
2632
 
2553
2633
  /**
2554
2634
  * Extracts YouTube video ID from various YouTube URL formats.
@@ -2567,6 +2647,13 @@ function getYoutubeVideoId(url) {
2567
2647
  return null;
2568
2648
  }
2569
2649
 
2650
+ /**
2651
+ * Returns YouTube thumbnail URL for a video ID (used when app is in iframe and YouTube iframe won't play).
2652
+ */
2653
+ function getYoutubeThumbnailUrl(videoId) {
2654
+ return `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`;
2655
+ }
2656
+
2570
2657
  /**
2571
2658
  * Builds YouTube embed URL with params for background video:
2572
2659
  * autoplay, mute, loop (via playlist), no controls, minimal branding, no end-screen suggestions.
@@ -2610,10 +2697,13 @@ function withSectionBackground(WrappedSectionRenderer) {
2610
2697
  sectionIndex,
2611
2698
  ...restProps
2612
2699
  } = props;
2700
+ const {
2701
+ isMobile
2702
+ } = useContext(PageContext);
2703
+ const classes = useStyles$1();
2613
2704
 
2614
2705
  // Use props first, then fall back to sectionData so it works for all sections
2615
2706
  const componentBg = componentBgProp ?? {};
2616
- console.log('amit1111', componentBg, isSkipV2Section, sectionData);
2617
2707
 
2618
2708
  // version !== 2: skip background — render section only, no wrapper
2619
2709
 
@@ -2667,7 +2757,7 @@ function withSectionBackground(WrappedSectionRenderer) {
2667
2757
  return {};
2668
2758
  }
2669
2759
  };
2670
- const layerClassName = type === 'image' ? 'sectionBackgroundLayer sectionBackgroundImage' : type === 'gradient' ? 'sectionBackgroundLayer sectionBackgroundGradient' : 'sectionBackgroundLayer';
2760
+ const layerClassName = type === 'image' ? `${classes.sectionBackgroundLayer} ${classes.sectionBackgroundImage}` : type === 'gradient' ? `${classes.sectionBackgroundLayer} ${classes.sectionBackgroundGradient}` : classes.sectionBackgroundLayer;
2671
2761
 
2672
2762
  // Video background: YouTube embed (when isYoutube/isYoutubeVideo) or normal <video> from url
2673
2763
  if (type === 'video') {
@@ -2676,9 +2766,9 @@ function withSectionBackground(WrappedSectionRenderer) {
2676
2766
  if (!videoId) {
2677
2767
  // Fallback to normal video if we can't parse YouTube ID
2678
2768
  return /*#__PURE__*/React.createElement("div", {
2679
- className: "sectionBackgroundWrapper"
2769
+ className: classes.sectionBackgroundWrapper
2680
2770
  }, /*#__PURE__*/React.createElement("video", {
2681
- className: "sectionBackgroundVideo",
2771
+ className: classes.sectionBackgroundVideo,
2682
2772
  src: value,
2683
2773
  autoPlay: true,
2684
2774
  muted: true,
@@ -2686,10 +2776,33 @@ function withSectionBackground(WrappedSectionRenderer) {
2686
2776
  playsInline: true,
2687
2777
  "aria-hidden": "true"
2688
2778
  }), /*#__PURE__*/React.createElement("div", {
2689
- className: "sectionBackgroundBlur",
2779
+ className: classes.sectionBackgroundBlur,
2690
2780
  "aria-hidden": "true"
2691
2781
  }), /*#__PURE__*/React.createElement("div", {
2692
- className: "sectionBackgroundContent"
2782
+ className: classes.sectionBackgroundContent
2783
+ }, /*#__PURE__*/React.createElement(WrappedSectionRenderer, _extends({
2784
+ sectionData: sectionData,
2785
+ extraProps: extraProps,
2786
+ sectionIndex: sectionIndex
2787
+ }, restProps))));
2788
+ }
2789
+ // When isMobile is true, app is rendered inside an iframe; YouTube iframe often fails in nested iframes.
2790
+ // Use static YouTube thumbnail as background instead of the YouTube player.
2791
+ if (isMobile) {
2792
+ const thumbUrl = getYoutubeThumbnailUrl(videoId);
2793
+ return /*#__PURE__*/React.createElement("div", {
2794
+ className: classes.sectionBackgroundWrapper
2795
+ }, /*#__PURE__*/React.createElement("div", {
2796
+ className: `${classes.sectionBackgroundLayer} ${classes.sectionBackgroundImage}`,
2797
+ style: {
2798
+ backgroundImage: `url(${thumbUrl})`
2799
+ },
2800
+ "aria-hidden": "true"
2801
+ }), /*#__PURE__*/React.createElement("div", {
2802
+ className: classes.sectionBackgroundBlur,
2803
+ "aria-hidden": "true"
2804
+ }), /*#__PURE__*/React.createElement("div", {
2805
+ className: classes.sectionBackgroundContent
2693
2806
  }, /*#__PURE__*/React.createElement(WrappedSectionRenderer, _extends({
2694
2807
  sectionData: sectionData,
2695
2808
  extraProps: extraProps,
@@ -2698,19 +2811,20 @@ function withSectionBackground(WrappedSectionRenderer) {
2698
2811
  }
2699
2812
  const embedUrl = getYoutubeEmbedUrl(videoId);
2700
2813
  return /*#__PURE__*/React.createElement("div", {
2701
- className: "sectionBackgroundWrapper"
2814
+ className: classes.sectionBackgroundWrapper
2702
2815
  }, /*#__PURE__*/React.createElement("iframe", {
2703
- className: "sectionBackgroundYoutube",
2816
+ className: classes.sectionBackgroundYoutube,
2704
2817
  src: embedUrl,
2705
2818
  title: "Background video",
2706
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope",
2819
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
2707
2820
  allowFullScreen: true,
2821
+ referrerPolicy: "strict-origin-when-cross-origin",
2708
2822
  "aria-hidden": "true"
2709
2823
  }), /*#__PURE__*/React.createElement("div", {
2710
- className: "sectionBackgroundBlur",
2824
+ className: classes.sectionBackgroundBlur,
2711
2825
  "aria-hidden": "true"
2712
2826
  }), /*#__PURE__*/React.createElement("div", {
2713
- className: "sectionBackgroundContent"
2827
+ className: classes.sectionBackgroundContent
2714
2828
  }, /*#__PURE__*/React.createElement(WrappedSectionRenderer, _extends({
2715
2829
  sectionData: sectionData,
2716
2830
  extraProps: extraProps,
@@ -2719,9 +2833,9 @@ function withSectionBackground(WrappedSectionRenderer) {
2719
2833
  }
2720
2834
  // Normal video from URL
2721
2835
  return /*#__PURE__*/React.createElement("div", {
2722
- className: "sectionBackgroundWrapper"
2836
+ className: classes.sectionBackgroundWrapper
2723
2837
  }, /*#__PURE__*/React.createElement("video", {
2724
- className: "sectionBackgroundVideo",
2838
+ className: classes.sectionBackgroundVideo,
2725
2839
  src: value,
2726
2840
  autoPlay: true,
2727
2841
  muted: true,
@@ -2729,10 +2843,10 @@ function withSectionBackground(WrappedSectionRenderer) {
2729
2843
  playsInline: true,
2730
2844
  "aria-hidden": "true"
2731
2845
  }), /*#__PURE__*/React.createElement("div", {
2732
- className: "sectionBackgroundBlur",
2846
+ className: classes.sectionBackgroundBlur,
2733
2847
  "aria-hidden": "true"
2734
2848
  }), /*#__PURE__*/React.createElement("div", {
2735
- className: "sectionBackgroundContent"
2849
+ className: classes.sectionBackgroundContent
2736
2850
  }, /*#__PURE__*/React.createElement(WrappedSectionRenderer, _extends({
2737
2851
  sectionData: sectionData,
2738
2852
  extraProps: extraProps,
@@ -2742,16 +2856,17 @@ function withSectionBackground(WrappedSectionRenderer) {
2742
2856
 
2743
2857
  // color | image | gradient: background layer behind content so section can be transparent
2744
2858
  return /*#__PURE__*/React.createElement("div", {
2745
- className: "sectionBackgroundWrapper"
2859
+ className: classes.sectionBackgroundWrapper,
2860
+ style: isMobile ? getLayerStyle() : {}
2746
2861
  }, /*#__PURE__*/React.createElement("div", {
2747
2862
  className: layerClassName,
2748
2863
  style: getLayerStyle(),
2749
2864
  "aria-hidden": "true"
2750
2865
  }), /*#__PURE__*/React.createElement("div", {
2751
- className: "sectionBackgroundBlur",
2866
+ className: classes.sectionBackgroundBlur,
2752
2867
  "aria-hidden": "true"
2753
2868
  }), /*#__PURE__*/React.createElement("div", {
2754
- className: "sectionBackgroundContent"
2869
+ className: classes.sectionBackgroundContent
2755
2870
  }, /*#__PURE__*/React.createElement(WrappedSectionRenderer, _extends({
2756
2871
  sectionData: sectionData,
2757
2872
  extraProps: extraProps,
@@ -5517,8 +5632,9 @@ function VideoPlayer(props) {
5517
5632
  className: classes.iframe + ' ' + classes.hideImg,
5518
5633
  src: imageUrl ? getId(videoUrl) + '?autoplay=1' : getId(videoUrl),
5519
5634
  frameBorder: "0",
5520
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
5635
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
5521
5636
  allowFullScreen: true,
5637
+ referrerPolicy: "strict-origin-when-cross-origin",
5522
5638
  onLoad: () => {
5523
5639
  setIsLoaded(true);
5524
5640
  }
@@ -11786,7 +11902,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11786
11902
  } = {}) => backgroundImage ? `url("${backgroundImage}")` : 'none',
11787
11903
  backgroundColor: ({
11788
11904
  backgroundColor
11789
- } = {}) => backgroundColor || '#f8f8fa',
11905
+ } = {}) => backgroundColor || theme?.colors?.background2,
11790
11906
  backgroundSize: 'cover',
11791
11907
  backgroundPosition: 'center',
11792
11908
  backgroundRepeat: 'no-repeat',
@@ -11807,7 +11923,8 @@ const useCounterSectionStyles = createUseStyles(theme => {
11807
11923
  },
11808
11924
  grid: {
11809
11925
  display: 'grid',
11810
- gridTemplateColumns: 'repeat(4, 1fr)',
11926
+ gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
11927
+ // fits 4 columns in desktop
11811
11928
  gap: ({
11812
11929
  isMobile
11813
11930
  } = {}) => isMobile ? '24px' : '32px',
@@ -11826,7 +11943,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11826
11943
  fontSize: '64px',
11827
11944
  fontWeight: theme.typography?.fontWeight?.bold,
11828
11945
  lineHeight: 1.1,
11829
- color: 'rgba(247, 37, 133, 1)' ,
11946
+ color: theme?.colors?.AccentColor,
11830
11947
  wordBreak: 'break-word'
11831
11948
  },
11832
11949
  description: {
@@ -11834,7 +11951,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11834
11951
  fontSize: '20px',
11835
11952
  lineHeight: 1.4,
11836
11953
  fontWeight: '700',
11837
- color: 'rgba(51, 51, 51, 1)' ,
11954
+ color: theme?.colors?.font3,
11838
11955
  wordBreak: 'break-word'
11839
11956
  },
11840
11957
  '@media (max-width: 1024px)': {
@@ -11864,6 +11981,83 @@ const useCounterSectionStyles = createUseStyles(theme => {
11864
11981
  };
11865
11982
  });
11866
11983
 
11984
+ const DURATION_MS = 2000;
11985
+ const EASING = t => 1 - Math.pow(1 - t, 3); // easeOutCubic
11986
+
11987
+ function parseCounterValue(value) {
11988
+ if (value == null || value === '') return null;
11989
+ const match = String(value).trim().match(/^([\d.]+)(.*)$/);
11990
+ if (!match) return null;
11991
+ const num = parseFloat(match[1]);
11992
+ if (Number.isNaN(num)) return null;
11993
+ return {
11994
+ end: num,
11995
+ suffix: match[2] || ''
11996
+ };
11997
+ }
11998
+ function AnimatedCounter({
11999
+ value,
12000
+ className,
12001
+ refSetter
12002
+ }) {
12003
+ const elRef = useRef(null);
12004
+ const rafIdRef = useRef(null);
12005
+ const hasAnimatedRef = useRef(false);
12006
+ useLayoutEffect(() => {
12007
+ hasAnimatedRef.current = false; // Reset so we can re-animate when value changes (e.g. live edit)
12008
+ const parsed = parseCounterValue(value);
12009
+ if (!parsed || !elRef.current) return;
12010
+ const observer = new IntersectionObserver(entries => {
12011
+ const [entry] = entries;
12012
+ if (!entry.isIntersecting || hasAnimatedRef.current) return;
12013
+ hasAnimatedRef.current = true;
12014
+ const startTime = performance.now();
12015
+ const {
12016
+ end,
12017
+ suffix
12018
+ } = parsed;
12019
+ const tick = now => {
12020
+ const elapsed = now - startTime;
12021
+ const progress = Math.min(elapsed / DURATION_MS, 1);
12022
+ const eased = EASING(progress);
12023
+ const current = eased * end;
12024
+ if (elRef.current) {
12025
+ const displayValue = Number.isInteger(end) ? Math.round(current) : parseFloat(current.toFixed(2));
12026
+ elRef.current.textContent = displayValue + suffix;
12027
+ }
12028
+ if (progress < 1) {
12029
+ rafIdRef.current = requestAnimationFrame(tick);
12030
+ }
12031
+ };
12032
+ rafIdRef.current = requestAnimationFrame(tick);
12033
+ }, {
12034
+ threshold: 0.2
12035
+ });
12036
+ observer.observe(elRef.current);
12037
+ return () => {
12038
+ observer.disconnect();
12039
+ if (rafIdRef.current) cancelAnimationFrame(rafIdRef.current);
12040
+ };
12041
+ }, [value]);
12042
+ const parsed = parseCounterValue(value);
12043
+ const setRef = el => {
12044
+ elRef.current = el;
12045
+ refSetter?.(el);
12046
+ };
12047
+ if (parsed) {
12048
+ return /*#__PURE__*/React.createElement("h2", {
12049
+ ref: setRef,
12050
+ className: className
12051
+ }, "0", parsed.suffix);
12052
+ }
12053
+ return /*#__PURE__*/React.createElement("h2", {
12054
+ ref: refSetter,
12055
+ className: className,
12056
+ dangerouslySetInnerHTML: {
12057
+ __html: value
12058
+ }
12059
+ });
12060
+ }
11867
12061
  function CounterSection({
11868
12062
  sectionData,
11869
12063
  sectionIndex
@@ -11874,44 +12068,49 @@ function CounterSection({
11874
12068
  },
11875
12069
  isMobile
11876
12070
  } = useContext(PageContext);
11877
- console.log('llll', sectionData);
11878
- sectionData.components = sectionData.components;
11879
12071
  const metadata = sectionData.metadata || {};
11880
12072
  const backgroundImage = metadata.backgroundImage || '';
11881
- const backgroundColor = metadata.backgroundColor || '#f8f8fa';
12073
+ const backgroundColor = metadata.backgroundColor;
11882
12074
  const classes = useCounterSectionStyles({
11883
12075
  containerWidth,
11884
12076
  isMobile,
11885
12077
  backgroundImage: backgroundImage || null,
11886
12078
  backgroundColor
11887
12079
  });
11888
- const cardData = sectionData?.components[0];
11889
- const [sectionComponent] = sectionData.components || [];
12080
+ const cardData = sectionData?.components?.[0];
12081
+ const [sectionComponent] = sectionData?.components || [];
11890
12082
  const counterSection = sectionComponent?.counterSection;
11891
- counterSection?.components || [];
12083
+ const counters = counterSection?.components || [];
12084
+ const items = cardData?.contentList?.components || counters;
11892
12085
  if (!cardData) return null;
12086
+ const getValue = item => item?.contentHeading?.metadata?.value ?? item?.value?.metadata?.value;
12087
+ const getDescription = item => item?.contentPara?.metadata?.value ?? item?.description?.metadata?.value;
12088
+ const getValueRefSetter = item => item?.contentHeading?.refSetter ?? item?.value?.refSetter;
12089
+ const getDescRefSetter = item => item?.contentPara?.refSetter ?? item?.description?.refSetter;
11893
12090
  return /*#__PURE__*/React.createElement("section", {
11894
12091
  className: classes.section
11895
12092
  }, /*#__PURE__*/React.createElement("div", {
11896
12093
  className: classes.container
11897
12094
  }, /*#__PURE__*/React.createElement("div", {
11898
12095
  className: classes.grid
11899
- }, cardData?.contentList?.components?.map((item, index) => /*#__PURE__*/React.createElement("div", {
11900
- key: item._id || index,
11901
- className: classes.counterItem
11902
- }, item.contentHeading?.metadata?.value != null && item.contentHeading?.metadata?.value !== '' && /*#__PURE__*/React.createElement("h2", {
11903
- ref: item.contentHeading?.refSetter,
11904
- className: classes.value,
11905
- dangerouslySetInnerHTML: {
11906
- __html: item.contentHeading.metadata.value
11907
- }
11908
- }), item.contentPara?.metadata?.value != null && item.contentPara?.metadata?.value !== '' && /*#__PURE__*/React.createElement("p", {
11909
- ref: item.contentPara?.refSetter,
11910
- className: classes.description,
11911
- dangerouslySetInnerHTML: {
11912
- __html: item.contentPara.metadata.value
11913
- }
11914
- }))))));
12096
+ }, items?.map((item, index) => {
12097
+ const value = getValue(item);
12098
+ const description = getDescription(item);
12099
+ return /*#__PURE__*/React.createElement("div", {
12100
+ key: item._id || index,
12101
+ className: classes.counterItem
12102
+ }, value != null && value !== '' && /*#__PURE__*/React.createElement(AnimatedCounter, {
12103
+ value: value,
12104
+ className: classes.value,
12105
+ refSetter: getValueRefSetter(item)
12106
+ }), description != null && description !== '' && /*#__PURE__*/React.createElement("p", {
12107
+ ref: getDescRefSetter(item),
12108
+ className: classes.description,
12109
+ dangerouslySetInnerHTML: {
12110
+ __html: description
12111
+ }
12112
+ }));
12113
+ }))));
11915
12114
  }
11916
12115
 
11917
12116
  var index$5 = /*#__PURE__*/Object.freeze({
@@ -11928,12 +12127,13 @@ const BREAKPOINTS = {
11928
12127
  /**
11929
12128
  * Get current breakpoint from window width
11930
12129
  */
11931
- const getBreakpoint = width => {
12130
+ const getBreakpoint = (width, isMobile) => {
12131
+ if (isMobile) return 'mobile';
11932
12132
  if (width >= BREAKPOINTS.desktop) return 'desktop';
11933
12133
  if (width >= BREAKPOINTS.tablet) return 'tablet';
11934
12134
  return 'mobile';
11935
12135
  };
11936
- const stickyBarBase = {
12136
+ const getStickyBarBase = theme => ({
11937
12137
  position: 'fixed',
11938
12138
  left: 0,
11939
12139
  right: 0,
@@ -11942,100 +12142,86 @@ const stickyBarBase = {
11942
12142
  display: 'flex',
11943
12143
  alignItems: 'center',
11944
12144
  justifyContent: 'center',
11945
- backgroundColor: '#F8F9FB',
11946
- boxShadow: '0 -2px 8px rgba(0, 0, 0, 0.06)',
11947
- borderTop: '1px solid #E5E7EB'
11948
- };
11949
- const stickyBarResponsive = {
11950
- mobile: {
11951
- ...stickyBarBase,
11952
- padding: '12px 16px',
11953
- gap: '12px',
11954
- flexDirection: 'column',
11955
- alignItems: 'stretch'
11956
- },
11957
- tablet: {
11958
- ...stickyBarBase,
11959
- padding: '14px 24px',
11960
- gap: '16px',
11961
- flexDirection: 'row',
11962
- alignItems: 'center'
11963
- },
11964
- desktop: {
11965
- ...stickyBarBase,
11966
- padding: '16px 32px',
11967
- gap: '24px',
11968
- flexDirection: 'row',
11969
- alignItems: 'center'
11970
- }
12145
+ fontFamily: theme?.typography?.fontFamily,
12146
+ backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
12147
+ boxShadow: theme?.shadows?.secondary ?? '0 -2px 8px rgba(0, 0, 0, 0.06)',
12148
+ borderTop: `1px solid ${theme?.colors?.border2}`
12149
+ });
12150
+ const getStickyBarResponsive = (theme, bgColor) => {
12151
+ const base = getStickyBarBase(theme);
12152
+ return {
12153
+ mobile: {
12154
+ ...base,
12155
+ padding: '12px 16px',
12156
+ gap: '12px',
12157
+ flexDirection: 'column',
12158
+ alignItems: 'stretch',
12159
+ background: '#FFFFFF',
12160
+ color: theme?.colors?.CtaTextColor || 'white'
12161
+ },
12162
+ tablet: {
12163
+ ...base,
12164
+ padding: '14px 24px',
12165
+ gap: '16px',
12166
+ flexDirection: 'row',
12167
+ alignItems: 'center',
12168
+ background: '#FFFFFF',
12169
+ color: theme?.colors?.CtaTextColor || 'white'
12170
+ },
12171
+ desktop: {
12172
+ ...base,
12173
+ padding: '16px 32px',
12174
+ gap: '24px',
12175
+ flexDirection: 'row',
12176
+ alignItems: 'center',
12177
+ background: '#FFFFFF',
12178
+ color: theme?.colors?.CtaTextColor || 'white'
12179
+ }
12180
+ };
11971
12181
  };
11972
- const getStickyBarStyle = breakpoint => stickyBarResponsive[breakpoint] || stickyBarResponsive.mobile;
11973
- const stickyTextBase = {
11974
- color: '#343A40',
11975
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12182
+ const getStickyBarStyle = (breakpoint, theme = {}, bgColor) => getStickyBarResponsive(theme)[breakpoint] || getStickyBarResponsive(theme).mobile;
12183
+ const getStickyTextBase = theme => ({
12184
+ color: theme?.colors?.font2,
12185
+ fontFamily: theme?.typography?.fontFamily ?? 'inherit',
11976
12186
  margin: 0
12187
+ });
12188
+ const getStickyTextResponsive = (theme, bgColor) => {
12189
+ const base = getStickyTextBase(theme);
12190
+ return {
12191
+ mobile: {
12192
+ ...base,
12193
+ fontSize: '13px',
12194
+ lineHeight: 1.4,
12195
+ textAlign: 'center',
12196
+ color: '#000000' ,
12197
+ background: '#FFFFFF'
12198
+ },
12199
+ tablet: {
12200
+ ...base,
12201
+ fontSize: '14px',
12202
+ lineHeight: 1.45,
12203
+ textAlign: 'left',
12204
+ color: '#000000' ,
12205
+ background: '#FFFFFF'
12206
+ },
12207
+ desktop: {
12208
+ ...base,
12209
+ fontSize: '15px',
12210
+ lineHeight: 1.5,
12211
+ textAlign: 'left',
12212
+ color: '#000000' ,
12213
+ background: '#FFFFFF'
12214
+ }
12215
+ };
11977
12216
  };
11978
- const stickyTextResponsive = {
11979
- mobile: {
11980
- ...stickyTextBase,
11981
- fontSize: '13px',
11982
- lineHeight: 1.4,
11983
- textAlign: 'center'
11984
- },
11985
- tablet: {
11986
- ...stickyTextBase,
11987
- fontSize: '14px',
11988
- lineHeight: 1.45,
11989
- textAlign: 'left'
11990
- },
11991
- desktop: {
11992
- ...stickyTextBase,
11993
- fontSize: '15px',
11994
- lineHeight: 1.5,
11995
- textAlign: 'left'
11996
- }
11997
- };
11998
- const getStickyTextStyle = breakpoint => stickyTextResponsive[breakpoint] || stickyTextResponsive.mobile;
11999
- const stickyButtonBase = {
12000
- backgroundColor: '#3366FF',
12001
- color: '#FFFFFF',
12002
- border: 'none',
12003
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12004
- fontWeight: 600,
12005
- textTransform: 'uppercase',
12006
- letterSpacing: '0.02em',
12007
- cursor: 'pointer',
12008
- whiteSpace: 'nowrap',
12009
- flexShrink: 0
12010
- };
12011
- const stickyButtonResponsive = {
12012
- mobile: {
12013
- ...stickyButtonBase,
12014
- padding: '10px 20px',
12015
- fontSize: '12px',
12016
- borderRadius: '6px'
12017
- },
12018
- tablet: {
12019
- ...stickyButtonBase,
12020
- padding: '12px 24px',
12021
- fontSize: '13px',
12022
- borderRadius: '8px'
12023
- },
12024
- desktop: {
12025
- ...stickyButtonBase,
12026
- padding: '14px 28px',
12027
- fontSize: '14px',
12028
- borderRadius: '8px'
12029
- }
12030
- };
12031
- const getStickyButtonStyle = breakpoint => stickyButtonResponsive[breakpoint] || stickyButtonResponsive.mobile;
12217
+ const getStickyTextStyle = (breakpoint, theme = {}) => getStickyTextResponsive(theme)[breakpoint] || getStickyTextResponsive(theme).mobile;
12032
12218
 
12033
12219
  // --- Floating (WhatsApp) type ---
12034
12220
 
12035
- const floatingButtonBase = {
12221
+ const getFloatingButtonBase = theme => ({
12036
12222
  position: 'fixed',
12037
12223
  bottom: 24,
12038
- right: 24,
12224
+ right: 9,
12039
12225
  width: 'fit-content',
12040
12226
  marginLeft: 'auto',
12041
12227
  zIndex: 9999,
@@ -12043,47 +12229,53 @@ const floatingButtonBase = {
12043
12229
  alignItems: 'center',
12044
12230
  gap: '10px',
12045
12231
  padding: '12px 20px',
12046
- backgroundColor: '#FFFFFF',
12047
- border: '1px solid #E5E7EB',
12232
+ backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
12233
+ border: `1px solid ${theme?.palette?.border?.secondary ?? '#E5E7EB'}`,
12048
12234
  borderRadius: '9999px',
12049
- boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
12235
+ boxShadow: theme?.shadows?.primary ?? '0 4px 12px rgba(0, 0, 0, 0.1)',
12050
12236
  cursor: 'pointer',
12051
12237
  textDecoration: 'none',
12052
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12053
- fontWeight: 700,
12238
+ fontFamily: theme?.typography?.fontFamily ?? 'inherit',
12239
+ fontWeight: theme?.typography?.fontWeight?.bold ?? 700,
12054
12240
  fontSize: '14px',
12055
12241
  textTransform: 'uppercase',
12056
12242
  letterSpacing: '0.02em',
12057
- color: '#000000',
12243
+ color: theme?.colors?.CtaTextColor || 'white',
12058
12244
  transition: 'box-shadow 0.2s ease, transform 0.2s ease'
12245
+ });
12246
+ const getFloatingButtonResponsive = theme => {
12247
+ const base = getFloatingButtonBase(theme);
12248
+ return {
12249
+ mobile: {
12250
+ ...base,
12251
+ bottom: 142,
12252
+ left: 16,
12253
+ padding: '10px 16px',
12254
+ gap: '8px',
12255
+ fontSize: '12px',
12256
+ background: theme?.colors?.ctaColor || '#FFFFFF'
12257
+ },
12258
+ tablet: {
12259
+ ...base,
12260
+ bottom: 20,
12261
+ left: 20,
12262
+ padding: '12px 18px',
12263
+ gap: '10px',
12264
+ fontSize: '13px',
12265
+ background: theme?.colors?.ctaColor || '#FFFFFF'
12266
+ },
12267
+ desktop: {
12268
+ ...base,
12269
+ bottom: 24,
12270
+ left: 24,
12271
+ padding: '12px 20px',
12272
+ gap: '10px',
12273
+ fontSize: '14px',
12274
+ background: theme?.colors?.ctaColor || '#FFFFFF'
12275
+ }
12276
+ };
12059
12277
  };
12060
- const floatingButtonResponsive = {
12061
- mobile: {
12062
- ...floatingButtonBase,
12063
- bottom: 16,
12064
- left: 16,
12065
- padding: '10px 16px',
12066
- gap: '8px',
12067
- fontSize: '12px'
12068
- },
12069
- tablet: {
12070
- ...floatingButtonBase,
12071
- bottom: 20,
12072
- left: 20,
12073
- padding: '12px 18px',
12074
- gap: '10px',
12075
- fontSize: '13px'
12076
- },
12077
- desktop: {
12078
- ...floatingButtonBase,
12079
- bottom: 24,
12080
- left: 24,
12081
- padding: '12px 20px',
12082
- gap: '10px',
12083
- fontSize: '14px'
12084
- }
12085
- };
12086
- const getFloatingButtonStyle = breakpoint => floatingButtonResponsive[breakpoint] || floatingButtonResponsive.mobile;
12278
+ const getFloatingButtonStyle = (breakpoint, theme = {}) => getFloatingButtonResponsive(theme)[breakpoint] || getFloatingButtonResponsive(theme).mobile;
12087
12279
  const whatsAppIconSvgSize = {
12088
12280
  mobile: 24,
12089
12281
  tablet: 26,
@@ -12171,12 +12363,17 @@ function StickyCta({
12171
12363
  whatsAppLabel = 'SUPPORT',
12172
12364
  whatsAppIconColor,
12173
12365
  whatsAppButtonBackgroundColor,
12174
- iconImageUrl
12366
+ iconImageUrl,
12367
+ nodeData,
12368
+ extraProps
12175
12369
  }) {
12176
- console.log('nishu03333', sectionData);
12370
+ const {
12371
+ isMobile
12372
+ } = useContext(PageContext);
12177
12373
  const node = sectionData?.components?.[0];
12178
12374
  const contentList = node?.contentList?.components || [];
12179
12375
  const showEditHint = sectionData?.isDefaultEditor ?? false;
12376
+ sectionData?.bgSection?.components?.[0]?.sectionBgData?.metadata?.value;
12180
12377
  const propsFromSection = node ? {
12181
12378
  type: node?.title?.metadata?.value ?? type,
12182
12379
  stickyMessage: contentList[1]?.contentPara?.metadata?.value ?? stickyMessage,
@@ -12199,8 +12396,9 @@ function StickyCta({
12199
12396
  whatsAppButtonBackgroundColor,
12200
12397
  iconImageUrl
12201
12398
  };
12202
- const whatsAppUrl = p?.whatsAppPhoneNumber ? p?.whatsAppPhoneNumber : buildWhatsAppUrl(p?.whatsAppPhoneNumber);
12203
- const [breakpoint, setBreakpoint] = useState(() => typeof window !== 'undefined' ? getBreakpoint(window.innerWidth) : 'mobile');
12399
+ const whatsAppUrl = buildWhatsAppUrl(p?.whatsAppPhoneNumber) ?? p?.whatsAppHref ?? '#';
12400
+ const theme = useTheme() || {};
12401
+ const [breakpoint, setBreakpoint] = useState(() => typeof window !== 'undefined' ? getBreakpoint(window.innerWidth, isMobile) : 'mobile');
12204
12402
  useEffect(() => {
12205
12403
  if (typeof window === 'undefined') return;
12206
12404
  const onResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
@@ -12229,14 +12427,14 @@ function StickyCta({
12229
12427
  }, "Click on edit button to edit this section")) : null;
12230
12428
  if (p.type === 'floating') {
12231
12429
  const buttonStyle = {
12232
- ...getFloatingButtonStyle(breakpoint),
12430
+ ...getFloatingButtonStyle(breakpoint, theme),
12233
12431
  ...(p.whatsAppButtonBackgroundColor != null && {
12234
12432
  backgroundColor: p.whatsAppButtonBackgroundColor
12235
12433
  })
12236
12434
  };
12237
12435
  const iconSize = getWhatsAppIconSize(breakpoint);
12238
12436
  const iconColor = p.whatsAppIconColor ?? DEFAULT_WHATSAPP_ICON_COLOR;
12239
- return /*#__PURE__*/React.createElement(React.Fragment, null, editHintBlock, /*#__PURE__*/React.createElement("a", {
12437
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isMobile ? null : editHintBlock, /*#__PURE__*/React.createElement("a", {
12240
12438
  href: whatsAppUrl,
12241
12439
  target: "_blank",
12242
12440
  rel: "noopener noreferrer",
@@ -12258,28 +12456,29 @@ function StickyCta({
12258
12456
  }), /*#__PURE__*/React.createElement("span", null, p.whatsAppLabel)));
12259
12457
  }
12260
12458
 
12261
- // type === 'sticky' – button uses mobile number from props to build URL; click redirects to WhatsApp
12262
- const barStyle = getStickyBarStyle(breakpoint);
12263
- const textStyle = getStickyTextStyle(breakpoint);
12264
- const buttonStyle = getStickyButtonStyle(breakpoint);
12265
- return /*#__PURE__*/React.createElement(React.Fragment, null, editHintBlock, /*#__PURE__*/React.createElement("div", {
12459
+ // type === 'sticky' – use primary Button (same as other sections) linking to WhatsApp
12460
+ const barStyle = getStickyBarStyle(breakpoint, theme);
12461
+ const textStyle = getStickyTextStyle(breakpoint, theme);
12462
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isMobile ? null : editHintBlock, /*#__PURE__*/React.createElement("div", {
12266
12463
  style: barStyle,
12267
- role: "banner"
12464
+ role: "banner",
12465
+ "access-cta-sticky": "DIY"
12268
12466
  }, /*#__PURE__*/React.createElement("p", {
12269
12467
  style: textStyle
12270
- }, p.stickyMessage), /*#__PURE__*/React.createElement("a", {
12271
- href: whatsAppUrl,
12272
- target: "_blank",
12273
- rel: "noopener noreferrer",
12274
- "access-cta-container": "DIY",
12275
- style: {
12276
- ...buttonStyle,
12277
- textDecoration: 'none',
12278
- display: 'inline-flex',
12279
- alignItems: 'center',
12280
- justifyContent: 'center'
12281
- }
12282
- }, p.stickyButtonText)));
12468
+ }, p.stickyMessage), /*#__PURE__*/React.createElement(Button, {
12469
+ data: {
12470
+ isLink: 1,
12471
+ isExternal: 1,
12472
+ link: whatsAppUrl,
12473
+ value: p.stickyButtonText
12474
+ },
12475
+ type: "primary",
12476
+ styling: {
12477
+ background: theme?.colors?.ctaColor
12478
+ },
12479
+ size: breakpoint === 'mobile' ? 'small' : 'medium',
12480
+ "access-cta-container": "DIY"
12481
+ })));
12283
12482
  }
12284
12483
 
12285
12484
  var index$4 = /*#__PURE__*/Object.freeze({
@@ -12624,7 +12823,8 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12624
12823
  return {
12625
12824
  section: {
12626
12825
  width: '100%',
12627
- background: 'linear-gradient(135deg, #6b2d5c 0%, #4a3f6b 40%, #2d5a6b 70%, #3d6b5a 100%)',
12826
+ background: theme?.colors?.background2,
12827
+ color: theme?.colors?.font3,
12628
12828
  minHeight: '100%',
12629
12829
  '&, & *, & *:before, & *:after': {
12630
12830
  fontFamily: theme?.typography?.fontFamily,
@@ -12664,7 +12864,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12664
12864
  lineHeight: 1.25,
12665
12865
  letterSpacing: '3px',
12666
12866
  textTransform: 'uppercase',
12667
- color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.9)',
12668
12867
  wordBreak: 'break-word',
12669
12868
  fontWeight: theme.typography?.fontWeight?.regular
12670
12869
  },
@@ -12673,15 +12872,12 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12673
12872
  fontSize: theme.typography.fontSize.h2,
12674
12873
  lineHeight: 1.1,
12675
12874
  letterSpacing: '-1px',
12676
- fontWeight: theme.typography?.fontWeight?.bold,
12677
- color: theme.palette?.font?.invertedDefault || '#ffffff',
12678
12875
  wordBreak: 'break-word'
12679
12876
  },
12680
12877
  subHeading: {
12681
12878
  margin: 0,
12682
12879
  fontSize: theme.typography.fontSize.body,
12683
12880
  lineHeight: 1.5,
12684
- color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.95)',
12685
12881
  wordBreak: 'break-word',
12686
12882
  maxWidth: '600px'
12687
12883
  },
@@ -12727,7 +12923,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12727
12923
  margin: 0,
12728
12924
  fontSize: theme.typography.fontSize.body,
12729
12925
  fontWeight: theme.typography?.fontWeight?.semiBold,
12730
- color: '#ffffff',
12731
12926
  lineHeight: 1.3
12732
12927
  }
12733
12928
  },
@@ -12742,7 +12937,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12742
12937
  '& p': {
12743
12938
  margin: 0,
12744
12939
  fontSize: theme.typography.fontSize.body,
12745
- color: '#ffffff',
12746
12940
  lineHeight: 1.4
12747
12941
  }
12748
12942
  },