igloo-d2c-components 1.0.11 → 1.0.13

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 (105) hide show
  1. package/README.md +0 -18
  2. package/dist/cjs/index.js +41 -2551
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/esm/index.js +41 -2501
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/types/{storybook-components → components/Banner}/Banner.stories.d.ts +1 -1
  7. package/dist/types/{storybook-components → components/Button}/Button.stories.d.ts +1 -1
  8. package/dist/types/{storybook-components → components/Card}/Card.stories.d.ts +1 -1
  9. package/dist/types/context/TenantThemeContext.d.ts +2 -3
  10. package/dist/types/index.d.ts +4 -48
  11. package/dist/types/themes/index.d.ts +1 -1
  12. package/dist/types/types/tenant.d.ts +2 -23
  13. package/dist/types/utils/theme.d.ts +2 -3
  14. package/package.json +2 -4
  15. package/dist/assets/icons/alert.svg +0 -5
  16. package/dist/assets/icons/arrow-down.svg +0 -3
  17. package/dist/assets/icons/arrow.svg +0 -9
  18. package/dist/assets/icons/close.svg +0 -4
  19. package/dist/assets/icons/facebook.svg +0 -3
  20. package/dist/assets/icons/index.ts +0 -26
  21. package/dist/assets/icons/instagram.svg +0 -11
  22. package/dist/assets/icons/youtube.svg +0 -11
  23. package/dist/assets/index.ts +0 -13
  24. package/dist/assets/tenants/ammetlife/logo.svg +0 -10
  25. package/dist/assets/tenants/cimb/logo-white.png +0 -0
  26. package/dist/assets/tenants/cimb/logo.svg +0 -62
  27. package/dist/assets/tenants/igloo/logo.svg +0 -22
  28. package/dist/types/assets/icons/index.d.ts +0 -21
  29. package/dist/types/assets/index.d.ts +0 -9
  30. package/dist/types/components/BillingToggle/BillingToggle.d.ts +0 -34
  31. package/dist/types/components/BillingToggle/index.d.ts +0 -3
  32. package/dist/types/components/BillingToggle/styled.d.ts +0 -12
  33. package/dist/types/components/CheckoutFormButton/CheckoutFormButton.d.ts +0 -39
  34. package/dist/types/components/CheckoutFormButton/index.d.ts +0 -2
  35. package/dist/types/components/CheckoutFormButton/styled.d.ts +0 -9
  36. package/dist/types/components/CheckoutHeader/CheckoutHeader.d.ts +0 -41
  37. package/dist/types/components/CheckoutHeader/index.d.ts +0 -2
  38. package/dist/types/components/CheckoutHeader/styled.d.ts +0 -15
  39. package/dist/types/components/CheckoutProgress/CheckoutProgress.d.ts +0 -35
  40. package/dist/types/components/CheckoutProgress/index.d.ts +0 -2
  41. package/dist/types/components/CheckoutProgress/styled.d.ts +0 -16
  42. package/dist/types/components/ChildInformationForm/ChildInformationForm.d.ts +0 -52
  43. package/dist/types/components/ChildInformationForm/index.d.ts +0 -2
  44. package/dist/types/components/ChildInformationForm/styled.d.ts +0 -4
  45. package/dist/types/components/ContactDetailsForm/ContactDetailsForm.d.ts +0 -63
  46. package/dist/types/components/ContactDetailsForm/index.d.ts +0 -2
  47. package/dist/types/components/ContactDetailsForm/styled.d.ts +0 -10
  48. package/dist/types/components/CoverageAmountSlider/CoverageAmountSlider.d.ts +0 -57
  49. package/dist/types/components/CoverageAmountSlider/index.d.ts +0 -3
  50. package/dist/types/components/CoverageAmountSlider/styled.d.ts +0 -50
  51. package/dist/types/components/Footer/Footer.d.ts +0 -94
  52. package/dist/types/components/Footer/index.d.ts +0 -3
  53. package/dist/types/components/Footer/styled.d.ts +0 -38
  54. package/dist/types/components/Header/Header.d.ts +0 -159
  55. package/dist/types/components/Header/index.d.ts +0 -3
  56. package/dist/types/components/Header/styled.d.ts +0 -80
  57. package/dist/types/components/HealthInformationForm/HealthInformationForm.d.ts +0 -81
  58. package/dist/types/components/HealthInformationForm/index.d.ts +0 -2
  59. package/dist/types/components/HealthInformationForm/styled.d.ts +0 -4
  60. package/dist/types/components/HealthQuestionGroup/HealthQuestionGroup.d.ts +0 -40
  61. package/dist/types/components/HealthQuestionGroup/index.d.ts +0 -2
  62. package/dist/types/components/HealthQuestionGroup/styled.d.ts +0 -20
  63. package/dist/types/components/InfoCallout/InfoCallout.d.ts +0 -34
  64. package/dist/types/components/InfoCallout/index.d.ts +0 -3
  65. package/dist/types/components/InfoCallout/styled.d.ts +0 -16
  66. package/dist/types/components/NewHeader/NewHeader.d.ts +0 -60
  67. package/dist/types/components/NewHeader/index.d.ts +0 -3
  68. package/dist/types/components/NewHeader/styled.d.ts +0 -26
  69. package/dist/types/components/OptionButton/OptionButton.d.ts +0 -59
  70. package/dist/types/components/OptionButton/index.d.ts +0 -3
  71. package/dist/types/components/OptionButton/styled.d.ts +0 -18
  72. package/dist/types/components/PersonalInformationForm/PersonalInformationForm.d.ts +0 -75
  73. package/dist/types/components/PersonalInformationForm/index.d.ts +0 -2
  74. package/dist/types/components/PersonalInformationForm/styled.d.ts +0 -10
  75. package/dist/types/components/ProductCard/ProductCard.d.ts +0 -43
  76. package/dist/types/components/ProductCard/index.d.ts +0 -2
  77. package/dist/types/components/ProductCard/styled.d.ts +0 -27
  78. package/dist/types/components/ProductSelectionDrawer/ProductSelectionDrawer.d.ts +0 -54
  79. package/dist/types/components/ProductSelectionDrawer/index.d.ts +0 -3
  80. package/dist/types/components/ProductSelectionDrawer/styled.d.ts +0 -44
  81. package/dist/types/components/QuestionSection/QuestionSection.d.ts +0 -71
  82. package/dist/types/components/QuestionSection/index.d.ts +0 -3
  83. package/dist/types/components/QuestionSection/styled.d.ts +0 -16
  84. package/dist/types/components/RecommendationsDrawer/RecommendationsDrawer.d.ts +0 -92
  85. package/dist/types/components/RecommendationsDrawer/index.d.ts +0 -3
  86. package/dist/types/components/RecommendationsDrawer/styled.d.ts +0 -35
  87. package/dist/types/components/ToggleGroup/ToggleGroup.d.ts +0 -45
  88. package/dist/types/components/ToggleGroup/index.d.ts +0 -3
  89. package/dist/types/components/ToggleGroup/styled.d.ts +0 -17
  90. package/dist/types/storybook-components/BillingToggle.stories.d.ts +0 -10
  91. package/dist/types/storybook-components/CheckoutProgress.stories.d.ts +0 -9
  92. package/dist/types/storybook-components/CoverageAmountSlider.stories.d.ts +0 -14
  93. package/dist/types/storybook-components/Footer.stories.d.ts +0 -10
  94. package/dist/types/storybook-components/Header.stories.d.ts +0 -9
  95. package/dist/types/storybook-components/HealthQuestionGroup.stories.d.ts +0 -9
  96. package/dist/types/storybook-components/InfoCallout.stories.d.ts +0 -11
  97. package/dist/types/storybook-components/NewHeader.stories.d.ts +0 -82
  98. package/dist/types/storybook-components/OptionButton.stories.d.ts +0 -12
  99. package/dist/types/storybook-components/ProductCard.stories.d.ts +0 -9
  100. package/dist/types/storybook-components/ProductSelectionDrawer.stories.d.ts +0 -24
  101. package/dist/types/storybook-components/QuestionSection.stories.d.ts +0 -11
  102. package/dist/types/storybook-components/RecommendationsDrawer.stories.d.ts +0 -36
  103. package/dist/types/storybook-components/ToggleGroup.stories.d.ts +0 -10
  104. package/dist/types/themes/typography.d.ts +0 -69
  105. package/dist/types/utils/assets.d.ts +0 -54
package/dist/cjs/index.js CHANGED
@@ -2,39 +2,10 @@
2
2
  'use strict';
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
- var React = require('react');
5
+ var react = require('react');
6
6
  var material = require('@mui/material');
7
- var CloseIcon = require('@mui/icons-material/Close');
8
- var ArrowDropDownIcon = require('@mui/icons-material/ArrowDropDown');
9
- var MenuIcon = require('@mui/icons-material/Menu');
10
- var AppBar = require('@mui/material/AppBar');
11
- var Container = require('@mui/material/Container');
12
- var styles = require('@mui/material/styles');
13
- var ArrowBackIcon = require('@mui/icons-material/ArrowBack');
14
- var InfoIcon = require('@mui/icons-material/Info');
15
- var AddIcon = require('@mui/icons-material/Add');
16
- var RemoveIcon = require('@mui/icons-material/Remove');
17
7
 
18
- function _interopNamespaceDefault(e) {
19
- var n = Object.create(null);
20
- if (e) {
21
- Object.keys(e).forEach(function (k) {
22
- if (k !== 'default') {
23
- var d = Object.getOwnPropertyDescriptor(e, k);
24
- Object.defineProperty(n, k, d.get ? d : {
25
- enumerable: true,
26
- get: function () { return e[k]; }
27
- });
28
- }
29
- });
30
- }
31
- n.default = e;
32
- return Object.freeze(n);
33
- }
34
-
35
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
36
-
37
- const TenantThemeContext = React.createContext(undefined);
8
+ const TenantThemeContext = react.createContext(undefined);
38
9
  /**
39
10
  * TenantThemeProvider
40
11
  * Wraps components to provide tenant-specific theming
@@ -50,7 +21,7 @@ const TenantThemeContext = React.createContext(undefined);
50
21
  * ```
51
22
  */
52
23
  function TenantThemeProvider({ children, tenantId, theme, }) {
53
- const value = React.useMemo(() => ({
24
+ const value = react.useMemo(() => ({
54
25
  tenantId,
55
26
  theme,
56
27
  }), [tenantId, theme]);
@@ -58,20 +29,11 @@ function TenantThemeProvider({ children, tenantId, theme, }) {
58
29
  }
59
30
  /**
60
31
  * Hook to access tenant theme configuration
61
- * Returns undefined during SSR if context is not available
62
- * @returns TenantContextValue or undefined during SSR
32
+ * @throws Error if used outside TenantThemeProvider
63
33
  */
64
34
  function useTenantTheme() {
65
- const context = React.useContext(TenantThemeContext);
66
- // During SSR, context might be undefined - return undefined instead of throwing
67
- // This allows components to handle SSR gracefully with fallback values
35
+ const context = react.useContext(TenantThemeContext);
68
36
  if (context === undefined) {
69
- // Check if we're in a browser environment
70
- if (typeof window === 'undefined') {
71
- // SSR - return undefined to allow fallback handling
72
- return undefined;
73
- }
74
- // Client-side but no provider - throw error for development
75
37
  throw new Error('useTenantTheme must be used within a TenantThemeProvider');
76
38
  }
77
39
  return context;
@@ -80,160 +42,15 @@ function useTenantTheme() {
80
42
  * Hook to get tenant ID
81
43
  */
82
44
  function useTenantId() {
83
- const tenantTheme = useTenantTheme();
84
- return (tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.tenantId) || '';
45
+ const { tenantId } = useTenantTheme();
46
+ return tenantId;
85
47
  }
86
48
  /**
87
49
  * Hook to check if current tenant matches given tenant ID
88
50
  */
89
51
  function useIsTenant(checkTenantId) {
90
- const tenantTheme = useTenantTheme();
91
- return (tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.tenantId) === checkTenantId;
92
- }
93
-
94
- /**
95
- * Tenant Typography Configurations
96
- * Centralized typography definitions for all tenants
97
- * Based on b2c-web-demo typography structure
98
- */
99
- /**
100
- * Igloo Typography Configuration
101
- */
102
- const iglooTypography = {
103
- fontFamily: 'Montserrat',
104
- fontWeightRegular: 400,
105
- fontWeightMedium: 500,
106
- fontWeightSemiBold: 600,
107
- fontWeightBold: 700,
108
- fontWeightExtraBold: 800,
109
- fontWeightExtraBlack: 900,
110
- h1: {
111
- fontSize: '42px',
112
- fontStyle: 'normal',
113
- fontWeight: 700,
114
- lineHeight: '48px',
115
- '@media (max-width:600px)': {
116
- fontSize: '24px',
117
- fontStyle: 'normal',
118
- fontWeight: 700,
119
- lineHeight: '30px',
120
- },
121
- },
122
- h2: {
123
- fontSize: '22px',
124
- fontStyle: 'normal',
125
- fontWeight: 700,
126
- lineHeight: '26px',
127
- '@media (max-width:600px)': {
128
- fontSize: '14px',
129
- fontStyle: 'normal',
130
- fontWeight: 700,
131
- lineHeight: '22px',
132
- },
133
- },
134
- h3: {
135
- fontSize: '18px',
136
- fontStyle: 'normal',
137
- fontWeight: 600,
138
- lineHeight: '24px',
139
- '@media (max-width:600px)': {
140
- fontSize: '14px',
141
- fontStyle: 'normal',
142
- fontWeight: 600,
143
- lineHeight: '20px',
144
- },
145
- },
146
- h4: {
147
- fontSize: '18px',
148
- fontStyle: 'normal',
149
- fontWeight: 600,
150
- lineHeight: '24px',
151
- '@media (max-width:600px)': {
152
- fontSize: '14px',
153
- fontStyle: 'normal',
154
- fontWeight: 500,
155
- lineHeight: '18px',
156
- },
157
- },
158
- bodyStrongLarge: {
159
- fontSize: '16px',
160
- fontStyle: 'normal',
161
- fontWeight: 500,
162
- lineHeight: '20px',
163
- '@media (max-width:600px)': {
164
- fontSize: '14px',
165
- fontStyle: 'normal',
166
- fontWeight: 400,
167
- lineHeight: '18px',
168
- },
169
- },
170
- bodyStrongMedium: {
171
- fontSize: '14px',
172
- fontStyle: 'normal',
173
- fontWeight: 500,
174
- lineHeight: '18px',
175
- },
176
- bodyStrongSmall: {
177
- fontSize: '12px',
178
- fontStyle: 'normal',
179
- fontWeight: 500,
180
- lineHeight: '16px',
181
- },
182
- bodyLarge: {
183
- fontSize: '16px',
184
- fontStyle: 'normal',
185
- fontWeight: 400,
186
- lineHeight: '20px',
187
- '@media (max-width:600px)': {
188
- fontSize: '14px',
189
- fontStyle: 'normal',
190
- fontWeight: 400,
191
- lineHeight: '18px',
192
- },
193
- },
194
- bodyMedium: {
195
- fontSize: '14px',
196
- fontStyle: 'normal',
197
- fontWeight: 400,
198
- lineHeight: '20px',
199
- },
200
- bodySmall: {
201
- fontSize: '12px',
202
- fontStyle: 'normal',
203
- fontWeight: 400,
204
- lineHeight: '16px',
205
- },
206
- smallText: {
207
- fontSize: '8px',
208
- fontStyle: 'normal',
209
- fontWeight: 500,
210
- lineHeight: '16px',
211
- },
212
- };
213
- /**
214
- * CIMB Typography Configuration
215
- */
216
- const cimbTypography = Object.assign(Object.assign({}, iglooTypography), { fontFamily: 'CIMB Sans' });
217
- /**
218
- * AmmetLife Typography Configuration
219
- */
220
- const ammetlifeTypography = Object.assign(Object.assign({}, iglooTypography), { fontFamily: 'Montserrat' });
221
- /**
222
- * Typography Registry
223
- * Map of tenant IDs to their typography configurations
224
- */
225
- const tenantTypography = {
226
- igloo: iglooTypography,
227
- cimb: cimbTypography,
228
- ammetlife: ammetlifeTypography,
229
- };
230
- /**
231
- * Get typography configuration by tenant ID
232
- * @param tenantId - The tenant identifier
233
- * @returns Typography configuration for the specified tenant
234
- */
235
- function getTenantTypography(tenantId) {
236
- return tenantTypography[tenantId] || iglooTypography;
52
+ const { tenantId } = useTenantTheme();
53
+ return tenantId === checkTenantId;
237
54
  }
238
55
 
239
56
  /**
@@ -277,19 +94,6 @@ const iglooTheme = {
277
94
  bright: '#fff',
278
95
  granite: '#666',
279
96
  },
280
- // UI Component Colors
281
- ui: {
282
- sliderActive: '#5656F6',
283
- sliderInactive: '#c8c5ca',
284
- sliderBackground: '#f9f9f9',
285
- toggleActive: '#5656F6',
286
- toggleActiveText: '#ffffff',
287
- toggleInactiveText: '#5f5e62',
288
- calloutBackground: '#f9f9f9',
289
- calloutBorder: '#ffffff',
290
- inputBackground: '#ffffff',
291
- inputBorder: '#eeeeee',
292
- },
293
97
  motor: {
294
98
  main: '#00CCFF',
295
99
  light: 'rgba(0, 208, 255, 0.10)',
@@ -315,10 +119,11 @@ const iglooTheme = {
315
119
  main: '#F3A100',
316
120
  },
317
121
  },
318
- typography: Object.assign(Object.assign({}, iglooTypography), { fontFamily: '"Manrope", "Roboto", "Helvetica", "Arial", sans-serif' }),
319
- logo: '/assets/tenants/igloo/logo.svg',
122
+ typography: {
123
+ fontFamily: '"Manrope", "Roboto", "Helvetica", "Arial", sans-serif',
124
+ },
125
+ logo: '/assets/igloo_nobeta.svg',
320
126
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
321
- assetBaseUrl: '/assets/tenants/igloo',
322
127
  };
323
128
  /**
324
129
  * CIMB Theme Configuration
@@ -363,19 +168,6 @@ const cimbTheme = {
363
168
  bright: '#fff',
364
169
  granite: '#666',
365
170
  },
366
- // UI Component Colors
367
- ui: {
368
- sliderActive: '#C3214B',
369
- sliderInactive: '#c8c5ca',
370
- sliderBackground: '#f9f9f9',
371
- toggleActive: '#EE0500',
372
- toggleActiveText: '#fefbff',
373
- toggleInactiveText: '#5f5e62',
374
- calloutBackground: '#f9f9f9',
375
- calloutBorder: '#ffffff',
376
- inputBackground: '#ffffff',
377
- inputBorder: '#eeeeee',
378
- },
379
171
  motor: {
380
172
  main: '#C3214B',
381
173
  light: 'rgba(195, 33, 75, 0.10)',
@@ -402,11 +194,11 @@ const cimbTheme = {
402
194
  main: '#F3A100',
403
195
  },
404
196
  },
405
- typography: Object.assign(Object.assign({}, cimbTypography), { fontFamily: '"CIMB Sans", "Roboto", "Helvetica", "Arial", sans-serif' }),
406
- logo: '/assets/tenants/cimb/logo.svg',
407
- logoWhite: '/assets/tenants/cimb/logo-white.png',
197
+ typography: {
198
+ fontFamily: '"CIMB Sans", "Roboto", "Helvetica", "Arial", sans-serif',
199
+ },
200
+ logo: '/assets/cimb/cimb-logo.svg',
408
201
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
409
- assetBaseUrl: '/assets/tenants/cimb',
410
202
  };
411
203
  /**
412
204
  * Ammetlife Theme Configuration
@@ -414,12 +206,12 @@ const cimbTheme = {
414
206
  const ammetlifeTheme = {
415
207
  palette: {
416
208
  primary: {
417
- dark: '#2869a8',
418
- main: '#317abc',
209
+ dark: '#0D47A1',
210
+ main: '#1976D2',
419
211
  light: '#42A5F5',
420
212
  bright: '#90CAF9',
421
213
  plain: '#E3F2FD',
422
- border: '#317abc',
214
+ border: '#1976D2',
423
215
  },
424
216
  secondary: {
425
217
  dim: '#E65100',
@@ -445,19 +237,6 @@ const ammetlifeTheme = {
445
237
  bright: '#fff',
446
238
  granite: '#666',
447
239
  },
448
- // UI Component Colors
449
- ui: {
450
- sliderActive: '#317abc',
451
- sliderInactive: '#c8c5ca',
452
- sliderBackground: '#f9f9f9',
453
- toggleActive: '#a4ce4e',
454
- toggleActiveText: '#fefbff',
455
- toggleInactiveText: '#5f5e62',
456
- calloutBackground: '#f9f9f9',
457
- calloutBorder: '#ffffff',
458
- inputBackground: '#ffffff',
459
- inputBorder: '#eeeeee',
460
- },
461
240
  motor: {
462
241
  main: '#1976D2',
463
242
  light: 'rgba(25, 118, 210, 0.10)',
@@ -484,10 +263,11 @@ const ammetlifeTheme = {
484
263
  main: '#FF9800',
485
264
  },
486
265
  },
487
- typography: Object.assign(Object.assign({}, ammetlifeTypography), { fontFamily: '"Montserrat", "Roboto", "Helvetica", "Arial", sans-serif' }),
488
- logo: '/assets/tenants/ammetlife/logo.svg',
266
+ typography: {
267
+ fontFamily: '"Open Sans", "Roboto", "Helvetica", "Arial", sans-serif',
268
+ },
269
+ logo: '/assets/ammetlife/logo-AmMetLife.svg',
489
270
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
490
- assetBaseUrl: '/assets/tenants/ammetlife',
491
271
  };
492
272
  /**
493
273
  * Theme Registry
@@ -574,13 +354,12 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
574
354
  * ```
575
355
  */
576
356
  function Button(_a) {
577
- var _b, _c, _d, _e, _f, _g;
357
+ var _b, _c, _d;
578
358
  var { tenantColored = false, variant = 'contained', sx, color } = _a, props = __rest(_a, ["tenantColored", "variant", "sx", "color"]);
579
- const tenantTheme = useTenantTheme();
580
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
581
- const buttonSx = tenantColored && theme
582
- ? 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': {
583
- 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),
359
+ const { theme } = useTenantTheme();
360
+ const buttonSx = tenantColored
361
+ ? Object.assign({ backgroundColor: (_b = theme.palette.primary) === null || _b === void 0 ? void 0 : _b.main, color: '#fff', '&:hover': {
362
+ 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),
584
363
  } }, sx) : sx;
585
364
  return (jsxRuntime.jsx(material.Button, Object.assign({ variant: variant, color: tenantColored ? undefined : color, sx: buttonSx }, props)));
586
365
  }
@@ -599,12 +378,11 @@ function Button(_a) {
599
378
  * ```
600
379
  */
601
380
  function Card(_a) {
602
- var _b, _c;
381
+ var _b;
603
382
  var { title, headerAction, content, actions, tenantAccent = false, sx, children } = _a, props = __rest(_a, ["title", "headerAction", "content", "actions", "tenantAccent", "sx", "children"]);
604
- const tenantTheme = useTenantTheme();
605
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
606
- const cardSx = tenantAccent && theme
607
- ? 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;
383
+ const { theme } = useTenantTheme();
384
+ const cardSx = tenantAccent
385
+ ? Object.assign({ borderTop: `4px solid ${(_b = theme.palette.primary) === null || _b === void 0 ? void 0 : _b.main}` }, sx) : sx;
608
386
  return (jsxRuntime.jsxs(material.Card, Object.assign({ sx: cardSx }, props, { children: [title && jsxRuntime.jsx(material.CardHeader, { title: title, action: headerAction }), (content || children) && (jsxRuntime.jsx(material.CardContent, { children: content || children })), actions && jsxRuntime.jsx(material.CardActions, { children: actions })] })));
609
387
  }
610
388
 
@@ -624,1348 +402,25 @@ function Card(_a) {
624
402
  function Banner(_a) {
625
403
  var _b, _c, _d, _e;
626
404
  var { title, description, action, gradient = true, sx } = _a, props = __rest(_a, ["title", "description", "action", "gradient", "sx"]);
627
- const tenantTheme = useTenantTheme();
628
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
629
- 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';
630
- 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;
405
+ const { theme } = useTenantTheme();
631
406
  const background = gradient
632
- ? `linear-gradient(135deg, ${primaryColor} 0%, ${lightColor} 100%)`
633
- : primaryColor;
407
+ ? `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%)`
408
+ : (_e = theme.palette.primary) === null || _e === void 0 ? void 0 : _e.main;
634
409
  return (jsxRuntime.jsxs(material.Box, Object.assign({ sx: Object.assign({ background, color: 'white', padding: '32px', borderRadius: '12px', textAlign: 'center' }, sx) }, props, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h4", component: "h2", gutterBottom: true, fontWeight: "bold" }, { children: title })), description && (jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", sx: { opacity: 0.95, mb: action ? 2 : 0 } }, { children: description }))), action && jsxRuntime.jsx(material.Box, Object.assign({ sx: { mt: 2 } }, { children: action }))] })));
635
410
  }
636
411
 
637
- const StyledAppBar$1 = styles.styled(AppBar)(({ theme, ispartnershippagemobileview, scrolled }) => {
638
- var _a, _b;
639
- return ({
640
- zIndex: '1000 !important',
641
- backgroundColor: ispartnershippagemobileview && !scrolled
642
- ? 'transparent !important'
643
- : `${((_a = theme.palette.background) === null || _a === void 0 ? void 0 : _a.paper) || '#fff'} !important`,
644
- boxShadow: 'none !important',
645
- '& .MuiToolbar-root': {
646
- minHeight: '80px',
647
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
648
- minHeight: '64px',
649
- },
650
- },
651
- [theme.breakpoints.up(1025)]: {
652
- boxShadow: scrolled && '0px 2px 20px 4px rgba(0, 0, 0, 0.14) !important',
653
- },
654
- });
655
- });
656
- const ResponsiveB2CLayout = styles.styled('div')(({ theme }) => ({
657
- [theme.breakpoints.up(1025)]: {
658
- minWidth: '1128px',
659
- maxWidth: '1128px',
660
- margin: '0 auto',
661
- },
662
- }));
663
- const StyledContainer = styles.styled(Container)(({ theme, ispartnershippagemobileview, scrolled }) => {
664
- var _a;
665
- return ({
666
- boxShadow: 'none',
667
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
668
- boxShadow: !scrolled ? 'none' : '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
669
- },
670
- });
671
- });
672
- const TypographyLogo = styles.styled(material.Typography)(({ theme }) => {
673
- var _a, _b;
674
- return ({
675
- margin: 'auto 40 auto 0',
676
- display: '-webkit-box',
677
- alignItems: 'anchor-center',
678
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.up('md')]: {
679
- width: 95,
680
- height: 57,
681
- },
682
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
683
- width: 73.3,
684
- display: 'flex',
685
- },
686
- });
687
- });
688
- const ButtonDesktopMenu = styles.styled(material.Button)(({ theme }) => {
689
- var _a;
690
- return ({
691
- color: ((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000',
692
- display: 'flex',
693
- padding: '0px 10px',
694
- alignItems: 'center',
695
- gap: 8,
696
- alignSelf: 'stretch',
697
- });
698
- });
699
- const AnchorLinks = styles.styled('a')(({ theme }) => ({
700
- color: 'inherit',
701
- '&:hover': {
702
- color: 'inherit',
703
- },
704
- }));
705
- const StyledAvatar = styles.styled(material.Avatar)(({ theme }) => {
706
- var _a;
707
- return ({
708
- margin: '15px 0',
709
- cursor: 'pointer',
710
- backgroundColor: `${theme.palette.primary.main} !important`,
711
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
712
- margin: '0',
713
- },
714
- });
715
- });
716
- const DivButtonWrapper = styles.styled('div')(({ theme }) => {
717
- var _a;
718
- return ({
719
- justifyContent: 'end',
720
- display: 'flex',
721
- marginTop: 0,
722
- padding: `16px 0`,
723
- gap: 12,
724
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
725
- marginTop: 24,
726
- padding: 0,
727
- },
728
- });
729
- });
730
- const ButtonAuth = styles.styled(material.Button)(({ theme }) => ({
731
- justifyContent: 'center',
732
- alignItems: 'center',
733
- borderRadius: '100px !important',
734
- borderColor: theme.palette.primary.main,
735
- borderStyle: 'solid',
736
- borderWidth: 1,
737
- flex: 1,
738
- height: 40,
739
- minWidth: 'max-content !important',
740
- }));
741
- const TypographyAuth = styles.styled(material.Typography)(({ theme }) => ({
742
- textTransform: 'none',
743
- }));
744
- const StyledMenu = styles.styled(material.Menu)(({ theme }) => {
745
- var _a;
746
- return ({
747
- '& .MuiMenu-paper': {
748
- left: 'auto',
749
- width: 'fit-content',
750
- maxWidth: 'unset',
751
- boxShadow: 'inset',
752
- borderRadius: 16,
753
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
754
- left: `0 !important`,
755
- width: '100%',
756
- boxShadow: 'none !important',
757
- borderRadius: 'none',
758
- },
759
- },
760
- });
761
- });
762
- const DivProductListing = styles.styled('div')(({ theme }) => {
763
- var _a;
764
- return ({
765
- padding: '0 16px',
766
- display: 'flex',
767
- flexDirection: 'column',
768
- alignSelf: 'stretch',
769
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
770
- padding: 16,
771
- },
772
- });
773
- });
774
- const StyledMenuItem = styles.styled(material.MenuItem)(({ theme }) => {
775
- var _a;
776
- return ({
777
- display: 'flex',
778
- borderBottom: 'none',
779
- alignItems: 'flex-start',
780
- gap: 6,
781
- padding: '16px 0 !important',
782
- '&:last-child': {
783
- borderBottom: 'none !important',
784
- },
785
- width: '100%',
786
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
787
- borderBottom: `1px solid ${theme.palette.divider} !important`,
788
- },
789
- });
790
- });
791
- const SpanImageWrapper = styles.styled('span')(({ theme }) => ({
792
- alignItems: 'center',
793
- display: 'flex',
794
- justifyContent: 'center',
795
- margin: 'auto 0',
796
- }));
797
- const ImageProductIcon = styles.styled('img')(({ theme }) => ({
798
- aspectRatio: 1,
799
- objectPosition: 'center',
800
- width: 18,
801
- height: 18,
802
- }));
803
- const StyledMenuItemDesktop = styles.styled(material.MenuItem)(({ theme }) => {
804
- var _a, _b;
805
- return ({
806
- color: `${((_a = theme.palette.secondary) === null || _a === void 0 ? void 0 : _a.main) || '#f00'} !important`,
807
- display: 'flex',
808
- borderBottom: 'none',
809
- alignItems: 'flex-start',
810
- gap: 6,
811
- padding: '16px 0 !important',
812
- '&:last-child': {
813
- borderBottom: 'none !important',
814
- },
815
- width: '100%',
816
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
817
- borderBottom: `1px solid ${theme.palette.divider} !important`,
818
- },
819
- });
820
- });
821
- const StyledCloseIcon = styles.styled(CloseIcon)(({ theme }) => {
822
- var _a;
823
- return ({
824
- color: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'}`,
825
- });
826
- });
827
- const StyledAvatarUserIcon = styles.styled(material.Avatar)(({ theme }) => {
828
- var _a, _b;
829
- return ({
830
- margin: '15px 0',
831
- cursor: 'pointer',
832
- backgroundColor: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'} !important`,
833
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
834
- margin: '0',
835
- },
836
- });
837
- });
838
- const StyledMenuIcon = styles.styled(MenuIcon)(({ theme, ispartnershippagemobileview, scrolled }) => {
839
- var _a, _b;
840
- return ({
841
- color: ispartnershippagemobileview && !scrolled
842
- ? ((_a = theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff'
843
- : `${((_b = theme.palette.text) === null || _b === void 0 ? void 0 : _b.primary) || '#000'}`,
844
- });
845
- });
846
- const StyledDrawer$3 = styles.styled(material.Drawer)(({ theme }) => {
847
- var _a;
848
- return ({
849
- '& .MuiMenu-paper': {
850
- left: 'auto',
851
- width: 'fit-content',
852
- maxWidth: 'unset',
853
- boxShadow: 'inset',
854
- borderRadius: 16,
855
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
856
- left: `0 !important`,
857
- width: '100%',
858
- boxShadow: 'none !important',
859
- borderRadius: 'none',
860
- },
861
- },
862
- });
863
- });
864
- const DivLogoWrapper = styles.styled('div')(({ theme }) => ({
865
- justifyContent: 'space-between',
866
- alignSelf: 'stretch',
867
- backgroundColor: '',
868
- display: 'flex',
869
- gap: '20px',
870
- padding: '12px 16px',
871
- marginBottom: 16,
872
- }));
873
- const DivLogo = styles.styled('div')(({ theme }) => {
874
- var _a, _b;
875
- return ({
876
- margin: 'auto 40 auto 0',
877
- display: '-webkit-box',
878
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.up('md')]: {
879
- width: 95,
880
- height: 57,
881
- },
882
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
883
- width: 60,
884
- height: 36,
885
- display: 'flex',
886
- },
887
- });
888
- });
889
- const DivCrossIconWrapper = styles.styled('div')(({ theme }) => ({
890
- display: 'flex',
891
- alignItems: 'center',
892
- justifyContent: 'center',
893
- padding: 6,
894
- }));
895
- const StyledCloseIconBtn = styles.styled(material.IconButton)(({ theme }) => {
896
- var _a;
897
- return ({
898
- color: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'} !important`,
899
- padding: '0 !important',
900
- });
901
- });
902
- const DivLoginActionContainer = styles.styled('div')(({ theme }) => ({
903
- justifyContent: 'center',
904
- alignSelf: 'stretch',
905
- display: 'flex',
906
- flexDirection: 'column',
907
- padding: ' 0 16px',
908
- }));
909
- const DivCommonMenus = styles.styled('div')(({ theme }) => ({
910
- padding: 16,
911
- display: 'flex',
912
- flexDirection: 'column',
913
- alignSelf: 'stretch',
914
- alignItems: 'flex-start',
915
- }));
916
- const MenuItemOtherLinks = styles.styled(material.MenuItem)(({ theme }) => ({
917
- display: 'flex',
918
- borderBottom: `1px solid ${theme.palette.divider} !important`,
919
- alignItems: 'flex-start',
920
- padding: '16px 0 !important',
921
- '&:last-child': {
922
- borderBottom: 'none !important',
923
- gap: '30px',
924
- justifyContent: 'space-between',
925
- },
926
- width: '100%',
927
- gap: '50%',
928
- }));
929
- const StyledFormControlLabel = styles.styled(material.FormControlLabel)(({ theme }) => ({
930
- '& .MuiRadio-root': {
931
- padding: '0 9px',
932
- },
933
- }));
934
- const ButtonLogout = styles.styled(material.Button)(({ theme }) => {
935
- var _a, _b;
936
- return ({
937
- display: 'flex',
938
- padding: 16,
939
- alignItems: 'center',
940
- gap: 78,
941
- alignSelf: 'stretch',
942
- width: '100%',
943
- flex: '1 0 0',
944
- justifyContent: 'center',
945
- flexDirection: 'column',
946
- borderRadius: '100px !important',
947
- border: `1px solid ${((_a = theme.palette.secondary) === null || _a === void 0 ? void 0 : _a.main) || '#f00'} !important`,
948
- color: `${((_b = theme.palette.secondary) === null || _b === void 0 ? void 0 : _b.main) || '#f00'} !important`,
949
- });
950
- });
951
- const DivLogoutBtnWrapper = styles.styled('div')(({ theme }) => ({
952
- margin: 16,
953
- }));
954
- const AnchorLink$1 = styles.styled('a')(({ theme }) => ({
955
- color: 'inherit',
956
- '&:hover': {
957
- color: 'inherit',
958
- },
959
- }));
960
- const StyledButton$1 = styles.styled(material.Button)(({ theme }) => {
961
- var _a, _b, _c, _d;
962
- return ({
963
- alignSelf: 'start',
964
- 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,
965
- 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',
966
- height: '40px',
967
- borderRadius: '100px',
968
- padding: '10px 24px',
969
- });
970
- });
971
- const StyledButtonBanner = styles.styled(material.Button)(({ theme }) => ({
972
- alignSelf: 'start',
973
- height: '40px',
974
- borderRadius: '100px',
975
- padding: '10px 24px',
976
- }));
977
- const TypographyBtnText = styles.styled(material.Typography)(({ theme }) => {
978
- var _a, _b;
979
- return ({
980
- 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',
981
- textTransform: 'none',
982
- });
983
- });
984
-
985
- /**
986
- * Header component with tenant theme support and responsive navigation
987
- *
988
- * @example
989
- * ```tsx
990
- * <Header
991
- * logo={logoSrc}
992
- * navigationLinks={navLinks}
993
- * languages={languageOptions}
994
- * currentLocale="en"
995
- * onLogoClick={() => history.push('/')}
996
- * onLoginClick={() => setShowLoginModal(true)}
997
- * />
998
- * ```
999
- */
1000
- 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, }) {
1001
- var _a, _b;
1002
- const tenantTheme = useTenantTheme();
1003
- tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
1004
- const muiTheme = material.useTheme();
1005
- const themeBreakpoint = material.useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1006
- const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
1007
- const [anchorElNav, setAnchorElNav] = React__namespace.useState(null);
1008
- const [anchorElLanguage, setAnchorElLanguage] = React__namespace.useState(null);
1009
- const [anchorElUserMenu, setAnchorElUserMenu] = React__namespace.useState(null);
1010
- const shouldShowContent = (!isPartnershipPagePCView || (isPartnershipPagePCView && !scrolled)) &&
1011
- (!isSeoPageView || (isSeoPageView && !scrolled));
1012
- const firstName1stLetter = ((_b = userFirstName === null || userFirstName === void 0 ? void 0 : userFirstName.trim()) === null || _b === void 0 ? void 0 : _b.slice(0, 1)) || '';
1013
- const handleOpenNavMenu = (event) => {
1014
- setAnchorElNav(event.currentTarget);
1015
- };
1016
- const handleOpenLanguageMenu = (event) => {
1017
- setAnchorElLanguage(event.currentTarget);
1018
- };
1019
- const handleCloseNavMenu = () => {
1020
- setAnchorElNav(null);
1021
- };
1022
- const handleCloseLanguageMenu = () => {
1023
- setAnchorElLanguage(null);
1024
- };
1025
- const handleOpenUserMenu = (event) => {
1026
- setAnchorElUserMenu(event.currentTarget);
1027
- };
1028
- const handleCloseUserMenu = () => {
1029
- setAnchorElUserMenu(null);
1030
- };
1031
- const displayLogo = showAlternateLogo && alternateLogo ? alternateLogo : logo;
1032
- return (jsxRuntime.jsx(StyledAppBar$1, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled }, { children: jsxRuntime.jsx(ResponsiveB2CLayout, { children: jsxRuntime.jsx(StyledContainer, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled, maxWidth: "xl" }, { children: jsxRuntime.jsxs(material.Toolbar, Object.assign({ disableGutters: true }, { children: [jsxRuntime.jsx("a", Object.assign({ href: host || '#', onClick: (e) => {
1033
- e === null || e === void 0 ? void 0 : e.preventDefault();
1034
- onLogoClick === null || onLogoClick === void 0 ? void 0 : onLogoClick();
1035
- }, 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: jsxRuntime.jsx(TypographyLogo, Object.assign({ variant: "h6", noWrap: true, sx: {
1036
- mr: isMobile ? 2 : 5,
1037
- display: { xs: 'flex', md: 'flex' },
1038
- flexGrow: isMobile ? 1 : 0,
1039
- fontFamily: 'monospace',
1040
- fontWeight: 700,
1041
- letterSpacing: '.3rem',
1042
- color: 'inherit',
1043
- textDecoration: 'none',
1044
- } }, { children: jsxRuntime.jsx("img", { src: displayLogo, alt: "Logo", style: Object.assign({}, (isMobile && { height: '32px', width: '119px' })), height: isMobile ? '32px' : '57px', width: isMobile ? '119px' : '93.36px' }) })) })), !isMobile && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [shouldShowContent && (jsxRuntime.jsxs(material.Box, Object.assign({ sx: {
1045
- flexGrow: 1,
1046
- display: { xs: 'none', md: 'flex', gap: 40 },
1047
- } }, { children: [jsxRuntime.jsxs(ButtonDesktopMenu, Object.assign({ onClick: handleOpenNavMenu, sx: { my: 2, textTransform: 'capitalize' }, "data-testid": "productNavigationMenu" }, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: formatMessage({ id: 'Products' }) })), jsxRuntime.jsx(material.Icon, { component: ArrowDropDownIcon })] }), "product"), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.partnership) && (jsxRuntime.jsx(ButtonDesktopMenu, Object.assign({ onClick: onPartnershipClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: jsxRuntime.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) && (jsxRuntime.jsx(ButtonDesktopMenu, Object.assign({ onClick: onAboutUsClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: jsxRuntime.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) && (jsxRuntime.jsx(ButtonDesktopMenu, Object.assign({ onClick: onBlogClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: jsxRuntime.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"))] }))), jsxRuntime.jsxs(material.Box, Object.assign({ sx: {
1048
- flexGrow: 1,
1049
- display: {
1050
- xs: 'none',
1051
- md: 'flex',
1052
- gap: 40,
1053
- justifyContent: 'flex-end',
1054
- },
1055
- } }, { children: [shouldShowContent && (jsxRuntime.jsxs(ButtonDesktopMenu, Object.assign({ onClick: handleOpenLanguageMenu, sx: { my: 2, textTransform: 'capitalize' }, "data-testid": "selectedLocale" }, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: formatMessage({
1056
- id: `${currentLocale === null || currentLocale === void 0 ? void 0 : currentLocale.toLocaleUpperCase()}`,
1057
- }) })), jsxRuntime.jsx(material.Icon, { component: ArrowDropDownIcon })] }), "language")), isPartnershipPagePCView && scrolled ? (jsxRuntime.jsx(StyledButton$1, Object.assign({ variant: "contained", onClick: onPartnershipCTAClick }, { children: jsxRuntime.jsx(TypographyBtnText, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Be Our Partner' }) })) }))) : isSeoPageView && scrolled && bannerData ? (jsxRuntime.jsx(StyledButtonBanner, Object.assign({ style: { background: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaBGColor }, variant: "contained", onClick: onGetQuoteClick }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ style: {
1058
- color: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaTextColor,
1059
- textTransform: 'none',
1060
- }, variant: "body1" }, { children: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaText })) }))) : userToken ? (jsxRuntime.jsx(StyledAvatar, Object.assign({ onClick: handleOpenUserMenu, "data-testid": "user-profile-avatar" }, { children: firstName1stLetter }))) : (jsxRuntime.jsxs(DivButtonWrapper, { children: [jsxRuntime.jsx(ButtonAuth, Object.assign({ color: "primary", variant: "outlined", sx: { textTransform: 'capitalize' }, onClick: onLoginClick, "data-testid": "headerLogin" }, { children: jsxRuntime.jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Log in' }) })) })), jsxRuntime.jsx(ButtonAuth, Object.assign({ color: "primary", variant: "contained", sx: { textTransform: 'capitalize' }, onClick: onSignupClick }, { children: jsxRuntime.jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Sign up' }) })) }))] }))] })), jsxRuntime.jsx(StyledMenu, Object.assign({ id: "menu-appbar", anchorEl: anchorElNav, anchorOrigin: {
1061
- vertical: 'bottom',
1062
- horizontal: 'left',
1063
- }, keepMounted: true, transformOrigin: {
1064
- vertical: 'top',
1065
- horizontal: 'left',
1066
- }, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, sx: {
1067
- display: { xs: 'none', md: 'block' },
1068
- } }, { children: jsxRuntime.jsx(DivProductListing, { children: navigationLinks.map(({ key, name, icon }) => (jsxRuntime.jsxs(StyledMenuItem, Object.assign({ onClick: () => {
1069
- onProductMenuClick === null || onProductMenuClick === void 0 ? void 0 : onProductMenuClick(key);
1070
- handleCloseNavMenu();
1071
- }, "data-testid": `product-navigation-${key}` }, { children: [jsxRuntime.jsx(SpanImageWrapper, { children: jsxRuntime.jsx(ImageProductIcon, { src: icon, width: 18, height: 18, alt: name }) }), jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: jsxRuntime.jsx(AnchorLinks, Object.assign({ href: `#${key}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: `${name}` }) })) }))] }), key))) }) })), jsxRuntime.jsx(StyledMenu, Object.assign({ id: "language-menu", anchorEl: anchorElLanguage, anchorOrigin: {
1072
- vertical: 'bottom',
1073
- horizontal: 'left',
1074
- }, keepMounted: true, transformOrigin: {
1075
- vertical: 'top',
1076
- horizontal: 'left',
1077
- }, open: Boolean(anchorElLanguage), onClose: handleCloseLanguageMenu, sx: {
1078
- display: { xs: 'none', md: 'block' },
1079
- } }, { children: jsxRuntime.jsx(DivProductListing, { children: languages.map(({ value, locale, label }) => (jsxRuntime.jsx(StyledMenuItem, Object.assign({ onClick: () => {
1080
- onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(locale, value);
1081
- handleCloseLanguageMenu();
1082
- }, "data-testid": `lang-${locale}` }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: label })) }), value))) }) })), jsxRuntime.jsx(StyledMenu, Object.assign({ id: "user-menu", anchorEl: anchorElUserMenu, anchorOrigin: {
1083
- vertical: 'bottom',
1084
- horizontal: 'left',
1085
- }, keepMounted: true, transformOrigin: {
1086
- vertical: 'top',
1087
- horizontal: 'left',
1088
- }, open: Boolean(anchorElUserMenu), onClose: handleCloseUserMenu, sx: {
1089
- display: { xs: 'none', md: 'block' },
1090
- } }, { children: jsxRuntime.jsxs(DivProductListing, { children: [jsxRuntime.jsx(StyledMenuItem, Object.assign({ onClick: () => {
1091
- onMyProfileClick === null || onMyProfileClick === void 0 ? void 0 : onMyProfileClick();
1092
- handleCloseUserMenu();
1093
- } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `My profile` }) })) }), "myProfile"), jsxRuntime.jsx(StyledMenuItemDesktop, Object.assign({ onClick: () => {
1094
- onLogoutClick === null || onLogoutClick === void 0 ? void 0 : onLogoutClick();
1095
- handleCloseUserMenu();
1096
- } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `Logout` }) })) }), "logout")] }) }))] })), isMobile && (jsxRuntime.jsxs(material.Box, Object.assign({ sx: { flexGrow: 0, display: { xs: 'flex', md: 'none' } } }, { children: [jsxRuntime.jsx(material.IconButton, Object.assign({ size: "large", "aria-label": "account of current user", "aria-controls": "menu-appbar", "aria-haspopup": "true", "aria-labelledby": "menu icon", onClick: (e) => {
1097
- if (isPartnershipPageMobileView && scrolled) {
1098
- onPartnershipCTAClick === null || onPartnershipCTAClick === void 0 ? void 0 : onPartnershipCTAClick();
1099
- }
1100
- else if (isSeoPageView && scrolled) {
1101
- onGetQuoteClick === null || onGetQuoteClick === void 0 ? void 0 : onGetQuoteClick();
1102
- }
1103
- else {
1104
- handleOpenNavMenu(e);
1105
- }
1106
- }, color: "inherit", sx: Object.assign({}, (isPartnershipPageMobileView &&
1107
- scrolled && { padding: '0px !important' })) }, { children: Boolean(anchorElNav) ? (jsxRuntime.jsx(StyledCloseIcon, {})) : isPartnershipPageMobileView && scrolled ? (jsxRuntime.jsx(StyledButton$1, Object.assign({ variant: "contained", onClick: onPartnershipCTAClick }, { children: jsxRuntime.jsx(TypographyBtnText, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Be Our Partner' }) })) }))) : isSeoPageView && scrolled && bannerData ? (jsxRuntime.jsx(StyledButtonBanner, Object.assign({ style: {
1108
- background: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaBGColor,
1109
- }, variant: "contained", onClick: onGetQuoteClick }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ style: {
1110
- color: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaTextColor,
1111
- textTransform: 'none',
1112
- }, variant: "body1" }, { children: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaText })) }))) : userToken ? (jsxRuntime.jsx(StyledAvatarUserIcon, Object.assign({ "data-testid": "user-profile-avatar" }, { children: firstName1stLetter }))) : (jsxRuntime.jsx(StyledMenuIcon, { ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled })) })), jsxRuntime.jsxs(StyledDrawer$3, Object.assign({ id: "menu-appbar", anchor: "top", keepMounted: true, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, sx: {
1113
- display: { xs: 'block', md: 'none' },
1114
- width: '100%',
1115
- left: 0,
1116
- } }, { children: [jsxRuntime.jsxs(DivLogoWrapper, { children: [jsxRuntime.jsx(DivLogo, { children: jsxRuntime.jsx("img", { src: logo, alt: "logo", width: "100%", height: "100%" }) }), jsxRuntime.jsx(DivCrossIconWrapper, { children: jsxRuntime.jsx(StyledCloseIconBtn, Object.assign({ size: "large", "aria-label": "close menu", "aria-controls": "menu-appbar", "aria-haspopup": "true", onClick: handleCloseNavMenu, color: "inherit" }, { children: jsxRuntime.jsx(CloseIcon, {}) })) })] }), userToken ? (userProfileComponent) : (jsxRuntime.jsxs(DivLoginActionContainer, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: welcomeMessage || formatMessage({ id: 'Welcome' }) })), jsxRuntime.jsxs(DivButtonWrapper, { children: [jsxRuntime.jsx(ButtonAuth, Object.assign({ color: "primary", variant: "outlined", onClick: () => {
1117
- onLoginClick === null || onLoginClick === void 0 ? void 0 : onLoginClick();
1118
- handleCloseNavMenu();
1119
- }, "data-testid": "headerLogin" }, { children: jsxRuntime.jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Log in' }) })) })), jsxRuntime.jsx(ButtonAuth, Object.assign({ color: "primary", variant: "contained", onClick: () => {
1120
- onSignupClick === null || onSignupClick === void 0 ? void 0 : onSignupClick();
1121
- handleCloseNavMenu();
1122
- } }, { children: jsxRuntime.jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Sign up' }) })) }))] })] })), jsxRuntime.jsx(DivProductListing, { children: navigationLinks.map(({ key, name, icon }) => (jsxRuntime.jsxs(StyledMenuItem, Object.assign({ onClick: () => {
1123
- onProductMenuClick === null || onProductMenuClick === void 0 ? void 0 : onProductMenuClick(key);
1124
- handleCloseNavMenu();
1125
- }, "data-testid": `product-navigation-${key}` }, { children: [jsxRuntime.jsx(SpanImageWrapper, { children: jsxRuntime.jsx(ImageProductIcon, { src: icon, width: 18, height: 18, alt: name }) }), jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `${name}` }) }))] }), key))) }), jsxRuntime.jsxs(DivCommonMenus, { children: [userToken && (jsxRuntime.jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1126
- handleCloseNavMenu();
1127
- onMyProfileClick === null || onMyProfileClick === void 0 ? void 0 : onMyProfileClick();
1128
- } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: 'My Policy' }) })) }))), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.blog) && (jsxRuntime.jsx(MenuItemOtherLinks, Object.assign({ onClick: onBlogClick }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: jsxRuntime.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) && (jsxRuntime.jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1129
- handleCloseNavMenu();
1130
- onPartnershipClick === null || onPartnershipClick === void 0 ? void 0 : onPartnershipClick();
1131
- } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: menuItems.partnership.label })) }))), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.aboutUs) && (jsxRuntime.jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1132
- handleCloseNavMenu();
1133
- onAboutUsClick === null || onAboutUsClick === void 0 ? void 0 : onAboutUsClick();
1134
- } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: menuItems.aboutUs.label })) }))), jsxRuntime.jsxs(MenuItemOtherLinks, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: 'Language' }) })), jsxRuntime.jsx(material.RadioGroup, Object.assign({ row: true, "aria-labelledby": "language-selector", name: "language-selector", onChange: (e) => {
1135
- const value = e.target.value;
1136
- const selectedLang = languages.find((lang) => lang.locale === value);
1137
- if (selectedLang) {
1138
- onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(selectedLang.locale, selectedLang.value);
1139
- }
1140
- }, defaultValue: currentLocale, value: currentLocale }, { children: languages.map((lang) => (jsxRuntime.jsx(StyledFormControlLabel, { value: lang.locale, control: jsxRuntime.jsx(material.Radio, {}), label: lang.label, "data-testid": `lang-${lang.locale}` }, lang.locale))) }))] })] }), isMobile && userToken && (jsxRuntime.jsx(DivLogoutBtnWrapper, { children: jsxRuntime.jsx(ButtonLogout, Object.assign({ onClick: onLogoutClick }, { children: formatMessage({ id: 'Logout' }) })) }))] }))] })))] })) })) }) })));
1141
- }
1142
-
1143
- const StyledAppBar = styles.styled(material.AppBar)(({ theme }) => ({
1144
- backgroundColor: '#FFFFFF',
1145
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
1146
- zIndex: theme.zIndex.drawer + 1,
1147
- }));
1148
- const StyledToolbar = styles.styled(material.Toolbar)(({ theme }) => ({
1149
- display: 'flex',
1150
- alignItems: 'center',
1151
- justifyContent: 'space-between',
1152
- padding: '12px 16px',
1153
- minHeight: '64px !important',
1154
- [theme.breakpoints.down('md')]: {
1155
- minHeight: '56px !important',
1156
- padding: '12px 16px',
1157
- },
1158
- }));
1159
- const LogoContainer$1 = styles.styled('div')(({ theme }) => ({
1160
- display: 'flex',
1161
- alignItems: 'center',
1162
- cursor: 'pointer',
1163
- height: '32px',
1164
- }));
1165
- const LogoImage = styles.styled('img')(({ theme }) => ({
1166
- height: '32px',
1167
- width: 'auto',
1168
- objectFit: 'contain',
1169
- }));
1170
- const MenuIconButton = styles.styled(material.IconButton)(({ theme }) => ({
1171
- padding: '6px',
1172
- borderRadius: '25px',
1173
- width: '40px',
1174
- height: '40px',
1175
- '& .MuiSvgIcon-root': {
1176
- color: '#000000',
1177
- fontSize: '24px',
1178
- },
1179
- }));
1180
- const StyledDrawer$2 = styles.styled(material.Drawer)(({ theme }) => ({
1181
- '& .MuiDrawer-paper': {
1182
- backgroundColor: '#FFFFFF',
1183
- boxSizing: 'border-box',
1184
- },
1185
- }));
1186
- const DrawerHeader$2 = styles.styled(material.Box)(({ theme }) => ({
1187
- display: 'flex',
1188
- alignItems: 'center',
1189
- justifyContent: 'space-between',
1190
- padding: '12px 16px',
1191
- minHeight: '64px',
1192
- }));
1193
- const DrawerLogoContainer = styles.styled('div')(({ theme }) => ({
1194
- display: 'flex',
1195
- alignItems: 'center',
1196
- cursor: 'pointer',
1197
- height: '32px',
1198
- }));
1199
- const CloseIconButton = styles.styled(material.IconButton)(({ theme }) => ({
1200
- padding: '6px',
1201
- '& .MuiSvgIcon-root': {
1202
- color: '#000000',
1203
- fontSize: '24px',
1204
- },
1205
- }));
1206
- const DrawerContent$2 = styles.styled(material.Box)(({ theme }) => ({
1207
- flex: 1,
1208
- overflowY: 'auto',
1209
- paddingBottom: theme.spacing(2),
1210
- }));
1211
- styles.styled(material.Box)(({ theme }) => ({
1212
- padding: theme.spacing(2),
1213
- borderTop: `1px solid ${theme.palette.divider}`,
1214
- }));
1215
-
1216
- /**
1217
- * NewHeader component - simplified design based on Figma
1218
- *
1219
- * @example
1220
- * ```tsx
1221
- * <NewHeader
1222
- * logo={logoSrc}
1223
- * navigationLinks={navLinks}
1224
- * onLogoClick={() => history.push('/')}
1225
- * />
1226
- * ```
1227
- */
1228
- function NewHeader({ logo: propLogo, navigationLinks = [], additionalMenuSections = [], isMobile: propIsMobile, onLogoClick, onMenuOpen, onMenuClose, customDrawerContent, formatMessage = (descriptor) => descriptor.id, }) {
1229
- var _a;
1230
- const tenantTheme = useTenantTheme();
1231
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
1232
- const muiTheme = material.useTheme();
1233
- const themeBreakpoint = material.useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1234
- const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
1235
- // Use prop logo if provided, otherwise try to get from theme
1236
- // Fallback to empty string to avoid SSR errors
1237
- const logo = propLogo || (theme === null || theme === void 0 ? void 0 : theme.logo) || '';
1238
- const [drawerOpen, setDrawerOpen] = React__namespace.useState(false);
1239
- const handleDrawerOpen = () => {
1240
- setDrawerOpen(true);
1241
- onMenuOpen === null || onMenuOpen === void 0 ? void 0 : onMenuOpen();
1242
- };
1243
- const handleDrawerClose = () => {
1244
- setDrawerOpen(false);
1245
- onMenuClose === null || onMenuClose === void 0 ? void 0 : onMenuClose();
1246
- };
1247
- const handleLogoClick = (e) => {
1248
- e.preventDefault();
1249
- onLogoClick === null || onLogoClick === void 0 ? void 0 : onLogoClick();
1250
- };
1251
- const handleMenuItemClick = (item) => {
1252
- var _a;
1253
- (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item);
1254
- handleDrawerClose();
1255
- };
1256
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(StyledAppBar, Object.assign({ position: "fixed" }, { children: jsxRuntime.jsxs(StyledToolbar, Object.assign({ disableGutters: true }, { children: [jsxRuntime.jsx(LogoContainer$1, Object.assign({ onClick: handleLogoClick }, { children: jsxRuntime.jsx(LogoImage, { src: logo, alt: "Logo" }) })), jsxRuntime.jsx(MenuIconButton, Object.assign({ size: "large", edge: "end", "aria-label": "menu", onClick: handleDrawerOpen }, { children: jsxRuntime.jsx(MenuIcon, {}) }))] })) })), jsxRuntime.jsx(StyledDrawer$2, Object.assign({ anchor: "right", open: drawerOpen, onClose: handleDrawerClose }, { children: customDrawerContent ? (jsxRuntime.jsx(material.Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: customDrawerContent }))) : (jsxRuntime.jsxs(material.Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: [jsxRuntime.jsxs(DrawerHeader$2, { children: [jsxRuntime.jsx(DrawerLogoContainer, Object.assign({ onClick: handleLogoClick }, { children: jsxRuntime.jsx(LogoImage, { src: logo, alt: "Logo" }) })), jsxRuntime.jsx(CloseIconButton, Object.assign({ onClick: handleDrawerClose, "aria-label": "close" }, { children: jsxRuntime.jsx(CloseIcon, {}) }))] }), jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsxs(DrawerContent$2, { children: [navigationLinks.length > 0 && (jsxRuntime.jsx(material.List, { children: navigationLinks.map((item) => (jsxRuntime.jsx(material.ListItem, Object.assign({ disablePadding: true }, { children: jsxRuntime.jsx(material.ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsxRuntime.jsx(material.ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })), additionalMenuSections.map((section, index) => (jsxRuntime.jsxs(React__namespace.Fragment, { children: [section.title && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsx(material.Box, Object.assign({ sx: { px: 2, py: 1 } }, { children: jsxRuntime.jsx(material.ListItemText, { primary: formatMessage({ id: section.title }), primaryTypographyProps: {
1257
- variant: 'caption',
1258
- color: 'text.secondary',
1259
- } }) }))] })), jsxRuntime.jsx(material.List, { children: section.items.map((item) => (jsxRuntime.jsx(material.ListItem, Object.assign({ disablePadding: true }, { children: jsxRuntime.jsx(material.ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsxRuntime.jsx(material.ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })] }, index)))] })] }))) }))] }));
1260
- }
1261
-
1262
- const DivFooter = styles.styled('div')(({ theme }) => ({
1263
- backgroundColor: '#424242',
1264
- padding: '20px 16px',
1265
- '@media (min-width: 769px)': {
1266
- padding: '70px 0px',
1267
- },
1268
- anchorLinks: {
1269
- color: 'inherit',
1270
- '&:hover': {
1271
- color: 'inherit',
1272
- },
1273
- },
1274
- }));
1275
- const DivFooterConterResponsiveLayout = styles.styled('div')(({ theme }) => ({
1276
- color: '#fff',
1277
- [theme.breakpoints.up(1025)]: {
1278
- minWidth: '1128px',
1279
- maxWidth: '1128px',
1280
- margin: '0 auto',
1281
- },
1282
- }));
1283
- const FooterHiddenContent = styles.styled('div')(({ theme, simplifiedLayout }) => simplifiedLayout ? { display: 'none' } : { display: 'flex' });
1284
- const DivIglooIntro = styles.styled('div')(({ theme }) => {
1285
- var _a;
1286
- return ({
1287
- display: 'flex',
1288
- flexDirection: 'column',
1289
- gap: '24px',
1290
- color: ((_a = theme === null || theme === void 0 ? void 0 : theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff',
1291
- '@media (min-width: 769px)': {
1292
- width: 320,
1293
- marginRight: 194,
1294
- },
1295
- });
1296
- });
1297
- const DivSocial = styles.styled('div')(({ theme }) => ({
1298
- display: 'flex',
1299
- alignItems: 'center',
1300
- margin: '0 auto',
1301
- columnGap: '32px',
1302
- flexDirection: 'row',
1303
- '@media (min-width: 769px)': {
1304
- margin: 'initial',
1305
- },
1306
- }));
1307
- const ButtonIcon = styles.styled(material.Button)(({ theme }) => {
1308
- var _a;
1309
- return ({
1310
- color: ((_a = theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff',
1311
- padding: '0 !important',
1312
- minWidth: 'auto !important',
1313
- });
1314
- });
1315
- const TypographyIntro = styles.styled(material.Typography)(({ theme }) => ({
1316
- textAlign: 'center',
1317
- color: `#fff !important`,
1318
- '@media (min-width: 769px)': {
1319
- textAlign: 'left',
1320
- },
1321
- }));
1322
- const TypographyAddressFooter = styles.styled(material.Typography)(({ theme }) => ({
1323
- marginTop: 16,
1324
- textAlign: 'center',
1325
- color: '#fff',
1326
- '@media (min-width: 769px)': {
1327
- textAlign: 'left',
1328
- },
1329
- }));
1330
- const DivLogos = styles.styled('div')(({ theme }) => ({
1331
- display: 'flex',
1332
- flexDirection: 'column',
1333
- gap: 16,
1334
- alignItems: 'center',
1335
- marginTop: 16,
1336
- '@media (min-width: 769px)': {
1337
- width: '100%',
1338
- marginTop: 0,
1339
- gap: 'initial',
1340
- alignItems: 'baseline',
1341
- },
1342
- }));
1343
- const DivFirstRow = styles.styled('div')(({ theme }) => ({
1344
- display: 'flex',
1345
- flexDirection: 'row',
1346
- gap: 16,
1347
- }));
1348
- const ButtonOjkLink = styles.styled(material.Button)(({ theme }) => ({
1349
- display: 'flex',
1350
- justifyContent: 'flex-start',
1351
- '@media (min-width: 769px)': {
1352
- display: 'flex !important',
1353
- justifyContent: 'flex-start !important ',
1354
- },
1355
- }));
1356
- const ImageOjkLicense = styles.styled('img')(({ theme }) => ({
1357
- alignSelf: 'flex-start',
1358
- height: 36,
1359
- }));
1360
- const ButtonSolisoustamaLink = styles.styled(material.Button)(({ theme }) => ({
1361
- display: 'flex',
1362
- justifyContent: 'flex-start',
1363
- }));
1364
- const ImageSolisoustama = styles.styled('img')(({ theme }) => ({
1365
- height: 'auto',
1366
- }));
1367
- const DivLinks = styles.styled('div')(({ theme }) => ({
1368
- display: 'flex',
1369
- flex: 1,
1370
- alignItems: 'center',
1371
- gap: 16,
1372
- justifyContent: 'center',
1373
- '@media (min-width: 769px)': {
1374
- flex: '1 1',
1375
- alignItems: 'normal',
1376
- },
1377
- }));
1378
- const DivSection = styles.styled('div')(({ theme }) => ({
1379
- display: 'flex',
1380
- flexDirection: 'column',
1381
- gap: 16,
1382
- flex: 1,
1383
- alignItems: 'flex-start',
1384
- '@media (min-width: 769px)': {
1385
- gap: 24,
1386
- '&:not(:first-of-type)': {
1387
- marginLeft: 194,
1388
- },
1389
- },
1390
- }));
1391
- const ButtonBottomLink = styles.styled(material.Button)(({ theme }) => ({
1392
- color: '#fff !important',
1393
- textTransform: 'capitalize',
1394
- '@media (min-width: 769px)': {
1395
- padding: '0 !important',
1396
- textAlign: 'left !important',
1397
- minWidth: 'auto !important',
1398
- },
1399
- }));
1400
- const StyledDivider = styles.styled(material.Divider)(({ theme }) => ({
1401
- margin: '24px 0 16px !important',
1402
- borderColor: '#5F5E62 !important',
1403
- }));
1404
- const DivBottom = styles.styled('div')(({ theme }) => ({
1405
- display: 'flex',
1406
- justifyContent: 'space-between',
1407
- alignItems: 'center',
1408
- }));
1409
- const DivSep = styles.styled('div')(({ theme }) => ({
1410
- width: '1px',
1411
- height: 10,
1412
- borderRadius: '1px',
1413
- backgroundColor: '#fff',
1414
- }));
1415
- const AnchorLink = styles.styled('a')(({ theme }) => ({
1416
- color: 'inherit',
1417
- '&:hover': {
1418
- color: 'inherit',
1419
- },
1420
- }));
1421
-
1422
- /**
1423
- * Footer component with tenant theme support
1424
- *
1425
- * @example
1426
- * ```tsx
1427
- * <Footer
1428
- * introText="Company introduction..."
1429
- * socialLinks={socialMediaLinks}
1430
- * licenseImages={licenses}
1431
- * navigationLinks={footerNavLinks}
1432
- * currentLocale="en"
1433
- * />
1434
- * ```
1435
- */
1436
- function Footer({ simplifiedLayout = false, introText, addressText, socialLinks, licenseImages, poweredByImage, navigationLinks = [], currentLocale, host = '', isMobile: propIsMobile, onLinkClick, onSocialClick, onPrivacyPolicyClick, onTermsOfServiceClick, formatMessage = (descriptor) => descriptor.id, }) {
1437
- var _a;
1438
- const tenantTheme = useTenantTheme();
1439
- tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
1440
- const muiTheme = material.useTheme();
1441
- const themeBreakpoint = material.useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1442
- const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
1443
- return (jsxRuntime.jsx(DivFooter, { children: jsxRuntime.jsxs(DivFooterConterResponsiveLayout, { children: [jsxRuntime.jsxs(FooterHiddenContent, Object.assign({ simplifiedLayout: simplifiedLayout }, { children: [jsxRuntime.jsxs(DivIglooIntro, { children: [isMobile && (jsxRuntime.jsx(DivSocial, { children: socialLinks.map((social) => (jsxRuntime.jsx(ButtonIcon, Object.assign({ onClick: () => onSocialClick === null || onSocialClick === void 0 ? void 0 : onSocialClick(social.platform, social.url), "aria-label": social.ariaLabel || social.platform }, { children: jsxRuntime.jsx("img", { src: social.icon, alt: social.platform, loading: "lazy", height: "24px", width: "24px" }) }), social.platform))) })), jsxRuntime.jsx(TypographyIntro, Object.assign({ variant: "body2" }, { children: formatMessage({ id: introText }) })), addressText && (jsxRuntime.jsx(TypographyAddressFooter, Object.assign({ variant: "body2" }, { children: addressText }))), jsxRuntime.jsxs(DivLogos, { children: [jsxRuntime.jsx(DivFirstRow, { children: licenseImages.map((license, index) => (jsxRuntime.jsx(ButtonOjkLink, Object.assign({ onClick: () => license.url && window.open(license.url), "aria-label": license.ariaLabel || license.alt }, { children: jsxRuntime.jsx(ImageOjkLicense, { src: license.src, alt: license.alt, width: license.width, height: license.height, loading: "lazy" }) }), index))) }), poweredByImage && (jsxRuntime.jsx(ButtonSolisoustamaLink, Object.assign({ "aria-label": poweredByImage.ariaLabel || 'Powered by' }, { children: jsxRuntime.jsx(ImageSolisoustama, { src: poweredByImage.src, alt: poweredByImage.alt, width: poweredByImage.width, height: poweredByImage.height, loading: "lazy" }) })))] })] }), !isMobile && (jsxRuntime.jsx(DivLinks, { children: navigationLinks === null || navigationLinks === void 0 ? void 0 : navigationLinks.map((items, index) => (jsxRuntime.jsxs(DivSection, { children: [items === null || items === void 0 ? void 0 : items.map((link, _index) => {
1444
- var _a, _b, _c;
1445
- 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');
1446
- const anchorLinkOuterRef = isExternalURL
1447
- ? link.outerHref || ''
1448
- : `${host}${link.outerHref}`;
1449
- const anchorLinkInnerRef = `${host}${link.innerHref}`;
1450
- return (jsxRuntime.jsx(ButtonBottomLink, Object.assign({ onClick: () => {
1451
- onLinkClick === null || onLinkClick === void 0 ? void 0 : onLinkClick(link);
1452
- } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1" }, { children: jsxRuntime.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));
1453
- }), index === navigationLinks.length - 1 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ButtonBottomLink, Object.assign({ onClick: onPrivacyPolicyClick }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1" }, { children: jsxRuntime.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' }) })) })) })), jsxRuntime.jsx(ButtonBottomLink, Object.assign({ onClick: onTermsOfServiceClick }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1" }, { children: jsxRuntime.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' }) })) })) })), jsxRuntime.jsx(DivSocial, { children: socialLinks.map((social) => (jsxRuntime.jsx(ButtonIcon, Object.assign({ onClick: () => onSocialClick === null || onSocialClick === void 0 ? void 0 : onSocialClick(social.platform, social.url), "aria-label": social.ariaLabel || social.platform }, { children: jsxRuntime.jsx(AnchorLink, Object.assign({ href: social.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: jsxRuntime.jsx("img", { src: social.icon, alt: social.platform, height: isMobile ? '24' : '28', width: isMobile ? '24' : '28', loading: "lazy" }) })) }), social.platform))) })] }))] }, index))) }))] })), isMobile && jsxRuntime.jsx(StyledDivider, {}), isMobile && (jsxRuntime.jsx(DivBottom, { children: jsxRuntime.jsxs(DivLinks, { children: [jsxRuntime.jsx("div", Object.assign({ onClick: onPrivacyPolicyClick, style: { cursor: 'pointer' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body2" }, { children: jsxRuntime.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' }) })) })) })), jsxRuntime.jsx(DivSep, {}), jsxRuntime.jsx("div", Object.assign({ onClick: onTermsOfServiceClick, style: { cursor: 'pointer' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body2" }, { children: jsxRuntime.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' }) })) })) }))] }) }))] }) }));
1454
- }
1455
-
1456
- const StyledDrawer$1 = styles.styled(material.Drawer)(({ theme }) => ({
1457
- zIndex: '1300 !important',
1458
- '& .MuiDrawer-root': {
1459
- zIndex: 1300,
1460
- },
1461
- '& .MuiDrawer-paper': {
1462
- backgroundColor: '#FFFFFF',
1463
- boxSizing: 'border-box',
1464
- overflow: 'hidden',
1465
- zIndex: 1300,
1466
- },
1467
- '& .MuiBackdrop-root': {
1468
- zIndex: 1299,
1469
- },
1470
- }));
1471
- const DrawerHeader$1 = styles.styled(material.Box)(({ theme }) => ({
1472
- display: 'flex',
1473
- alignItems: 'center',
1474
- justifyContent: 'flex-start',
1475
- padding: '16px',
1476
- minHeight: '56px',
1477
- }));
1478
- const DrawerContent$1 = styles.styled(material.Box)(({ theme }) => ({
1479
- flex: 1,
1480
- overflowY: 'auto',
1481
- paddingBottom: theme.spacing(2),
1482
- }));
1483
- const DrawerFooter = styles.styled(material.Box)(({ theme }) => ({
1484
- padding: '16px',
1485
- backgroundColor: '#FFFFFF',
1486
- borderTop: 'none',
1487
- boxShadow: '0px -2px 8px rgba(0, 0, 0, 0.08)',
1488
- }));
1489
- styles.styled(material.Button)(({ theme }) => ({
1490
- minWidth: 'auto',
1491
- padding: 0,
1492
- }));
1493
- const HeaderSection = styles.styled(material.Box)(({ theme }) => ({
1494
- backgroundColor: '#FFFFFF',
1495
- padding: '16px',
1496
- display: 'flex',
1497
- flexDirection: 'column',
1498
- gap: '12px',
1499
- }));
1500
- const CategoryIcon = styles.styled(material.Box)(({ theme }) => ({
1501
- width: '32px',
1502
- height: '32px',
1503
- display: 'flex',
1504
- alignItems: 'center',
1505
- justifyContent: 'center',
1506
- }));
1507
- const TitleText = styles.styled(material.Typography)(({ theme }) => ({
1508
- fontFamily: '"Montserrat", sans-serif',
1509
- fontWeight: 700,
1510
- fontSize: '20px',
1511
- lineHeight: '28px',
1512
- color: '#13131B',
1513
- }));
1514
- const SubtitleText = styles.styled(material.Typography)(({ theme }) => ({
1515
- fontFamily: '"Montserrat", sans-serif',
1516
- fontWeight: 400,
1517
- fontSize: '14px',
1518
- lineHeight: '18px',
1519
- color: '#5F5E62',
1520
- }));
1521
- const FooterButtons = styles.styled(material.Box)(({ theme }) => ({
1522
- display: 'flex',
1523
- flexDirection: 'column',
1524
- gap: '16px',
1525
- width: '100%',
1526
- }));
1527
- // Base button styles - colors will be injected via sx prop from component
1528
- const PrimaryButton = styles.styled(material.Button)(({ theme }) => ({
1529
- color: '#FFFFFF',
1530
- borderRadius: '8px',
1531
- height: '48px',
1532
- textTransform: 'none',
1533
- fontFamily: '"Montserrat", sans-serif',
1534
- fontWeight: 500,
1535
- fontSize: '14px',
1536
- lineHeight: '18px',
1537
- '&:disabled': {
1538
- backgroundColor: '#C8C5CA',
1539
- color: '#FFFFFF',
1540
- },
1541
- }));
1542
- const SecondaryButton = styles.styled(material.Button)(({ theme }) => ({
1543
- borderRadius: '8px',
1544
- height: '40px',
1545
- textTransform: 'none',
1546
- fontFamily: '"Montserrat", sans-serif',
1547
- fontWeight: 500,
1548
- fontSize: '14px',
1549
- lineHeight: '18px',
1550
- }));
1551
-
1552
- /**
1553
- * RecommendationsDrawer - Mobile drawer for recommendations and forms
1554
- *
1555
- * @example
1556
- * ```tsx
1557
- * <RecommendationsDrawer
1558
- * open={isOpen}
1559
- * onClose={handleClose}
1560
- * title="Personalize Your Plan"
1561
- * subtitle="Answer a few questions"
1562
- * primaryButtonText="Next"
1563
- * onPrimaryAction={handleNext}
1564
- * >
1565
- * <QuestionSection question="What is your budget?" />
1566
- * </RecommendationsDrawer>
1567
- * ```
1568
- */
1569
- function RecommendationsDrawer({ open, onClose, children, headerIcon, title, subtitle, showBackButton = false, onBack, primaryButtonText, onPrimaryAction, primaryButtonDisabled = false, secondaryButtonText, onSecondaryAction, showFooter = true, customFooter, formatMessage = (descriptor) => descriptor.id, }) {
1570
- var _a, _b, _c, _d, _e, _f, _g;
1571
- const muiTheme = material.useTheme();
1572
- material.useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1573
- const tenantTheme = useTenantTheme();
1574
- // Get primary color from tenant theme, fallback to default
1575
- const primaryColor = ((_d = (_c = (_b = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _b === void 0 ? void 0 : _b.palette) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d.main) || '#317abc';
1576
- const primaryDark = ((_g = (_f = (_e = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _e === void 0 ? void 0 : _e.palette) === null || _f === void 0 ? void 0 : _f.primary) === null || _g === void 0 ? void 0 : _g.dark) || '#2869a8';
1577
- // Helper to convert hex to rgba
1578
- const hexToRgba = (hex, alpha) => {
1579
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
1580
- if (result) {
1581
- const r = parseInt(result[1], 16);
1582
- const g = parseInt(result[2], 16);
1583
- const b = parseInt(result[3], 16);
1584
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
1585
- }
1586
- return `rgba(49, 122, 188, ${alpha})`;
1587
- };
1588
- const handleClose = () => {
1589
- onClose();
1590
- };
1591
- const handleBackOrClose = () => {
1592
- if (showBackButton && onBack) {
1593
- onBack();
1594
- }
1595
- else {
1596
- onClose();
1597
- }
1598
- };
1599
- return (jsxRuntime.jsx(StyledDrawer$1, Object.assign({ anchor: "bottom", open: open, onClose: handleClose, PaperProps: {
1600
- sx: {
1601
- height: '95vh',
1602
- borderTopLeftRadius: '16px',
1603
- borderTopRightRadius: '16px',
1604
- maxHeight: '95vh',
1605
- },
1606
- }, sx: {
1607
- zIndex: 1300,
1608
- } }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', height: '100%' } }, { children: [jsxRuntime.jsx(DrawerHeader$1, { children: jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: handleBackOrClose, sx: { padding: 0 }, "aria-label": showBackButton ? 'back' : 'close' }, { children: showBackButton ? jsxRuntime.jsx(ArrowBackIcon, {}) : jsxRuntime.jsx(CloseIcon, {}) })) }), (title || subtitle || headerIcon) && (jsxRuntime.jsxs(HeaderSection, { children: [headerIcon && (jsxRuntime.jsx(CategoryIcon, { children: jsxRuntime.jsx("img", { src: headerIcon, alt: "Category icon", width: 32, height: 32 }) })), title && (jsxRuntime.jsx(TitleText, Object.assign({ variant: "h5" }, { children: formatMessage({ id: title }) }))), subtitle && (jsxRuntime.jsx(SubtitleText, Object.assign({ variant: "body2" }, { children: formatMessage({ id: subtitle }) })))] })), jsxRuntime.jsx(DrawerContent$1, { children: children }), showFooter && (jsxRuntime.jsx(DrawerFooter, { children: customFooter ? (customFooter) : (jsxRuntime.jsxs(FooterButtons, { children: [primaryButtonText && (jsxRuntime.jsx(PrimaryButton, Object.assign({ variant: "contained", fullWidth: true, onClick: onPrimaryAction, disabled: primaryButtonDisabled, sx: {
1609
- backgroundColor: primaryColor,
1610
- '&:hover': {
1611
- backgroundColor: primaryDark,
1612
- },
1613
- } }, { children: formatMessage({ id: primaryButtonText }) }))), secondaryButtonText && (jsxRuntime.jsx(SecondaryButton, Object.assign({ variant: "text", fullWidth: true, onClick: onSecondaryAction, sx: {
1614
- color: primaryColor,
1615
- '&:hover': {
1616
- backgroundColor: hexToRgba(primaryColor, 0.08),
1617
- },
1618
- } }, { children: formatMessage({ id: secondaryButtonText }) })))] })) }))] })) })));
1619
- }
1620
-
1621
- const StyledDrawer = material.styled(material.Drawer)(({ theme }) => ({
1622
- zIndex: 1300,
1623
- '& .MuiDrawer-paper': {
1624
- borderTopLeftRadius: '8px',
1625
- borderTopRightRadius: '8px',
1626
- maxHeight: '90vh',
1627
- },
1628
- }));
1629
- const DrawerContent = material.styled(material.Box)({
1630
- display: 'flex',
1631
- flexDirection: 'column',
1632
- width: '100%',
1633
- backgroundColor: '#ffffff',
1634
- });
1635
- const DrawerHeader = material.styled(material.Box)({
1636
- display: 'flex',
1637
- justifyContent: 'flex-end',
1638
- alignItems: 'center',
1639
- padding: '16px 16px 0',
1640
- backgroundColor: '#ffffff',
1641
- });
1642
- const CloseButtonContainer = material.styled(material.Box)({
1643
- width: '24px',
1644
- height: '24px',
1645
- });
1646
- const Header = material.styled(material.Box)({
1647
- display: 'flex',
1648
- flexDirection: 'column',
1649
- gap: '6px',
1650
- padding: '16px',
1651
- backgroundColor: '#ffffff',
1652
- });
1653
- const HeaderTitle = material.styled(material.Typography)({
1654
- fontFamily: 'Montserrat, sans-serif',
1655
- fontSize: '20px',
1656
- fontWeight: 700,
1657
- lineHeight: '28px',
1658
- color: '#13131b',
1659
- });
1660
- const HeaderSubtitle = material.styled(material.Typography)({
1661
- fontFamily: 'Montserrat, sans-serif',
1662
- fontSize: '14px',
1663
- fontWeight: 400,
1664
- lineHeight: '18px',
1665
- color: 'rgba(0, 0, 0, 0.6)',
1666
- });
1667
- const ProductsContainer = material.styled(material.Box)({
1668
- padding: '16px',
1669
- backgroundColor: '#ffffff',
1670
- });
1671
- const ProductsGrid = material.styled(material.Box)({
1672
- display: 'grid',
1673
- gridTemplateColumns: 'repeat(2, 1fr)',
1674
- gap: '12px',
1675
- });
1676
- const ProductCard$1 = material.styled(material.Box)({
1677
- display: 'flex',
1678
- flexDirection: 'column',
1679
- gap: '16px',
1680
- backgroundColor: '#ffffff',
1681
- borderRadius: '12px',
1682
- boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.12)',
1683
- padding: '16px 12px 12px',
1684
- height: '168px',
1685
- });
1686
- const ProductInfo$1 = material.styled(material.Box)({
1687
- display: 'flex',
1688
- flexDirection: 'column',
1689
- gap: '6px',
1690
- alignItems: 'center',
1691
- justifyContent: 'center',
1692
- flex: 1,
1693
- });
1694
- const ProductLogo = material.styled(material.Box)({
1695
- display: 'flex',
1696
- alignItems: 'center',
1697
- justifyContent: 'center',
1698
- padding: '4px',
1699
- });
1700
- const ProductName$1 = material.styled(material.Typography)({
1701
- fontFamily: 'Montserrat, sans-serif',
1702
- fontSize: '14px',
1703
- fontWeight: 700,
1704
- lineHeight: '22px',
1705
- color: '#13131b',
1706
- textAlign: 'center',
1707
- });
1708
- const ProductType = material.styled(material.Typography)({
1709
- fontFamily: 'Montserrat, sans-serif',
1710
- fontSize: '12px',
1711
- fontWeight: 400,
1712
- lineHeight: '16px',
1713
- color: '#13131b',
1714
- textAlign: 'center',
1715
- });
1716
- // Base button styles - colors will be injected via sx prop from component
1717
- const ViewPlansButton = material.styled(material.Button)({
1718
- color: '#ffffff',
1719
- borderRadius: '8px',
1720
- height: '36px',
1721
- textTransform: 'none',
1722
- fontFamily: 'Montserrat, sans-serif',
1723
- fontSize: '14px',
1724
- fontWeight: 500,
1725
- lineHeight: '18px',
1726
- });
1727
-
1728
- 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', }) {
1729
- var _a, _b, _c, _d, _e, _f;
1730
- const tenantTheme = useTenantTheme();
1731
- // Get primary color from tenant theme, fallback to default
1732
- const primaryColor = ((_c = (_b = (_a = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#317abc';
1733
- const primaryDark = ((_f = (_e = (_d = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _d === void 0 ? void 0 : _d.palette) === null || _e === void 0 ? void 0 : _e.primary) === null || _f === void 0 ? void 0 : _f.dark) || '#2869a8';
1734
- const primaryDarker = '#1f5489'; // Active state
1735
- return (jsxRuntime.jsx(StyledDrawer, Object.assign({ anchor: "bottom", open: open, onClose: onClose }, { children: jsxRuntime.jsxs(DrawerContent, { children: [jsxRuntime.jsx(DrawerHeader, { children: jsxRuntime.jsx(CloseButtonContainer, { children: jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: onClose, sx: { padding: 0 } }, { children: jsxRuntime.jsx(CloseIcon, { sx: { fontSize: 24, color: '#13131b' } }) })) }) }), jsxRuntime.jsxs(Header, { children: [jsxRuntime.jsx(HeaderTitle, { children: title }), jsxRuntime.jsx(HeaderSubtitle, { children: subtitle })] }), jsxRuntime.jsx(ProductsContainer, { children: jsxRuntime.jsx(ProductsGrid, { children: products.map((product) => (jsxRuntime.jsxs(ProductCard$1, { children: [jsxRuntime.jsxs(ProductInfo$1, { children: [jsxRuntime.jsx(ProductLogo, { children: jsxRuntime.jsx("img", { src: product.logo, alt: product.name, style: {
1736
- width: '88px',
1737
- height: '32px',
1738
- objectFit: 'cover',
1739
- } }) }), jsxRuntime.jsxs(material.Box, Object.assign({ sx: { textAlign: 'center', width: '100%' } }, { children: [jsxRuntime.jsx(ProductName$1, { children: product.name }), jsxRuntime.jsx(ProductType, { children: product.type })] }))] }), jsxRuntime.jsx(ViewPlansButton, Object.assign({ variant: "contained", fullWidth: true, onClick: () => onProductSelect(product.id), sx: {
1740
- backgroundColor: primaryColor,
1741
- '&:hover': {
1742
- backgroundColor: primaryDark,
1743
- },
1744
- '&:active': {
1745
- backgroundColor: primaryDarker,
1746
- },
1747
- } }, { children: viewPlansButtonText }))] }, product.id))) }) })] }) })));
1748
- }
1749
-
1750
- const QuestionContainer$1 = styles.styled(material.Box)(({ theme }) => ({
1751
- backgroundColor: '#FFFFFF',
1752
- padding: '12px 16px',
1753
- display: 'flex',
1754
- flexDirection: 'column',
1755
- gap: '16px',
1756
- width: '100%',
1757
- }));
1758
- const QuestionHeader = styles.styled(material.Box)(({ theme }) => ({
1759
- display: 'flex',
1760
- flexDirection: 'column',
1761
- gap: '6px',
1762
- width: '100%',
1763
- }));
1764
- const QuestionTitle = styles.styled(material.Typography)(({ theme }) => ({
1765
- fontFamily: '"Montserrat", sans-serif',
1766
- fontWeight: 600,
1767
- fontSize: '14px',
1768
- lineHeight: '20px',
1769
- color: '#13131B',
1770
- }));
1771
- const QuestionSubtext = styles.styled(material.Typography)(({ theme }) => ({
1772
- fontFamily: '"Montserrat", sans-serif',
1773
- fontWeight: 400,
1774
- fontSize: '12px',
1775
- lineHeight: '16px',
1776
- color: '#5F5E62',
1777
- }));
1778
- const OptionsContainer$1 = styles.styled(material.Box)(({ theme }) => ({
1779
- display: 'flex',
1780
- flexDirection: 'column',
1781
- gap: '8px',
1782
- width: '100%',
1783
- }));
1784
-
1785
- /**
1786
- * QuestionSection - Displays a question with selectable options
1787
- *
1788
- * @example
1789
- * ```tsx
1790
- * <QuestionSection
1791
- * questionNumber="1"
1792
- * question="Which plan feels right for you?"
1793
- * helperText="Select one option"
1794
- * options={planOptions}
1795
- * selectedValue={selectedPlan}
1796
- * onSelect={setSelectedPlan}
1797
- * />
1798
- * ```
1799
- */
1800
- function QuestionSection({ questionNumber, question, helperText, options, selectedValue, onSelect, multiple = false, selectedValues = [], renderOption, formatMessage = (descriptor) => descriptor.id, }) {
1801
- const isSelected = (optionValue) => {
1802
- if (multiple) {
1803
- return selectedValues.includes(optionValue);
1804
- }
1805
- return selectedValue === optionValue;
1806
- };
1807
- return (jsxRuntime.jsxs(QuestionContainer$1, { children: [jsxRuntime.jsxs(QuestionHeader, { children: [jsxRuntime.jsxs(QuestionTitle, Object.assign({ variant: "subtitle1" }, { children: [questionNumber && `${questionNumber}. `, formatMessage({ id: question })] })), helperText && (jsxRuntime.jsx(QuestionSubtext, Object.assign({ variant: "caption" }, { children: formatMessage({ id: helperText }) })))] }), jsxRuntime.jsx(OptionsContainer$1, { children: options.map((option) => {
1808
- const selected = isSelected(option.value);
1809
- if (renderOption) {
1810
- return renderOption(option, selected);
1811
- }
1812
- // Default rendering handled by parent or OptionButton component
1813
- return null;
1814
- }) })] }));
1815
- }
1816
-
1817
- const StyledOptionButton = styles.styled(material.ButtonBase)(({ theme, selected, size = 'medium', fullWidth }) => {
1818
- const heights = {
1819
- small: '32px',
1820
- medium: '40px',
1821
- large: '48px',
1822
- };
1823
- return {
1824
- height: heights[size],
1825
- width: fullWidth ? '100%' : 'auto',
1826
- borderRadius: '8px',
1827
- border: selected
1828
- ? '2px solid #317ABC'
1829
- : '1px solid #C8C5CA',
1830
- backgroundColor: selected ? 'rgba(49, 122, 188, 0.1)' : '#FFFFFF',
1831
- padding: '10px 24px',
1832
- display: 'flex',
1833
- alignItems: 'center',
1834
- justifyContent: 'center',
1835
- cursor: 'pointer',
1836
- transition: 'all 0.2s ease',
1837
- '&:hover': {
1838
- backgroundColor: selected ? 'rgba(49, 122, 188, 0.15)' : 'rgba(0, 0, 0, 0.04)',
1839
- },
1840
- '&:disabled': {
1841
- backgroundColor: '#F5F5F5',
1842
- border: '1px solid #EEEEEE',
1843
- cursor: 'not-allowed',
1844
- opacity: 0.6,
1845
- },
1846
- };
1847
- });
1848
- const OptionContent = styles.styled(material.Box)(({ theme }) => ({
1849
- display: 'flex',
1850
- alignItems: 'center',
1851
- justifyContent: 'center',
1852
- gap: '8px',
1853
- width: '100%',
1854
- }));
1855
- const OptionIcon = styles.styled('span')(({ theme }) => ({
1856
- fontSize: '18px',
1857
- lineHeight: 1,
1858
- flexShrink: 0,
1859
- }));
1860
- const OptionLabel = styles.styled(material.Typography)(({ theme, selected, disabled }) => ({
1861
- fontFamily: '"Montserrat", sans-serif',
1862
- fontWeight: selected ? 600 : 500,
1863
- fontSize: '14px',
1864
- lineHeight: '20px',
1865
- color: disabled ? 'rgba(0, 0, 0, 0.4)' : '#13131B',
1866
- textAlign: 'center',
1867
- }));
1868
-
1869
- /**
1870
- * OptionButton - Selectable button for questionnaire options
1871
- *
1872
- * @example
1873
- * ```tsx
1874
- * <OptionButton
1875
- * value="option1"
1876
- * label="Option 1"
1877
- * icon="🎯"
1878
- * selected={selectedValue === 'option1'}
1879
- * onClick={(value) => setSelectedValue(value)}
1880
- * />
1881
- * ```
1882
- */
1883
- function OptionButton$1({ value, label, icon, selected = false, disabled = false, onClick, size = 'medium', fullWidth = true, formatMessage = (descriptor) => descriptor.id, }) {
1884
- const handleClick = () => {
1885
- if (!disabled && onClick) {
1886
- onClick(value);
1887
- }
1888
- };
1889
- return (jsxRuntime.jsx(StyledOptionButton, Object.assign({ selected: selected, disabled: disabled, onClick: handleClick, size: size, fullWidth: fullWidth }, { children: jsxRuntime.jsxs(OptionContent, { children: [icon && jsxRuntime.jsx(OptionIcon, { children: icon }), jsxRuntime.jsx(OptionLabel, Object.assign({ selected: selected, disabled: disabled, variant: "body2" }, { children: formatMessage({ id: label }) }))] }) })));
1890
- }
1891
-
1892
- const ToggleContainer$1 = styles.styled(material.Box)(({ theme }) => ({
1893
- backgroundColor: '#F9F9F9',
1894
- borderRadius: '40px',
1895
- display: 'flex',
1896
- gap: '6px',
1897
- height: '48px',
1898
- padding: '0',
1899
- width: '100%',
1900
- }));
1901
- const ToggleButton$1 = styles.styled(material.ButtonBase)(({ theme, selected }) => ({
1902
- flex: 1,
1903
- display: 'flex',
1904
- alignItems: 'center',
1905
- justifyContent: 'center',
1906
- gap: '4px',
1907
- padding: '8px',
1908
- borderRadius: selected ? '40px' : '104px',
1909
- backgroundColor: selected ? '#00E08B' : 'transparent',
1910
- transition: 'all 0.3s ease',
1911
- '&:hover': {
1912
- backgroundColor: selected ? '#00D080' : 'rgba(0, 0, 0, 0.04)',
1913
- },
1914
- }));
1915
- const ToggleIcon = styles.styled(material.Box)(({ theme }) => ({
1916
- backgroundColor: '#FFFFFF',
1917
- borderRadius: '50px',
1918
- width: '32px',
1919
- height: '32px',
1920
- display: 'flex',
1921
- alignItems: 'center',
1922
- justifyContent: 'center',
1923
- padding: '6px',
1924
- }));
1925
- const ToggleLabel = styles.styled(material.Typography)(({ theme, selected }) => ({
1926
- fontFamily: '"Montserrat", sans-serif',
1927
- fontWeight: 600,
1928
- fontSize: '14px',
1929
- lineHeight: '20px',
1930
- color: selected ? '#FEFBFF' : '#5F5E62',
1931
- whiteSpace: 'nowrap',
1932
- }));
1933
-
1934
- /**
1935
- * ToggleGroup - Segmented control for switching between options
1936
- *
1937
- * @example
1938
- * ```tsx
1939
- * <ToggleGroup
1940
- * options={[
1941
- * { value: 'domestic', label: 'Domestic', icon: '🏠' },
1942
- * { value: 'international', label: 'International', icon: '✈️' }
1943
- * ]}
1944
- * value={selectedType}
1945
- * onChange={setSelectedType}
1946
- * />
1947
- * ```
1948
- */
1949
- function ToggleGroup({ options, value, onChange, formatMessage = (descriptor) => descriptor.id, }) {
1950
- return (jsxRuntime.jsx(ToggleContainer$1, { children: options.map((option) => (jsxRuntime.jsxs(ToggleButton$1, Object.assign({ selected: value === option.value, onClick: () => onChange(option.value) }, { children: [option.icon && (jsxRuntime.jsx(ToggleIcon, { children: jsxRuntime.jsx("img", { src: option.icon, alt: option.label, width: 19.2, height: 19.2 }) })), jsxRuntime.jsx(ToggleLabel, Object.assign({ selected: value === option.value }, { children: formatMessage({ id: option.label }) }))] }), option.value))) }));
1951
- }
1952
-
1953
412
  /**
1954
413
  * Theme Utility Functions
1955
414
  * Helper functions for working with tenant themes
1956
415
  */
1957
416
  /**
1958
417
  * Get color value from theme palette path
1959
- * @param theme - Tenant theme configuration (can be undefined/null for SSR)
418
+ * @param theme - Tenant theme configuration
1960
419
  * @param path - Dot-notation path to color (e.g., 'primary.main')
1961
420
  * @param defaultColor - Fallback color if path not found
1962
421
  * @returns Color string
1963
422
  */
1964
423
  function getThemeColor(theme, path, defaultColor = '#000000') {
1965
- // Handle SSR case where theme might be undefined
1966
- if (!theme || !theme.palette) {
1967
- return defaultColor;
1968
- }
1969
424
  const keys = path.split('.');
1970
425
  let value = theme.palette;
1971
426
  for (const key of keys) {
@@ -1980,22 +435,15 @@ function getThemeColor(theme, path, defaultColor = '#000000') {
1980
435
  }
1981
436
  /**
1982
437
  * Merge tenant theme with base MUI theme
1983
- * This makes tenant theme accessible in styled components via theme parameter
1984
438
  * @param baseTheme - Base MUI theme
1985
439
  * @param tenantTheme - Tenant-specific theme configuration
1986
440
  * @returns Merged theme
1987
441
  */
1988
442
  function mergeTenantTheme(baseTheme, tenantTheme) {
1989
- // Merge tenant palette and typography into MUI theme
1990
- const mergedPalette = Object.assign(Object.assign(Object.assign({}, baseTheme.palette), tenantTheme.palette), {
1991
- // Make tenant colors accessible via theme.palette
1992
- tenant: tenantTheme.palette });
1993
- const mergedTypography = Object.assign(Object.assign(Object.assign({}, baseTheme.typography), tenantTheme.typography), {
1994
- // Make tenant typography accessible via theme.typography
1995
- tenant: tenantTheme.typography });
1996
- return Object.assign(Object.assign({}, baseTheme), { palette: mergedPalette, typography: mergedTypography,
1997
- // Also add tenant theme at root level for easy access
1998
- tenantTheme });
443
+ var _a, _b;
444
+ return Object.assign(Object.assign({}, baseTheme), { palette: Object.assign(Object.assign(Object.assign({}, baseTheme.palette), tenantTheme.palette), {
445
+ // Deep merge for nested objects
446
+ 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) });
1999
447
  }
2000
448
  /**
2001
449
  * Create CSS variables from tenant theme
@@ -2030,979 +478,21 @@ function createThemeCSSVariables(theme, prefix = '--tenant') {
2030
478
  return variables;
2031
479
  }
2032
480
 
2033
- const ToggleContainer = styles.styled(material.Box)(({ theme }) => {
2034
- var _a, _b;
2035
- return ({
2036
- display: 'flex',
2037
- gap: '6px',
2038
- height: '48px',
2039
- 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',
2040
- borderRadius: '40px',
2041
- width: '100%',
2042
- padding: '0',
2043
- position: 'relative',
2044
- });
2045
- });
2046
- const ToggleButton = styles.styled(material.Box)(({ theme, active }) => {
2047
- var _a, _b, _c, _d, _e, _f;
2048
- return ({
2049
- flex: 1,
2050
- display: 'flex',
2051
- gap: '4px',
2052
- alignItems: 'center',
2053
- justifyContent: 'center',
2054
- padding: '8px',
2055
- height: '100%',
2056
- borderRadius: '40px',
2057
- cursor: 'pointer',
2058
- backgroundColor: active
2059
- ? ((_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'
2060
- : 'transparent',
2061
- color: active
2062
- ? ((_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'
2063
- : ((_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',
2064
- transition: 'all 0.2s ease',
2065
- '&:hover': {
2066
- opacity: 0.9,
2067
- },
2068
- });
2069
- });
2070
- const ToggleText = styles.styled(material.Typography)(({ theme }) => {
2071
- var _a, _b, _c, _d, _e, _f;
2072
- return ({
2073
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2074
- "'Montserrat', sans-serif",
2075
- 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',
2076
- fontWeight: ((_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.fontWeightSemiBold) || 600,
2077
- 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',
2078
- whiteSpace: 'nowrap',
2079
- });
2080
- });
2081
-
2082
- /**
2083
- * BillingToggle - Toggle between monthly and annual billing
2084
- *
2085
- * @example
2086
- * ```tsx
2087
- * <BillingToggle
2088
- * value={billingType}
2089
- * onChange={setBillingType}
2090
- * />
2091
- * ```
2092
- */
2093
- function BillingToggle({ value, onChange, formatMessage = (descriptor) => descriptor.defaultMessage || descriptor.id, }) {
2094
- // Safely get theme, handle SSR case where it might be undefined
2095
- const tenantTheme = useTenantTheme();
2096
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2097
- // Get theme colors with SSR-safe fallbacks
2098
- const toggleActiveColor = getThemeColor(theme, 'ui.toggleActive', '#a4ce4e');
2099
- const toggleActiveTextColor = getThemeColor(theme, 'ui.toggleActiveText', '#fefbff');
2100
- const toggleInactiveTextColor = getThemeColor(theme, 'ui.toggleInactiveText', '#5f5e62');
2101
- const toggleBgColor = getThemeColor(theme, 'ui.sliderBackground', '#f9f9f9');
2102
- return (jsxRuntime.jsxs(ToggleContainer, Object.assign({ sx: {
2103
- backgroundColor: toggleBgColor,
2104
- } }, { children: [jsxRuntime.jsx(ToggleButton, Object.assign({ active: value === 'monthly', onClick: () => onChange('monthly'), sx: {
2105
- backgroundColor: value === 'monthly' ? toggleActiveColor : 'transparent',
2106
- color: value === 'monthly'
2107
- ? toggleActiveTextColor
2108
- : toggleInactiveTextColor,
2109
- } }, { children: jsxRuntime.jsx(ToggleText, { children: formatMessage({
2110
- id: 'Billed monthly',
2111
- defaultMessage: 'Billed monthly',
2112
- }) }) })), jsxRuntime.jsx(ToggleButton, Object.assign({ active: value === 'annually', onClick: () => onChange('annually'), sx: {
2113
- backgroundColor: value === 'annually' ? toggleActiveColor : 'transparent',
2114
- color: value === 'annually'
2115
- ? toggleActiveTextColor
2116
- : toggleInactiveTextColor,
2117
- } }, { children: jsxRuntime.jsx(ToggleText, { children: formatMessage({
2118
- id: 'Billed annually',
2119
- defaultMessage: 'Billed annually',
2120
- }) }) }))] })));
2121
- }
2122
-
2123
- const CalloutContainer = styles.styled(material.Box)(({ theme }) => {
2124
- var _a, _b, _c, _d;
2125
- return ({
2126
- display: 'flex',
2127
- flexDirection: 'column',
2128
- gap: '8px',
2129
- padding: '12px',
2130
- 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',
2131
- 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'}`,
2132
- borderRadius: '8px',
2133
- width: '100%',
2134
- });
2135
- });
2136
- const CalloutHeader = styles.styled(material.Box)(({ theme }) => ({
2137
- display: 'flex',
2138
- gap: '4px',
2139
- alignItems: 'center',
2140
- }));
2141
- const CalloutIcon = styles.styled(InfoIcon)(({ theme }) => {
2142
- var _a, _b;
2143
- return ({
2144
- width: '20px',
2145
- height: '20px',
2146
- 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',
2147
- });
2148
- });
2149
- const CalloutTitle = styles.styled(material.Typography)(({ theme }) => {
2150
- var _a, _b, _c, _d, _e, _f, _g, _h;
2151
- return ({
2152
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2153
- "'Montserrat', sans-serif",
2154
- 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',
2155
- fontWeight: ((_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.fontWeightSemiBold) || 600,
2156
- 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',
2157
- 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',
2158
- });
2159
- });
2160
- const CalloutText = styles.styled(material.Typography)(({ theme }) => {
2161
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2162
- return ({
2163
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2164
- "'Montserrat', sans-serif",
2165
- 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',
2166
- 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,
2167
- 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',
2168
- 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',
2169
- });
2170
- });
2171
-
2172
- /**
2173
- * InfoCallout - Displays helpful information or tips
2174
- *
2175
- * @example
2176
- * ```tsx
2177
- * <InfoCallout title="Helpful tip">
2178
- * Many Malaysians aim for life protection that's at least 10–12 times their annual income
2179
- * </InfoCallout>
2180
- * ```
2181
- */
2182
- function InfoCallout({ title = 'Helpful tip', children, formatMessage = (descriptor) => descriptor.defaultMessage || descriptor.id, }) {
2183
- // Safely get theme, handle SSR case where it might be undefined
2184
- const tenantTheme = useTenantTheme();
2185
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2186
- // Get theme colors with SSR-safe fallbacks
2187
- const calloutBgColor = getThemeColor(theme, 'ui.calloutBackground', '#f9f9f9');
2188
- const calloutBorderColor = getThemeColor(theme, 'ui.calloutBorder', '#ffffff');
2189
- const textColor = getThemeColor(theme, 'natural.dim', '#13131b');
2190
- const subtitleColor = getThemeColor(theme, 'natural.dark', '#5f5e62');
2191
- return (jsxRuntime.jsxs(CalloutContainer, Object.assign({ sx: {
2192
- backgroundColor: calloutBgColor,
2193
- border: `1px solid ${calloutBorderColor}`,
2194
- } }, { children: [jsxRuntime.jsxs(CalloutHeader, { children: [jsxRuntime.jsx(CalloutIcon, { sx: { color: textColor } }), jsxRuntime.jsx(CalloutTitle, Object.assign({ sx: { color: textColor } }, { children: formatMessage({
2195
- id: title,
2196
- defaultMessage: title,
2197
- }) }))] }), jsxRuntime.jsx(CalloutText, Object.assign({ sx: { color: subtitleColor } }, { children: children }))] })));
2198
- }
2199
-
2200
- const SliderContainer = styles.styled(material.Box)(({ theme }) => {
2201
- var _a, _b;
2202
- return ({
2203
- display: 'flex',
2204
- flexDirection: 'column',
2205
- gap: '16px',
2206
- padding: '12px',
2207
- 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',
2208
- borderRadius: '8px',
2209
- width: '100%',
2210
- });
2211
- });
2212
- const InputSection = styles.styled(material.Box)(({ theme }) => ({
2213
- display: 'flex',
2214
- flexDirection: 'column',
2215
- gap: '8px',
2216
- width: '100%',
2217
- }));
2218
- const InputLabel = styles.styled(material.Typography)(({ theme }) => {
2219
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2220
- return ({
2221
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2222
- "'Montserrat', sans-serif",
2223
- 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',
2224
- 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,
2225
- 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',
2226
- 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',
2227
- });
2228
- });
2229
- const InputContainer = styles.styled(material.Box)(({ theme }) => {
2230
- var _a, _b, _c, _d;
2231
- return ({
2232
- display: 'flex',
2233
- gap: '24px',
2234
- alignItems: 'center',
2235
- justifyContent: 'center',
2236
- padding: '8px 16px',
2237
- height: '44px',
2238
- 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',
2239
- 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'}`,
2240
- borderRadius: '8px',
2241
- width: '100%',
2242
- maxWidth: 'initial', // Match slider track width
2243
- });
2244
- });
2245
- const InputValue = styles.styled(material.Typography)(({ theme }) => {
2246
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2247
- return ({
2248
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2249
- "'Montserrat', sans-serif",
2250
- 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',
2251
- 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,
2252
- 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',
2253
- 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',
2254
- textAlign: 'center',
2255
- flex: 1,
2256
- });
2257
- });
2258
- styles.styled(material.Box)(({ theme }) => ({
2259
- display: 'flex',
2260
- alignItems: 'center',
2261
- position: 'relative',
2262
- width: '100%',
2263
- maxWidth: 'initial',
2264
- height: '4px',
2265
- }));
2266
- styles.styled(material.Box)(({ theme, active }) => {
2267
- var _a, _b, _c, _d;
2268
- return ({
2269
- height: '4px',
2270
- backgroundColor: active
2271
- ? ((_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'
2272
- : ((_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',
2273
- borderRadius: '8px',
2274
- width: '22px',
2275
- marginRight: '-1px',
2276
- });
2277
- });
2278
- styles.styled(material.Box)(({ theme, active }) => {
2279
- var _a, _b, _c, _d;
2280
- return ({
2281
- width: '10px',
2282
- height: '10px',
2283
- borderRadius: '8px',
2284
- backgroundColor: active
2285
- ? ((_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'
2286
- : ((_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',
2287
- boxShadow: active ? '0px 2px 20px 4px rgba(0, 0, 0, 0.14)' : 'none',
2288
- marginRight: '-1px',
2289
- cursor: 'pointer',
2290
- position: 'relative',
2291
- zIndex: 2,
2292
- '&:hover': {
2293
- transform: 'scale(1.2)',
2294
- transition: 'transform 0.2s ease',
2295
- },
2296
- });
2297
- });
2298
- styles.styled(material.Box)(({ theme }) => ({
2299
- position: 'absolute',
2300
- width: '18px',
2301
- height: '18px',
2302
- borderRadius: '34px',
2303
- backgroundColor: '#ffffff',
2304
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
2305
- display: 'flex',
2306
- alignItems: 'center',
2307
- justifyContent: 'center',
2308
- top: '-21px',
2309
- left: '0px',
2310
- cursor: 'grab',
2311
- zIndex: 10,
2312
- '&:active': {
2313
- cursor: 'grabbing',
2314
- },
2315
- }));
2316
- styles.styled(material.Box)(({ theme }) => {
2317
- var _a, _b;
2318
- return ({
2319
- width: '13px',
2320
- height: '10px',
2321
- display: 'flex',
2322
- alignItems: 'center',
2323
- justifyContent: 'center',
2324
- 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',
2325
- });
2326
- });
2327
- styles.styled(material.Box)(({ theme }) => ({
2328
- display: 'flex',
2329
- justifyContent: 'space-between',
2330
- width: '100%',
2331
- maxWidth: 'initial', // Match slider track width
2332
- }));
2333
- const RangeLabel = styles.styled(material.Typography)(({ theme }) => {
2334
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2335
- return ({
2336
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2337
- "'Montserrat', sans-serif",
2338
- 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',
2339
- 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,
2340
- 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',
2341
- 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',
2342
- });
2343
- });
2344
- const StyledMuiSlider = styles.styled(material.Slider)(({ theme, sliderActiveColor, sliderInactiveColor }) => {
2345
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2346
- return ({
2347
- width: '100%',
2348
- marginBottom: '0px !important',
2349
- padding: '7px 0px !important',
2350
- '& .MuiSlider-markLabel': {
2351
- display: 'none',
2352
- },
2353
- '& .MuiSlider-mark': {
2354
- width: 10,
2355
- height: 10,
2356
- borderRadius: '50%',
2357
- backgroundColor: sliderInactiveColor || ((_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.sliderInactive) || '#c8c5ca',
2358
- },
2359
- '& .MuiSlider-track': {
2360
- height: 4,
2361
- backgroundColor: sliderActiveColor || ((_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.sliderActive) || '#317abc',
2362
- },
2363
- '& .MuiSlider-rail': {
2364
- height: 4,
2365
- backgroundColor: sliderInactiveColor || ((_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.sliderInactive) || '#c8c5ca',
2366
- },
2367
- '& .MuiSlider-markActive': {
2368
- backgroundColor: sliderActiveColor || ((_h = (_g = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _g === void 0 ? void 0 : _g.ui) === null || _h === void 0 ? void 0 : _h.sliderActive) || '#317abc',
2369
- },
2370
- '& .MuiSlider-thumb': {
2371
- display: 'flex',
2372
- justifyContent: 'center',
2373
- alignItems: 'center',
2374
- height: 18,
2375
- width: 18,
2376
- backgroundColor: '#ffffff',
2377
- border: 'none',
2378
- cursor: 'pointer',
2379
- borderRadius: '50%',
2380
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
2381
- color: `${sliderActiveColor || ((_k = (_j = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _j === void 0 ? void 0 : _j.ui) === null || _k === void 0 ? void 0 : _k.sliderActive) || '#317abc'} !important`,
2382
- transform: 'translate(-50%, -50%) !important',
2383
- '&::before': {
2384
- content: '""',
2385
- width: '13px',
2386
- height: '10px',
2387
- backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='${encodeURIComponent(sliderActiveColor || '#317abc')}'%3E%3Cpath d='M4 18h16v-2H4v2zm0-5h16v-2H4v2zm0-7v2h16V6H4z'/%3E%3C/svg%3E")`,
2388
- backgroundRepeat: 'no-repeat',
2389
- backgroundPosition: 'center',
2390
- backgroundSize: 'contain',
2391
- },
2392
- '&:hover': {
2393
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.2)',
2394
- },
2395
- '&.Mui-focusVisible': {
2396
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.2)',
2397
- },
2398
- '&.Mui-active': {
2399
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.2)',
2400
- },
2401
- },
2402
- });
2403
- });
2404
- const SliderLabelsContainer = styles.styled(material.Box)(({ theme }) => ({
2405
- display: 'flex',
2406
- justifyContent: 'space-between',
2407
- width: '100%',
2408
- marginTop: '6px',
2409
- }));
2410
-
2411
- /**
2412
- * CoverageAmountSlider - Interactive slider for selecting coverage amounts
2413
- *
2414
- * @example
2415
- * ```tsx
2416
- * <CoverageAmountSlider
2417
- * min={100000}
2418
- * max={550000}
2419
- * value={coverageAmount}
2420
- * onChange={setCoverageAmount}
2421
- * />
2422
- * ```
2423
- */
2424
- function CoverageAmountSlider({ min, max, value, onChange, label = 'Choose your coverage amount', steps = 5, currency = 'RM', formatCurrency: customFormatCurrency, disabled = false, }) {
2425
- // Safely get theme, handle SSR case where it might be undefined
2426
- const tenantTheme = useTenantTheme();
2427
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2428
- const [localValue, setLocalValue] = React.useState(value);
2429
- const [sliderIndex, setSliderIndex] = React.useState(0);
2430
- // Get theme colors with SSR-safe fallbacks
2431
- const sliderActiveColor = getThemeColor(theme, 'ui.sliderActive', '#317abc');
2432
- const sliderInactiveColor = getThemeColor(theme, 'ui.sliderInactive', '#c8c5ca');
2433
- const sliderBgColor = getThemeColor(theme, 'ui.sliderBackground', '#f9f9f9');
2434
- const inputBgColor = getThemeColor(theme, 'ui.inputBackground', '#ffffff');
2435
- const inputBorderColor = getThemeColor(theme, 'ui.inputBorder', '#eeeeee');
2436
- const textColor = getThemeColor(theme, 'natural.dim', '#13131b');
2437
- const labelColor = getThemeColor(theme, 'natural.main', '#929094');
2438
- // Generate slider marks/options based on min, max, and steps
2439
- const { sliderMarks, stepSize, maxSliderValue, defaultSliderValue } = React.useMemo(() => {
2440
- const stepAmount = (max - min) / (steps - 1);
2441
- const marks = [];
2442
- for (let i = 0; i < steps; i++) {
2443
- const coverageValue = min + stepAmount * i;
2444
- marks.push({
2445
- value: i * 10,
2446
- label: `${(coverageValue / 1000).toFixed(0)}k`,
2447
- coverageVal: coverageValue,
2448
- });
2449
- }
2450
- // Find the default slider position based on the initial value
2451
- const defaultIdx = marks.findIndex((m) => m.coverageVal >= value) || 0;
2452
- return {
2453
- sliderMarks: marks,
2454
- stepSize: 10,
2455
- maxSliderValue: (steps - 1) * 10,
2456
- defaultSliderValue: defaultIdx * 10,
2457
- };
2458
- }, [min, max, steps, value]);
2459
- React.useEffect(() => {
2460
- setLocalValue(value);
2461
- // Update slider index when value changes externally
2462
- const idx = sliderMarks.findIndex((m) => m.coverageVal >= value);
2463
- setSliderIndex(idx >= 0 ? idx * 10 : 0);
2464
- }, [value, sliderMarks]);
2465
- const defaultFormatCurrency = (amount) => {
2466
- return `${currency} ${amount.toLocaleString('en-US', {
2467
- minimumFractionDigits: 0,
2468
- maximumFractionDigits: 0,
2469
- })}`;
2470
- };
2471
- const formatCurrency = customFormatCurrency || defaultFormatCurrency;
2472
- const handleDecrease = () => {
2473
- if (disabled)
2474
- return;
2475
- const currentIdx = sliderMarks.findIndex((m) => m.coverageVal === localValue);
2476
- if (currentIdx > 0) {
2477
- const newValue = sliderMarks[currentIdx - 1].coverageVal;
2478
- setLocalValue(newValue);
2479
- setSliderIndex((currentIdx - 1) * 10);
2480
- onChange(newValue);
2481
- }
2482
- };
2483
- const handleIncrease = () => {
2484
- if (disabled)
2485
- return;
2486
- const currentIdx = sliderMarks.findIndex((m) => m.coverageVal === localValue);
2487
- if (currentIdx < sliderMarks.length - 1) {
2488
- const newValue = sliderMarks[currentIdx + 1].coverageVal;
2489
- setLocalValue(newValue);
2490
- setSliderIndex((currentIdx + 1) * 10);
2491
- onChange(newValue);
2492
- }
2493
- };
2494
- const handleSliderChange = (_event, newValue) => {
2495
- if (disabled)
2496
- return;
2497
- const sliderVal = newValue;
2498
- const currentMark = sliderMarks.find((opt) => opt.value === sliderVal);
2499
- if (currentMark) {
2500
- setSliderIndex(sliderVal);
2501
- setLocalValue(currentMark.coverageVal);
2502
- onChange(currentMark.coverageVal);
2503
- }
2504
- };
2505
- return (jsxRuntime.jsxs(SliderContainer, Object.assign({ sx: {
2506
- backgroundColor: sliderBgColor,
2507
- } }, { children: [jsxRuntime.jsxs(InputSection, { children: [jsxRuntime.jsx(InputLabel, Object.assign({ sx: { color: textColor } }, { children: label })), jsxRuntime.jsxs(InputContainer, Object.assign({ sx: {
2508
- backgroundColor: inputBgColor,
2509
- border: `1px solid ${inputBorderColor}`,
2510
- opacity: disabled ? 0.5 : 1,
2511
- } }, { children: [jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: handleDecrease, disabled: disabled, sx: {
2512
- padding: 0,
2513
- width: '24px',
2514
- height: '24px',
2515
- color: textColor,
2516
- } }, { children: jsxRuntime.jsx(RemoveIcon, { sx: { fontSize: 24 } }) })), jsxRuntime.jsx(InputValue, Object.assign({ sx: { color: textColor } }, { children: formatCurrency(localValue) })), jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: handleIncrease, disabled: disabled, sx: {
2517
- padding: 0,
2518
- width: '24px',
2519
- height: '24px',
2520
- color: textColor,
2521
- } }, { children: jsxRuntime.jsx(AddIcon, { sx: { fontSize: 24 } }) }))] }))] }), jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', width: '100%' } }, { children: [jsxRuntime.jsx(StyledMuiSlider, { value: sliderIndex, defaultValue: defaultSliderValue, step: stepSize, min: 0, max: maxSliderValue, marks: sliderMarks, valueLabelDisplay: "off", onChange: handleSliderChange, disabled: disabled, sliderActiveColor: sliderActiveColor, sliderInactiveColor: sliderInactiveColor }), jsxRuntime.jsx(SliderLabelsContainer, { children: sliderMarks.map((mark, index) => (jsxRuntime.jsx(RangeLabel, Object.assign({ sx: {
2522
- color: sliderIndex === mark.value
2523
- ? sliderActiveColor
2524
- : labelColor,
2525
- textAlign: index === 0 ? 'left' : index === sliderMarks.length - 1 ? 'right' : 'center',
2526
- flex: index === 0 || index === sliderMarks.length - 1 ? 'none' : 1,
2527
- } }, { children: mark.label }), index))) })] }))] })));
2528
- }
2529
-
2530
- const ProgressBarContainer = styles.styled(material.Box)({
2531
- display: 'flex',
2532
- alignItems: 'center',
2533
- gap: '8px',
2534
- padding: '16px',
2535
- });
2536
- const ProgressBar = styles.styled(material.Box)({
2537
- display: 'flex',
2538
- alignItems: 'center',
2539
- flex: 1,
2540
- height: '4px',
2541
- backgroundColor: 'rgba(0, 0, 0, 0.1)',
2542
- borderRadius: '2px',
2543
- overflow: 'hidden',
2544
- });
2545
- const ProgressFill = styles.styled(material.Box)(({ width, progressBarTheme }) => ({
2546
- height: '100%',
2547
- width: `${width}%`,
2548
- background: progressBarTheme || 'linear-gradient(90deg, #0090DA 0.06%, #A4CE4E 99.94%)',
2549
- transition: 'width 0.3s ease',
2550
- }));
2551
- const ProgressText = styles.styled(material.Typography)({
2552
- fontFamily: 'Montserrat',
2553
- fontSize: '12px',
2554
- color: '#5F5E62',
2555
- fontWeight: 400,
2556
- lineHeight: '16px',
2557
- });
2558
-
2559
- const CheckoutProgress = ({ currentStep, totalSteps, onBack, showBackButton = true, progressBarTheme, sx, }) => {
2560
- const progressPercentage = ((currentStep + 1) / totalSteps) * 100;
2561
- return (jsxRuntime.jsxs(ProgressBarContainer, Object.assign({ sx: sx }, { children: [showBackButton && onBack && (jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: onBack, sx: { p: 0, width: '24px', height: '24px' }, "aria-label": "Go back" }, { children: jsxRuntime.jsx(ArrowBackIcon, { sx: { fontSize: '20px', color: '#13131B' } }) }))), jsxRuntime.jsx(ProgressBar, { children: jsxRuntime.jsx(ProgressFill, { width: progressPercentage, progressBarTheme: progressBarTheme }) }), jsxRuntime.jsxs(ProgressText, { children: [currentStep + 1, "/", totalSteps] })] })));
2562
- };
2563
-
2564
- const ProductCardContainer = styles.styled(material.Box)(({ theme, showIndicator }) => {
2565
- var _a, _b;
2566
- return (Object.assign({ backgroundColor: '#fff', boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.12)', borderRadius: '8px', padding: '12px 20px 12px 12px', display: 'flex', gap: '4px', alignItems: 'center', position: 'relative' }, (showIndicator && {
2567
- '&::before': {
2568
- content: '""',
2569
- position: 'absolute',
2570
- left: 0,
2571
- top: 0,
2572
- width: '8px',
2573
- height: '64px',
2574
- borderRadius: '0 0 8px 8px',
2575
- backgroundColor: ((_b = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) || '#13131B',
2576
- },
2577
- })));
2578
- });
2579
- const LogoContainer = styles.styled(material.Box)({
2580
- width: '45px',
2581
- height: '40px',
2582
- border: '1.25px solid rgba(0, 0, 0, 0.1)',
2583
- borderRadius: '10px',
2584
- display: 'flex',
2585
- alignItems: 'center',
2586
- justifyContent: 'center',
2587
- flexShrink: 0,
2588
- marginLeft: '8px',
2589
- });
2590
- const ProductInfo = styles.styled(material.Box)({
2591
- flex: 1,
2592
- marginLeft: '4px',
2593
- });
2594
- const ProductName = styles.styled(material.Typography)({
2595
- fontFamily: 'Montserrat',
2596
- fontSize: '14px',
2597
- fontWeight: 600,
2598
- color: '#13131B',
2599
- lineHeight: '20px',
2600
- });
2601
- const PlanName = styles.styled(material.Typography)({
2602
- fontFamily: 'Montserrat',
2603
- fontSize: '12px',
2604
- fontWeight: 400,
2605
- color: '#13131B',
2606
- lineHeight: '16px',
2607
- });
2608
- const PriceContainer = styles.styled(material.Box)({
2609
- display: 'flex',
2610
- alignItems: 'baseline',
2611
- gap: '2px',
2612
- });
2613
- const Price = styles.styled(material.Typography)({
2614
- fontFamily: 'Montserrat',
2615
- fontSize: '14px',
2616
- fontWeight: 600,
2617
- color: '#13131B',
2618
- lineHeight: '20px',
2619
- });
2620
- const PricePeriod = styles.styled(material.Typography)({
2621
- fontFamily: 'Montserrat',
2622
- fontSize: '12px',
2623
- fontWeight: 400,
2624
- color: '#13131B',
2625
- lineHeight: '16px',
2626
- });
2627
-
2628
- const ProductCard = ({ productName, planName, logoUrl, price, currency = 'RM', period = '/month', sx, showIndicator = true, }) => {
2629
- return (jsxRuntime.jsxs(ProductCardContainer, Object.assign({ sx: sx, showIndicator: showIndicator }, { children: [logoUrl && (jsxRuntime.jsx(LogoContainer, { children: jsxRuntime.jsx("img", { src: logoUrl, alt: productName, style: { maxWidth: '100%', maxHeight: '100%' } }) })), jsxRuntime.jsxs(ProductInfo, { children: [jsxRuntime.jsx(ProductName, { children: productName }), planName && jsxRuntime.jsx(PlanName, { children: planName })] }), jsxRuntime.jsxs(PriceContainer, { children: [jsxRuntime.jsxs(Price, { children: [currency, " ", price] }), jsxRuntime.jsx(PricePeriod, { children: period })] })] })));
2630
- };
2631
-
2632
- const HeaderContainer = styles.styled(material.Box)(({ sticky }) => (Object.assign(Object.assign({}, (sticky && {
2633
- position: 'sticky',
2634
- top: 0,
2635
- zIndex: 1000,
2636
- })), { backgroundColor: '#fff', width: '100%' })));
2637
- const SectionHeader = styles.styled(material.Box)({
2638
- padding: '0 16px 24px',
2639
- });
2640
- const SectionTitle = styles.styled(material.Typography)({
2641
- fontFamily: 'Montserrat',
2642
- fontSize: '20px',
2643
- fontWeight: 700,
2644
- color: '#13131B',
2645
- lineHeight: '28px',
2646
- marginBottom: '8px',
2647
- });
2648
- const SectionDescription = styles.styled(material.Typography)({
2649
- fontFamily: 'Montserrat',
2650
- fontSize: '14px',
2651
- fontWeight: 400,
2652
- color: '#5F5E62',
2653
- lineHeight: '18px',
2654
- });
2655
-
2656
- const CheckoutHeader = ({ progress, product, sectionTitle, sectionDescription, sticky = true, progressBarTheme, sx, }) => {
2657
- return (jsxRuntime.jsxs(HeaderContainer, Object.assign({ sticky: sticky, sx: sx }, { children: [jsxRuntime.jsx(CheckoutProgress, Object.assign({}, progress, { progressBarTheme: progressBarTheme })), product && (jsxRuntime.jsx(material.Box, Object.assign({ sx: { padding: '0 16px 24px' } }, { children: jsxRuntime.jsx(ProductCard, Object.assign({}, product)) }))), jsxRuntime.jsxs(SectionHeader, { children: [jsxRuntime.jsx(SectionTitle, { children: sectionTitle }), jsxRuntime.jsx(SectionDescription, { children: sectionDescription })] })] })));
2658
- };
2659
-
2660
- const ButtonContainer = styles.styled(material.Box)(({ isFixed }) => ({
2661
- position: isFixed ? 'fixed' : 'relative',
2662
- bottom: 0,
2663
- left: 0,
2664
- right: 0,
2665
- backgroundColor: '#fff',
2666
- padding: '16px',
2667
- boxShadow: isFixed ? '0px 2px 10px 0px rgba(0, 0, 0, 0.12)' : 'none',
2668
- zIndex: 999,
2669
- }));
2670
- const StyledButton = styles.styled('button')(({ theme, isDisabled }) => {
2671
- var _a, _b, _c, _d;
2672
- return ({
2673
- width: '100%',
2674
- height: '48px',
2675
- borderRadius: '8px',
2676
- border: 'none',
2677
- backgroundColor: isDisabled
2678
- ? '#E1E2EB'
2679
- : ((_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) || '#13131B',
2680
- color: isDisabled ? '#929094' : '#fff',
2681
- fontFamily: 'Montserrat',
2682
- fontSize: '14px',
2683
- fontWeight: 500,
2684
- lineHeight: '18px',
2685
- cursor: isDisabled ? 'not-allowed' : 'pointer',
2686
- transition: 'all 0.2s ease',
2687
- '&:hover': {
2688
- backgroundColor: isDisabled
2689
- ? '#E1E2EB'
2690
- : ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d.dark) || '#2a2a33',
2691
- },
2692
- });
2693
- });
2694
-
2695
- const CheckoutFormButton = ({ text = 'Next', disabled = false, onClick, fixed = true, type = 'button', sx, loading = false, }) => {
2696
- return (jsxRuntime.jsx(ButtonContainer, Object.assign({ isFixed: fixed, sx: sx }, { children: jsxRuntime.jsx(StyledButton, Object.assign({ type: type, disabled: disabled || loading, isDisabled: disabled || loading, onClick: onClick }, { children: loading ? 'Processing...' : text })) })));
2697
- };
2698
-
2699
- const QuestionContainer = styles.styled(material.Box)({
2700
- display: 'flex',
2701
- flexDirection: 'column',
2702
- gap: '8px',
2703
- marginBottom: '24px',
2704
- });
2705
- const QuestionText = styles.styled(material.Typography)({
2706
- fontFamily: 'Montserrat',
2707
- fontSize: '14px',
2708
- fontWeight: 400,
2709
- color: '#13131B',
2710
- lineHeight: '20px',
2711
- });
2712
- const OptionsContainer = styles.styled(material.Box)({
2713
- display: 'flex',
2714
- gap: '16px',
2715
- marginTop: '12px',
2716
- });
2717
- const OptionButton = styles.styled(material.Box)(({ selected }) => ({
2718
- flex: 1,
2719
- height: '48px',
2720
- border: `1px solid ${selected ? '#13131B' : '#929094'}`,
2721
- borderRadius: '8px',
2722
- display: 'flex',
2723
- alignItems: 'center',
2724
- justifyContent: 'center',
2725
- cursor: 'pointer',
2726
- backgroundColor: selected ? '#F5F5F7' : '#fff',
2727
- transition: 'all 0.2s ease',
2728
- '&:hover': {
2729
- borderColor: '#13131B',
2730
- },
2731
- }));
2732
- const OptionText = styles.styled(material.Typography)(({ selected }) => ({
2733
- fontFamily: 'Montserrat',
2734
- fontSize: '14px',
2735
- fontWeight: 600,
2736
- color: selected ? '#13131B' : '#5F5E62',
2737
- lineHeight: '20px',
2738
- }));
2739
-
2740
- const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, }) => {
2741
- return (jsxRuntime.jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxRuntime.jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxRuntime.jsxs(OptionsContainer, { children: [jsxRuntime.jsx(OptionButton, Object.assign({ selected: value === 'yes', onClick: () => onChange('yes'), role: "button", "aria-pressed": value === 'yes' }, { children: jsxRuntime.jsx(OptionText, Object.assign({ selected: value === 'yes' }, { children: labels.yes || 'Yes' })) })), jsxRuntime.jsx(OptionButton, Object.assign({ selected: value === 'no', onClick: () => onChange('no'), role: "button", "aria-pressed": value === 'no' }, { children: jsxRuntime.jsx(OptionText, Object.assign({ selected: value === 'no' }, { children: labels.no || 'No' })) }))] }), error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
2742
- color: 'error.main',
2743
- fontSize: '12px',
2744
- mt: 0.5,
2745
- ml: 2,
2746
- } }, { children: error })))] })));
2747
- };
2748
-
2749
- const FormContainer$3 = styles.styled(material.Box)({
2750
- padding: '0 16px 100px',
2751
- });
2752
- const CheckboxContainer$1 = styles.styled(material.Box)({
2753
- marginTop: '12px',
2754
- '& .MuiFormControlLabel-root': {
2755
- alignItems: 'flex-start',
2756
- marginLeft: 0,
2757
- },
2758
- '& .MuiCheckbox-root': {
2759
- padding: '4px 8px 4px 0',
2760
- },
2761
- });
2762
- const CheckboxLabel$1 = styles.styled(material.Typography)({
2763
- fontFamily: 'Montserrat',
2764
- fontSize: '14px',
2765
- fontWeight: 400,
2766
- color: '#5F5E62',
2767
- lineHeight: '18px',
2768
- });
2769
-
2770
- const PersonalInformationForm = ({ renderField, fields, consents, onSubmit, formRef, sx, }) => {
2771
- const defaultBankConfirmationLabel = 'I confirm this bank account is mine and consent to AmMetLife crediting payouts to it';
2772
- const defaultMarketingLabel = 'I/We consent to AmMetLife Insurance Berhad using my personal data for marketing and communication via digital platforms such as email, WhatsApp, and mobile';
2773
- return (jsxRuntime.jsx(FormContainer$3, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [jsxRuntime.jsxs(material.Box, { children: [renderField(fields.full_name), fields.full_name.helperText && (jsxRuntime.jsx(material.Typography, Object.assign({ variant: "caption", sx: {
2774
- display: 'block',
2775
- mt: 0.5,
2776
- ml: 2,
2777
- color: '#5F5E62',
2778
- fontSize: '12px',
2779
- fontFamily: 'Montserrat',
2780
- } }, { children: fields.full_name.helperText })))] }), renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.salutation), renderField(fields.nationality), renderField(fields.occupation), renderField(fields.industry), renderField(fields.crediting_bank_name), renderField(fields.crediting_bank_account_number), jsxRuntime.jsxs(CheckboxContainer$1, { children: [jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => consents.bank_account_confirmation.onChange(e.target.checked), name: "bank_account_confirmation" }), label: jsxRuntime.jsx(CheckboxLabel$1, { children: consents.bank_account_confirmation.label ||
2781
- defaultBankConfirmationLabel }) }), consents.bank_account_confirmation.error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
2782
- color: 'error.main',
2783
- fontSize: '12px',
2784
- mt: 0.5,
2785
- ml: 4,
2786
- } }, { children: consents.bank_account_confirmation.error })))] }), jsxRuntime.jsx(CheckboxContainer$1, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: consents.marketing_consent.checked, onChange: (e) => consents.marketing_consent.onChange(e.target.checked), name: "marketing_consent" }), label: jsxRuntime.jsx(CheckboxLabel$1, { children: consents.marketing_consent.label || defaultMarketingLabel }) }) })] })) })));
2787
- };
2788
-
2789
- const FormContainer$2 = styles.styled(material.Box)({
2790
- padding: '0 16px 100px',
2791
- });
2792
- const CheckboxContainer = styles.styled(material.Box)({
2793
- marginTop: '12px',
2794
- '& .MuiFormControlLabel-root': {
2795
- alignItems: 'flex-start',
2796
- marginLeft: 0,
2797
- },
2798
- '& .MuiCheckbox-root': {
2799
- padding: '4px 8px 4px 0',
2800
- },
2801
- });
2802
- const CheckboxLabel = styles.styled(material.Typography)({
2803
- fontFamily: 'Montserrat',
2804
- fontSize: '14px',
2805
- fontWeight: 400,
2806
- color: '#5F5E62',
2807
- lineHeight: '18px',
2808
- });
2809
-
2810
- const ContactDetailsForm = ({ renderField, fields, mailingAddressSame, onSubmit, formRef, sx, }) => {
2811
- const defaultMailingLabel = 'My mailing address is the same as residential';
2812
- return (jsxRuntime.jsx(FormContainer$2, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [jsxRuntime.jsxs(material.Box, { children: [renderField(fields.phone_number), fields.phone_number.helperText && (jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
2813
- display: 'block',
2814
- mt: 0.5,
2815
- ml: 2,
2816
- color: '#5F5E62',
2817
- fontSize: '12px',
2818
- fontFamily: 'Montserrat',
2819
- } }, { children: fields.phone_number.helperText })))] }), renderField(fields.email_address), renderField(fields.residential_address), renderField(fields.postal_code), renderField(fields.city), renderField(fields.state), mailingAddressSame && (jsxRuntime.jsx(CheckboxContainer, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: mailingAddressSame.checked, onChange: (e) => mailingAddressSame.onChange(e.target.checked), name: "mailing_same_as_residential" }), label: jsxRuntime.jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) }))] })) })));
2820
- };
2821
-
2822
- const FormContainer$1 = styles.styled(material.Box)({
2823
- padding: '0 16px 100px',
2824
- });
2825
-
2826
- const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, }) => {
2827
- return (jsxRuntime.jsx(FormContainer$1, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [renderField(measurementFields.weight), renderField(measurementFields.height), healthQuestions.map((question, index) => (jsxRuntime.jsx(HealthQuestionGroup, { question: question.question, questionNumber: question.questionNumber, value: question.value, onChange: question.onChange, error: question.error, labels: question.labels }, question.name || index)))] })) })));
2828
- };
2829
-
2830
- const FormContainer = styles.styled(material.Box)({
2831
- padding: '0 16px 100px',
2832
- });
2833
-
2834
- const ChildInformationForm = ({ renderField, fields, onSubmit, formRef, sx, }) => {
2835
- return (jsxRuntime.jsx(FormContainer, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [jsxRuntime.jsxs(material.Box, { children: [renderField(fields.full_name), fields.full_name.helperText && (jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
2836
- display: 'block',
2837
- mt: 0.5,
2838
- ml: 2,
2839
- color: '#5F5E62',
2840
- fontSize: '12px',
2841
- fontFamily: 'Montserrat',
2842
- } }, { children: fields.full_name.helperText })))] }), renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.nationality)] })) })));
2843
- };
2844
-
2845
- /**
2846
- * Asset Management Utilities
2847
- * Helper functions for managing tenant-specific assets
2848
- */
2849
- /**
2850
- * Hook to get tenant-specific asset URL
2851
- * @param assetPath - Relative path to asset within tenant folder
2852
- * @returns Full path to tenant-specific asset
2853
- *
2854
- * @example
2855
- * ```tsx
2856
- * const bannerImage = useTenantAsset('promotional-banner.jpg')
2857
- * <img src={bannerImage} alt="Promo" />
2858
- * ```
2859
- */
2860
- function useTenantAsset(assetPath) {
2861
- const tenantId = useTenantId();
2862
- // Return tenant-specific asset path that will be resolved at build time
2863
- return `/assets/tenants/${tenantId}/${assetPath}`;
2864
- }
2865
- /**
2866
- * Hook to get tenant logo URL
2867
- * @param variant - Logo variant ('default' | 'dark' | 'alt' | 'white')
2868
- * @returns Logo URL from theme configuration
2869
- *
2870
- * @example
2871
- * ```tsx
2872
- * const logo = useTenantLogo()
2873
- * const darkLogo = useTenantLogo('dark')
2874
- * <img src={logo} alt="Logo" />
2875
- * ```
2876
- */
2877
- function useTenantLogo(variant = 'default') {
2878
- const tenantTheme = useTenantTheme();
2879
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2880
- // Guard against undefined theme (SSR or initialization issues)
2881
- if (!theme || !theme.logo) {
2882
- console.warn('useTenantLogo: Theme or logo is undefined, returning empty string');
2883
- return '';
2884
- }
2885
- switch (variant) {
2886
- case 'dark':
2887
- return theme.logoDark || theme.logo;
2888
- case 'alt':
2889
- return theme.logoAlt || theme.logo;
2890
- case 'white':
2891
- return theme.logoWhite || theme.logo;
2892
- default:
2893
- return theme.logo;
2894
- }
2895
- }
2896
- /**
2897
- * Hook to get tenant favicon URL
2898
- * @returns Favicon URL from theme configuration
2899
- *
2900
- * @example
2901
- * ```tsx
2902
- * const favicon = useTenantFavicon()
2903
- * <link rel="icon" href={favicon} />
2904
- * ```
2905
- */
2906
- function useTenantFavicon() {
2907
- const tenantTheme = useTenantTheme();
2908
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2909
- // Guard against undefined theme
2910
- if (!theme || !theme.favicon) {
2911
- console.warn('useTenantFavicon: Theme or favicon is undefined');
2912
- return '';
2913
- }
2914
- return theme.favicon;
2915
- }
2916
- /**
2917
- * Get tenant asset path (non-hook version for use outside components)
2918
- * @param tenantId - Tenant identifier
2919
- * @param assetPath - Relative path to asset
2920
- * @returns Full asset path
2921
- */
2922
- function getTenantAssetPath(tenantId, assetPath) {
2923
- return `/assets/tenants/${tenantId}/${assetPath}`;
2924
- }
2925
- /**
2926
- * Get tenant logo path (non-hook version)
2927
- * @param tenantId - Tenant identifier
2928
- * @param variant - Logo variant
2929
- * @returns Logo path
2930
- */
2931
- function getTenantLogoPath(tenantId, variant = 'default') {
2932
- const variantSuffix = variant === 'default' ? '' : `-${variant}`;
2933
- return `/assets/tenants/${tenantId}/logo${variantSuffix}.svg`;
2934
- }
2935
-
2936
- /**
2937
- * Common UI Icons
2938
- * Path references to reusable icons
2939
- * Assets are copied to dist/assets folder during build
2940
- */
2941
- const ICON_PATHS = {
2942
- close: '/assets/icons/close.svg',
2943
- arrow: '/assets/icons/arrow.svg',
2944
- arrowDown: '/assets/icons/arrow-down.svg',
2945
- alert: '/assets/icons/alert.svg',
2946
- facebook: '/assets/icons/facebook.svg',
2947
- instagram: '/assets/icons/instagram.svg',
2948
- youtube: '/assets/icons/youtube.svg',
2949
- };
2950
- /**
2951
- * Get icon path by name
2952
- * @param iconName - Name of the icon
2953
- * @returns Path to icon asset
2954
- */
2955
- function getIconPath(iconName) {
2956
- return ICON_PATHS[iconName];
2957
- }
2958
-
2959
481
  exports.Banner = Banner;
2960
- exports.BillingToggle = BillingToggle;
2961
482
  exports.Button = Button;
2962
483
  exports.Card = Card;
2963
- exports.CheckoutFormButton = CheckoutFormButton;
2964
- exports.CheckoutHeader = CheckoutHeader;
2965
- exports.CheckoutProgress = CheckoutProgress;
2966
- exports.ChildInformationForm = ChildInformationForm;
2967
- exports.ContactDetailsForm = ContactDetailsForm;
2968
- exports.CoverageAmountSlider = CoverageAmountSlider;
2969
- exports.Footer = Footer;
2970
- exports.Header = Header$1;
2971
- exports.HealthInformationForm = HealthInformationForm;
2972
- exports.HealthQuestionGroup = HealthQuestionGroup;
2973
- exports.ICON_PATHS = ICON_PATHS;
2974
- exports.InfoCallout = InfoCallout;
2975
- exports.NewHeader = NewHeader;
2976
- exports.OptionButton = OptionButton$1;
2977
- exports.PersonalInformationForm = PersonalInformationForm;
2978
- exports.ProductCard = ProductCard;
2979
- exports.ProductSelectionDrawer = ProductSelectionDrawer;
2980
- exports.QuestionSection = QuestionSection;
2981
- exports.RecommendationsDrawer = RecommendationsDrawer;
2982
484
  exports.TenantThemeProvider = TenantThemeProvider;
2983
- exports.ToggleGroup = ToggleGroup;
2984
485
  exports.ammetlifeTheme = ammetlifeTheme;
2985
- exports.ammetlifeTypography = ammetlifeTypography;
2986
486
  exports.cimbTheme = cimbTheme;
2987
- exports.cimbTypography = cimbTypography;
2988
487
  exports.createThemeCSSVariables = createThemeCSSVariables;
2989
488
  exports.getAvailableTenants = getAvailableTenants;
2990
- exports.getIconPath = getIconPath;
2991
- exports.getTenantAssetPath = getTenantAssetPath;
2992
- exports.getTenantLogoPath = getTenantLogoPath;
2993
489
  exports.getTenantTheme = getTenantTheme;
2994
- exports.getTenantTypography = getTenantTypography;
2995
490
  exports.getThemeColor = getThemeColor;
2996
491
  exports.iglooTheme = iglooTheme;
2997
- exports.iglooTypography = iglooTypography;
2998
492
  exports.isValidTenantId = isValidTenantId;
2999
493
  exports.mergeTenantTheme = mergeTenantTheme;
3000
494
  exports.tenantThemes = tenantThemes;
3001
- exports.tenantTypography = tenantTypography;
3002
495
  exports.useIsTenant = useIsTenant;
3003
- exports.useTenantAsset = useTenantAsset;
3004
- exports.useTenantFavicon = useTenantFavicon;
3005
496
  exports.useTenantId = useTenantId;
3006
- exports.useTenantLogo = useTenantLogo;
3007
497
  exports.useTenantTheme = useTenantTheme;
3008
498
  //# sourceMappingURL=index.js.map