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