@cleartrip/ct-design-header 1.2.0-SNAPSHOT-header-test.0 → 1.2.0-SNAPSHOT-styled-header-test.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { __assign } from 'tslib';
1
+ import { __assign, __makeTemplateObject } from 'tslib';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { Container } from '@cleartrip/ct-design-container';
4
4
  import { Typography } from '@cleartrip/ct-design-typography';
@@ -7,366 +7,488 @@ import { Divider } from '@cleartrip/ct-design-divider';
7
7
  import { Offers, BusinessBag, ChevronDown, MyTrips, SupportIcon, ArrowRight, MyAccount, SavedCard, Travellers, HiFive, Wallet, SettingsCog, PrivacyRights, HeaderChevronRight, FkVip, FkPremium, InsiderIcon, InsiderElite, Supercoin, Signout, CTLogo, Fkcompany } from '@cleartrip/ct-design-icons';
8
8
  import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
9
9
  import { Shimmer } from '@cleartrip/ct-design-shimmer';
10
+ import styled from 'styled-components';
10
11
 
11
12
  var OFFERS_URL = 'all-offers/?categories=flights';
12
13
  var MY_TRIPS_URL = '/account/trips';
13
14
  var SUPPORT_URL = '/support';
14
- var NAVBAR_OPTIONS = [
15
- {
16
- lefticon: Offers,
17
- text: 'Offers',
18
- isHoverable: false,
19
- isClickable: true,
20
- link: OFFERS_URL,
21
- },
22
- {
23
- lefticon: BusinessBag,
24
- text: 'Business',
25
- rightIcon: ChevronDown,
26
- isHoverable: true,
27
- },
28
- {
29
- lefticon: MyTrips,
30
- text: 'My Trips',
31
- isHoverable: false,
32
- isClickable: true,
33
- link: MY_TRIPS_URL,
34
- },
35
- {
36
- lefticon: SupportIcon,
37
- text: 'Support',
38
- isHoverable: false,
39
- isClickable: true,
40
- link: SUPPORT_URL,
41
- },
42
- ];
15
+ var NAVBAR_OPTIONS = [{
16
+ lefticon: Offers,
17
+ text: 'Offers',
18
+ isHoverable: false,
19
+ isClickable: true,
20
+ link: OFFERS_URL
21
+ }, {
22
+ lefticon: BusinessBag,
23
+ text: 'Business',
24
+ rightIcon: ChevronDown,
25
+ isHoverable: true
26
+ }, {
27
+ lefticon: MyTrips,
28
+ text: 'My Trips',
29
+ isHoverable: false,
30
+ isClickable: true,
31
+ link: MY_TRIPS_URL
32
+ }, {
33
+ lefticon: SupportIcon,
34
+ text: 'Support',
35
+ isHoverable: false,
36
+ isClickable: true,
37
+ link: SUPPORT_URL
38
+ }];
43
39
  var LOBS = {
44
- FLIGHTS: 'Flights',
45
- HOTELS: 'Hotels',
46
- TRAIN: 'Trains',
47
- PACKAGES: 'Packages',
48
- BUSES: 'Buses',
40
+ FLIGHTS: 'Flights',
41
+ HOTELS: 'Hotels',
42
+ TRAIN: 'Trains',
43
+ PACKAGES: 'Packages',
44
+ BUSES: 'Buses'
49
45
  };
50
- var LOB_DATA = [
51
- {
52
- title: LOBS.FLIGHTS,
53
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/flight_uhp.png?cache=true',
54
- link: '/flights',
55
- },
56
- {
57
- title: LOBS.HOTELS,
58
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/hotel_uhp.png?cache=true',
59
- link: '/hotels',
60
- },
61
- {
62
- title: LOBS.BUSES,
63
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/bus_uhp.png?cache=true',
64
- link: '/bus',
65
- },
66
- {
67
- title: LOBS.TRAIN,
68
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/train_uhp.png?cache=true',
69
- link: '/',
70
- },
71
- {
72
- title: LOBS.PACKAGES,
73
- image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/holiday_uhp.png?cache=true',
74
- link: '/#',
75
- },
76
- ];
77
- var bdConfig = [
78
- {
79
- title: 'AgentBox',
80
- subtitle: 'For travel agents',
81
- details: 'One-stop travel solution offering the best deals to our travel agency partners',
82
- },
83
- {
84
- title: 'OutOfOffice',
85
- subtitle: 'For startups, corporates and SMEs',
86
- details: 'Manage corporate business travel, smartly',
87
- },
88
- {
89
- title: 'MICE',
90
- subtitle: 'For corporate events',
91
- details: 'An end-to-end management solution for all your corporate events',
92
- },
93
- {
94
- title: 'API',
95
- subtitle: 'For developers',
96
- details: 'Unlock seamless integration and scale with our powerful, reliable APIs',
97
- },
98
- ];
46
+ var LOB_DATA = [{
47
+ title: LOBS.FLIGHTS,
48
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/flight_uhp.png?cache=true',
49
+ link: '/flights'
50
+ }, {
51
+ title: LOBS.HOTELS,
52
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_48,h_48,dpr_2/offermgmt-prod/offermgmt/images/banner/hotel_uhp.png?cache=true',
53
+ link: '/hotels'
54
+ }, {
55
+ title: LOBS.BUSES,
56
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/bus_uhp.png?cache=true',
57
+ link: '/bus'
58
+ }, {
59
+ title: LOBS.TRAIN,
60
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/train_uhp.png?cache=true',
61
+ link: '/'
62
+ }, {
63
+ title: LOBS.PACKAGES,
64
+ image: 'https://rukmini-ct.flixcart.com/f_auto,w_40,h_40,dpr_2/offermgmt-prod/offermgmt/images/banner/holiday_uhp.png?cache=true',
65
+ link: '/#'
66
+ }];
67
+ var bdConfig = [{
68
+ title: 'AgentBox',
69
+ subtitle: 'For travel agents',
70
+ details: 'One-stop travel solution offering the best deals to our travel agency partners'
71
+ }, {
72
+ title: 'OutOfOffice',
73
+ subtitle: 'For startups, corporates and SMEs',
74
+ details: 'Manage corporate business travel, smartly'
75
+ }, {
76
+ title: 'MICE',
77
+ subtitle: 'For corporate events',
78
+ details: 'An end-to-end management solution for all your corporate events'
79
+ }, {
80
+ title: 'API',
81
+ subtitle: 'For developers',
82
+ details: 'Unlock seamless integration and scale with our powerful, reliable APIs'
83
+ }];
99
84
  var BUSINESS_DROPDOWN_HEADING = 'Other business services';
100
85
 
101
86
  var LobsHeader = function (_a) {
102
- var selectedLOB = _a.selectedLOB;
103
- return (jsx(Container, __assign({ className: 'flex p-4 flex-middle flex-center p-sticky', css: {
104
- gap: 40,
105
- height: 64,
106
- background: ' #F3F5FA',
107
- top: 64,
108
- zIndex: 2,
109
- } }, { children: LOB_DATA.map(function (item, index) {
110
- return (jsxs(Container, __assign({ className: 'flex flex-middle c-pointer', css: {
111
- gap: 8,
112
- background: selectedLOB === item.title ? '#FFFFFF' : 'transparent',
113
- borderRadius: selectedLOB === item.title ? '40px' : '0',
114
- padding: selectedLOB === item.title ? '8px 16px 8px 8px' : '0',
115
- }, onClick: function () {
116
- window.location.href = item.link;
117
- } }, { children: [jsx("img", { src: item.image, alt: item.title, width: 32, height: 32 }), jsx(Typography, __assign({ variant: 'P1', style: { fontWeight: selectedLOB === item.title ? 600 : 500 }, isClickable: true }, { children: item.title }))] }), index));
118
- }) })));
87
+ var selectedLOB = _a.selectedLOB;
88
+ return jsx(Container, __assign({
89
+ className: 'flex p-4 flex-middle flex-center p-sticky',
90
+ css: {
91
+ gap: 40,
92
+ height: 64,
93
+ background: ' #F3F5FA',
94
+ top: 64,
95
+ zIndex: 2
96
+ }
97
+ }, {
98
+ children: LOB_DATA.map(function (item, index) {
99
+ return jsxs(Container, __assign({
100
+ className: 'flex flex-middle c-pointer',
101
+ css: {
102
+ gap: 8,
103
+ background: selectedLOB === item.title ? '#FFFFFF' : 'transparent',
104
+ borderRadius: selectedLOB === item.title ? '40px' : '0',
105
+ padding: selectedLOB === item.title ? '8px 16px 8px 8px' : '0'
106
+ },
107
+ onClick: function () {
108
+ window.location.href = item.link;
109
+ }
110
+ }, {
111
+ children: [jsx("img", {
112
+ src: item.image,
113
+ alt: item.title,
114
+ width: 32,
115
+ height: 32
116
+ }), jsx(Typography, __assign({
117
+ variant: 'P1',
118
+ style: {
119
+ fontWeight: selectedLOB === item.title ? 600 : 500
120
+ },
121
+ isClickable: true
122
+ }, {
123
+ children: item.title
124
+ }))]
125
+ }), index);
126
+ })
127
+ }));
119
128
  };
120
129
 
121
130
  var useDelayedUnmount = function (show, unmountDelay) {
122
- var _a = useState(show), showComponent = _a[0], setShowComponent = _a[1];
123
- var timerRef = useRef();
124
- useEffect(function () {
125
- if (!show) {
126
- timerRef.current = setTimeout(function () {
127
- setShowComponent(false);
128
- }, unmountDelay);
129
- }
130
- else {
131
- setShowComponent(show);
132
- }
133
- return function () {
134
- (timerRef === null || timerRef === void 0 ? void 0 : timerRef.current) && clearTimeout(timerRef.current);
135
- };
136
- }, [show]);
137
- return showComponent;
131
+ var _a = useState(show),
132
+ showComponent = _a[0],
133
+ setShowComponent = _a[1];
134
+ var timerRef = useRef();
135
+ useEffect(function () {
136
+ if (!show) {
137
+ timerRef.current = setTimeout(function () {
138
+ setShowComponent(false);
139
+ }, unmountDelay);
140
+ } else {
141
+ setShowComponent(show);
142
+ }
143
+ return function () {
144
+ (timerRef === null || timerRef === void 0 ? void 0 : timerRef.current) && clearTimeout(timerRef.current);
145
+ };
146
+ }, [show]);
147
+ return showComponent;
138
148
  };
139
149
  var useMountTransition = function (isMounted, unmountDelay) {
140
- var _a = useState(false), hasTransitionedIn = _a[0], setHasTransitionedIn = _a[1];
141
- var timeoutIdRef = useRef();
142
- useEffect(function () {
143
- if (isMounted && !hasTransitionedIn) {
144
- setTimeout(function () {
145
- setHasTransitionedIn(true);
146
- }, 0);
147
- }
148
- else if (!isMounted && hasTransitionedIn) {
149
- timeoutIdRef.current = setTimeout(function () { return setHasTransitionedIn(false); }, unmountDelay);
150
- }
151
- return function () {
152
- if (timeoutIdRef && timeoutIdRef.current) {
153
- clearTimeout(timeoutIdRef.current);
154
- }
155
- };
156
- }, [unmountDelay, isMounted]);
157
- return hasTransitionedIn;
150
+ var _a = useState(false),
151
+ hasTransitionedIn = _a[0],
152
+ setHasTransitionedIn = _a[1];
153
+ var timeoutIdRef = useRef();
154
+ useEffect(function () {
155
+ if (isMounted && !hasTransitionedIn) {
156
+ setTimeout(function () {
157
+ setHasTransitionedIn(true);
158
+ }, 0);
159
+ } else if (!isMounted && hasTransitionedIn) {
160
+ timeoutIdRef.current = setTimeout(function () {
161
+ return setHasTransitionedIn(false);
162
+ }, unmountDelay);
163
+ }
164
+ return function () {
165
+ if (timeoutIdRef && timeoutIdRef.current) {
166
+ clearTimeout(timeoutIdRef.current);
167
+ }
168
+ };
169
+ }, [unmountDelay, isMounted]);
170
+ return hasTransitionedIn;
158
171
  };
159
172
 
160
173
  function HeaderAnimatedMask(_a) {
161
- var children = _a.children, onMaskClick = _a.onMaskClick, show = _a.show, marginTop = _a.marginTop, handleDropdownMouseEnter = _a.handleDropdownMouseEnter, handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
162
- useEffect(function () {
163
- if (show) {
164
- document.body.style.overflow = 'hidden';
165
- }
166
- return function () {
167
- document.body.style.overflow = 'initial';
168
- };
169
- }, [show]);
170
- var showFlagProxy = useDelayedUnmount(show, 300);
171
- var triggerTransition = useMountTransition(show, 100);
172
- var triggerOpenTransition = triggerTransition;
173
- console.log(show, showFlagProxy, 'custom hook');
174
- return (jsxs(Fragment, { children: [showFlagProxy && (jsx(Container, { id: 'mask-container', css: {
175
- position: 'fixed',
176
- backgroundColor: '#000',
177
- opacity: triggerOpenTransition ? 0.4 : 0,
178
- width: '100%',
179
- height: '100vh',
180
- left: 0,
181
- top: marginTop || 0,
182
- zIndex: 9,
183
- transition: 'opacity 300ms ease-in',
184
- }, onClick: onMaskClick })), showFlagProxy && (jsx(Container, __assign({ onMouseEnter: handleDropdownMouseEnter, onMouseLeave: handleDropdownMouseLeave }, { children: children })))] }));
174
+ var children = _a.children,
175
+ onMaskClick = _a.onMaskClick,
176
+ show = _a.show,
177
+ marginTop = _a.marginTop,
178
+ handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
179
+ handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
180
+ useEffect(function () {
181
+ if (show) {
182
+ document.body.style.overflow = 'hidden';
183
+ }
184
+ return function () {
185
+ document.body.style.overflow = 'initial';
186
+ };
187
+ }, [show]);
188
+ var showFlagProxy = useDelayedUnmount(show, 300);
189
+ var triggerTransition = useMountTransition(show, 100);
190
+ var triggerOpenTransition = triggerTransition;
191
+ console.log(show, showFlagProxy, 'custom hook');
192
+ return jsxs(Fragment, {
193
+ children: [showFlagProxy && jsx(Container, {
194
+ id: 'mask-container',
195
+ css: {
196
+ position: 'fixed',
197
+ backgroundColor: '#000',
198
+ opacity: triggerOpenTransition ? 0.4 : 0,
199
+ width: '100%',
200
+ height: '100vh',
201
+ left: 0,
202
+ top: marginTop || 0,
203
+ zIndex: 9,
204
+ transition: 'opacity 300ms ease-in'
205
+ },
206
+ onClick: onMaskClick
207
+ }), showFlagProxy && jsx(Container, __assign({
208
+ onMouseEnter: handleDropdownMouseEnter,
209
+ onMouseLeave: handleDropdownMouseLeave
210
+ }, {
211
+ children: children
212
+ }))]
213
+ });
185
214
  }
186
215
 
187
216
  var MIN_CLOSE_DELAY = 150;
188
217
  var useHoverDropdown = function (_a) {
189
- var _b = _a === void 0 ? {} : _a, _c = _b.closeDelay, closeDelayArg = _c === void 0 ? 300 : _c, _d = _b.openDelay, openDelay = _d === void 0 ? 500 : _d;
190
- var closeDelay = Math.max(closeDelayArg, MIN_CLOSE_DELAY);
191
- var _e = useState(false), isDropdownVisible = _e[0], setIsDropdownVisible = _e[1];
192
- var _f = useState(null), hoveredElemIndex = _f[0], setHoveredElemIndex = _f[1];
193
- var timeoutRef = useRef(null);
194
- var openTimeoutRef = useRef(null);
195
- var cancelElementHover = useRef(false);
196
- var handleOnMouseEnter = useCallback(function (index) {
197
- console.log('handleOnMouseEnter');
198
- if (timeoutRef.current)
199
- clearTimeout(timeoutRef.current);
200
- if (openTimeoutRef.current)
201
- clearTimeout(openTimeoutRef.current);
202
- cancelElementHover.current = false;
203
- openTimeoutRef.current = setTimeout(function () {
204
- setIsDropdownVisible(true);
205
- if (!cancelElementHover.current) {
206
- setHoveredElemIndex(index);
207
- }
208
- }, openDelay);
209
- }, [openDelay]);
210
- var handleOnMouseLeave = useCallback(function () {
211
- console.log('handleMouseLeave');
212
- cancelElementHover.current = true;
213
- timeoutRef.current = setTimeout(function () {
214
- setIsDropdownVisible(false);
215
- setHoveredElemIndex(null);
216
- }, closeDelay);
217
- }, [closeDelay]);
218
- var handleDropdownMouseEnter = useCallback(function () {
219
- console.log('handleDropdownMouseEnter');
220
- if (timeoutRef.current)
221
- clearTimeout(timeoutRef.current);
222
- }, []);
223
- var handleDropdownMouseLeave = useCallback(function () {
224
- console.log('handleDropdownMouseLeave');
225
- cancelElementHover.current = true;
226
- (timeoutRef === null || timeoutRef === void 0 ? void 0 : timeoutRef.current) && clearTimeout(timeoutRef.current);
227
- timeoutRef.current = setTimeout(function () {
228
- setIsDropdownVisible(false);
229
- setHoveredElemIndex(null);
230
- }, closeDelay);
231
- }, []);
232
- useEffect(function () {
233
- var handleMouseLeaveWindow = function (event) {
234
- if (event.clientY <= 0) {
235
- setIsDropdownVisible(false);
236
- setHoveredElemIndex(null);
237
- }
238
- };
239
- window.addEventListener('mouseleave', handleMouseLeaveWindow);
240
- return function () {
241
- window.removeEventListener('mouseleave', handleMouseLeaveWindow);
242
- };
243
- }, []);
244
- return {
245
- isDropdownVisible: isDropdownVisible,
246
- hoveredElemIndex: hoveredElemIndex,
247
- handleOnMouseEnter: handleOnMouseEnter,
248
- handleOnMouseLeave: handleOnMouseLeave,
249
- handleDropdownMouseEnter: handleDropdownMouseEnter,
250
- handleDropdownMouseLeave: handleDropdownMouseLeave,
218
+ var _b = _a === void 0 ? {} : _a,
219
+ _c = _b.closeDelay,
220
+ closeDelayArg = _c === void 0 ? 300 : _c,
221
+ _d = _b.openDelay,
222
+ openDelay = _d === void 0 ? 500 : _d;
223
+ var closeDelay = Math.max(closeDelayArg, MIN_CLOSE_DELAY);
224
+ var _e = useState(false),
225
+ isDropdownVisible = _e[0],
226
+ setIsDropdownVisible = _e[1];
227
+ var _f = useState(null),
228
+ hoveredElemIndex = _f[0],
229
+ setHoveredElemIndex = _f[1];
230
+ var timeoutRef = useRef(null);
231
+ var openTimeoutRef = useRef(null);
232
+ var cancelElementHover = useRef(false);
233
+ var handleOnMouseEnter = useCallback(function (index) {
234
+ console.log('handleOnMouseEnter');
235
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
236
+ if (openTimeoutRef.current) clearTimeout(openTimeoutRef.current);
237
+ cancelElementHover.current = false;
238
+ openTimeoutRef.current = setTimeout(function () {
239
+ setIsDropdownVisible(true);
240
+ if (!cancelElementHover.current) {
241
+ setHoveredElemIndex(index);
242
+ }
243
+ }, openDelay);
244
+ }, [openDelay]);
245
+ var handleOnMouseLeave = useCallback(function () {
246
+ console.log('handleMouseLeave');
247
+ cancelElementHover.current = true;
248
+ timeoutRef.current = setTimeout(function () {
249
+ setIsDropdownVisible(false);
250
+ setHoveredElemIndex(null);
251
+ }, closeDelay);
252
+ }, [closeDelay]);
253
+ var handleDropdownMouseEnter = useCallback(function () {
254
+ console.log('handleDropdownMouseEnter');
255
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
256
+ }, []);
257
+ var handleDropdownMouseLeave = useCallback(function () {
258
+ console.log('handleDropdownMouseLeave');
259
+ cancelElementHover.current = true;
260
+ (timeoutRef === null || timeoutRef === void 0 ? void 0 : timeoutRef.current) && clearTimeout(timeoutRef.current);
261
+ timeoutRef.current = setTimeout(function () {
262
+ setIsDropdownVisible(false);
263
+ setHoveredElemIndex(null);
264
+ }, closeDelay);
265
+ }, []);
266
+ useEffect(function () {
267
+ var handleMouseLeaveWindow = function (event) {
268
+ if (event.clientY <= 0) {
269
+ setIsDropdownVisible(false);
270
+ setHoveredElemIndex(null);
271
+ }
251
272
  };
273
+ window.addEventListener('mouseleave', handleMouseLeaveWindow);
274
+ return function () {
275
+ window.removeEventListener('mouseleave', handleMouseLeaveWindow);
276
+ };
277
+ }, []);
278
+ return {
279
+ isDropdownVisible: isDropdownVisible,
280
+ hoveredElemIndex: hoveredElemIndex,
281
+ handleOnMouseEnter: handleOnMouseEnter,
282
+ handleOnMouseLeave: handleOnMouseLeave,
283
+ handleDropdownMouseEnter: handleDropdownMouseEnter,
284
+ handleDropdownMouseLeave: handleDropdownMouseLeave
285
+ };
252
286
  };
253
287
 
254
288
  var useDropdownAnimation = function (isOpen) {
255
- var containerRef = useRef(null);
256
- var openDropdown = function () {
289
+ var containerRef = useRef(null);
290
+ var openDropdown = function () {
291
+ if (containerRef.current) {
292
+ var fullHeight_1 = containerRef.current.scrollHeight;
293
+ containerRef.current.style.maxHeight = "".concat(fullHeight_1 / 2, "px");
294
+ containerRef.current.style.opacity = '0';
295
+ requestAnimationFrame(function () {
257
296
  if (containerRef.current) {
258
- var fullHeight_1 = containerRef.current.scrollHeight;
259
- containerRef.current.style.maxHeight = "".concat(fullHeight_1 / 2, "px");
260
- containerRef.current.style.opacity = '0';
261
- requestAnimationFrame(function () {
262
- if (containerRef.current) {
263
- containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
264
- containerRef.current.style.maxHeight = "".concat(fullHeight_1, "px");
265
- containerRef.current.style.opacity = '1';
266
- }
267
- });
297
+ containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
298
+ containerRef.current.style.maxHeight = "".concat(fullHeight_1, "px");
299
+ containerRef.current.style.opacity = '1';
268
300
  }
269
- };
270
- var closeDropdown = function () {
301
+ });
302
+ }
303
+ };
304
+ var closeDropdown = function () {
305
+ if (containerRef.current) {
306
+ var fullHeight = containerRef.current.scrollHeight;
307
+ containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
308
+ containerRef.current.style.maxHeight = "".concat(fullHeight / 2, "px");
309
+ containerRef.current.style.opacity = '0';
310
+ setTimeout(function () {
271
311
  if (containerRef.current) {
272
- var fullHeight = containerRef.current.scrollHeight;
273
- containerRef.current.style.transition = 'max-height 0.3s ease-in-out, opacity 0.3s ease-in-out';
274
- containerRef.current.style.maxHeight = "".concat(fullHeight / 2, "px");
275
- containerRef.current.style.opacity = '0';
276
- setTimeout(function () {
277
- if (containerRef.current) {
278
- containerRef.current.style.maxHeight = '0px';
279
- }
280
- }, 300);
281
- }
282
- };
283
- useEffect(function () {
284
- if (isOpen) {
285
- openDropdown();
286
- }
287
- else {
288
- closeDropdown();
312
+ containerRef.current.style.maxHeight = '0px';
289
313
  }
290
- }, [isOpen]);
291
- return { containerRef: containerRef };
314
+ }, 300);
315
+ }
316
+ };
317
+ useEffect(function () {
318
+ if (isOpen) {
319
+ openDropdown();
320
+ } else {
321
+ closeDropdown();
322
+ }
323
+ }, [isOpen]);
324
+ return {
325
+ containerRef: containerRef
326
+ };
292
327
  };
293
328
 
294
329
  var BusinessDropdownContent = function (_a) {
295
- var isOpen = _a.isOpen;
296
- var _b = useState(0), leftPosition = _b[0], setLeftPosition = _b[1];
297
- var containerRef = useDropdownAnimation(isOpen).containerRef;
298
- useEffect(function () {
299
- var updatePosition = function () {
300
- if (containerRef.current) {
301
- var screenWidth = window.innerWidth;
302
- var containerWidth = containerRef.current.offsetWidth || 0;
303
- setLeftPosition((screenWidth - containerWidth) / 2);
330
+ var isOpen = _a.isOpen;
331
+ var _b = useState(0),
332
+ leftPosition = _b[0],
333
+ setLeftPosition = _b[1];
334
+ var containerRef = useDropdownAnimation(isOpen).containerRef;
335
+ useEffect(function () {
336
+ var updatePosition = function () {
337
+ if (containerRef.current) {
338
+ var screenWidth = window.innerWidth;
339
+ var containerWidth = containerRef.current.offsetWidth || 0;
340
+ setLeftPosition((screenWidth - containerWidth) / 2);
341
+ }
342
+ };
343
+ updatePosition();
344
+ window.addEventListener('resize', updatePosition);
345
+ return function () {
346
+ return window.removeEventListener('resize', updatePosition);
347
+ };
348
+ }, []);
349
+ return jsxs(Container, __assign({
350
+ ref: containerRef,
351
+ className: 'bg-neutral-100 o-hidden',
352
+ css: {
353
+ top: '76px',
354
+ position: 'fixed',
355
+ left: "".concat(leftPosition, "px"),
356
+ borderRadius: 24,
357
+ boxShadow: '0px 8px 24px 0px rgba(26, 26, 26, 0.10)',
358
+ width: 'fit-content',
359
+ zIndex: 1002,
360
+ opacity: 0
361
+ }
362
+ }, {
363
+ children: [jsx(Container, __assign({
364
+ className: 'px-6 py-5',
365
+ backgroundColor: '#FFF1EC'
366
+ }, {
367
+ children: jsx(Typography, __assign({
368
+ variant: 'HM2',
369
+ style: {
370
+ lineHeight: '24px'
371
+ }
372
+ }, {
373
+ children: BUSINESS_DROPDOWN_HEADING
374
+ }))
375
+ })), jsx(Container, __assign({
376
+ className: 'flex flex-row p-6',
377
+ css: {
378
+ columnGap: '48px',
379
+ width: 'fit-content'
380
+ }
381
+ }, {
382
+ children: bdConfig.map(function (_a) {
383
+ var title = _a.title,
384
+ subtitle = _a.subtitle,
385
+ details = _a.details;
386
+ return jsxs(Container, __assign({
387
+ css: {
388
+ width: '200px'
389
+ },
390
+ className: 'bd-hover-container c-pointer'
391
+ }, {
392
+ children: [jsxs(Container, __assign({
393
+ className: 'flex flex-row flex-middle',
394
+ style: {
395
+ columnGap: '8px'
396
+ }
397
+ }, {
398
+ children: [jsx(Typography, __assign({
399
+ variant: 'HM2',
400
+ className: 'color-orange-on-hover'
401
+ }, {
402
+ children: title
403
+ })), jsx(AnimatedArrow, {})]
404
+ })), jsx(Typography, __assign({
405
+ variant: 'B3',
406
+ className: 'mt-1',
407
+ css: {
408
+ opacity: 0.75
304
409
  }
305
- };
306
- updatePosition();
307
- window.addEventListener('resize', updatePosition);
308
- return function () { return window.removeEventListener('resize', updatePosition); };
309
- }, []);
310
- return (jsxs(Container, __assign({ ref: containerRef, className: 'bg-neutral-100 o-hidden', css: {
311
- top: '76px',
312
- position: 'fixed',
313
- left: "".concat(leftPosition, "px"),
314
- borderRadius: 24,
315
- boxShadow: '0px 8px 24px 0px rgba(26, 26, 26, 0.10)',
316
- width: 'fit-content',
317
- zIndex: 1002,
318
- opacity: 0,
319
- } }, { children: [jsx(Container, __assign({ className: 'px-6 py-5', backgroundColor: '#FFF1EC' }, { children: jsx(Typography, __assign({ variant: 'HM2', style: { lineHeight: '24px' } }, { children: BUSINESS_DROPDOWN_HEADING })) })), jsx(Container, __assign({ className: 'flex flex-row p-6', css: { columnGap: '48px', width: 'fit-content' } }, { children: bdConfig.map(function (_a) {
320
- var title = _a.title, subtitle = _a.subtitle, details = _a.details;
321
- return (jsxs(Container, __assign({ css: { width: '200px' }, className: 'bd-hover-container' }, { children: [jsxs(Container, __assign({ className: 'flex flex-row flex-middle', style: { columnGap: '8px' } }, { children: [jsx(Typography, __assign({ variant: 'HM2', className: 'color-orange-on-hover' }, { children: title })), jsx(AnimatedArrow, {})] })), jsx(Typography, __assign({ variant: 'B3', className: 'mt-1', css: { opacity: 0.75 } }, { children: subtitle })), jsx(Typography, __assign({ variant: 'P3', color: 'subheading', className: 'mt-3' }, { children: details }))] }), title));
322
- }) }))] })));
410
+ }, {
411
+ children: subtitle
412
+ })), jsx(Typography, __assign({
413
+ variant: 'P3',
414
+ color: 'subheading',
415
+ className: 'mt-3'
416
+ }, {
417
+ children: details
418
+ }))]
419
+ }), title);
420
+ })
421
+ }))]
422
+ }));
323
423
  };
324
424
  var AnimatedArrow = function () {
325
- return (jsxs("div", __assign({ className: 'bd-arrow-container' }, { children: [jsx("div", __assign({ className: 'bd-arrow-wrapper' }, { children: jsx(ArrowRight, {}) })), jsx("div", __assign({ className: 'bd-arrow-wrapper' }, { children: jsx(ArrowRight, {}) })), jsx("div", __assign({ className: 'bd-arrow-wrapper' }, { children: jsx(ArrowRight, {}) }))] })));
425
+ return jsxs("div", __assign({
426
+ className: 'bd-arrow-container'
427
+ }, {
428
+ children: [jsx("div", __assign({
429
+ className: 'bd-arrow-wrapper'
430
+ }, {
431
+ children: jsx(ArrowRight, {})
432
+ })), jsx("div", __assign({
433
+ className: 'bd-arrow-wrapper'
434
+ }, {
435
+ children: jsx(ArrowRight, {})
436
+ })), jsx("div", __assign({
437
+ className: 'bd-arrow-wrapper'
438
+ }, {
439
+ children: jsx(ArrowRight, {})
440
+ }))]
441
+ }));
326
442
  };
327
443
 
328
- var ACCOUNT_OPTIONS_POPUP_CONFIG = [
329
- {
330
- text: 'My Profile',
331
- icon: jsx(MyAccount, { width: 24, height: 24 }),
332
- redirectionLink: '/accounts/profile',
333
- },
334
- {
335
- text: 'My Trips',
336
- icon: jsx(MyTrips, { width: 24, height: 24 }),
337
- redirectionLink: '/accounts/trips',
338
- },
339
- {
340
- text: 'Saved Cards',
341
- icon: jsx(SavedCard, {}),
342
- redirectionLink: '/accounts/expressway',
343
- },
344
- {
345
- text: 'Saved Travellers',
346
- icon: jsx(Travellers, { width: 24, height: 24 }),
347
- redirectionLink: '/account/travellers',
348
- },
349
- {
350
- text: 'Hi-Five',
351
- icon: jsx(HiFive, {}),
352
- redirectionLink: '/accounts/hi-five?src=fh',
353
- },
354
- {
355
- text: 'Wallet',
356
- icon: jsx(Wallet, { width: 24, height: 24 }),
357
- redirectionLink: '/accounts/wallet',
358
- },
359
- {
360
- text: 'Settings',
361
- icon: jsx(SettingsCog, { width: 24, height: 24 }),
362
- redirectionLink: '/account/settings',
363
- },
364
- {
365
- text: 'Privacy Rights',
366
- icon: jsx(PrivacyRights, {}),
367
- redirectionLink: 'accounts/personal-data-dashboard',
368
- },
369
- ];
444
+ var ACCOUNT_OPTIONS_POPUP_CONFIG = [{
445
+ text: 'My Profile',
446
+ icon: jsx(MyAccount, {
447
+ width: 24,
448
+ height: 24
449
+ }),
450
+ redirectionLink: '/accounts/profile'
451
+ }, {
452
+ text: 'My Trips',
453
+ icon: jsx(MyTrips, {
454
+ width: 24,
455
+ height: 24
456
+ }),
457
+ redirectionLink: '/accounts/trips'
458
+ }, {
459
+ text: 'Saved Cards',
460
+ icon: jsx(SavedCard, {}),
461
+ redirectionLink: '/accounts/expressway'
462
+ }, {
463
+ text: 'Saved Travellers',
464
+ icon: jsx(Travellers, {
465
+ width: 24,
466
+ height: 24
467
+ }),
468
+ redirectionLink: '/account/travellers'
469
+ }, {
470
+ text: 'Hi-Five',
471
+ icon: jsx(HiFive, {}),
472
+ redirectionLink: '/accounts/hi-five?src=fh'
473
+ }, {
474
+ text: 'Wallet',
475
+ icon: jsx(Wallet, {
476
+ width: 24,
477
+ height: 24
478
+ }),
479
+ redirectionLink: '/accounts/wallet'
480
+ }, {
481
+ text: 'Settings',
482
+ icon: jsx(SettingsCog, {
483
+ width: 24,
484
+ height: 24
485
+ }),
486
+ redirectionLink: '/account/settings'
487
+ }, {
488
+ text: 'Privacy Rights',
489
+ icon: jsx(PrivacyRights, {}),
490
+ redirectionLink: 'accounts/personal-data-dashboard'
491
+ }];
370
492
  var SIGN_OUT_TEXT = 'Logout';
371
493
  var LOGGEDIN_USER_TEXT = 'You are logged in with';
372
494
  var HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID = 'header-acc-btn';
@@ -374,173 +496,600 @@ var ACCOUNT_OPTIONS_CONTAINER_ID = 'account-options';
374
496
  var ACCOUNT_OPTIONS_CONTAINER_WIDTH = 328;
375
497
 
376
498
  var LoyaltyChip = function (_a) {
377
- var icon = _a.icon, borderGradient = _a.borderGradient, backgroundGradient = _a.backgroundGradient, handleChipClick = _a.handleChipClick;
378
- var _b = useState(false), isHovered = _b[0], setIsHovered = _b[1];
379
- return (jsxs(Container, __assign({ className: 'flex p-relative flex-middle flex-center br-8 o-hidden c-pointer', style: {
380
- height: 32,
381
- paddingLeft: 8,
382
- transition: 'padding-right 0.2s ease-in-out',
383
- paddingRight: isHovered ? 4 : 8,
384
- }, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onClick: handleChipClick }, { children: [jsx(Container, { style: {
385
- content: '""',
386
- position: 'absolute',
387
- inset: 0,
388
- borderRadius: 'inherit',
389
- background: backgroundGradient,
390
- zIndex: -2,
391
- } }), jsx(Container, { style: {
392
- content: '""',
393
- position: 'absolute',
394
- inset: 0,
395
- borderRadius: 'inherit',
396
- padding: '1px',
397
- background: borderGradient,
398
- WebkitMask: 'linear-gradient(white, white) content-box, linear-gradient(white, white)',
399
- WebkitMaskComposite: 'destination-out',
400
- maskComposite: 'exclude',
401
- zIndex: -1,
402
- } }), jsx(Container, __assign({ className: 'flex flex-middle p-relative' }, { children: icon })), jsx(Container, __assign({ className: 'flex flex-middle o-hidden', style: {
403
- maxWidth: isHovered ? 16 : 0,
404
- transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
405
- opacity: isHovered ? 0.5 : 0,
406
- } }, { children: jsx(HeaderChevronRight, { color: 'white' }) }))] })));
499
+ var icon = _a.icon,
500
+ borderGradient = _a.borderGradient,
501
+ backgroundGradient = _a.backgroundGradient,
502
+ handleChipClick = _a.handleChipClick;
503
+ var _b = useState(false),
504
+ isHovered = _b[0],
505
+ setIsHovered = _b[1];
506
+ return jsxs(Container, __assign({
507
+ className: 'flex p-relative flex-middle flex-center br-8 o-hidden c-pointer',
508
+ style: {
509
+ height: 32,
510
+ paddingLeft: 8,
511
+ transition: 'padding-right 0.2s ease-in-out',
512
+ paddingRight: isHovered ? 4 : 8
513
+ },
514
+ onMouseEnter: function () {
515
+ return setIsHovered(true);
516
+ },
517
+ onMouseLeave: function () {
518
+ return setIsHovered(false);
519
+ },
520
+ onClick: handleChipClick
521
+ }, {
522
+ children: [jsx(Container, {
523
+ style: {
524
+ content: '""',
525
+ position: 'absolute',
526
+ inset: 0,
527
+ borderRadius: 'inherit',
528
+ background: backgroundGradient,
529
+ zIndex: -2
530
+ }
531
+ }), jsx(Container, {
532
+ style: {
533
+ content: '""',
534
+ position: 'absolute',
535
+ inset: 0,
536
+ borderRadius: 'inherit',
537
+ padding: '1px',
538
+ background: borderGradient,
539
+ WebkitMask: 'linear-gradient(white, white) content-box, linear-gradient(white, white)',
540
+ WebkitMaskComposite: 'destination-out',
541
+ maskComposite: 'exclude',
542
+ zIndex: -1
543
+ }
544
+ }), jsx(Container, __assign({
545
+ className: 'flex flex-middle p-relative'
546
+ }, {
547
+ children: icon
548
+ })), jsx(Container, __assign({
549
+ className: 'flex flex-middle o-hidden',
550
+ style: {
551
+ maxWidth: isHovered ? 16 : 0,
552
+ transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
553
+ opacity: isHovered ? 0.5 : 0
554
+ }
555
+ }, {
556
+ children: jsx(HeaderChevronRight, {
557
+ color: 'white'
558
+ })
559
+ }))]
560
+ }));
407
561
  };
408
562
 
409
563
  var _a;
410
564
  var LoyaltyType;
411
565
  (function (LoyaltyType) {
412
- LoyaltyType["FkVip"] = "FkVip";
413
- LoyaltyType["FkPremium"] = "FkPremium";
414
- LoyaltyType["InsiderIcon"] = "InsiderIcon";
415
- LoyaltyType["InsiderElite"] = "InsiderElite";
566
+ LoyaltyType["FkVip"] = "FkVip";
567
+ LoyaltyType["FkPremium"] = "FkPremium";
568
+ LoyaltyType["InsiderIcon"] = "InsiderIcon";
569
+ LoyaltyType["InsiderElite"] = "InsiderElite";
416
570
  })(LoyaltyType || (LoyaltyType = {}));
417
- var LOYALTY_DATA = (_a = {},
418
- _a[LoyaltyType.FkVip] = {
419
- icon: jsx(FkVip, {}),
420
- borderGradient: 'linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)',
421
- backgroundGradient: 'linear-gradient(111deg, #360042 0%, #540061 100%)',
422
- },
423
- _a[LoyaltyType.FkPremium] = {
424
- icon: jsx(FkPremium, {}),
425
- borderGradient: 'linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)',
426
- backgroundGradient: 'linear-gradient(180deg, #04176A 0%, #082395 100%)',
571
+ var LOYALTY_DATA = (_a = {}, _a[LoyaltyType.FkVip] = {
572
+ icon: jsx(FkVip, {}),
573
+ borderGradient: 'linear-gradient(222.13deg, rgba(243, 179, 39, 0) 2.08%, #F3B327 85.17%)',
574
+ backgroundGradient: 'linear-gradient(111deg, #360042 0%, #540061 100%)'
575
+ }, _a[LoyaltyType.FkPremium] = {
576
+ icon: jsx(FkPremium, {}),
577
+ borderGradient: 'linear-gradient(230.68deg, rgba(243, 179, 39, 0) 10.1%, #F3B327 45.74%)',
578
+ backgroundGradient: 'linear-gradient(180deg, #04176A 0%, #082395 100%)'
579
+ }, _a[LoyaltyType.InsiderIcon] = {
580
+ icon: jsx(InsiderIcon, {}),
581
+ borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
582
+ backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)'
583
+ }, _a[LoyaltyType.InsiderElite] = {
584
+ icon: jsx(InsiderElite, {}),
585
+ borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
586
+ backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)'
587
+ }, _a);
588
+
589
+ var ExpandableItem = function (_a) {
590
+ var icon = _a.icon,
591
+ handleChipClick = _a.handleChipClick,
592
+ value = _a.value;
593
+ var _b = useState(false),
594
+ isHovered = _b[0],
595
+ setIsHovered = _b[1];
596
+ return jsxs(Container, __assign({
597
+ className: "flex flex-middle justify-center br-8 c-pointer",
598
+ style: {
599
+ height: 32,
600
+ paddingLeft: 8,
601
+ paddingRight: isHovered ? 4 : 8,
602
+ transition: 'padding-right 0.2s ease-in-out',
603
+ background: isHovered ? '#ffd7ca' : '#ffe6df'
427
604
  },
428
- _a[LoyaltyType.InsiderIcon] = {
429
- icon: jsx(InsiderIcon, {}),
430
- borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
431
- backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)',
605
+ onMouseEnter: function () {
606
+ return setIsHovered(true);
432
607
  },
433
- _a[LoyaltyType.InsiderElite] = {
434
- icon: jsx(InsiderElite, {}),
435
- borderGradient: 'linear-gradient(230.68deg, rgba(208, 175, 101, 0) 10.1%, #D0AF65 45.74%)',
436
- backgroundGradient: 'linear-gradient(111deg, #2E3042 0%, #1A1C23 100%)',
608
+ onMouseLeave: function () {
609
+ return setIsHovered(false);
437
610
  },
438
- _a);
439
-
440
- var ExpandableItem = function (_a) {
441
- var icon = _a.icon, handleChipClick = _a.handleChipClick, value = _a.value;
442
- var _b = useState(false), isHovered = _b[0], setIsHovered = _b[1];
443
- return (jsxs(Container, __assign({ className: "flex flex-middle justify-center br-8 c-pointer", style: {
444
- height: 32,
445
- paddingLeft: 8,
446
- paddingRight: isHovered ? 4 : 8,
447
- transition: 'padding-right 0.2s ease-in-out',
448
- background: isHovered ? '#ffd7ca' : '#ffe6df',
449
- }, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onClick: handleChipClick }, { children: [jsxs(Container, __assign({ className: 'flex flex-middle flex-gap-1' }, { children: [icon, value && (jsx(Typography, __assign({ variant: 'B3', className: 'value-text', isClickable: true }, { children: value })))] })), jsx(Container, __assign({ className: 'flex flex-middle o-hidden', style: {
450
- maxWidth: isHovered ? 16 : 0,
451
- transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
452
- opacity: isHovered ? 1 : 0,
453
- } }, { children: jsx(HeaderChevronRight, {}) }))] })));
611
+ onClick: handleChipClick
612
+ }, {
613
+ children: [jsxs(Container, __assign({
614
+ className: 'flex flex-middle flex-gap-1'
615
+ }, {
616
+ children: [icon, value && jsx(Typography, __assign({
617
+ variant: 'B3',
618
+ className: 'value-text',
619
+ isClickable: true
620
+ }, {
621
+ children: value
622
+ }))]
623
+ })), jsx(Container, __assign({
624
+ className: 'flex flex-middle o-hidden',
625
+ style: {
626
+ maxWidth: isHovered ? 16 : 0,
627
+ transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
628
+ opacity: isHovered ? 1 : 0
629
+ }
630
+ }, {
631
+ children: jsx(HeaderChevronRight, {})
632
+ }))]
633
+ }));
454
634
  };
455
635
  var RewardsSection = function (props) {
456
- var selectedLoyaltyType = props.loyaltyType, _a = props.fkSupercoinBurnBalance, superCoinBalance = _a === void 0 ? 0 : _a, _b = props.walletBalance, walletBalance = _b === void 0 ? 0 : _b, loyaltyLoading = props.loyaltyLoading, superCoinsLoading = props.superCoinsLoading, walletLoading = props.walletLoading, walletChipClick = props.walletChipClick, supercoinsChipClick = props.supercoinsChipClick, loyaltyChipClick = props.loyaltyChipClick;
457
- return (jsxs(Container, __assign({ className: 'flex p-4 pt-0 flex-start flex-gap-1', style: { alignSelf: 'stretch' } }, { children: [loyaltyLoading ? (jsx(Shimmer, { width: '50px', height: '32px', borderRadius: '8px' })) : (selectedLoyaltyType &&
458
- LOYALTY_DATA[selectedLoyaltyType] && (jsx(LoyaltyChip, { icon: LOYALTY_DATA[selectedLoyaltyType].icon, borderGradient: LOYALTY_DATA[selectedLoyaltyType].borderGradient, backgroundGradient: LOYALTY_DATA[selectedLoyaltyType].backgroundGradient, handleChipClick: loyaltyChipClick }))), superCoinsLoading ? (jsx(Shimmer, { width: '50px', height: '32px', borderRadius: '8px' })) : (jsx(ExpandableItem, { icon: jsx(Supercoin, { width: 20, height: 20 }), value: superCoinBalance, handleChipClick: supercoinsChipClick })), walletLoading ? (jsx(Shimmer, { width: '50px', height: '32px', borderRadius: '8px' })) : (jsx(ExpandableItem, { icon: jsx(Wallet, { width: 20, height: 20 }), value: walletBalance, handleChipClick: walletChipClick }))] })));
636
+ var selectedLoyaltyType = props.loyaltyType,
637
+ _a = props.fkSupercoinBurnBalance,
638
+ superCoinBalance = _a === void 0 ? 0 : _a,
639
+ _b = props.walletBalance,
640
+ walletBalance = _b === void 0 ? 0 : _b,
641
+ loyaltyLoading = props.loyaltyLoading,
642
+ superCoinsLoading = props.superCoinsLoading,
643
+ walletLoading = props.walletLoading,
644
+ walletChipClick = props.walletChipClick,
645
+ supercoinsChipClick = props.supercoinsChipClick,
646
+ loyaltyChipClick = props.loyaltyChipClick;
647
+ return jsxs(Container, __assign({
648
+ className: 'flex p-4 pt-0 flex-start flex-gap-1',
649
+ style: {
650
+ alignSelf: 'stretch'
651
+ }
652
+ }, {
653
+ children: [loyaltyLoading ? jsx(Shimmer, {
654
+ width: '50px',
655
+ height: '32px',
656
+ borderRadius: '8px'
657
+ }) : selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && jsx(LoyaltyChip, {
658
+ icon: LOYALTY_DATA[selectedLoyaltyType].icon,
659
+ borderGradient: LOYALTY_DATA[selectedLoyaltyType].borderGradient,
660
+ backgroundGradient: LOYALTY_DATA[selectedLoyaltyType].backgroundGradient,
661
+ handleChipClick: loyaltyChipClick
662
+ }), superCoinsLoading ? jsx(Shimmer, {
663
+ width: '50px',
664
+ height: '32px',
665
+ borderRadius: '8px'
666
+ }) : jsx(ExpandableItem, {
667
+ icon: jsx(Supercoin, {
668
+ width: 20,
669
+ height: 20
670
+ }),
671
+ value: superCoinBalance,
672
+ handleChipClick: supercoinsChipClick
673
+ }), walletLoading ? jsx(Shimmer, {
674
+ width: '50px',
675
+ height: '32px',
676
+ borderRadius: '8px'
677
+ }) : jsx(ExpandableItem, {
678
+ icon: jsx(Wallet, {
679
+ width: 20,
680
+ height: 20
681
+ }),
682
+ value: walletBalance,
683
+ handleChipClick: walletChipClick
684
+ })]
685
+ }));
459
686
  };
460
687
 
688
+ var HoverableContainer = /*#__PURE__*/styled(Container).withConfig({
689
+ displayName: "StyledHeader__HoverableContainer",
690
+ componentId: "sc-aht4pl-0"
691
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #ecf3ff;\n color: green;\n }\n"], ["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #ecf3ff;\n color: green;\n }\n"])));
692
+ var LogoutButton = /*#__PURE__*/styled(Container).withConfig({
693
+ displayName: "StyledHeader__LogoutButton",
694
+ componentId: "sc-aht4pl-1"
695
+ })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n column-gap: 8px;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #fbefef;\n }\n"], ["\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n column-gap: 8px;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: #fbefef;\n }\n"])));
696
+ var templateObject_1, templateObject_2;
697
+
461
698
  var AccountDropdownContent = function (props) {
462
- var _a = props || {}, handleLogout = _a.handleLogout, userName = _a.userName, userMobileNumber = _a.userMobileNumber, countryCode = _a.countryCode, userDetailsLoading = _a.userDetailsLoading, superCoinBalance = _a.fkSupercoinBurnBalance, walletBalance = _a.walletBalance, loyaltyType = _a.loyaltyType, loyaltyLoading = _a.loyaltyLoading, walletLoading = _a.walletLoading, superCoinsLoading = _a.superCoinsLoading, walletChipClick = _a.walletChipClick, supercoinsChipClick = _a.supercoinsChipClick, loyaltyChipClick = _a.loyaltyChipClick, isOpen = _a.isOpen;
463
- var containerRef = useDropdownAnimation(isOpen).containerRef;
464
- var _b = useMemo(function () {
465
- var userGreeting = userName && "Hello ".concat(userName, "!");
466
- var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
467
- return { userGreeting: userGreeting, phoneNumber: phoneNumber };
468
- }, [userName, userMobileNumber, countryCode]), userGreeting = _b.userGreeting, phoneNumber = _b.phoneNumber;
469
- var handleRedirectClick = function (redirectLink) {
470
- return function () {
471
- window.location.href = redirectLink;
472
- };
699
+ var _a = props || {},
700
+ handleLogout = _a.handleLogout,
701
+ userName = _a.userName,
702
+ userMobileNumber = _a.userMobileNumber,
703
+ countryCode = _a.countryCode,
704
+ userDetailsLoading = _a.userDetailsLoading,
705
+ superCoinBalance = _a.fkSupercoinBurnBalance,
706
+ walletBalance = _a.walletBalance,
707
+ loyaltyType = _a.loyaltyType,
708
+ loyaltyLoading = _a.loyaltyLoading,
709
+ walletLoading = _a.walletLoading,
710
+ superCoinsLoading = _a.superCoinsLoading,
711
+ walletChipClick = _a.walletChipClick,
712
+ supercoinsChipClick = _a.supercoinsChipClick,
713
+ loyaltyChipClick = _a.loyaltyChipClick,
714
+ isOpen = _a.isOpen;
715
+ var containerRef = useDropdownAnimation(isOpen).containerRef;
716
+ var _b = useMemo(function () {
717
+ var userGreeting = userName && "Hello ".concat(userName, "!");
718
+ var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
719
+ return {
720
+ userGreeting: userGreeting,
721
+ phoneNumber: phoneNumber
722
+ };
723
+ }, [userName, userMobileNumber, countryCode]),
724
+ userGreeting = _b.userGreeting,
725
+ phoneNumber = _b.phoneNumber;
726
+ var handleRedirectClick = function (redirectLink) {
727
+ return function () {
728
+ window.location.href = redirectLink;
473
729
  };
474
- useEffect(function () {
475
- var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
476
- var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
477
- var positionAccountOptionsDiv = function () {
478
- var headerBtnRight = headerAccBtn === null || headerAccBtn === void 0 ? void 0 : headerAccBtn.getBoundingClientRect().right;
479
- if (accountOptionsElem && headerBtnRight) {
480
- accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
481
- }
482
- };
483
- positionAccountOptionsDiv();
484
- }, []);
485
- var renderUserData = function () {
486
- var renderContent = function (loading, content, variant, color) { return (jsx(Typography, __assign({ variant: variant, color: color }, { children: loading ? (jsx(Shimmer, { height: variant === 'HM3' ? '18px' : '12px', width: variant === 'HM3' ? '140px' : '200px' })) : (content) }))); };
487
- return (jsx(Container, __assign({ className: 'flex flex-column flex-gap-1' }, { children: userGreeting ? (jsxs(Fragment, { children: [renderContent(userDetailsLoading, userGreeting, 'HM3', 'primary'), renderContent(userDetailsLoading, "".concat(LOGGEDIN_USER_TEXT, " ").concat(phoneNumber), 'P3', 'subheading')] })) : (jsxs(Fragment, { children: [renderContent(userDetailsLoading, LOGGEDIN_USER_TEXT, 'P3', 'subheading'), renderContent(userDetailsLoading, phoneNumber, 'HM3', 'primary')] })) })));
730
+ };
731
+ useEffect(function () {
732
+ var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
733
+ var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
734
+ var positionAccountOptionsDiv = function () {
735
+ var headerBtnRight = headerAccBtn === null || headerAccBtn === void 0 ? void 0 : headerAccBtn.getBoundingClientRect().right;
736
+ if (accountOptionsElem && headerBtnRight) {
737
+ accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
738
+ }
488
739
  };
489
- return (jsxs(Container, __assign({ id: ACCOUNT_OPTIONS_CONTAINER_ID, ref: containerRef, className: 'flex flex-column br-16 o-hidden', css: { zIndex: 1002, opacity: 0, top: '76px', position: 'fixed' }, width: "".concat(ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px"), background: '#FFF1EC' }, { children: [jsx(Container, __assign({ className: 'p-4', height: '72px' }, { children: renderUserData() })), jsx(RewardsSection, { fkSupercoinBurnBalance: superCoinBalance, walletBalance: walletBalance, loyaltyType: loyaltyType, loyaltyLoading: loyaltyLoading, superCoinsLoading: superCoinsLoading, walletLoading: walletLoading, walletChipClick: walletChipClick, supercoinsChipClick: supercoinsChipClick, loyaltyChipClick: loyaltyChipClick }), jsxs(Container, __assign({ className: 'p-2 flex flex-column', backgroundColor: 'white', style: {
490
- borderBottomLeftRadius: 12,
491
- borderBottomRightRadius: 12,
492
- rowGap: 8,
493
- } }, { children: [ACCOUNT_OPTIONS_POPUP_CONFIG.map(function (_a) {
494
- var text = _a.text, icon = _a.icon, redirectionLink = _a.redirectionLink;
495
- return (jsx(Container, __assign({ className: "highlight-on-hover default p-2 br-8 c-pointer" }, { children: jsxs(Container, __assign({ className: 'flex c-pointer', css: { columnGap: '8px' }, onClick: handleRedirectClick(redirectionLink) }, { children: [icon, jsx(Typography, __assign({ variant: 'P1', className: 'flex flex-middle c-pointer' }, { children: text }))] }), "account-option-".concat(text)) }), "account-option-".concat(text)));
496
- }), jsx(Divider, { style: {
497
- borderBottom: '1px dashed #E6E6E6',
498
- } }), jsxs(Container, __assign({ className: "logout-button-hover default flex p-2 br-8 c-pointer", css: { columnGap: '8px' }, onClick: handleLogout }, { children: [jsx(Signout, { height: 24, width: 24 }), jsx(Typography, __assign({ variant: 'P1', className: 'flex flex-middle c-pointer', color: 'warning' }, { children: SIGN_OUT_TEXT }))] }))] }))] })));
740
+ positionAccountOptionsDiv();
741
+ }, []);
742
+ var renderUserData = function () {
743
+ var renderContent = function (loading, content, variant, color) {
744
+ return jsx(Typography, __assign({
745
+ variant: variant,
746
+ color: color
747
+ }, {
748
+ children: loading ? jsx(Shimmer, {
749
+ height: variant === 'HM3' ? '18px' : '12px',
750
+ width: variant === 'HM3' ? '140px' : '200px'
751
+ }) : content
752
+ }));
753
+ };
754
+ return jsx(Container, __assign({
755
+ className: 'flex flex-column flex-gap-1'
756
+ }, {
757
+ children: userGreeting ? jsxs(Fragment, {
758
+ children: [renderContent(userDetailsLoading, userGreeting, 'HM3', 'primary'), renderContent(userDetailsLoading, "".concat(LOGGEDIN_USER_TEXT, " ").concat(phoneNumber), 'P3', 'subheading')]
759
+ }) : jsxs(Fragment, {
760
+ children: [renderContent(userDetailsLoading, LOGGEDIN_USER_TEXT, 'P3', 'subheading'), renderContent(userDetailsLoading, phoneNumber, 'HM3', 'primary')]
761
+ })
762
+ }));
763
+ };
764
+ return jsxs(Container, __assign({
765
+ id: ACCOUNT_OPTIONS_CONTAINER_ID,
766
+ ref: containerRef,
767
+ className: 'flex flex-column br-16 o-hidden',
768
+ css: {
769
+ zIndex: 1002,
770
+ opacity: 0,
771
+ top: '76px',
772
+ position: 'fixed'
773
+ },
774
+ width: "".concat(ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px"),
775
+ background: '#FFF1EC'
776
+ }, {
777
+ children: [jsx(Container, __assign({
778
+ className: 'p-4',
779
+ height: '72px'
780
+ }, {
781
+ children: renderUserData()
782
+ })), jsx(RewardsSection, {
783
+ fkSupercoinBurnBalance: superCoinBalance,
784
+ walletBalance: walletBalance,
785
+ loyaltyType: loyaltyType,
786
+ loyaltyLoading: loyaltyLoading,
787
+ superCoinsLoading: superCoinsLoading,
788
+ walletLoading: walletLoading,
789
+ walletChipClick: walletChipClick,
790
+ supercoinsChipClick: supercoinsChipClick,
791
+ loyaltyChipClick: loyaltyChipClick
792
+ }), jsxs(Container, __assign({
793
+ className: 'p-2 flex flex-column',
794
+ backgroundColor: 'white',
795
+ style: {
796
+ borderBottomLeftRadius: 12,
797
+ borderBottomRightRadius: 12,
798
+ rowGap: 8
799
+ }
800
+ }, {
801
+ children: [ACCOUNT_OPTIONS_POPUP_CONFIG.map(function (_a) {
802
+ var text = _a.text,
803
+ icon = _a.icon,
804
+ redirectionLink = _a.redirectionLink;
805
+ return jsx(HoverableContainer, __assign({
806
+ onClick: handleRedirectClick(redirectionLink)
807
+ }, {
808
+ children: jsxs(Container, __assign({
809
+ className: 'flex c-pointer',
810
+ style: {
811
+ columnGap: '8px'
812
+ }
813
+ }, {
814
+ children: [icon, jsx(Typography, __assign({
815
+ variant: 'P1',
816
+ className: 'flex flex-middle c-pointer'
817
+ }, {
818
+ children: text
819
+ }))]
820
+ }))
821
+ }), "account-option-".concat(text));
822
+ }), jsx(Divider, {
823
+ style: {
824
+ borderBottom: '1px dashed #E6E6E6'
825
+ }
826
+ }), jsxs(LogoutButton, __assign({
827
+ onClick: handleLogout
828
+ }, {
829
+ children: [jsx(Signout, {
830
+ height: 24,
831
+ width: 24
832
+ }), jsx(Typography, __assign({
833
+ variant: 'P1',
834
+ className: 'flex flex-middle c-pointer',
835
+ color: 'warning'
836
+ }, {
837
+ children: SIGN_OUT_TEXT
838
+ }))]
839
+ }))]
840
+ }))]
841
+ }));
499
842
  };
500
843
 
501
844
  var UserAccount = function (props) {
502
- var handleLogout = props.handleLogout, userDetailsLoading = props.userDetailsLoading, userName = props.userName, userMobileNumber = props.userMobileNumber, countryCode = props.countryCode, fkSupercoinBurnBalance = props.fkSupercoinBurnBalance, walletBalance = props.walletBalance, loyaltyType = props.loyaltyType, walletLoading = props.walletLoading, superCoinsLoading = props.superCoinsLoading, loyaltyLoading = props.loyaltyLoading, loyaltyChipClick = props.loyaltyChipClick, supercoinsChipClick = props.supercoinsChipClick, walletChipClick = props.walletChipClick;
503
- var _a = useHoverDropdown({ openDelay: 500, closeDelay: 50 }), isDropdownVisible = _a.isDropdownVisible, handleOnMouseEnter = _a.handleOnMouseEnter, handleOnMouseLeave = _a.handleOnMouseLeave, handleDropdownMouseEnter = _a.handleDropdownMouseEnter, handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
504
- return (jsxs(Container, { children: [jsxs(Container, __assign({ className: "flex px-3 py-2 flex-middle br-12 h-100p c-pointer", style: { columnGap: 8 }, onMouseEnter: function () { return handleOnMouseEnter(4); }, onMouseLeave: handleOnMouseLeave, id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID }, { children: [jsx(MyAccount, { color: isDropdownVisible ? '#FF4F17' : '#1A1A1A' }), jsxs(Container, __assign({ className: 'flex flex-row flex-middle' }, { children: [jsx(Typography, __assign({ variant: 'B2', className: 'c-pointer', color: isDropdownVisible ? 'secondary' : 'primary' }, { children: "My Account" })), jsx(ChevronDown, { width: 20, height: 20, fill: isDropdownVisible ? '#FF4F17' : '#1A1A1A' })] }))] })), jsx(HeaderAnimatedMask, __assign({ show: isDropdownVisible, marginTop: '64px', handleDropdownMouseEnter: handleDropdownMouseEnter, handleDropdownMouseLeave: handleDropdownMouseLeave, onMaskClick: handleDropdownMouseLeave }, { children: jsx(AccountDropdownContent, { handleLogout: handleLogout, userDetailsLoading: userDetailsLoading, userName: userName, userMobileNumber: userMobileNumber, countryCode: countryCode, loyaltyType: loyaltyType, walletBalance: walletBalance, fkSupercoinBurnBalance: fkSupercoinBurnBalance, walletLoading: walletLoading, superCoinsLoading: superCoinsLoading, loyaltyLoading: loyaltyLoading, loyaltyChipClick: loyaltyChipClick, walletChipClick: walletChipClick, supercoinsChipClick: supercoinsChipClick, isOpen: isDropdownVisible }) }))] }));
845
+ var handleLogout = props.handleLogout,
846
+ userDetailsLoading = props.userDetailsLoading,
847
+ userName = props.userName,
848
+ userMobileNumber = props.userMobileNumber,
849
+ countryCode = props.countryCode,
850
+ fkSupercoinBurnBalance = props.fkSupercoinBurnBalance,
851
+ walletBalance = props.walletBalance,
852
+ loyaltyType = props.loyaltyType,
853
+ walletLoading = props.walletLoading,
854
+ superCoinsLoading = props.superCoinsLoading,
855
+ loyaltyLoading = props.loyaltyLoading,
856
+ loyaltyChipClick = props.loyaltyChipClick,
857
+ supercoinsChipClick = props.supercoinsChipClick,
858
+ walletChipClick = props.walletChipClick;
859
+ var _a = useHoverDropdown({
860
+ openDelay: 500,
861
+ closeDelay: 50
862
+ }),
863
+ isDropdownVisible = _a.isDropdownVisible,
864
+ handleOnMouseEnter = _a.handleOnMouseEnter,
865
+ handleOnMouseLeave = _a.handleOnMouseLeave,
866
+ handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
867
+ handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
868
+ return jsxs(Container, {
869
+ children: [jsxs(Container, __assign({
870
+ className: "flex px-3 py-2 flex-middle br-12 h-100p c-pointer",
871
+ style: {
872
+ columnGap: 8,
873
+ height: 64
874
+ },
875
+ onMouseEnter: function () {
876
+ return handleOnMouseEnter(4);
877
+ },
878
+ onMouseLeave: handleOnMouseLeave,
879
+ id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID
880
+ }, {
881
+ children: [jsx(MyAccount, {
882
+ color: isDropdownVisible ? '#FF4F17' : '#1A1A1A'
883
+ }), jsxs(Container, __assign({
884
+ className: 'flex flex-row flex-middle'
885
+ }, {
886
+ children: [jsx(Typography, __assign({
887
+ variant: 'B2',
888
+ className: 'c-pointer',
889
+ color: isDropdownVisible ? 'secondary' : 'primary'
890
+ }, {
891
+ children: "My Account"
892
+ })), jsx(ChevronDown, {
893
+ width: 20,
894
+ height: 20,
895
+ fill: isDropdownVisible ? '#FF4F17' : '#1A1A1A'
896
+ })]
897
+ }))]
898
+ })), jsx(HeaderAnimatedMask, __assign({
899
+ show: isDropdownVisible,
900
+ marginTop: '64px',
901
+ handleDropdownMouseEnter: handleDropdownMouseEnter,
902
+ handleDropdownMouseLeave: handleDropdownMouseLeave,
903
+ onMaskClick: handleDropdownMouseLeave
904
+ }, {
905
+ children: jsx(AccountDropdownContent, {
906
+ handleLogout: handleLogout,
907
+ userDetailsLoading: userDetailsLoading,
908
+ userName: userName,
909
+ userMobileNumber: userMobileNumber,
910
+ countryCode: countryCode,
911
+ loyaltyType: loyaltyType,
912
+ walletBalance: walletBalance,
913
+ fkSupercoinBurnBalance: fkSupercoinBurnBalance,
914
+ walletLoading: walletLoading,
915
+ superCoinsLoading: superCoinsLoading,
916
+ loyaltyLoading: loyaltyLoading,
917
+ loyaltyChipClick: loyaltyChipClick,
918
+ walletChipClick: walletChipClick,
919
+ supercoinsChipClick: supercoinsChipClick,
920
+ isOpen: isDropdownVisible
921
+ })
922
+ }))]
923
+ });
505
924
  };
506
925
 
507
926
  var Header = function (props) {
508
- var superCoinsLoading = props.superCoinsLoading, fkSupercoinBurnBalance = props.fkSupercoinBurnBalance, onLoginButtonClick = props.onLoginButtonClick, _a = props.showAllLobs, showAllLobs = _a === void 0 ? false : _a, selectedLOB = props.selectedLOB, isUserLoggedIn = props.isUserLoggedIn, handleLogoutClick = props.handleLogoutClick, walletBalance = props.walletBalance, walletLoading = props.walletLoading, loyaltyLoading = props.loyaltyLoading, loyaltyType = props.loyaltyType, userDetailsLoading = props.userDetailsLoading, userName = props.userName, userMobileNumber = props.userMobileNumber, countryCode = props.countryCode, loyaltyChipClick = props.loyaltyChipClick, supercoinsChipClick = props.supercoinsChipClick, walletChipClick = props.walletChipClick; props.ravenPayload; props.ravenPushCallback;
509
- var _c = useHoverDropdown({
510
- openDelay: 500,
511
- }), isDropdownVisible = _c.isDropdownVisible, hoveredElemIndex = _c.hoveredElemIndex, handleOnMouseEnter = _c.handleOnMouseEnter, handleOnMouseLeave = _c.handleOnMouseLeave, handleDropdownMouseEnter = _c.handleDropdownMouseEnter, handleDropdownMouseLeave = _c.handleDropdownMouseLeave;
512
- return (jsxs(Fragment, { children: [jsx(Container, __assign({ className: 'flex t-0 p-sticky w-100p flex-middle flex-center flex-gap-6 flex-no-shrink', style: {
513
- zIndex: 1000,
514
- height: 64,
515
- borderBottom: '1px solid #E6E6E6',
516
- background: '#F7FAFF',
517
- } }, { children: jsxs(Container, __assign({ className: 'flex flex-middle flex-between flex-gap-6', style: {
518
- maxWidth: 1440,
519
- padding: '0px 28px',
520
- flex: '1 0 0',
521
- } }, { children: [jsxs(Container, __assign({ className: 'flex flex-row flex-center flex-middle' }, { children: [jsx(CTLogo, {}), jsx(Divider, { style: {
522
- width: 12,
523
- marginLeft: 2,
524
- marginRight: 2,
525
- transform: 'rotate(90deg)',
526
- borderBottom: '1px solid #e0e0e0',
527
- } }), jsx(Fkcompany, {})] })), jsxs(Container, __assign({ className: 'flex flex-row flex-middle flex-center flex-cg-6' }, { children: [jsx(Container, __assign({ className: 'flex flex-row flex-middle flex-center flex-cg-1' }, { children: NAVBAR_OPTIONS.map(function (option, index) {
528
- var isHovered = hoveredElemIndex === index;
529
- return (jsxs(Container, { children: [jsxs(Container, __assign({ onMouseEnter: function () { return handleOnMouseEnter(index); }, onMouseLeave: handleOnMouseLeave, className: 'flex flex-row flex-middle px-3 py-2 c-pointer p-relative', style: { columnGap: 8, height: 64 }, onClick: function () {
530
- if (option.isClickable) {
531
- window.location.href = option.link;
532
- }
533
- } }, { children: [jsx(option.lefticon, { color: isHovered ? '#FF4F17' : '#1A1A1A' }), jsxs(Container, __assign({ className: 'flex flex-row flex-middle' }, { children: [jsx(Typography, __assign({ variant: 'B2', color: isHovered ? 'secondary' : 'primary', isClickable: true }, { children: option.text })), option.rightIcon && (jsx(option.rightIcon, { width: 20, height: 20, fill: isHovered ? '#FF4F17' : '#1A1A1A' }))] }))] }), "nav-option-".concat(index)), jsx(HeaderAnimatedMask, __assign({ show: hoveredElemIndex === index && option.isHoverable && isDropdownVisible, marginTop: '64px', handleDropdownMouseEnter: handleDropdownMouseEnter, handleDropdownMouseLeave: handleDropdownMouseLeave, onMaskClick: handleDropdownMouseLeave }, { children: jsx(BusinessDropdownContent, { isOpen: hoveredElemIndex === index && option.isHoverable && isDropdownVisible }) }))] }));
534
- }) })), isUserLoggedIn && (jsx(Divider, { style: {
535
- width: 12,
536
- margin: '0 -18px',
537
- transform: 'rotate(90deg)',
538
- borderBottom: '1px solid #e0e0e0',
539
- } })), jsx(Container, { children: isUserLoggedIn ? (jsx(Container, __assign({ className: 'flex flex-row flex-middle' }, { children: jsx(UserAccount, { handleLogout: handleLogoutClick, superCoinsLoading: superCoinsLoading, fkSupercoinBurnBalance: fkSupercoinBurnBalance, walletBalance: walletBalance, walletLoading: walletLoading, loyaltyLoading: loyaltyLoading, loyaltyType: loyaltyType, userDetailsLoading: userDetailsLoading, userName: userName, userMobileNumber: userMobileNumber, countryCode: countryCode, walletChipClick: walletChipClick, supercoinsChipClick: supercoinsChipClick, loyaltyChipClick: loyaltyChipClick }) }))) : (jsx(Button, __assign({ className: "fw-400 fs-14 login-button", onClick: onLoginButtonClick, style: {
540
- width: 153,
541
- height: 40,
542
- border: '1px solid #1A1A1A',
543
- }, loading: false }, { children: jsx(Typography, __assign({ componentNode: 'span', variant: 'L2' }, { children: "Login" })) }))) })] }))] })) })), showAllLobs && jsx(LobsHeader, { selectedLOB: selectedLOB })] }));
927
+ var superCoinsLoading = props.superCoinsLoading,
928
+ fkSupercoinBurnBalance = props.fkSupercoinBurnBalance,
929
+ onLoginButtonClick = props.onLoginButtonClick,
930
+ _a = props.showAllLobs,
931
+ showAllLobs = _a === void 0 ? false : _a,
932
+ selectedLOB = props.selectedLOB,
933
+ isUserLoggedIn = props.isUserLoggedIn,
934
+ handleLogoutClick = props.handleLogoutClick,
935
+ walletBalance = props.walletBalance,
936
+ walletLoading = props.walletLoading,
937
+ loyaltyLoading = props.loyaltyLoading,
938
+ loyaltyType = props.loyaltyType,
939
+ userDetailsLoading = props.userDetailsLoading,
940
+ userName = props.userName,
941
+ userMobileNumber = props.userMobileNumber,
942
+ countryCode = props.countryCode,
943
+ loyaltyChipClick = props.loyaltyChipClick,
944
+ supercoinsChipClick = props.supercoinsChipClick,
945
+ walletChipClick = props.walletChipClick;
946
+ props.ravenPayload;
947
+ props.ravenPushCallback;
948
+ var _c = useHoverDropdown({
949
+ openDelay: 500
950
+ }),
951
+ isDropdownVisible = _c.isDropdownVisible,
952
+ hoveredElemIndex = _c.hoveredElemIndex,
953
+ handleOnMouseEnter = _c.handleOnMouseEnter,
954
+ handleOnMouseLeave = _c.handleOnMouseLeave,
955
+ handleDropdownMouseEnter = _c.handleDropdownMouseEnter,
956
+ handleDropdownMouseLeave = _c.handleDropdownMouseLeave;
957
+ return jsxs(Fragment, {
958
+ children: [jsx(Container, __assign({
959
+ className: 'flex t-0 p-sticky w-100p flex-middle flex-center flex-gap-6 flex-no-shrink',
960
+ style: {
961
+ zIndex: 1000,
962
+ height: 64,
963
+ borderBottom: '1px solid #E6E6E6',
964
+ background: '#F7FAFF'
965
+ }
966
+ }, {
967
+ children: jsxs(Container, __assign({
968
+ className: 'flex flex-middle flex-between flex-gap-6',
969
+ style: {
970
+ maxWidth: 1440,
971
+ padding: '0px 28px',
972
+ flex: '1 0 0'
973
+ }
974
+ }, {
975
+ children: [jsxs(Container, __assign({
976
+ className: 'flex flex-row flex-center flex-middle'
977
+ }, {
978
+ children: [jsx(CTLogo, {}), jsx(Divider, {
979
+ style: {
980
+ width: 12,
981
+ marginLeft: 2,
982
+ marginRight: 2,
983
+ transform: 'rotate(90deg)',
984
+ borderBottom: '1px solid #e0e0e0'
985
+ }
986
+ }), jsx(Fkcompany, {})]
987
+ })), jsxs(Container, __assign({
988
+ className: 'flex flex-row flex-middle flex-center flex-cg-6'
989
+ }, {
990
+ children: [jsx(Container, __assign({
991
+ className: 'flex flex-row flex-middle flex-center flex-cg-1'
992
+ }, {
993
+ children: NAVBAR_OPTIONS.map(function (option, index) {
994
+ var isHovered = hoveredElemIndex === index;
995
+ return jsxs(Container, {
996
+ children: [jsxs(Container, __assign({
997
+ onMouseEnter: function () {
998
+ return handleOnMouseEnter(index);
999
+ },
1000
+ onMouseLeave: handleOnMouseLeave,
1001
+ className: 'flex flex-row flex-middle px-3 py-2 c-pointer p-relative',
1002
+ style: {
1003
+ columnGap: 8,
1004
+ height: 64
1005
+ },
1006
+ onClick: function () {
1007
+ if (option.isClickable) {
1008
+ window.location.href = option.link;
1009
+ }
1010
+ }
1011
+ }, {
1012
+ children: [jsx(option.lefticon, {
1013
+ color: isHovered ? '#FF4F17' : '#1A1A1A'
1014
+ }), jsxs(Container, __assign({
1015
+ className: 'flex flex-row flex-middle'
1016
+ }, {
1017
+ children: [jsx(Typography, __assign({
1018
+ variant: 'B2',
1019
+ color: isHovered ? 'secondary' : 'primary',
1020
+ isClickable: true
1021
+ }, {
1022
+ children: option.text
1023
+ })), option.rightIcon && jsx(option.rightIcon, {
1024
+ width: 20,
1025
+ height: 20,
1026
+ fill: isHovered ? '#FF4F17' : '#1A1A1A'
1027
+ })]
1028
+ }))]
1029
+ }), "nav-option-".concat(index)), jsx(HeaderAnimatedMask, __assign({
1030
+ show: hoveredElemIndex === index && option.isHoverable && isDropdownVisible,
1031
+ marginTop: '64px',
1032
+ handleDropdownMouseEnter: handleDropdownMouseEnter,
1033
+ handleDropdownMouseLeave: handleDropdownMouseLeave,
1034
+ onMaskClick: handleDropdownMouseLeave
1035
+ }, {
1036
+ children: jsx(BusinessDropdownContent, {
1037
+ isOpen: hoveredElemIndex === index && option.isHoverable && isDropdownVisible
1038
+ })
1039
+ }))]
1040
+ });
1041
+ })
1042
+ })), isUserLoggedIn && jsx(Divider, {
1043
+ style: {
1044
+ width: 12,
1045
+ margin: '0 -18px',
1046
+ transform: 'rotate(90deg)',
1047
+ borderBottom: '1px solid #e0e0e0'
1048
+ }
1049
+ }), jsx(Container, {
1050
+ children: isUserLoggedIn ? jsx(Container, __assign({
1051
+ className: 'flex flex-row flex-middle'
1052
+ }, {
1053
+ children: jsx(UserAccount, {
1054
+ handleLogout: handleLogoutClick,
1055
+ superCoinsLoading: superCoinsLoading,
1056
+ fkSupercoinBurnBalance: fkSupercoinBurnBalance,
1057
+ walletBalance: walletBalance,
1058
+ walletLoading: walletLoading,
1059
+ loyaltyLoading: loyaltyLoading,
1060
+ loyaltyType: loyaltyType,
1061
+ userDetailsLoading: userDetailsLoading,
1062
+ userName: userName,
1063
+ userMobileNumber: userMobileNumber,
1064
+ countryCode: countryCode,
1065
+ walletChipClick: walletChipClick,
1066
+ supercoinsChipClick: supercoinsChipClick,
1067
+ loyaltyChipClick: loyaltyChipClick
1068
+ })
1069
+ })) : jsx(Button, __assign({
1070
+ className: "fw-400 fs-14 login-button",
1071
+ onClick: onLoginButtonClick,
1072
+ style: {
1073
+ width: 153,
1074
+ height: 40,
1075
+ border: '1px solid #1A1A1A'
1076
+ },
1077
+ loading: false
1078
+ }, {
1079
+ children: jsx(Typography, __assign({
1080
+ componentNode: 'span',
1081
+ variant: 'L2'
1082
+ }, {
1083
+ children: "Login"
1084
+ }))
1085
+ }))
1086
+ })]
1087
+ }))]
1088
+ }))
1089
+ })), showAllLobs && jsx(LobsHeader, {
1090
+ selectedLOB: selectedLOB
1091
+ })]
1092
+ });
544
1093
  };
545
1094
 
546
1095
  export { Header };