ba-js-common-header 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,264 +1,264 @@
1
- # Bookassist Common Header
2
-
3
- A React-based shared header component
4
-
5
- ## Installation
6
-
7
- ```javascript
8
- yarn add ba-js-common-header
9
- ```
10
-
11
- ## Usage
12
-
13
- ```javascript
14
- // React
15
-
16
- import { Header } from 'ba-js-common-header/dist/ba-js-common-header.es.js'
17
-
18
- function App(props) {
19
- return <Header {...props} />
20
- }
21
- ```
22
-
23
- ```javascript
24
- // website
25
-
26
- <div id="header"></div>
27
-
28
- // es5
29
- <script src="https://unpkg.com/ba-js-common-header/dist/ba-js-common-header.umd.js"></script>
30
- // baJsHeader global now available
31
- <script>
32
- const { renderHeader } = baJsHeader
33
- renderHeader(document.querySelector('#header'), {
34
- // props
35
- })
36
- </script>
37
-
38
- // ES Modules
39
- <script type="module">
40
- import { renderHeader } from 'https://unpkg.com/ba-js-common-header/dist/ba-js-common-header.es.js'
41
- renderHeader(document.querySelector('#header'), {
42
- // props
43
- })
44
- </script>
45
- ```
46
-
47
- ## Header Props
48
-
49
- | Prop | Type | Description | Required |
50
- | :--------------------- | :---- | :--------------------------------- | :------- |
51
- | `config` | `url` | header configuration feed endpoint | Yes |
52
- | `userInfo` | `obj` | userInfo object | Yes |
53
- | `userLanguage` | `str` | default user language | No |
54
- | `handleLanguageChange` | `fn` | language selector callback | No |
55
- | `handleHotelChange` | `fn` | hotel selector callback | No |
56
- | `i18nFeed` | `url` | Jed i18n endpoint | No |
57
-
58
- #### config (required)
59
-
60
- The header configuration feed endpoint. See below for structure
61
-
62
- #### userInfo (required)
63
-
64
- The user state
65
-
66
- ```javascript
67
- {
68
- username, // string (required)
69
- hotelId, // integer (optional)
70
- guideId, // integer (optional)
71
- group, // string (optional)
72
- }
73
- ```
74
-
75
- The username is used by the header for display purposes. The hotel and guide ids are to provide for an initially selected hotel
76
-
77
- #### userLanguage (optional)
78
-
79
- The initially selected language, provided as an ISO language code (defaults to 'en')
80
-
81
- #### handleLanguageChange (optional)
82
-
83
- Callback fired on selection of a language. The callback is passed the new language code
84
-
85
- ```javascript
86
- const cb = code => {
87
- console.log(`The new language code is ${code}`)
88
- }
89
- ```
90
-
91
- #### handleHotelChange (optional)
92
-
93
- Callback fired on selection of a hotel. The callback is passed an object containing name, hotel id and guide id
94
-
95
- ```javascript
96
- const cb = ({ name, hotelId, guideId }) => {
97
- console.log({ name, hotelId, guideId })
98
- }
99
- ```
100
-
101
- #### i18nFeed (optional)
102
-
103
- Endpoint for Jed-based i18n feed. The url may contain a '{0}' placeholder for the current language code
104
-
105
- ```javascript
106
- const i18nFeed =
107
- 'https://www.bookassist.com/rest/api/v1/i18n/jed/bookassist.i18n.HotelAdminRB/{0}'
108
- ```
109
-
110
- ## Feed Structures
111
-
112
- ### Config Feed (required)
113
-
114
- The config feed is an object with 2 required properties:
115
-
116
- ```javascript
117
- const config = {
118
- titleBar, // required object
119
- menuBar, // required array
120
- }
121
- ```
122
-
123
- #### titleBar (required)
124
-
125
- The `titleBar` property provides configuration details for the 6 available widgets in the upper half of the header (a given widget will be rendered if configuration for it exists). The property value is an object with 6 possible properties:
126
-
127
- ```javascript
128
- {
129
- help, // optional object
130
- languageSelector, // optional object
131
- notifications, // optional object
132
- product, // required object
133
- propertySelector, // optional object
134
- user, // required object
135
- }
136
- ```
137
-
138
- ##### help (optional)
139
-
140
- The `help` property provides link information for the help widget. The property value is an object with 2 required properties:
141
-
142
- ```javascript
143
- {
144
- label: 'Help Center', // required string
145
- href: 'https://go.bookassist.org/en/knowledge/booking-engine', // required string
146
- }
147
- ```
148
-
149
- ##### languageSelector (optional)
150
-
151
- The `languageSelector` property provides a language widget label and an array of available languages. The property value is an object with 2 required properties:
152
-
153
- ```javascript
154
-
155
- {
156
- label: 'Language', // required string
157
- children: [ // required array
158
- {
159
- code: 'en', // required string
160
- },
161
- {
162
- code: 'es', // required string
163
- label: 'Español', // optional string
164
- },
165
- {
166
- code: 'fr', // required string
167
- },
168
- // ...
169
- ],
170
- }
171
- ```
172
-
173
- The `children` array is a list of `language` objects. A `language` object consists of a required language code property and an optional label property that can be used to override the name provided by [Intl.DisplayNames](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
174
-
175
- ##### notifications (optional)
176
-
177
- ```javascript
178
- {
179
- }
180
- ```
181
-
182
- ##### product (required)
183
-
184
- The `product` property denotes the current product. The property value is an object with 2 required properties:
185
-
186
- ```javascript
187
- {
188
- name: 'Booking Engine', // required string
189
- href: '/hotel_admin/spl.jsp', // required string
190
- }
191
- ```
192
-
193
- ##### propertySelector (optional)
194
-
195
- The `propertySelector` property is used to provide the list of selectable hotels. The property value is an object with 2 required properties:
196
-
197
- ```javascript
198
- {
199
- type, // required string (one of 'data' or 'fetch')
200
- items, // required array of hotels or endpoint providing said array
201
- }
202
- ```
203
-
204
- The `items` property value is an array of hotels or an endpoint returning such an array. Individual hotels are specified as 2-item arrays containing the hotel name and a string consisting of the hotel and guide ids separated by an underscore.
205
-
206
- ```javascript
207
- const hotels = [
208
- ['ADLER HOTEL', '3724_802'],
209
- ['Adria Hotel Prague', '1465_802'],
210
- ['Agroturismo Can Toni Xumeu', '3033_102'],
211
- // ...
212
- ]
213
- ```
214
-
215
- ##### user (required)
216
-
217
- The `user` property denotes a set of user-related links. The property value is an object with 2 required properties:
218
-
219
- ```javascript
220
- {
221
- label: 'Profile', // required string
222
- children: [ // required array
223
- {
224
- label: 'Maintain Users', // required string
225
- href: '/hotel_admin/maintain_users.jsp', // required string
226
- },
227
- {
228
- label: 'Change Password', // required string
229
- href: '/hotel_admin/login.jsp?resetpass', // required string
230
- },
231
- {
232
- label: 'Log Out', // required string
233
- href: '/hotel_admin/logout.jsp', // required string
234
- },
235
- ],
236
- }
237
- ```
238
-
239
- The `children` property is a list of link objects, each with 2 required properties (`label` and `href`)
240
-
241
- #### menuBar (requred)
242
-
243
- The `menuBar` property provides configuration details for the lower half of the header. The property value is a flat array of menu item objects:
244
-
245
- ```javascript
246
- const menuBar = [
247
- {
248
- id, // required string
249
- parentId, // required for nested menu items
250
- label, // required string
251
- href, // optional link (string)
252
- group, // optional header for menu item grouping (string)
253
- premium: { // optional object outlining premium status
254
- value: true, // required boolean
255
- locked: true, // required boolean
256
- },
257
- },
258
- // ...
259
- ]
260
- ```
261
-
262
- ## i18n
263
-
264
- i18n can be optionally provided via the `i18nFeed` prop. The header uses [Jed](https://github.com/messageformat/Jed). If an i18n feed is specified all header labels will be treated as i18n keys and run through Jed for translation.
1
+ # Bookassist Common Header
2
+
3
+ A React-based shared header component
4
+
5
+ ## Installation
6
+
7
+ ```javascript
8
+ yarn add ba-js-common-header
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```javascript
14
+ // React
15
+
16
+ import { Header } from 'ba-js-common-header/dist/ba-js-common-header.es.js'
17
+
18
+ function App(props) {
19
+ return <Header {...props} />
20
+ }
21
+ ```
22
+
23
+ ```javascript
24
+ // website
25
+
26
+ <div id="header"></div>
27
+
28
+ // es5
29
+ <script src="https://unpkg.com/ba-js-common-header/dist/ba-js-common-header.umd.js"></script>
30
+ // baJsHeader global now available
31
+ <script>
32
+ const { renderHeader } = baJsHeader
33
+ renderHeader(document.querySelector('#header'), {
34
+ // props
35
+ })
36
+ </script>
37
+
38
+ // ES Modules
39
+ <script type="module">
40
+ import { renderHeader } from 'https://unpkg.com/ba-js-common-header/dist/ba-js-common-header.es.js'
41
+ renderHeader(document.querySelector('#header'), {
42
+ // props
43
+ })
44
+ </script>
45
+ ```
46
+
47
+ ## Header Props
48
+
49
+ | Prop | Type | Description | Required |
50
+ | :--------------------- | :---- | :--------------------------------- | :------- |
51
+ | `config` | `url` | header configuration feed endpoint | Yes |
52
+ | `userInfo` | `obj` | userInfo object | Yes |
53
+ | `userLanguage` | `str` | default user language | No |
54
+ | `handleLanguageChange` | `fn` | language selector callback | No |
55
+ | `handleHotelChange` | `fn` | hotel selector callback | No |
56
+ | `i18nFeed` | `url` | Jed i18n endpoint | No |
57
+
58
+ #### config (required)
59
+
60
+ The header configuration feed endpoint. See below for structure
61
+
62
+ #### userInfo (required)
63
+
64
+ The user state
65
+
66
+ ```javascript
67
+ {
68
+ username, // string (required)
69
+ hotelId, // integer (optional)
70
+ guideId, // integer (optional)
71
+ group, // string (optional)
72
+ }
73
+ ```
74
+
75
+ The username is used by the header for display purposes. The hotel and guide ids are to provide for an initially selected hotel
76
+
77
+ #### userLanguage (optional)
78
+
79
+ The initially selected language, provided as an ISO language code (defaults to 'en')
80
+
81
+ #### handleLanguageChange (optional)
82
+
83
+ Callback fired on selection of a language. The callback is passed the new language code
84
+
85
+ ```javascript
86
+ const cb = code => {
87
+ console.log(`The new language code is ${code}`)
88
+ }
89
+ ```
90
+
91
+ #### handleHotelChange (optional)
92
+
93
+ Callback fired on selection of a hotel. The callback is passed an object containing name, hotel id and guide id
94
+
95
+ ```javascript
96
+ const cb = ({ name, hotelId, guideId }) => {
97
+ console.log({ name, hotelId, guideId })
98
+ }
99
+ ```
100
+
101
+ #### i18nFeed (optional)
102
+
103
+ Endpoint for Jed-based i18n feed. The url may contain a '{0}' placeholder for the current language code
104
+
105
+ ```javascript
106
+ const i18nFeed =
107
+ 'https://www.bookassist.com/rest/api/v1/i18n/jed/bookassist.i18n.HotelAdminRB/{0}'
108
+ ```
109
+
110
+ ## Feed Structures
111
+
112
+ ### Config Feed (required)
113
+
114
+ The config feed is an object with 2 required properties:
115
+
116
+ ```javascript
117
+ const config = {
118
+ titleBar, // required object
119
+ menuBar, // required array
120
+ }
121
+ ```
122
+
123
+ #### titleBar (required)
124
+
125
+ The `titleBar` property provides configuration details for the 6 available widgets in the upper half of the header (a given widget will be rendered if configuration for it exists). The property value is an object with 6 possible properties:
126
+
127
+ ```javascript
128
+ {
129
+ help, // optional object
130
+ languageSelector, // optional object
131
+ notifications, // optional object
132
+ product, // required object
133
+ propertySelector, // optional object
134
+ user, // required object
135
+ }
136
+ ```
137
+
138
+ ##### help (optional)
139
+
140
+ The `help` property provides link information for the help widget. The property value is an object with 2 required properties:
141
+
142
+ ```javascript
143
+ {
144
+ label: 'Help Center', // required string
145
+ href: 'https://go.bookassist.org/en/knowledge/booking-engine', // required string
146
+ }
147
+ ```
148
+
149
+ ##### languageSelector (optional)
150
+
151
+ The `languageSelector` property provides a language widget label and an array of available languages. The property value is an object with 2 required properties:
152
+
153
+ ```javascript
154
+
155
+ {
156
+ label: 'Language', // required string
157
+ children: [ // required array
158
+ {
159
+ code: 'en', // required string
160
+ },
161
+ {
162
+ code: 'es', // required string
163
+ label: 'Español', // optional string
164
+ },
165
+ {
166
+ code: 'fr', // required string
167
+ },
168
+ // ...
169
+ ],
170
+ }
171
+ ```
172
+
173
+ The `children` array is a list of `language` objects. A `language` object consists of a required language code property and an optional label property that can be used to override the name provided by [Intl.DisplayNames](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
174
+
175
+ ##### notifications (optional)
176
+
177
+ ```javascript
178
+ {
179
+ }
180
+ ```
181
+
182
+ ##### product (required)
183
+
184
+ The `product` property denotes the current product. The property value is an object with 2 required properties:
185
+
186
+ ```javascript
187
+ {
188
+ name: 'Booking Engine', // required string
189
+ href: '/hotel_admin/spl.jsp', // required string
190
+ }
191
+ ```
192
+
193
+ ##### propertySelector (optional)
194
+
195
+ The `propertySelector` property is used to provide the list of selectable hotels. The property value is an object with 2 required properties:
196
+
197
+ ```javascript
198
+ {
199
+ type, // required string (one of 'data' or 'fetch')
200
+ items, // required array of hotels or endpoint providing said array
201
+ }
202
+ ```
203
+
204
+ The `items` property value is an array of hotels or an endpoint returning such an array. Individual hotels are specified as 2-item arrays containing the hotel name and a string consisting of the hotel and guide ids separated by an underscore.
205
+
206
+ ```javascript
207
+ const hotels = [
208
+ ['ADLER HOTEL', '3724_802'],
209
+ ['Adria Hotel Prague', '1465_802'],
210
+ ['Agroturismo Can Toni Xumeu', '3033_102'],
211
+ // ...
212
+ ]
213
+ ```
214
+
215
+ ##### user (required)
216
+
217
+ The `user` property denotes a set of user-related links. The property value is an object with 2 required properties:
218
+
219
+ ```javascript
220
+ {
221
+ label: 'Profile', // required string
222
+ children: [ // required array
223
+ {
224
+ label: 'Maintain Users', // required string
225
+ href: '/hotel_admin/maintain_users.jsp', // required string
226
+ },
227
+ {
228
+ label: 'Change Password', // required string
229
+ href: '/hotel_admin/login.jsp?resetpass', // required string
230
+ },
231
+ {
232
+ label: 'Log Out', // required string
233
+ href: '/hotel_admin/logout.jsp', // required string
234
+ },
235
+ ],
236
+ }
237
+ ```
238
+
239
+ The `children` property is a list of link objects, each with 2 required properties (`label` and `href`)
240
+
241
+ #### menuBar (requred)
242
+
243
+ The `menuBar` property provides configuration details for the lower half of the header. The property value is a flat array of menu item objects:
244
+
245
+ ```javascript
246
+ const menuBar = [
247
+ {
248
+ id, // required string
249
+ parentId, // required for nested menu items
250
+ label, // required string
251
+ href, // optional link (string)
252
+ group, // optional header for menu item grouping (string)
253
+ premium: { // optional object outlining premium status
254
+ value: true, // required boolean
255
+ locked: true, // required boolean
256
+ },
257
+ },
258
+ // ...
259
+ ]
260
+ ```
261
+
262
+ ## i18n
263
+
264
+ i18n can be optionally provided via the `i18nFeed` prop. The header uses [Jed](https://github.com/messageformat/Jed). If an i18n feed is specified all header labels will be treated as i18n keys and run through Jed for translation.
@@ -14005,11 +14005,11 @@ function HelpCenter() {
14005
14005
  className: "hd-icon hd-icon-arrow-angle-right"
14006
14006
  })
14007
14007
  })]
14008
- }), /* @__PURE__ */ jsx("ul", {
14008
+ }), /* @__PURE__ */ jsxs("ul", {
14009
14009
  className: cn("py-3", "list-unstyled", "hd-nav-second-level", {
14010
14010
  "hd-submenu-opened": subMenuOpen
14011
14011
  }),
14012
- children: children.map(({
14012
+ children: [children.map(({
14013
14013
  href,
14014
14014
  label: lbl
14015
14015
  }) => /* @__PURE__ */ jsx("li", {
@@ -14027,7 +14027,19 @@ function HelpCenter() {
14027
14027
  }))
14028
14028
  })
14029
14029
  })
14030
- }, nanoid()))
14030
+ }, nanoid())), /* @__PURE__ */ jsx("li", {
14031
+ children: /* @__PURE__ */ jsx("div", {
14032
+ className: "row m-0 py-lg-0 align-items-center",
14033
+ children: /* @__PURE__ */ jsx("div", {
14034
+ className: "col py-2 py-lg-0 px-0",
14035
+ children: /* @__PURE__ */ jsxs("a", {
14036
+ className: "px-lg-4 py-2 d-block",
14037
+ href: "mailto:support@bookassist.com",
14038
+ children: [i18n && i18n.translate("bex.contact_support_team").fetch(), ":", /* @__PURE__ */ jsx("br", {}), "support@bookassist.com"]
14039
+ })
14040
+ })
14041
+ })
14042
+ })]
14031
14043
  })]
14032
14044
  });
14033
14045
  }
@@ -106,4 +106,4 @@ Expecting `+j.join(", ")+", got '"+this.terminals_[q]+"'":V="Parse error on line
106
106
  *
107
107
  * This source code is licensed under the MIT license found in the
108
108
  * LICENSE file in the root directory of this source tree.
109
- */var fi=60103,di=60106,Kr=60107,Gr=60108,kr=60114,Qr=60109,qr=60110,Xr=60112,Yr=60113,ns=60120,Jr=60115,Zr=60116,Zf=60121,ed=60122,td=60117,rd=60129,nd=60131;if(typeof Symbol=="function"&&Symbol.for){var Se=Symbol.for;fi=Se("react.element"),di=Se("react.portal"),Kr=Se("react.fragment"),Gr=Se("react.strict_mode"),kr=Se("react.profiler"),Qr=Se("react.provider"),qr=Se("react.context"),Xr=Se("react.forward_ref"),Yr=Se("react.suspense"),ns=Se("react.suspense_list"),Jr=Se("react.memo"),Zr=Se("react.lazy"),Zf=Se("react.block"),ed=Se("react.server.block"),td=Se("react.fundamental"),rd=Se("react.debug_trace_mode"),nd=Se("react.legacy_hidden")}function Qe(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case fi:switch(e=e.type,e){case Kr:case kr:case Gr:case Yr:case ns:return e;default:switch(e=e&&e.$$typeof,e){case qr:case Xr:case Zr:case Jr:case Qr:return e;default:return t}}case di:return t}}}var tO=Qr,rO=fi,nO=Xr,iO=Kr,aO=Zr,oO=Jr,sO=di,uO=kr,cO=Gr,lO=Yr;pe.ContextConsumer=qr,pe.ContextProvider=tO,pe.Element=rO,pe.ForwardRef=nO,pe.Fragment=iO,pe.Lazy=aO,pe.Memo=oO,pe.Portal=sO,pe.Profiler=uO,pe.StrictMode=cO,pe.Suspense=lO,pe.isAsyncMode=function(){return!1},pe.isConcurrentMode=function(){return!1},pe.isContextConsumer=function(e){return Qe(e)===qr},pe.isContextProvider=function(e){return Qe(e)===Qr},pe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===fi},pe.isForwardRef=function(e){return Qe(e)===Xr},pe.isFragment=function(e){return Qe(e)===Kr},pe.isLazy=function(e){return Qe(e)===Zr},pe.isMemo=function(e){return Qe(e)===Jr},pe.isPortal=function(e){return Qe(e)===di},pe.isProfiler=function(e){return Qe(e)===kr},pe.isStrictMode=function(e){return Qe(e)===Gr},pe.isSuspense=function(e){return Qe(e)===Yr},pe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Kr||e===kr||e===rd||e===Gr||e===Yr||e===ns||e===nd||typeof e=="object"&&e!==null&&(e.$$typeof===Zr||e.$$typeof===Jr||e.$$typeof===Qr||e.$$typeof===qr||e.$$typeof===Xr||e.$$typeof===td||e.$$typeof===Zf||e[0]===ed)},pe.typeOf=Qe;function id(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function ad(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function is(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return ad(r.overflowY,t)||ad(r.overflowX,t)||function(n){var i=function(a){if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}}(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)}(e)}return!1}function hi(e,t,r,n,i,a,o,s){return a<e&&o>t||a>e&&o<t?0:a<=e&&s<=r||o>=t&&s>=r?a-e-n:o>t&&s<r||a<e&&s>r?o-t+i:0}function fO(e,t){var r=window,n=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,s=t.skipOverflowHiddenElements,l=typeof o=="function"?o:function(W){return W!==o};if(!id(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,h=[],g=e;id(g)&&l(g);){if((g=g.parentElement)===u){h.push(g);break}g!=null&&g===document.body&&is(g)&&!is(document.documentElement)||g!=null&&is(g,s)&&h.push(g)}for(var y=r.visualViewport?r.visualViewport.width:innerWidth,P=r.visualViewport?r.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,O=window.scrollY||pageYOffset,d=e.getBoundingClientRect(),m=d.height,c=d.width,f=d.top,v=d.right,b=d.bottom,I=d.left,R=i==="start"||i==="nearest"?f:i==="end"?b:f+m/2,_=a==="center"?I+c/2:a==="end"?v:I,L=[],A=0;A<h.length;A++){var B=h[A],p=B.getBoundingClientRect(),U=p.height,z=p.width,H=p.top,ae=p.right,oe=p.bottom,q=p.left;if(n==="if-needed"&&f>=0&&I>=0&&b<=P&&v<=y&&f>=H&&b<=oe&&I>=q&&v<=ae)return L;var ce=getComputedStyle(B),ee=parseInt(ce.borderLeftWidth,10),x=parseInt(ce.borderTopWidth,10),C=parseInt(ce.borderRightWidth,10),E=parseInt(ce.borderBottomWidth,10),T=0,D=0,k="offsetWidth"in B?B.offsetWidth-B.clientWidth-ee-C:0,j="offsetHeight"in B?B.offsetHeight-B.clientHeight-x-E:0;if(u===B)T=i==="start"?R:i==="end"?R-P:i==="nearest"?hi(O,O+P,P,x,E,O+R,O+R+m,m):R-P/2,D=a==="start"?_:a==="center"?_-y/2:a==="end"?_-y:hi(w,w+y,y,ee,C,w+_,w+_+c,c),T=Math.max(0,T+O),D=Math.max(0,D+w);else{T=i==="start"?R-H-x:i==="end"?R-oe+E+j:i==="nearest"?hi(H,oe,U,x,E+j,R,R+m,m):R-(H+U/2)+j/2,D=a==="start"?_-q-ee:a==="center"?_-(q+z/2)+k/2:a==="end"?_-ae+C+k:hi(q,ae,z,ee,C+k,_,_+c,c);var V=B.scrollLeft,F=B.scrollTop;R+=F-(T=Math.max(0,Math.min(F+T,B.scrollHeight-U+j))),_+=V-(D=Math.max(0,Math.min(V+D,B.scrollWidth-z+k)))}L.push({el:B,top:T,left:D})}return L}var dO=0;function od(){}function hO(e,t){if(!!e){var r=fO(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});r.forEach(function(n){var i=n.el,a=n.top,o=n.left;i.scrollTop=a,i.scrollLeft=o})}}function sd(e,t,r){var n=e===t||t instanceof r.Node&&e.contains&&e.contains(t);return n}function ud(e,t){var r;function n(){r&&clearTimeout(r)}function i(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];n(),r=setTimeout(function(){r=null,e.apply(void 0,o)},t)}return i.cancel=n,i}function At(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return t.some(function(s){return s&&s.apply(void 0,[n].concat(a)),n.preventDownshiftDefault||n.hasOwnProperty("nativeEvent")&&n.nativeEvent.preventDownshiftDefault})}}function en(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){t.forEach(function(i){typeof i=="function"?i(n):i&&(i.current=n)})}}function pO(){return String(dO++)}function gO(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function as(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=cd(t,n)?t[n]:e[n],r},{})}function cd(e,t){return e[t]!==void 0}function vO(e){var t=e.key,r=e.keyCode;return r>=37&&r<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function os(e,t,r,n,i){if(i===void 0&&(i=!0),r===0)return-1;var a=r-1;(typeof t!="number"||t<0||t>=r)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=tn(e,o,r,n,i);return s===-1?t>=r?-1:t:s}function tn(e,t,r,n,i){var a=n(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o<r;o++)if(!n(o).hasAttribute("disabled"))return o}else for(var s=t-1;s>=0;s--)if(!n(s).hasAttribute("disabled"))return s;return i?e>0?tn(1,0,r,n,!1):tn(-1,r-1,r,n,!1):-1}function ld(e,t,r,n){return n===void 0&&(n=!0),t.some(function(i){return i&&(sd(i,e,r)||n&&sd(i,r.document.activeElement,r))})}var mO=ud(function(e){fd(e).textContent=""},500);function yO(e,t){var r=fd(t);!e||(r.textContent=e,mO(t))}function fd(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var bO=["isInitialMount","highlightedIndex","items","environment"],dd={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function wO(e,t,r){var n=e.props,i=e.type,a={};Object.keys(t).forEach(function(o){_O(o,e,t,r),r[o]!==t[o]&&(a[o]=r[o])}),n.onStateChange&&Object.keys(a).length&&n.onStateChange(ve({type:i},a))}function _O(e,t,r,n){var i=t.props,a=t.type,o="on"+ss(e)+"Change";i[o]&&n[e]!==void 0&&n[e]!==r[e]&&i[o](ve({type:a},n))}function OO(e,t){return t.changes}function PO(e){var t=e.selectedItem,r=e.itemToString;return t?r(t)+" has been selected.":""}var xO=ud(function(e,t){yO(e(),t)},200),IO=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?S.useLayoutEffect:S.useEffect;function SO(e){var t=e.id,r=t===void 0?"downshift-"+pO():t,n=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId,l=S.useRef({labelId:n||r+"-label",menuId:i||r+"-menu",getItemId:a||function(u){return r+"-item-"+u},toggleButtonId:o||r+"-toggle-button",inputId:s||r+"-input"});return l.current}function EO(e,t,r){return e!==void 0?e:r.length===0?-1:r.indexOf(t)}function CO(e){return e?String(e):""}function ss(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function hd(e){var t=S.useRef(e);return t.current=e,t}function MO(e,t,r){var n=S.useRef(),i=S.useRef(),a=S.useCallback(function(y,P){i.current=P,y=as(y,P.props);var w=e(y,P),O=P.props.stateReducer(y,ve({},P,{changes:w}));return O},[e]),o=S.useReducer(a,t),s=o[0],l=o[1],u=hd(r),h=S.useCallback(function(y){return l(ve({props:u.current},y))},[u]),g=i.current;return S.useEffect(function(){g&&n.current&&n.current!==s&&wO(g,as(n.current,g.props),s),n.current=s},[s,r,g]),[s,h]}var rn={itemToString:CO,stateReducer:OO,getA11ySelectionMessage:PO,scrollIntoView:hO,circularNavigation:!1,environment:typeof window=="undefined"?{}:window};function tt(e,t,r){r===void 0&&(r=dd);var n="default"+ss(t);return n in e?e[n]:r[t]}function pi(e,t,r){if(r===void 0&&(r=dd),t in e)return e[t];var n="initial"+ss(t);return n in e?e[n]:tt(e,t,r)}function RO(e){var t=pi(e,"selectedItem"),r=pi(e,"isOpen"),n=pi(e,"highlightedIndex"),i=pi(e,"inputValue");return{highlightedIndex:n<0&&t&&r?e.items.indexOf(t):n,isOpen:r,selectedItem:t,inputValue:i}}function gi(e,t,r,n){var i=e.items,a=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,s=t.selectedItem,l=t.highlightedIndex;return i.length===0?-1:a!==void 0&&l===a?a:o!==void 0?o:s?r===0?i.indexOf(s):os(r,i.indexOf(s),i.length,n,!1):r===0?-1:r<0?i.length-1:0}function AO(e,t,r,n){var i=S.useRef({isMouseDown:!1,isTouchMove:!1});return S.useEffect(function(){var a=function(){i.current.isMouseDown=!0},o=function(g){i.current.isMouseDown=!1,e&&!ld(g.target,t.map(function(y){return y.current}),r)&&n()},s=function(){i.current.isTouchMove=!1},l=function(){i.current.isTouchMove=!0},u=function(g){e&&!i.current.isTouchMove&&!ld(g.target,t.map(function(y){return y.current}),r,!1)&&n()};return r.addEventListener("mousedown",a),r.addEventListener("mouseup",o),r.addEventListener("touchstart",s),r.addEventListener("touchmove",l),r.addEventListener("touchend",u),function(){r.removeEventListener("mousedown",a),r.removeEventListener("mouseup",o),r.removeEventListener("touchstart",s),r.removeEventListener("touchmove",l),r.removeEventListener("touchend",u)}},[e,r]),i}var TO=function(){return od};function pd(e,t,r){var n=r.isInitialMount,i=r.highlightedIndex,a=r.items,o=r.environment,s=Nt(r,bO);S.useEffect(function(){n||xO(function(){return e(ve({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function $O(e){var t=e.highlightedIndex,r=e.isOpen,n=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=S.useRef(!0);return IO(function(){t<0||!r||!Object.keys(n.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var NO=od;function DO(e,t,r){var n=t.type,i=t.props,a;switch(n){case r.ItemMouseMove:a={highlightedIndex:t.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:gi(i,e,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:gi(i,e,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case r.FunctionSetInputValue:a={inputValue:t.inputValue};break;case r.FunctionReset:a={highlightedIndex:tt(i,"highlightedIndex"),isOpen:tt(i,"isOpen"),selectedItem:tt(i,"selectedItem"),inputValue:tt(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return ve({},e,a)}N.array.isRequired,N.func,N.func,N.func,N.bool,N.number,N.number,N.number,N.bool,N.bool,N.bool,N.any,N.any,N.any,N.string,N.string,N.string,N.func,N.string,N.func,N.func,N.func,N.func,N.func,N.shape({addEventListener:N.func,removeEventListener:N.func,document:N.shape({getElementById:N.func,activeElement:N.any,body:N.any})});function FO(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}bn(bn({},rn),{getA11yStatusMessage:FO});var us=0,cs=1,ls=2,fs=3,ds=4,hs=5,ps=6,vi=7,gd=8,vd=9,gs=10,md=11,yd=12,bd=13,wd=14,_d=15,vs=16,Od=17,Pd=18,ms=19,xd=Object.freeze({__proto__:null,InputKeyDownArrowDown:us,InputKeyDownArrowUp:cs,InputKeyDownEscape:ls,InputKeyDownHome:fs,InputKeyDownEnd:ds,InputKeyDownEnter:hs,InputChange:ps,InputBlur:vi,MenuMouseLeave:gd,ItemMouseMove:vd,ItemClick:gs,ToggleButtonClick:md,FunctionToggleMenu:yd,FunctionOpenMenu:bd,FunctionCloseMenu:wd,FunctionSetHighlightedIndex:_d,FunctionSelectItem:vs,FunctionSetInputValue:Od,FunctionReset:Pd,ControlledPropUpdatedSelectedItem:ms});function LO(e){var t=RO(e),r=t.selectedItem,n=t.inputValue;return n===""&&r&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(n=e.itemToString(r)),ve({},t,{inputValue:n})}N.array.isRequired,N.func,N.func,N.func,N.bool,N.number,N.number,N.number,N.bool,N.bool,N.bool,N.any,N.any,N.any,N.string,N.string,N.string,N.string,N.string,N.string,N.func,N.string,N.string,N.func,N.func,N.func,N.func,N.func,N.func,N.shape({addEventListener:N.func,removeEventListener:N.func,document:N.shape({getElementById:N.func,activeElement:N.any,body:N.any})});function jO(e,t,r){var n=S.useRef(),i=MO(e,t,r),a=i[0],o=i[1];return S.useEffect(function(){cd(r,"selectedItem")&&(n.current!==r.selectedItem&&o({type:ms,inputValue:r.itemToString(r.selectedItem)}),n.current=a.selectedItem===n.current?r.selectedItem:a.selectedItem)}),[as(a,r),o]}var WO=ve({},rn,{getA11yStatusMessage:gO,circularNavigation:!0});function zO(e,t){var r=t.type,n=t.props,i=t.shiftKey,a;switch(r){case gs:a={isOpen:tt(n,"isOpen"),highlightedIndex:tt(n,"highlightedIndex"),selectedItem:n.items[t.index],inputValue:n.itemToString(n.items[t.index])};break;case us:e.isOpen?a={highlightedIndex:os(i?5:1,e.highlightedIndex,n.items.length,t.getItemNodeFromIndex,n.circularNavigation)}:a={highlightedIndex:gi(n,e,1,t.getItemNodeFromIndex),isOpen:n.items.length>=0};break;case cs:e.isOpen?a={highlightedIndex:os(i?-5:-1,e.highlightedIndex,n.items.length,t.getItemNodeFromIndex,n.circularNavigation)}:a={highlightedIndex:gi(n,e,-1,t.getItemNodeFromIndex),isOpen:n.items.length>=0};break;case hs:a=ve({},e.isOpen&&e.highlightedIndex>=0&&{selectedItem:n.items[e.highlightedIndex],isOpen:tt(n,"isOpen"),highlightedIndex:tt(n,"highlightedIndex"),inputValue:n.itemToString(n.items[e.highlightedIndex])});break;case ls:a=ve({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case fs:a={highlightedIndex:tn(1,0,n.items.length,t.getItemNodeFromIndex,!1)};break;case ds:a={highlightedIndex:tn(-1,n.items.length-1,n.items.length,t.getItemNodeFromIndex,!1)};break;case vi:a=ve({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:n.items[e.highlightedIndex],inputValue:n.itemToString(n.items[e.highlightedIndex])});break;case ps:a={isOpen:!0,highlightedIndex:tt(n,"highlightedIndex"),inputValue:t.inputValue};break;case vs:a={selectedItem:t.selectedItem,inputValue:n.itemToString(t.selectedItem)};break;case ms:a={inputValue:t.inputValue};break;default:return DO(e,t,xd)}return ve({},e,a)}var HO=["onMouseLeave","refKey","ref"],VO=["item","index","refKey","ref","onMouseMove","onClick","onPress"],UO=["onClick","onPress","refKey","ref"],BO=["onKeyDown","onChange","onInput","onBlur","onChangeText","refKey","ref"],KO=["refKey","ref"];Id.stateChangeTypes=xd;function Id(e){e===void 0&&(e={});var t=ve({},WO,e),r=t.initialIsOpen,n=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,l=t.getA11ySelectionMessage,u=t.itemToString,h=LO(t),g=jO(zO,h,t),y=g[0],P=g[1],w=y.isOpen,O=y.highlightedIndex,d=y.selectedItem,m=y.inputValue,c=S.useRef(null),f=S.useRef({}),v=S.useRef(null),b=S.useRef(null),I=S.useRef(null),R=S.useRef(!0),_=SO(t),L=S.useRef(),A=hd({state:y,props:t}),B=S.useCallback(function(F){return f.current[_.getItemId(F)]},[_]);pd(s,[w,O,m,i],ve({isInitialMount:R.current,previousResultCount:L.current,items:i,environment:o,itemToString:u},y)),pd(l,[d],ve({isInitialMount:R.current,previousResultCount:L.current,items:i,environment:o,itemToString:u},y));var p=$O({menuElement:c.current,highlightedIndex:O,isOpen:w,itemRefs:f,scrollIntoView:a,getItemNodeFromIndex:B});NO({isInitialMount:R.current,props:t,state:y}),S.useEffect(function(){var F=r||n||w;F&&v.current&&v.current.focus()},[]),S.useEffect(function(){R.current||(L.current=i.length)});var U=AO(w,[I,c,b],o,function(){P({type:vi,selectItem:!1})}),z=TO();S.useEffect(function(){R.current=!1},[]),S.useEffect(function(){w||(f.current={})},[w]);var H=S.useMemo(function(){return{ArrowDown:function(W){W.preventDefault(),P({type:us,shiftKey:W.shiftKey,getItemNodeFromIndex:B})},ArrowUp:function(W){W.preventDefault(),P({type:cs,shiftKey:W.shiftKey,getItemNodeFromIndex:B})},Home:function(W){!A.current.state.isOpen||(W.preventDefault(),P({type:fs,getItemNodeFromIndex:B}))},End:function(W){!A.current.state.isOpen||(W.preventDefault(),P({type:ds,getItemNodeFromIndex:B}))},Escape:function(){var W=A.current.state;(W.isOpen||W.inputValue||W.selectedItem||W.highlightedIndex>-1)&&P({type:ls})},Enter:function(W){var G=A.current.state;!G.isOpen||G.highlightedIndex<0||W.which===229||(W.preventDefault(),P({type:hs,getItemNodeFromIndex:B}))}}},[P,A,B]),ae=S.useCallback(function(F){return ve({id:_.labelId,htmlFor:_.inputId},F)},[_]),oe=S.useCallback(function(F,W){var G,Q=F===void 0?{}:F,re=Q.onMouseLeave,K=Q.refKey,de=K===void 0?"ref":K,se=Q.ref,te=Nt(Q,HO),ye=W===void 0?{}:W;return ye.suppressRefError,ve((G={},G[de]=en(se,function(xe){c.current=xe}),G.id=_.menuId,G.role="listbox",G["aria-labelledby"]=_.labelId,G.onMouseLeave=At(re,function(){P({type:gd})}),G),te)},[P,z,_]),q=S.useCallback(function(F){var W,G,Q=F===void 0?{}:F,re=Q.item,K=Q.index,de=Q.refKey,se=de===void 0?"ref":de,te=Q.ref,ye=Q.onMouseMove,xe=Q.onClick;Q.onPress;var Ee=Nt(Q,VO),Fe=A.current,we=Fe.props,Tt=Fe.state,bt=EO(K,re,we.items);if(bt<0)throw new Error("Pass either item or item index in getItemProps!");var an="onClick",st=xe,rt=function(){K!==Tt.highlightedIndex&&(p.current=!1,P({type:vd,index:K}))},qe=function(){P({type:gs,index:K}),v.current&&v.current.focus()};return ve((W={},W[se]=en(te,function(We){We&&(f.current[_.getItemId(bt)]=We)}),W.role="option",W["aria-selected"]=""+(bt===Tt.highlightedIndex),W.id=_.getItemId(bt),W),!Ee.disabled&&(G={onMouseMove:At(ye,rt)},G[an]=At(st,qe),G),Ee)},[P,A,p,_]),ce=S.useCallback(function(F){var W,G=F===void 0?{}:F,Q=G.onClick;G.onPress;var re=G.refKey,K=re===void 0?"ref":re,de=G.ref,se=Nt(G,UO),te=function(){P({type:md}),!A.current.state.isOpen&&v.current&&v.current.focus()};return ve((W={},W[K]=en(de,function(ye){b.current=ye}),W.id=_.toggleButtonId,W.tabIndex=-1,W),!se.disabled&&ve({},{onClick:At(Q,te)}),se)},[P,A,_]),ee=S.useCallback(function(F,W){var G,Q=F===void 0?{}:F,re=Q.onKeyDown,K=Q.onChange,de=Q.onInput,se=Q.onBlur;Q.onChangeText;var te=Q.refKey,ye=te===void 0?"ref":te,xe=Q.ref,Ee=Nt(Q,BO),Fe=W===void 0?{}:W;Fe.suppressRefError;var we=A.current.state,Tt=function(wt){var $t=vO(wt);$t&&H[$t]&&H[$t](wt)},bt=function(wt){P({type:ps,inputValue:wt.target.value})},an=function(){we.isOpen&&!U.current.isMouseDown&&P({type:vi,selectItem:!0})},st="onChange",rt={};if(!Ee.disabled){var qe;rt=(qe={},qe[st]=At(K,de,bt),qe.onKeyDown=At(re,Tt),qe.onBlur=At(se,an),qe)}return ve((G={},G[ye]=en(xe,function(We){v.current=We}),G.id=_.inputId,G["aria-autocomplete"]="list",G["aria-controls"]=_.menuId,G),we.isOpen&&we.highlightedIndex>-1&&{"aria-activedescendant":_.getItemId(we.highlightedIndex)},{"aria-labelledby":_.labelId,autoComplete:"off",value:we.inputValue},rt,Ee)},[P,H,A,U,z,_]),x=S.useCallback(function(F,W){var G,Q=F===void 0?{}:F,re=Q.refKey,K=re===void 0?"ref":re,de=Q.ref,se=Nt(Q,KO),te=W===void 0?{}:W;return te.suppressRefError,ve((G={},G[K]=en(de,function(ye){I.current=ye}),G.role="combobox",G["aria-haspopup"]="listbox",G["aria-owns"]=_.menuId,G["aria-expanded"]=A.current.state.isOpen,G),se)},[A,z,_]),C=S.useCallback(function(){P({type:yd})},[P]),E=S.useCallback(function(){P({type:wd})},[P]),T=S.useCallback(function(){P({type:bd})},[P]),D=S.useCallback(function(F){P({type:_d,highlightedIndex:F})},[P]),k=S.useCallback(function(F){P({type:vs,selectedItem:F})},[P]),j=S.useCallback(function(F){P({type:Od,inputValue:F})},[P]),V=S.useCallback(function(){P({type:Pd})},[P]);return{getItemProps:q,getLabelProps:ae,getMenuProps:oe,getInputProps:ee,getComboboxProps:x,getToggleButtonProps:ce,toggleMenu:C,openMenu:T,closeMenu:E,setHighlightedIndex:D,setInputValue:j,selectItem:k,reset:V,highlightedIndex:O,isOpen:w,selectedItem:d,inputValue:m}}function GO(e){var t=e.removedSelectedItem,r=e.itemToString;return r(t)+" has been removed."}N.array,N.array,N.array,N.func,N.func,N.func,N.number,N.number,N.number,N.func,N.func,N.string,N.string,N.shape({addEventListener:N.func,removeEventListener:N.func,document:N.shape({getElementById:N.func,activeElement:N.any,body:N.any})}),rn.itemToString,rn.stateReducer,rn.environment;function ys(e){let t,r,n;try{t=e[0],[r,n]=e[1].split("_").map(i=>+i)}catch{}return{name:t,hotelId:r,guideId:n}}const nn=["0_0"];function bs(e){const{hotels:t,defaultHotel:r,selectedHotel:n,handleHotelChange:i,subMenuItem:a}=e,{i18n:o}=yt();o&&nn.length===1&&nn.unshift(o.translate("header.no_matches_please_try_again").fetch());const[s,l]=S.useState([]),[u,h]=S.useState(r&&r[0]||""),{subMenus:g}=ie(I=>I.headerInfo),y=Be(),P=g.find(I=>I===a),w=I=>I?I[0]:"",{isOpen:O,getMenuProps:d,getInputProps:m,getComboboxProps:c,highlightedIndex:f,getItemProps:v,closeMenu:b}=Id({items:s,itemToString:w,initialSelectedItem:r,selectedItem:n,initialInputValue:r&&r[0]||"",onSelectedItemChange:({selectedItem:I})=>{Ce.unstable_batchedUpdates(()=>{I&&I!==nn&&y(Pu(I)),y(Wi(a))}),typeof i=="function"&&I&&I!==nn&&i(ys(I)),document.querySelector("#hd-property-input").blur()},onInputValueChange:({inputValue:I})=>{const R=I.toLowerCase(),_=t.filter(L=>R?w(L).toLowerCase().trim().match(`(^|\\s)${R}`):!1);_.length>0?l(_):R?l([nn]):(l([]),b()),h(I)}});return M("ul",{className:ze("col-12","col-lg","py-3","px-lg-0","py-lg-0","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":P}),children:M("li",{children:Z("div",{id:"hd-property-search",children:[M("label",{htmlFor:"hd-property-input",className:"form-label d-lg-none visually-hidden",children:"Select property"}),Z("div",fe(ne({id:"hd-property-input-container"},c()),{children:[M("input",fe(ne({},m({onChange:I=>{const R=I.target.selectionStart;setTimeout(()=>{I.target.setSelectionRange(R,R)},0)},onFocus:I=>{document.querySelector("#hd-property-search").classList.add("hd-active")},onBlur:I=>{document.querySelector("#hd-property-search").classList.remove("hd-active");const{name:R}=ys(n);I.target.value!==R&&h(R)}})),{type:"text",className:"form-control",placeholder:o&&o.translate("header.type_property_name").fetch(),id:"hd-property-input",value:u})),M("ul",fe(ne({className:"mb-0 list-unstyled shadow"},d()),{children:O&&s.map((I,R)=>Z("li",fe(ne({className:ze("px-3","py-3","py-lg-2",{"hd-active":f===R})},v({hotel:I,index:R})),{children:[I[0],I===n&&M(Pe.Tick,{className:"hd-icon hd-icon-tick float-end"})]}),I[1]))})),M(Pe.Search,{className:"hd-icon hd-icon-search"}),M(Pe.Close,{className:"hd-icon hd-icon-close",onClick:()=>{h(""),b()},onMouseDown:I=>{I.preventDefault()}})]}))]})})})}bs.propTypes={hotels:X.exports.arrayOf(X.exports.arrayOf(X.exports.string)).isRequired,defaultHotel:X.exports.arrayOf(X.exports.string),selectedHotel:X.exports.arrayOf(X.exports.string),handleHotelChange:X.exports.func,subMenuItem:X.exports.oneOfType([X.exports.string,X.exports.number]).isRequired},bs.defaultProps={defaultHotel:void 0,selectedHotel:void 0,handleHotelChange:void 0};function kO(e){const{handleHotelChange:t}=e,[r,n]=S.useState(""),i=ie(c=>c.userInfo),{isOpen:a,isMobileOrTablet:o}=ie(c=>c.headerInfo),{propertySelector:s}=ie(c=>c.titleBar),{items:l,defaultHotel:u,selectedHotel:h}=ie(c=>c.hotels),[g,{height:y}]=Oi(),P=Lr(!o||a,{from:{height:0},enter:{height:y},leave:{height:0},update:{height:y},config:fe(ne({},Kt.stiff),{clamp:!0})}),{i18n:w}=yt(),O=Be();S.useEffect(()=>{(async()=>{if(s){let{type:c,items:f=[]}=s;if(c==="fetch")try{f=await(await fetch(f)).json()}catch(b){console.error(b)}const v=f.find(b=>{const[I,R]=b[1].split("_").map(_=>+_);return i.hotelId===I&&i.guideId===R});Ce.unstable_batchedUpdates(()=>{O(_p(f)),v&&(O(Op(v)),O(Pu(v)))})}})()},[s]),S.useEffect(()=>{if(i.group)n(i.group);else if(h){const{name:c}=ys(h);n(c)}},[i,h]);const{label:d}=s||{},m=i.group&&l.length>1;return P((c,f)=>f&&M(kt.div,{className:"col-12 col-lg me-lg-auto px-0 order-lg-3",id:"hd-property",style:o?fe(ne({},c),{display:"block"}):{},children:M("ul",{ref:g,className:"row list-unstyled mx-0 mb-0 hd-nav-first-level",children:M("li",{className:"col-lg-auto align-items-center",onClick:()=>{m&&O(xt(d))},children:Z("div",{className:"row py-lg-0 align-items-center",children:[Z("div",{className:"col col-lg-auto py-2 py-lg-0",id:i.group?"hd-group-property-name":"hd-hotel-property-name",children:[M("span",{className:"ps-lg-3 py-3 py-lg-0 d-block",id:i.group?"hd-group-name":"hd-hotel-name",children:r}),m&&Z("div",{className:"row me-0 d-lg-none align-items-center",children:[Z("div",{className:"col",children:[M("small",{className:"pt-2",children:w&&w.translate(d).fetch()}),M("span",{className:"d-block",id:"hd-property-name",children:h&&h[0]||u&&u[0]})]}),M("div",{className:"col-auto p-2 d-block",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]})]}),m&&M(bs,{hotels:l,defaultHotel:u,selectedHotel:h,handleHotelChange:t,subMenuItem:d})]})})})}))}function QO(){const{i18n:e}=yt(),{subMenus:t}=ie(s=>s.headerInfo),{help:r}=ie(s=>s.titleBar),n=Be();if(!r)return null;const{label:i,children:a}=r,o=t.find(s=>s===i);return Z("li",{className:"col-lg-auto p-0",onClick:()=>{n(xt(i))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[M("div",{className:"col py-2 py-lg-0 px-0",children:Z("span",{className:"ps-lg-3 pe-3 py-2 d-block",children:[M("span",{className:"ps-lg-2",children:e&&e.translate(i).fetch()}),M("span",{className:"d-none d-lg-inline ms-2",children:M(Pe.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})}),M("div",{className:"col-auto p-2 d-block d-lg-none",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),M("ul",{className:ze("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":o}),children:a.map(({href:s,label:l})=>M("li",{children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:M("a",fe(ne({className:"px-lg-4 py-2 d-block",href:s},Zt(s)&&{target:"_blank"}),{children:e&&e.translate(l).fetch()}))})})},Wr()))})]})}function qO(){const{i18n:e}=yt(),{subMenus:t}=ie(l=>l.headerInfo),{user:r}=ie(l=>l.titleBar),{username:n}=ie(l=>l.userInfo),i=Be();if(!r)return null;const{label:a,children:o}=r,s=t.find(l=>l===a);return Z("li",{className:"col-lg-auto p-0",onClick:()=>{i(xt(a))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[Z("div",{className:"col py-2 py-lg-0 px-0",children:[M("small",{className:"pt-2 d-lg-none",children:e&&e.translate(a).fetch()}),Z("span",{className:"ps-lg-3 pe-3 pt-lg-2 pb-2 d-block",children:[M("span",{className:"d-none d-lg-inline",children:M(Pe.User,{className:"hd-icon hd-icon-user"})}),M("span",{className:"ps-lg-2",children:n}),M("span",{className:"d-none d-lg-inline ms-2",children:M(Pe.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})]}),M("div",{className:"col-auto p-2 d-block d-lg-none",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),M("ul",{className:ze("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":s}),children:o.map(({href:l,label:u})=>M("li",{children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:M("a",fe(ne({className:"px-lg-4 py-2 d-block",href:l},Zt(l)&&{target:"_blank"}),{children:e&&e.translate(u).fetch()}))})})},Wr()))})]})}function ws(e){const{handleLanguageChange:t,onLanguageChange:r}=e,[n,i]=S.useState(),[a,o]=S.useState([]),s=ie(w=>w.userLanguage),{languageSelector:l}=ie(w=>w.titleBar),{subMenus:u}=ie(w=>w.headerInfo),h=Be(),{i18n:g}=yt();if(S.useEffect(()=>{if(l){const{children:w}=l;if(Array.isArray(w)){const O=w.map(({code:d,label:m})=>{const c=new Intl.DisplayNames([d],{type:"language"});return{code:d,name:m||c.of(d)}});O.length>0&&o(O)}}},[l]),S.useEffect(()=>{var w;if(s){const O=(w=a.find(({code:d})=>d===s))==null?void 0:w.name;O&&i(O)}},[s,a]),!l)return null;const{label:y}=l,P=u.find(w=>w===y);return Z("li",{className:"col-lg-auto p-0",onClick:()=>{h(xt(y))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[Z("div",{className:"col py-2 py-lg-0 px-0",children:[M("small",{className:"pt-2 d-lg-none",children:g&&g.translate(y).fetch()}),Z("span",{className:"ps-lg-3 pe-3 pt-lg-2 pb-2 d-block",children:[n,M("span",{className:"d-none d-lg-inline ms-2",children:M(Pe.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})]}),M("div",{className:"col-auto p-2 d-block d-lg-none",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),M("ul",{className:ze("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":P}),children:a.map(({code:w,name:O})=>M("li",{children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:M("a",{className:"px-lg-4 py-2 d-block",href:"#",onClick:d=>{d.preventDefault(),d.stopPropagation(),w!==s&&(typeof t=="function"?t(w):typeof r=="function"&&(h(yu(w)),r(w))),h(Wi(y))},children:O},w)})})},Wr()))})]})}ws.propTypes={handleLanguageChange:X.exports.func,onLanguageChange:X.exports.func},ws.defaultProps={handleLanguageChange:void 0,onLanguageChange:void 0};function XO(){const[e,t]=S.useState(),{isOpen:r,subMenus:n,isMobileOrTablet:i}=ie(u=>u.headerInfo),{items:a}=ie(u=>u.menuItems),o=Lr(n.length>0,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:Kt.stiff}),s=Be(),{i18n:l}=yt();return S.useEffect(()=>{var h;const u=((h=a.find(g=>g.id===n[n.length-1]))==null?void 0:h.label)||n[n.length-1];u&&t(u)},[a,n]),!i||!r?null:o((u,h)=>h&&Z(kt.div,{className:"col py-2 py-lg-0",id:"hd-submenu-title-container",style:u,children:[M("span",{id:"hd-submenu-back",onClick:()=>{s(Wi(n[n.length-1]))},children:M(Pe.ArrowLeft,{className:"hd-icon hd-icon-arrow-left"})}),M("span",{className:"ms-3",id:"hd-submenu-title",children:e&&l&&l.translate(e).fetch()})]}))}function _s(e){const{handleHotelChange:t,handleLanguageChange:r,onLanguageChange:n}=e,{isOpen:i,isMobileOrTablet:a}=ie(u=>u.headerInfo),[o,{height:s}]=Oi(),l=Lr(!a||i,{from:{height:0},enter:{height:s},leave:{height:0},update:{height:s},config:fe(ne({},Kt.stiff),{clamp:!0})});return M("div",{className:"container-xxl",id:"hd-top-container",children:Z("div",{className:"row align-items-center pb-lg-2",id:"hd-header-container",children:[M(XO,{}),M(bg,{}),M(J_,{}),M(eO,{}),M(kO,{handleHotelChange:t}),l((u,h)=>h&&M(kt.div,{className:"col-12 col-lg-auto ps-lg-0 align-middle order-lg-5",id:"hd-nav-container-top",style:a?fe(ne({},u),{display:"block"}):{},children:M("nav",{ref:o,id:"hd-top-nav",children:Z("ul",{className:"row list-unstyled mb-0 hd-nav-first-level",children:[M(QO,{}),M(ws,{handleLanguageChange:r,onLanguageChange:n}),M(qO,{})]})})}))]})})}_s.propTypes={handleHotelChange:X.exports.func,handleLanguageChange:X.exports.func,onLanguageChange:X.exports.func},_s.defaultProps={handleHotelChange:void 0,handleLanguageChange:void 0,onLanguageChange:void 0};function YO(){const[e,t]=S.useState([]),{items:r,selectedItem:n}=ie(a=>a.menuItems),{i18n:i}=yt();return S.useEffect(()=>{if(n){const a=[];let o=r.find(s=>s.id===n);do a.push(o),o=r.find(s=>s.id===o.parentId);while(o);t(a.reverse())}},[n]),e.length===0?null:M("div",{className:"container-xxl mb-3",children:M("nav",{"aria-label":"breadcrumb",id:"hd-breadcrumb",children:Z("ol",{className:"breadcrumb mb-0",children:[M("li",{className:"breadcrumb-item active",children:i&&i.translate(e[0].label).fetch()}),e.length>=2&&M("li",{className:"breadcrumb-item active",children:i&&i.translate(e[1].label).fetch()}),e.length===3&&M("li",{className:"breadcrumb-item active",children:i&&i.translate(e[2].label).fetch()})]})})})}function Os(e){const{config:t,userInfo:r,userLanguage:n,i18nFeed:i}=e,{isOpen:a,subMenus:o,isMobileOrTablet:s}=ie(d=>d.headerInfo),{showNotifications:l}=ie(d=>d.notifications),u=S.useRef(null),h=Be();S.useEffect(()=>{n&&h(yu(n)),r&&h(fp(r)),i&&h(vp(i))},[]);const{width:g}=Ch();S.useEffect(()=>{g&&h(pp(g))},[g]);const{headerConfig:y={},error:P}=e1(t),{titleBar:w,menuBar:O}=y;return S.useEffect(()=>{w&&h(cp(w))},[w]),S.useEffect(()=>{O&&h(sp(O))},[O]),S.useEffect(()=>{u&&o.length>0&&(u.current.scrollTop=0)},[o.length]),P?(console.error(P),null):Z("div",{children:[Z("div",{ref:u,id:"hd-container",className:ze("container-fluid","px-0 fixed-top",{"hd-menu-opened":a,"hd-overflow-hidden":o.length>0}),style:fe(ne(ne({},s&&!a&&{overflow:"hidden"}),l&&{overflow:"visible"}),{maxWidth:"none"}),children:[M(_s,ne({},e)),M(Y_,{})]}),M(YO,{})]})}Os.propTypes={userInfo:X.exports.shape({username:X.exports.string,hotelId:X.exports.number,guideId:X.exports.number}),userLanguage:X.exports.string,config:X.exports.string.isRequired,i18nFeed:X.exports.string},Os.defaultProps={userInfo:void 0,userLanguage:"en",i18nFeed:void 0};const Sd=Sp(Os);function JO(e,t){Ce.render(M(Sd,ne({},t)),e)}_e.Header=Sd,_e.renderHeader=JO,Object.defineProperties(_e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
109
+ */var fi=60103,di=60106,Kr=60107,Gr=60108,kr=60114,Qr=60109,qr=60110,Xr=60112,Yr=60113,ns=60120,Jr=60115,Zr=60116,Zf=60121,ed=60122,td=60117,rd=60129,nd=60131;if(typeof Symbol=="function"&&Symbol.for){var Se=Symbol.for;fi=Se("react.element"),di=Se("react.portal"),Kr=Se("react.fragment"),Gr=Se("react.strict_mode"),kr=Se("react.profiler"),Qr=Se("react.provider"),qr=Se("react.context"),Xr=Se("react.forward_ref"),Yr=Se("react.suspense"),ns=Se("react.suspense_list"),Jr=Se("react.memo"),Zr=Se("react.lazy"),Zf=Se("react.block"),ed=Se("react.server.block"),td=Se("react.fundamental"),rd=Se("react.debug_trace_mode"),nd=Se("react.legacy_hidden")}function Qe(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case fi:switch(e=e.type,e){case Kr:case kr:case Gr:case Yr:case ns:return e;default:switch(e=e&&e.$$typeof,e){case qr:case Xr:case Zr:case Jr:case Qr:return e;default:return t}}case di:return t}}}var tO=Qr,rO=fi,nO=Xr,iO=Kr,aO=Zr,oO=Jr,sO=di,uO=kr,cO=Gr,lO=Yr;pe.ContextConsumer=qr,pe.ContextProvider=tO,pe.Element=rO,pe.ForwardRef=nO,pe.Fragment=iO,pe.Lazy=aO,pe.Memo=oO,pe.Portal=sO,pe.Profiler=uO,pe.StrictMode=cO,pe.Suspense=lO,pe.isAsyncMode=function(){return!1},pe.isConcurrentMode=function(){return!1},pe.isContextConsumer=function(e){return Qe(e)===qr},pe.isContextProvider=function(e){return Qe(e)===Qr},pe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===fi},pe.isForwardRef=function(e){return Qe(e)===Xr},pe.isFragment=function(e){return Qe(e)===Kr},pe.isLazy=function(e){return Qe(e)===Zr},pe.isMemo=function(e){return Qe(e)===Jr},pe.isPortal=function(e){return Qe(e)===di},pe.isProfiler=function(e){return Qe(e)===kr},pe.isStrictMode=function(e){return Qe(e)===Gr},pe.isSuspense=function(e){return Qe(e)===Yr},pe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Kr||e===kr||e===rd||e===Gr||e===Yr||e===ns||e===nd||typeof e=="object"&&e!==null&&(e.$$typeof===Zr||e.$$typeof===Jr||e.$$typeof===Qr||e.$$typeof===qr||e.$$typeof===Xr||e.$$typeof===td||e.$$typeof===Zf||e[0]===ed)},pe.typeOf=Qe;function id(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function ad(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function is(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return ad(r.overflowY,t)||ad(r.overflowX,t)||function(n){var i=function(a){if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}}(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)}(e)}return!1}function hi(e,t,r,n,i,a,o,s){return a<e&&o>t||a>e&&o<t?0:a<=e&&s<=r||o>=t&&s>=r?a-e-n:o>t&&s<r||a<e&&s>r?o-t+i:0}function fO(e,t){var r=window,n=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,s=t.skipOverflowHiddenElements,l=typeof o=="function"?o:function(W){return W!==o};if(!id(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,h=[],g=e;id(g)&&l(g);){if((g=g.parentElement)===u){h.push(g);break}g!=null&&g===document.body&&is(g)&&!is(document.documentElement)||g!=null&&is(g,s)&&h.push(g)}for(var y=r.visualViewport?r.visualViewport.width:innerWidth,P=r.visualViewport?r.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,O=window.scrollY||pageYOffset,d=e.getBoundingClientRect(),m=d.height,c=d.width,f=d.top,v=d.right,b=d.bottom,I=d.left,R=i==="start"||i==="nearest"?f:i==="end"?b:f+m/2,_=a==="center"?I+c/2:a==="end"?v:I,L=[],A=0;A<h.length;A++){var B=h[A],p=B.getBoundingClientRect(),U=p.height,z=p.width,H=p.top,ae=p.right,oe=p.bottom,q=p.left;if(n==="if-needed"&&f>=0&&I>=0&&b<=P&&v<=y&&f>=H&&b<=oe&&I>=q&&v<=ae)return L;var ce=getComputedStyle(B),ee=parseInt(ce.borderLeftWidth,10),x=parseInt(ce.borderTopWidth,10),C=parseInt(ce.borderRightWidth,10),E=parseInt(ce.borderBottomWidth,10),T=0,D=0,k="offsetWidth"in B?B.offsetWidth-B.clientWidth-ee-C:0,j="offsetHeight"in B?B.offsetHeight-B.clientHeight-x-E:0;if(u===B)T=i==="start"?R:i==="end"?R-P:i==="nearest"?hi(O,O+P,P,x,E,O+R,O+R+m,m):R-P/2,D=a==="start"?_:a==="center"?_-y/2:a==="end"?_-y:hi(w,w+y,y,ee,C,w+_,w+_+c,c),T=Math.max(0,T+O),D=Math.max(0,D+w);else{T=i==="start"?R-H-x:i==="end"?R-oe+E+j:i==="nearest"?hi(H,oe,U,x,E+j,R,R+m,m):R-(H+U/2)+j/2,D=a==="start"?_-q-ee:a==="center"?_-(q+z/2)+k/2:a==="end"?_-ae+C+k:hi(q,ae,z,ee,C+k,_,_+c,c);var V=B.scrollLeft,F=B.scrollTop;R+=F-(T=Math.max(0,Math.min(F+T,B.scrollHeight-U+j))),_+=V-(D=Math.max(0,Math.min(V+D,B.scrollWidth-z+k)))}L.push({el:B,top:T,left:D})}return L}var dO=0;function od(){}function hO(e,t){if(!!e){var r=fO(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});r.forEach(function(n){var i=n.el,a=n.top,o=n.left;i.scrollTop=a,i.scrollLeft=o})}}function sd(e,t,r){var n=e===t||t instanceof r.Node&&e.contains&&e.contains(t);return n}function ud(e,t){var r;function n(){r&&clearTimeout(r)}function i(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];n(),r=setTimeout(function(){r=null,e.apply(void 0,o)},t)}return i.cancel=n,i}function At(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return t.some(function(s){return s&&s.apply(void 0,[n].concat(a)),n.preventDownshiftDefault||n.hasOwnProperty("nativeEvent")&&n.nativeEvent.preventDownshiftDefault})}}function en(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){t.forEach(function(i){typeof i=="function"?i(n):i&&(i.current=n)})}}function pO(){return String(dO++)}function gO(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function as(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=cd(t,n)?t[n]:e[n],r},{})}function cd(e,t){return e[t]!==void 0}function vO(e){var t=e.key,r=e.keyCode;return r>=37&&r<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function os(e,t,r,n,i){if(i===void 0&&(i=!0),r===0)return-1;var a=r-1;(typeof t!="number"||t<0||t>=r)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=tn(e,o,r,n,i);return s===-1?t>=r?-1:t:s}function tn(e,t,r,n,i){var a=n(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o<r;o++)if(!n(o).hasAttribute("disabled"))return o}else for(var s=t-1;s>=0;s--)if(!n(s).hasAttribute("disabled"))return s;return i?e>0?tn(1,0,r,n,!1):tn(-1,r-1,r,n,!1):-1}function ld(e,t,r,n){return n===void 0&&(n=!0),t.some(function(i){return i&&(sd(i,e,r)||n&&sd(i,r.document.activeElement,r))})}var mO=ud(function(e){fd(e).textContent=""},500);function yO(e,t){var r=fd(t);!e||(r.textContent=e,mO(t))}function fd(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var bO=["isInitialMount","highlightedIndex","items","environment"],dd={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function wO(e,t,r){var n=e.props,i=e.type,a={};Object.keys(t).forEach(function(o){_O(o,e,t,r),r[o]!==t[o]&&(a[o]=r[o])}),n.onStateChange&&Object.keys(a).length&&n.onStateChange(ve({type:i},a))}function _O(e,t,r,n){var i=t.props,a=t.type,o="on"+ss(e)+"Change";i[o]&&n[e]!==void 0&&n[e]!==r[e]&&i[o](ve({type:a},n))}function OO(e,t){return t.changes}function PO(e){var t=e.selectedItem,r=e.itemToString;return t?r(t)+" has been selected.":""}var xO=ud(function(e,t){yO(e(),t)},200),IO=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?S.useLayoutEffect:S.useEffect;function SO(e){var t=e.id,r=t===void 0?"downshift-"+pO():t,n=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId,l=S.useRef({labelId:n||r+"-label",menuId:i||r+"-menu",getItemId:a||function(u){return r+"-item-"+u},toggleButtonId:o||r+"-toggle-button",inputId:s||r+"-input"});return l.current}function EO(e,t,r){return e!==void 0?e:r.length===0?-1:r.indexOf(t)}function CO(e){return e?String(e):""}function ss(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function hd(e){var t=S.useRef(e);return t.current=e,t}function MO(e,t,r){var n=S.useRef(),i=S.useRef(),a=S.useCallback(function(y,P){i.current=P,y=as(y,P.props);var w=e(y,P),O=P.props.stateReducer(y,ve({},P,{changes:w}));return O},[e]),o=S.useReducer(a,t),s=o[0],l=o[1],u=hd(r),h=S.useCallback(function(y){return l(ve({props:u.current},y))},[u]),g=i.current;return S.useEffect(function(){g&&n.current&&n.current!==s&&wO(g,as(n.current,g.props),s),n.current=s},[s,r,g]),[s,h]}var rn={itemToString:CO,stateReducer:OO,getA11ySelectionMessage:PO,scrollIntoView:hO,circularNavigation:!1,environment:typeof window=="undefined"?{}:window};function tt(e,t,r){r===void 0&&(r=dd);var n="default"+ss(t);return n in e?e[n]:r[t]}function pi(e,t,r){if(r===void 0&&(r=dd),t in e)return e[t];var n="initial"+ss(t);return n in e?e[n]:tt(e,t,r)}function RO(e){var t=pi(e,"selectedItem"),r=pi(e,"isOpen"),n=pi(e,"highlightedIndex"),i=pi(e,"inputValue");return{highlightedIndex:n<0&&t&&r?e.items.indexOf(t):n,isOpen:r,selectedItem:t,inputValue:i}}function gi(e,t,r,n){var i=e.items,a=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,s=t.selectedItem,l=t.highlightedIndex;return i.length===0?-1:a!==void 0&&l===a?a:o!==void 0?o:s?r===0?i.indexOf(s):os(r,i.indexOf(s),i.length,n,!1):r===0?-1:r<0?i.length-1:0}function AO(e,t,r,n){var i=S.useRef({isMouseDown:!1,isTouchMove:!1});return S.useEffect(function(){var a=function(){i.current.isMouseDown=!0},o=function(g){i.current.isMouseDown=!1,e&&!ld(g.target,t.map(function(y){return y.current}),r)&&n()},s=function(){i.current.isTouchMove=!1},l=function(){i.current.isTouchMove=!0},u=function(g){e&&!i.current.isTouchMove&&!ld(g.target,t.map(function(y){return y.current}),r,!1)&&n()};return r.addEventListener("mousedown",a),r.addEventListener("mouseup",o),r.addEventListener("touchstart",s),r.addEventListener("touchmove",l),r.addEventListener("touchend",u),function(){r.removeEventListener("mousedown",a),r.removeEventListener("mouseup",o),r.removeEventListener("touchstart",s),r.removeEventListener("touchmove",l),r.removeEventListener("touchend",u)}},[e,r]),i}var TO=function(){return od};function pd(e,t,r){var n=r.isInitialMount,i=r.highlightedIndex,a=r.items,o=r.environment,s=Nt(r,bO);S.useEffect(function(){n||xO(function(){return e(ve({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function $O(e){var t=e.highlightedIndex,r=e.isOpen,n=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=S.useRef(!0);return IO(function(){t<0||!r||!Object.keys(n.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var NO=od;function DO(e,t,r){var n=t.type,i=t.props,a;switch(n){case r.ItemMouseMove:a={highlightedIndex:t.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:gi(i,e,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:gi(i,e,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case r.FunctionSetInputValue:a={inputValue:t.inputValue};break;case r.FunctionReset:a={highlightedIndex:tt(i,"highlightedIndex"),isOpen:tt(i,"isOpen"),selectedItem:tt(i,"selectedItem"),inputValue:tt(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return ve({},e,a)}N.array.isRequired,N.func,N.func,N.func,N.bool,N.number,N.number,N.number,N.bool,N.bool,N.bool,N.any,N.any,N.any,N.string,N.string,N.string,N.func,N.string,N.func,N.func,N.func,N.func,N.func,N.shape({addEventListener:N.func,removeEventListener:N.func,document:N.shape({getElementById:N.func,activeElement:N.any,body:N.any})});function FO(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}bn(bn({},rn),{getA11yStatusMessage:FO});var us=0,cs=1,ls=2,fs=3,ds=4,hs=5,ps=6,vi=7,gd=8,vd=9,gs=10,md=11,yd=12,bd=13,wd=14,_d=15,vs=16,Od=17,Pd=18,ms=19,xd=Object.freeze({__proto__:null,InputKeyDownArrowDown:us,InputKeyDownArrowUp:cs,InputKeyDownEscape:ls,InputKeyDownHome:fs,InputKeyDownEnd:ds,InputKeyDownEnter:hs,InputChange:ps,InputBlur:vi,MenuMouseLeave:gd,ItemMouseMove:vd,ItemClick:gs,ToggleButtonClick:md,FunctionToggleMenu:yd,FunctionOpenMenu:bd,FunctionCloseMenu:wd,FunctionSetHighlightedIndex:_d,FunctionSelectItem:vs,FunctionSetInputValue:Od,FunctionReset:Pd,ControlledPropUpdatedSelectedItem:ms});function LO(e){var t=RO(e),r=t.selectedItem,n=t.inputValue;return n===""&&r&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(n=e.itemToString(r)),ve({},t,{inputValue:n})}N.array.isRequired,N.func,N.func,N.func,N.bool,N.number,N.number,N.number,N.bool,N.bool,N.bool,N.any,N.any,N.any,N.string,N.string,N.string,N.string,N.string,N.string,N.func,N.string,N.string,N.func,N.func,N.func,N.func,N.func,N.func,N.shape({addEventListener:N.func,removeEventListener:N.func,document:N.shape({getElementById:N.func,activeElement:N.any,body:N.any})});function jO(e,t,r){var n=S.useRef(),i=MO(e,t,r),a=i[0],o=i[1];return S.useEffect(function(){cd(r,"selectedItem")&&(n.current!==r.selectedItem&&o({type:ms,inputValue:r.itemToString(r.selectedItem)}),n.current=a.selectedItem===n.current?r.selectedItem:a.selectedItem)}),[as(a,r),o]}var WO=ve({},rn,{getA11yStatusMessage:gO,circularNavigation:!0});function zO(e,t){var r=t.type,n=t.props,i=t.shiftKey,a;switch(r){case gs:a={isOpen:tt(n,"isOpen"),highlightedIndex:tt(n,"highlightedIndex"),selectedItem:n.items[t.index],inputValue:n.itemToString(n.items[t.index])};break;case us:e.isOpen?a={highlightedIndex:os(i?5:1,e.highlightedIndex,n.items.length,t.getItemNodeFromIndex,n.circularNavigation)}:a={highlightedIndex:gi(n,e,1,t.getItemNodeFromIndex),isOpen:n.items.length>=0};break;case cs:e.isOpen?a={highlightedIndex:os(i?-5:-1,e.highlightedIndex,n.items.length,t.getItemNodeFromIndex,n.circularNavigation)}:a={highlightedIndex:gi(n,e,-1,t.getItemNodeFromIndex),isOpen:n.items.length>=0};break;case hs:a=ve({},e.isOpen&&e.highlightedIndex>=0&&{selectedItem:n.items[e.highlightedIndex],isOpen:tt(n,"isOpen"),highlightedIndex:tt(n,"highlightedIndex"),inputValue:n.itemToString(n.items[e.highlightedIndex])});break;case ls:a=ve({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case fs:a={highlightedIndex:tn(1,0,n.items.length,t.getItemNodeFromIndex,!1)};break;case ds:a={highlightedIndex:tn(-1,n.items.length-1,n.items.length,t.getItemNodeFromIndex,!1)};break;case vi:a=ve({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:n.items[e.highlightedIndex],inputValue:n.itemToString(n.items[e.highlightedIndex])});break;case ps:a={isOpen:!0,highlightedIndex:tt(n,"highlightedIndex"),inputValue:t.inputValue};break;case vs:a={selectedItem:t.selectedItem,inputValue:n.itemToString(t.selectedItem)};break;case ms:a={inputValue:t.inputValue};break;default:return DO(e,t,xd)}return ve({},e,a)}var HO=["onMouseLeave","refKey","ref"],VO=["item","index","refKey","ref","onMouseMove","onClick","onPress"],UO=["onClick","onPress","refKey","ref"],BO=["onKeyDown","onChange","onInput","onBlur","onChangeText","refKey","ref"],KO=["refKey","ref"];Id.stateChangeTypes=xd;function Id(e){e===void 0&&(e={});var t=ve({},WO,e),r=t.initialIsOpen,n=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,l=t.getA11ySelectionMessage,u=t.itemToString,h=LO(t),g=jO(zO,h,t),y=g[0],P=g[1],w=y.isOpen,O=y.highlightedIndex,d=y.selectedItem,m=y.inputValue,c=S.useRef(null),f=S.useRef({}),v=S.useRef(null),b=S.useRef(null),I=S.useRef(null),R=S.useRef(!0),_=SO(t),L=S.useRef(),A=hd({state:y,props:t}),B=S.useCallback(function(F){return f.current[_.getItemId(F)]},[_]);pd(s,[w,O,m,i],ve({isInitialMount:R.current,previousResultCount:L.current,items:i,environment:o,itemToString:u},y)),pd(l,[d],ve({isInitialMount:R.current,previousResultCount:L.current,items:i,environment:o,itemToString:u},y));var p=$O({menuElement:c.current,highlightedIndex:O,isOpen:w,itemRefs:f,scrollIntoView:a,getItemNodeFromIndex:B});NO({isInitialMount:R.current,props:t,state:y}),S.useEffect(function(){var F=r||n||w;F&&v.current&&v.current.focus()},[]),S.useEffect(function(){R.current||(L.current=i.length)});var U=AO(w,[I,c,b],o,function(){P({type:vi,selectItem:!1})}),z=TO();S.useEffect(function(){R.current=!1},[]),S.useEffect(function(){w||(f.current={})},[w]);var H=S.useMemo(function(){return{ArrowDown:function(W){W.preventDefault(),P({type:us,shiftKey:W.shiftKey,getItemNodeFromIndex:B})},ArrowUp:function(W){W.preventDefault(),P({type:cs,shiftKey:W.shiftKey,getItemNodeFromIndex:B})},Home:function(W){!A.current.state.isOpen||(W.preventDefault(),P({type:fs,getItemNodeFromIndex:B}))},End:function(W){!A.current.state.isOpen||(W.preventDefault(),P({type:ds,getItemNodeFromIndex:B}))},Escape:function(){var W=A.current.state;(W.isOpen||W.inputValue||W.selectedItem||W.highlightedIndex>-1)&&P({type:ls})},Enter:function(W){var G=A.current.state;!G.isOpen||G.highlightedIndex<0||W.which===229||(W.preventDefault(),P({type:hs,getItemNodeFromIndex:B}))}}},[P,A,B]),ae=S.useCallback(function(F){return ve({id:_.labelId,htmlFor:_.inputId},F)},[_]),oe=S.useCallback(function(F,W){var G,Q=F===void 0?{}:F,re=Q.onMouseLeave,K=Q.refKey,de=K===void 0?"ref":K,se=Q.ref,te=Nt(Q,HO),ye=W===void 0?{}:W;return ye.suppressRefError,ve((G={},G[de]=en(se,function(xe){c.current=xe}),G.id=_.menuId,G.role="listbox",G["aria-labelledby"]=_.labelId,G.onMouseLeave=At(re,function(){P({type:gd})}),G),te)},[P,z,_]),q=S.useCallback(function(F){var W,G,Q=F===void 0?{}:F,re=Q.item,K=Q.index,de=Q.refKey,se=de===void 0?"ref":de,te=Q.ref,ye=Q.onMouseMove,xe=Q.onClick;Q.onPress;var Ee=Nt(Q,VO),Fe=A.current,we=Fe.props,Tt=Fe.state,bt=EO(K,re,we.items);if(bt<0)throw new Error("Pass either item or item index in getItemProps!");var an="onClick",st=xe,rt=function(){K!==Tt.highlightedIndex&&(p.current=!1,P({type:vd,index:K}))},qe=function(){P({type:gs,index:K}),v.current&&v.current.focus()};return ve((W={},W[se]=en(te,function(We){We&&(f.current[_.getItemId(bt)]=We)}),W.role="option",W["aria-selected"]=""+(bt===Tt.highlightedIndex),W.id=_.getItemId(bt),W),!Ee.disabled&&(G={onMouseMove:At(ye,rt)},G[an]=At(st,qe),G),Ee)},[P,A,p,_]),ce=S.useCallback(function(F){var W,G=F===void 0?{}:F,Q=G.onClick;G.onPress;var re=G.refKey,K=re===void 0?"ref":re,de=G.ref,se=Nt(G,UO),te=function(){P({type:md}),!A.current.state.isOpen&&v.current&&v.current.focus()};return ve((W={},W[K]=en(de,function(ye){b.current=ye}),W.id=_.toggleButtonId,W.tabIndex=-1,W),!se.disabled&&ve({},{onClick:At(Q,te)}),se)},[P,A,_]),ee=S.useCallback(function(F,W){var G,Q=F===void 0?{}:F,re=Q.onKeyDown,K=Q.onChange,de=Q.onInput,se=Q.onBlur;Q.onChangeText;var te=Q.refKey,ye=te===void 0?"ref":te,xe=Q.ref,Ee=Nt(Q,BO),Fe=W===void 0?{}:W;Fe.suppressRefError;var we=A.current.state,Tt=function(wt){var $t=vO(wt);$t&&H[$t]&&H[$t](wt)},bt=function(wt){P({type:ps,inputValue:wt.target.value})},an=function(){we.isOpen&&!U.current.isMouseDown&&P({type:vi,selectItem:!0})},st="onChange",rt={};if(!Ee.disabled){var qe;rt=(qe={},qe[st]=At(K,de,bt),qe.onKeyDown=At(re,Tt),qe.onBlur=At(se,an),qe)}return ve((G={},G[ye]=en(xe,function(We){v.current=We}),G.id=_.inputId,G["aria-autocomplete"]="list",G["aria-controls"]=_.menuId,G),we.isOpen&&we.highlightedIndex>-1&&{"aria-activedescendant":_.getItemId(we.highlightedIndex)},{"aria-labelledby":_.labelId,autoComplete:"off",value:we.inputValue},rt,Ee)},[P,H,A,U,z,_]),x=S.useCallback(function(F,W){var G,Q=F===void 0?{}:F,re=Q.refKey,K=re===void 0?"ref":re,de=Q.ref,se=Nt(Q,KO),te=W===void 0?{}:W;return te.suppressRefError,ve((G={},G[K]=en(de,function(ye){I.current=ye}),G.role="combobox",G["aria-haspopup"]="listbox",G["aria-owns"]=_.menuId,G["aria-expanded"]=A.current.state.isOpen,G),se)},[A,z,_]),C=S.useCallback(function(){P({type:yd})},[P]),E=S.useCallback(function(){P({type:wd})},[P]),T=S.useCallback(function(){P({type:bd})},[P]),D=S.useCallback(function(F){P({type:_d,highlightedIndex:F})},[P]),k=S.useCallback(function(F){P({type:vs,selectedItem:F})},[P]),j=S.useCallback(function(F){P({type:Od,inputValue:F})},[P]),V=S.useCallback(function(){P({type:Pd})},[P]);return{getItemProps:q,getLabelProps:ae,getMenuProps:oe,getInputProps:ee,getComboboxProps:x,getToggleButtonProps:ce,toggleMenu:C,openMenu:T,closeMenu:E,setHighlightedIndex:D,setInputValue:j,selectItem:k,reset:V,highlightedIndex:O,isOpen:w,selectedItem:d,inputValue:m}}function GO(e){var t=e.removedSelectedItem,r=e.itemToString;return r(t)+" has been removed."}N.array,N.array,N.array,N.func,N.func,N.func,N.number,N.number,N.number,N.func,N.func,N.string,N.string,N.shape({addEventListener:N.func,removeEventListener:N.func,document:N.shape({getElementById:N.func,activeElement:N.any,body:N.any})}),rn.itemToString,rn.stateReducer,rn.environment;function ys(e){let t,r,n;try{t=e[0],[r,n]=e[1].split("_").map(i=>+i)}catch{}return{name:t,hotelId:r,guideId:n}}const nn=["0_0"];function bs(e){const{hotels:t,defaultHotel:r,selectedHotel:n,handleHotelChange:i,subMenuItem:a}=e,{i18n:o}=yt();o&&nn.length===1&&nn.unshift(o.translate("header.no_matches_please_try_again").fetch());const[s,l]=S.useState([]),[u,h]=S.useState(r&&r[0]||""),{subMenus:g}=ie(I=>I.headerInfo),y=Be(),P=g.find(I=>I===a),w=I=>I?I[0]:"",{isOpen:O,getMenuProps:d,getInputProps:m,getComboboxProps:c,highlightedIndex:f,getItemProps:v,closeMenu:b}=Id({items:s,itemToString:w,initialSelectedItem:r,selectedItem:n,initialInputValue:r&&r[0]||"",onSelectedItemChange:({selectedItem:I})=>{Ce.unstable_batchedUpdates(()=>{I&&I!==nn&&y(Pu(I)),y(Wi(a))}),typeof i=="function"&&I&&I!==nn&&i(ys(I)),document.querySelector("#hd-property-input").blur()},onInputValueChange:({inputValue:I})=>{const R=I.toLowerCase(),_=t.filter(L=>R?w(L).toLowerCase().trim().match(`(^|\\s)${R}`):!1);_.length>0?l(_):R?l([nn]):(l([]),b()),h(I)}});return M("ul",{className:ze("col-12","col-lg","py-3","px-lg-0","py-lg-0","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":P}),children:M("li",{children:Z("div",{id:"hd-property-search",children:[M("label",{htmlFor:"hd-property-input",className:"form-label d-lg-none visually-hidden",children:"Select property"}),Z("div",fe(ne({id:"hd-property-input-container"},c()),{children:[M("input",fe(ne({},m({onChange:I=>{const R=I.target.selectionStart;setTimeout(()=>{I.target.setSelectionRange(R,R)},0)},onFocus:I=>{document.querySelector("#hd-property-search").classList.add("hd-active")},onBlur:I=>{document.querySelector("#hd-property-search").classList.remove("hd-active");const{name:R}=ys(n);I.target.value!==R&&h(R)}})),{type:"text",className:"form-control",placeholder:o&&o.translate("header.type_property_name").fetch(),id:"hd-property-input",value:u})),M("ul",fe(ne({className:"mb-0 list-unstyled shadow"},d()),{children:O&&s.map((I,R)=>Z("li",fe(ne({className:ze("px-3","py-3","py-lg-2",{"hd-active":f===R})},v({hotel:I,index:R})),{children:[I[0],I===n&&M(Pe.Tick,{className:"hd-icon hd-icon-tick float-end"})]}),I[1]))})),M(Pe.Search,{className:"hd-icon hd-icon-search"}),M(Pe.Close,{className:"hd-icon hd-icon-close",onClick:()=>{h(""),b()},onMouseDown:I=>{I.preventDefault()}})]}))]})})})}bs.propTypes={hotels:X.exports.arrayOf(X.exports.arrayOf(X.exports.string)).isRequired,defaultHotel:X.exports.arrayOf(X.exports.string),selectedHotel:X.exports.arrayOf(X.exports.string),handleHotelChange:X.exports.func,subMenuItem:X.exports.oneOfType([X.exports.string,X.exports.number]).isRequired},bs.defaultProps={defaultHotel:void 0,selectedHotel:void 0,handleHotelChange:void 0};function kO(e){const{handleHotelChange:t}=e,[r,n]=S.useState(""),i=ie(c=>c.userInfo),{isOpen:a,isMobileOrTablet:o}=ie(c=>c.headerInfo),{propertySelector:s}=ie(c=>c.titleBar),{items:l,defaultHotel:u,selectedHotel:h}=ie(c=>c.hotels),[g,{height:y}]=Oi(),P=Lr(!o||a,{from:{height:0},enter:{height:y},leave:{height:0},update:{height:y},config:fe(ne({},Kt.stiff),{clamp:!0})}),{i18n:w}=yt(),O=Be();S.useEffect(()=>{(async()=>{if(s){let{type:c,items:f=[]}=s;if(c==="fetch")try{f=await(await fetch(f)).json()}catch(b){console.error(b)}const v=f.find(b=>{const[I,R]=b[1].split("_").map(_=>+_);return i.hotelId===I&&i.guideId===R});Ce.unstable_batchedUpdates(()=>{O(_p(f)),v&&(O(Op(v)),O(Pu(v)))})}})()},[s]),S.useEffect(()=>{if(i.group)n(i.group);else if(h){const{name:c}=ys(h);n(c)}},[i,h]);const{label:d}=s||{},m=i.group&&l.length>1;return P((c,f)=>f&&M(kt.div,{className:"col-12 col-lg me-lg-auto px-0 order-lg-3",id:"hd-property",style:o?fe(ne({},c),{display:"block"}):{},children:M("ul",{ref:g,className:"row list-unstyled mx-0 mb-0 hd-nav-first-level",children:M("li",{className:"col-lg-auto align-items-center",onClick:()=>{m&&O(xt(d))},children:Z("div",{className:"row py-lg-0 align-items-center",children:[Z("div",{className:"col col-lg-auto py-2 py-lg-0",id:i.group?"hd-group-property-name":"hd-hotel-property-name",children:[M("span",{className:"ps-lg-3 py-3 py-lg-0 d-block",id:i.group?"hd-group-name":"hd-hotel-name",children:r}),m&&Z("div",{className:"row me-0 d-lg-none align-items-center",children:[Z("div",{className:"col",children:[M("small",{className:"pt-2",children:w&&w.translate(d).fetch()}),M("span",{className:"d-block",id:"hd-property-name",children:h&&h[0]||u&&u[0]})]}),M("div",{className:"col-auto p-2 d-block",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]})]}),m&&M(bs,{hotels:l,defaultHotel:u,selectedHotel:h,handleHotelChange:t,subMenuItem:d})]})})})}))}function QO(){const{i18n:e}=yt(),{subMenus:t}=ie(s=>s.headerInfo),{help:r}=ie(s=>s.titleBar),n=Be();if(!r)return null;const{label:i,children:a}=r,o=t.find(s=>s===i);return Z("li",{className:"col-lg-auto p-0",onClick:()=>{n(xt(i))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[M("div",{className:"col py-2 py-lg-0 px-0",children:Z("span",{className:"ps-lg-3 pe-3 py-2 d-block",children:[M("span",{className:"ps-lg-2",children:e&&e.translate(i).fetch()}),M("span",{className:"d-none d-lg-inline ms-2",children:M(Pe.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})}),M("div",{className:"col-auto p-2 d-block d-lg-none",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),Z("ul",{className:ze("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":o}),children:[a.map(({href:s,label:l})=>M("li",{children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:M("a",fe(ne({className:"px-lg-4 py-2 d-block",href:s},Zt(s)&&{target:"_blank"}),{children:e&&e.translate(l).fetch()}))})})},Wr())),M("li",{children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:Z("a",{className:"px-lg-4 py-2 d-block",href:"mailto:support@bookassist.com",children:[e&&e.translate("bex.contact_support_team").fetch(),":",M("br",{}),"support@bookassist.com"]})})})})]})]})}function qO(){const{i18n:e}=yt(),{subMenus:t}=ie(l=>l.headerInfo),{user:r}=ie(l=>l.titleBar),{username:n}=ie(l=>l.userInfo),i=Be();if(!r)return null;const{label:a,children:o}=r,s=t.find(l=>l===a);return Z("li",{className:"col-lg-auto p-0",onClick:()=>{i(xt(a))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[Z("div",{className:"col py-2 py-lg-0 px-0",children:[M("small",{className:"pt-2 d-lg-none",children:e&&e.translate(a).fetch()}),Z("span",{className:"ps-lg-3 pe-3 pt-lg-2 pb-2 d-block",children:[M("span",{className:"d-none d-lg-inline",children:M(Pe.User,{className:"hd-icon hd-icon-user"})}),M("span",{className:"ps-lg-2",children:n}),M("span",{className:"d-none d-lg-inline ms-2",children:M(Pe.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})]}),M("div",{className:"col-auto p-2 d-block d-lg-none",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),M("ul",{className:ze("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":s}),children:o.map(({href:l,label:u})=>M("li",{children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:M("a",fe(ne({className:"px-lg-4 py-2 d-block",href:l},Zt(l)&&{target:"_blank"}),{children:e&&e.translate(u).fetch()}))})})},Wr()))})]})}function ws(e){const{handleLanguageChange:t,onLanguageChange:r}=e,[n,i]=S.useState(),[a,o]=S.useState([]),s=ie(w=>w.userLanguage),{languageSelector:l}=ie(w=>w.titleBar),{subMenus:u}=ie(w=>w.headerInfo),h=Be(),{i18n:g}=yt();if(S.useEffect(()=>{if(l){const{children:w}=l;if(Array.isArray(w)){const O=w.map(({code:d,label:m})=>{const c=new Intl.DisplayNames([d],{type:"language"});return{code:d,name:m||c.of(d)}});O.length>0&&o(O)}}},[l]),S.useEffect(()=>{var w;if(s){const O=(w=a.find(({code:d})=>d===s))==null?void 0:w.name;O&&i(O)}},[s,a]),!l)return null;const{label:y}=l,P=u.find(w=>w===y);return Z("li",{className:"col-lg-auto p-0",onClick:()=>{h(xt(y))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[Z("div",{className:"col py-2 py-lg-0 px-0",children:[M("small",{className:"pt-2 d-lg-none",children:g&&g.translate(y).fetch()}),Z("span",{className:"ps-lg-3 pe-3 pt-lg-2 pb-2 d-block",children:[n,M("span",{className:"d-none d-lg-inline ms-2",children:M(Pe.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})]}),M("div",{className:"col-auto p-2 d-block d-lg-none",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),M("ul",{className:ze("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":P}),children:a.map(({code:w,name:O})=>M("li",{children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:M("a",{className:"px-lg-4 py-2 d-block",href:"#",onClick:d=>{d.preventDefault(),d.stopPropagation(),w!==s&&(typeof t=="function"?t(w):typeof r=="function"&&(h(yu(w)),r(w))),h(Wi(y))},children:O},w)})})},Wr()))})]})}ws.propTypes={handleLanguageChange:X.exports.func,onLanguageChange:X.exports.func},ws.defaultProps={handleLanguageChange:void 0,onLanguageChange:void 0};function XO(){const[e,t]=S.useState(),{isOpen:r,subMenus:n,isMobileOrTablet:i}=ie(u=>u.headerInfo),{items:a}=ie(u=>u.menuItems),o=Lr(n.length>0,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:Kt.stiff}),s=Be(),{i18n:l}=yt();return S.useEffect(()=>{var h;const u=((h=a.find(g=>g.id===n[n.length-1]))==null?void 0:h.label)||n[n.length-1];u&&t(u)},[a,n]),!i||!r?null:o((u,h)=>h&&Z(kt.div,{className:"col py-2 py-lg-0",id:"hd-submenu-title-container",style:u,children:[M("span",{id:"hd-submenu-back",onClick:()=>{s(Wi(n[n.length-1]))},children:M(Pe.ArrowLeft,{className:"hd-icon hd-icon-arrow-left"})}),M("span",{className:"ms-3",id:"hd-submenu-title",children:e&&l&&l.translate(e).fetch()})]}))}function _s(e){const{handleHotelChange:t,handleLanguageChange:r,onLanguageChange:n}=e,{isOpen:i,isMobileOrTablet:a}=ie(u=>u.headerInfo),[o,{height:s}]=Oi(),l=Lr(!a||i,{from:{height:0},enter:{height:s},leave:{height:0},update:{height:s},config:fe(ne({},Kt.stiff),{clamp:!0})});return M("div",{className:"container-xxl",id:"hd-top-container",children:Z("div",{className:"row align-items-center pb-lg-2",id:"hd-header-container",children:[M(XO,{}),M(bg,{}),M(J_,{}),M(eO,{}),M(kO,{handleHotelChange:t}),l((u,h)=>h&&M(kt.div,{className:"col-12 col-lg-auto ps-lg-0 align-middle order-lg-5",id:"hd-nav-container-top",style:a?fe(ne({},u),{display:"block"}):{},children:M("nav",{ref:o,id:"hd-top-nav",children:Z("ul",{className:"row list-unstyled mb-0 hd-nav-first-level",children:[M(QO,{}),M(ws,{handleLanguageChange:r,onLanguageChange:n}),M(qO,{})]})})}))]})})}_s.propTypes={handleHotelChange:X.exports.func,handleLanguageChange:X.exports.func,onLanguageChange:X.exports.func},_s.defaultProps={handleHotelChange:void 0,handleLanguageChange:void 0,onLanguageChange:void 0};function YO(){const[e,t]=S.useState([]),{items:r,selectedItem:n}=ie(a=>a.menuItems),{i18n:i}=yt();return S.useEffect(()=>{if(n){const a=[];let o=r.find(s=>s.id===n);do a.push(o),o=r.find(s=>s.id===o.parentId);while(o);t(a.reverse())}},[n]),e.length===0?null:M("div",{className:"container-xxl mb-3",children:M("nav",{"aria-label":"breadcrumb",id:"hd-breadcrumb",children:Z("ol",{className:"breadcrumb mb-0",children:[M("li",{className:"breadcrumb-item active",children:i&&i.translate(e[0].label).fetch()}),e.length>=2&&M("li",{className:"breadcrumb-item active",children:i&&i.translate(e[1].label).fetch()}),e.length===3&&M("li",{className:"breadcrumb-item active",children:i&&i.translate(e[2].label).fetch()})]})})})}function Os(e){const{config:t,userInfo:r,userLanguage:n,i18nFeed:i}=e,{isOpen:a,subMenus:o,isMobileOrTablet:s}=ie(d=>d.headerInfo),{showNotifications:l}=ie(d=>d.notifications),u=S.useRef(null),h=Be();S.useEffect(()=>{n&&h(yu(n)),r&&h(fp(r)),i&&h(vp(i))},[]);const{width:g}=Ch();S.useEffect(()=>{g&&h(pp(g))},[g]);const{headerConfig:y={},error:P}=e1(t),{titleBar:w,menuBar:O}=y;return S.useEffect(()=>{w&&h(cp(w))},[w]),S.useEffect(()=>{O&&h(sp(O))},[O]),S.useEffect(()=>{u&&o.length>0&&(u.current.scrollTop=0)},[o.length]),P?(console.error(P),null):Z("div",{children:[Z("div",{ref:u,id:"hd-container",className:ze("container-fluid","px-0 fixed-top",{"hd-menu-opened":a,"hd-overflow-hidden":o.length>0}),style:fe(ne(ne({},s&&!a&&{overflow:"hidden"}),l&&{overflow:"visible"}),{maxWidth:"none"}),children:[M(_s,ne({},e)),M(Y_,{})]}),M(YO,{})]})}Os.propTypes={userInfo:X.exports.shape({username:X.exports.string,hotelId:X.exports.number,guideId:X.exports.number}),userLanguage:X.exports.string,config:X.exports.string.isRequired,i18nFeed:X.exports.string},Os.defaultProps={userInfo:void 0,userLanguage:"en",i18nFeed:void 0};const Sd=Sp(Os);function JO(e,t){Ce.render(M(Sd,ne({},t)),e)}_e.Header=Sd,_e.renderHeader=JO,Object.defineProperties(_e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
- {
2
- "name": "ba-js-common-header",
3
- "version": "1.0.4",
4
- "scripts": {
5
- "dev": "vite",
6
- "build": "vite build",
7
- "build:watch": "vite build --watch",
8
- "build:watch:dev": "vite build --mode development --watch",
9
- "preview": "vite preview",
10
- "lint": "eslint --ext js,jsx src --fix",
11
- "prepublishOnly": "yarn build",
12
- "prepare": "husky install"
13
- },
14
- "files": [
15
- "dist"
16
- ],
17
- "dependencies": {
18
- "@react-spring/web": "^9.4.4",
19
- "@reduxjs/toolkit": "^1.8.1",
20
- "ba-js-icon": "^2.2.0",
21
- "classnames": "^2.3.1",
22
- "downshift": "^6.1.7",
23
- "jed": "^1.1.1",
24
- "js-cookie": "^3.0.1",
25
- "lodash": "^4.17.21",
26
- "nanoid": "^3.3.4",
27
- "prop-types": "^15.8.1",
28
- "query-string": "^7.1.1",
29
- "react": "^17.0.2",
30
- "react-dom": "^17.0.2",
31
- "react-redux": "^7.2.8",
32
- "react-use": "^17.3.2",
33
- "redux-logger": "^3.0.6",
34
- "swr": "^1.2.2"
35
- },
36
- "devDependencies": {
37
- "@vitejs/plugin-react": "^1.0.7",
38
- "eslint": "^8.13.0",
39
- "eslint-config-airbnb": "^19.0.4",
40
- "eslint-config-prettier": "^8.5.0",
41
- "eslint-plugin-import": "^2.26.0",
42
- "eslint-plugin-jsx-a11y": "^6.5.1",
43
- "eslint-plugin-prettier": "^4.0.0",
44
- "eslint-plugin-react": "^7.29.4",
45
- "eslint-plugin-react-hooks": "^4.4.0",
46
- "husky": ">=6",
47
- "lint-staged": ">=10",
48
- "miragejs": "^0.1.43",
49
- "prettier": "^2.6.2",
50
- "vite": "^2.9.0"
51
- },
52
- "lint-staged": {
53
- "*.{js,jsx}": "eslint --ext js,jsx --cache --fix"
54
- },
55
- "license": "MIT"
56
- }
1
+ {
2
+ "name": "ba-js-common-header",
3
+ "version": "1.0.6",
4
+ "scripts": {
5
+ "dev": "vite",
6
+ "build": "vite build",
7
+ "build:watch": "vite build --watch",
8
+ "build:watch:dev": "vite build --mode development --watch",
9
+ "preview": "vite preview",
10
+ "lint": "eslint --ext js,jsx src --fix",
11
+ "prepublishOnly": "yarn build",
12
+ "prepare": "husky install"
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "dependencies": {
18
+ "@react-spring/web": "^9.4.4",
19
+ "@reduxjs/toolkit": "^1.8.1",
20
+ "ba-js-icon": "^2.2.0",
21
+ "classnames": "^2.3.1",
22
+ "downshift": "^6.1.7",
23
+ "jed": "^1.1.1",
24
+ "js-cookie": "^3.0.1",
25
+ "lodash": "^4.17.21",
26
+ "nanoid": "^3.3.4",
27
+ "prop-types": "^15.8.1",
28
+ "query-string": "^7.1.1",
29
+ "react": "^17.0.2",
30
+ "react-dom": "^17.0.2",
31
+ "react-redux": "^7.2.8",
32
+ "react-use": "^17.3.2",
33
+ "redux-logger": "^3.0.6",
34
+ "swr": "^1.2.2"
35
+ },
36
+ "devDependencies": {
37
+ "@vitejs/plugin-react": "^1.0.7",
38
+ "eslint": "^8.13.0",
39
+ "eslint-config-airbnb": "^19.0.4",
40
+ "eslint-config-prettier": "^8.5.0",
41
+ "eslint-plugin-import": "^2.26.0",
42
+ "eslint-plugin-jsx-a11y": "^6.5.1",
43
+ "eslint-plugin-prettier": "^4.0.0",
44
+ "eslint-plugin-react": "^7.29.4",
45
+ "eslint-plugin-react-hooks": "^4.4.0",
46
+ "husky": ">=6",
47
+ "lint-staged": ">=10",
48
+ "miragejs": "^0.1.43",
49
+ "prettier": "^2.6.2",
50
+ "vite": "^2.9.0"
51
+ },
52
+ "lint-staged": {
53
+ "*.{js,jsx}": "eslint --ext js,jsx --cache --fix"
54
+ },
55
+ "license": "MIT"
56
+ }