igloo-d2c-components 1.0.9 → 1.0.10

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.
Files changed (75) hide show
  1. package/README.md +8 -0
  2. package/dist/assets/icons/alert.svg +5 -0
  3. package/dist/assets/icons/arrow-down.svg +3 -0
  4. package/dist/assets/icons/arrow.svg +9 -0
  5. package/dist/assets/icons/close.svg +4 -0
  6. package/dist/assets/icons/facebook.svg +3 -0
  7. package/dist/assets/icons/index.ts +26 -0
  8. package/dist/assets/icons/instagram.svg +11 -0
  9. package/dist/assets/icons/youtube.svg +11 -0
  10. package/dist/assets/index.ts +13 -0
  11. package/dist/assets/tenants/ammetlife/logo.svg +10 -0
  12. package/dist/assets/tenants/cimb/logo-white.png +0 -0
  13. package/dist/assets/tenants/cimb/logo.svg +62 -0
  14. package/dist/assets/tenants/igloo/logo.svg +22 -0
  15. package/dist/cjs/index.js +2124 -38
  16. package/dist/cjs/index.js.map +1 -1
  17. package/dist/esm/index.js +2083 -38
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/types/assets/icons/index.d.ts +21 -0
  20. package/dist/types/assets/index.d.ts +9 -0
  21. package/dist/types/components/BillingToggle/BillingToggle.d.ts +34 -0
  22. package/dist/types/components/BillingToggle/index.d.ts +3 -0
  23. package/dist/types/components/BillingToggle/styled.d.ts +12 -0
  24. package/dist/types/components/CoverageAmountSlider/CoverageAmountSlider.d.ts +53 -0
  25. package/dist/types/components/CoverageAmountSlider/index.d.ts +3 -0
  26. package/dist/types/components/CoverageAmountSlider/styled.d.ts +41 -0
  27. package/dist/types/components/Footer/Footer.d.ts +94 -0
  28. package/dist/types/components/Footer/index.d.ts +3 -0
  29. package/dist/types/components/Footer/styled.d.ts +38 -0
  30. package/dist/types/components/Header/Header.d.ts +159 -0
  31. package/dist/types/components/Header/index.d.ts +3 -0
  32. package/dist/types/components/Header/styled.d.ts +80 -0
  33. package/dist/types/components/InfoCallout/InfoCallout.d.ts +34 -0
  34. package/dist/types/components/InfoCallout/index.d.ts +3 -0
  35. package/dist/types/components/InfoCallout/styled.d.ts +16 -0
  36. package/dist/types/components/NewHeader/NewHeader.d.ts +60 -0
  37. package/dist/types/components/NewHeader/index.d.ts +3 -0
  38. package/dist/types/components/NewHeader/styled.d.ts +26 -0
  39. package/dist/types/components/OptionButton/OptionButton.d.ts +59 -0
  40. package/dist/types/components/OptionButton/index.d.ts +3 -0
  41. package/dist/types/components/OptionButton/styled.d.ts +18 -0
  42. package/dist/types/components/ProductSelectionDrawer/ProductSelectionDrawer.d.ts +54 -0
  43. package/dist/types/components/ProductSelectionDrawer/index.d.ts +3 -0
  44. package/dist/types/components/ProductSelectionDrawer/styled.d.ts +44 -0
  45. package/dist/types/components/QuestionSection/QuestionSection.d.ts +71 -0
  46. package/dist/types/components/QuestionSection/index.d.ts +3 -0
  47. package/dist/types/components/QuestionSection/styled.d.ts +16 -0
  48. package/dist/types/components/RecommendationsDrawer/RecommendationsDrawer.d.ts +92 -0
  49. package/dist/types/components/RecommendationsDrawer/index.d.ts +3 -0
  50. package/dist/types/components/RecommendationsDrawer/styled.d.ts +35 -0
  51. package/dist/types/components/ToggleGroup/ToggleGroup.d.ts +45 -0
  52. package/dist/types/components/ToggleGroup/index.d.ts +3 -0
  53. package/dist/types/components/ToggleGroup/styled.d.ts +17 -0
  54. package/dist/types/context/TenantThemeContext.d.ts +3 -2
  55. package/dist/types/index.d.ts +30 -4
  56. package/dist/types/{components/Banner → storybook-components}/Banner.stories.d.ts +1 -1
  57. package/dist/types/storybook-components/BillingToggle.stories.d.ts +10 -0
  58. package/dist/types/{components/Button → storybook-components}/Button.stories.d.ts +1 -1
  59. package/dist/types/{components/Card → storybook-components}/Card.stories.d.ts +1 -1
  60. package/dist/types/storybook-components/CoverageAmountSlider.stories.d.ts +14 -0
  61. package/dist/types/storybook-components/Footer.stories.d.ts +10 -0
  62. package/dist/types/storybook-components/Header.stories.d.ts +9 -0
  63. package/dist/types/storybook-components/InfoCallout.stories.d.ts +11 -0
  64. package/dist/types/storybook-components/NewHeader.stories.d.ts +82 -0
  65. package/dist/types/storybook-components/OptionButton.stories.d.ts +12 -0
  66. package/dist/types/storybook-components/ProductSelectionDrawer.stories.d.ts +24 -0
  67. package/dist/types/storybook-components/QuestionSection.stories.d.ts +11 -0
  68. package/dist/types/storybook-components/RecommendationsDrawer.stories.d.ts +36 -0
  69. package/dist/types/storybook-components/ToggleGroup.stories.d.ts +10 -0
  70. package/dist/types/themes/index.d.ts +1 -1
  71. package/dist/types/themes/typography.d.ts +69 -0
  72. package/dist/types/types/tenant.d.ts +23 -2
  73. package/dist/types/utils/assets.d.ts +54 -0
  74. package/dist/types/utils/theme.d.ts +3 -2
  75. package/package.json +4 -2
package/dist/esm/index.js CHANGED
@@ -1,7 +1,19 @@
1
1
  "use client"
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { createContext, useMemo, useContext } from 'react';
4
- import { Button as Button$1, Card as Card$1, CardHeader, CardContent, CardActions, Box, Typography } from '@mui/material';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { createContext, useMemo, useContext, useState, useEffect } from 'react';
5
+ import { Button as Button$1, Card as Card$1, CardHeader, CardContent, CardActions, Box, Typography, Avatar, Menu, MenuItem, Drawer, IconButton, FormControlLabel, useTheme, useMediaQuery, Toolbar, Icon, RadioGroup, Radio, AppBar as AppBar$1, Divider, List, ListItem, ListItemButton, ListItemText, styled as styled$1, ButtonBase } from '@mui/material';
6
+ import CloseIcon from '@mui/icons-material/Close';
7
+ import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
8
+ import MenuIcon from '@mui/icons-material/Menu';
9
+ import AppBar from '@mui/material/AppBar';
10
+ import Container from '@mui/material/Container';
11
+ import { styled } from '@mui/material/styles';
12
+ import ArrowBackIcon from '@mui/icons-material/ArrowBack';
13
+ import InfoIcon from '@mui/icons-material/Info';
14
+ import AddIcon from '@mui/icons-material/Add';
15
+ import DragHandleIcon from '@mui/icons-material/DragHandle';
16
+ import RemoveIcon from '@mui/icons-material/Remove';
5
17
 
6
18
  const TenantThemeContext = createContext(undefined);
7
19
  /**
@@ -27,11 +39,20 @@ function TenantThemeProvider({ children, tenantId, theme, }) {
27
39
  }
28
40
  /**
29
41
  * Hook to access tenant theme configuration
30
- * @throws Error if used outside TenantThemeProvider
42
+ * Returns undefined during SSR if context is not available
43
+ * @returns TenantContextValue or undefined during SSR
31
44
  */
32
45
  function useTenantTheme() {
33
46
  const context = useContext(TenantThemeContext);
47
+ // During SSR, context might be undefined - return undefined instead of throwing
48
+ // This allows components to handle SSR gracefully with fallback values
34
49
  if (context === undefined) {
50
+ // Check if we're in a browser environment
51
+ if (typeof window === 'undefined') {
52
+ // SSR - return undefined to allow fallback handling
53
+ return undefined;
54
+ }
55
+ // Client-side but no provider - throw error for development
35
56
  throw new Error('useTenantTheme must be used within a TenantThemeProvider');
36
57
  }
37
58
  return context;
@@ -40,15 +61,160 @@ function useTenantTheme() {
40
61
  * Hook to get tenant ID
41
62
  */
42
63
  function useTenantId() {
43
- const { tenantId } = useTenantTheme();
44
- return tenantId;
64
+ const tenantTheme = useTenantTheme();
65
+ return (tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.tenantId) || '';
45
66
  }
46
67
  /**
47
68
  * Hook to check if current tenant matches given tenant ID
48
69
  */
49
70
  function useIsTenant(checkTenantId) {
50
- const { tenantId } = useTenantTheme();
51
- return tenantId === checkTenantId;
71
+ const tenantTheme = useTenantTheme();
72
+ return (tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.tenantId) === checkTenantId;
73
+ }
74
+
75
+ /**
76
+ * Tenant Typography Configurations
77
+ * Centralized typography definitions for all tenants
78
+ * Based on b2c-web-demo typography structure
79
+ */
80
+ /**
81
+ * Igloo Typography Configuration
82
+ */
83
+ const iglooTypography = {
84
+ fontFamily: 'Montserrat',
85
+ fontWeightRegular: 400,
86
+ fontWeightMedium: 500,
87
+ fontWeightSemiBold: 600,
88
+ fontWeightBold: 700,
89
+ fontWeightExtraBold: 800,
90
+ fontWeightExtraBlack: 900,
91
+ h1: {
92
+ fontSize: '42px',
93
+ fontStyle: 'normal',
94
+ fontWeight: 700,
95
+ lineHeight: '48px',
96
+ '@media (max-width:600px)': {
97
+ fontSize: '24px',
98
+ fontStyle: 'normal',
99
+ fontWeight: 700,
100
+ lineHeight: '30px',
101
+ },
102
+ },
103
+ h2: {
104
+ fontSize: '22px',
105
+ fontStyle: 'normal',
106
+ fontWeight: 700,
107
+ lineHeight: '26px',
108
+ '@media (max-width:600px)': {
109
+ fontSize: '14px',
110
+ fontStyle: 'normal',
111
+ fontWeight: 700,
112
+ lineHeight: '22px',
113
+ },
114
+ },
115
+ h3: {
116
+ fontSize: '18px',
117
+ fontStyle: 'normal',
118
+ fontWeight: 600,
119
+ lineHeight: '24px',
120
+ '@media (max-width:600px)': {
121
+ fontSize: '14px',
122
+ fontStyle: 'normal',
123
+ fontWeight: 600,
124
+ lineHeight: '20px',
125
+ },
126
+ },
127
+ h4: {
128
+ fontSize: '18px',
129
+ fontStyle: 'normal',
130
+ fontWeight: 600,
131
+ lineHeight: '24px',
132
+ '@media (max-width:600px)': {
133
+ fontSize: '14px',
134
+ fontStyle: 'normal',
135
+ fontWeight: 500,
136
+ lineHeight: '18px',
137
+ },
138
+ },
139
+ bodyStrongLarge: {
140
+ fontSize: '16px',
141
+ fontStyle: 'normal',
142
+ fontWeight: 500,
143
+ lineHeight: '20px',
144
+ '@media (max-width:600px)': {
145
+ fontSize: '14px',
146
+ fontStyle: 'normal',
147
+ fontWeight: 400,
148
+ lineHeight: '18px',
149
+ },
150
+ },
151
+ bodyStrongMedium: {
152
+ fontSize: '14px',
153
+ fontStyle: 'normal',
154
+ fontWeight: 500,
155
+ lineHeight: '18px',
156
+ },
157
+ bodyStrongSmall: {
158
+ fontSize: '12px',
159
+ fontStyle: 'normal',
160
+ fontWeight: 500,
161
+ lineHeight: '16px',
162
+ },
163
+ bodyLarge: {
164
+ fontSize: '16px',
165
+ fontStyle: 'normal',
166
+ fontWeight: 400,
167
+ lineHeight: '20px',
168
+ '@media (max-width:600px)': {
169
+ fontSize: '14px',
170
+ fontStyle: 'normal',
171
+ fontWeight: 400,
172
+ lineHeight: '18px',
173
+ },
174
+ },
175
+ bodyMedium: {
176
+ fontSize: '14px',
177
+ fontStyle: 'normal',
178
+ fontWeight: 400,
179
+ lineHeight: '20px',
180
+ },
181
+ bodySmall: {
182
+ fontSize: '12px',
183
+ fontStyle: 'normal',
184
+ fontWeight: 400,
185
+ lineHeight: '16px',
186
+ },
187
+ smallText: {
188
+ fontSize: '8px',
189
+ fontStyle: 'normal',
190
+ fontWeight: 500,
191
+ lineHeight: '16px',
192
+ },
193
+ };
194
+ /**
195
+ * CIMB Typography Configuration
196
+ */
197
+ const cimbTypography = Object.assign(Object.assign({}, iglooTypography), { fontFamily: 'CIMB Sans' });
198
+ /**
199
+ * AmmetLife Typography Configuration
200
+ */
201
+ const ammetlifeTypography = Object.assign(Object.assign({}, iglooTypography), { fontFamily: 'Montserrat' });
202
+ /**
203
+ * Typography Registry
204
+ * Map of tenant IDs to their typography configurations
205
+ */
206
+ const tenantTypography = {
207
+ igloo: iglooTypography,
208
+ cimb: cimbTypography,
209
+ ammetlife: ammetlifeTypography,
210
+ };
211
+ /**
212
+ * Get typography configuration by tenant ID
213
+ * @param tenantId - The tenant identifier
214
+ * @returns Typography configuration for the specified tenant
215
+ */
216
+ function getTenantTypography(tenantId) {
217
+ return tenantTypography[tenantId] || iglooTypography;
52
218
  }
53
219
 
54
220
  /**
@@ -92,6 +258,19 @@ const iglooTheme = {
92
258
  bright: '#fff',
93
259
  granite: '#666',
94
260
  },
261
+ // UI Component Colors
262
+ ui: {
263
+ sliderActive: '#5656F6',
264
+ sliderInactive: '#c8c5ca',
265
+ sliderBackground: '#f9f9f9',
266
+ toggleActive: '#5656F6',
267
+ toggleActiveText: '#ffffff',
268
+ toggleInactiveText: '#5f5e62',
269
+ calloutBackground: '#f9f9f9',
270
+ calloutBorder: '#ffffff',
271
+ inputBackground: '#ffffff',
272
+ inputBorder: '#eeeeee',
273
+ },
95
274
  motor: {
96
275
  main: '#00CCFF',
97
276
  light: 'rgba(0, 208, 255, 0.10)',
@@ -117,11 +296,10 @@ const iglooTheme = {
117
296
  main: '#F3A100',
118
297
  },
119
298
  },
120
- typography: {
121
- fontFamily: '"Manrope", "Roboto", "Helvetica", "Arial", sans-serif',
122
- },
123
- logo: '/assets/igloo_nobeta.svg',
299
+ typography: Object.assign(Object.assign({}, iglooTypography), { fontFamily: '"Manrope", "Roboto", "Helvetica", "Arial", sans-serif' }),
300
+ logo: '/assets/tenants/igloo/logo.svg',
124
301
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
302
+ assetBaseUrl: '/assets/tenants/igloo',
125
303
  };
126
304
  /**
127
305
  * CIMB Theme Configuration
@@ -166,6 +344,19 @@ const cimbTheme = {
166
344
  bright: '#fff',
167
345
  granite: '#666',
168
346
  },
347
+ // UI Component Colors
348
+ ui: {
349
+ sliderActive: '#C3214B',
350
+ sliderInactive: '#c8c5ca',
351
+ sliderBackground: '#f9f9f9',
352
+ toggleActive: '#EE0500',
353
+ toggleActiveText: '#fefbff',
354
+ toggleInactiveText: '#5f5e62',
355
+ calloutBackground: '#f9f9f9',
356
+ calloutBorder: '#ffffff',
357
+ inputBackground: '#ffffff',
358
+ inputBorder: '#eeeeee',
359
+ },
169
360
  motor: {
170
361
  main: '#C3214B',
171
362
  light: 'rgba(195, 33, 75, 0.10)',
@@ -192,11 +383,11 @@ const cimbTheme = {
192
383
  main: '#F3A100',
193
384
  },
194
385
  },
195
- typography: {
196
- fontFamily: '"CIMB Sans", "Roboto", "Helvetica", "Arial", sans-serif',
197
- },
198
- logo: '/assets/cimb/cimb-logo.svg',
386
+ typography: Object.assign(Object.assign({}, cimbTypography), { fontFamily: '"CIMB Sans", "Roboto", "Helvetica", "Arial", sans-serif' }),
387
+ logo: '/assets/tenants/cimb/logo.svg',
388
+ logoWhite: '/assets/tenants/cimb/logo-white.png',
199
389
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
390
+ assetBaseUrl: '/assets/tenants/cimb',
200
391
  };
201
392
  /**
202
393
  * Ammetlife Theme Configuration
@@ -235,6 +426,19 @@ const ammetlifeTheme = {
235
426
  bright: '#fff',
236
427
  granite: '#666',
237
428
  },
429
+ // UI Component Colors
430
+ ui: {
431
+ sliderActive: '#317abc',
432
+ sliderInactive: '#c8c5ca',
433
+ sliderBackground: '#f9f9f9',
434
+ toggleActive: '#a4ce4e',
435
+ toggleActiveText: '#fefbff',
436
+ toggleInactiveText: '#5f5e62',
437
+ calloutBackground: '#f9f9f9',
438
+ calloutBorder: '#ffffff',
439
+ inputBackground: '#ffffff',
440
+ inputBorder: '#eeeeee',
441
+ },
238
442
  motor: {
239
443
  main: '#1976D2',
240
444
  light: 'rgba(25, 118, 210, 0.10)',
@@ -261,11 +465,10 @@ const ammetlifeTheme = {
261
465
  main: '#FF9800',
262
466
  },
263
467
  },
264
- typography: {
265
- fontFamily: '"Open Sans", "Roboto", "Helvetica", "Arial", sans-serif',
266
- },
267
- logo: '/assets/ammetlife/logo-AmMetLife.svg',
468
+ typography: Object.assign(Object.assign({}, ammetlifeTypography), { fontFamily: '"Montserrat", "Roboto", "Helvetica", "Arial", sans-serif' }),
469
+ logo: '/assets/tenants/ammetlife/logo.svg',
268
470
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
471
+ assetBaseUrl: '/assets/tenants/ammetlife',
269
472
  };
270
473
  /**
271
474
  * Theme Registry
@@ -352,12 +555,13 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
352
555
  * ```
353
556
  */
354
557
  function Button(_a) {
355
- var _b, _c, _d;
558
+ var _b, _c, _d, _e, _f, _g;
356
559
  var { tenantColored = false, variant = 'contained', sx, color } = _a, props = __rest(_a, ["tenantColored", "variant", "sx", "color"]);
357
- const { theme } = useTenantTheme();
358
- const buttonSx = tenantColored
359
- ? Object.assign({ backgroundColor: (_b = theme.palette.primary) === null || _b === void 0 ? void 0 : _b.main, color: '#fff', '&:hover': {
360
- backgroundColor: ((_c = theme.palette.primary) === null || _c === void 0 ? void 0 : _c.dark) || ((_d = theme.palette.primary) === null || _d === void 0 ? void 0 : _d.main),
560
+ const tenantTheme = useTenantTheme();
561
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
562
+ const buttonSx = tenantColored && theme
563
+ ? Object.assign({ backgroundColor: (_c = (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main, color: '#fff', '&:hover': {
564
+ backgroundColor: ((_e = (_d = theme.palette) === null || _d === void 0 ? void 0 : _d.primary) === null || _e === void 0 ? void 0 : _e.dark) || ((_g = (_f = theme.palette) === null || _f === void 0 ? void 0 : _f.primary) === null || _g === void 0 ? void 0 : _g.main),
361
565
  } }, sx) : sx;
362
566
  return (jsx(Button$1, Object.assign({ variant: variant, color: tenantColored ? undefined : color, sx: buttonSx }, props)));
363
567
  }
@@ -376,11 +580,12 @@ function Button(_a) {
376
580
  * ```
377
581
  */
378
582
  function Card(_a) {
379
- var _b;
583
+ var _b, _c;
380
584
  var { title, headerAction, content, actions, tenantAccent = false, sx, children } = _a, props = __rest(_a, ["title", "headerAction", "content", "actions", "tenantAccent", "sx", "children"]);
381
- const { theme } = useTenantTheme();
382
- const cardSx = tenantAccent
383
- ? Object.assign({ borderTop: `4px solid ${(_b = theme.palette.primary) === null || _b === void 0 ? void 0 : _b.main}` }, sx) : sx;
585
+ const tenantTheme = useTenantTheme();
586
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
587
+ const cardSx = tenantAccent && theme
588
+ ? Object.assign({ borderTop: `4px solid ${((_c = (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#000000'}` }, sx) : sx;
384
589
  return (jsxs(Card$1, Object.assign({ sx: cardSx }, props, { children: [title && jsx(CardHeader, { title: title, action: headerAction }), (content || children) && (jsx(CardContent, { children: content || children })), actions && jsx(CardActions, { children: actions })] })));
385
590
  }
386
591
 
@@ -400,25 +605,1322 @@ function Card(_a) {
400
605
  function Banner(_a) {
401
606
  var _b, _c, _d, _e;
402
607
  var { title, description, action, gradient = true, sx } = _a, props = __rest(_a, ["title", "description", "action", "gradient", "sx"]);
403
- const { theme } = useTenantTheme();
608
+ const tenantTheme = useTenantTheme();
609
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
610
+ const primaryColor = ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#000000';
611
+ const lightColor = ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _d === void 0 ? void 0 : _d.primary) === null || _e === void 0 ? void 0 : _e.light) || primaryColor;
404
612
  const background = gradient
405
- ? `linear-gradient(135deg, ${(_b = theme.palette.primary) === null || _b === void 0 ? void 0 : _b.main} 0%, ${((_c = theme.palette.primary) === null || _c === void 0 ? void 0 : _c.light) || ((_d = theme.palette.primary) === null || _d === void 0 ? void 0 : _d.main)} 100%)`
406
- : (_e = theme.palette.primary) === null || _e === void 0 ? void 0 : _e.main;
613
+ ? `linear-gradient(135deg, ${primaryColor} 0%, ${lightColor} 100%)`
614
+ : primaryColor;
407
615
  return (jsxs(Box, Object.assign({ sx: Object.assign({ background, color: 'white', padding: '32px', borderRadius: '12px', textAlign: 'center' }, sx) }, props, { children: [jsx(Typography, Object.assign({ variant: "h4", component: "h2", gutterBottom: true, fontWeight: "bold" }, { children: title })), description && (jsx(Typography, Object.assign({ variant: "body1", sx: { opacity: 0.95, mb: action ? 2 : 0 } }, { children: description }))), action && jsx(Box, Object.assign({ sx: { mt: 2 } }, { children: action }))] })));
408
616
  }
409
617
 
618
+ const StyledAppBar$1 = styled(AppBar)(({ theme, ispartnershippagemobileview, scrolled }) => {
619
+ var _a, _b;
620
+ return ({
621
+ zIndex: '1000 !important',
622
+ backgroundColor: ispartnershippagemobileview && !scrolled
623
+ ? 'transparent !important'
624
+ : `${((_a = theme.palette.background) === null || _a === void 0 ? void 0 : _a.paper) || '#fff'} !important`,
625
+ boxShadow: 'none !important',
626
+ '& .MuiToolbar-root': {
627
+ minHeight: '80px',
628
+ [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
629
+ minHeight: '64px',
630
+ },
631
+ },
632
+ [theme.breakpoints.up(1025)]: {
633
+ boxShadow: scrolled && '0px 2px 20px 4px rgba(0, 0, 0, 0.14) !important',
634
+ },
635
+ });
636
+ });
637
+ const ResponsiveB2CLayout = styled('div')(({ theme }) => ({
638
+ [theme.breakpoints.up(1025)]: {
639
+ minWidth: '1128px',
640
+ maxWidth: '1128px',
641
+ margin: '0 auto',
642
+ },
643
+ }));
644
+ const StyledContainer = styled(Container)(({ theme, ispartnershippagemobileview, scrolled }) => {
645
+ var _a;
646
+ return ({
647
+ boxShadow: 'none',
648
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
649
+ boxShadow: !scrolled ? 'none' : '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
650
+ },
651
+ });
652
+ });
653
+ const TypographyLogo = styled(Typography)(({ theme }) => {
654
+ var _a, _b;
655
+ return ({
656
+ margin: 'auto 40 auto 0',
657
+ display: '-webkit-box',
658
+ alignItems: 'anchor-center',
659
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.up('md')]: {
660
+ width: 95,
661
+ height: 57,
662
+ },
663
+ [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
664
+ width: 73.3,
665
+ display: 'flex',
666
+ },
667
+ });
668
+ });
669
+ const ButtonDesktopMenu = styled(Button$1)(({ theme }) => {
670
+ var _a;
671
+ return ({
672
+ color: ((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000',
673
+ display: 'flex',
674
+ padding: '0px 10px',
675
+ alignItems: 'center',
676
+ gap: 8,
677
+ alignSelf: 'stretch',
678
+ });
679
+ });
680
+ const AnchorLinks = styled('a')(({ theme }) => ({
681
+ color: 'inherit',
682
+ '&:hover': {
683
+ color: 'inherit',
684
+ },
685
+ }));
686
+ const StyledAvatar = styled(Avatar)(({ theme }) => {
687
+ var _a;
688
+ return ({
689
+ margin: '15px 0',
690
+ cursor: 'pointer',
691
+ backgroundColor: `${theme.palette.primary.main} !important`,
692
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
693
+ margin: '0',
694
+ },
695
+ });
696
+ });
697
+ const DivButtonWrapper = styled('div')(({ theme }) => {
698
+ var _a;
699
+ return ({
700
+ justifyContent: 'end',
701
+ display: 'flex',
702
+ marginTop: 0,
703
+ padding: `16px 0`,
704
+ gap: 12,
705
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
706
+ marginTop: 24,
707
+ padding: 0,
708
+ },
709
+ });
710
+ });
711
+ const ButtonAuth = styled(Button$1)(({ theme }) => ({
712
+ justifyContent: 'center',
713
+ alignItems: 'center',
714
+ borderRadius: '100px !important',
715
+ borderColor: theme.palette.primary.main,
716
+ borderStyle: 'solid',
717
+ borderWidth: 1,
718
+ flex: 1,
719
+ height: 40,
720
+ minWidth: 'max-content !important',
721
+ }));
722
+ const TypographyAuth = styled(Typography)(({ theme }) => ({
723
+ textTransform: 'none',
724
+ }));
725
+ const StyledMenu = styled(Menu)(({ theme }) => {
726
+ var _a;
727
+ return ({
728
+ '& .MuiMenu-paper': {
729
+ left: 'auto',
730
+ width: 'fit-content',
731
+ maxWidth: 'unset',
732
+ boxShadow: 'inset',
733
+ borderRadius: 16,
734
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
735
+ left: `0 !important`,
736
+ width: '100%',
737
+ boxShadow: 'none !important',
738
+ borderRadius: 'none',
739
+ },
740
+ },
741
+ });
742
+ });
743
+ const DivProductListing = styled('div')(({ theme }) => {
744
+ var _a;
745
+ return ({
746
+ padding: '0 16px',
747
+ display: 'flex',
748
+ flexDirection: 'column',
749
+ alignSelf: 'stretch',
750
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
751
+ padding: 16,
752
+ },
753
+ });
754
+ });
755
+ const StyledMenuItem = styled(MenuItem)(({ theme }) => {
756
+ var _a;
757
+ return ({
758
+ display: 'flex',
759
+ borderBottom: 'none',
760
+ alignItems: 'flex-start',
761
+ gap: 6,
762
+ padding: '16px 0 !important',
763
+ '&:last-child': {
764
+ borderBottom: 'none !important',
765
+ },
766
+ width: '100%',
767
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
768
+ borderBottom: `1px solid ${theme.palette.divider} !important`,
769
+ },
770
+ });
771
+ });
772
+ const SpanImageWrapper = styled('span')(({ theme }) => ({
773
+ alignItems: 'center',
774
+ display: 'flex',
775
+ justifyContent: 'center',
776
+ margin: 'auto 0',
777
+ }));
778
+ const ImageProductIcon = styled('img')(({ theme }) => ({
779
+ aspectRatio: 1,
780
+ objectPosition: 'center',
781
+ width: 18,
782
+ height: 18,
783
+ }));
784
+ const StyledMenuItemDesktop = styled(MenuItem)(({ theme }) => {
785
+ var _a, _b;
786
+ return ({
787
+ color: `${((_a = theme.palette.secondary) === null || _a === void 0 ? void 0 : _a.main) || '#f00'} !important`,
788
+ display: 'flex',
789
+ borderBottom: 'none',
790
+ alignItems: 'flex-start',
791
+ gap: 6,
792
+ padding: '16px 0 !important',
793
+ '&:last-child': {
794
+ borderBottom: 'none !important',
795
+ },
796
+ width: '100%',
797
+ [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
798
+ borderBottom: `1px solid ${theme.palette.divider} !important`,
799
+ },
800
+ });
801
+ });
802
+ const StyledCloseIcon = styled(CloseIcon)(({ theme }) => {
803
+ var _a;
804
+ return ({
805
+ color: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'}`,
806
+ });
807
+ });
808
+ const StyledAvatarUserIcon = styled(Avatar)(({ theme }) => {
809
+ var _a, _b;
810
+ return ({
811
+ margin: '15px 0',
812
+ cursor: 'pointer',
813
+ backgroundColor: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'} !important`,
814
+ [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
815
+ margin: '0',
816
+ },
817
+ });
818
+ });
819
+ const StyledMenuIcon = styled(MenuIcon)(({ theme, ispartnershippagemobileview, scrolled }) => {
820
+ var _a, _b;
821
+ return ({
822
+ color: ispartnershippagemobileview && !scrolled
823
+ ? ((_a = theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff'
824
+ : `${((_b = theme.palette.text) === null || _b === void 0 ? void 0 : _b.primary) || '#000'}`,
825
+ });
826
+ });
827
+ const StyledDrawer$3 = styled(Drawer)(({ theme }) => {
828
+ var _a;
829
+ return ({
830
+ '& .MuiMenu-paper': {
831
+ left: 'auto',
832
+ width: 'fit-content',
833
+ maxWidth: 'unset',
834
+ boxShadow: 'inset',
835
+ borderRadius: 16,
836
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
837
+ left: `0 !important`,
838
+ width: '100%',
839
+ boxShadow: 'none !important',
840
+ borderRadius: 'none',
841
+ },
842
+ },
843
+ });
844
+ });
845
+ const DivLogoWrapper = styled('div')(({ theme }) => ({
846
+ justifyContent: 'space-between',
847
+ alignSelf: 'stretch',
848
+ backgroundColor: '',
849
+ display: 'flex',
850
+ gap: '20px',
851
+ padding: '12px 16px',
852
+ marginBottom: 16,
853
+ }));
854
+ const DivLogo = styled('div')(({ theme }) => {
855
+ var _a, _b;
856
+ return ({
857
+ margin: 'auto 40 auto 0',
858
+ display: '-webkit-box',
859
+ [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.up('md')]: {
860
+ width: 95,
861
+ height: 57,
862
+ },
863
+ [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
864
+ width: 60,
865
+ height: 36,
866
+ display: 'flex',
867
+ },
868
+ });
869
+ });
870
+ const DivCrossIconWrapper = styled('div')(({ theme }) => ({
871
+ display: 'flex',
872
+ alignItems: 'center',
873
+ justifyContent: 'center',
874
+ padding: 6,
875
+ }));
876
+ const StyledCloseIconBtn = styled(IconButton)(({ theme }) => {
877
+ var _a;
878
+ return ({
879
+ color: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'} !important`,
880
+ padding: '0 !important',
881
+ });
882
+ });
883
+ const DivLoginActionContainer = styled('div')(({ theme }) => ({
884
+ justifyContent: 'center',
885
+ alignSelf: 'stretch',
886
+ display: 'flex',
887
+ flexDirection: 'column',
888
+ padding: ' 0 16px',
889
+ }));
890
+ const DivCommonMenus = styled('div')(({ theme }) => ({
891
+ padding: 16,
892
+ display: 'flex',
893
+ flexDirection: 'column',
894
+ alignSelf: 'stretch',
895
+ alignItems: 'flex-start',
896
+ }));
897
+ const MenuItemOtherLinks = styled(MenuItem)(({ theme }) => ({
898
+ display: 'flex',
899
+ borderBottom: `1px solid ${theme.palette.divider} !important`,
900
+ alignItems: 'flex-start',
901
+ padding: '16px 0 !important',
902
+ '&:last-child': {
903
+ borderBottom: 'none !important',
904
+ gap: '30px',
905
+ justifyContent: 'space-between',
906
+ },
907
+ width: '100%',
908
+ gap: '50%',
909
+ }));
910
+ const StyledFormControlLabel = styled(FormControlLabel)(({ theme }) => ({
911
+ '& .MuiRadio-root': {
912
+ padding: '0 9px',
913
+ },
914
+ }));
915
+ const ButtonLogout = styled(Button$1)(({ theme }) => {
916
+ var _a, _b;
917
+ return ({
918
+ display: 'flex',
919
+ padding: 16,
920
+ alignItems: 'center',
921
+ gap: 78,
922
+ alignSelf: 'stretch',
923
+ width: '100%',
924
+ flex: '1 0 0',
925
+ justifyContent: 'center',
926
+ flexDirection: 'column',
927
+ borderRadius: '100px !important',
928
+ border: `1px solid ${((_a = theme.palette.secondary) === null || _a === void 0 ? void 0 : _a.main) || '#f00'} !important`,
929
+ color: `${((_b = theme.palette.secondary) === null || _b === void 0 ? void 0 : _b.main) || '#f00'} !important`,
930
+ });
931
+ });
932
+ const DivLogoutBtnWrapper = styled('div')(({ theme }) => ({
933
+ margin: 16,
934
+ }));
935
+ const AnchorLink$1 = styled('a')(({ theme }) => ({
936
+ color: 'inherit',
937
+ '&:hover': {
938
+ color: 'inherit',
939
+ },
940
+ }));
941
+ const StyledButton = styled(Button$1)(({ theme }) => {
942
+ var _a, _b, _c, _d;
943
+ return ({
944
+ alignSelf: 'start',
945
+ backgroundColor: (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main,
946
+ color: ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.common) === null || _d === void 0 ? void 0 : _d.white) || '#fff',
947
+ height: '40px',
948
+ borderRadius: '100px',
949
+ padding: '10px 24px',
950
+ });
951
+ });
952
+ const StyledButtonBanner = styled(Button$1)(({ theme }) => ({
953
+ alignSelf: 'start',
954
+ height: '40px',
955
+ borderRadius: '100px',
956
+ padding: '10px 24px',
957
+ }));
958
+ const TypographyBtnText = styled(Typography)(({ theme }) => {
959
+ var _a, _b;
960
+ return ({
961
+ color: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.white) || '#fff',
962
+ textTransform: 'none',
963
+ });
964
+ });
965
+
966
+ /**
967
+ * Header component with tenant theme support and responsive navigation
968
+ *
969
+ * @example
970
+ * ```tsx
971
+ * <Header
972
+ * logo={logoSrc}
973
+ * navigationLinks={navLinks}
974
+ * languages={languageOptions}
975
+ * currentLocale="en"
976
+ * onLogoClick={() => history.push('/')}
977
+ * onLoginClick={() => setShowLoginModal(true)}
978
+ * />
979
+ * ```
980
+ */
981
+ function Header$1({ logo, alternateLogo, showAlternateLogo = false, navigationLinks, languages, currentLocale, currentLang, userToken, userFirstName, isMobile: propIsMobile, scrolled = false, isPartnershipPageMobileView = false, isPartnershipPagePCView = false, isSeoPageView = false, showGetQuoteButton = false, bannerData, ctaData, host = '', welcomeMessage, formatMessage = (descriptor) => descriptor.id, menuItems, userProfileComponent, onLogoClick, onProductMenuClick, onLanguageChange, onLoginClick, onSignupClick, onLogoutClick, onPartnershipClick, onAboutUsClick, onBlogClick, onMyProfileClick, onGetQuoteClick, onPartnershipCTAClick, }) {
982
+ var _a, _b;
983
+ const tenantTheme = useTenantTheme();
984
+ tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
985
+ const muiTheme = useTheme();
986
+ const themeBreakpoint = useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
987
+ const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
988
+ const [anchorElNav, setAnchorElNav] = React.useState(null);
989
+ const [anchorElLanguage, setAnchorElLanguage] = React.useState(null);
990
+ const [anchorElUserMenu, setAnchorElUserMenu] = React.useState(null);
991
+ const shouldShowContent = (!isPartnershipPagePCView || (isPartnershipPagePCView && !scrolled)) &&
992
+ (!isSeoPageView || (isSeoPageView && !scrolled));
993
+ const firstName1stLetter = ((_b = userFirstName === null || userFirstName === void 0 ? void 0 : userFirstName.trim()) === null || _b === void 0 ? void 0 : _b.slice(0, 1)) || '';
994
+ const handleOpenNavMenu = (event) => {
995
+ setAnchorElNav(event.currentTarget);
996
+ };
997
+ const handleOpenLanguageMenu = (event) => {
998
+ setAnchorElLanguage(event.currentTarget);
999
+ };
1000
+ const handleCloseNavMenu = () => {
1001
+ setAnchorElNav(null);
1002
+ };
1003
+ const handleCloseLanguageMenu = () => {
1004
+ setAnchorElLanguage(null);
1005
+ };
1006
+ const handleOpenUserMenu = (event) => {
1007
+ setAnchorElUserMenu(event.currentTarget);
1008
+ };
1009
+ const handleCloseUserMenu = () => {
1010
+ setAnchorElUserMenu(null);
1011
+ };
1012
+ const displayLogo = showAlternateLogo && alternateLogo ? alternateLogo : logo;
1013
+ return (jsx(StyledAppBar$1, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled }, { children: jsx(ResponsiveB2CLayout, { children: jsx(StyledContainer, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled, maxWidth: "xl" }, { children: jsxs(Toolbar, Object.assign({ disableGutters: true }, { children: [jsx("a", Object.assign({ href: host || '#', onClick: (e) => {
1014
+ e === null || e === void 0 ? void 0 : e.preventDefault();
1015
+ onLogoClick === null || onLogoClick === void 0 ? void 0 : onLogoClick();
1016
+ }, style: Object.assign({ marginRight: isMobile ? 2 : 5, display: 'flex', flexGrow: isMobile ? 1 : 0, fontFamily: 'monospace', fontWeight: 700, letterSpacing: '.3rem', color: 'inherit' }, (isMobile && { height: '44px', width: '73.3px' })) }, { children: jsx(TypographyLogo, Object.assign({ variant: "h6", noWrap: true, sx: {
1017
+ mr: isMobile ? 2 : 5,
1018
+ display: { xs: 'flex', md: 'flex' },
1019
+ flexGrow: isMobile ? 1 : 0,
1020
+ fontFamily: 'monospace',
1021
+ fontWeight: 700,
1022
+ letterSpacing: '.3rem',
1023
+ color: 'inherit',
1024
+ textDecoration: 'none',
1025
+ } }, { children: jsx("img", { src: displayLogo, alt: "Logo", style: Object.assign({}, (isMobile && { height: '32px', width: '119px' })), height: isMobile ? '32px' : '57px', width: isMobile ? '119px' : '93.36px' }) })) })), !isMobile && (jsxs(Fragment, { children: [shouldShowContent && (jsxs(Box, Object.assign({ sx: {
1026
+ flexGrow: 1,
1027
+ display: { xs: 'none', md: 'flex', gap: 40 },
1028
+ } }, { children: [jsxs(ButtonDesktopMenu, Object.assign({ onClick: handleOpenNavMenu, sx: { my: 2, textTransform: 'capitalize' }, "data-testid": "productNavigationMenu" }, { children: [jsx(Typography, Object.assign({ variant: "h6" }, { children: formatMessage({ id: 'Products' }) })), jsx(Icon, { component: ArrowDropDownIcon })] }), "product"), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.partnership) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onPartnershipClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: jsx(AnchorLink$1, Object.assign({ href: `${host}${menuItems.partnership.route}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.partnership.label })) })) }), "partnership")), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.aboutUs) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onAboutUsClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: jsx(AnchorLinks, Object.assign({ href: `${host}${menuItems.aboutUs.route}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.aboutUs.label })) })) }), "aboutus")), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.blog) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onBlogClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: jsx(AnchorLink$1, Object.assign({ href: menuItems.blog.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.blog.label })) })) }), "blog"))] }))), jsxs(Box, Object.assign({ sx: {
1029
+ flexGrow: 1,
1030
+ display: {
1031
+ xs: 'none',
1032
+ md: 'flex',
1033
+ gap: 40,
1034
+ justifyContent: 'flex-end',
1035
+ },
1036
+ } }, { children: [shouldShowContent && (jsxs(ButtonDesktopMenu, Object.assign({ onClick: handleOpenLanguageMenu, sx: { my: 2, textTransform: 'capitalize' }, "data-testid": "selectedLocale" }, { children: [jsx(Typography, Object.assign({ variant: "h6" }, { children: formatMessage({
1037
+ id: `${currentLocale === null || currentLocale === void 0 ? void 0 : currentLocale.toLocaleUpperCase()}`,
1038
+ }) })), jsx(Icon, { component: ArrowDropDownIcon })] }), "language")), isPartnershipPagePCView && scrolled ? (jsx(StyledButton, Object.assign({ variant: "contained", onClick: onPartnershipCTAClick }, { children: jsx(TypographyBtnText, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Be Our Partner' }) })) }))) : isSeoPageView && scrolled && bannerData ? (jsx(StyledButtonBanner, Object.assign({ style: { background: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaBGColor }, variant: "contained", onClick: onGetQuoteClick }, { children: jsx(Typography, Object.assign({ style: {
1039
+ color: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaTextColor,
1040
+ textTransform: 'none',
1041
+ }, variant: "body1" }, { children: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaText })) }))) : userToken ? (jsx(StyledAvatar, Object.assign({ onClick: handleOpenUserMenu, "data-testid": "user-profile-avatar" }, { children: firstName1stLetter }))) : (jsxs(DivButtonWrapper, { children: [jsx(ButtonAuth, Object.assign({ color: "primary", variant: "outlined", sx: { textTransform: 'capitalize' }, onClick: onLoginClick, "data-testid": "headerLogin" }, { children: jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Log in' }) })) })), jsx(ButtonAuth, Object.assign({ color: "primary", variant: "contained", sx: { textTransform: 'capitalize' }, onClick: onSignupClick }, { children: jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Sign up' }) })) }))] }))] })), jsx(StyledMenu, Object.assign({ id: "menu-appbar", anchorEl: anchorElNav, anchorOrigin: {
1042
+ vertical: 'bottom',
1043
+ horizontal: 'left',
1044
+ }, keepMounted: true, transformOrigin: {
1045
+ vertical: 'top',
1046
+ horizontal: 'left',
1047
+ }, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, sx: {
1048
+ display: { xs: 'none', md: 'block' },
1049
+ } }, { children: jsx(DivProductListing, { children: navigationLinks.map(({ key, name, icon }) => (jsxs(StyledMenuItem, Object.assign({ onClick: () => {
1050
+ onProductMenuClick === null || onProductMenuClick === void 0 ? void 0 : onProductMenuClick(key);
1051
+ handleCloseNavMenu();
1052
+ }, "data-testid": `product-navigation-${key}` }, { children: [jsx(SpanImageWrapper, { children: jsx(ImageProductIcon, { src: icon, width: 18, height: 18, alt: name }) }), jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: jsx(AnchorLinks, Object.assign({ href: `#${key}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: `${name}` }) })) }))] }), key))) }) })), jsx(StyledMenu, Object.assign({ id: "language-menu", anchorEl: anchorElLanguage, anchorOrigin: {
1053
+ vertical: 'bottom',
1054
+ horizontal: 'left',
1055
+ }, keepMounted: true, transformOrigin: {
1056
+ vertical: 'top',
1057
+ horizontal: 'left',
1058
+ }, open: Boolean(anchorElLanguage), onClose: handleCloseLanguageMenu, sx: {
1059
+ display: { xs: 'none', md: 'block' },
1060
+ } }, { children: jsx(DivProductListing, { children: languages.map(({ value, locale, label }) => (jsx(StyledMenuItem, Object.assign({ onClick: () => {
1061
+ onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(locale, value);
1062
+ handleCloseLanguageMenu();
1063
+ }, "data-testid": `lang-${locale}` }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: label })) }), value))) }) })), jsx(StyledMenu, Object.assign({ id: "user-menu", anchorEl: anchorElUserMenu, anchorOrigin: {
1064
+ vertical: 'bottom',
1065
+ horizontal: 'left',
1066
+ }, keepMounted: true, transformOrigin: {
1067
+ vertical: 'top',
1068
+ horizontal: 'left',
1069
+ }, open: Boolean(anchorElUserMenu), onClose: handleCloseUserMenu, sx: {
1070
+ display: { xs: 'none', md: 'block' },
1071
+ } }, { children: jsxs(DivProductListing, { children: [jsx(StyledMenuItem, Object.assign({ onClick: () => {
1072
+ onMyProfileClick === null || onMyProfileClick === void 0 ? void 0 : onMyProfileClick();
1073
+ handleCloseUserMenu();
1074
+ } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `My profile` }) })) }), "myProfile"), jsx(StyledMenuItemDesktop, Object.assign({ onClick: () => {
1075
+ onLogoutClick === null || onLogoutClick === void 0 ? void 0 : onLogoutClick();
1076
+ handleCloseUserMenu();
1077
+ } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `Logout` }) })) }), "logout")] }) }))] })), isMobile && (jsxs(Box, Object.assign({ sx: { flexGrow: 0, display: { xs: 'flex', md: 'none' } } }, { children: [jsx(IconButton, Object.assign({ size: "large", "aria-label": "account of current user", "aria-controls": "menu-appbar", "aria-haspopup": "true", "aria-labelledby": "menu icon", onClick: (e) => {
1078
+ if (isPartnershipPageMobileView && scrolled) {
1079
+ onPartnershipCTAClick === null || onPartnershipCTAClick === void 0 ? void 0 : onPartnershipCTAClick();
1080
+ }
1081
+ else if (isSeoPageView && scrolled) {
1082
+ onGetQuoteClick === null || onGetQuoteClick === void 0 ? void 0 : onGetQuoteClick();
1083
+ }
1084
+ else {
1085
+ handleOpenNavMenu(e);
1086
+ }
1087
+ }, color: "inherit", sx: Object.assign({}, (isPartnershipPageMobileView &&
1088
+ scrolled && { padding: '0px !important' })) }, { children: Boolean(anchorElNav) ? (jsx(StyledCloseIcon, {})) : isPartnershipPageMobileView && scrolled ? (jsx(StyledButton, Object.assign({ variant: "contained", onClick: onPartnershipCTAClick }, { children: jsx(TypographyBtnText, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Be Our Partner' }) })) }))) : isSeoPageView && scrolled && bannerData ? (jsx(StyledButtonBanner, Object.assign({ style: {
1089
+ background: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaBGColor,
1090
+ }, variant: "contained", onClick: onGetQuoteClick }, { children: jsx(Typography, Object.assign({ style: {
1091
+ color: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaTextColor,
1092
+ textTransform: 'none',
1093
+ }, variant: "body1" }, { children: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaText })) }))) : userToken ? (jsx(StyledAvatarUserIcon, Object.assign({ "data-testid": "user-profile-avatar" }, { children: firstName1stLetter }))) : (jsx(StyledMenuIcon, { ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled })) })), jsxs(StyledDrawer$3, Object.assign({ id: "menu-appbar", anchor: "top", keepMounted: true, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, sx: {
1094
+ display: { xs: 'block', md: 'none' },
1095
+ width: '100%',
1096
+ left: 0,
1097
+ } }, { children: [jsxs(DivLogoWrapper, { children: [jsx(DivLogo, { children: jsx("img", { src: logo, alt: "logo", width: "100%", height: "100%" }) }), jsx(DivCrossIconWrapper, { children: jsx(StyledCloseIconBtn, Object.assign({ size: "large", "aria-label": "close menu", "aria-controls": "menu-appbar", "aria-haspopup": "true", onClick: handleCloseNavMenu, color: "inherit" }, { children: jsx(CloseIcon, {}) })) })] }), userToken ? (userProfileComponent) : (jsxs(DivLoginActionContainer, { children: [jsx(Typography, Object.assign({ variant: "h6" }, { children: welcomeMessage || formatMessage({ id: 'Welcome' }) })), jsxs(DivButtonWrapper, { children: [jsx(ButtonAuth, Object.assign({ color: "primary", variant: "outlined", onClick: () => {
1098
+ onLoginClick === null || onLoginClick === void 0 ? void 0 : onLoginClick();
1099
+ handleCloseNavMenu();
1100
+ }, "data-testid": "headerLogin" }, { children: jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Log in' }) })) })), jsx(ButtonAuth, Object.assign({ color: "primary", variant: "contained", onClick: () => {
1101
+ onSignupClick === null || onSignupClick === void 0 ? void 0 : onSignupClick();
1102
+ handleCloseNavMenu();
1103
+ } }, { children: jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Sign up' }) })) }))] })] })), jsx(DivProductListing, { children: navigationLinks.map(({ key, name, icon }) => (jsxs(StyledMenuItem, Object.assign({ onClick: () => {
1104
+ onProductMenuClick === null || onProductMenuClick === void 0 ? void 0 : onProductMenuClick(key);
1105
+ handleCloseNavMenu();
1106
+ }, "data-testid": `product-navigation-${key}` }, { children: [jsx(SpanImageWrapper, { children: jsx(ImageProductIcon, { src: icon, width: 18, height: 18, alt: name }) }), jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `${name}` }) }))] }), key))) }), jsxs(DivCommonMenus, { children: [userToken && (jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1107
+ handleCloseNavMenu();
1108
+ onMyProfileClick === null || onMyProfileClick === void 0 ? void 0 : onMyProfileClick();
1109
+ } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: 'My Policy' }) })) }))), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.blog) && (jsx(MenuItemOtherLinks, Object.assign({ onClick: onBlogClick }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: jsx(AnchorLink$1, Object.assign({ href: menuItems.blog.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.blog.label })) })) }))), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.partnership) && (jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1110
+ handleCloseNavMenu();
1111
+ onPartnershipClick === null || onPartnershipClick === void 0 ? void 0 : onPartnershipClick();
1112
+ } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: menuItems.partnership.label })) }))), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.aboutUs) && (jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1113
+ handleCloseNavMenu();
1114
+ onAboutUsClick === null || onAboutUsClick === void 0 ? void 0 : onAboutUsClick();
1115
+ } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: menuItems.aboutUs.label })) }))), jsxs(MenuItemOtherLinks, { children: [jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: 'Language' }) })), jsx(RadioGroup, Object.assign({ row: true, "aria-labelledby": "language-selector", name: "language-selector", onChange: (e) => {
1116
+ const value = e.target.value;
1117
+ const selectedLang = languages.find((lang) => lang.locale === value);
1118
+ if (selectedLang) {
1119
+ onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(selectedLang.locale, selectedLang.value);
1120
+ }
1121
+ }, defaultValue: currentLocale, value: currentLocale }, { children: languages.map((lang) => (jsx(StyledFormControlLabel, { value: lang.locale, control: jsx(Radio, {}), label: lang.label, "data-testid": `lang-${lang.locale}` }, lang.locale))) }))] })] }), isMobile && userToken && (jsx(DivLogoutBtnWrapper, { children: jsx(ButtonLogout, Object.assign({ onClick: onLogoutClick }, { children: formatMessage({ id: 'Logout' }) })) }))] }))] })))] })) })) }) })));
1122
+ }
1123
+
1124
+ const StyledAppBar = styled(AppBar$1)(({ theme }) => ({
1125
+ backgroundColor: '#FFFFFF',
1126
+ boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
1127
+ zIndex: theme.zIndex.drawer + 1,
1128
+ }));
1129
+ const StyledToolbar = styled(Toolbar)(({ theme }) => ({
1130
+ display: 'flex',
1131
+ alignItems: 'center',
1132
+ justifyContent: 'space-between',
1133
+ padding: '12px 16px',
1134
+ minHeight: '64px !important',
1135
+ [theme.breakpoints.down('md')]: {
1136
+ minHeight: '56px !important',
1137
+ padding: '12px 16px',
1138
+ },
1139
+ }));
1140
+ const LogoContainer = styled('div')(({ theme }) => ({
1141
+ display: 'flex',
1142
+ alignItems: 'center',
1143
+ cursor: 'pointer',
1144
+ height: '32px',
1145
+ }));
1146
+ const LogoImage = styled('img')(({ theme }) => ({
1147
+ height: '32px',
1148
+ width: 'auto',
1149
+ objectFit: 'contain',
1150
+ }));
1151
+ const MenuIconButton = styled(IconButton)(({ theme }) => ({
1152
+ padding: '6px',
1153
+ borderRadius: '25px',
1154
+ width: '40px',
1155
+ height: '40px',
1156
+ '& .MuiSvgIcon-root': {
1157
+ color: '#000000',
1158
+ fontSize: '24px',
1159
+ },
1160
+ }));
1161
+ const StyledDrawer$2 = styled(Drawer)(({ theme }) => ({
1162
+ '& .MuiDrawer-paper': {
1163
+ backgroundColor: '#FFFFFF',
1164
+ boxSizing: 'border-box',
1165
+ },
1166
+ }));
1167
+ const DrawerHeader$2 = styled(Box)(({ theme }) => ({
1168
+ display: 'flex',
1169
+ alignItems: 'center',
1170
+ justifyContent: 'space-between',
1171
+ padding: '12px 16px',
1172
+ minHeight: '64px',
1173
+ }));
1174
+ const DrawerLogoContainer = styled('div')(({ theme }) => ({
1175
+ display: 'flex',
1176
+ alignItems: 'center',
1177
+ cursor: 'pointer',
1178
+ height: '32px',
1179
+ }));
1180
+ const CloseIconButton = styled(IconButton)(({ theme }) => ({
1181
+ padding: '6px',
1182
+ '& .MuiSvgIcon-root': {
1183
+ color: '#000000',
1184
+ fontSize: '24px',
1185
+ },
1186
+ }));
1187
+ const DrawerContent$2 = styled(Box)(({ theme }) => ({
1188
+ flex: 1,
1189
+ overflowY: 'auto',
1190
+ paddingBottom: theme.spacing(2),
1191
+ }));
1192
+ styled(Box)(({ theme }) => ({
1193
+ padding: theme.spacing(2),
1194
+ borderTop: `1px solid ${theme.palette.divider}`,
1195
+ }));
1196
+
1197
+ /**
1198
+ * NewHeader component - simplified design based on Figma
1199
+ *
1200
+ * @example
1201
+ * ```tsx
1202
+ * <NewHeader
1203
+ * logo={logoSrc}
1204
+ * navigationLinks={navLinks}
1205
+ * onLogoClick={() => history.push('/')}
1206
+ * />
1207
+ * ```
1208
+ */
1209
+ function NewHeader({ logo: propLogo, navigationLinks = [], additionalMenuSections = [], isMobile: propIsMobile, onLogoClick, onMenuOpen, onMenuClose, customDrawerContent, formatMessage = (descriptor) => descriptor.id, }) {
1210
+ var _a;
1211
+ const tenantTheme = useTenantTheme();
1212
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
1213
+ const muiTheme = useTheme();
1214
+ const themeBreakpoint = useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1215
+ const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
1216
+ // Use prop logo if provided, otherwise try to get from theme
1217
+ // Fallback to empty string to avoid SSR errors
1218
+ const logo = propLogo || (theme === null || theme === void 0 ? void 0 : theme.logo) || '';
1219
+ const [drawerOpen, setDrawerOpen] = React.useState(false);
1220
+ const handleDrawerOpen = () => {
1221
+ setDrawerOpen(true);
1222
+ onMenuOpen === null || onMenuOpen === void 0 ? void 0 : onMenuOpen();
1223
+ };
1224
+ const handleDrawerClose = () => {
1225
+ setDrawerOpen(false);
1226
+ onMenuClose === null || onMenuClose === void 0 ? void 0 : onMenuClose();
1227
+ };
1228
+ const handleLogoClick = (e) => {
1229
+ e.preventDefault();
1230
+ onLogoClick === null || onLogoClick === void 0 ? void 0 : onLogoClick();
1231
+ };
1232
+ const handleMenuItemClick = (item) => {
1233
+ var _a;
1234
+ (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item);
1235
+ handleDrawerClose();
1236
+ };
1237
+ return (jsxs(Fragment, { children: [jsx(StyledAppBar, Object.assign({ position: "fixed" }, { children: jsxs(StyledToolbar, Object.assign({ disableGutters: true }, { children: [jsx(LogoContainer, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage, { src: logo, alt: "Logo" }) })), jsx(MenuIconButton, Object.assign({ size: "large", edge: "end", "aria-label": "menu", onClick: handleDrawerOpen }, { children: jsx(MenuIcon, {}) }))] })) })), jsx(StyledDrawer$2, Object.assign({ anchor: "right", open: drawerOpen, onClose: handleDrawerClose }, { children: customDrawerContent ? (jsx(Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: customDrawerContent }))) : (jsxs(Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: [jsxs(DrawerHeader$2, { children: [jsx(DrawerLogoContainer, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage, { src: logo, alt: "Logo" }) })), jsx(CloseIconButton, Object.assign({ onClick: handleDrawerClose, "aria-label": "close" }, { children: jsx(CloseIcon, {}) }))] }), jsx(Divider, {}), jsxs(DrawerContent$2, { children: [navigationLinks.length > 0 && (jsx(List, { children: navigationLinks.map((item) => (jsx(ListItem, Object.assign({ disablePadding: true }, { children: jsx(ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsx(ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })), additionalMenuSections.map((section, index) => (jsxs(React.Fragment, { children: [section.title && (jsxs(Fragment, { children: [jsx(Divider, {}), jsx(Box, Object.assign({ sx: { px: 2, py: 1 } }, { children: jsx(ListItemText, { primary: formatMessage({ id: section.title }), primaryTypographyProps: {
1238
+ variant: 'caption',
1239
+ color: 'text.secondary',
1240
+ } }) }))] })), jsx(List, { children: section.items.map((item) => (jsx(ListItem, Object.assign({ disablePadding: true }, { children: jsx(ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsx(ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })] }, index)))] })] }))) }))] }));
1241
+ }
1242
+
1243
+ const DivFooter = styled('div')(({ theme }) => ({
1244
+ backgroundColor: '#424242',
1245
+ padding: '20px 16px',
1246
+ '@media (min-width: 769px)': {
1247
+ padding: '70px 0px',
1248
+ },
1249
+ anchorLinks: {
1250
+ color: 'inherit',
1251
+ '&:hover': {
1252
+ color: 'inherit',
1253
+ },
1254
+ },
1255
+ }));
1256
+ const DivFooterConterResponsiveLayout = styled('div')(({ theme }) => ({
1257
+ color: '#fff',
1258
+ [theme.breakpoints.up(1025)]: {
1259
+ minWidth: '1128px',
1260
+ maxWidth: '1128px',
1261
+ margin: '0 auto',
1262
+ },
1263
+ }));
1264
+ const FooterHiddenContent = styled('div')(({ theme, simplifiedLayout }) => simplifiedLayout ? { display: 'none' } : { display: 'flex' });
1265
+ const DivIglooIntro = styled('div')(({ theme }) => {
1266
+ var _a;
1267
+ return ({
1268
+ display: 'flex',
1269
+ flexDirection: 'column',
1270
+ gap: '24px',
1271
+ color: ((_a = theme === null || theme === void 0 ? void 0 : theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff',
1272
+ '@media (min-width: 769px)': {
1273
+ width: 320,
1274
+ marginRight: 194,
1275
+ },
1276
+ });
1277
+ });
1278
+ const DivSocial = styled('div')(({ theme }) => ({
1279
+ display: 'flex',
1280
+ alignItems: 'center',
1281
+ margin: '0 auto',
1282
+ columnGap: '32px',
1283
+ flexDirection: 'row',
1284
+ '@media (min-width: 769px)': {
1285
+ margin: 'initial',
1286
+ },
1287
+ }));
1288
+ const ButtonIcon = styled(Button$1)(({ theme }) => {
1289
+ var _a;
1290
+ return ({
1291
+ color: ((_a = theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff',
1292
+ padding: '0 !important',
1293
+ minWidth: 'auto !important',
1294
+ });
1295
+ });
1296
+ const TypographyIntro = styled(Typography)(({ theme }) => ({
1297
+ textAlign: 'center',
1298
+ color: `#fff !important`,
1299
+ '@media (min-width: 769px)': {
1300
+ textAlign: 'left',
1301
+ },
1302
+ }));
1303
+ const TypographyAddressFooter = styled(Typography)(({ theme }) => ({
1304
+ marginTop: 16,
1305
+ textAlign: 'center',
1306
+ color: '#fff',
1307
+ '@media (min-width: 769px)': {
1308
+ textAlign: 'left',
1309
+ },
1310
+ }));
1311
+ const DivLogos = styled('div')(({ theme }) => ({
1312
+ display: 'flex',
1313
+ flexDirection: 'column',
1314
+ gap: 16,
1315
+ alignItems: 'center',
1316
+ marginTop: 16,
1317
+ '@media (min-width: 769px)': {
1318
+ width: '100%',
1319
+ marginTop: 0,
1320
+ gap: 'initial',
1321
+ alignItems: 'baseline',
1322
+ },
1323
+ }));
1324
+ const DivFirstRow = styled('div')(({ theme }) => ({
1325
+ display: 'flex',
1326
+ flexDirection: 'row',
1327
+ gap: 16,
1328
+ }));
1329
+ const ButtonOjkLink = styled(Button$1)(({ theme }) => ({
1330
+ display: 'flex',
1331
+ justifyContent: 'flex-start',
1332
+ '@media (min-width: 769px)': {
1333
+ display: 'flex !important',
1334
+ justifyContent: 'flex-start !important ',
1335
+ },
1336
+ }));
1337
+ const ImageOjkLicense = styled('img')(({ theme }) => ({
1338
+ alignSelf: 'flex-start',
1339
+ height: 36,
1340
+ }));
1341
+ const ButtonSolisoustamaLink = styled(Button$1)(({ theme }) => ({
1342
+ display: 'flex',
1343
+ justifyContent: 'flex-start',
1344
+ }));
1345
+ const ImageSolisoustama = styled('img')(({ theme }) => ({
1346
+ height: 'auto',
1347
+ }));
1348
+ const DivLinks = styled('div')(({ theme }) => ({
1349
+ display: 'flex',
1350
+ flex: 1,
1351
+ alignItems: 'center',
1352
+ gap: 16,
1353
+ justifyContent: 'center',
1354
+ '@media (min-width: 769px)': {
1355
+ flex: '1 1',
1356
+ alignItems: 'normal',
1357
+ },
1358
+ }));
1359
+ const DivSection = styled('div')(({ theme }) => ({
1360
+ display: 'flex',
1361
+ flexDirection: 'column',
1362
+ gap: 16,
1363
+ flex: 1,
1364
+ alignItems: 'flex-start',
1365
+ '@media (min-width: 769px)': {
1366
+ gap: 24,
1367
+ '&:not(:first-of-type)': {
1368
+ marginLeft: 194,
1369
+ },
1370
+ },
1371
+ }));
1372
+ const ButtonBottomLink = styled(Button$1)(({ theme }) => ({
1373
+ color: '#fff !important',
1374
+ textTransform: 'capitalize',
1375
+ '@media (min-width: 769px)': {
1376
+ padding: '0 !important',
1377
+ textAlign: 'left !important',
1378
+ minWidth: 'auto !important',
1379
+ },
1380
+ }));
1381
+ const StyledDivider = styled(Divider)(({ theme }) => ({
1382
+ margin: '24px 0 16px !important',
1383
+ borderColor: '#5F5E62 !important',
1384
+ }));
1385
+ const DivBottom = styled('div')(({ theme }) => ({
1386
+ display: 'flex',
1387
+ justifyContent: 'space-between',
1388
+ alignItems: 'center',
1389
+ }));
1390
+ const DivSep = styled('div')(({ theme }) => ({
1391
+ width: '1px',
1392
+ height: 10,
1393
+ borderRadius: '1px',
1394
+ backgroundColor: '#fff',
1395
+ }));
1396
+ const AnchorLink = styled('a')(({ theme }) => ({
1397
+ color: 'inherit',
1398
+ '&:hover': {
1399
+ color: 'inherit',
1400
+ },
1401
+ }));
1402
+
1403
+ /**
1404
+ * Footer component with tenant theme support
1405
+ *
1406
+ * @example
1407
+ * ```tsx
1408
+ * <Footer
1409
+ * introText="Company introduction..."
1410
+ * socialLinks={socialMediaLinks}
1411
+ * licenseImages={licenses}
1412
+ * navigationLinks={footerNavLinks}
1413
+ * currentLocale="en"
1414
+ * />
1415
+ * ```
1416
+ */
1417
+ function Footer({ simplifiedLayout = false, introText, addressText, socialLinks, licenseImages, poweredByImage, navigationLinks = [], currentLocale, host = '', isMobile: propIsMobile, onLinkClick, onSocialClick, onPrivacyPolicyClick, onTermsOfServiceClick, formatMessage = (descriptor) => descriptor.id, }) {
1418
+ var _a;
1419
+ const tenantTheme = useTenantTheme();
1420
+ tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
1421
+ const muiTheme = useTheme();
1422
+ const themeBreakpoint = useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1423
+ const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
1424
+ return (jsx(DivFooter, { children: jsxs(DivFooterConterResponsiveLayout, { children: [jsxs(FooterHiddenContent, Object.assign({ simplifiedLayout: simplifiedLayout }, { children: [jsxs(DivIglooIntro, { children: [isMobile && (jsx(DivSocial, { children: socialLinks.map((social) => (jsx(ButtonIcon, Object.assign({ onClick: () => onSocialClick === null || onSocialClick === void 0 ? void 0 : onSocialClick(social.platform, social.url), "aria-label": social.ariaLabel || social.platform }, { children: jsx("img", { src: social.icon, alt: social.platform, loading: "lazy", height: "24px", width: "24px" }) }), social.platform))) })), jsx(TypographyIntro, Object.assign({ variant: "body2" }, { children: formatMessage({ id: introText }) })), addressText && (jsx(TypographyAddressFooter, Object.assign({ variant: "body2" }, { children: addressText }))), jsxs(DivLogos, { children: [jsx(DivFirstRow, { children: licenseImages.map((license, index) => (jsx(ButtonOjkLink, Object.assign({ onClick: () => license.url && window.open(license.url), "aria-label": license.ariaLabel || license.alt }, { children: jsx(ImageOjkLicense, { src: license.src, alt: license.alt, width: license.width, height: license.height, loading: "lazy" }) }), index))) }), poweredByImage && (jsx(ButtonSolisoustamaLink, Object.assign({ "aria-label": poweredByImage.ariaLabel || 'Powered by' }, { children: jsx(ImageSolisoustama, { src: poweredByImage.src, alt: poweredByImage.alt, width: poweredByImage.width, height: poweredByImage.height, loading: "lazy" }) })))] })] }), !isMobile && (jsx(DivLinks, { children: navigationLinks === null || navigationLinks === void 0 ? void 0 : navigationLinks.map((items, index) => (jsxs(DivSection, { children: [items === null || items === void 0 ? void 0 : items.map((link, _index) => {
1425
+ var _a, _b, _c;
1426
+ const isExternalURL = (_c = (_b = (_a = link.outerHref) === null || _a === void 0 ? void 0 : _a.split(':')) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.includes('http');
1427
+ const anchorLinkOuterRef = isExternalURL
1428
+ ? link.outerHref || ''
1429
+ : `${host}${link.outerHref}`;
1430
+ const anchorLinkInnerRef = `${host}${link.innerHref}`;
1431
+ return (jsx(ButtonBottomLink, Object.assign({ onClick: () => {
1432
+ onLinkClick === null || onLinkClick === void 0 ? void 0 : onLinkClick(link);
1433
+ } }, { children: jsx(Typography, Object.assign({ variant: "body1" }, { children: jsx(AnchorLink, Object.assign({ href: link.innerHref ? anchorLinkInnerRef : anchorLinkOuterRef || '', onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: `${link.label}` }) })) })) }), _index));
1434
+ }), index === navigationLinks.length - 1 && (jsxs(Fragment, { children: [jsx(ButtonBottomLink, Object.assign({ onClick: onPrivacyPolicyClick }, { children: jsx(Typography, Object.assign({ variant: "body1" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/privacypolicy`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Privacy Policy' }) })) })) })), jsx(ButtonBottomLink, Object.assign({ onClick: onTermsOfServiceClick }, { children: jsx(Typography, Object.assign({ variant: "body1" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/termsofservice`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Terms of Service' }) })) })) })), jsx(DivSocial, { children: socialLinks.map((social) => (jsx(ButtonIcon, Object.assign({ onClick: () => onSocialClick === null || onSocialClick === void 0 ? void 0 : onSocialClick(social.platform, social.url), "aria-label": social.ariaLabel || social.platform }, { children: jsx(AnchorLink, Object.assign({ href: social.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: jsx("img", { src: social.icon, alt: social.platform, height: isMobile ? '24' : '28', width: isMobile ? '24' : '28', loading: "lazy" }) })) }), social.platform))) })] }))] }, index))) }))] })), isMobile && jsx(StyledDivider, {}), isMobile && (jsx(DivBottom, { children: jsxs(DivLinks, { children: [jsx("div", Object.assign({ onClick: onPrivacyPolicyClick, style: { cursor: 'pointer' } }, { children: jsx(Typography, Object.assign({ variant: "body2" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/privacypolicy`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Privacy Policy' }) })) })) })), jsx(DivSep, {}), jsx("div", Object.assign({ onClick: onTermsOfServiceClick, style: { cursor: 'pointer' } }, { children: jsx(Typography, Object.assign({ variant: "body2" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/termsofservice`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Terms of Service' }) })) })) }))] }) }))] }) }));
1435
+ }
1436
+
1437
+ const StyledDrawer$1 = styled(Drawer)(({ theme }) => ({
1438
+ zIndex: '1300 !important',
1439
+ '& .MuiDrawer-root': {
1440
+ zIndex: 1300,
1441
+ },
1442
+ '& .MuiDrawer-paper': {
1443
+ backgroundColor: '#FFFFFF',
1444
+ boxSizing: 'border-box',
1445
+ overflow: 'hidden',
1446
+ zIndex: 1300,
1447
+ },
1448
+ '& .MuiBackdrop-root': {
1449
+ zIndex: 1299,
1450
+ },
1451
+ }));
1452
+ const DrawerHeader$1 = styled(Box)(({ theme }) => ({
1453
+ display: 'flex',
1454
+ alignItems: 'center',
1455
+ justifyContent: 'flex-start',
1456
+ padding: '16px',
1457
+ minHeight: '56px',
1458
+ }));
1459
+ const DrawerContent$1 = styled(Box)(({ theme }) => ({
1460
+ flex: 1,
1461
+ overflowY: 'auto',
1462
+ paddingBottom: theme.spacing(2),
1463
+ }));
1464
+ const DrawerFooter = styled(Box)(({ theme }) => ({
1465
+ padding: '16px',
1466
+ backgroundColor: '#FFFFFF',
1467
+ borderTop: 'none',
1468
+ boxShadow: '0px -2px 8px rgba(0, 0, 0, 0.08)',
1469
+ }));
1470
+ styled(Button$1)(({ theme }) => ({
1471
+ minWidth: 'auto',
1472
+ padding: 0,
1473
+ }));
1474
+ const HeaderSection = styled(Box)(({ theme }) => ({
1475
+ backgroundColor: '#FFFFFF',
1476
+ padding: '16px',
1477
+ display: 'flex',
1478
+ flexDirection: 'column',
1479
+ gap: '12px',
1480
+ }));
1481
+ const CategoryIcon = styled(Box)(({ theme }) => ({
1482
+ width: '32px',
1483
+ height: '32px',
1484
+ display: 'flex',
1485
+ alignItems: 'center',
1486
+ justifyContent: 'center',
1487
+ }));
1488
+ const TitleText = styled(Typography)(({ theme }) => ({
1489
+ fontFamily: '"Montserrat", sans-serif',
1490
+ fontWeight: 700,
1491
+ fontSize: '20px',
1492
+ lineHeight: '28px',
1493
+ color: '#13131B',
1494
+ }));
1495
+ const SubtitleText = styled(Typography)(({ theme }) => ({
1496
+ fontFamily: '"Montserrat", sans-serif',
1497
+ fontWeight: 400,
1498
+ fontSize: '14px',
1499
+ lineHeight: '18px',
1500
+ color: '#5F5E62',
1501
+ }));
1502
+ const FooterButtons = styled(Box)(({ theme }) => ({
1503
+ display: 'flex',
1504
+ flexDirection: 'column',
1505
+ gap: '16px',
1506
+ width: '100%',
1507
+ }));
1508
+ const PrimaryButton = styled(Button$1)(({ theme }) => ({
1509
+ backgroundColor: '#4E4EEB',
1510
+ color: '#FFFFFF',
1511
+ borderRadius: '8px',
1512
+ height: '48px',
1513
+ textTransform: 'none',
1514
+ fontFamily: '"Montserrat", sans-serif',
1515
+ fontWeight: 500,
1516
+ fontSize: '14px',
1517
+ lineHeight: '18px',
1518
+ '&:hover': {
1519
+ backgroundColor: '#3E3EDB',
1520
+ },
1521
+ '&:disabled': {
1522
+ backgroundColor: '#C8C5CA',
1523
+ color: '#FFFFFF',
1524
+ },
1525
+ }));
1526
+ const SecondaryButton = styled(Button$1)(({ theme }) => ({
1527
+ color: '#4E4EEB',
1528
+ borderRadius: '8px',
1529
+ height: '40px',
1530
+ textTransform: 'none',
1531
+ fontFamily: '"Montserrat", sans-serif',
1532
+ fontWeight: 500,
1533
+ fontSize: '14px',
1534
+ lineHeight: '18px',
1535
+ '&:hover': {
1536
+ backgroundColor: 'rgba(78, 78, 235, 0.08)',
1537
+ },
1538
+ }));
1539
+
1540
+ /**
1541
+ * RecommendationsDrawer - Mobile drawer for recommendations and forms
1542
+ *
1543
+ * @example
1544
+ * ```tsx
1545
+ * <RecommendationsDrawer
1546
+ * open={isOpen}
1547
+ * onClose={handleClose}
1548
+ * title="Personalize Your Plan"
1549
+ * subtitle="Answer a few questions"
1550
+ * primaryButtonText="Next"
1551
+ * onPrimaryAction={handleNext}
1552
+ * >
1553
+ * <QuestionSection question="What is your budget?" />
1554
+ * </RecommendationsDrawer>
1555
+ * ```
1556
+ */
1557
+ function RecommendationsDrawer({ open, onClose, children, headerIcon, title, subtitle, showBackButton = false, onBack, primaryButtonText, onPrimaryAction, primaryButtonDisabled = false, secondaryButtonText, onSecondaryAction, showFooter = true, customFooter, formatMessage = (descriptor) => descriptor.id, }) {
1558
+ var _a;
1559
+ const muiTheme = useTheme();
1560
+ useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1561
+ const handleClose = () => {
1562
+ onClose();
1563
+ };
1564
+ const handleBackOrClose = () => {
1565
+ if (showBackButton && onBack) {
1566
+ onBack();
1567
+ }
1568
+ else {
1569
+ onClose();
1570
+ }
1571
+ };
1572
+ return (jsx(StyledDrawer$1, Object.assign({ anchor: "bottom", open: open, onClose: handleClose, PaperProps: {
1573
+ sx: {
1574
+ height: '95vh',
1575
+ borderTopLeftRadius: '16px',
1576
+ borderTopRightRadius: '16px',
1577
+ maxHeight: '95vh',
1578
+ },
1579
+ }, sx: {
1580
+ zIndex: 1300,
1581
+ } }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', height: '100%' } }, { children: [jsx(DrawerHeader$1, { children: jsx(IconButton, Object.assign({ onClick: handleBackOrClose, sx: { padding: 0 }, "aria-label": showBackButton ? 'back' : 'close' }, { children: showBackButton ? jsx(ArrowBackIcon, {}) : jsx(CloseIcon, {}) })) }), (title || subtitle || headerIcon) && (jsxs(HeaderSection, { children: [headerIcon && (jsx(CategoryIcon, { children: jsx("img", { src: headerIcon, alt: "Category icon", width: 32, height: 32 }) })), title && (jsx(TitleText, Object.assign({ variant: "h5" }, { children: formatMessage({ id: title }) }))), subtitle && (jsx(SubtitleText, Object.assign({ variant: "body2" }, { children: formatMessage({ id: subtitle }) })))] })), jsx(DrawerContent$1, { children: children }), showFooter && (jsx(DrawerFooter, { children: customFooter ? (customFooter) : (jsxs(FooterButtons, { children: [primaryButtonText && (jsx(PrimaryButton, Object.assign({ variant: "contained", fullWidth: true, onClick: onPrimaryAction, disabled: primaryButtonDisabled }, { children: formatMessage({ id: primaryButtonText }) }))), secondaryButtonText && (jsx(SecondaryButton, Object.assign({ variant: "text", fullWidth: true, onClick: onSecondaryAction }, { children: formatMessage({ id: secondaryButtonText }) })))] })) }))] })) })));
1582
+ }
1583
+
1584
+ const StyledDrawer = styled$1(Drawer)(({ theme }) => ({
1585
+ zIndex: 1300,
1586
+ '& .MuiDrawer-paper': {
1587
+ borderTopLeftRadius: '8px',
1588
+ borderTopRightRadius: '8px',
1589
+ maxHeight: '90vh',
1590
+ },
1591
+ }));
1592
+ const DrawerContent = styled$1(Box)({
1593
+ display: 'flex',
1594
+ flexDirection: 'column',
1595
+ width: '100%',
1596
+ backgroundColor: '#ffffff',
1597
+ });
1598
+ const DrawerHeader = styled$1(Box)({
1599
+ display: 'flex',
1600
+ justifyContent: 'flex-end',
1601
+ alignItems: 'center',
1602
+ padding: '16px 16px 0',
1603
+ backgroundColor: '#ffffff',
1604
+ });
1605
+ const CloseButtonContainer = styled$1(Box)({
1606
+ width: '24px',
1607
+ height: '24px',
1608
+ });
1609
+ const Header = styled$1(Box)({
1610
+ display: 'flex',
1611
+ flexDirection: 'column',
1612
+ gap: '6px',
1613
+ padding: '16px',
1614
+ backgroundColor: '#ffffff',
1615
+ });
1616
+ const HeaderTitle = styled$1(Typography)({
1617
+ fontFamily: 'Montserrat, sans-serif',
1618
+ fontSize: '20px',
1619
+ fontWeight: 700,
1620
+ lineHeight: '28px',
1621
+ color: '#13131b',
1622
+ });
1623
+ const HeaderSubtitle = styled$1(Typography)({
1624
+ fontFamily: 'Montserrat, sans-serif',
1625
+ fontSize: '14px',
1626
+ fontWeight: 400,
1627
+ lineHeight: '18px',
1628
+ color: 'rgba(0, 0, 0, 0.6)',
1629
+ });
1630
+ const ProductsContainer = styled$1(Box)({
1631
+ padding: '16px',
1632
+ backgroundColor: '#ffffff',
1633
+ });
1634
+ const ProductsGrid = styled$1(Box)({
1635
+ display: 'grid',
1636
+ gridTemplateColumns: 'repeat(2, 1fr)',
1637
+ gap: '12px',
1638
+ });
1639
+ const ProductCard = styled$1(Box)({
1640
+ display: 'flex',
1641
+ flexDirection: 'column',
1642
+ gap: '16px',
1643
+ backgroundColor: '#ffffff',
1644
+ borderRadius: '12px',
1645
+ boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.12)',
1646
+ padding: '16px 12px 12px',
1647
+ height: '168px',
1648
+ });
1649
+ const ProductInfo = styled$1(Box)({
1650
+ display: 'flex',
1651
+ flexDirection: 'column',
1652
+ gap: '6px',
1653
+ alignItems: 'center',
1654
+ justifyContent: 'center',
1655
+ flex: 1,
1656
+ });
1657
+ const ProductLogo = styled$1(Box)({
1658
+ display: 'flex',
1659
+ alignItems: 'center',
1660
+ justifyContent: 'center',
1661
+ padding: '4px',
1662
+ });
1663
+ const ProductName = styled$1(Typography)({
1664
+ fontFamily: 'Montserrat, sans-serif',
1665
+ fontSize: '14px',
1666
+ fontWeight: 700,
1667
+ lineHeight: '22px',
1668
+ color: '#13131b',
1669
+ textAlign: 'center',
1670
+ });
1671
+ const ProductType = styled$1(Typography)({
1672
+ fontFamily: 'Montserrat, sans-serif',
1673
+ fontSize: '12px',
1674
+ fontWeight: 400,
1675
+ lineHeight: '16px',
1676
+ color: '#13131b',
1677
+ textAlign: 'center',
1678
+ });
1679
+ const ViewPlansButton = styled$1(Button$1)({
1680
+ backgroundColor: '#317abc',
1681
+ color: '#ffffff',
1682
+ borderRadius: '8px',
1683
+ height: '36px',
1684
+ textTransform: 'none',
1685
+ fontFamily: 'Montserrat, sans-serif',
1686
+ fontSize: '14px',
1687
+ fontWeight: 500,
1688
+ lineHeight: '18px',
1689
+ '&:hover': {
1690
+ backgroundColor: '#2869a8',
1691
+ },
1692
+ '&:active': {
1693
+ backgroundColor: '#1f5489',
1694
+ },
1695
+ });
1696
+
1697
+ function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans', viewPlansButtonText = 'View plans', }) {
1698
+ return (jsx(StyledDrawer, Object.assign({ anchor: "bottom", open: open, onClose: onClose }, { children: jsxs(DrawerContent, { children: [jsx(DrawerHeader, { children: jsx(CloseButtonContainer, { children: jsx(IconButton, Object.assign({ onClick: onClose, sx: { padding: 0 } }, { children: jsx(CloseIcon, { sx: { fontSize: 24, color: '#13131b' } }) })) }) }), jsxs(Header, { children: [jsx(HeaderTitle, { children: title }), jsx(HeaderSubtitle, { children: subtitle })] }), jsx(ProductsContainer, { children: jsx(ProductsGrid, { children: products.map((product) => (jsxs(ProductCard, { children: [jsxs(ProductInfo, { children: [jsx(ProductLogo, { children: jsx("img", { src: product.logo, alt: product.name, style: {
1699
+ width: '88px',
1700
+ height: '32px',
1701
+ objectFit: 'cover',
1702
+ } }) }), jsxs(Box, Object.assign({ sx: { textAlign: 'center', width: '100%' } }, { children: [jsx(ProductName, { children: product.name }), jsx(ProductType, { children: product.type })] }))] }), jsx(ViewPlansButton, Object.assign({ variant: "contained", fullWidth: true, onClick: () => onProductSelect(product.id) }, { children: viewPlansButtonText }))] }, product.id))) }) })] }) })));
1703
+ }
1704
+
1705
+ const QuestionContainer = styled(Box)(({ theme }) => ({
1706
+ backgroundColor: '#FFFFFF',
1707
+ padding: '12px 16px',
1708
+ display: 'flex',
1709
+ flexDirection: 'column',
1710
+ gap: '16px',
1711
+ width: '100%',
1712
+ }));
1713
+ const QuestionHeader = styled(Box)(({ theme }) => ({
1714
+ display: 'flex',
1715
+ flexDirection: 'column',
1716
+ gap: '6px',
1717
+ width: '100%',
1718
+ }));
1719
+ const QuestionTitle = styled(Typography)(({ theme }) => ({
1720
+ fontFamily: '"Montserrat", sans-serif',
1721
+ fontWeight: 600,
1722
+ fontSize: '14px',
1723
+ lineHeight: '20px',
1724
+ color: '#13131B',
1725
+ }));
1726
+ const QuestionSubtext = styled(Typography)(({ theme }) => ({
1727
+ fontFamily: '"Montserrat", sans-serif',
1728
+ fontWeight: 400,
1729
+ fontSize: '12px',
1730
+ lineHeight: '16px',
1731
+ color: '#5F5E62',
1732
+ }));
1733
+ const OptionsContainer = styled(Box)(({ theme }) => ({
1734
+ display: 'flex',
1735
+ flexDirection: 'column',
1736
+ gap: '8px',
1737
+ width: '100%',
1738
+ }));
1739
+
1740
+ /**
1741
+ * QuestionSection - Displays a question with selectable options
1742
+ *
1743
+ * @example
1744
+ * ```tsx
1745
+ * <QuestionSection
1746
+ * questionNumber="1"
1747
+ * question="Which plan feels right for you?"
1748
+ * helperText="Select one option"
1749
+ * options={planOptions}
1750
+ * selectedValue={selectedPlan}
1751
+ * onSelect={setSelectedPlan}
1752
+ * />
1753
+ * ```
1754
+ */
1755
+ function QuestionSection({ questionNumber, question, helperText, options, selectedValue, onSelect, multiple = false, selectedValues = [], renderOption, formatMessage = (descriptor) => descriptor.id, }) {
1756
+ const isSelected = (optionValue) => {
1757
+ if (multiple) {
1758
+ return selectedValues.includes(optionValue);
1759
+ }
1760
+ return selectedValue === optionValue;
1761
+ };
1762
+ return (jsxs(QuestionContainer, { children: [jsxs(QuestionHeader, { children: [jsxs(QuestionTitle, Object.assign({ variant: "subtitle1" }, { children: [questionNumber && `${questionNumber}. `, formatMessage({ id: question })] })), helperText && (jsx(QuestionSubtext, Object.assign({ variant: "caption" }, { children: formatMessage({ id: helperText }) })))] }), jsx(OptionsContainer, { children: options.map((option) => {
1763
+ const selected = isSelected(option.value);
1764
+ if (renderOption) {
1765
+ return renderOption(option, selected);
1766
+ }
1767
+ // Default rendering handled by parent or OptionButton component
1768
+ return null;
1769
+ }) })] }));
1770
+ }
1771
+
1772
+ const StyledOptionButton = styled(ButtonBase)(({ theme, selected, size = 'medium', fullWidth }) => {
1773
+ const heights = {
1774
+ small: '32px',
1775
+ medium: '40px',
1776
+ large: '48px',
1777
+ };
1778
+ return {
1779
+ height: heights[size],
1780
+ width: fullWidth ? '100%' : 'auto',
1781
+ borderRadius: '8px',
1782
+ border: selected
1783
+ ? '2px solid #317ABC'
1784
+ : '1px solid #C8C5CA',
1785
+ backgroundColor: selected ? 'rgba(49, 122, 188, 0.1)' : '#FFFFFF',
1786
+ padding: '10px 24px',
1787
+ display: 'flex',
1788
+ alignItems: 'center',
1789
+ justifyContent: 'center',
1790
+ cursor: 'pointer',
1791
+ transition: 'all 0.2s ease',
1792
+ '&:hover': {
1793
+ backgroundColor: selected ? 'rgba(49, 122, 188, 0.15)' : 'rgba(0, 0, 0, 0.04)',
1794
+ },
1795
+ '&:disabled': {
1796
+ backgroundColor: '#F5F5F5',
1797
+ border: '1px solid #EEEEEE',
1798
+ cursor: 'not-allowed',
1799
+ opacity: 0.6,
1800
+ },
1801
+ };
1802
+ });
1803
+ const OptionContent = styled(Box)(({ theme }) => ({
1804
+ display: 'flex',
1805
+ alignItems: 'center',
1806
+ justifyContent: 'center',
1807
+ gap: '8px',
1808
+ width: '100%',
1809
+ }));
1810
+ const OptionIcon = styled('span')(({ theme }) => ({
1811
+ fontSize: '18px',
1812
+ lineHeight: 1,
1813
+ flexShrink: 0,
1814
+ }));
1815
+ const OptionLabel = styled(Typography)(({ theme, selected, disabled }) => ({
1816
+ fontFamily: '"Montserrat", sans-serif',
1817
+ fontWeight: selected ? 600 : 500,
1818
+ fontSize: '14px',
1819
+ lineHeight: '20px',
1820
+ color: disabled ? 'rgba(0, 0, 0, 0.4)' : '#13131B',
1821
+ textAlign: 'center',
1822
+ }));
1823
+
1824
+ /**
1825
+ * OptionButton - Selectable button for questionnaire options
1826
+ *
1827
+ * @example
1828
+ * ```tsx
1829
+ * <OptionButton
1830
+ * value="option1"
1831
+ * label="Option 1"
1832
+ * icon="🎯"
1833
+ * selected={selectedValue === 'option1'}
1834
+ * onClick={(value) => setSelectedValue(value)}
1835
+ * />
1836
+ * ```
1837
+ */
1838
+ function OptionButton({ value, label, icon, selected = false, disabled = false, onClick, size = 'medium', fullWidth = true, formatMessage = (descriptor) => descriptor.id, }) {
1839
+ const handleClick = () => {
1840
+ if (!disabled && onClick) {
1841
+ onClick(value);
1842
+ }
1843
+ };
1844
+ return (jsx(StyledOptionButton, Object.assign({ selected: selected, disabled: disabled, onClick: handleClick, size: size, fullWidth: fullWidth }, { children: jsxs(OptionContent, { children: [icon && jsx(OptionIcon, { children: icon }), jsx(OptionLabel, Object.assign({ selected: selected, disabled: disabled, variant: "body2" }, { children: formatMessage({ id: label }) }))] }) })));
1845
+ }
1846
+
1847
+ const ToggleContainer$1 = styled(Box)(({ theme }) => ({
1848
+ backgroundColor: '#F9F9F9',
1849
+ borderRadius: '40px',
1850
+ display: 'flex',
1851
+ gap: '6px',
1852
+ height: '48px',
1853
+ padding: '0',
1854
+ width: '100%',
1855
+ }));
1856
+ const ToggleButton$1 = styled(ButtonBase)(({ theme, selected }) => ({
1857
+ flex: 1,
1858
+ display: 'flex',
1859
+ alignItems: 'center',
1860
+ justifyContent: 'center',
1861
+ gap: '4px',
1862
+ padding: '8px',
1863
+ borderRadius: selected ? '40px' : '104px',
1864
+ backgroundColor: selected ? '#00E08B' : 'transparent',
1865
+ transition: 'all 0.3s ease',
1866
+ '&:hover': {
1867
+ backgroundColor: selected ? '#00D080' : 'rgba(0, 0, 0, 0.04)',
1868
+ },
1869
+ }));
1870
+ const ToggleIcon = styled(Box)(({ theme }) => ({
1871
+ backgroundColor: '#FFFFFF',
1872
+ borderRadius: '50px',
1873
+ width: '32px',
1874
+ height: '32px',
1875
+ display: 'flex',
1876
+ alignItems: 'center',
1877
+ justifyContent: 'center',
1878
+ padding: '6px',
1879
+ }));
1880
+ const ToggleLabel = styled(Typography)(({ theme, selected }) => ({
1881
+ fontFamily: '"Montserrat", sans-serif',
1882
+ fontWeight: 600,
1883
+ fontSize: '14px',
1884
+ lineHeight: '20px',
1885
+ color: selected ? '#FEFBFF' : '#5F5E62',
1886
+ whiteSpace: 'nowrap',
1887
+ }));
1888
+
1889
+ /**
1890
+ * ToggleGroup - Segmented control for switching between options
1891
+ *
1892
+ * @example
1893
+ * ```tsx
1894
+ * <ToggleGroup
1895
+ * options={[
1896
+ * { value: 'domestic', label: 'Domestic', icon: '🏠' },
1897
+ * { value: 'international', label: 'International', icon: '✈️' }
1898
+ * ]}
1899
+ * value={selectedType}
1900
+ * onChange={setSelectedType}
1901
+ * />
1902
+ * ```
1903
+ */
1904
+ function ToggleGroup({ options, value, onChange, formatMessage = (descriptor) => descriptor.id, }) {
1905
+ return (jsx(ToggleContainer$1, { children: options.map((option) => (jsxs(ToggleButton$1, Object.assign({ selected: value === option.value, onClick: () => onChange(option.value) }, { children: [option.icon && (jsx(ToggleIcon, { children: jsx("img", { src: option.icon, alt: option.label, width: 19.2, height: 19.2 }) })), jsx(ToggleLabel, Object.assign({ selected: value === option.value }, { children: formatMessage({ id: option.label }) }))] }), option.value))) }));
1906
+ }
1907
+
410
1908
  /**
411
1909
  * Theme Utility Functions
412
1910
  * Helper functions for working with tenant themes
413
1911
  */
414
1912
  /**
415
1913
  * Get color value from theme palette path
416
- * @param theme - Tenant theme configuration
1914
+ * @param theme - Tenant theme configuration (can be undefined/null for SSR)
417
1915
  * @param path - Dot-notation path to color (e.g., 'primary.main')
418
1916
  * @param defaultColor - Fallback color if path not found
419
1917
  * @returns Color string
420
1918
  */
421
1919
  function getThemeColor(theme, path, defaultColor = '#000000') {
1920
+ // Handle SSR case where theme might be undefined
1921
+ if (!theme || !theme.palette) {
1922
+ return defaultColor;
1923
+ }
422
1924
  const keys = path.split('.');
423
1925
  let value = theme.palette;
424
1926
  for (const key of keys) {
@@ -433,15 +1935,22 @@ function getThemeColor(theme, path, defaultColor = '#000000') {
433
1935
  }
434
1936
  /**
435
1937
  * Merge tenant theme with base MUI theme
1938
+ * This makes tenant theme accessible in styled components via theme parameter
436
1939
  * @param baseTheme - Base MUI theme
437
1940
  * @param tenantTheme - Tenant-specific theme configuration
438
1941
  * @returns Merged theme
439
1942
  */
440
1943
  function mergeTenantTheme(baseTheme, tenantTheme) {
441
- var _a, _b;
442
- return Object.assign(Object.assign({}, baseTheme), { palette: Object.assign(Object.assign(Object.assign({}, baseTheme.palette), tenantTheme.palette), {
443
- // Deep merge for nested objects
444
- primary: Object.assign(Object.assign({}, (((_a = baseTheme.palette) === null || _a === void 0 ? void 0 : _a.primary) || {})), (tenantTheme.palette.primary || {})), secondary: Object.assign(Object.assign({}, (((_b = baseTheme.palette) === null || _b === void 0 ? void 0 : _b.secondary) || {})), (tenantTheme.palette.secondary || {})) }), typography: Object.assign(Object.assign({}, baseTheme.typography), tenantTheme.typography) });
1944
+ // Merge tenant palette and typography into MUI theme
1945
+ const mergedPalette = Object.assign(Object.assign(Object.assign({}, baseTheme.palette), tenantTheme.palette), {
1946
+ // Make tenant colors accessible via theme.palette
1947
+ tenant: tenantTheme.palette });
1948
+ const mergedTypography = Object.assign(Object.assign(Object.assign({}, baseTheme.typography), tenantTheme.typography), {
1949
+ // Make tenant typography accessible via theme.typography
1950
+ tenant: tenantTheme.typography });
1951
+ return Object.assign(Object.assign({}, baseTheme), { palette: mergedPalette, typography: mergedTypography,
1952
+ // Also add tenant theme at root level for easy access
1953
+ tenantTheme });
445
1954
  }
446
1955
  /**
447
1956
  * Create CSS variables from tenant theme
@@ -476,5 +1985,541 @@ function createThemeCSSVariables(theme, prefix = '--tenant') {
476
1985
  return variables;
477
1986
  }
478
1987
 
479
- export { Banner, Button, Card, TenantThemeProvider, ammetlifeTheme, cimbTheme, createThemeCSSVariables, getAvailableTenants, getTenantTheme, getThemeColor, iglooTheme, isValidTenantId, mergeTenantTheme, tenantThemes, useIsTenant, useTenantId, useTenantTheme };
1988
+ const ToggleContainer = styled(Box)(({ theme }) => {
1989
+ var _a, _b;
1990
+ return ({
1991
+ display: 'flex',
1992
+ gap: '6px',
1993
+ height: '48px',
1994
+ backgroundColor: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderBackground) || '#f9f9f9',
1995
+ borderRadius: '40px',
1996
+ width: '100%',
1997
+ padding: '0',
1998
+ position: 'relative',
1999
+ });
2000
+ });
2001
+ const ToggleButton = styled(Box)(({ theme, active }) => {
2002
+ var _a, _b, _c, _d, _e, _f;
2003
+ return ({
2004
+ flex: 1,
2005
+ display: 'flex',
2006
+ gap: '4px',
2007
+ alignItems: 'center',
2008
+ justifyContent: 'center',
2009
+ padding: '8px',
2010
+ height: '100%',
2011
+ borderRadius: '40px',
2012
+ cursor: 'pointer',
2013
+ backgroundColor: active
2014
+ ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.toggleActive) || '#a4ce4e'
2015
+ : 'transparent',
2016
+ color: active
2017
+ ? ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.toggleActiveText) || '#fefbff'
2018
+ : ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _e === void 0 ? void 0 : _e.ui) === null || _f === void 0 ? void 0 : _f.toggleInactiveText) || '#5f5e62',
2019
+ transition: 'all 0.2s ease',
2020
+ '&:hover': {
2021
+ opacity: 0.9,
2022
+ },
2023
+ });
2024
+ });
2025
+ const ToggleText = styled(Typography)(({ theme }) => {
2026
+ var _a, _b, _c, _d, _e, _f;
2027
+ return ({
2028
+ fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2029
+ "'Montserrat', sans-serif",
2030
+ fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodyMedium) === null || _c === void 0 ? void 0 : _c.fontSize) || '14px',
2031
+ fontWeight: ((_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.fontWeightSemiBold) || 600,
2032
+ lineHeight: ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _e === void 0 ? void 0 : _e.bodyMedium) === null || _f === void 0 ? void 0 : _f.lineHeight) || '20px',
2033
+ whiteSpace: 'nowrap',
2034
+ });
2035
+ });
2036
+
2037
+ /**
2038
+ * BillingToggle - Toggle between monthly and annual billing
2039
+ *
2040
+ * @example
2041
+ * ```tsx
2042
+ * <BillingToggle
2043
+ * value={billingType}
2044
+ * onChange={setBillingType}
2045
+ * />
2046
+ * ```
2047
+ */
2048
+ function BillingToggle({ value, onChange, formatMessage = (descriptor) => descriptor.defaultMessage || descriptor.id, }) {
2049
+ // Safely get theme, handle SSR case where it might be undefined
2050
+ const tenantTheme = useTenantTheme();
2051
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2052
+ // Get theme colors with SSR-safe fallbacks
2053
+ const toggleActiveColor = getThemeColor(theme, 'ui.toggleActive', '#a4ce4e');
2054
+ const toggleActiveTextColor = getThemeColor(theme, 'ui.toggleActiveText', '#fefbff');
2055
+ const toggleInactiveTextColor = getThemeColor(theme, 'ui.toggleInactiveText', '#5f5e62');
2056
+ const toggleBgColor = getThemeColor(theme, 'ui.sliderBackground', '#f9f9f9');
2057
+ return (jsxs(ToggleContainer, Object.assign({ sx: {
2058
+ backgroundColor: toggleBgColor,
2059
+ } }, { children: [jsx(ToggleButton, Object.assign({ active: value === 'monthly', onClick: () => onChange('monthly'), sx: {
2060
+ backgroundColor: value === 'monthly' ? toggleActiveColor : 'transparent',
2061
+ color: value === 'monthly'
2062
+ ? toggleActiveTextColor
2063
+ : toggleInactiveTextColor,
2064
+ } }, { children: jsx(ToggleText, { children: formatMessage({
2065
+ id: 'Billed monthly',
2066
+ defaultMessage: 'Billed monthly',
2067
+ }) }) })), jsx(ToggleButton, Object.assign({ active: value === 'annually', onClick: () => onChange('annually'), sx: {
2068
+ backgroundColor: value === 'annually' ? toggleActiveColor : 'transparent',
2069
+ color: value === 'annually'
2070
+ ? toggleActiveTextColor
2071
+ : toggleInactiveTextColor,
2072
+ } }, { children: jsx(ToggleText, { children: formatMessage({
2073
+ id: 'Billed annually',
2074
+ defaultMessage: 'Billed annually',
2075
+ }) }) }))] })));
2076
+ }
2077
+
2078
+ const CalloutContainer = styled(Box)(({ theme }) => {
2079
+ var _a, _b, _c, _d;
2080
+ return ({
2081
+ display: 'flex',
2082
+ flexDirection: 'column',
2083
+ gap: '8px',
2084
+ padding: '12px',
2085
+ backgroundColor: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.calloutBackground) || '#f9f9f9',
2086
+ border: `1px solid ${((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.calloutBorder) || '#ffffff'}`,
2087
+ borderRadius: '8px',
2088
+ width: '100%',
2089
+ });
2090
+ });
2091
+ const CalloutHeader = styled(Box)(({ theme }) => ({
2092
+ display: 'flex',
2093
+ gap: '4px',
2094
+ alignItems: 'center',
2095
+ }));
2096
+ const CalloutIcon = styled(InfoIcon)(({ theme }) => {
2097
+ var _a, _b;
2098
+ return ({
2099
+ width: '20px',
2100
+ height: '20px',
2101
+ color: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.natural) === null || _b === void 0 ? void 0 : _b.dim) || '#13131b',
2102
+ });
2103
+ });
2104
+ const CalloutTitle = styled(Typography)(({ theme }) => {
2105
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2106
+ return ({
2107
+ fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2108
+ "'Montserrat', sans-serif",
2109
+ fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodyMedium) === null || _c === void 0 ? void 0 : _c.fontSize) || '14px',
2110
+ fontWeight: ((_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.fontWeightSemiBold) || 600,
2111
+ lineHeight: ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _e === void 0 ? void 0 : _e.bodyMedium) === null || _f === void 0 ? void 0 : _f.lineHeight) || '20px',
2112
+ color: ((_h = (_g = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _g === void 0 ? void 0 : _g.natural) === null || _h === void 0 ? void 0 : _h.dim) || '#13131b',
2113
+ });
2114
+ });
2115
+ const CalloutText = styled(Typography)(({ theme }) => {
2116
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2117
+ return ({
2118
+ fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2119
+ "'Montserrat', sans-serif",
2120
+ fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodySmall) === null || _c === void 0 ? void 0 : _c.fontSize) || '12px',
2121
+ fontWeight: ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.bodySmall) === null || _e === void 0 ? void 0 : _e.fontWeight) || 400,
2122
+ lineHeight: ((_g = (_f = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _f === void 0 ? void 0 : _f.bodySmall) === null || _g === void 0 ? void 0 : _g.lineHeight) || '16px',
2123
+ color: ((_j = (_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.natural) === null || _j === void 0 ? void 0 : _j.dark) || '#5f5e62',
2124
+ });
2125
+ });
2126
+
2127
+ /**
2128
+ * InfoCallout - Displays helpful information or tips
2129
+ *
2130
+ * @example
2131
+ * ```tsx
2132
+ * <InfoCallout title="Helpful tip">
2133
+ * Many Malaysians aim for life protection that's at least 10–12 times their annual income
2134
+ * </InfoCallout>
2135
+ * ```
2136
+ */
2137
+ function InfoCallout({ title = 'Helpful tip', children, formatMessage = (descriptor) => descriptor.defaultMessage || descriptor.id, }) {
2138
+ // Safely get theme, handle SSR case where it might be undefined
2139
+ const tenantTheme = useTenantTheme();
2140
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2141
+ // Get theme colors with SSR-safe fallbacks
2142
+ const calloutBgColor = getThemeColor(theme, 'ui.calloutBackground', '#f9f9f9');
2143
+ const calloutBorderColor = getThemeColor(theme, 'ui.calloutBorder', '#ffffff');
2144
+ const textColor = getThemeColor(theme, 'natural.dim', '#13131b');
2145
+ const subtitleColor = getThemeColor(theme, 'natural.dark', '#5f5e62');
2146
+ return (jsxs(CalloutContainer, Object.assign({ sx: {
2147
+ backgroundColor: calloutBgColor,
2148
+ border: `1px solid ${calloutBorderColor}`,
2149
+ } }, { children: [jsxs(CalloutHeader, { children: [jsx(CalloutIcon, { sx: { color: textColor } }), jsx(CalloutTitle, Object.assign({ sx: { color: textColor } }, { children: formatMessage({
2150
+ id: title,
2151
+ defaultMessage: title,
2152
+ }) }))] }), jsx(CalloutText, Object.assign({ sx: { color: subtitleColor } }, { children: children }))] })));
2153
+ }
2154
+
2155
+ const SliderContainer = styled(Box)(({ theme }) => {
2156
+ var _a, _b;
2157
+ return ({
2158
+ display: 'flex',
2159
+ flexDirection: 'column',
2160
+ gap: '16px',
2161
+ padding: '12px',
2162
+ backgroundColor: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderBackground) || '#f9f9f9',
2163
+ borderRadius: '8px',
2164
+ width: '100%',
2165
+ });
2166
+ });
2167
+ const InputSection = styled(Box)(({ theme }) => ({
2168
+ display: 'flex',
2169
+ flexDirection: 'column',
2170
+ gap: '8px',
2171
+ width: '100%',
2172
+ }));
2173
+ const InputLabel = styled(Typography)(({ theme }) => {
2174
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2175
+ return ({
2176
+ fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2177
+ "'Montserrat', sans-serif",
2178
+ fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodySmall) === null || _c === void 0 ? void 0 : _c.fontSize) || '12px',
2179
+ fontWeight: ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.bodySmall) === null || _e === void 0 ? void 0 : _e.fontWeight) || 400,
2180
+ lineHeight: ((_g = (_f = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _f === void 0 ? void 0 : _f.bodySmall) === null || _g === void 0 ? void 0 : _g.lineHeight) || '16px',
2181
+ color: ((_j = (_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.natural) === null || _j === void 0 ? void 0 : _j.dim) || '#13131b',
2182
+ });
2183
+ });
2184
+ const InputContainer = styled(Box)(({ theme }) => {
2185
+ var _a, _b, _c, _d;
2186
+ return ({
2187
+ display: 'flex',
2188
+ gap: '24px',
2189
+ alignItems: 'center',
2190
+ justifyContent: 'center',
2191
+ padding: '8px 16px',
2192
+ height: '44px',
2193
+ backgroundColor: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.inputBackground) || '#ffffff',
2194
+ border: `1px solid ${((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.inputBorder) || '#eeeeee'}`,
2195
+ borderRadius: '8px',
2196
+ width: '100%',
2197
+ maxWidth: '298px', // Match slider track width
2198
+ });
2199
+ });
2200
+ const InputValue = styled(Typography)(({ theme }) => {
2201
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2202
+ return ({
2203
+ fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2204
+ "'Montserrat', sans-serif",
2205
+ fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodyMedium) === null || _c === void 0 ? void 0 : _c.fontSize) || '14px',
2206
+ fontWeight: ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.bodyMedium) === null || _e === void 0 ? void 0 : _e.fontWeight) || 400,
2207
+ lineHeight: ((_g = (_f = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _f === void 0 ? void 0 : _f.bodyMedium) === null || _g === void 0 ? void 0 : _g.lineHeight) || '18px',
2208
+ color: ((_j = (_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.natural) === null || _j === void 0 ? void 0 : _j.dim) || '#13131b',
2209
+ textAlign: 'center',
2210
+ flex: 1,
2211
+ });
2212
+ });
2213
+ const SliderTrack = styled(Box)(({ theme }) => ({
2214
+ display: 'flex',
2215
+ alignItems: 'center',
2216
+ position: 'relative',
2217
+ width: '100%',
2218
+ maxWidth: '298px',
2219
+ height: '4px',
2220
+ }));
2221
+ const SliderSegment = styled(Box)(({ theme, active }) => {
2222
+ var _a, _b, _c, _d;
2223
+ return ({
2224
+ height: '4px',
2225
+ backgroundColor: active
2226
+ ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderActive) || '#317abc'
2227
+ : ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.sliderInactive) || '#c8c5ca',
2228
+ borderRadius: '8px',
2229
+ width: '22px',
2230
+ marginRight: '-1px',
2231
+ });
2232
+ });
2233
+ const SliderDot = styled(Box)(({ theme, active }) => {
2234
+ var _a, _b, _c, _d;
2235
+ return ({
2236
+ width: '10px',
2237
+ height: '10px',
2238
+ borderRadius: '8px',
2239
+ backgroundColor: active
2240
+ ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderActive) || '#317abc'
2241
+ : ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.sliderInactive) || '#c8c5ca',
2242
+ boxShadow: active ? '0px 2px 20px 4px rgba(0, 0, 0, 0.14)' : 'none',
2243
+ marginRight: '-1px',
2244
+ cursor: 'pointer',
2245
+ position: 'relative',
2246
+ zIndex: 2,
2247
+ '&:hover': {
2248
+ transform: 'scale(1.2)',
2249
+ transition: 'transform 0.2s ease',
2250
+ },
2251
+ });
2252
+ });
2253
+ const SliderThumb = styled(Box)(({ theme }) => ({
2254
+ position: 'absolute',
2255
+ width: '18px',
2256
+ height: '18px',
2257
+ borderRadius: '34px',
2258
+ backgroundColor: '#ffffff',
2259
+ boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
2260
+ display: 'flex',
2261
+ alignItems: 'center',
2262
+ justifyContent: 'center',
2263
+ top: '-21px',
2264
+ left: '0px',
2265
+ cursor: 'grab',
2266
+ zIndex: 10,
2267
+ '&:active': {
2268
+ cursor: 'grabbing',
2269
+ },
2270
+ }));
2271
+ const ThumbIcon = styled(Box)(({ theme }) => {
2272
+ var _a, _b;
2273
+ return ({
2274
+ width: '13px',
2275
+ height: '10px',
2276
+ display: 'flex',
2277
+ alignItems: 'center',
2278
+ justifyContent: 'center',
2279
+ color: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderActive) || '#317abc',
2280
+ });
2281
+ });
2282
+ const RangeLabels = styled(Box)(({ theme }) => ({
2283
+ display: 'flex',
2284
+ justifyContent: 'space-between',
2285
+ width: '100%',
2286
+ maxWidth: '298px', // Match slider track width
2287
+ }));
2288
+ const RangeLabel = styled(Typography)(({ theme }) => {
2289
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2290
+ return ({
2291
+ fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2292
+ "'Montserrat', sans-serif",
2293
+ fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.smallText) === null || _c === void 0 ? void 0 : _c.fontSize) || '8px',
2294
+ fontWeight: ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.smallText) === null || _e === void 0 ? void 0 : _e.fontWeight) || 500,
2295
+ lineHeight: ((_g = (_f = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _f === void 0 ? void 0 : _f.smallText) === null || _g === void 0 ? void 0 : _g.lineHeight) || '16px',
2296
+ color: ((_j = (_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.natural) === null || _j === void 0 ? void 0 : _j.main) || '#929094',
2297
+ });
2298
+ });
2299
+
2300
+ /**
2301
+ * CoverageAmountSlider - Interactive slider for selecting coverage amounts
2302
+ *
2303
+ * @example
2304
+ * ```tsx
2305
+ * <CoverageAmountSlider
2306
+ * min={100000}
2307
+ * max={550000}
2308
+ * value={coverageAmount}
2309
+ * onChange={setCoverageAmount}
2310
+ * />
2311
+ * ```
2312
+ */
2313
+ function CoverageAmountSlider({ min, max, value, onChange, label = 'Choose your coverage amount', segments = 8, currency = 'RM', formatCurrency: customFormatCurrency, }) {
2314
+ // Safely get theme, handle SSR case where it might be undefined
2315
+ const tenantTheme = useTenantTheme();
2316
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2317
+ const [localValue, setLocalValue] = useState(value);
2318
+ // Get theme colors with SSR-safe fallbacks
2319
+ const sliderActiveColor = getThemeColor(theme, 'ui.sliderActive', '#317abc');
2320
+ const sliderInactiveColor = getThemeColor(theme, 'ui.sliderInactive', '#c8c5ca');
2321
+ const sliderBgColor = getThemeColor(theme, 'ui.sliderBackground', '#f9f9f9');
2322
+ const inputBgColor = getThemeColor(theme, 'ui.inputBackground', '#ffffff');
2323
+ const inputBorderColor = getThemeColor(theme, 'ui.inputBorder', '#eeeeee');
2324
+ const textColor = getThemeColor(theme, 'natural.dim', '#13131b');
2325
+ const labelColor = getThemeColor(theme, 'natural.main', '#929094');
2326
+ useEffect(() => {
2327
+ setLocalValue(value);
2328
+ }, [value]);
2329
+ const defaultFormatCurrency = (amount) => {
2330
+ return `${currency} ${amount.toLocaleString('en-US', {
2331
+ minimumFractionDigits: 0,
2332
+ maximumFractionDigits: 0,
2333
+ })}`;
2334
+ };
2335
+ const formatCurrency = customFormatCurrency || defaultFormatCurrency;
2336
+ const handleDecrease = () => {
2337
+ // Use total segments (9) for step calculation to match visual dots
2338
+ const totalSegmentsForSteps = segments + 1; // 9 segments between 10 dots
2339
+ const step = (max - min) / totalSegmentsForSteps;
2340
+ const newValue = Math.max(min, localValue - step);
2341
+ setLocalValue(newValue);
2342
+ onChange(newValue);
2343
+ };
2344
+ const handleIncrease = () => {
2345
+ // Use total segments (9) for step calculation to match visual dots
2346
+ const totalSegmentsForSteps = segments + 1; // 9 segments between 10 dots
2347
+ const step = (max - min) / totalSegmentsForSteps;
2348
+ const newValue = Math.min(max, localValue + step);
2349
+ setLocalValue(newValue);
2350
+ onChange(newValue);
2351
+ };
2352
+ const handleDotClick = (dotIndex) => {
2353
+ // Calculate the value for this dot position
2354
+ const dotValue = min + (dotIndex * (max - min)) / (totalDots - 1);
2355
+ setLocalValue(dotValue);
2356
+ onChange(dotValue);
2357
+ };
2358
+ const percentage = ((localValue - min) / (max - min)) * 100;
2359
+ // Track width is 298px (10 dots * 10px + 9 gaps * 22px = 298px)
2360
+ // Each dot is 10px wide, so dot centers are at: 5px, 37px, 69px, ... (5 + dotIndex * 32)
2361
+ // First dot center: 5px (half of 10px dot width)
2362
+ // Last dot center: 298px - 5px = 293px
2363
+ // Thumb is 18px wide, so thumb center offset from left edge is 9px
2364
+ // Position thumb so its center aligns with the dot center
2365
+ // left = dotCenter - thumbCenterOffset = dotCenter - 9px
2366
+ const firstDotCenter = 5; // First dot center position
2367
+ const lastDotCenter = 298 - 5; // Last dot center position
2368
+ const thumbCenterOffset = 9; // Half of thumb width (18px / 2)
2369
+ const dotCenterPosition = firstDotCenter + (percentage / 100) * (lastDotCenter - firstDotCenter);
2370
+ const thumbPosition = dotCenterPosition - thumbCenterOffset;
2371
+ // Create slider with dots: dot-segment-dot-segment-...-dot
2372
+ // With 8 segments, we have 9 dots total (start + 8 in between + end)
2373
+ // But user wants 8 dots in between, so total = 1 (start) + 8 (between) + 1 (end) = 10 dots
2374
+ // This means 9 segments between the 10 dots
2375
+ const dotsInBetween = segments; // 8 dots in between
2376
+ const totalDots = dotsInBetween + 2; // start + 8 in between + end = 10 dots
2377
+ return (jsxs(SliderContainer, Object.assign({ sx: {
2378
+ backgroundColor: sliderBgColor,
2379
+ } }, { children: [jsxs(InputSection, { children: [jsx(InputLabel, Object.assign({ sx: { color: textColor } }, { children: label })), jsxs(InputContainer, Object.assign({ sx: {
2380
+ backgroundColor: inputBgColor,
2381
+ border: `1px solid ${inputBorderColor}`,
2382
+ } }, { children: [jsx(IconButton, Object.assign({ onClick: handleDecrease, sx: {
2383
+ padding: 0,
2384
+ width: '24px',
2385
+ height: '24px',
2386
+ color: textColor,
2387
+ } }, { children: jsx(RemoveIcon, { sx: { fontSize: 24 } }) })), jsx(InputValue, Object.assign({ sx: { color: textColor } }, { children: formatCurrency(localValue) })), jsx(IconButton, Object.assign({ onClick: handleIncrease, sx: {
2388
+ padding: 0,
2389
+ width: '24px',
2390
+ height: '24px',
2391
+ color: textColor,
2392
+ } }, { children: jsx(AddIcon, { sx: { fontSize: 24 } }) }))] }))] }), jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '10px' } }, { children: [jsxs(SliderTrack, { children: [Array.from({ length: totalDots }).map((_, index) => {
2393
+ const dotValue = min + (index * (max - min)) / (totalDots - 1);
2394
+ const isActive = localValue >= dotValue;
2395
+ const isLast = index === totalDots - 1;
2396
+ return (jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: [jsx(SliderDot, { active: isActive, onClick: () => handleDotClick(index), sx: {
2397
+ backgroundColor: isActive
2398
+ ? sliderActiveColor
2399
+ : sliderInactiveColor,
2400
+ } }), !isLast && (jsx(SliderSegment, { active: localValue > dotValue, sx: {
2401
+ backgroundColor: localValue > dotValue
2402
+ ? sliderActiveColor
2403
+ : sliderInactiveColor,
2404
+ } }))] }), index));
2405
+ }), jsx(SliderThumb, Object.assign({ style: {
2406
+ left: `${thumbPosition}px`,
2407
+ } }, { children: jsx(ThumbIcon, Object.assign({ sx: { color: sliderActiveColor } }, { children: jsx(DragHandleIcon, { sx: { fontSize: 16 } }) })) }))] }), jsxs(RangeLabels, { children: [jsx(RangeLabel, Object.assign({ sx: { color: labelColor } }, { children: formatCurrency(min) })), jsx(RangeLabel, Object.assign({ sx: { textAlign: 'right', color: labelColor } }, { children: formatCurrency(max) }))] })] }))] })));
2408
+ }
2409
+
2410
+ /**
2411
+ * Asset Management Utilities
2412
+ * Helper functions for managing tenant-specific assets
2413
+ */
2414
+ /**
2415
+ * Hook to get tenant-specific asset URL
2416
+ * @param assetPath - Relative path to asset within tenant folder
2417
+ * @returns Full path to tenant-specific asset
2418
+ *
2419
+ * @example
2420
+ * ```tsx
2421
+ * const bannerImage = useTenantAsset('promotional-banner.jpg')
2422
+ * <img src={bannerImage} alt="Promo" />
2423
+ * ```
2424
+ */
2425
+ function useTenantAsset(assetPath) {
2426
+ const tenantId = useTenantId();
2427
+ // Return tenant-specific asset path that will be resolved at build time
2428
+ return `/assets/tenants/${tenantId}/${assetPath}`;
2429
+ }
2430
+ /**
2431
+ * Hook to get tenant logo URL
2432
+ * @param variant - Logo variant ('default' | 'dark' | 'alt' | 'white')
2433
+ * @returns Logo URL from theme configuration
2434
+ *
2435
+ * @example
2436
+ * ```tsx
2437
+ * const logo = useTenantLogo()
2438
+ * const darkLogo = useTenantLogo('dark')
2439
+ * <img src={logo} alt="Logo" />
2440
+ * ```
2441
+ */
2442
+ function useTenantLogo(variant = 'default') {
2443
+ const tenantTheme = useTenantTheme();
2444
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2445
+ // Guard against undefined theme (SSR or initialization issues)
2446
+ if (!theme || !theme.logo) {
2447
+ console.warn('useTenantLogo: Theme or logo is undefined, returning empty string');
2448
+ return '';
2449
+ }
2450
+ switch (variant) {
2451
+ case 'dark':
2452
+ return theme.logoDark || theme.logo;
2453
+ case 'alt':
2454
+ return theme.logoAlt || theme.logo;
2455
+ case 'white':
2456
+ return theme.logoWhite || theme.logo;
2457
+ default:
2458
+ return theme.logo;
2459
+ }
2460
+ }
2461
+ /**
2462
+ * Hook to get tenant favicon URL
2463
+ * @returns Favicon URL from theme configuration
2464
+ *
2465
+ * @example
2466
+ * ```tsx
2467
+ * const favicon = useTenantFavicon()
2468
+ * <link rel="icon" href={favicon} />
2469
+ * ```
2470
+ */
2471
+ function useTenantFavicon() {
2472
+ const tenantTheme = useTenantTheme();
2473
+ const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2474
+ // Guard against undefined theme
2475
+ if (!theme || !theme.favicon) {
2476
+ console.warn('useTenantFavicon: Theme or favicon is undefined');
2477
+ return '';
2478
+ }
2479
+ return theme.favicon;
2480
+ }
2481
+ /**
2482
+ * Get tenant asset path (non-hook version for use outside components)
2483
+ * @param tenantId - Tenant identifier
2484
+ * @param assetPath - Relative path to asset
2485
+ * @returns Full asset path
2486
+ */
2487
+ function getTenantAssetPath(tenantId, assetPath) {
2488
+ return `/assets/tenants/${tenantId}/${assetPath}`;
2489
+ }
2490
+ /**
2491
+ * Get tenant logo path (non-hook version)
2492
+ * @param tenantId - Tenant identifier
2493
+ * @param variant - Logo variant
2494
+ * @returns Logo path
2495
+ */
2496
+ function getTenantLogoPath(tenantId, variant = 'default') {
2497
+ const variantSuffix = variant === 'default' ? '' : `-${variant}`;
2498
+ return `/assets/tenants/${tenantId}/logo${variantSuffix}.svg`;
2499
+ }
2500
+
2501
+ /**
2502
+ * Common UI Icons
2503
+ * Path references to reusable icons
2504
+ * Assets are copied to dist/assets folder during build
2505
+ */
2506
+ const ICON_PATHS = {
2507
+ close: '/assets/icons/close.svg',
2508
+ arrow: '/assets/icons/arrow.svg',
2509
+ arrowDown: '/assets/icons/arrow-down.svg',
2510
+ alert: '/assets/icons/alert.svg',
2511
+ facebook: '/assets/icons/facebook.svg',
2512
+ instagram: '/assets/icons/instagram.svg',
2513
+ youtube: '/assets/icons/youtube.svg',
2514
+ };
2515
+ /**
2516
+ * Get icon path by name
2517
+ * @param iconName - Name of the icon
2518
+ * @returns Path to icon asset
2519
+ */
2520
+ function getIconPath(iconName) {
2521
+ return ICON_PATHS[iconName];
2522
+ }
2523
+
2524
+ export { Banner, BillingToggle, Button, Card, CoverageAmountSlider, Footer, Header$1 as Header, ICON_PATHS, InfoCallout, NewHeader, OptionButton, ProductSelectionDrawer, QuestionSection, RecommendationsDrawer, TenantThemeProvider, ToggleGroup, ammetlifeTheme, ammetlifeTypography, cimbTheme, cimbTypography, createThemeCSSVariables, getAvailableTenants, getIconPath, getTenantAssetPath, getTenantLogoPath, getTenantTheme, getTenantTypography, getThemeColor, iglooTheme, iglooTypography, isValidTenantId, mergeTenantTheme, tenantThemes, tenantTypography, useIsTenant, useTenantAsset, useTenantFavicon, useTenantId, useTenantLogo, useTenantTheme };
480
2525
  //# sourceMappingURL=index.js.map