@findhotel/sapi 1.2.2 → 1.3.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.
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ hotels, hotels\' offers and rooms.
|
|
|
17
17
|
- [Search](#search)
|
|
18
18
|
- [Get hotel's rooms offers](#get-hotels-rooms-offers)
|
|
19
19
|
- [Get hotel](#get-hotel)
|
|
20
|
+
- [Get hotels](#get-hotels)
|
|
20
21
|
- [Get hotel offers](#get-hotel-offers)
|
|
21
22
|
- [API Reference](#api-reference)
|
|
22
23
|
- [SAPI client](#sapi-client)
|
|
@@ -36,9 +37,12 @@ hotels, hotels\' offers and rooms.
|
|
|
36
37
|
- [`hotel()` method](#hotel-method)
|
|
37
38
|
- [Hotel parameters](#hotel-parameters)
|
|
38
39
|
- [Response](#response-4)
|
|
40
|
+
- [`hotels()` method](#hotels-method)
|
|
41
|
+
- [Hotels parameters](#hotels-parameters)
|
|
42
|
+
- [Response](#response-5)
|
|
39
43
|
- [`offers()` method](#offers-method)
|
|
40
44
|
- [Offers parameters](#offers-parameters)
|
|
41
|
-
- [Response](#response-
|
|
45
|
+
- [Response](#response-6)
|
|
42
46
|
- [Rooms configuration](#rooms-configuration)
|
|
43
47
|
- [Examples](#examples)
|
|
44
48
|
- [How to generate `searchId`?](#how-to-generate-searchid)
|
|
@@ -202,6 +206,17 @@ const hotel = await sapiClient.hotel('1196472')
|
|
|
202
206
|
|
|
203
207
|
For full documentation, check [hotel method api](#hotel-method).
|
|
204
208
|
|
|
209
|
+
### Get hotels
|
|
210
|
+
<a id="tutorial-get-hotels"></a>
|
|
211
|
+
|
|
212
|
+
Get hotels by ids:
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
const hotels = await sapiClient.hotels(['1714808','1380416','1710829'])
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
For full documentation, check [hotels method api](#hotels-method).
|
|
219
|
+
|
|
205
220
|
### Get hotel offers
|
|
206
221
|
<a id="tutorial-get-offers"></a>
|
|
207
222
|
|
|
@@ -340,7 +355,7 @@ const search = await sapiClient.search(searchParameters, callbacks)
|
|
|
340
355
|
All parameters are optional.
|
|
341
356
|
|
|
342
357
|
| name | type | description | example |
|
|
343
|
-
|
|
358
|
+
| --------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
344
359
|
| `hotelId` | `string` | Hotel Id for hotel search. If present, takes precedence over `placeId`, `query` and `geolocation`. | `1371626` |
|
|
345
360
|
| `placeId` | `string` | Place Id for place search. If present, takes precedence over `query` and `geolocation`. | `47319` |
|
|
346
361
|
| `geolocation` | `{lat: number, lon: number, precision: string}` | Geolocation query. If present, takes precedence over `query` | `{lat: 36.114303, lon: -115.178312}` |
|
|
@@ -651,7 +666,7 @@ const rooms = await sapiClient.rooms({
|
|
|
651
666
|
<a id="rooms-parameters"></a>
|
|
652
667
|
|
|
653
668
|
| name | type | description | required | example |
|
|
654
|
-
|
|
669
|
+
| ----------------------- | -------- | -------------------------------------------------------------------------------- | -------- | ------------------------------------------ |
|
|
655
670
|
| `hotelId` | `string` | Hotel Id to retrieve rooms | yes | `1714808` |
|
|
656
671
|
| `checkIn` | `string` | Check in date (`YYYY-MM-DD`) | yes | `2021-10-10` |
|
|
657
672
|
| `checkOut` | `string` | Check out date (`YYYY-MM-DD`) | yes | `2021-10-11` |
|
|
@@ -757,9 +772,9 @@ and \"pt-BR\" `language`
|
|
|
757
772
|
"lat": 52.377805,
|
|
758
773
|
"lon": 4.914172
|
|
759
774
|
},
|
|
760
|
-
"feesOpt": "<p>Os seguintes depósitos e taxas são cobrados pelo hotel no momento do serviço prestado, durante o check-in ou check-out. </p> <ul> <li>Taxa para café da manhã em estilo buffet: EUR 25.00 por pessoa (aproximadamente)</li> <li>Taxa para o acesso à internet com fio no quarto: EUR 15 por dia (as tarifas podem variar)</li>
|
|
775
|
+
"feesOpt": "<p>Os seguintes depósitos e taxas são cobrados pelo hotel no momento do serviço prestado, durante o check-in ou check-out. </p> <ul> <li>Taxa para café da manhã em estilo buffet: EUR 25.00 por pessoa (aproximadamente)</li> <li>Taxa para o acesso à internet com fio no quarto: EUR 15 por dia (as tarifas podem variar)</li> </ul> <p>A lista acima pode estar incompleta. As taxas e os depósitos podem não incluir impostos e estão sujeitos a mudanças. </p>",
|
|
761
776
|
"checkInSpInst": "O funcionário da recepção receberá os hóspedes na chegada. Para mais informações, entre em contato com o estabelecimento usando os dados que estão na confirmação da reserva. Os hóspedes que forem usar o traslado da Estação Central de Amsterdã devem entrar em contato com o estabelecimento com antecedência. Devido à COVID-19, as opções de comida e bebida deste estabelecimento podem estar limitadas de acordo com os regulamentos locais.",
|
|
762
|
-
"policies": "<ul> <li>Este estabelecimento oferece transporte da estação de trem. Os hóspedes devem entrar em contato com o estabelecimento antes da viagem com os detalhes da chegada usando as informações para contato presentes na confirmação da reserva. </li> <li>É necessário reservar os seguintes serviços: serviços de massagem. As reservas podem ser feitas contatando este hotel antes da viagem usando as informações para contato fornecidas na confirmação da reserva. </li> <li>Somente hóspedes registrados podem ter acesso aos quartos. </li
|
|
777
|
+
"policies": "<ul> <li>Este estabelecimento oferece transporte da estação de trem. Os hóspedes devem entrar em contato com o estabelecimento antes da viagem com os detalhes da chegada usando as informações para contato presentes na confirmação da reserva. </li> <li>É necessário reservar os seguintes serviços: serviços de massagem. As reservas podem ser feitas contatando este hotel antes da viagem usando as informações para contato fornecidas na confirmação da reserva. </li> <li>Somente hóspedes registrados podem ter acesso aos quartos. </li></ul>",
|
|
763
778
|
"phone": "+31205191200",
|
|
764
779
|
"imageURIs": [
|
|
765
780
|
"https://i.travelapi.com/hotels/2000000/1460000/1452100/1452083/a39e2fc8_w.jpg",
|
|
@@ -767,7 +782,7 @@ and \"pt-BR\" `language`
|
|
|
767
782
|
"https://i.travelapi.com/hotels/2000000/1460000/1452100/1452083/aed25438_w.jpg"
|
|
768
783
|
],
|
|
769
784
|
"checkInTime": "15:00",
|
|
770
|
-
"checkInInst": "<ul> <li>Pessoas extras podem incorrer em taxas adicionais que variam dependendo da política do estabelecimento</li><li>Documento de identificação oficial com foto e cartão de crédito, cartão de débito ou depósito em dinheiro podem ser exigidos no momento do check-in para despesas extras.</li
|
|
785
|
+
"checkInInst": "<ul> <li>Pessoas extras podem incorrer em taxas adicionais que variam dependendo da política do estabelecimento</li><li>Documento de identificação oficial com foto e cartão de crédito, cartão de débito ou depósito em dinheiro podem ser exigidos no momento do check-in para despesas extras.</li></ul>",
|
|
771
786
|
"reviewCount": 17538,
|
|
772
787
|
"chainID": "2101",
|
|
773
788
|
"checkInEnd": "01:00",
|
|
@@ -824,6 +839,116 @@ and \"pt-BR\" `language`
|
|
|
824
839
|
}
|
|
825
840
|
```
|
|
826
841
|
|
|
842
|
+
## `hotels()` method
|
|
843
|
+
<a id="hotels-method"></a>
|
|
844
|
+
|
|
845
|
+
Hotel is a method of **sapiClient** for retrieving multiple hotels by hotel ids
|
|
846
|
+
|
|
847
|
+
```js
|
|
848
|
+
const hotels = await sapiClient.hotels(['1714808','1380416','1710829'])
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
### Hotels parameters
|
|
852
|
+
<a id="hotels-parameters"></a>
|
|
853
|
+
|
|
854
|
+
| name | type | description | required | example |
|
|
855
|
+
| ---------- | ---------- | ----------- | -------- | --------------------------------- |
|
|
856
|
+
| `hotelIds` | `string[]` | Hotel Ids | yes | `['1714808','1380416','1710829']` |
|
|
857
|
+
|
|
858
|
+
### Response
|
|
859
|
+
<a id="hotel-response"></a>
|
|
860
|
+
|
|
861
|
+
An example of the response for request with `hotelId` 1196472
|
|
862
|
+
and \"pt-BR\" `language`
|
|
863
|
+
|
|
864
|
+
```json
|
|
865
|
+
{
|
|
866
|
+
"1196472": {
|
|
867
|
+
"objectID": "1196472",
|
|
868
|
+
"guestRating": {
|
|
869
|
+
"cleanliness": 8.82,
|
|
870
|
+
"dining": 8.73,
|
|
871
|
+
"facilities": 8.73,
|
|
872
|
+
"location": 8.8,
|
|
873
|
+
"overall": 8.54,
|
|
874
|
+
"pricing": 4.49,
|
|
875
|
+
"rooms": 8.82,
|
|
876
|
+
"service": 8.67
|
|
877
|
+
},
|
|
878
|
+
"isDeleted": false,
|
|
879
|
+
"starRating": 4,
|
|
880
|
+
"_geoloc": {
|
|
881
|
+
"lat": 52.377805,
|
|
882
|
+
"lon": 4.914172
|
|
883
|
+
},
|
|
884
|
+
"feesOpt": "<p>Os seguintes depósitos e taxas são cobrados pelo hotel no momento do serviço prestado, durante o check-in ou check-out. </p> <ul> <li>Taxa para café da manhã em estilo buffet: EUR 25.00 por pessoa (aproximadamente)</li> <li>Taxa para o acesso à internet com fio no quarto: EUR 15 por dia (as tarifas podem variar)</li> </ul> <p>A lista acima pode estar incompleta. As taxas e os depósitos podem não incluir impostos e estão sujeitos a mudanças. </p>",
|
|
885
|
+
"checkInSpInst": "O funcionário da recepção receberá os hóspedes na chegada. Para mais informações, entre em contato com o estabelecimento usando os dados que estão na confirmação da reserva. Os hóspedes que forem usar o traslado da Estação Central de Amsterdã devem entrar em contato com o estabelecimento com antecedência. Devido à COVID-19, as opções de comida e bebida deste estabelecimento podem estar limitadas de acordo com os regulamentos locais.",
|
|
886
|
+
"policies": "<ul> <li>Este estabelecimento oferece transporte da estação de trem. Os hóspedes devem entrar em contato com o estabelecimento antes da viagem com os detalhes da chegada usando as informações para contato presentes na confirmação da reserva. </li> <li>É necessário reservar os seguintes serviços: serviços de massagem. As reservas podem ser feitas contatando este hotel antes da viagem usando as informações para contato fornecidas na confirmação da reserva. </li> <li>Somente hóspedes registrados podem ter acesso aos quartos. </li></ul>",
|
|
887
|
+
"phone": "+31205191200",
|
|
888
|
+
"imageURIs": [
|
|
889
|
+
"https://i.travelapi.com/hotels/2000000/1460000/1452100/1452083/a39e2fc8_w.jpg",
|
|
890
|
+
"https://i.travelapi.com/hotels/2000000/1460000/1452100/1452083/3892e861_w.jpg",
|
|
891
|
+
"https://i.travelapi.com/hotels/2000000/1460000/1452100/1452083/aed25438_w.jpg"
|
|
892
|
+
],
|
|
893
|
+
"checkInTime": "15:00",
|
|
894
|
+
"checkInInst": "<ul> <li>Pessoas extras podem incorrer em taxas adicionais que variam dependendo da política do estabelecimento</li><li>Documento de identificação oficial com foto e cartão de crédito, cartão de débito ou depósito em dinheiro podem ser exigidos no momento do check-in para despesas extras.</li></ul>",
|
|
895
|
+
"reviewCount": 17538,
|
|
896
|
+
"chainID": "2101",
|
|
897
|
+
"checkInEnd": "01:00",
|
|
898
|
+
"lastBooked": 1608030831,
|
|
899
|
+
"checkOutTime": "12:00",
|
|
900
|
+
"feesMnd": "<p>Você deverá pagar os seguintes encargos no estabelecimento:</p> <ul><li>Depósito: EUR 50 por noite</li><li>A cidade cobra um imposto de EUR 3.00 por pessoa, por noite até 21 noites. Esse imposto não se aplica a crianças de até 16 anos. </li><li>Será cobrado um imposto municipal/local de 6.422 %</li></ul> <p>Incluímos todas as cobranças que o estabelecimento nos forneceu. No entanto, as cobranças podem variar com base, por exemplo, na duração da estadia ou no tipo de quarto reservado. </p>",
|
|
901
|
+
"reviewCountBkt": 9,
|
|
902
|
+
"hotelName": "Movenpick Hotel Amsterdam City Centre",
|
|
903
|
+
"sentiments": [{
|
|
904
|
+
"value": "Gostou do bar",
|
|
905
|
+
"id": 46
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
"value": "Processo rápido de check-in/check-out",
|
|
909
|
+
"id": 180
|
|
910
|
+
}
|
|
911
|
+
],
|
|
912
|
+
"facilities": [{
|
|
913
|
+
"categoryID": 4,
|
|
914
|
+
"importance": 2,
|
|
915
|
+
"value": "Centro de Negócios",
|
|
916
|
+
"id": 1
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"categoryID": 17,
|
|
920
|
+
"importance": 2,
|
|
921
|
+
"value": "Serviço de quarto",
|
|
922
|
+
"id": 2
|
|
923
|
+
}
|
|
924
|
+
],
|
|
925
|
+
"placeID": "311007",
|
|
926
|
+
"guestType": {
|
|
927
|
+
"business": 1333,
|
|
928
|
+
"couples": 3125,
|
|
929
|
+
"families": 1484,
|
|
930
|
+
"groups": 1121,
|
|
931
|
+
"solo": 206
|
|
932
|
+
},
|
|
933
|
+
"themes": [{
|
|
934
|
+
"value": "Cidade",
|
|
935
|
+
"id": 2
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"value": "Empresarial",
|
|
939
|
+
"id": 12
|
|
940
|
+
}
|
|
941
|
+
],
|
|
942
|
+
"propertyType": {
|
|
943
|
+
"value": "Hotel",
|
|
944
|
+
"id": 0
|
|
945
|
+
},
|
|
946
|
+
"placeDisplayName": "Oostelijk Havengebied, Amsterdã",
|
|
947
|
+
"displayAddress": "Piet Heinkade 11, Oostelijk Havengebied, Amsterdã, Holanda"
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
```
|
|
951
|
+
|
|
827
952
|
## `offers()` method
|
|
828
953
|
<a id="offers-method"></a>
|
|
829
954
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).sapi=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}function r(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};var a=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function u(e){return this instanceof u?(this.v=e,this):new u(e)}var c=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var l=Object.freeze({__proto__:null,__extends:function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return o},__rest:function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},__decorate:function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},__param:function(e,t){return function(r,n){t(r,n,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},__createBinding:a,__exportStar:function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)},__values:i,__read:s,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)n[o]=a[i];return n},__spreadArray:function(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},__await:u,__asyncGenerator:function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof u?Promise.resolve(e.value.v).then(c,l):f(a[0][2],e)}(o[e](t))}catch(e){f(a[0][3],e)}}function c(e){s("next",e)}function l(e){s("throw",e)}function f(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:u(e[n](t)),done:"return"===n}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=i(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return c(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},__classPrivateFieldSet:function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},__classPrivateFieldIn:function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}});function f(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if("production"!==process.env.NODE_ENV){var o=ae[e],a=o?"function"==typeof o?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function d(e){return!!e&&!!e[ne]}function h(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===ie}(e)||Array.isArray(e)||!!e[re]||!!e.constructor[re]||_(e)||w(e))}function p(e,t,r){void 0===r&&(r=!1),0===v(e)?(r?Object.keys:se)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function v(e){var t=e[ne];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:_(e)?2:w(e)?3:0}function g(e,t){return 2===v(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){return 2===v(e)?e.get(t):e[t]}function y(e,t,r){var n=v(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function b(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function _(e){return $&&e instanceof Map}function w(e){return Z&&e instanceof Set}function O(e){return e.o||e.t}function P(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=ue(e);delete t[ne];for(var r=se(t),n=0;n<r.length;n++){var o=r[n],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function T(e,t){return void 0===t&&(t=!1),D(e)||d(e)||!h(e)||(v(e)>1&&(e.set=e.add=e.clear=e.delete=S),Object.freeze(e),t&&p(e,(function(e,t){return T(t,!0)}),!0)),e}function S(){f(2)}function D(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function I(e){var t=ce[e];return t||f(18,e),t}function j(e,t){ce[e]||(ce[e]=t)}function k(){return"production"===process.env.NODE_ENV||V||f(0),V}function C(e,t){t&&(I("Patches"),e.u=[],e.s=[],e.v=t)}function E(e){x(e),e.p.forEach(N),e.p=null}function x(e){e===V&&(V=e.l)}function R(e){return V={p:[],l:V,h:e,m:!0,_:0}}function N(e){var t=e[ne];0===t.i||1===t.i?t.j():t.O=!0}function M(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||I("ES5").S(t,e,n),n?(r[ne].P&&(E(t),f(4)),h(e)&&(e=A(t,e),t.l||q(t,e)),t.u&&I("Patches").M(r[ne].t,e,t.u,t.s)):e=A(t,r,[]),E(t),t.u&&t.v(t.u,t.s),e!==te?e:void 0}function A(e,t,r){if(D(t))return t;var n=t[ne];if(!n)return p(t,(function(o,a){return U(e,n,t,o,a,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return q(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=P(n.k):n.o;p(3===n.i?new Set(o):o,(function(t,a){return U(e,n,o,t,a,r)})),q(e,o,!1),r&&e.u&&I("Patches").R(n,r,e.u,e.s)}return n.o}function U(e,t,r,n,o,a){if("production"!==process.env.NODE_ENV&&o===r&&f(5),d(o)){var i=A(e,o,a&&t&&3!==t.i&&!g(t.D,n)?a.concat(n):void 0);if(y(r,n,i),!d(i))return;e.m=!1}if(h(o)&&!D(o)){if(!e.h.F&&e._<1)return;A(e,o),t&&t.A.l||q(e,o)}}function q(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&T(t,r)}function H(e,t){var r=e[ne];return(r?O(r):e)[t]}function B(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function F(e){e.P||(e.P=!0,e.l&&F(e.l))}function W(e){e.o||(e.o=P(e.t))}function L(e,t,r){var n=_(t)?I("MapSet").N(t,r):w(t)?I("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:k(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,a=le;r&&(o=[n],a=fe);var i=Proxy.revocable(o,a),s=i.revoke,u=i.proxy;return n.k=u,n.j=s,u}(t,r):I("ES5").J(t,r);return(r?r.A:k()).p.push(n),n}function z(e){return d(e)||f(22,e),function e(t){if(!h(t))return t;var r,n=t[ne],o=v(t);if(n){if(!n.P&&(n.i<4||!I("ES5").K(n)))return n.t;n.I=!0,r=Y(t,o),n.I=!1}else r=Y(t,o);return p(r,(function(t,o){n&&m(n.t,t)===o||y(r,t,e(o))})),3===o?new Set(r):r}(e)}function Y(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return P(e)}function G(){function e(e,t){var r=a[e];return r?r.enumerable=t:a[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[ne];return"production"!==process.env.NODE_ENV&&o(t),le.get(t,e)},set:function(t){var r=this[ne];"production"!==process.env.NODE_ENV&&o(r),le.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][ne];if(!o.P)switch(o.i){case 5:n(o)&&F(o);break;case 4:r(o)&&F(o)}}}function r(e){for(var t=e.t,r=e.k,n=se(r),o=n.length-1;o>=0;o--){var a=n[o];if(a!==ne){var i=t[a];if(void 0===i&&!g(t,a))return!0;var s=r[a],u=s&&s[ne];if(u?u.t!==i:!b(s,i))return!0}}var c=!!t[ne];return n.length!==se(t).length+(c?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);if(r&&!r.get)return!0;for(var n=0;n<t.length;n++)if(!t.hasOwnProperty(n))return!0;return!1}function o(e){e.O&&f(3,JSON.stringify(O(e)))}var a={};j("ES5",{J:function(t,r){var n=Array.isArray(t),o=function(t,r){if(t){for(var n=Array(r.length),o=0;o<r.length;o++)Object.defineProperty(n,""+o,e(o,!0));return n}var a=ue(r);delete a[ne];for(var i=se(a),s=0;s<i.length;s++){var u=i[s];a[u]=e(u,t||!!a[u].enumerable)}return Object.create(Object.getPrototypeOf(r),a)}(n,t),a={i:n?5:4,A:r?r.A:k(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,ne,{value:a,writable:!0}),o},S:function(e,r,o){o?d(r)&&r[ne].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[ne];if(r){var o=r.t,a=r.k,i=r.D,s=r.i;if(4===s)p(a,(function(t){t!==ne&&(void 0!==o[t]||g(o,t)?i[t]||e(a[t]):(i[t]=!0,F(r)))})),p(o,(function(e){void 0!==a[e]||g(a,e)||(i[e]=!1,F(r))}));else if(5===s){if(n(r)&&(F(r),i.length=!0),a.length<o.length)for(var u=a.length;u<o.length;u++)i[u]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var l=Math.min(a.length,o.length),f=0;f<l;f++)a.hasOwnProperty(f)||(i[f]=!0),void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}function K(){function e(t){if(!h(t))return t;if(Array.isArray(t))return t.map(e);if(_(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(w(t))return new Set(Array.from(t).map(e));var r=Object.create(Object.getPrototypeOf(t));for(var n in t)r[n]=e(t[n]);return g(t,re)&&(r[re]=t[re]),r}function t(t){return d(t)?e(t):t}var r="add";j("Patches",{$:function(t,n){return n.forEach((function(n){for(var o=n.path,a=n.op,i=t,s=0;s<o.length-1;s++){var u=v(i),c=""+o[s];0!==u&&1!==u||"__proto__"!==c&&"constructor"!==c||f(24),"function"==typeof i&&"prototype"===c&&f(24),"object"!=typeof(i=m(i,c))&&f(15,o.join("/"))}var l=v(i),d=e(n.value),h=o[o.length-1];switch(a){case"replace":switch(l){case 2:return i.set(h,d);case 3:f(16);default:return i[h]=d}case r:switch(l){case 1:return"-"===h?i.push(d):i.splice(h,0,d);case 2:return i.set(h,d);case 3:return i.add(d);default:return i[h]=d}case"remove":switch(l){case 1:return i.splice(h,1);case 2:return i.delete(h);case 3:return i.delete(n.value);default:return delete i[h]}default:f(17,a)}})),t},R:function(e,n,o,a){switch(e.i){case 0:case 4:case 2:return function(e,n,o,a){var i=e.t,s=e.o;p(e.D,(function(e,u){var c=m(i,e),l=m(s,e),f=u?g(i,e)?"replace":r:"remove";if(c!==l||"replace"!==f){var d=n.concat(e);o.push("remove"===f?{op:f,path:d}:{op:f,path:d,value:l}),a.push(f===r?{op:"remove",path:d}:"remove"===f?{op:r,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,n,o,a);case 5:case 1:return function(e,n,o,a){var i=e.t,s=e.D,u=e.o;if(u.length<i.length){var c=[u,i];i=c[0],u=c[1];var l=[a,o];o=l[0],a=l[1]}for(var f=0;f<i.length;f++)if(s[f]&&u[f]!==i[f]){var d=n.concat([f]);o.push({op:"replace",path:d,value:t(u[f])}),a.push({op:"replace",path:d,value:t(i[f])})}for(var h=i.length;h<u.length;h++){var p=n.concat([h]);o.push({op:r,path:p,value:t(u[h])})}i.length<u.length&&a.push({op:"replace",path:n.concat(["length"]),value:i.length})}(e,n,o,a);case 3:return function(e,t,n,o){var a=e.t,i=e.o,s=0;a.forEach((function(e){if(!i.has(e)){var a=t.concat([s]);n.push({op:"remove",path:a,value:e}),o.unshift({op:r,path:a,value:e})}s++})),s=0,i.forEach((function(e){if(!a.has(e)){var i=t.concat([s]);n.push({op:r,path:i,value:e}),o.unshift({op:"remove",path:i,value:e})}s++}))}(e,n,o,a)}},M:function(e,t,r,n){r.push({op:"replace",path:[],value:t===te?void 0:t}),n.push({op:"replace",path:[],value:e})}})}function J(){function e(e,t){function r(){this.constructor=e}o(e,t),e.prototype=(r.prototype=t.prototype,new r)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function r(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(h(t)){var r=L(e.A.h,t,e);e.p.set(t,r),e.o.add(r)}else e.o.add(t)})))}function n(e){e.O&&f(3,JSON.stringify(O(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},a=function(){function r(e,t){return this[ne]={i:2,l:t,A:t?t.A:k(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(r,Map);var o=r.prototype;return Object.defineProperty(o,"size",{get:function(){return O(this[ne]).size}}),o.has=function(e){return O(this[ne]).has(e)},o.set=function(e,r){var o=this[ne];return n(o),O(o).has(e)&&O(o).get(e)===r||(t(o),F(o),o.D.set(e,!0),o.o.set(e,r),o.D.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var r=this[ne];return n(r),t(r),F(r),r.t.has(e)?r.D.set(e,!1):r.D.delete(e),r.o.delete(e),!0},o.clear=function(){var e=this[ne];n(e),O(e).size&&(t(e),F(e),e.D=new Map,p(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var r=this;O(this[ne]).forEach((function(n,o){e.call(t,r.get(o),o,r)}))},o.get=function(e){var r=this[ne];n(r);var o=O(r).get(e);if(r.I||!h(o))return o;if(o!==r.t.get(e))return o;var a=L(r.A.h,o,r);return t(r),r.o.set(e,a),a},o.keys=function(){return O(this[ne]).keys()},o.values=function(){var e,t=this,r=this.keys();return(e={})[oe]=function(){return t.values()},e.next=function(){var e=r.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,r=this.keys();return(e={})[oe]=function(){return t.entries()},e.next=function(){var e=r.next();if(e.done)return e;var n=t.get(e.value);return{done:!1,value:[e.value,n]}},e},o[oe]=function(){return this.entries()},r}(),i=function(){function t(e,t){return this[ne]={i:3,l:t,A:t?t.A:k(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var o=t.prototype;return Object.defineProperty(o,"size",{get:function(){return O(this[ne]).size}}),o.has=function(e){var t=this[ne];return n(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},o.add=function(e){var t=this[ne];return n(t),this.has(e)||(r(t),F(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[ne];return n(t),r(t),F(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[ne];n(e),O(e).size&&(r(e),F(e),e.o.clear())},o.values=function(){var e=this[ne];return n(e),r(e),e.o.values()},o.entries=function(){var e=this[ne];return n(e),r(e),e.o.entries()},o.keys=function(){return this.values()},o[oe]=function(){return this.values()},o.forEach=function(e,t){for(var r=this.values(),n=r.next();!n.done;)e.call(t,n.value,n.value,this),n=r.next()},t}();j("MapSet",{N:function(e,t){return new a(e,t)},T:function(e,t){return new i(e,t)}})}var Q,V,X="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),$="undefined"!=typeof Map,Z="undefined"!=typeof Set,ee="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,te=X?Symbol.for("immer-nothing"):((Q={})["immer-nothing"]=!0,Q),re=X?Symbol.for("immer-draftable"):"__$immer_draftable",ne=X?Symbol.for("immer-state"):"__$immer_state",oe="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",ae={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},ie=""+Object.prototype.constructor,se="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ue=Object.getOwnPropertyDescriptors||function(e){var t={};return se(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},ce={},le={get:function(e,t){if(t===ne)return e;var r=O(e);if(!g(r,t))return function(e,t,r){var n,o=B(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!h(n)?n:n===H(e.t,t)?(W(e),e.o[t]=L(e.A.h,n,e)):n},has:function(e,t){return t in O(e)},ownKeys:function(e){return Reflect.ownKeys(O(e))},set:function(e,t,r){var n=B(O(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=H(O(e),t),a=null==o?void 0:o[ne];if(a&&a.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(b(r,o)&&(void 0!==r||g(e.t,t)))return!0;W(e),F(e)}return e.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==H(e.t,t)||t in e.t?(e.D[t]=!1,W(e),F(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=O(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){f(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){f(12)}},fe={};p(le,(function(e,t){fe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),fe.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&f(13),fe.set.call(this,e,t,void 0)},fe.set=function(e,t,r){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&f(14),le.set.call(this,e[0],t,r,e[0])};var de=function(){function e(e){var t=this;this.g=ee,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return a.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(i))}))}}var i;if("function"!=typeof r&&f(6),void 0!==n&&"function"!=typeof n&&f(7),h(e)){var s=R(t),u=L(t,e,void 0),c=!0;try{i=r(u),c=!1}finally{c?E(s):x(s)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return C(s,n),M(e,s)}),(function(e){throw E(s),e})):(C(s,n),M(i,s))}if(!e||"object"!=typeof e){if(void 0===(i=r(e))&&(i=e),i===te&&(i=void 0),t.F&&T(i,!0),n){var l=[],d=[];I("Patches").M(e,i,l,d),n(l,d)}return i}f(21,e)},this.produceWithPatches=function(e,r){if("function"==typeof e)return function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(o))}))};var n,o,a=t.produce(e,r,(function(e,t){n=e,o=t}));return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return[e,n,o]})):[a,n,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){h(e)||f(8),d(e)&&(e=z(e));var t=R(this),r=L(this,e,void 0);return r[ne].C=!0,x(t),r},t.finishDraft=function(e,t){var r=e&&e[ne];"production"!==process.env.NODE_ENV&&(r&&r.C||f(9),r.I&&f(10));var n=r.A;return C(n,t),M(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!ee&&f(20),this.g=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var o=I("Patches").$;return d(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),he=new de,pe=he.produce,ve=he.produceWithPatches.bind(he),ge=he.setAutoFreeze.bind(he),me=he.setUseProxies.bind(he),ye=he.applyPatches.bind(he),be=he.createDraft.bind(he),_e=he.finishDraft.bind(he),we=Object.freeze({__proto__:null,default:pe,Immer:de,applyPatches:ye,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:be,current:z,enableAllPlugins:function(){G(),J(),K()},enableES5:G,enableMapSet:J,enablePatches:K,finishDraft:_e,freeze:T,immerable:re,isDraft:d,isDraftable:h,nothing:te,original:function(e){return d(e)||f(23,e),e[ne].t},produce:pe,produceWithPatches:ve,setAutoFreeze:ge,setUseProxies:me}),Oe=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Pe}(e)}(e)};var Pe="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Te(e,t){return!1!==t.clone&&t.isMergeableObject(e)?ke((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function Se(e,t,r){return e.concat(t).map((function(e){return Te(e,r)}))}function De(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function Ie(e,t){try{return t in e}catch(e){return!1}}function je(e,t,r){var n={};return r.isMergeableObject(e)&&De(e).forEach((function(t){n[t]=Te(e[t],r)})),De(t).forEach((function(o){(function(e,t){return Ie(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(Ie(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return ke;var r=t.customMerge(e);return"function"==typeof r?r:ke}(o,r)(e[o],t[o],r):n[o]=Te(t[o],r))})),n}function ke(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||Se,r.isMergeableObject=r.isMergeableObject||Oe,r.cloneUnlessOtherwiseSpecified=Te;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):je(e,t,r):Te(t,r)}ke.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return ke(e,r,t)}),{})};var Ce=ke,Ee=r(l),xe=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getAppConfig=void 0;var r=Ee.__importDefault(Ce),n={sapiBackend:{baseUrl:"dikcjxfwieazv.cloudfront.net",endpoints:{anchor:"anchor",search:"search",offers:"ws/offers",roomsOffers:"rooms-offers"}},saf:{baseUrl:"sapi.findhotel.services",endpoints:{offersRooms:"1/offers-rooms",search:"1/search",hotel:"1/hotel"}},algolia:{appId:"4UYGJP42KQ",apiKey:"efa703d5c0057a24487bc9bdcb597770",autocompleteIndex:"prod_autocomplete_v2_os000007"},client:{defaultRooms:"2",features:["offers","search","suggests","configs","rooms","get-hotel"],blockedDefaultDates:["2022-12-25","2023-01-01"],daysFromNow:45,fallbackLanguages:{"pt-BR":["pt"],"zh-CN":["zh"],"zh-HK":["zh"],"zh-TW":["zh"],iw:["he"],nb:["no"],nn:["no"]}}},o={"findhotel-website":n,"findhotel-website-e2e":Ee.__assign(Ee.__assign({},n),{saf:Ee.__assign(Ee.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-website-stg":Ee.__assign(Ee.__assign({},n),{sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})}),"findhotel-website-ci":Ee.__assign(Ee.__assign({},n),{sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d1ue1wauc6u0m5.cloudfront.net"})}),"findhotel-website-dev":Ee.__assign(Ee.__assign({},n),{sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d3b8t16k1aaypx.cloudfront.net"})}),"findhotel-website-dev2":Ee.__assign(Ee.__assign({},n),{sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d3u31tr22fwdg3.cloudfront.net"})}),"findhotel-checkout":Ee.__assign(Ee.__assign({},n),{client:Ee.__assign(Ee.__assign({},n.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-e2e":Ee.__assign(Ee.__assign({},n),{saf:Ee.__assign(Ee.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),client:Ee.__assign(Ee.__assign({},n.client),{features:["rooms","get-hotel"]}),sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-checkout-stg":Ee.__assign(Ee.__assign({},n),{saf:Ee.__assign(Ee.__assign({},n.saf),{baseUrl:"sapi-stg.findhotel.services"}),client:Ee.__assign(Ee.__assign({},n.client),{features:["rooms","get-hotel"]}),sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})})};t.getAppConfig=function(e,t){var n=o[e];if(void 0===n)throw new Error("Profile key is not valid");return t&&(n=(0,r.default)(n,t,{arrayMerge:function(e,t){return t}})),n}}));var Re=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,a=[],i=[],s={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return a},entries:function(){return i},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){a.push(t=t.toLowerCase()),i.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(u())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),Ne={};try{!function(e,t){if(new e("q=%2B").get("q")!==t||new e({q:t}).get("q")!==t||new e([["q",t]]).get("q")!==t||"q=%0A"!==new e("q=\n").toString()||"q=+%26"!==new e({q:" &"}).toString()||"q=%25zx"!==new e({q:"%zx"}).toString())throw e;Ne.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,r){var n=e.create,o=e.defineProperty,a=/[!'\(\)~]|%20|%00/g,i=/%(?![0-9a-fA-F]{2})/g,s=/\+/g,u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},c={append:function(e,t){h(this._ungap,e,t)},delete:function(e){delete this._ungap[e]},get:function(e){return this.has(e)?this._ungap[e][0]:null},getAll:function(e){return this.has(e)?this._ungap[e].slice(0):[]},has:function(e){return e in this._ungap},set:function(e,r){this._ungap[e]=[t(r)]},forEach:function(e,r){var n=this;for(var o in n._ungap)n._ungap[o].forEach(a,o);function a(a){e.call(r,a,t(o),n)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var r=v(t),n=0,o=this._ungap[t];n<o.length;n++)e.push(r+"="+v(o[n]));return e.join("&")}};for(var l in c)o(f.prototype,l,{configurable:!0,writable:!0,value:c[l]});function f(e){var t=n(null);switch(o(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var a=e.split("&"),i=0,s=a.length;i<s;i++){var u=(c=a[i]).indexOf("=");-1<u?h(t,p(c.slice(0,u)),p(c.slice(u+1))):c.length&&h(t,p(c),"")}break;case r(e):for(i=0,s=e.length;i<s;i++){var c;h(t,(c=e[i])[0],c[1])}break;case"forEach"in e:e.forEach(d,t);break;default:for(var l in e)h(t,l,e[l])}}function d(e,t){h(this,t,e)}function h(e,t,n){var o=r(n)?n.join(","):n;t in e?e[t].push(o):e[t]=[o]}function p(e){return decodeURIComponent(e.replace(i,"%25").replace(s," "))}function v(e){return encodeURIComponent(e).replace(a,g)}function g(e){return u[e]}Ne.URLSearchParams=f}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function r(e,r){var n=[];return e.forEach(r,n),t?n[Symbol.iterator]():{next:function(){var e=n.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var r=this,n=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(o){o.length&&!(o in n)&&(n[o]=r.getAll(o)).forEach((function(n){e.call(t,n,o,r)}))}))}),"keys"in e||(e.keys=function(){return r(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return r(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return r(this,(function(e,t){this.push([t,e])}))}),t&&!(Symbol.iterator in e)&&(e[Symbol.iterator]=e.entries),"sort"in e||(e.sort=function(){for(var e,t,r,n=this.entries(),o=n.next(),a=o.done,i=[],s=Object.create(null);!a;)t=(r=o.value)[0],i.push(t),t in s||(s[t]=[]),s[t].push(r[1]),a=(o=n.next()).done;for(i.sort(),e=0;e<i.length;e++)this.delete(i[e]);for(e=0;e<i.length;e++)t=i[e],this.append(t,s[t].shift())}),function(t){var r=t.defineProperty,n=t.getOwnPropertyDescriptor,o=function(t){var r=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=r},a=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},i=function(i){var s,u,c=i.prototype,l=n(c,"searchParams"),f=n(c,"href"),d=n(c,"search");!l&&d&&d.set&&(u=function(t){function n(r,n){e.append.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function o(r){e.delete.call(this,r),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function a(r,n){e.set.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}return function(e,t){return e.append=n,e.delete=o,e.set=a,r(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),s=function(e,t){return r(e,"_searchParams",{configurable:!0,writable:!0,value:u(t,e)}),t},t.defineProperties(c,{href:{get:function(){return f.get.call(this)},set:function(e){var t=this._searchParams;f.set.call(this,e),t&&o(t)}},search:{get:function(){return d.get.call(this)},set:function(e){var t=this._searchParams;d.set.call(this,e),t&&o(t)}},searchParams:{get:function(){return a(this,i),this._searchParams||s(this,new URLSearchParams(this.search.slice(1)))},set:function(e){a(this,i),s(this,e)}}}))};try{i(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&i(URL)}catch(e){}}(Object)}(Ne.URLSearchParams.prototype);var Me=Ne.URLSearchParams,Ae=r(Object.freeze({__proto__:null,default:Me})),Ue=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getSapiOverrideParameter=void 0;var r=Ee.__importDefault(Ae);t.getSapiOverrideParameter=function(e){if("undefined"==typeof window)return null;var t,n=new r.default(window.location.search).get("sapiOverride");try{n?(window.sessionStorage.setItem("sapiOverride",n),t=n):t=window.sessionStorage.getItem("sapiOverride")}catch(e){}return e?t&&t.length<=2e3?t:void 0:t}})),qe=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheapestRate=void 0,t.getCheapestRate=function(e,t){if(0!==e.offers.length)return Math.min.apply(Math,e.offers.map((function(e){return t(e.rate)})))}})),He=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDiscount=void 0,t.calculateDiscount=function(e,t,r){return void 0===t||void 0===r||0===r?0:e<t?-1*(e-t)/t:e>r?-1*(e-r)/r:0}}));function Be(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Fe(e){return Be(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function We(e){Be(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Le(e){if(Be(1,arguments),!Fe(e)&&"number"!=typeof e)return!1;var t=We(e);return!isNaN(Number(t))}var ze={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ye=function(e,t,r){var n,o=ze[e];return n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=r&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Ge(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var Ke={date:Ge({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Ge({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Ge({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Je={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qe=function(e,t,r,n){return Je[e]};function Ve(e){return function(t,r){var n,o=r||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;n=e.formattingValues[i]||e.formattingValues[a]}else{var s=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;n=e.values[u]||e.values[s]}return n[e.argumentCallback?e.argumentCallback(t):t]}}var Xe={ordinalNumber:function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Ve({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Ve({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Ve({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Ve({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Ve({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function $e(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;var i,s=a[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(u)?et(u,(function(e){return e.test(s)})):Ze(u,(function(e){return e.test(s)}));i=e.valueCallback?e.valueCallback(c):c,i=r.valueCallback?r.valueCallback(i):i;var l=t.slice(s.length);return{value:i,rest:l}}}function Ze(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function et(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}var tt,rt={ordinalNumber:(tt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.match(tt.matchPattern);if(!r)return null;var n=r[0],o=e.match(tt.parsePattern);if(!o)return null;var a=tt.valueCallback?tt.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;var i=e.slice(n.length);return{value:a,rest:i}}),era:$e({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$e({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:$e({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$e({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$e({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},nt={code:"en-US",formatDistance:Ye,formatLong:Ke,formatRelative:Qe,localize:Xe,match:rt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ot(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function at(e,t){Be(2,arguments);var r=We(e).getTime(),n=ot(t);return new Date(r+n)}function it(e,t){Be(2,arguments);var r=ot(t);return at(e,-r)}var st=864e5;function ut(e){Be(1,arguments);var t=1,r=We(e),n=r.getUTCDay(),o=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-o),r.setUTCHours(0,0,0,0),r}function ct(e){Be(1,arguments);var t=We(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=ut(n),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var i=ut(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function lt(e){Be(1,arguments);var t=ct(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=ut(r);return n}var ft=6048e5;function dt(e,t){Be(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ot(o),i=null==r.weekStartsOn?a:ot(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=We(e),u=s.getUTCDay(),c=(u<i?7:0)+u-i;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function ht(e,t){Be(1,arguments);var r=We(e),n=r.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,s=null==i?1:ot(i),u=null==o.firstWeekContainsDate?s:ot(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,u),c.setUTCHours(0,0,0,0);var l=dt(c,t),f=new Date(0);f.setUTCFullYear(n,0,u),f.setUTCHours(0,0,0,0);var d=dt(f,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function pt(e,t){Be(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.firstWeekContainsDate,a=null==o?1:ot(o),i=null==r.firstWeekContainsDate?a:ot(r.firstWeekContainsDate),s=ht(e,t),u=new Date(0);u.setUTCFullYear(s,0,i),u.setUTCHours(0,0,0,0);var c=dt(u,t);return c}var vt=6048e5;function gt(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var mt={y:function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return gt("yy"===t?n%100:n,t.length)},M:function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):gt(r+1,2)},d:function(e,t){return gt(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:function(e,t){return gt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return gt(e.getUTCHours(),t.length)},m:function(e,t){return gt(e.getUTCMinutes(),t.length)},s:function(e,t){return gt(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds();return gt(Math.floor(n*Math.pow(10,r-3)),t.length)}},yt="midnight",bt="noon",_t="morning",wt="afternoon",Ot="evening",Pt="night",Tt={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return mt.y(e,t)},Y:function(e,t,r,n){var o=ht(e,n),a=o>0?o:1-o;return"YY"===t?gt(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):gt(a,t.length)},R:function(e,t){return gt(ct(e),t.length)},u:function(e,t){return gt(e.getUTCFullYear(),t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return gt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return gt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return mt.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return gt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var o=function(e,t){Be(1,arguments);var r=We(e),n=dt(r,t).getTime()-pt(r,t).getTime();return Math.round(n/vt)+1}(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):gt(o,t.length)},I:function(e,t,r){var n=function(e){Be(1,arguments);var t=We(e),r=ut(t).getTime()-lt(t).getTime();return Math.round(r/ft)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):gt(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):mt.d(e,t)},D:function(e,t,r){var n=function(e){Be(1,arguments);var t=We(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=r-n;return Math.floor(o/st)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):gt(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return gt(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return gt(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return gt(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,o=e.getUTCHours();switch(n=12===o?bt:0===o?yt:o/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,o=e.getUTCHours();switch(n=o>=17?Ot:o>=12?wt:o>=4?_t:Pt,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return mt.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):mt.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):gt(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):gt(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):mt.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):mt.s(e,t)},S:function(e,t){return mt.S(e,t)},X:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Dt(o);case"XXXX":case"XX":return It(o);default:return It(o,":")}},x:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Dt(o);case"xxxx":case"xx":return It(o);default:return It(o,":")}},O:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+St(o,":");default:return"GMT"+It(o,":")}},z:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+St(o,":");default:return"GMT"+It(o,":")}},t:function(e,t,r,n){var o=n._originalDate||e;return gt(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,r,n){return gt((n._originalDate||e).getTime(),t.length)}};function St(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),a=n%60;if(0===a)return r+String(o);var i=t||"";return r+String(o)+i+gt(a,2)}function Dt(e,t){return e%60==0?(e>0?"-":"+")+gt(Math.abs(e)/60,2):It(e,t)}function It(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+gt(Math.floor(o/60),2)+r+gt(o%60,2)}var jt=Tt;function kt(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}}function Ct(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}}var Et={p:Ct,P:function(e,t){var r,n=e.match(/(P+)(p+)?/)||[],o=n[1],a=n[2];if(!a)return kt(e,t);switch(o){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",kt(o,t)).replace("{{time}}",Ct(a,t))}},xt=Et;function Rt(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var Nt=["D","DD"],Mt=["YY","YYYY"];function At(e){return-1!==Nt.indexOf(e)}function Ut(e){return-1!==Mt.indexOf(e)}function qt(e,t,r){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"))}var Ht=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ft=/^'([^]*?)'?$/,Wt=/''/g,Lt=/[a-zA-Z]/;function zt(e){return e.match(Ft)[1].replace(Wt,"'")}var Yt=Object.freeze({__proto__:null,default:function(e,t,r){Be(2,arguments);var n=String(t),o=r||{},a=o.locale||nt,i=a.options&&a.options.firstWeekContainsDate,s=null==i?1:ot(i),u=null==o.firstWeekContainsDate?s:ot(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,l=null==c?0:ot(c),f=null==o.weekStartsOn?l:ot(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=We(e);if(!Le(d))throw new RangeError("Invalid time value");var h=Rt(d),p=it(d,h),v={firstWeekContainsDate:u,weekStartsOn:f,locale:a,_originalDate:d},g=n.match(Bt).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,xt[t])(e,a.formatLong,v):e})).join("").match(Ht).map((function(r){if("''"===r)return"'";var n=r[0];if("'"===n)return zt(r);var i=jt[n];if(i)return!o.useAdditionalWeekYearTokens&&Ut(r)&&qt(r,t,e),!o.useAdditionalDayOfYearTokens&&At(r)&&qt(r,t,e),i(p,r,a.localize,v);if(n.match(Lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return r})).join("");return g}});function Gt(e,t){Be(2,arguments);var r=We(e),n=ot(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}var Kt=Object.freeze({__proto__:null,default:Gt});function Jt(e,t){Be(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ot(o),i=null==r.weekStartsOn?a:ot(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var s=We(e),u=s.getDay(),c=6+(u<i?-7:0)-(u-i);return s.setHours(0,0,0,0),s.setDate(s.getDate()+c),s}var Qt=Object.freeze({__proto__:null,default:function(e){return Be(1,arguments),Jt(e,{weekStartsOn:1})}});var Vt=Object.freeze({__proto__:null,default:function(e,t){Be(2,arguments);var r=ot(t),n=7*r;return Gt(e,n)}}),Xt=36e5;var $t={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Zt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,er=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function rr(e){var t,r={},n=e.split($t.dateTimeDelimiter);if(n.length>2)return r;if(/:/.test(n[0])?t=n[0]:(r.date=n[0],t=n[1],$t.timeZoneDelimiter.test(r.date)&&(r.date=e.split($t.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var o=$t.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function nr(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var o=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:null===a?o:100*a,restDateString:e.slice((n[1]||n[2]).length)}}function or(e,t){if(null===t)return new Date(NaN);var r=e.match(Zt);if(!r)return new Date(NaN);var n=!!r[4],o=ar(r[1]),a=ar(r[2])-1,i=ar(r[3]),s=ar(r[4]),u=ar(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,s,u)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var o=n.getUTCDay()||7,a=7*(t-1)+r+1-o;return n.setUTCDate(n.getUTCDate()+a),n}(t,s,u):new Date(NaN);var c=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(cr[t]||(lr(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(lr(e)?366:365)}(t,o)?(c.setUTCFullYear(t,a,Math.max(o,i)),c):new Date(NaN)}function ar(e){return e?parseInt(e):1}function ir(e){var t=e.match(er);if(!t)return NaN;var r=sr(t[1]),n=sr(t[2]),o=sr(t[3]);return function(e,t,r){if(24===e)return 0===t&&0===r;return r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,o)?r*Xt+6e4*n+1e3*o:NaN}function sr(e){return e&&parseFloat(e.replace(",","."))||0}function ur(e){if("Z"===e)return 0;var t=e.match(tr);if(!t)return 0;var r="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?r*(n*Xt+6e4*o):NaN}var cr=[31,null,31,30,31,30,31,31,30,31,30,31];function lr(e){return e%400==0||e%4==0&&e%100!=0}var fr,dr=Object.freeze({__proto__:null,default:function(e,t){Be(1,arguments);var r=t||{},n=null==r.additionalDigits?2:ot(r.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,a=rr(e);if(a.date){var i=nr(a.date,n);o=or(i.restDateString,i.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s,u=o.getTime(),c=0;if(a.time&&(c=ir(a.time),isNaN(c)))return new Date(NaN);if(!a.timezone){var l=new Date(u+c),f=new Date(0);return f.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),f.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),f}return s=ur(a.timezone),isNaN(s)?new Date(NaN):new Date(u+c+s)}}),hr=r(Yt),pr=r(Kt),vr=r(Qt),gr=r(Vt),mr=r(dr),yr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.shouldUseClientDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var r=Ee.__importDefault(hr),n=Ee.__importDefault(pr),o=Ee.__importDefault(vr),a=Ee.__importDefault(gr),i=Ee.__importDefault(mr);function s(e){return(0,i.default)("".concat(e," 12:00:00"))}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=s;var u=function(e,t){return(0,n.default)(e,t)};t.shouldUseClientDates=function(e,t){var r,n=e.checkIn,o=e.checkOut,a=e.dayDistance,i=e.nights,s=Boolean(n&&o||void 0!==a&&(void 0===i?1:i)),u=!(null===(r=t.variations)||void 0===r?void 0:r.includes("sapi4eva-sid-landing-unavailability-b"));return s||u},t.getCheckInCheckOutDates=function(e,i){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h;c=void 0===l?void 0===d?function(e){for(var i,u=e.daysFromNow,c=e.blockedDefaultDates,l=s((0,r.default)(new Date,t.DATE_FORMAT)),f=(0,o.default)((0,n.default)(l,u));i=(0,r.default)(f,t.DATE_FORMAT),c.includes(i);)f=(0,a.default)(f,1);return f}(i):u(s((0,r.default)(new Date,t.DATE_FORMAT)),d):s(l);var v=void 0===f?u(c,p):s(f);return{checkIn:(0,r.default)(c,t.DATE_FORMAT),checkOut:(0,r.default)(v,t.DATE_FORMAT)}}})),br=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){for(var r={},n={},o=0,a=e.length;o<a;)n[e[o]]=1,o+=1;for(var i in t)Object.prototype.hasOwnProperty.call(n,i)||(r[i]=t[i]);return r}})),_r=r(we),wr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createState=void 0,t.createState=function(e){var t=e;return{current:function(){return t},get:function(e){return t[e]},update:function(e){t=(0,_r.produce)(t,e)}}}})),Or=new Uint8Array(16);function Pr(){if(!fr&&!(fr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fr(Or)}var Tr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Sr(e){return"string"==typeof e&&Tr.test(e)}for(var Dr,Ir,jr=[],kr=0;kr<256;++kr)jr.push((kr+256).toString(16).substr(1));function Cr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(jr[e[t+0]]+jr[e[t+1]]+jr[e[t+2]]+jr[e[t+3]]+"-"+jr[e[t+4]]+jr[e[t+5]]+"-"+jr[e[t+6]]+jr[e[t+7]]+"-"+jr[e[t+8]]+jr[e[t+9]]+"-"+jr[e[t+10]]+jr[e[t+11]]+jr[e[t+12]]+jr[e[t+13]]+jr[e[t+14]]+jr[e[t+15]]).toLowerCase();if(!Sr(r))throw TypeError("Stringified UUID is invalid");return r}var Er=0,xr=0;function Rr(e){if(!Sr(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function Nr(e,t,r){function n(e,n,o,a){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=Rr(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(n),i.set(e,n.length),(i=r(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){a=a||0;for(var s=0;s<16;++s)o[a+s]=i[s];return o}return Cr(i)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function Mr(e){return 14+(e+64>>>9<<4)+1}function Ar(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function Ur(e,t,r,n,o,a){return Ar((i=Ar(Ar(t,e),Ar(n,a)))<<(s=o)|i>>>32-s,r);var i,s}function qr(e,t,r,n,o,a,i){return Ur(t&r|~t&n,e,t,o,a,i)}function Hr(e,t,r,n,o,a,i){return Ur(t&n|r&~n,e,t,o,a,i)}function Br(e,t,r,n,o,a,i){return Ur(t^r^n,e,t,o,a,i)}function Fr(e,t,r,n,o,a,i){return Ur(r^(t|~n),e,t,o,a,i)}var Wr=Nr("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",o=0;o<r;o+=8){var a=e[o>>5]>>>o%32&255,i=parseInt(n.charAt(a>>>4&15)+n.charAt(15&a),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[Mr(t)-1]=t;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var s=r,u=n,c=o,l=a;r=qr(r,n,o,a,e[i],7,-680876936),a=qr(a,r,n,o,e[i+1],12,-389564586),o=qr(o,a,r,n,e[i+2],17,606105819),n=qr(n,o,a,r,e[i+3],22,-1044525330),r=qr(r,n,o,a,e[i+4],7,-176418897),a=qr(a,r,n,o,e[i+5],12,1200080426),o=qr(o,a,r,n,e[i+6],17,-1473231341),n=qr(n,o,a,r,e[i+7],22,-45705983),r=qr(r,n,o,a,e[i+8],7,1770035416),a=qr(a,r,n,o,e[i+9],12,-1958414417),o=qr(o,a,r,n,e[i+10],17,-42063),n=qr(n,o,a,r,e[i+11],22,-1990404162),r=qr(r,n,o,a,e[i+12],7,1804603682),a=qr(a,r,n,o,e[i+13],12,-40341101),o=qr(o,a,r,n,e[i+14],17,-1502002290),r=Hr(r,n=qr(n,o,a,r,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=Hr(a,r,n,o,e[i+6],9,-1069501632),o=Hr(o,a,r,n,e[i+11],14,643717713),n=Hr(n,o,a,r,e[i],20,-373897302),r=Hr(r,n,o,a,e[i+5],5,-701558691),a=Hr(a,r,n,o,e[i+10],9,38016083),o=Hr(o,a,r,n,e[i+15],14,-660478335),n=Hr(n,o,a,r,e[i+4],20,-405537848),r=Hr(r,n,o,a,e[i+9],5,568446438),a=Hr(a,r,n,o,e[i+14],9,-1019803690),o=Hr(o,a,r,n,e[i+3],14,-187363961),n=Hr(n,o,a,r,e[i+8],20,1163531501),r=Hr(r,n,o,a,e[i+13],5,-1444681467),a=Hr(a,r,n,o,e[i+2],9,-51403784),o=Hr(o,a,r,n,e[i+7],14,1735328473),r=Br(r,n=Hr(n,o,a,r,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=Br(a,r,n,o,e[i+8],11,-2022574463),o=Br(o,a,r,n,e[i+11],16,1839030562),n=Br(n,o,a,r,e[i+14],23,-35309556),r=Br(r,n,o,a,e[i+1],4,-1530992060),a=Br(a,r,n,o,e[i+4],11,1272893353),o=Br(o,a,r,n,e[i+7],16,-155497632),n=Br(n,o,a,r,e[i+10],23,-1094730640),r=Br(r,n,o,a,e[i+13],4,681279174),a=Br(a,r,n,o,e[i],11,-358537222),o=Br(o,a,r,n,e[i+3],16,-722521979),n=Br(n,o,a,r,e[i+6],23,76029189),r=Br(r,n,o,a,e[i+9],4,-640364487),a=Br(a,r,n,o,e[i+12],11,-421815835),o=Br(o,a,r,n,e[i+15],16,530742520),r=Fr(r,n=Br(n,o,a,r,e[i+2],23,-995338651),o,a,e[i],6,-198630844),a=Fr(a,r,n,o,e[i+7],10,1126891415),o=Fr(o,a,r,n,e[i+14],15,-1416354905),n=Fr(n,o,a,r,e[i+5],21,-57434055),r=Fr(r,n,o,a,e[i+12],6,1700485571),a=Fr(a,r,n,o,e[i+3],10,-1894986606),o=Fr(o,a,r,n,e[i+10],15,-1051523),n=Fr(n,o,a,r,e[i+1],21,-2054922799),r=Fr(r,n,o,a,e[i+8],6,1873313359),a=Fr(a,r,n,o,e[i+15],10,-30611744),o=Fr(o,a,r,n,e[i+6],15,-1560198380),n=Fr(n,o,a,r,e[i+13],21,1309151649),r=Fr(r,n,o,a,e[i+4],6,-145523070),a=Fr(a,r,n,o,e[i+11],10,-1120210379),o=Fr(o,a,r,n,e[i+2],15,718787259),n=Fr(n,o,a,r,e[i+9],21,-343485551),r=Ar(r,s),n=Ar(n,u),o=Ar(o,c),a=Ar(a,l)}return[r,n,o,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(Mr(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))})),Lr=Wr;function zr(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function Yr(e,t){return e<<t|e>>>32-t}var Gr=Nr("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var o=0;o<n.length;++o)e.push(n.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,i=Math.ceil(a/16),s=new Array(i),u=0;u<i;++u){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*u+4*l]<<24|e[64*u+4*l+1]<<16|e[64*u+4*l+2]<<8|e[64*u+4*l+3];s[u]=c}s[i-1][14]=8*(e.length-1)/Math.pow(2,32),s[i-1][14]=Math.floor(s[i-1][14]),s[i-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=s[f][h];for(var p=16;p<80;++p)d[p]=Yr(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var v=r[0],g=r[1],m=r[2],y=r[3],b=r[4],_=0;_<80;++_){var w=Math.floor(_/20),O=Yr(v,5)+zr(w,g,m,y)+b+t[w]+d[_]>>>0;b=y,y=m,m=Yr(g,30)>>>0,g=v,v=O}r[0]=r[0]+v>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),Kr=Gr;var Jr=Object.freeze({__proto__:null,v1:function(e,t,r){var n=t&&r||0,o=t||new Array(16),a=(e=e||{}).node||Dr,i=void 0!==e.clockseq?e.clockseq:Ir;if(null==a||null==i){var s=e.random||(e.rng||Pr)();null==a&&(a=Dr=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==i&&(i=Ir=16383&(s[6]<<8|s[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:xr+1,l=u-Er+(c-xr)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||u>Er)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Er=u,xr=c,Ir=i;var f=(1e4*(268435455&(u+=122192928e5))+c)%4294967296;o[n++]=f>>>24&255,o[n++]=f>>>16&255,o[n++]=f>>>8&255,o[n++]=255&f;var d=u/4294967296*1e4&268435455;o[n++]=d>>>8&255,o[n++]=255&d,o[n++]=d>>>24&15|16,o[n++]=d>>>16&255,o[n++]=i>>>8|128,o[n++]=255&i;for(var h=0;h<6;++h)o[n+h]=a[h];return t||Cr(o)},v3:Lr,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||Pr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return Cr(n)},v5:Kr,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!Sr(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:Sr,stringify:Cr,parse:Rr}),Qr=r(Jr),Vr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0,t.generateSearchId=function(){return(0,Qr.v4)()}})),Xr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.augmentHotelWithRegularPriceRange=void 0,t.augmentHotelWithRegularPriceRange=function(e,t,r){var n;if(void 0===(null===(n=e.pricing)||void 0===n?void 0:n.medianRateBkt)||void 0===r)return e;var o=e.pricing.medianRateBkt*r*t,a=(e.pricing.medianRateBkt+1)*r*t;return Ee.__assign(Ee.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(a)]})}})),$r=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmpty=void 0,t.removeEmpty=function e(t){return Object.entries(t).filter((function(e){e[0];var t=e[1];return null!=t})).reduce((function(t,r){var n,o=r[0],a=r[1];return Ee.__assign(Ee.__assign({},t),((n={})[o]=a===new Object(a)?e(a):a,n))}),{})}})),Zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSortingBoost=void 0,t.generateSortingBoost=function(e){var t;return(null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.freeCancellation)?"freeCancellation=true:100":void 0}}));function en(e){Be(1,arguments);var t=We(e);return t.setHours(0,0,0,0),t}var tn=864e5;function rn(e,t){Be(2,arguments);var r=en(e),n=en(t),o=r.getTime()-Rt(r),a=n.getTime()-Rt(n);return Math.round((o-a)/tn)}function nn(e,t){var r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}var on=Object.freeze({__proto__:null,default:function(e,t){Be(2,arguments);var r=We(e),n=We(t),o=nn(r,n),a=Math.abs(rn(r,n));r.setDate(r.getDate()-o*a);var i=Number(nn(r,n)===-o),s=o*(a-i);return 0===s?0:s}}),an=r(on),sn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.buildOffersResponse=t.applySort=t.applyPriceFilter=t.isRateInPriceRange=void 0;var r=Ee.__importDefault(an);function n(e,t,r,n){return!(r&&e<r)&&!(n&&n<t&&e>n)}function o(e,t){var o,a=e.filters,i=void 0===a?{}:a,s=e.priceBucketWidth,u=e.priceBucketsCount,c=e.exchangeRate,l=e.getTotalRate;if(void 0===s)return t;var f=u*Math.round(s*c);if(void 0!==i.priceMin||void 0!==i.priceMax){var d=(0,r.default)((0,yr.dateToMiddayUTC)(e.checkOut),(0,yr.dateToMiddayUTC)(e.checkIn));if(!(null===(o=t.offers)||void 0===o?void 0:o.some((function(e){return n((t=l(e.rate),void 0===(r=d)&&(r=1),1===r?t:t/r),f,i.priceMin,i.priceMax);var t,r}))))return Ee.__assign(Ee.__assign({},t),{offers:[]})}return t}function a(e,t){var r=t.sortField,n=t.sortOrder,o=void 0===n?"ascending":n,a=t.getTotalRate;return"price"===r?function(e,t,r){return e.sort((function(e,n){var o,a,i=(null!==(o=(0,qe.getCheapestRate)(e,r))&&void 0!==o?o:0)-(null!==(a=(0,qe.getCheapestRate)(n,r))&&void 0!==a?a:0);return"ascending"===t?i:-i}))}(e,o,a):e}t.isRateInPriceRange=n,t.applyPriceFilter=o,t.applySort=a,t.buildOffersResponse=function(e,t){var r,n,i,s={};e.anchorHotelOfferEntity&&(s[e.anchorHotelOfferEntity.id]=e.anchorHotelOfferEntity);var u=null===(r=e.hotelOfferEntities)||void 0===r?void 0:r.map((function(e){return o(t,e)}));if(u&&t.sortField&&(i=a(u,t).map((function(e){return e.id}))),u)for(var c=0,l=u;c<l.length;c++){var f=l[c];s[f.id]=f}return{hotelOfferEntities:s,hotelIds:null!==(n=null!=i?i:t.hotelIds)&&void 0!==n?n:[]}}})),un=t((function(e,t){function r(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function n(e,t){for(var n=0,o=t;n<o.length;n++){var a=o[n];if(r(null==e?void 0:e[a]))return e[a]}return""}function o(e,t,o){void 0===o&&(o=", ");for(var a={},i=0,s=t;i<s.length;i++){var u=s[i],c=(null==e?void 0:e[u])||[];a[u]=c.map((function(n,o){if(r(n))return n;var a=t.find((function(t){var n;return r(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[o])}));return a?e[a][o]:""})).join("".concat(o))}return n(a,t)}function a(e,t,o){for(var a={},i=0,s=t;i<s.length;i++){var u=s[i],c=e[u]||[],l=-1===o?void 0:o+1,f=c.slice(o,l).toString();if(r(f))a[u]=f;else{var d=t.find((function(t){var n;return r(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[o])}));a[u]=d?e[d][o]:""}}return n(a,t)}function i(e,t){for(var o,a={},i=0,s=t;i<s.length;i++){var u=s[i],c=null===(o=e[u])||void 0===o?void 0:o.value;if(r(c))a[u]=c;else{var l=t.find((function(t){var n;return r(null===(n=e[t])||void 0===n?void 0:n.value)}));a[u]=l?e[l].value:""}}return n(a,t)}function s(e,t,r){var n,o=e[t];if(!o){var a=r.indexOf(t),i=null!==(n=r.slice(a).find((function(t){return e[t]})))&&void 0!==n?n:"en";o=e[i]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function u(e,t,r){if(void 0===e)return t;try{for(var n in t)if(void 0===e[n])throw new TypeError("Hotel ".concat(e.objectID," is missing ").concat(n," field"))}catch(e){r||console.error(e)}return Ee.__assign(Ee.__assign({},t),e)}function c(e){if(void 0===e)return"property";switch(e){case 0:return"country";case 23:return"city";case 64:case 1010:return"airport";case 199:case 232:case 251:case 1024:return"station";default:return"area"}}Object.defineProperty(t,"__esModule",{value:!0}),t.hitToPlaceSuggest=t.hitToHotelSuggest=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=void 0,t.isNotEmptyOrWhiteSpace=r,t.getTranslatedAttributes=function(e,t){for(var r=[],n=function(e){var n=t.map((function(t){return"".concat(t,".").concat(e)}));r.push.apply(r,n)},o=0,a=e;o<a.length;o++){n(a[o])}return r},t.toString=n,t.translatedArrayToString=o,t.getStringFromTranslatedArray=a,t.getValueFromTranslatedHightlightResult=i,t.attributeWithFallback=s,t.mergeTranslatedAttributes=function(e,t,r){for(var n={},a=0,i=r;a<i.length;a++){var u=i[a];n[u]=Ee.__spreadArray(Ee.__spreadArray([],s(e,u,r),!0),s(t,u,r),!0)}return o(n,r)},t.validateHit=u,t.placeTypeToPlaceTypeName=c,t.hitToHotelSuggest=function(e,t){var o=u(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),s=a(o.placeADN,t,-1),l=a(o.placeDN,t,1),f=r(l)?"".concat(l,", ").concat(s):s,d=i(o._highlightResult.hotelName,t);return{objectID:o.objectID.replace("".concat(o.objectType,":"),""),objectType:o.objectType,value:n(o.hotelName,t),highlightValue:d,placeDisplayName:f,placeTypeName:c()}},t.hitToPlaceSuggest=function(e,t){var o=u(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),s=a(o.placeADN,t,-1),l=a(o.placeDN,t,1),f=r(l)?"".concat(l,", ").concat(s):s,d=i(o._highlightResult.placeName,t);return{objectID:o.objectID.replace("".concat(o.objectType,":"),""),objectType:o.objectType,value:n(o.placeName,t),highlightValue:d,placeDisplayName:f,placeTypeName:c(o.placeType)}}})),cn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hasRequiredSearchParameters=void 0;t.hasRequiredSearchParameters=function(e){var t=e,r=t.checkIn,n=t.checkOut,o=t.rooms;return Boolean(r&&n&&o)}})),ln=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getTotalRate=void 0,t.getTotalRate=function(e){return e.base+e.hotelFees+e.taxes}})),fn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Ee.__exportStar(qe,t),Ee.__exportStar(He,t),Ee.__exportStar(yr,t),Ee.__exportStar(br,t),Ee.__exportStar(wr,t),Ee.__exportStar(Vr,t),Ee.__exportStar(Xr,t),Ee.__exportStar($r,t),Ee.__exportStar(Zr,t),Ee.__exportStar(sn,t),Ee.__exportStar(un,t),Ee.__exportStar(cn,t),Ee.__exportStar(ln,t)})),dn=t((function(e,t){function r(e,t){return void 0===e&&(e=""),void 0===t&&(t=500),{name:"ApiError",message:e,status:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.createBackendError=t.createApiError=void 0,t.createApiError=r,t.createBackendError=function(e,t){var n,o;return Ee.__awaiter(this,void 0,void 0,(function(){var a,i;return Ee.__generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,e.json()];case 1:return i=s.sent(),a=null!==(o=null!==(n=i.message)&&void 0!==n?n:e.statusText)&&void 0!==o?o:t,[3,3];case 2:return s.sent(),[3,3];case 3:return[2,r(a,e.status)]}}))}))}})),hn=r(Re),pn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.createAnchorRequestString=t.createSearchRequestString=t.prepareSearchParameters=void 0;var r=Ee.__importDefault(hn),n=Ee.__importDefault(Ae);function o(e,t,r){var n;e.checkIn,e.checkOut,e.dayDistance;var o=e.nights,a=Ee.__rest(e,["checkIn","checkOut","dayDistance","nights"]);return Ee.__assign(Ee.__assign(Ee.__assign({},a),(0,fn.shouldUseClientDates)(e,r)?(0,fn.getCheckInCheckOutDates)(e,t):{nights:o}),{rooms:null!==(n=e.rooms)&&void 0!==n?n:"2"})}function a(e){var t,r,o,a,i,s,u,c,l,f,d,h,p,v,g,m,y,b,_,w,O,P,T,S,D=e.profileKey,I=e.searchId,j=e.searchParameters,k=e.options,C=e.offset,E=e.attributes,x=(0,fn.removeEmpty)({offset:C,searchId:I,profileId:D,query:j.query,hotelId:j.hotelId,placeId:j.hotelId?void 0:j.placeId,checkIn:j.checkIn,checkOut:j.checkOut,rooms:j.rooms,dayDistance:j.dayDistance,nights:j.nights,sortField:j.sortField,sortOrder:j.sortOrder,boundingBox:null===(t=j.boundingBox)||void 0===t?void 0:t.join(","),currency:k.currency,language:k.language,variations:null===(r=k.variations)||void 0===r?void 0:r.join(","),starRating:null===(a=null===(o=j.filters)||void 0===o?void 0:o.starRating)||void 0===a?void 0:a.join(","),guestRating:null===(s=null===(i=j.filters)||void 0===i?void 0:i.guestRating)||void 0===s?void 0:s.join(","),propertyTypeId:null===(c=null===(u=j.filters)||void 0===u?void 0:u.propertyTypeId)||void 0===c?void 0:c.join(","),facilities:null===(f=null===(l=j.filters)||void 0===l?void 0:l.facilities)||void 0===f?void 0:f.join(","),themeIds:null===(h=null===(d=j.filters)||void 0===d?void 0:d.themeIds)||void 0===h?void 0:h.join(","),chainIds:null===(v=null===(p=j.filters)||void 0===p?void 0:p.chainIds)||void 0===v?void 0:v.join(","),noHostels:null===(g=j.filters)||void 0===g?void 0:g.noHostels,priceMin:null===(m=j.filters)||void 0===m?void 0:m.priceMin,priceMax:null===(y=j.filters)||void 0===y?void 0:y.priceMax,hotelName:null===(b=j.filters)||void 0===b?void 0:b.hotelName,freeCancellation:null===(_=j.filters)||void 0===_?void 0:_.freeCancellation,attributes:null==E?void 0:E.join(","),anonymousId:k.anonymousId,cugDeals:null===(w=j.cugDeals)||void 0===w?void 0:w.join(","),tier:j.tier,deviceType:k.deviceType,originId:j.originId,brand:k.brand,sortingBoost:(0,fn.generateSortingBoost)(j),preferredRate:j.preferredRate,label:null!==(O=j.label)&&void 0!==O?O:j.trafficSource,countryCode:k.countryCode,userId:j.userId,emailDomain:j.emailDomain,screenshots:j.screenshots,pageSize:j.pageSize,lat:null===(P=j.geolocation)||void 0===P?void 0:P.lat,lon:null===(T=j.geolocation)||void 0===T?void 0:T.lon,precision:null===(S=j.geolocation)||void 0===S?void 0:S.precision});return new n.default(x).toString()}function i(e,t){var n=e.baseUrl,o=e.endpoints;return Ee.__awaiter(this,void 0,void 0,(function(){var e,i,s,u,c,l,f,d;return Ee.__generator(this,(function(h){switch(h.label){case 0:return e=a(t),i=(0,Ue.getSapiOverrideParameter)(),s={credentials:"include"},i&&(s.method="POST",s.headers={"Content-Type":"application/json"},s.body=JSON.stringify({sapiOverride:i})),[4,(0,r.default)("https://".concat(n,"/").concat(o.search,"?").concat(e),s)];case 1:return(u=h.sent()).ok?[4,u.json()]:[3,3];case 2:return[2,h.sent()];case 3:return c=t.searchParameters,l=t.options,f=t.offset,d=t.attributes,l.logger.log({name:"SearchFailed",value:Ee.__assign(Ee.__assign({},c),{offset:f,attributes:d,language:l.language,currency:l.currency,deviceType:l.deviceType})}),[4,(0,dn.createBackendError)(u,"Search request failed")];case 4:throw h.sent()}}))}))}function s(e){var t,r,o,a,i,s,u,c,l,f,d=e.profileKey,h=e.searchId,p=e.searchParameters,v=e.options,g=e.attributes,m=(0,fn.removeEmpty)({searchId:h,profileId:d,query:p.query,hotelId:p.hotelId,placeId:p.hotelId?void 0:p.placeId,boundingBox:null===(t=p.boundingBox)||void 0===t?void 0:t.join(","),checkIn:p.checkIn,checkOut:p.checkOut,rooms:p.rooms,dayDistance:p.dayDistance,nights:p.nights,currency:v.currency,language:v.language,variations:null===(r=v.variations)||void 0===r?void 0:r.join(","),attributes:null==g?void 0:g.join(","),anonymousId:v.anonymousId,cugDeals:null===(o=p.cugDeals)||void 0===o?void 0:o.join(","),tier:p.tier,sapiOverride:(0,Ue.getSapiOverrideParameter)(!0),userId:p.userId,emailDomain:p.emailDomain,screenshots:p.screenshots,priceMin:null===(a=p.filters)||void 0===a?void 0:a.priceMin,priceMax:null===(i=p.filters)||void 0===i?void 0:i.priceMax,freeCancellation:null===(s=p.filters)||void 0===s?void 0:s.freeCancellation,deviceType:v.deviceType,originId:p.originId,brand:v.brand,sortingBoost:(0,fn.generateSortingBoost)(p),preferredRate:p.preferredRate,label:null!==(u=p.label)&&void 0!==u?u:p.trafficSource,countryCode:v.countryCode,lat:null===(c=p.geolocation)||void 0===c?void 0:c.lat,lon:null===(l=p.geolocation)||void 0===l?void 0:l.lon,precision:null===(f=p.geolocation)||void 0===f?void 0:f.precision});return new n.default(m).toString()}function u(e,t){var n=e.baseUrl,o=e.endpoints;return Ee.__awaiter(this,void 0,void 0,(function(){var e,a,i,u,c;return Ee.__generator(this,(function(l){switch(l.label){case 0:return e=s(t),[4,(0,r.default)("https://".concat(n,"/").concat(o.anchor,"?").concat(e))];case 1:return(a=l.sent()).ok?[4,a.json()]:[3,3];case 2:return[2,l.sent()];case 3:return i=t.searchParameters,u=t.options,c=t.attributes,u.logger.log({name:"AnchorSearchFailed",value:Ee.__assign(Ee.__assign({},i),{attributes:c,language:u.language,currency:u.currency,deviceType:u.deviceType})}),[4,(0,dn.createBackendError)(a,"Anchor request failed")];case 4:throw l.sent()}}))}))}t.prepareSearchParameters=o,t.createSearchRequestString=a,t.createAnchorRequestString=s,t.search=function(e){var t,r=this,n=e.getFeatureEnabled,a=e.profileKey,s=e.appConfig,c=e.offersClient,l=e.options,f=n("offers"),d=!1;return function(e,n){return void 0===n&&(n={}),Ee.__awaiter(r,void 0,void 0,(function(){function r(){var e=h.current().searchParameters;if(!(0,fn.hasRequiredSearchParameters)(e))throw new Error("Dates must be set by client, SDK or response");return e}var h,p,v,g,m,y,b,_,w,O,P,T,S,D=this;return Ee.__generator(this,(function(I){switch(I.label){case 0:return h=(0,fn.createState)({status:{},hotelIds:[]}),p=n.onStart,v=n.onAnchorReceived,g=n.onHotelsReceived,m=n.onOffersReceived,y=n.onComplete,b=0,_=o(e,s.client,l),w=(0,fn.generateSearchId)(),h.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof p&&p(h.current()),O=function(n,o,u){return void 0===n&&(n=0),Ee.__awaiter(D,void 0,void 0,(function(){var u,p,b,O,P,T,S;return Ee.__generator(this,(function(D){switch(D.label){case 0:return[4,i(s.sapiBackend,{searchId:w,profileKey:a,searchParameters:_,options:l,offset:n,attributes:o})];case 1:return u=D.sent(),d||(t=u.exchangeRates[l.currency],(null===(T=l.callbacks)||void 0===T?void 0:T.onConfigReceived)&&l.callbacks.onConfigReceived({lov:u.lov,exchangeRates:u.exchangeRates}),d=!0),(void 0===o||o.includes("anchor"))&&(h.update((function(e){e.anchor=u.anchor,e.anchorHotelId=u.anchorHotelId,e.anchorType=u.anchorType,e.hotelEntities=u.hotelEntities,e.searchParameters=Ee.__assign(Ee.__assign({},e.searchParameters),{checkIn:u.searchParameters.checkIn,checkOut:u.searchParameters.checkOut})})),"function"==typeof v&&v(h.current())),h.update((function(e){e.facets=u.facets,e.hotelEntities=u.hotelEntities,u.hotelIds&&(e.hotelIds=u.hotelIds),e.hotelsHaveStaticPosition=u.hotelsHaveStaticPosition,e.offset=u.offset,e.resultsCount=u.resultsCount,e.resultsCountTotal=u.resultsCountTotal})),"function"==typeof g&&g(h.current()),f&&void 0!==c?(p=h.get("hotelIds"),b=Ee.__assign(Ee.__assign({},r()),{searchId:w,hotelIds:p,metadata:e.metadata,anchorHotelId:h.get("anchorHotelId")}),[4,c.getOffers(b,(function(e){var r,n=(0,fn.buildOffersResponse)(e,Ee.__assign(Ee.__assign({},b),{priceBucketWidth:null===(r=h.get("anchor"))||void 0===r?void 0:r.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate}));h.update((function(t){t.hotelIds=n.hotelIds,t.hotelOfferEntities=Ee.__assign(Ee.__assign({},t.hotelOfferEntities),n.hotelOfferEntities),t.status.anchorComplete=e.status.anchorComplete,t.status.nonAnchorComplete=e.status.nonAnchorComplete})),"function"==typeof m&&m(h.current())}))]):[3,3];case 2:O=D.sent(),P=(0,fn.buildOffersResponse)(O,Ee.__assign(Ee.__assign({},b),{priceBucketWidth:null===(S=h.get("anchor"))||void 0===S?void 0:S.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate})),h.update((function(e){e.hotelIds=P.hotelIds,e.hotelOfferEntities=P.hotelOfferEntities})),D.label=3;case 3:return"function"==typeof y&&y(h.current()),[2,h.current()]}}))}))},P=function(n,o,p){return void 0===n&&(n=0),void 0===p&&(p=!0),Ee.__awaiter(D,void 0,void 0,(function(){var b,O,P=this;return Ee.__generator(this,(function(T){switch(T.label){case 0:return b=function(){return Ee.__awaiter(P,void 0,void 0,(function(){var t,n;return Ee.__generator(this,(function(o){switch(o.label){case 0:return[4,u(s.sapiBackend,{searchId:w,profileKey:a,searchParameters:_,options:l,attributes:["anchor","anchorHotelId","anchorType","hotelEntities","searchParameters"]})];case 1:return t=o.sent(),h.update((function(e){e.anchor=t.anchor,e.anchorHotelId=t.anchorHotelId,e.anchorType=t.anchorType,e.hotelEntities=Ee.__assign(Ee.__assign({},e.hotelEntities),t.hotelEntities),e.searchParameters=Ee.__assign(Ee.__assign({},e.searchParameters),{checkIn:t.searchParameters.checkIn,checkOut:t.searchParameters.checkOut})})),"function"==typeof v&&v(h.current()),f&&void 0!==c&&"hotel"===t.anchorType?(n=Ee.__assign(Ee.__assign({},r()),{metadata:e.metadata,anchorHotelId:t.anchorHotelId,searchId:w}),[4,c.getOffers(n,(function(e){var t=e.anchorHotelOfferEntity,r=e.status;h.update((function(e){var n;t&&(e.hotelOfferEntities=Ee.__assign(Ee.__assign({},e.hotelOfferEntities),((n={})[t.id]=t,n))),e.status.anchorComplete=r.anchorComplete})),"function"==typeof m&&m(h.current())}))]):[3,3];case 2:o.sent(),o.label=3;case 3:return[2,h.current()]}}))}))},O=function(){return Ee.__awaiter(P,void 0,void 0,(function(){var o,u,v,y,b,O,P;return Ee.__generator(this,(function(T){switch(T.label){case 0:return o=["facets","hotelEntities","hotelIds","hotelsHaveStaticPosition","offset","resultsCount","resultsCountTotal","searchParameters"],d||o.push("lov","exchangeRates"),[4,i(s.sapiBackend,{searchId:w,profileKey:a,searchParameters:_,options:l,offset:n,attributes:o})];case 1:return u=T.sent(),d||(t=u.exchangeRates[l.currency],(null===(O=l.callbacks)||void 0===O?void 0:O.onConfigReceived)&&l.callbacks.onConfigReceived({lov:u.lov,exchangeRates:u.exchangeRates}),d=!0),h.update((function(e){e.facets=u.facets,e.hotelEntities=p?Ee.__assign(Ee.__assign({},e.hotelEntities),u.hotelEntities):u.hotelEntities,u.hotelIds&&(e.hotelIds=u.hotelIds),e.hotelsHaveStaticPosition=u.hotelsHaveStaticPosition,e.offset=u.offset,e.resultsCount=u.resultsCount,e.resultsCountTotal=u.resultsCountTotal,e.searchParameters=Ee.__assign(Ee.__assign({},e.searchParameters),{checkIn:u.searchParameters.checkIn,checkOut:u.searchParameters.checkOut})})),"function"==typeof g&&g(h.current()),f&&void 0!==c?(v=Ee.__assign(Ee.__assign({},r()),{searchId:w,metadata:e.metadata,hotelIds:h.get("hotelIds")}),[4,c.getOffers(v,(function(e){var r,n=(0,fn.buildOffersResponse)(e,Ee.__assign(Ee.__assign({},v),{priceBucketWidth:null===(r=h.get("anchor"))||void 0===r?void 0:r.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate}));h.update((function(t){t.hotelIds=n.hotelIds,t.hotelOfferEntities=Ee.__assign(Ee.__assign({},t.hotelOfferEntities),n.hotelOfferEntities),t.status.nonAnchorComplete=e.status.nonAnchorComplete})),"function"==typeof m&&m(h.current())}))]):[3,3];case 2:y=T.sent(),b=(0,fn.buildOffersResponse)(y,Ee.__assign(Ee.__assign({},v),{priceBucketWidth:null===(P=h.get("anchor"))||void 0===P?void 0:P.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate})),h.update((function(e){e.hotelIds=b.hotelIds,e.hotelOfferEntities=p?Ee.__assign(Ee.__assign({},e.hotelOfferEntities),b.hotelOfferEntities):b.hotelOfferEntities})),T.label=3;case 3:return[2,h.current()]}}))}))},[4,void 0===o||o.includes("anchor")?Promise.all([b(),O()]):O()];case 1:return T.sent(),"function"==typeof y&&y(h.current()),[2,h.current()]}}))}))},T=(null===(S=l.variations)||void 0===S?void 0:S.includes("sapi4eva-load-anchor-separately-b"))?P:O,[4,d?T(_.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition","searchParameters"]):T(_.offset)];case 1:return I.sent(),[2,{loadOffers:function(n){var o,a;return Ee.__awaiter(this,void 0,void 0,(function(){var i,s,u,d;return Ee.__generator(this,(function(p){switch(p.label){case 0:if(!n)throw new Error("Hotel id must be provided");if(!f||!c)throw new Error("Offers loading is disabled");return i=n===h.get("anchorHotelId"),s=Ee.__assign(Ee.__assign({},r()),{searchId:w,metadata:e.metadata,getAllOffers:!0,hotelIds:i?[]:[n],anchorHotelId:i?n:void 0}),[4,c.getOffers(s)];case 1:return u=p.sent(),d=(0,fn.buildOffersResponse)(u,Ee.__assign(Ee.__assign({},s),{priceBucketWidth:null===(o=h.get("anchor"))||void 0===o?void 0:o.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate})),[2,null===(a=d.hotelOfferEntities)||void 0===a?void 0:a[n]]}}))}))},loadMore:function(){return Ee.__awaiter(this,void 0,void 0,(function(){return Ee.__generator(this,(function(e){return b+=h.get("resultsCount"),[2,T(b,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"],!1)]}))}))}}]}}))}))}}})),vn=t((function(e,t){e.exports=function(){function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(n().getItem(r)||"{}")};return{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=o(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function s(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,o).catch((function(){return s({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return s({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return s({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return s({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=n(),s=o&&o.miss||function(){return Promise.resolve()};return i.then((function(e){return s(e)})).then((function(){return i}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===v.WithinHeaders?n:{}},queryParameters:function(){return e===v.WithinQueryParameters?n:{}}}}function l(e){var t=0;return e((function r(){return t++,new Promise((function(n){setTimeout((function(){n(e(r))}),Math.min(100*t,1e3))}))}))}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(r){return f(e.then((function(e){return Promise.all([t(e,r),e])})).then((function(e){return e[1]})))}})}function d(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function p(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(r[o++])}))}var v={WithinQueryParameters:0,WithinHeaders:1};function g(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var m={Read:1,Write:2,Any:3},y=1,b=2,_=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:m.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||m.Any}}var P="DELETE",T="GET",S="POST",D="PUT";function I(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===y||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===_&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return O(e)})):t}}))}function j(e,t,n,o){var i=[],s=function(e,t){if(e.method!==T&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,o),u=function(e,t){var n=r(r({},e.headers),t.headers),o={};return Object.keys(n).forEach((function(e){var t=n[e];o[e.toLowerCase()]=t})),o}(e,o),c=n.method,l=n.method!==T?{}:r(r({},n.data),o.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),d=0,h=function t(r,a){var l=r.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:R(i)};var h={data:s,headers:u,method:c,url:E(l,n.path,f),connectTimeout:a(d,e.timeouts.connect),responseTimeout:a(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:r.length};return i.push(t),t},v={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var o=p(n);return n.isTimedOut&&d++,Promise.all([e.logger.info("Retryable failure",N(o)),e.hostsCache.set(l,w(l,n.isTimedOut?_:b))]).then((function(){return t(r,a)}))},onFail:function(e){throw p(e),function(e,t){var r=e.content,n=e.status,o=r;try{o=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(o,n,t)}(e,R(i))}};return e.requester.send(h).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,v)}))};return I(e.hostsCache,t).then((function(e){return h(a(e.statelessHosts).reverse(),e.getTimeout)}))}function k(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,i=e.responsesCache,s=e.timeouts,u=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:i,timeouts:s,userAgent:u,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var r=g(t,f.timeouts.read),n=function(){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&m.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&m.Write)})),e,g(t,f.timeouts.write))}};return f}function C(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function E(e,t,r){var n=x(r),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(o+="?".concat(n)),o}function x(e){return Object.keys(e).map((function(t){return p("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function R(e){return e.map((function(e){return N(e)}))}function N(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var M=function(e){return function(t,r){return e.transporter.write({method:S,path:"2/abtests",data:t},r)}},A=function(e){return function(t,r){return e.transporter.write({method:P,path:p("2/abtests/%s",t)},r)}},U=function(e){return function(t,r){return e.transporter.read({method:T,path:p("2/abtests/%s",t)},r)}},q=function(e){return function(t){return e.transporter.read({method:T,path:"2/abtests"},t)}},H=function(e){return function(t,r){return e.transporter.write({method:S,path:p("2/abtests/%s/stop",t)},r)}},B=function(e){return function(t){return e.transporter.read({method:T,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,r){return e.transporter.write({method:S,path:"1/strategies/personalization",data:t},r)}};function W(e){return function t(r){return e.request(r).then((function(n){if(void 0!==e.batch&&e.batch(n.hits),!e.shouldStop(n))return n.cursor?t({cursor:n.cursor}):t({page:(r.page||0)+1})}))}({})}var L=function(e){return function(t,o){var a=o||{},i=a.queryParameters,s=n(a,["queryParameters"]),u=r({acl:t},void 0!==i?{queryParameters:i}:{});return f(e.transporter.write({method:S,path:"1/keys",data:u},s),(function(t,r){return l((function(n){return ee(e)(t.key,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},z=function(e){return function(t,r,n){var o=g(n);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:S,path:"1/clusters/mapping",data:{cluster:r}},o)}},Y=function(e){return function(t,r,n){return e.transporter.write({method:S,path:"1/clusters/mapping/batch",data:{users:t,cluster:r}},n)}},G=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},r),(function(t,r){return Se(e)(t.taskID,r)}))}},K=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:r}},n),(function(r,n){return se(e)(t,{methods:{waitTask:ft}}).waitTask(r.taskID,n)}))}},J=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[ht.Rules]}))}},Q=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[ht.Settings]}))}},V=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[ht.Synonyms]}))}},X=function(e){return function(t,r){return t.method===T?e.transporter.read(t,r):e.transporter.write(t,r)}},$=function(e){return function(t,r){return f(e.transporter.write({method:P,path:p("1/keys/%s",t)},r),(function(r,n){return l((function(r){return ee(e)(t,n).then(r).catch((function(e){if(404!==e.status)throw e}))}))}))}},Z=function(e){return function(t,r,n){var o=r.map((function(e){return{action:"deleteEntry",body:{objectID:e}}}));return f(e.transporter.write({method:S,path:p("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:o}},n),(function(t,r){return Se(e)(t.taskID,r)}))}},ee=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/keys/%s",t)},r)}},te=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/task/%s",t.toString())},r)}},re=function(e){return function(t){return e.transporter.read({method:T,path:"/1/dictionaries/*/settings"},t)}},ne=function(e){return function(t){return e.transporter.read({method:T,path:"1/logs"},t)}},oe=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters/mapping/top"},t)}},ae=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/clusters/mapping/%s",t)},r)}},ie=function(e){return function(t){var r=t||{},o=r.retrieveMappings,a=n(r,["retrieveMappings"]);return!0===o&&(a.getClusters=!0),e.transporter.read({method:T,path:"1/clusters/mapping/pending"},a)}},se=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},ue=function(e){return function(t){return e.transporter.read({method:T,path:"1/keys"},t)}},ce=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters"},t)}},le=function(e){return function(t){return e.transporter.read({method:T,path:"1/indexes"},t)}},fe=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters/mapping"},t)}},de=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:r}},n),(function(r,n){return se(e)(t,{methods:{waitTask:ft}}).waitTask(r.taskID,n)}))}},he=function(e){return function(t,r){return f(e.transporter.write({method:S,path:"1/indexes/*/batch",data:{requests:t}},r),(function(t,r){return Promise.all(Object.keys(t.taskID).map((function(n){return se(e)(n,{methods:{waitTask:ft}}).waitTask(t.taskID[n],r)})))}))}},pe=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:t}},r)}},ve=function(e){return function(t,n){var o=t.map((function(e){return r(r({},e),{},{params:x(e.params||{})})}));return e.transporter.read({method:S,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},n)}},ge=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,i=a.facetName,s=a.facetQuery,u=n(a,["facetName","facetQuery"]);return se(e)(t.indexName,{methods:{searchForFacetValues:st}}).searchForFacetValues(i,s,r(r({},o),u))})))}},me=function(e){return function(t,r){var n=g(r);return n.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:P,path:"1/clusters/mapping"},n)}},ye=function(e){return function(t,r,n){var o=r.map((function(e){return{action:"addEntry",body:e}}));return f(e.transporter.write({method:S,path:p("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:o}},n),(function(t,r){return Se(e)(t.taskID,r)}))}},be=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/keys/%s/restore",t)},r),(function(r,n){return l((function(r){return ee(e)(t,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},_e=function(e){return function(t,r,n){var o=r.map((function(e){return{action:"addEntry",body:e}}));return f(e.transporter.write({method:S,path:p("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:o}},n),(function(t,r){return Se(e)(t.taskID,r)}))}},we=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("/1/dictionaries/%s/search",t),data:{query:r},cacheable:!0},n)}},Oe=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/clusters/mapping/search",data:{query:t}},r)}},Pe=function(e){return function(t,r){return f(e.transporter.write({method:D,path:"/1/dictionaries/*/settings",data:t},r),(function(t,r){return Se(e)(t.taskID,r)}))}},Te=function(e){return function(t,r){var o=Object.assign({},r),a=r||{},i=a.queryParameters,s=n(a,["queryParameters"]),u=i?{queryParameters:i}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:D,path:p("1/keys/%s",t),data:u},s),(function(r,n){return l((function(r){return ee(e)(t,n).then((function(e){return function(e){return Object.keys(o).filter((function(e){return-1!==c.indexOf(e)})).every((function(t){return e[t]===o[t]}))}(e)?Promise.resolve():r()}))}))}))}},Se=function(e){return function(t,r){return l((function(n){return te(e)(t,r).then((function(e){return"published"!==e.status?n():void 0}))}))}},De=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},r),(function(t,r){return ft(e)(t.taskID,r)}))}},Ie=function(e){return function(t){return W(r(r({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(r){return e.transporter.read({method:S,path:p("1/indexes/%s/browse",e.indexName),data:r},t)}}))}},je=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return W(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return ut(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},ke=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return W(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return ct(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},Ce=function(e){return function(t,r,o){var a=o||{},i=a.batchSize,s=n(a,["batchSize"]),u={taskIDs:[],objectIDs:[]};return f(function n(){var o,a=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(a.push(t[o]),a.length!==(i||1e3));o++);return 0===a.length?Promise.resolve(u):De(e)(a.map((function(e){return{action:r,body:e}})),s).then((function(e){return u.objectIDs=u.objectIDs.concat(e.objectIDs),u.taskIDs.push(e.taskID),o++,n(o)}))}(),(function(t,r){return Promise.all(t.taskIDs.map((function(t){return ft(e)(t,r)})))}))}},Ee=function(e){return function(t){return f(e.transporter.write({method:S,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,r){return ft(e)(t.taskID,r)}))}},xe=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=g(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/clear",e.indexName)},a),(function(t,r){return ft(e)(t.taskID,r)}))}},Re=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=g(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/clear",e.indexName)},a),(function(t,r){return ft(e)(t.taskID,r)}))}},Ne=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},r),(function(t,r){return ft(e)(t.taskID,r)}))}},Me=function(e){return function(t){return f(e.transporter.write({method:P,path:p("1/indexes/%s",e.indexName)},t),(function(t,r){return ft(e)(t.taskID,r)}))}},Ae=function(e){return function(t,r){return f(Ue(e)([t],r).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,r){return ft(e)(t.taskID,r)}))}},Ue=function(e){return function(t,r){var n=t.map((function(e){return{objectID:e}}));return Ce(e)(n,dt.DeleteObject,r)}},qe=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=g(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:P,path:p("1/indexes/%s/rules/%s",e.indexName,t)},i),(function(t,r){return ft(e)(t.taskID,r)}))}},He=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=g(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:P,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},i),(function(t,r){return ft(e)(t.taskID,r)}))}},Be=function(e){return function(t){return Ke(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Fe=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},We=function(e){return function(t,a){var i=a||{},s=i.query,u=i.paginate,c=n(i,["query","paginate"]),l=0;return function n(){return it(e)(s||"",r(r({},c),{},{page:l})).then((function(e){for(var r=0,a=Object.entries(e.hits);r<a.length;r++){var i=o(a[r],2),s=i[0],c=i[1];if(t(c))return{object:c,position:parseInt(s,10),page:l}}if(l++,!1===u||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return n()}))}()}},Le=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/indexes/%s/%s",e.indexName,t)},r)}},ze=function(){return function(e,t){for(var r=0,n=Object.entries(e.hits);r<n.length;r++){var a=o(n[r],2),i=a[0];if(a[1].objectID===t)return parseInt(i,10)}return-1}},Ye=function(e){return function(t,o){var a=o||{},i=a.attributesToRetrieve,s=n(a,["attributesToRetrieve"]),u=t.map((function(t){return r({indexName:e.indexName,objectID:t},i?{attributesToRetrieve:i}:{})}));return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:u}},s)}},Ge=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},r)}},Ke=function(e){return function(t){return e.transporter.read({method:T,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Je=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},r)}},Qe=function(e){return function(t,r){return f(Ve(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return ft(e)(t.taskID,r)}))}},Ve=function(e){return function(t,r){var o=r||{},a=o.createIfNotExists,i=n(o,["createIfNotExists"]),s=a?dt.PartialUpdateObject:dt.PartialUpdateObjectNoCreate;return Ce(e)(t,s,i)}},Xe=function(e){return function(t,i){var s=i||{},u=s.safe,c=s.autoGenerateObjectIDIfNotExist,l=s.batchSize,d=n(s,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,r,n,o){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:n,destination:r}},o),(function(t,r){return ft(e)(t.taskID,r)}))},v=Math.random().toString(36).substring(7),g="".concat(e.indexName,"_tmp_").concat(v),m=tt({appId:e.appId,transporter:e.transporter,indexName:g}),y=[],b=h(e.indexName,g,"copy",r(r({},d),{},{scope:["settings","synonyms","rules"]}));return y.push(b),f((u?b.wait(d):b).then((function(){var e=m(t,r(r({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return y.push(e),u?e.wait(d):e})).then((function(){var t=h(g,e.indexName,"move",d);return y.push(t),u?t.wait(d):t})).then((function(){return Promise.all(y)})).then((function(e){var t=o(e,3),r=t[0],n=t[1],i=t[2];return{objectIDs:n.objectIDs,taskIDs:[r.taskID].concat(a(n.taskIDs),[i.taskID])}})),(function(e,t){return Promise.all(y.map((function(e){return e.wait(t)})))}))}},$e=function(e){return function(t,n){return nt(e)(t,r(r({},n),{},{clearExistingRules:!0}))}},Ze=function(e){return function(t,n){return at(e)(t,r(r({},n),{},{clearExistingSynonyms:!0}))}},et=function(e){return function(t,r){return f(tt(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return ft(e)(t.taskID,r)}))}},tt=function(e){return function(t,r){var o=r||{},a=o.autoGenerateObjectIDIfNotExist,i=n(o,["autoGenerateObjectIDIfNotExist"]),s=a?dt.AddObject:dt.UpdateObject;if(s===dt.UpdateObject){var u=!0,c=!1,l=void 0;try{for(var d,h=t[Symbol.iterator]();!(u=(d=h.next()).done);u=!0)if(void 0===d.value.objectID)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}return Ce(e)(t,s,i)}},rt=function(e){return function(t,r){return nt(e)([t],r)}},nt=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingRules,s=g(n(o,["forwardToReplicas","clearExistingRules"]));return a&&(s.queryParameters.forwardToReplicas=1),i&&(s.queryParameters.clearExistingRules=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},s),(function(t,r){return ft(e)(t.taskID,r)}))}},ot=function(e){return function(t,r){return at(e)([t],r)}},at=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingSynonyms,s=o.replaceExistingSynonyms,u=g(n(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return a&&(u.queryParameters.forwardToReplicas=1),(s||i)&&(u.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},u),(function(t,r){return ft(e)(t.taskID,r)}))}},it=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},st=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},ut=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},r)}},ct=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},r)}},lt=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=g(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:D,path:p("1/indexes/%s/settings",e.indexName),data:t},i),(function(t,r){return ft(e)(t.taskID,r)}))}},ft=function(e){return function(t,r){return l((function(n){return function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/indexes/%s/task/%s",e.indexName,t.toString())},r)}}(e)(t,r).then((function(e){return"published"!==e.status?n():void 0}))}))}},dt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},ht={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},pt=1,vt=2,gt=3;function mt(e,t,n){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,o=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=o(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=gt,{debug:function(e,t){return pt>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return vt>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:s({caches:[i({key:"".concat("4.14.0","-").concat(e)}),u()]}),userAgent:C("4.14.0").add({segment:"Browser"})},l=r(r({},a),n),f=function(){return function(e){return function(e){var t=e.region||"us",n=c(v.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"personalization.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{getPersonalizationStrategy:B,setPersonalizationStrategy:F}}))}};return function(e){var t=e.appId,n=c(void 0!==e.authMode?e.authMode:v.WithinHeaders,t,e.apiKey),o=k(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:m.Read},{url:"".concat(t,".algolia.net"),accept:m.Write}].concat(d([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:o,appId:t,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}},e.methods)}(r(r({},l),{},{methods:{search:ve,searchForFacetValues:ge,multipleBatch:he,multipleGetObjects:pe,multipleQueries:ve,copyIndex:K,copySettings:Q,copySynonyms:V,copyRules:J,moveIndex:de,listIndices:le,getLogs:ne,listClusters:ce,multipleSearchForFacetValues:ge,getApiKey:ee,addApiKey:L,listApiKeys:ue,updateApiKey:Te,deleteApiKey:$,restoreApiKey:be,assignUserID:z,assignUserIDs:Y,getUserID:ae,searchUserIDs:Oe,listUserIDs:fe,getTopUserIDs:oe,removeUserID:me,hasPendingMappings:ie,clearDictionaryEntries:G,deleteDictionaryEntries:Z,getDictionarySettings:re,getAppTask:te,replaceDictionaryEntries:ye,saveDictionaryEntries:_e,searchDictionaryEntries:we,setDictionarySettings:Pe,waitAppTask:Se,customRequest:X,initIndex:function(e){return function(t){return se(e)(t,{methods:{batch:De,delete:Me,findAnswers:Fe,getObject:Le,getObjects:Ye,saveObject:et,saveObjects:tt,search:it,searchForFacetValues:st,waitTask:ft,setSettings:lt,getSettings:Ke,partialUpdateObject:Qe,partialUpdateObjects:Ve,deleteObject:Ae,deleteObjects:Ue,deleteBy:Ne,clearObjects:Ee,browseObjects:Ie,getObjectPosition:ze,findObject:We,exists:Be,saveSynonym:ot,saveSynonyms:at,getSynonym:Je,searchSynonyms:ct,browseSynonyms:ke,deleteSynonym:He,clearSynonyms:Re,replaceAllObjects:Xe,replaceAllSynonyms:Ze,searchRules:ut,getRule:Ge,deleteRule:qe,saveRule:rt,saveRules:nt,replaceAllRules:$e,browseRules:je,clearRules:xe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",n=c(v.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{addABTest:M,getABTest:U,getABTests:q,stopABTest:H,deleteABTest:A}}))}},initPersonalization:f,initRecommendation:function(){return function(e){return l.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),f()(e)}}}}))}return mt.version="4.14.0",mt}()})),gn=vn,mn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0;var r=Ee.__importDefault(gn);function n(e){return(0,fn.getTranslatedAttributes)(e,["placeName","hotelName"])}function o(e){var t=(0,fn.getTranslatedAttributes)(e,["placeName","placeADN","placeDN","hotelName"]);return Ee.__spreadArray(["objectType","objectID","placeType"],t,!0)}function a(e){var t="isDeleted != 1";if(null==e?void 0:e.length){var r=null==e?void 0:e.map((function(e){return'objectType: "'.concat(e,'"')})).join(" OR ");t="".concat(t," AND (").concat(r,")")}return t}function i(e,t,r){var i=this,s=e.search,u=t.autocompleteIndex,c=r.languages,l=r.suggestsTypes,f=r.suggestsCount,d=void 0===f?6:f;return function(e){return Ee.__awaiter(i,void 0,void 0,(function(){var t,r,i;return Ee.__generator(this,(function(f){switch(f.label){case 0:return t=[{indexName:u,params:{query:e,filters:a(l),hitsPerPage:d,attributesToRetrieve:o(c),attributesToHighlight:n(c)}}],[4,s(t)];case 1:return r=f.sent().results,[2,null===(i=r[0])||void 0===i?void 0:i.hits.map((function(e){return"hotel"===e.objectType?(0,fn.hitToHotelSuggest)(e,c):(0,fn.hitToPlaceSuggest)(e,c)}))]}}))}))}}t.suggest=function(e){var t=this,n=e.appConfig,o=e.options,a=(0,r.default)(n.algolia.appId,n.algolia.apiKey,o.algoliaClientOptions);return function(e,r,s){return Ee.__awaiter(t,void 0,void 0,(function(){var t;return Ee.__generator(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,i(a,n.algolia,{suggestsCount:r,suggestsTypes:s,languages:o.languages})(e)];case 1:return[2,u.sent()];case 2:throw t=u.sent(),(0,dn.createApiError)(null==t?void 0:t.message,null==t?void 0:t.status);case 3:return[2]}}))}))}}})),yn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var r=Ee.__importDefault(hn),n=Ee.__importDefault(Ae);function o(e,t,r){var o,a,i=t.hotelId,s=t.checkIn,u=t.checkOut,c=t.rooms,l=t.providerCode,f=t.cugDeals,d=t.tier,h=t.clickedOfferId,p=t.clickedOfferBaseRate,v=t.clickedOfferTaxes,g=t.clickedOfferHotelFees,m=t.preHeat,y=t.userId,b=t.emailDomain,_=t.searchId,w=(0,fn.removeEmpty)({hotelId:i,checkIn:s,checkOut:u,rooms:c,providerCode:l,cugDeals:f,tier:d,clickedOfferId:h,clickedOfferBaseRate:p,clickedOfferHotelFees:g,clickedOfferTaxes:v,deviceType:r.deviceType,language:r.language,currency:r.currency,aid:r.anonymousId,variations:null===(o=r.variations)||void 0===o?void 0:o.join(","),sapiOverride:(0,Ue.getSapiOverrideParameter)(),preHeat:m,label:null!==(a=t.label)&&void 0!==a?a:t.trafficSource,userId:y,emailDomain:b,searchId:_,profileId:e});return new n.default(w).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,n=e.appConfig,a=e.profileKey,i=e.options;return function(e){return Ee.__awaiter(t,void 0,void 0,(function(){var t,s,u,c,l;return Ee.__generator(this,(function(f){switch(f.label){case 0:return t=null!==(l=e.searchId)&&void 0!==l?l:(0,fn.generateSearchId)(),s=o(a,Ee.__assign(Ee.__assign({},e),{searchId:t}),i),[4,(0,r.default)("https://".concat(n.sapiBackend.baseUrl,"/").concat(n.sapiBackend.endpoints.roomsOffers,"?").concat(s))];case 1:return(u=f.sent()).ok?[4,u.json()]:[3,3];case 2:return c=f.sent(),[2,Ee.__assign({searchId:t,hotelId:e.hotelId,anonymousId:i.anonymousId},c)];case 3:return[4,(0,dn.createBackendError)(u,"Failed to get rooms offers")];case 4:throw f.sent()}}))}))}}})),bn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hotel=t.createRequestString=t.safToSapiHotel=void 0;var r=Ee.__importDefault(hn),n=Ee.__importDefault(Ae);function o(e,t){var r=e.checkInInst,n=e.checkInSpInst,o=e.feesMnd,a=e.feesOpt,i=e.policies,s=e.hotelName,u=e.placeDN,c=e.address,l=e.placeADName,f=e.propertyType,d=e.facilities,h=e.sentiments,p=e.themes,v=Ee.__assign(Ee.__assign({},e),{checkInInst:r&&(0,fn.toString)(r,t),checkInSpInst:n&&(0,fn.toString)(n,t),feesMnd:o&&(0,fn.toString)(o,t),feesOpt:a&&(0,fn.toString)(a,t),hotelName:(0,fn.toString)(s,t),policies:i&&(0,fn.toString)(i,t),placeDisplayName:u&&(0,fn.translatedArrayToString)(u,t),displayAddress:c&&l&&(0,fn.mergeTranslatedAttributes)(c,l,t),facilities:null==d?void 0:d.map((function(e){return Ee.__assign(Ee.__assign({},e),{value:(0,fn.toString)(e.value,t)})})),sentiments:null==h?void 0:h.map((function(e){return Ee.__assign(Ee.__assign({},e),{value:(0,fn.toString)(e.value,t)})})),themes:null==p?void 0:p.map((function(e){return Ee.__assign(Ee.__assign({},e),{value:(0,fn.toString)(e.value,t)})})),propertyType:f&&Ee.__assign(Ee.__assign({},f),{value:(0,fn.toString)(f.value,t)})});return(0,fn.omit)(["placeDN","placeADName","address"],v)}function a(e,t){var r,o=(0,fn.removeEmpty)({id:e,language:t.languages.join(","),attributes:["objectID","address","country","guestRating","isDeleted","starRating","_geoloc","placeADName","checkInSpInst","checkInMinAge","checkOutTime","checkInInst","checkInTime","checkInEnd","feesOpt","policies","phone","imageURIs","placeDN","reviewCount","chainID","parentChainID","lastBooked","feesMnd","reviewCountBkt","hotelName","sentiments","facilities","placeID","guestType","themes","propertyType","pricing","currency"].join(","),variations:null===(r=t.variations)||void 0===r?void 0:r.join(",")});return new n.default(o).toString()}t.safToSapiHotel=o,t.createRequestString=a,t.hotel=function(e){var t=this,n=e.appConfig,i=e.options;return function(e){return Ee.__awaiter(t,void 0,void 0,(function(){var t,s;return Ee.__generator(this,(function(u){switch(u.label){case 0:return t=a(e,i),[4,(0,r.default)("https://".concat(n.saf.baseUrl,"/").concat(n.saf.endpoints.hotel,"?").concat(t))];case 1:return(s=u.sent()).ok?[4,s.json()]:[3,3];case 2:return[2,o(u.sent(),i.languages)];case 3:return[4,(0,dn.createBackendError)(s,"Failed to fetch hotel data")];case 4:throw u.sent()}}))}))}}})),_n=t((function(e,t){function r(e,t){var r,n=e.hotelId,o=e.isAnchor,a=e.freeCancellation,i=e.rooms,s=void 0===i?t.client.defaultRooms:i,u=Ee.__rest(e,["hotelId","isAnchor","freeCancellation","rooms"]),c=(0,fn.getCheckInCheckOutDates)(e,t.client),l=c.checkIn,f=c.checkOut,d=Ee.__assign(Ee.__assign({},u),{checkIn:l,checkOut:f,rooms:s,label:null!==(r=e.label)&&void 0!==r?r:e.trafficSource});return a&&(d.filters={freeCancellation:!0}),e.searchId||(d.searchId=(0,fn.generateSearchId)()),o?d.anchorHotelId=n:d.hotelIds=[n],d}Object.defineProperty(t,"__esModule",{value:!0}),t.offers=t.getOffersParameters=void 0,t.getOffersParameters=r,t.offers=function(e){var t=this,n=e.offersClient,o=e.appConfig;return function(e,a){return void 0===a&&(a={}),Ee.__awaiter(t,void 0,void 0,(function(){var t,i,s,u,c,l,f,d;return Ee.__generator(this,(function(h){switch(h.label){case 0:return n?(t=e.isAnchor,i=a.onStart,s=a.onOffersReceived,u=a.onComplete,c=r(e,o),"function"==typeof i&&i(c),[4,n.getOffers(c,(function(e){var r;"function"==typeof s&&s(t?e.anchorHotelOfferEntity:null===(r=e.hotelOfferEntities)||void 0===r?void 0:r[0])}))]):[2];case 1:return l=h.sent(),"function"==typeof u&&u(t?l.anchorHotelOfferEntity:null===(f=l.hotelOfferEntities)||void 0===f?void 0:f[0]),[2,t?l.anchorHotelOfferEntity:null===(d=l.hotelOfferEntities)||void 0===d?void 0:d[0]]}}))}))}}})),wn=function(e,t){return wn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},wn(e,t)};function On(e,t){function r(){this.constructor=e}wn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function Pn(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function Tn(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pn(arguments[t]));return e}var Sn=function(e,t){this.target=t,this.type=e},Dn=function(e){function t(t,r){var n=e.call(this,"error",r)||this;return n.message=t.message,n.error=t,n}return On(t,e),t}(Sn),In=function(e){function t(t,r,n){void 0===t&&(t=1e3),void 0===r&&(r="");var o=e.call(this,"close",n)||this;return o.wasClean=!0,o.code=t,o.reason=r,o}return On(t,e),t}(Sn),jn=function(){if("undefined"!=typeof WebSocket)return WebSocket},kn={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},Cn=function(){function e(e,t,r){var n=this;void 0===r&&(r={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){n._debug("open event");var t=n._options.minUptime,r=void 0===t?kn.minUptime:t;clearTimeout(n._connectTimeout),n._uptimeTimeout=setTimeout((function(){return n._acceptOpen()}),r),n._ws.binaryType=n._binaryType,n._messageQueue.forEach((function(e){return n._ws.send(e)})),n._messageQueue=[],n.onopen&&n.onopen(e),n._listeners.open.forEach((function(t){return n._callEventListener(e,t)}))},this._handleMessage=function(e){n._debug("message event"),n.onmessage&&n.onmessage(e),n._listeners.message.forEach((function(t){return n._callEventListener(e,t)}))},this._handleError=function(e){n._debug("error event",e.message),n._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),n.onerror&&n.onerror(e),n._debug("exec error listeners"),n._listeners.error.forEach((function(t){return n._callEventListener(e,t)})),n._connect()},this._handleClose=function(e){n._debug("close event"),n._clearTimeouts(),n._shouldReconnect&&n._connect(),n.onclose&&n.onclose(e),n._listeners.close.forEach((function(t){return n._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,r=void 0===t?kn.maxEnqueuedMessages:t;this._messageQueue.length<r&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,r,n=this._listeners[e.type];if(n)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(n),a=o.next();!a.done;a=o.next()){var i=a.value;this._callEventListener(e,i)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,Tn(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,r=void 0===t?kn.reconnectionDelayGrowFactor:t,n=e.minReconnectionDelay,o=void 0===n?kn.minReconnectionDelay:n,a=e.maxReconnectionDelay,i=void 0===a?kn.maxReconnectionDelay:a,s=0;return this._retryCount>0&&(s=o*Math.pow(r,this._retryCount-1))>i&&(s=i),this._debug("next delay",s),s},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,r=t.maxRetries,n=void 0===r?kn.maxRetries:r,o=t.connectionTimeout,a=void 0===o?kn.connectionTimeout:o,i=t.WebSocket,s=void 0===i?jn():i;if(this._retryCount>=n)this._debug("max retries reached",this._retryCount,">=",n);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),!function(e){return void 0!==e&&!!e&&2===e.CLOSING}(s))throw Error("No valid WebSocket class provided");this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new s(t,e._protocols):new s(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),a))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new Dn(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new In(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),En=r(Object.freeze({__proto__:null,default:Cn})),xn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.offersClient=t.sapiResponseToHotelOfferEntity=t.createRequest=t.encodeMetadata=void 0;var r,n=Ee.__importDefault(Ae),o=Ee.__importDefault(En);function a(e){return encodeURIComponent(Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).join("&"))}function i(e,t,r){var n,o={checkIn:e.checkIn,checkOut:e.checkOut,anchorHotelId:e.anchorHotelId,hotelIds:e.hotelIds,rooms:e.rooms,searchId:e.searchId,cugDeals:e.cugDeals,tier:e.tier,language:t.language,deviceType:t.deviceType,anonymousId:t.anonymousId,currency:t.currency,originId:e.originId,brand:t.brand,clientRequestId:r,sortingBoost:(0,Zr.generateSortingBoost)(e),getAllOffers:Boolean(e.getAllOffers),preferredRate:e.preferredRate,label:e.label,countryCode:t.countryCode,variations:t.variations};e.metadata&&(o.metadata=a(e.metadata));try{n=JSON.stringify(o)}catch(e){console.log("WEBSOCKET: error serialising request")}return n}function s(e){var t;return{availableOffersCount:e.availableOffersCount,anchorRate:e.anchorRate,id:e.id,offers:null===(t=e.offers)||void 0===t?void 0:t.map((function(t){return function(e,t){var r;return(0,br.omit)(["roomID","occupancy"],Ee.__assign(Ee.__assign({},e),{roomName:null===(r=null==t?void 0:t[e.roomID])||void 0===r?void 0:r.name}))}(t,e.rooms)})),discount:e.discount}}!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(r||(r={})),t.encodeMetadata=a,t.createRequest=i,t.sapiResponseToHotelOfferEntity=s,t.offersClient=function(e,t){if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var a=(0,$r.removeEmpty)({sapiOverride:(0,Ue.getSapiOverrideParameter)(!0)}),u=new n.default(a).toString(),c="wss://".concat(e.baseUrl,"/").concat(e.endpoints.offers,"?").concat(u),l=new o.default(c,[],{maxRetries:15,WebSocket:t.WebSocket}),f={},d={};function h(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"sapi",code:e.code,reason:e.reason,wasClean:e.wasClean}})}function p(e){t.logger.log({name:"WebsocketError",value:Ee.__assign(Ee.__assign({},e),{service:"sapi"})})}function v(){for(var e=0,t=Object.keys(f);e<t.length;e++){var r=t[e],n=f[r];void 0!==n&&l.send(n)}}function g(e){var t;try{t=JSON.parse(e.data)}catch(e){return void console.log("WEBSOCKET: error parsing message")}var r=d[t.clientRequestId];"function"==typeof r&&r(t)}return l.addEventListener("open",v),l.addEventListener("close",h),l.addEventListener("error",p),l.addEventListener("message",g),{getOffers:function(e,n){return Ee.__awaiter(this,void 0,void 0,(function(){var o,a;return Ee.__generator(this,(function(u){return o={status:{anchorComplete:!1,nonAnchorComplete:!1}},a=(0,Qr.v4)(),f[a]=i(e,t,a),[2,new Promise((function(t){d[a]=function(r){var i,u;if(void 0!==r)if(r.status.complete)t(o),f[a]=void 0,d[a]=void 0;else{var c=null===(i=r.results)||void 0===i?void 0:i.find((function(t){return t.id===e.anchorHotelId}));c?(o.anchorHotelOfferEntity=s(c),o.status.anchorComplete||(o.status.anchorComplete=Boolean(r.status.anchorComplete))):(o.hotelOfferEntities=null===(u=r.results)||void 0===u?void 0:u.map((function(e){return s(e)})),o.status.nonAnchorComplete||(o.status.nonAnchorComplete=Boolean(r.status.nonAnchorComplete))),"function"==typeof n&&n(Ee.__assign({},o))}};var i=f[a];void 0!==i&&(l.readyState===r.Open?l.send(i):l.readyState===r.Closed&&(l._connectLock=!1,l.reconnect()))}))]}))}))}}}})),Rn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=t.variationsToArray=void 0;var r={log:function(){}};function n(e){void 0===e&&(e={});var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push("".concat(r,"-").concat(e[r]));return t}t.variationsToArray=n,t.sapi=function(e,t){var o,a,i,s,u,c,l;return Ee.__awaiter(this,void 0,void 0,(function(){function f(e){return h.client.features.includes(e)}function d(){var e,t;if(f("search")){if((null===(e=v.options.variations)||void 0===e?void 0:e.includes("sapi4eva-room-mapping-rsp-v8-1-a"))||(null===(t=v.options.variations)||void 0===t?void 0:t.includes("sapi4eva-room-mapping-rsp-v8-1-b"))){return function(e,t){return void 0===t&&(t={}),Ee.__awaiter(this,void 0,void 0,(function(){return Ee.__generator(this,(function(r){return[2,(0,pn.search)(v)(e,Ee.__assign(Ee.__assign({},t),{onComplete:function(e){var r,n,o=e.anchorHotelId,a=e.hotelOfferEntities,i=e.searchParameters,s=e.offset;if(!(0,fn.hasRequiredSearchParameters)(i))throw new Error("Dates must be set by client, SDK or response");if(o&&0===s){var u=a[o],c=null==u?void 0:u.offers.find((function(e){return"FHT"===e.intermediaryProvider}));if(c)try{(0,yn.rooms)(v)({hotelId:o,checkIn:i.checkIn,checkOut:i.checkOut,rooms:i.rooms,cugDeals:null===(r=i.cugDeals)||void 0===r?void 0:r.join(","),tier:i.tier,preHeat:1,label:null!==(n=i.label)&&void 0!==n?n:i.trafficSource,clickedOfferId:c.id,clickedOfferBaseRate:c.rate.base,clickedOfferHotelFees:c.rate.hotelFees,clickedOfferTaxes:c.rate.taxes})}catch(e){}}"function"==typeof t.onComplete&&t.onComplete(e)}}))]}))}))}}return(0,pn.search)(v)}return function(){throw new Error("Search is not enabled for this profile key")}}var h,p,v;return Ee.__generator(this,(function(g){if(!e)throw new Error("Profile key is required");return h=(0,xe.getAppConfig)(e,t.initWithAppConfig),p=Ee.__assign(Ee.__assign({},t),{logger:null!==(o=t.logger)&&void 0!==o?o:r,variations:n(t.variations),currency:null!==(i=null===(a=t.currency)||void 0===a?void 0:a.toUpperCase())&&void 0!==i?i:"USD",deviceType:null!==(s=t.deviceType)&&void 0!==s?s:"desktop",countryCode:t.countryCode,pageSize:null!==(u=t.pageSize)&&void 0!==u?u:20,getTotalRate:null!==(c=t.getTotalRate)&&void 0!==c?c:fn.getTotalRate,languages:Ee.__spreadArray(Ee.__spreadArray([t.language],null!==(l=h.client.fallbackLanguages[t.language])&&void 0!==l?l:[],!0),["en"],!1)}),v={appConfig:h,getFeatureEnabled:f,profileKey:e,options:p,offersClient:f("offers")?(0,xn.offersClient)(h.sapiBackend,p):void 0},[2,{rooms:f("rooms")?(0,yn.rooms)(v):function(){throw new Error("Rooms search is not enabled for this profile key")},search:d(),suggest:f("suggests")?(0,mn.suggest)(v):function(){throw new Error("Autosuggest is not enabled for this profile key")},hotel:f("get-hotel")?(0,bn.hotel)(v):function(){throw new Error("Get hotel is not allowed for this profile key")},offers:f("offers")?(0,_n.offers)(v):function(){throw new Error("Get offers is not allowed for this profile key")}}]}))}))}})),Nn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Mn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),An=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Un=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),qn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Hn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Bn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Fn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Wn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Ee.__exportStar(Nn,t),Ee.__exportStar(Mn,t),Ee.__exportStar(An,t),Ee.__exportStar(Un,t),Ee.__exportStar(qn,t),Ee.__exportStar(Hn,t),Ee.__exportStar(Bn,t),Ee.__exportStar(Fn,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0,(0,_r.enableES5)(),Ee.__exportStar(Rn,t),Ee.__exportStar(xe,t),Ee.__exportStar(Wn,t),Object.defineProperty(t,"generateSearchId",{enumerable:!0,get:function(){return fn.generateSearchId}})})))}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).sapi=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}function r(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};var a=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function u(e){return this instanceof u?(this.v=e,this):new u(e)}var c=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var l=Object.freeze({__proto__:null,__extends:function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return o},__rest:function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},__decorate:function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},__param:function(e,t){return function(r,n){t(r,n,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},__createBinding:a,__exportStar:function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)},__values:i,__read:s,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)n[o]=a[i];return n},__spreadArray:function(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},__await:u,__asyncGenerator:function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof u?Promise.resolve(e.value.v).then(c,l):f(a[0][2],e)}(o[e](t))}catch(e){f(a[0][3],e)}}function c(e){s("next",e)}function l(e){s("throw",e)}function f(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:u(e[n](t)),done:"return"===n}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=i(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return c(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},__classPrivateFieldSet:function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},__classPrivateFieldIn:function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}});function f(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if("production"!==process.env.NODE_ENV){var o=ae[e],a=o?"function"==typeof o?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function d(e){return!!e&&!!e[ne]}function h(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===ie}(e)||Array.isArray(e)||!!e[re]||!!e.constructor[re]||_(e)||w(e))}function p(e,t,r){void 0===r&&(r=!1),0===v(e)?(r?Object.keys:se)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function v(e){var t=e[ne];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:_(e)?2:w(e)?3:0}function g(e,t){return 2===v(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){return 2===v(e)?e.get(t):e[t]}function y(e,t,r){var n=v(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function b(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function _(e){return $&&e instanceof Map}function w(e){return Z&&e instanceof Set}function O(e){return e.o||e.t}function P(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=ue(e);delete t[ne];for(var r=se(t),n=0;n<r.length;n++){var o=r[n],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function T(e,t){return void 0===t&&(t=!1),I(e)||d(e)||!h(e)||(v(e)>1&&(e.set=e.add=e.clear=e.delete=S),Object.freeze(e),t&&p(e,(function(e,t){return T(t,!0)}),!0)),e}function S(){f(2)}function I(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function D(e){var t=ce[e];return t||f(18,e),t}function k(e,t){ce[e]||(ce[e]=t)}function j(){return"production"===process.env.NODE_ENV||V||f(0),V}function C(e,t){t&&(D("Patches"),e.u=[],e.s=[],e.v=t)}function E(e){x(e),e.p.forEach(N),e.p=null}function x(e){e===V&&(V=e.l)}function R(e){return V={p:[],l:V,h:e,m:!0,_:0}}function N(e){var t=e[ne];0===t.i||1===t.i?t.j():t.O=!0}function M(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||D("ES5").S(t,e,n),n?(r[ne].P&&(E(t),f(4)),h(e)&&(e=A(t,e),t.l||q(t,e)),t.u&&D("Patches").M(r[ne].t,e,t.u,t.s)):e=A(t,r,[]),E(t),t.u&&t.v(t.u,t.s),e!==te?e:void 0}function A(e,t,r){if(I(t))return t;var n=t[ne];if(!n)return p(t,(function(o,a){return U(e,n,t,o,a,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return q(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=P(n.k):n.o;p(3===n.i?new Set(o):o,(function(t,a){return U(e,n,o,t,a,r)})),q(e,o,!1),r&&e.u&&D("Patches").R(n,r,e.u,e.s)}return n.o}function U(e,t,r,n,o,a){if("production"!==process.env.NODE_ENV&&o===r&&f(5),d(o)){var i=A(e,o,a&&t&&3!==t.i&&!g(t.D,n)?a.concat(n):void 0);if(y(r,n,i),!d(i))return;e.m=!1}if(h(o)&&!I(o)){if(!e.h.F&&e._<1)return;A(e,o),t&&t.A.l||q(e,o)}}function q(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&T(t,r)}function H(e,t){var r=e[ne];return(r?O(r):e)[t]}function B(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function F(e){e.P||(e.P=!0,e.l&&F(e.l))}function W(e){e.o||(e.o=P(e.t))}function L(e,t,r){var n=_(t)?D("MapSet").N(t,r):w(t)?D("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:j(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,a=le;r&&(o=[n],a=fe);var i=Proxy.revocable(o,a),s=i.revoke,u=i.proxy;return n.k=u,n.j=s,u}(t,r):D("ES5").J(t,r);return(r?r.A:j()).p.push(n),n}function z(e){return d(e)||f(22,e),function e(t){if(!h(t))return t;var r,n=t[ne],o=v(t);if(n){if(!n.P&&(n.i<4||!D("ES5").K(n)))return n.t;n.I=!0,r=Y(t,o),n.I=!1}else r=Y(t,o);return p(r,(function(t,o){n&&m(n.t,t)===o||y(r,t,e(o))})),3===o?new Set(r):r}(e)}function Y(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return P(e)}function G(){function e(e,t){var r=a[e];return r?r.enumerable=t:a[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[ne];return"production"!==process.env.NODE_ENV&&o(t),le.get(t,e)},set:function(t){var r=this[ne];"production"!==process.env.NODE_ENV&&o(r),le.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][ne];if(!o.P)switch(o.i){case 5:n(o)&&F(o);break;case 4:r(o)&&F(o)}}}function r(e){for(var t=e.t,r=e.k,n=se(r),o=n.length-1;o>=0;o--){var a=n[o];if(a!==ne){var i=t[a];if(void 0===i&&!g(t,a))return!0;var s=r[a],u=s&&s[ne];if(u?u.t!==i:!b(s,i))return!0}}var c=!!t[ne];return n.length!==se(t).length+(c?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);if(r&&!r.get)return!0;for(var n=0;n<t.length;n++)if(!t.hasOwnProperty(n))return!0;return!1}function o(e){e.O&&f(3,JSON.stringify(O(e)))}var a={};k("ES5",{J:function(t,r){var n=Array.isArray(t),o=function(t,r){if(t){for(var n=Array(r.length),o=0;o<r.length;o++)Object.defineProperty(n,""+o,e(o,!0));return n}var a=ue(r);delete a[ne];for(var i=se(a),s=0;s<i.length;s++){var u=i[s];a[u]=e(u,t||!!a[u].enumerable)}return Object.create(Object.getPrototypeOf(r),a)}(n,t),a={i:n?5:4,A:r?r.A:j(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,ne,{value:a,writable:!0}),o},S:function(e,r,o){o?d(r)&&r[ne].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[ne];if(r){var o=r.t,a=r.k,i=r.D,s=r.i;if(4===s)p(a,(function(t){t!==ne&&(void 0!==o[t]||g(o,t)?i[t]||e(a[t]):(i[t]=!0,F(r)))})),p(o,(function(e){void 0!==a[e]||g(a,e)||(i[e]=!1,F(r))}));else if(5===s){if(n(r)&&(F(r),i.length=!0),a.length<o.length)for(var u=a.length;u<o.length;u++)i[u]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var l=Math.min(a.length,o.length),f=0;f<l;f++)a.hasOwnProperty(f)||(i[f]=!0),void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}function K(){function e(t){if(!h(t))return t;if(Array.isArray(t))return t.map(e);if(_(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(w(t))return new Set(Array.from(t).map(e));var r=Object.create(Object.getPrototypeOf(t));for(var n in t)r[n]=e(t[n]);return g(t,re)&&(r[re]=t[re]),r}function t(t){return d(t)?e(t):t}var r="add";k("Patches",{$:function(t,n){return n.forEach((function(n){for(var o=n.path,a=n.op,i=t,s=0;s<o.length-1;s++){var u=v(i),c=""+o[s];0!==u&&1!==u||"__proto__"!==c&&"constructor"!==c||f(24),"function"==typeof i&&"prototype"===c&&f(24),"object"!=typeof(i=m(i,c))&&f(15,o.join("/"))}var l=v(i),d=e(n.value),h=o[o.length-1];switch(a){case"replace":switch(l){case 2:return i.set(h,d);case 3:f(16);default:return i[h]=d}case r:switch(l){case 1:return"-"===h?i.push(d):i.splice(h,0,d);case 2:return i.set(h,d);case 3:return i.add(d);default:return i[h]=d}case"remove":switch(l){case 1:return i.splice(h,1);case 2:return i.delete(h);case 3:return i.delete(n.value);default:return delete i[h]}default:f(17,a)}})),t},R:function(e,n,o,a){switch(e.i){case 0:case 4:case 2:return function(e,n,o,a){var i=e.t,s=e.o;p(e.D,(function(e,u){var c=m(i,e),l=m(s,e),f=u?g(i,e)?"replace":r:"remove";if(c!==l||"replace"!==f){var d=n.concat(e);o.push("remove"===f?{op:f,path:d}:{op:f,path:d,value:l}),a.push(f===r?{op:"remove",path:d}:"remove"===f?{op:r,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,n,o,a);case 5:case 1:return function(e,n,o,a){var i=e.t,s=e.D,u=e.o;if(u.length<i.length){var c=[u,i];i=c[0],u=c[1];var l=[a,o];o=l[0],a=l[1]}for(var f=0;f<i.length;f++)if(s[f]&&u[f]!==i[f]){var d=n.concat([f]);o.push({op:"replace",path:d,value:t(u[f])}),a.push({op:"replace",path:d,value:t(i[f])})}for(var h=i.length;h<u.length;h++){var p=n.concat([h]);o.push({op:r,path:p,value:t(u[h])})}i.length<u.length&&a.push({op:"replace",path:n.concat(["length"]),value:i.length})}(e,n,o,a);case 3:return function(e,t,n,o){var a=e.t,i=e.o,s=0;a.forEach((function(e){if(!i.has(e)){var a=t.concat([s]);n.push({op:"remove",path:a,value:e}),o.unshift({op:r,path:a,value:e})}s++})),s=0,i.forEach((function(e){if(!a.has(e)){var i=t.concat([s]);n.push({op:r,path:i,value:e}),o.unshift({op:"remove",path:i,value:e})}s++}))}(e,n,o,a)}},M:function(e,t,r,n){r.push({op:"replace",path:[],value:t===te?void 0:t}),n.push({op:"replace",path:[],value:e})}})}function J(){function e(e,t){function r(){this.constructor=e}o(e,t),e.prototype=(r.prototype=t.prototype,new r)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function r(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(h(t)){var r=L(e.A.h,t,e);e.p.set(t,r),e.o.add(r)}else e.o.add(t)})))}function n(e){e.O&&f(3,JSON.stringify(O(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},a=function(){function r(e,t){return this[ne]={i:2,l:t,A:t?t.A:j(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(r,Map);var o=r.prototype;return Object.defineProperty(o,"size",{get:function(){return O(this[ne]).size}}),o.has=function(e){return O(this[ne]).has(e)},o.set=function(e,r){var o=this[ne];return n(o),O(o).has(e)&&O(o).get(e)===r||(t(o),F(o),o.D.set(e,!0),o.o.set(e,r),o.D.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var r=this[ne];return n(r),t(r),F(r),r.t.has(e)?r.D.set(e,!1):r.D.delete(e),r.o.delete(e),!0},o.clear=function(){var e=this[ne];n(e),O(e).size&&(t(e),F(e),e.D=new Map,p(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var r=this;O(this[ne]).forEach((function(n,o){e.call(t,r.get(o),o,r)}))},o.get=function(e){var r=this[ne];n(r);var o=O(r).get(e);if(r.I||!h(o))return o;if(o!==r.t.get(e))return o;var a=L(r.A.h,o,r);return t(r),r.o.set(e,a),a},o.keys=function(){return O(this[ne]).keys()},o.values=function(){var e,t=this,r=this.keys();return(e={})[oe]=function(){return t.values()},e.next=function(){var e=r.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,r=this.keys();return(e={})[oe]=function(){return t.entries()},e.next=function(){var e=r.next();if(e.done)return e;var n=t.get(e.value);return{done:!1,value:[e.value,n]}},e},o[oe]=function(){return this.entries()},r}(),i=function(){function t(e,t){return this[ne]={i:3,l:t,A:t?t.A:j(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var o=t.prototype;return Object.defineProperty(o,"size",{get:function(){return O(this[ne]).size}}),o.has=function(e){var t=this[ne];return n(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},o.add=function(e){var t=this[ne];return n(t),this.has(e)||(r(t),F(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[ne];return n(t),r(t),F(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[ne];n(e),O(e).size&&(r(e),F(e),e.o.clear())},o.values=function(){var e=this[ne];return n(e),r(e),e.o.values()},o.entries=function(){var e=this[ne];return n(e),r(e),e.o.entries()},o.keys=function(){return this.values()},o[oe]=function(){return this.values()},o.forEach=function(e,t){for(var r=this.values(),n=r.next();!n.done;)e.call(t,n.value,n.value,this),n=r.next()},t}();k("MapSet",{N:function(e,t){return new a(e,t)},T:function(e,t){return new i(e,t)}})}var Q,V,X="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),$="undefined"!=typeof Map,Z="undefined"!=typeof Set,ee="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,te=X?Symbol.for("immer-nothing"):((Q={})["immer-nothing"]=!0,Q),re=X?Symbol.for("immer-draftable"):"__$immer_draftable",ne=X?Symbol.for("immer-state"):"__$immer_state",oe="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",ae={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},ie=""+Object.prototype.constructor,se="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ue=Object.getOwnPropertyDescriptors||function(e){var t={};return se(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},ce={},le={get:function(e,t){if(t===ne)return e;var r=O(e);if(!g(r,t))return function(e,t,r){var n,o=B(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!h(n)?n:n===H(e.t,t)?(W(e),e.o[t]=L(e.A.h,n,e)):n},has:function(e,t){return t in O(e)},ownKeys:function(e){return Reflect.ownKeys(O(e))},set:function(e,t,r){var n=B(O(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=H(O(e),t),a=null==o?void 0:o[ne];if(a&&a.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(b(r,o)&&(void 0!==r||g(e.t,t)))return!0;W(e),F(e)}return e.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==H(e.t,t)||t in e.t?(e.D[t]=!1,W(e),F(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=O(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){f(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){f(12)}},fe={};p(le,(function(e,t){fe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),fe.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&f(13),fe.set.call(this,e,t,void 0)},fe.set=function(e,t,r){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&f(14),le.set.call(this,e[0],t,r,e[0])};var de=function(){function e(e){var t=this;this.g=ee,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return a.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(i))}))}}var i;if("function"!=typeof r&&f(6),void 0!==n&&"function"!=typeof n&&f(7),h(e)){var s=R(t),u=L(t,e,void 0),c=!0;try{i=r(u),c=!1}finally{c?E(s):x(s)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return C(s,n),M(e,s)}),(function(e){throw E(s),e})):(C(s,n),M(i,s))}if(!e||"object"!=typeof e){if(void 0===(i=r(e))&&(i=e),i===te&&(i=void 0),t.F&&T(i,!0),n){var l=[],d=[];D("Patches").M(e,i,l,d),n(l,d)}return i}f(21,e)},this.produceWithPatches=function(e,r){if("function"==typeof e)return function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(o))}))};var n,o,a=t.produce(e,r,(function(e,t){n=e,o=t}));return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return[e,n,o]})):[a,n,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){h(e)||f(8),d(e)&&(e=z(e));var t=R(this),r=L(this,e,void 0);return r[ne].C=!0,x(t),r},t.finishDraft=function(e,t){var r=e&&e[ne];"production"!==process.env.NODE_ENV&&(r&&r.C||f(9),r.I&&f(10));var n=r.A;return C(n,t),M(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!ee&&f(20),this.g=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var o=D("Patches").$;return d(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),he=new de,pe=he.produce,ve=he.produceWithPatches.bind(he),ge=he.setAutoFreeze.bind(he),me=he.setUseProxies.bind(he),ye=he.applyPatches.bind(he),be=he.createDraft.bind(he),_e=he.finishDraft.bind(he),we=Object.freeze({__proto__:null,default:pe,Immer:de,applyPatches:ye,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:be,current:z,enableAllPlugins:function(){G(),J(),K()},enableES5:G,enableMapSet:J,enablePatches:K,finishDraft:_e,freeze:T,immerable:re,isDraft:d,isDraftable:h,nothing:te,original:function(e){return d(e)||f(23,e),e[ne].t},produce:pe,produceWithPatches:ve,setAutoFreeze:ge,setUseProxies:me}),Oe=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Pe}(e)}(e)};var Pe="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Te(e,t){return!1!==t.clone&&t.isMergeableObject(e)?je((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function Se(e,t,r){return e.concat(t).map((function(e){return Te(e,r)}))}function Ie(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function De(e,t){try{return t in e}catch(e){return!1}}function ke(e,t,r){var n={};return r.isMergeableObject(e)&&Ie(e).forEach((function(t){n[t]=Te(e[t],r)})),Ie(t).forEach((function(o){(function(e,t){return De(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(De(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return je;var r=t.customMerge(e);return"function"==typeof r?r:je}(o,r)(e[o],t[o],r):n[o]=Te(t[o],r))})),n}function je(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||Se,r.isMergeableObject=r.isMergeableObject||Oe,r.cloneUnlessOtherwiseSpecified=Te;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):ke(e,t,r):Te(t,r)}je.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return je(e,r,t)}),{})};var Ce=je,Ee=r(l),xe=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getAppConfig=void 0;var r=Ee.__importDefault(Ce),n={sapiBackend:{baseUrl:"dikcjxfwieazv.cloudfront.net",endpoints:{anchor:"anchor",search:"search",offers:"ws/offers",roomsOffers:"rooms-offers"}},saf:{baseUrl:"sapi.findhotel.services",endpoints:{offersRooms:"1/offers-rooms",hotel:"1/hotel",hotels:"1/hotels"}},algolia:{appId:"4UYGJP42KQ",apiKey:"efa703d5c0057a24487bc9bdcb597770",autocompleteIndex:"prod_autocomplete_v2_os000007"},client:{defaultRooms:"2",features:["offers","search","suggests","configs","rooms","get-hotel"],blockedDefaultDates:["2022-12-25","2023-01-01"],daysFromNow:45,fallbackLanguages:{"pt-BR":["pt"],"zh-CN":["zh"],"zh-HK":["zh"],"zh-TW":["zh"],iw:["he"],nb:["no"],nn:["no"]}}},o={"findhotel-website":n,"findhotel-website-e2e":Ee.__assign(Ee.__assign({},n),{saf:Ee.__assign(Ee.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-website-stg":Ee.__assign(Ee.__assign({},n),{sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})}),"findhotel-website-ci":Ee.__assign(Ee.__assign({},n),{sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d1ue1wauc6u0m5.cloudfront.net"})}),"findhotel-website-dev":Ee.__assign(Ee.__assign({},n),{sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d3b8t16k1aaypx.cloudfront.net"})}),"findhotel-website-dev2":Ee.__assign(Ee.__assign({},n),{sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d3u31tr22fwdg3.cloudfront.net"})}),"findhotel-checkout":Ee.__assign(Ee.__assign({},n),{client:Ee.__assign(Ee.__assign({},n.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-e2e":Ee.__assign(Ee.__assign({},n),{saf:Ee.__assign(Ee.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),client:Ee.__assign(Ee.__assign({},n.client),{features:["rooms","get-hotel"]}),sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-checkout-stg":Ee.__assign(Ee.__assign({},n),{saf:Ee.__assign(Ee.__assign({},n.saf),{baseUrl:"sapi-stg.findhotel.services"}),client:Ee.__assign(Ee.__assign({},n.client),{features:["rooms","get-hotel"]}),sapiBackend:Ee.__assign(Ee.__assign({},n.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})})};t.getAppConfig=function(e,t){var n=o[e];if(void 0===n)throw new Error("Profile key is not valid");return t&&(n=(0,r.default)(n,t,{arrayMerge:function(e,t){return t}})),n}}));var Re=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,a=[],i=[],s={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return a},entries:function(){return i},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){a.push(t=t.toLowerCase()),i.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(u())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),Ne={};try{!function(e,t){if(new e("q=%2B").get("q")!==t||new e({q:t}).get("q")!==t||new e([["q",t]]).get("q")!==t||"q=%0A"!==new e("q=\n").toString()||"q=+%26"!==new e({q:" &"}).toString()||"q=%25zx"!==new e({q:"%zx"}).toString())throw e;Ne.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,r){var n=e.create,o=e.defineProperty,a=/[!'\(\)~]|%20|%00/g,i=/%(?![0-9a-fA-F]{2})/g,s=/\+/g,u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},c={append:function(e,t){h(this._ungap,e,t)},delete:function(e){delete this._ungap[e]},get:function(e){return this.has(e)?this._ungap[e][0]:null},getAll:function(e){return this.has(e)?this._ungap[e].slice(0):[]},has:function(e){return e in this._ungap},set:function(e,r){this._ungap[e]=[t(r)]},forEach:function(e,r){var n=this;for(var o in n._ungap)n._ungap[o].forEach(a,o);function a(a){e.call(r,a,t(o),n)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var r=v(t),n=0,o=this._ungap[t];n<o.length;n++)e.push(r+"="+v(o[n]));return e.join("&")}};for(var l in c)o(f.prototype,l,{configurable:!0,writable:!0,value:c[l]});function f(e){var t=n(null);switch(o(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var a=e.split("&"),i=0,s=a.length;i<s;i++){var u=(c=a[i]).indexOf("=");-1<u?h(t,p(c.slice(0,u)),p(c.slice(u+1))):c.length&&h(t,p(c),"")}break;case r(e):for(i=0,s=e.length;i<s;i++){var c;h(t,(c=e[i])[0],c[1])}break;case"forEach"in e:e.forEach(d,t);break;default:for(var l in e)h(t,l,e[l])}}function d(e,t){h(this,t,e)}function h(e,t,n){var o=r(n)?n.join(","):n;t in e?e[t].push(o):e[t]=[o]}function p(e){return decodeURIComponent(e.replace(i,"%25").replace(s," "))}function v(e){return encodeURIComponent(e).replace(a,g)}function g(e){return u[e]}Ne.URLSearchParams=f}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function r(e,r){var n=[];return e.forEach(r,n),t?n[Symbol.iterator]():{next:function(){var e=n.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var r=this,n=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(o){o.length&&!(o in n)&&(n[o]=r.getAll(o)).forEach((function(n){e.call(t,n,o,r)}))}))}),"keys"in e||(e.keys=function(){return r(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return r(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return r(this,(function(e,t){this.push([t,e])}))}),t&&!(Symbol.iterator in e)&&(e[Symbol.iterator]=e.entries),"sort"in e||(e.sort=function(){for(var e,t,r,n=this.entries(),o=n.next(),a=o.done,i=[],s=Object.create(null);!a;)t=(r=o.value)[0],i.push(t),t in s||(s[t]=[]),s[t].push(r[1]),a=(o=n.next()).done;for(i.sort(),e=0;e<i.length;e++)this.delete(i[e]);for(e=0;e<i.length;e++)t=i[e],this.append(t,s[t].shift())}),function(t){var r=t.defineProperty,n=t.getOwnPropertyDescriptor,o=function(t){var r=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=r},a=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},i=function(i){var s,u,c=i.prototype,l=n(c,"searchParams"),f=n(c,"href"),d=n(c,"search");!l&&d&&d.set&&(u=function(t){function n(r,n){e.append.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function o(r){e.delete.call(this,r),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function a(r,n){e.set.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}return function(e,t){return e.append=n,e.delete=o,e.set=a,r(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),s=function(e,t){return r(e,"_searchParams",{configurable:!0,writable:!0,value:u(t,e)}),t},t.defineProperties(c,{href:{get:function(){return f.get.call(this)},set:function(e){var t=this._searchParams;f.set.call(this,e),t&&o(t)}},search:{get:function(){return d.get.call(this)},set:function(e){var t=this._searchParams;d.set.call(this,e),t&&o(t)}},searchParams:{get:function(){return a(this,i),this._searchParams||s(this,new URLSearchParams(this.search.slice(1)))},set:function(e){a(this,i),s(this,e)}}}))};try{i(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&i(URL)}catch(e){}}(Object)}(Ne.URLSearchParams.prototype);var Me=Ne.URLSearchParams,Ae=r(Object.freeze({__proto__:null,default:Me})),Ue=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getSapiOverrideParameter=void 0;var r=Ee.__importDefault(Ae);t.getSapiOverrideParameter=function(e){if("undefined"==typeof window)return null;var t,n=new r.default(window.location.search).get("sapiOverride");try{n?(window.sessionStorage.setItem("sapiOverride",n),t=n):t=window.sessionStorage.getItem("sapiOverride")}catch(e){}return e?t&&t.length<=2e3?t:void 0:t}})),qe=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheapestRate=void 0,t.getCheapestRate=function(e,t){if(0!==e.offers.length)return Math.min.apply(Math,e.offers.map((function(e){return t(e.rate)})))}})),He=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDiscount=void 0,t.calculateDiscount=function(e,t,r){return void 0===t||void 0===r||0===r?0:e<t?-1*(e-t)/t:e>r?-1*(e-r)/r:0}}));function Be(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Fe(e){return Be(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function We(e){Be(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Le(e){if(Be(1,arguments),!Fe(e)&&"number"!=typeof e)return!1;var t=We(e);return!isNaN(Number(t))}var ze={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ye=function(e,t,r){var n,o=ze[e];return n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=r&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Ge(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var Ke={date:Ge({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Ge({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Ge({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Je={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qe=function(e,t,r,n){return Je[e]};function Ve(e){return function(t,r){var n,o=r||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;n=e.formattingValues[i]||e.formattingValues[a]}else{var s=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;n=e.values[u]||e.values[s]}return n[e.argumentCallback?e.argumentCallback(t):t]}}var Xe={ordinalNumber:function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Ve({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Ve({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Ve({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Ve({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Ve({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function $e(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;var i,s=a[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(u)?et(u,(function(e){return e.test(s)})):Ze(u,(function(e){return e.test(s)}));i=e.valueCallback?e.valueCallback(c):c,i=r.valueCallback?r.valueCallback(i):i;var l=t.slice(s.length);return{value:i,rest:l}}}function Ze(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function et(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}var tt,rt={ordinalNumber:(tt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.match(tt.matchPattern);if(!r)return null;var n=r[0],o=e.match(tt.parsePattern);if(!o)return null;var a=tt.valueCallback?tt.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;var i=e.slice(n.length);return{value:a,rest:i}}),era:$e({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$e({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:$e({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$e({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$e({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},nt={code:"en-US",formatDistance:Ye,formatLong:Ke,formatRelative:Qe,localize:Xe,match:rt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ot(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function at(e,t){Be(2,arguments);var r=We(e).getTime(),n=ot(t);return new Date(r+n)}function it(e,t){Be(2,arguments);var r=ot(t);return at(e,-r)}var st=864e5;function ut(e){Be(1,arguments);var t=1,r=We(e),n=r.getUTCDay(),o=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-o),r.setUTCHours(0,0,0,0),r}function ct(e){Be(1,arguments);var t=We(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=ut(n),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var i=ut(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function lt(e){Be(1,arguments);var t=ct(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=ut(r);return n}var ft=6048e5;function dt(e,t){Be(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ot(o),i=null==r.weekStartsOn?a:ot(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=We(e),u=s.getUTCDay(),c=(u<i?7:0)+u-i;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function ht(e,t){Be(1,arguments);var r=We(e),n=r.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,s=null==i?1:ot(i),u=null==o.firstWeekContainsDate?s:ot(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,u),c.setUTCHours(0,0,0,0);var l=dt(c,t),f=new Date(0);f.setUTCFullYear(n,0,u),f.setUTCHours(0,0,0,0);var d=dt(f,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function pt(e,t){Be(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.firstWeekContainsDate,a=null==o?1:ot(o),i=null==r.firstWeekContainsDate?a:ot(r.firstWeekContainsDate),s=ht(e,t),u=new Date(0);u.setUTCFullYear(s,0,i),u.setUTCHours(0,0,0,0);var c=dt(u,t);return c}var vt=6048e5;function gt(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var mt={y:function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return gt("yy"===t?n%100:n,t.length)},M:function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):gt(r+1,2)},d:function(e,t){return gt(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:function(e,t){return gt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return gt(e.getUTCHours(),t.length)},m:function(e,t){return gt(e.getUTCMinutes(),t.length)},s:function(e,t){return gt(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds();return gt(Math.floor(n*Math.pow(10,r-3)),t.length)}},yt="midnight",bt="noon",_t="morning",wt="afternoon",Ot="evening",Pt="night",Tt={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return mt.y(e,t)},Y:function(e,t,r,n){var o=ht(e,n),a=o>0?o:1-o;return"YY"===t?gt(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):gt(a,t.length)},R:function(e,t){return gt(ct(e),t.length)},u:function(e,t){return gt(e.getUTCFullYear(),t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return gt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return gt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return mt.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return gt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var o=function(e,t){Be(1,arguments);var r=We(e),n=dt(r,t).getTime()-pt(r,t).getTime();return Math.round(n/vt)+1}(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):gt(o,t.length)},I:function(e,t,r){var n=function(e){Be(1,arguments);var t=We(e),r=ut(t).getTime()-lt(t).getTime();return Math.round(r/ft)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):gt(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):mt.d(e,t)},D:function(e,t,r){var n=function(e){Be(1,arguments);var t=We(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=r-n;return Math.floor(o/st)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):gt(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return gt(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return gt(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return gt(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,o=e.getUTCHours();switch(n=12===o?bt:0===o?yt:o/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,o=e.getUTCHours();switch(n=o>=17?Ot:o>=12?wt:o>=4?_t:Pt,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return mt.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):mt.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):gt(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):gt(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):mt.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):mt.s(e,t)},S:function(e,t){return mt.S(e,t)},X:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return It(o);case"XXXX":case"XX":return Dt(o);default:return Dt(o,":")}},x:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return It(o);case"xxxx":case"xx":return Dt(o);default:return Dt(o,":")}},O:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+St(o,":");default:return"GMT"+Dt(o,":")}},z:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+St(o,":");default:return"GMT"+Dt(o,":")}},t:function(e,t,r,n){var o=n._originalDate||e;return gt(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,r,n){return gt((n._originalDate||e).getTime(),t.length)}};function St(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),a=n%60;if(0===a)return r+String(o);var i=t||"";return r+String(o)+i+gt(a,2)}function It(e,t){return e%60==0?(e>0?"-":"+")+gt(Math.abs(e)/60,2):Dt(e,t)}function Dt(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+gt(Math.floor(o/60),2)+r+gt(o%60,2)}var kt=Tt;function jt(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}}function Ct(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}}var Et={p:Ct,P:function(e,t){var r,n=e.match(/(P+)(p+)?/)||[],o=n[1],a=n[2];if(!a)return jt(e,t);switch(o){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",jt(o,t)).replace("{{time}}",Ct(a,t))}},xt=Et;function Rt(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var Nt=["D","DD"],Mt=["YY","YYYY"];function At(e){return-1!==Nt.indexOf(e)}function Ut(e){return-1!==Mt.indexOf(e)}function qt(e,t,r){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"))}var Ht=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ft=/^'([^]*?)'?$/,Wt=/''/g,Lt=/[a-zA-Z]/;function zt(e){return e.match(Ft)[1].replace(Wt,"'")}var Yt=Object.freeze({__proto__:null,default:function(e,t,r){Be(2,arguments);var n=String(t),o=r||{},a=o.locale||nt,i=a.options&&a.options.firstWeekContainsDate,s=null==i?1:ot(i),u=null==o.firstWeekContainsDate?s:ot(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,l=null==c?0:ot(c),f=null==o.weekStartsOn?l:ot(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=We(e);if(!Le(d))throw new RangeError("Invalid time value");var h=Rt(d),p=it(d,h),v={firstWeekContainsDate:u,weekStartsOn:f,locale:a,_originalDate:d},g=n.match(Bt).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,xt[t])(e,a.formatLong,v):e})).join("").match(Ht).map((function(r){if("''"===r)return"'";var n=r[0];if("'"===n)return zt(r);var i=kt[n];if(i)return!o.useAdditionalWeekYearTokens&&Ut(r)&&qt(r,t,e),!o.useAdditionalDayOfYearTokens&&At(r)&&qt(r,t,e),i(p,r,a.localize,v);if(n.match(Lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return r})).join("");return g}});function Gt(e,t){Be(2,arguments);var r=We(e),n=ot(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}var Kt=Object.freeze({__proto__:null,default:Gt});function Jt(e,t){Be(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ot(o),i=null==r.weekStartsOn?a:ot(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var s=We(e),u=s.getDay(),c=6+(u<i?-7:0)-(u-i);return s.setHours(0,0,0,0),s.setDate(s.getDate()+c),s}var Qt=Object.freeze({__proto__:null,default:function(e){return Be(1,arguments),Jt(e,{weekStartsOn:1})}});var Vt=Object.freeze({__proto__:null,default:function(e,t){Be(2,arguments);var r=ot(t),n=7*r;return Gt(e,n)}}),Xt=36e5;var $t={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Zt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,er=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function rr(e){var t,r={},n=e.split($t.dateTimeDelimiter);if(n.length>2)return r;if(/:/.test(n[0])?t=n[0]:(r.date=n[0],t=n[1],$t.timeZoneDelimiter.test(r.date)&&(r.date=e.split($t.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var o=$t.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function nr(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var o=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:null===a?o:100*a,restDateString:e.slice((n[1]||n[2]).length)}}function or(e,t){if(null===t)return new Date(NaN);var r=e.match(Zt);if(!r)return new Date(NaN);var n=!!r[4],o=ar(r[1]),a=ar(r[2])-1,i=ar(r[3]),s=ar(r[4]),u=ar(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,s,u)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var o=n.getUTCDay()||7,a=7*(t-1)+r+1-o;return n.setUTCDate(n.getUTCDate()+a),n}(t,s,u):new Date(NaN);var c=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(cr[t]||(lr(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(lr(e)?366:365)}(t,o)?(c.setUTCFullYear(t,a,Math.max(o,i)),c):new Date(NaN)}function ar(e){return e?parseInt(e):1}function ir(e){var t=e.match(er);if(!t)return NaN;var r=sr(t[1]),n=sr(t[2]),o=sr(t[3]);return function(e,t,r){if(24===e)return 0===t&&0===r;return r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,o)?r*Xt+6e4*n+1e3*o:NaN}function sr(e){return e&&parseFloat(e.replace(",","."))||0}function ur(e){if("Z"===e)return 0;var t=e.match(tr);if(!t)return 0;var r="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?r*(n*Xt+6e4*o):NaN}var cr=[31,null,31,30,31,30,31,31,30,31,30,31];function lr(e){return e%400==0||e%4==0&&e%100!=0}var fr,dr=Object.freeze({__proto__:null,default:function(e,t){Be(1,arguments);var r=t||{},n=null==r.additionalDigits?2:ot(r.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,a=rr(e);if(a.date){var i=nr(a.date,n);o=or(i.restDateString,i.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s,u=o.getTime(),c=0;if(a.time&&(c=ir(a.time),isNaN(c)))return new Date(NaN);if(!a.timezone){var l=new Date(u+c),f=new Date(0);return f.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),f.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),f}return s=ur(a.timezone),isNaN(s)?new Date(NaN):new Date(u+c+s)}}),hr=r(Yt),pr=r(Kt),vr=r(Qt),gr=r(Vt),mr=r(dr),yr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.shouldUseClientDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var r=Ee.__importDefault(hr),n=Ee.__importDefault(pr),o=Ee.__importDefault(vr),a=Ee.__importDefault(gr),i=Ee.__importDefault(mr);function s(e){return(0,i.default)("".concat(e," 12:00:00"))}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=s;var u=function(e,t){return(0,n.default)(e,t)};t.shouldUseClientDates=function(e,t){var r,n=e.checkIn,o=e.checkOut,a=e.dayDistance,i=e.nights,s=Boolean(n&&o||void 0!==a&&(void 0===i?1:i)),u=!(null===(r=t.variations)||void 0===r?void 0:r.includes("sapi4eva-sid-landing-unavailability-b"));return s||u},t.getCheckInCheckOutDates=function(e,i){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h;c=void 0===l?void 0===d?function(e){for(var i,u=e.daysFromNow,c=e.blockedDefaultDates,l=s((0,r.default)(new Date,t.DATE_FORMAT)),f=(0,o.default)((0,n.default)(l,u));i=(0,r.default)(f,t.DATE_FORMAT),c.includes(i);)f=(0,a.default)(f,1);return f}(i):u(s((0,r.default)(new Date,t.DATE_FORMAT)),d):s(l);var v=void 0===f?u(c,p):s(f);return{checkIn:(0,r.default)(c,t.DATE_FORMAT),checkOut:(0,r.default)(v,t.DATE_FORMAT)}}})),br=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){for(var r={},n={},o=0,a=e.length;o<a;)n[e[o]]=1,o+=1;for(var i in t)Object.prototype.hasOwnProperty.call(n,i)||(r[i]=t[i]);return r}})),_r=r(we),wr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createState=void 0,t.createState=function(e){var t=e;return{current:function(){return t},get:function(e){return t[e]},update:function(e){t=(0,_r.produce)(t,e)}}}})),Or=new Uint8Array(16);function Pr(){if(!fr&&!(fr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fr(Or)}var Tr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Sr(e){return"string"==typeof e&&Tr.test(e)}for(var Ir,Dr,kr=[],jr=0;jr<256;++jr)kr.push((jr+256).toString(16).substr(1));function Cr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(kr[e[t+0]]+kr[e[t+1]]+kr[e[t+2]]+kr[e[t+3]]+"-"+kr[e[t+4]]+kr[e[t+5]]+"-"+kr[e[t+6]]+kr[e[t+7]]+"-"+kr[e[t+8]]+kr[e[t+9]]+"-"+kr[e[t+10]]+kr[e[t+11]]+kr[e[t+12]]+kr[e[t+13]]+kr[e[t+14]]+kr[e[t+15]]).toLowerCase();if(!Sr(r))throw TypeError("Stringified UUID is invalid");return r}var Er=0,xr=0;function Rr(e){if(!Sr(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function Nr(e,t,r){function n(e,n,o,a){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=Rr(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(n),i.set(e,n.length),(i=r(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){a=a||0;for(var s=0;s<16;++s)o[a+s]=i[s];return o}return Cr(i)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function Mr(e){return 14+(e+64>>>9<<4)+1}function Ar(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function Ur(e,t,r,n,o,a){return Ar((i=Ar(Ar(t,e),Ar(n,a)))<<(s=o)|i>>>32-s,r);var i,s}function qr(e,t,r,n,o,a,i){return Ur(t&r|~t&n,e,t,o,a,i)}function Hr(e,t,r,n,o,a,i){return Ur(t&n|r&~n,e,t,o,a,i)}function Br(e,t,r,n,o,a,i){return Ur(t^r^n,e,t,o,a,i)}function Fr(e,t,r,n,o,a,i){return Ur(r^(t|~n),e,t,o,a,i)}var Wr=Nr("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",o=0;o<r;o+=8){var a=e[o>>5]>>>o%32&255,i=parseInt(n.charAt(a>>>4&15)+n.charAt(15&a),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[Mr(t)-1]=t;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var s=r,u=n,c=o,l=a;r=qr(r,n,o,a,e[i],7,-680876936),a=qr(a,r,n,o,e[i+1],12,-389564586),o=qr(o,a,r,n,e[i+2],17,606105819),n=qr(n,o,a,r,e[i+3],22,-1044525330),r=qr(r,n,o,a,e[i+4],7,-176418897),a=qr(a,r,n,o,e[i+5],12,1200080426),o=qr(o,a,r,n,e[i+6],17,-1473231341),n=qr(n,o,a,r,e[i+7],22,-45705983),r=qr(r,n,o,a,e[i+8],7,1770035416),a=qr(a,r,n,o,e[i+9],12,-1958414417),o=qr(o,a,r,n,e[i+10],17,-42063),n=qr(n,o,a,r,e[i+11],22,-1990404162),r=qr(r,n,o,a,e[i+12],7,1804603682),a=qr(a,r,n,o,e[i+13],12,-40341101),o=qr(o,a,r,n,e[i+14],17,-1502002290),r=Hr(r,n=qr(n,o,a,r,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=Hr(a,r,n,o,e[i+6],9,-1069501632),o=Hr(o,a,r,n,e[i+11],14,643717713),n=Hr(n,o,a,r,e[i],20,-373897302),r=Hr(r,n,o,a,e[i+5],5,-701558691),a=Hr(a,r,n,o,e[i+10],9,38016083),o=Hr(o,a,r,n,e[i+15],14,-660478335),n=Hr(n,o,a,r,e[i+4],20,-405537848),r=Hr(r,n,o,a,e[i+9],5,568446438),a=Hr(a,r,n,o,e[i+14],9,-1019803690),o=Hr(o,a,r,n,e[i+3],14,-187363961),n=Hr(n,o,a,r,e[i+8],20,1163531501),r=Hr(r,n,o,a,e[i+13],5,-1444681467),a=Hr(a,r,n,o,e[i+2],9,-51403784),o=Hr(o,a,r,n,e[i+7],14,1735328473),r=Br(r,n=Hr(n,o,a,r,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=Br(a,r,n,o,e[i+8],11,-2022574463),o=Br(o,a,r,n,e[i+11],16,1839030562),n=Br(n,o,a,r,e[i+14],23,-35309556),r=Br(r,n,o,a,e[i+1],4,-1530992060),a=Br(a,r,n,o,e[i+4],11,1272893353),o=Br(o,a,r,n,e[i+7],16,-155497632),n=Br(n,o,a,r,e[i+10],23,-1094730640),r=Br(r,n,o,a,e[i+13],4,681279174),a=Br(a,r,n,o,e[i],11,-358537222),o=Br(o,a,r,n,e[i+3],16,-722521979),n=Br(n,o,a,r,e[i+6],23,76029189),r=Br(r,n,o,a,e[i+9],4,-640364487),a=Br(a,r,n,o,e[i+12],11,-421815835),o=Br(o,a,r,n,e[i+15],16,530742520),r=Fr(r,n=Br(n,o,a,r,e[i+2],23,-995338651),o,a,e[i],6,-198630844),a=Fr(a,r,n,o,e[i+7],10,1126891415),o=Fr(o,a,r,n,e[i+14],15,-1416354905),n=Fr(n,o,a,r,e[i+5],21,-57434055),r=Fr(r,n,o,a,e[i+12],6,1700485571),a=Fr(a,r,n,o,e[i+3],10,-1894986606),o=Fr(o,a,r,n,e[i+10],15,-1051523),n=Fr(n,o,a,r,e[i+1],21,-2054922799),r=Fr(r,n,o,a,e[i+8],6,1873313359),a=Fr(a,r,n,o,e[i+15],10,-30611744),o=Fr(o,a,r,n,e[i+6],15,-1560198380),n=Fr(n,o,a,r,e[i+13],21,1309151649),r=Fr(r,n,o,a,e[i+4],6,-145523070),a=Fr(a,r,n,o,e[i+11],10,-1120210379),o=Fr(o,a,r,n,e[i+2],15,718787259),n=Fr(n,o,a,r,e[i+9],21,-343485551),r=Ar(r,s),n=Ar(n,u),o=Ar(o,c),a=Ar(a,l)}return[r,n,o,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(Mr(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))})),Lr=Wr;function zr(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function Yr(e,t){return e<<t|e>>>32-t}var Gr=Nr("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var o=0;o<n.length;++o)e.push(n.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,i=Math.ceil(a/16),s=new Array(i),u=0;u<i;++u){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*u+4*l]<<24|e[64*u+4*l+1]<<16|e[64*u+4*l+2]<<8|e[64*u+4*l+3];s[u]=c}s[i-1][14]=8*(e.length-1)/Math.pow(2,32),s[i-1][14]=Math.floor(s[i-1][14]),s[i-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=s[f][h];for(var p=16;p<80;++p)d[p]=Yr(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var v=r[0],g=r[1],m=r[2],y=r[3],b=r[4],_=0;_<80;++_){var w=Math.floor(_/20),O=Yr(v,5)+zr(w,g,m,y)+b+t[w]+d[_]>>>0;b=y,y=m,m=Yr(g,30)>>>0,g=v,v=O}r[0]=r[0]+v>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),Kr=Gr;var Jr=Object.freeze({__proto__:null,v1:function(e,t,r){var n=t&&r||0,o=t||new Array(16),a=(e=e||{}).node||Ir,i=void 0!==e.clockseq?e.clockseq:Dr;if(null==a||null==i){var s=e.random||(e.rng||Pr)();null==a&&(a=Ir=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==i&&(i=Dr=16383&(s[6]<<8|s[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:xr+1,l=u-Er+(c-xr)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||u>Er)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Er=u,xr=c,Dr=i;var f=(1e4*(268435455&(u+=122192928e5))+c)%4294967296;o[n++]=f>>>24&255,o[n++]=f>>>16&255,o[n++]=f>>>8&255,o[n++]=255&f;var d=u/4294967296*1e4&268435455;o[n++]=d>>>8&255,o[n++]=255&d,o[n++]=d>>>24&15|16,o[n++]=d>>>16&255,o[n++]=i>>>8|128,o[n++]=255&i;for(var h=0;h<6;++h)o[n+h]=a[h];return t||Cr(o)},v3:Lr,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||Pr)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return Cr(n)},v5:Kr,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!Sr(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:Sr,stringify:Cr,parse:Rr}),Qr=r(Jr),Vr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0,t.generateSearchId=function(){return(0,Qr.v4)()}})),Xr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.augmentHotelWithRegularPriceRange=void 0,t.augmentHotelWithRegularPriceRange=function(e,t,r){var n;if(void 0===(null===(n=e.pricing)||void 0===n?void 0:n.medianRateBkt)||void 0===r)return e;var o=e.pricing.medianRateBkt*r*t,a=(e.pricing.medianRateBkt+1)*r*t;return Ee.__assign(Ee.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(a)]})}})),$r=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmpty=void 0,t.removeEmpty=function e(t){return Object.entries(t).filter((function(e){e[0];var t=e[1];return null!=t})).reduce((function(t,r){var n,o=r[0],a=r[1];return Ee.__assign(Ee.__assign({},t),((n={})[o]=a===new Object(a)?e(a):a,n))}),{})}})),Zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSortingBoost=void 0,t.generateSortingBoost=function(e){var t;return(null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.freeCancellation)?"freeCancellation=true:100":void 0}}));function en(e){Be(1,arguments);var t=We(e);return t.setHours(0,0,0,0),t}var tn=864e5;function rn(e,t){Be(2,arguments);var r=en(e),n=en(t),o=r.getTime()-Rt(r),a=n.getTime()-Rt(n);return Math.round((o-a)/tn)}function nn(e,t){var r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}var on=Object.freeze({__proto__:null,default:function(e,t){Be(2,arguments);var r=We(e),n=We(t),o=nn(r,n),a=Math.abs(rn(r,n));r.setDate(r.getDate()-o*a);var i=Number(nn(r,n)===-o),s=o*(a-i);return 0===s?0:s}}),an=r(on),sn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.buildOffersResponse=t.applySort=t.applyPriceFilter=t.isRateInPriceRange=void 0;var r=Ee.__importDefault(an);function n(e,t,r,n){return!(r&&e<r)&&!(n&&n<t&&e>n)}function o(e,t){var o,a=e.filters,i=void 0===a?{}:a,s=e.priceBucketWidth,u=e.priceBucketsCount,c=e.exchangeRate,l=e.getTotalRate;if(void 0===s)return t;var f=u*Math.round(s*c);if(void 0!==i.priceMin||void 0!==i.priceMax){var d=(0,r.default)((0,yr.dateToMiddayUTC)(e.checkOut),(0,yr.dateToMiddayUTC)(e.checkIn));if(!(null===(o=t.offers)||void 0===o?void 0:o.some((function(e){return n((t=l(e.rate),void 0===(r=d)&&(r=1),1===r?t:t/r),f,i.priceMin,i.priceMax);var t,r}))))return Ee.__assign(Ee.__assign({},t),{offers:[]})}return t}function a(e,t){var r=t.sortField,n=t.sortOrder,o=void 0===n?"ascending":n,a=t.getTotalRate;return"price"===r?function(e,t,r){return e.sort((function(e,n){var o,a,i=(null!==(o=(0,qe.getCheapestRate)(e,r))&&void 0!==o?o:0)-(null!==(a=(0,qe.getCheapestRate)(n,r))&&void 0!==a?a:0);return"ascending"===t?i:-i}))}(e,o,a):e}t.isRateInPriceRange=n,t.applyPriceFilter=o,t.applySort=a,t.buildOffersResponse=function(e,t){var r,n,i,s={};e.anchorHotelOfferEntity&&(s[e.anchorHotelOfferEntity.id]=e.anchorHotelOfferEntity);var u=null===(r=e.hotelOfferEntities)||void 0===r?void 0:r.map((function(e){return o(t,e)}));if(u&&t.sortField&&(i=a(u,t).map((function(e){return e.id}))),u)for(var c=0,l=u;c<l.length;c++){var f=l[c];s[f.id]=f}return{hotelOfferEntities:s,hotelIds:null!==(n=null!=i?i:t.hotelIds)&&void 0!==n?n:[]}}})),un=t((function(e,t){function r(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function n(e,t){for(var n=0,o=t;n<o.length;n++){var a=o[n];if(r(null==e?void 0:e[a]))return e[a]}return""}function o(e,t,o){void 0===o&&(o=", ");for(var a={},i=0,s=t;i<s.length;i++){var u=s[i],c=(null==e?void 0:e[u])||[];a[u]=c.map((function(n,o){if(r(n))return n;var a=t.find((function(t){var n;return r(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[o])}));return a?e[a][o]:""})).join("".concat(o))}return n(a,t)}function a(e,t,o){for(var a={},i=0,s=t;i<s.length;i++){var u=s[i],c=e[u]||[],l=-1===o?void 0:o+1,f=c.slice(o,l).toString();if(r(f))a[u]=f;else{var d=t.find((function(t){var n;return r(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[o])}));a[u]=d?e[d][o]:""}}return n(a,t)}function i(e,t){for(var o,a={},i=0,s=t;i<s.length;i++){var u=s[i],c=null===(o=e[u])||void 0===o?void 0:o.value;if(r(c))a[u]=c;else{var l=t.find((function(t){var n;return r(null===(n=e[t])||void 0===n?void 0:n.value)}));a[u]=l?e[l].value:""}}return n(a,t)}function s(e,t,r){var n,o=e[t];if(!o){var a=r.indexOf(t),i=null!==(n=r.slice(a).find((function(t){return e[t]})))&&void 0!==n?n:"en";o=e[i]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function u(e,t,r){if(void 0===e)return t;try{for(var n in t)if(void 0===e[n])throw new TypeError("Hotel ".concat(e.objectID," is missing ").concat(n," field"))}catch(e){r||console.error(e)}return Ee.__assign(Ee.__assign({},t),e)}function c(e){if(void 0===e)return"property";switch(e){case 0:return"country";case 23:return"city";case 64:case 1010:return"airport";case 199:case 232:case 251:case 1024:return"station";default:return"area"}}Object.defineProperty(t,"__esModule",{value:!0}),t.hitToPlaceSuggest=t.hitToHotelSuggest=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=void 0,t.isNotEmptyOrWhiteSpace=r,t.getTranslatedAttributes=function(e,t){for(var r=[],n=function(e){var n=t.map((function(t){return"".concat(t,".").concat(e)}));r.push.apply(r,n)},o=0,a=e;o<a.length;o++){n(a[o])}return r},t.toString=n,t.translatedArrayToString=o,t.getStringFromTranslatedArray=a,t.getValueFromTranslatedHightlightResult=i,t.attributeWithFallback=s,t.mergeTranslatedAttributes=function(e,t,r){for(var n={},a=0,i=r;a<i.length;a++){var u=i[a];n[u]=Ee.__spreadArray(Ee.__spreadArray([],s(e,u,r),!0),s(t,u,r),!0)}return o(n,r)},t.validateHit=u,t.placeTypeToPlaceTypeName=c,t.hitToHotelSuggest=function(e,t){var o=u(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),s=a(o.placeADN,t,-1),l=a(o.placeDN,t,1),f=r(l)?"".concat(l,", ").concat(s):s,d=i(o._highlightResult.hotelName,t);return{objectID:o.objectID.replace("".concat(o.objectType,":"),""),objectType:o.objectType,value:n(o.hotelName,t),highlightValue:d,placeDisplayName:f,placeTypeName:c()}},t.hitToPlaceSuggest=function(e,t){var o=u(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),s=a(o.placeADN,t,-1),l=a(o.placeDN,t,1),f=r(l)?"".concat(l,", ").concat(s):s,d=i(o._highlightResult.placeName,t);return{objectID:o.objectID.replace("".concat(o.objectType,":"),""),objectType:o.objectType,value:n(o.placeName,t),highlightValue:d,placeDisplayName:f,placeTypeName:c(o.placeType)}}})),cn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hasRequiredSearchParameters=void 0;t.hasRequiredSearchParameters=function(e){var t=e,r=t.checkIn,n=t.checkOut,o=t.rooms;return Boolean(r&&n&&o)}})),ln=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getTotalRate=void 0,t.getTotalRate=function(e){return e.base+e.hotelFees+e.taxes}})),fn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Ee.__exportStar(qe,t),Ee.__exportStar(He,t),Ee.__exportStar(yr,t),Ee.__exportStar(br,t),Ee.__exportStar(wr,t),Ee.__exportStar(Vr,t),Ee.__exportStar(Xr,t),Ee.__exportStar($r,t),Ee.__exportStar(Zr,t),Ee.__exportStar(sn,t),Ee.__exportStar(un,t),Ee.__exportStar(cn,t),Ee.__exportStar(ln,t)})),dn=t((function(e,t){function r(e,t){return void 0===e&&(e=""),void 0===t&&(t=500),{name:"ApiError",message:e,status:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.createBackendError=t.createApiError=void 0,t.createApiError=r,t.createBackendError=function(e,t){var n,o;return Ee.__awaiter(this,void 0,void 0,(function(){var a,i;return Ee.__generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,e.json()];case 1:return i=s.sent(),a=null!==(o=null!==(n=i.message)&&void 0!==n?n:e.statusText)&&void 0!==o?o:t,[3,3];case 2:return s.sent(),[3,3];case 3:return[2,r(a,e.status)]}}))}))}})),hn=r(Re),pn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.createAnchorRequestString=t.createSearchRequestString=t.prepareSearchParameters=void 0;var r=Ee.__importDefault(hn),n=Ee.__importDefault(Ae);function o(e,t,r){var n;e.checkIn,e.checkOut,e.dayDistance;var o=e.nights,a=Ee.__rest(e,["checkIn","checkOut","dayDistance","nights"]);return Ee.__assign(Ee.__assign(Ee.__assign({},a),(0,fn.shouldUseClientDates)(e,r)?(0,fn.getCheckInCheckOutDates)(e,t):{nights:o}),{rooms:null!==(n=e.rooms)&&void 0!==n?n:"2"})}function a(e){var t,r,o,a,i,s,u,c,l,f,d,h,p,v,g,m,y,b,_,w,O,P,T,S,I=e.profileKey,D=e.searchId,k=e.searchParameters,j=e.options,C=e.offset,E=e.attributes,x=(0,fn.removeEmpty)({offset:C,searchId:D,profileId:I,query:k.query,hotelId:k.hotelId,placeId:k.hotelId?void 0:k.placeId,checkIn:k.checkIn,checkOut:k.checkOut,rooms:k.rooms,dayDistance:k.dayDistance,nights:k.nights,sortField:k.sortField,sortOrder:k.sortOrder,boundingBox:null===(t=k.boundingBox)||void 0===t?void 0:t.join(","),currency:j.currency,language:j.language,variations:null===(r=j.variations)||void 0===r?void 0:r.join(","),starRating:null===(a=null===(o=k.filters)||void 0===o?void 0:o.starRating)||void 0===a?void 0:a.join(","),guestRating:null===(s=null===(i=k.filters)||void 0===i?void 0:i.guestRating)||void 0===s?void 0:s.join(","),propertyTypeId:null===(c=null===(u=k.filters)||void 0===u?void 0:u.propertyTypeId)||void 0===c?void 0:c.join(","),facilities:null===(f=null===(l=k.filters)||void 0===l?void 0:l.facilities)||void 0===f?void 0:f.join(","),themeIds:null===(h=null===(d=k.filters)||void 0===d?void 0:d.themeIds)||void 0===h?void 0:h.join(","),chainIds:null===(v=null===(p=k.filters)||void 0===p?void 0:p.chainIds)||void 0===v?void 0:v.join(","),noHostels:null===(g=k.filters)||void 0===g?void 0:g.noHostels,priceMin:null===(m=k.filters)||void 0===m?void 0:m.priceMin,priceMax:null===(y=k.filters)||void 0===y?void 0:y.priceMax,hotelName:null===(b=k.filters)||void 0===b?void 0:b.hotelName,freeCancellation:null===(_=k.filters)||void 0===_?void 0:_.freeCancellation,attributes:null==E?void 0:E.join(","),anonymousId:j.anonymousId,cugDeals:null===(w=k.cugDeals)||void 0===w?void 0:w.join(","),tier:k.tier,deviceType:j.deviceType,originId:k.originId,brand:j.brand,sortingBoost:(0,fn.generateSortingBoost)(k),preferredRate:k.preferredRate,label:null!==(O=k.label)&&void 0!==O?O:k.trafficSource,countryCode:j.countryCode,userId:k.userId,emailDomain:k.emailDomain,screenshots:k.screenshots,pageSize:k.pageSize,lat:null===(P=k.geolocation)||void 0===P?void 0:P.lat,lon:null===(T=k.geolocation)||void 0===T?void 0:T.lon,precision:null===(S=k.geolocation)||void 0===S?void 0:S.precision});return new n.default(x).toString()}function i(e,t){var n=e.baseUrl,o=e.endpoints;return Ee.__awaiter(this,void 0,void 0,(function(){var e,i,s,u,c,l,f,d;return Ee.__generator(this,(function(h){switch(h.label){case 0:return e=a(t),i=(0,Ue.getSapiOverrideParameter)(),s={credentials:"include"},i&&(s.method="POST",s.headers={"Content-Type":"application/json"},s.body=JSON.stringify({sapiOverride:i})),[4,(0,r.default)("https://".concat(n,"/").concat(o.search,"?").concat(e),s)];case 1:return(u=h.sent()).ok?[4,u.json()]:[3,3];case 2:return[2,h.sent()];case 3:return c=t.searchParameters,l=t.options,f=t.offset,d=t.attributes,l.logger.log({name:"SearchFailed",value:Ee.__assign(Ee.__assign({},c),{offset:f,attributes:d,language:l.language,currency:l.currency,deviceType:l.deviceType})}),[4,(0,dn.createBackendError)(u,"Search request failed")];case 4:throw h.sent()}}))}))}function s(e){var t,r,o,a,i,s,u,c,l,f,d=e.profileKey,h=e.searchId,p=e.searchParameters,v=e.options,g=e.attributes,m=(0,fn.removeEmpty)({searchId:h,profileId:d,query:p.query,hotelId:p.hotelId,placeId:p.hotelId?void 0:p.placeId,boundingBox:null===(t=p.boundingBox)||void 0===t?void 0:t.join(","),checkIn:p.checkIn,checkOut:p.checkOut,rooms:p.rooms,dayDistance:p.dayDistance,nights:p.nights,currency:v.currency,language:v.language,variations:null===(r=v.variations)||void 0===r?void 0:r.join(","),attributes:null==g?void 0:g.join(","),anonymousId:v.anonymousId,cugDeals:null===(o=p.cugDeals)||void 0===o?void 0:o.join(","),tier:p.tier,sapiOverride:(0,Ue.getSapiOverrideParameter)(!0),userId:p.userId,emailDomain:p.emailDomain,screenshots:p.screenshots,priceMin:null===(a=p.filters)||void 0===a?void 0:a.priceMin,priceMax:null===(i=p.filters)||void 0===i?void 0:i.priceMax,freeCancellation:null===(s=p.filters)||void 0===s?void 0:s.freeCancellation,deviceType:v.deviceType,originId:p.originId,brand:v.brand,sortingBoost:(0,fn.generateSortingBoost)(p),preferredRate:p.preferredRate,label:null!==(u=p.label)&&void 0!==u?u:p.trafficSource,countryCode:v.countryCode,lat:null===(c=p.geolocation)||void 0===c?void 0:c.lat,lon:null===(l=p.geolocation)||void 0===l?void 0:l.lon,precision:null===(f=p.geolocation)||void 0===f?void 0:f.precision});return new n.default(m).toString()}function u(e,t){var n=e.baseUrl,o=e.endpoints;return Ee.__awaiter(this,void 0,void 0,(function(){var e,a,i,u,c;return Ee.__generator(this,(function(l){switch(l.label){case 0:return e=s(t),[4,(0,r.default)("https://".concat(n,"/").concat(o.anchor,"?").concat(e))];case 1:return(a=l.sent()).ok?[4,a.json()]:[3,3];case 2:return[2,l.sent()];case 3:return i=t.searchParameters,u=t.options,c=t.attributes,u.logger.log({name:"AnchorSearchFailed",value:Ee.__assign(Ee.__assign({},i),{attributes:c,language:u.language,currency:u.currency,deviceType:u.deviceType})}),[4,(0,dn.createBackendError)(a,"Anchor request failed")];case 4:throw l.sent()}}))}))}t.prepareSearchParameters=o,t.createSearchRequestString=a,t.createAnchorRequestString=s,t.search=function(e){var t,r=this,n=e.getFeatureEnabled,a=e.profileKey,s=e.appConfig,c=e.offersClient,l=e.options,f=n("offers"),d=!1;return function(e,n){return void 0===n&&(n={}),Ee.__awaiter(r,void 0,void 0,(function(){function r(){var e=h.current().searchParameters;if(!(0,fn.hasRequiredSearchParameters)(e))throw new Error("Dates must be set by client, SDK or response");return e}var h,p,v,g,m,y,b,_,w,O,P,T,S,I=this;return Ee.__generator(this,(function(D){switch(D.label){case 0:return h=(0,fn.createState)({status:{},hotelIds:[]}),p=n.onStart,v=n.onAnchorReceived,g=n.onHotelsReceived,m=n.onOffersReceived,y=n.onComplete,b=0,_=o(e,s.client,l),w=(0,fn.generateSearchId)(),h.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof p&&p(h.current()),O=function(n,o,u){return void 0===n&&(n=0),Ee.__awaiter(I,void 0,void 0,(function(){var u,p,b,O,P,T,S;return Ee.__generator(this,(function(I){switch(I.label){case 0:return[4,i(s.sapiBackend,{searchId:w,profileKey:a,searchParameters:_,options:l,offset:n,attributes:o})];case 1:return u=I.sent(),d||(t=u.exchangeRates[l.currency],(null===(T=l.callbacks)||void 0===T?void 0:T.onConfigReceived)&&l.callbacks.onConfigReceived({lov:u.lov,exchangeRates:u.exchangeRates}),d=!0),(void 0===o||o.includes("anchor"))&&(h.update((function(e){e.anchor=u.anchor,e.anchorHotelId=u.anchorHotelId,e.anchorType=u.anchorType,e.hotelEntities=u.hotelEntities,e.searchParameters=Ee.__assign(Ee.__assign({},e.searchParameters),{checkIn:u.searchParameters.checkIn,checkOut:u.searchParameters.checkOut})})),"function"==typeof v&&v(h.current())),h.update((function(e){e.facets=u.facets,e.hotelEntities=u.hotelEntities,u.hotelIds&&(e.hotelIds=u.hotelIds),e.hotelsHaveStaticPosition=u.hotelsHaveStaticPosition,e.offset=u.offset,e.resultsCount=u.resultsCount,e.resultsCountTotal=u.resultsCountTotal})),"function"==typeof g&&g(h.current()),f&&void 0!==c?(p=h.get("hotelIds"),b=Ee.__assign(Ee.__assign({},r()),{searchId:w,hotelIds:p,metadata:e.metadata,anchorHotelId:h.get("anchorHotelId")}),[4,c.getOffers(b,(function(e){var r,n=(0,fn.buildOffersResponse)(e,Ee.__assign(Ee.__assign({},b),{priceBucketWidth:null===(r=h.get("anchor"))||void 0===r?void 0:r.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate}));h.update((function(t){t.hotelIds=n.hotelIds,t.hotelOfferEntities=Ee.__assign(Ee.__assign({},t.hotelOfferEntities),n.hotelOfferEntities),t.status.anchorComplete=e.status.anchorComplete,t.status.nonAnchorComplete=e.status.nonAnchorComplete})),"function"==typeof m&&m(h.current())}))]):[3,3];case 2:O=I.sent(),P=(0,fn.buildOffersResponse)(O,Ee.__assign(Ee.__assign({},b),{priceBucketWidth:null===(S=h.get("anchor"))||void 0===S?void 0:S.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate})),h.update((function(e){e.hotelIds=P.hotelIds,e.hotelOfferEntities=P.hotelOfferEntities})),I.label=3;case 3:return"function"==typeof y&&y(h.current()),[2,h.current()]}}))}))},P=function(n,o,p){return void 0===n&&(n=0),void 0===p&&(p=!0),Ee.__awaiter(I,void 0,void 0,(function(){var b,O,P=this;return Ee.__generator(this,(function(T){switch(T.label){case 0:return b=function(){return Ee.__awaiter(P,void 0,void 0,(function(){var t,n;return Ee.__generator(this,(function(o){switch(o.label){case 0:return[4,u(s.sapiBackend,{searchId:w,profileKey:a,searchParameters:_,options:l,attributes:["anchor","anchorHotelId","anchorType","hotelEntities","searchParameters"]})];case 1:return t=o.sent(),h.update((function(e){e.anchor=t.anchor,e.anchorHotelId=t.anchorHotelId,e.anchorType=t.anchorType,e.hotelEntities=Ee.__assign(Ee.__assign({},e.hotelEntities),t.hotelEntities),e.searchParameters=Ee.__assign(Ee.__assign({},e.searchParameters),{checkIn:t.searchParameters.checkIn,checkOut:t.searchParameters.checkOut})})),"function"==typeof v&&v(h.current()),f&&void 0!==c&&"hotel"===t.anchorType?(n=Ee.__assign(Ee.__assign({},r()),{metadata:e.metadata,anchorHotelId:t.anchorHotelId,searchId:w}),[4,c.getOffers(n,(function(e){var t=e.anchorHotelOfferEntity,r=e.status;h.update((function(e){var n;t&&(e.hotelOfferEntities=Ee.__assign(Ee.__assign({},e.hotelOfferEntities),((n={})[t.id]=t,n))),e.status.anchorComplete=r.anchorComplete})),"function"==typeof m&&m(h.current())}))]):[3,3];case 2:o.sent(),o.label=3;case 3:return[2,h.current()]}}))}))},O=function(){return Ee.__awaiter(P,void 0,void 0,(function(){var o,u,v,y,b,O,P;return Ee.__generator(this,(function(T){switch(T.label){case 0:return o=["facets","hotelEntities","hotelIds","hotelsHaveStaticPosition","offset","resultsCount","resultsCountTotal","searchParameters"],d||o.push("lov","exchangeRates"),[4,i(s.sapiBackend,{searchId:w,profileKey:a,searchParameters:_,options:l,offset:n,attributes:o})];case 1:return u=T.sent(),d||(t=u.exchangeRates[l.currency],(null===(O=l.callbacks)||void 0===O?void 0:O.onConfigReceived)&&l.callbacks.onConfigReceived({lov:u.lov,exchangeRates:u.exchangeRates}),d=!0),h.update((function(e){e.facets=u.facets,e.hotelEntities=p?Ee.__assign(Ee.__assign({},e.hotelEntities),u.hotelEntities):u.hotelEntities,u.hotelIds&&(e.hotelIds=u.hotelIds),e.hotelsHaveStaticPosition=u.hotelsHaveStaticPosition,e.offset=u.offset,e.resultsCount=u.resultsCount,e.resultsCountTotal=u.resultsCountTotal,e.searchParameters=Ee.__assign(Ee.__assign({},e.searchParameters),{checkIn:u.searchParameters.checkIn,checkOut:u.searchParameters.checkOut})})),"function"==typeof g&&g(h.current()),f&&void 0!==c?(v=Ee.__assign(Ee.__assign({},r()),{searchId:w,metadata:e.metadata,hotelIds:h.get("hotelIds")}),[4,c.getOffers(v,(function(e){var r,n=(0,fn.buildOffersResponse)(e,Ee.__assign(Ee.__assign({},v),{priceBucketWidth:null===(r=h.get("anchor"))||void 0===r?void 0:r.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate}));h.update((function(t){t.hotelIds=n.hotelIds,t.hotelOfferEntities=Ee.__assign(Ee.__assign({},t.hotelOfferEntities),n.hotelOfferEntities),t.status.nonAnchorComplete=e.status.nonAnchorComplete})),"function"==typeof m&&m(h.current())}))]):[3,3];case 2:y=T.sent(),b=(0,fn.buildOffersResponse)(y,Ee.__assign(Ee.__assign({},v),{priceBucketWidth:null===(P=h.get("anchor"))||void 0===P?void 0:P.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate})),h.update((function(e){e.hotelIds=b.hotelIds,e.hotelOfferEntities=p?Ee.__assign(Ee.__assign({},e.hotelOfferEntities),b.hotelOfferEntities):b.hotelOfferEntities})),T.label=3;case 3:return[2,h.current()]}}))}))},[4,void 0===o||o.includes("anchor")?Promise.all([b(),O()]):O()];case 1:return T.sent(),"function"==typeof y&&y(h.current()),[2,h.current()]}}))}))},T=(null===(S=l.variations)||void 0===S?void 0:S.includes("sapi4eva-load-anchor-separately-b"))?P:O,[4,d?T(_.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition","searchParameters"]):T(_.offset)];case 1:return D.sent(),[2,{loadOffers:function(n){var o,a;return Ee.__awaiter(this,void 0,void 0,(function(){var i,s,u,d;return Ee.__generator(this,(function(p){switch(p.label){case 0:if(!n)throw new Error("Hotel id must be provided");if(!f||!c)throw new Error("Offers loading is disabled");return i=n===h.get("anchorHotelId"),s=Ee.__assign(Ee.__assign({},r()),{searchId:w,metadata:e.metadata,getAllOffers:!0,hotelIds:i?[]:[n],anchorHotelId:i?n:void 0}),[4,c.getOffers(s)];case 1:return u=p.sent(),d=(0,fn.buildOffersResponse)(u,Ee.__assign(Ee.__assign({},s),{priceBucketWidth:null===(o=h.get("anchor"))||void 0===o?void 0:o.priceBucketWidth,priceBucketsCount:31,exchangeRate:t,getTotalRate:l.getTotalRate})),[2,null===(a=d.hotelOfferEntities)||void 0===a?void 0:a[n]]}}))}))},loadMore:function(){return Ee.__awaiter(this,void 0,void 0,(function(){return Ee.__generator(this,(function(e){return b+=h.get("resultsCount"),[2,T(b,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"],!1)]}))}))}}]}}))}))}}})),vn=t((function(e,t){e.exports=function(){function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(n().getItem(r)||"{}")};return{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=o(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function s(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,o).catch((function(){return s({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return s({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return s({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return s({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=n(),s=o&&o.miss||function(){return Promise.resolve()};return i.then((function(e){return s(e)})).then((function(){return i}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===v.WithinHeaders?n:{}},queryParameters:function(){return e===v.WithinQueryParameters?n:{}}}}function l(e){var t=0;return e((function r(){return t++,new Promise((function(n){setTimeout((function(){n(e(r))}),Math.min(100*t,1e3))}))}))}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(r){return f(e.then((function(e){return Promise.all([t(e,r),e])})).then((function(e){return e[1]})))}})}function d(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function p(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(r[o++])}))}var v={WithinQueryParameters:0,WithinHeaders:1};function g(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var m={Read:1,Write:2,Any:3},y=1,b=2,_=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:m.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||m.Any}}var P="DELETE",T="GET",S="POST",I="PUT";function D(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===y||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===_&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return O(e)})):t}}))}function k(e,t,n,o){var i=[],s=function(e,t){if(e.method!==T&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,o),u=function(e,t){var n=r(r({},e.headers),t.headers),o={};return Object.keys(n).forEach((function(e){var t=n[e];o[e.toLowerCase()]=t})),o}(e,o),c=n.method,l=n.method!==T?{}:r(r({},n.data),o.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),d=0,h=function t(r,a){var l=r.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:R(i)};var h={data:s,headers:u,method:c,url:E(l,n.path,f),connectTimeout:a(d,e.timeouts.connect),responseTimeout:a(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:r.length};return i.push(t),t},v={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var o=p(n);return n.isTimedOut&&d++,Promise.all([e.logger.info("Retryable failure",N(o)),e.hostsCache.set(l,w(l,n.isTimedOut?_:b))]).then((function(){return t(r,a)}))},onFail:function(e){throw p(e),function(e,t){var r=e.content,n=e.status,o=r;try{o=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(o,n,t)}(e,R(i))}};return e.requester.send(h).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,v)}))};return D(e.hostsCache,t).then((function(e){return h(a(e.statelessHosts).reverse(),e.getTimeout)}))}function j(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,i=e.responsesCache,s=e.timeouts,u=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:i,timeouts:s,userAgent:u,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var r=g(t,f.timeouts.read),n=function(){return k(f,f.hosts.filter((function(e){return 0!=(e.accept&m.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return k(f,f.hosts.filter((function(e){return 0!=(e.accept&m.Write)})),e,g(t,f.timeouts.write))}};return f}function C(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function E(e,t,r){var n=x(r),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(o+="?".concat(n)),o}function x(e){return Object.keys(e).map((function(t){return p("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function R(e){return e.map((function(e){return N(e)}))}function N(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var M=function(e){return function(t,r){return e.transporter.write({method:S,path:"2/abtests",data:t},r)}},A=function(e){return function(t,r){return e.transporter.write({method:P,path:p("2/abtests/%s",t)},r)}},U=function(e){return function(t,r){return e.transporter.read({method:T,path:p("2/abtests/%s",t)},r)}},q=function(e){return function(t){return e.transporter.read({method:T,path:"2/abtests"},t)}},H=function(e){return function(t,r){return e.transporter.write({method:S,path:p("2/abtests/%s/stop",t)},r)}},B=function(e){return function(t){return e.transporter.read({method:T,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,r){return e.transporter.write({method:S,path:"1/strategies/personalization",data:t},r)}};function W(e){return function t(r){return e.request(r).then((function(n){if(void 0!==e.batch&&e.batch(n.hits),!e.shouldStop(n))return n.cursor?t({cursor:n.cursor}):t({page:(r.page||0)+1})}))}({})}var L=function(e){return function(t,o){var a=o||{},i=a.queryParameters,s=n(a,["queryParameters"]),u=r({acl:t},void 0!==i?{queryParameters:i}:{});return f(e.transporter.write({method:S,path:"1/keys",data:u},s),(function(t,r){return l((function(n){return ee(e)(t.key,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},z=function(e){return function(t,r,n){var o=g(n);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:S,path:"1/clusters/mapping",data:{cluster:r}},o)}},Y=function(e){return function(t,r,n){return e.transporter.write({method:S,path:"1/clusters/mapping/batch",data:{users:t,cluster:r}},n)}},G=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},r),(function(t,r){return Se(e)(t.taskID,r)}))}},K=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:r}},n),(function(r,n){return se(e)(t,{methods:{waitTask:ft}}).waitTask(r.taskID,n)}))}},J=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[ht.Rules]}))}},Q=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[ht.Settings]}))}},V=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[ht.Synonyms]}))}},X=function(e){return function(t,r){return t.method===T?e.transporter.read(t,r):e.transporter.write(t,r)}},$=function(e){return function(t,r){return f(e.transporter.write({method:P,path:p("1/keys/%s",t)},r),(function(r,n){return l((function(r){return ee(e)(t,n).then(r).catch((function(e){if(404!==e.status)throw e}))}))}))}},Z=function(e){return function(t,r,n){var o=r.map((function(e){return{action:"deleteEntry",body:{objectID:e}}}));return f(e.transporter.write({method:S,path:p("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:o}},n),(function(t,r){return Se(e)(t.taskID,r)}))}},ee=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/keys/%s",t)},r)}},te=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/task/%s",t.toString())},r)}},re=function(e){return function(t){return e.transporter.read({method:T,path:"/1/dictionaries/*/settings"},t)}},ne=function(e){return function(t){return e.transporter.read({method:T,path:"1/logs"},t)}},oe=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters/mapping/top"},t)}},ae=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/clusters/mapping/%s",t)},r)}},ie=function(e){return function(t){var r=t||{},o=r.retrieveMappings,a=n(r,["retrieveMappings"]);return!0===o&&(a.getClusters=!0),e.transporter.read({method:T,path:"1/clusters/mapping/pending"},a)}},se=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},ue=function(e){return function(t){return e.transporter.read({method:T,path:"1/keys"},t)}},ce=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters"},t)}},le=function(e){return function(t){return e.transporter.read({method:T,path:"1/indexes"},t)}},fe=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters/mapping"},t)}},de=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:r}},n),(function(r,n){return se(e)(t,{methods:{waitTask:ft}}).waitTask(r.taskID,n)}))}},he=function(e){return function(t,r){return f(e.transporter.write({method:S,path:"1/indexes/*/batch",data:{requests:t}},r),(function(t,r){return Promise.all(Object.keys(t.taskID).map((function(n){return se(e)(n,{methods:{waitTask:ft}}).waitTask(t.taskID[n],r)})))}))}},pe=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:t}},r)}},ve=function(e){return function(t,n){var o=t.map((function(e){return r(r({},e),{},{params:x(e.params||{})})}));return e.transporter.read({method:S,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},n)}},ge=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,i=a.facetName,s=a.facetQuery,u=n(a,["facetName","facetQuery"]);return se(e)(t.indexName,{methods:{searchForFacetValues:st}}).searchForFacetValues(i,s,r(r({},o),u))})))}},me=function(e){return function(t,r){var n=g(r);return n.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:P,path:"1/clusters/mapping"},n)}},ye=function(e){return function(t,r,n){var o=r.map((function(e){return{action:"addEntry",body:e}}));return f(e.transporter.write({method:S,path:p("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:o}},n),(function(t,r){return Se(e)(t.taskID,r)}))}},be=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/keys/%s/restore",t)},r),(function(r,n){return l((function(r){return ee(e)(t,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},_e=function(e){return function(t,r,n){var o=r.map((function(e){return{action:"addEntry",body:e}}));return f(e.transporter.write({method:S,path:p("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:o}},n),(function(t,r){return Se(e)(t.taskID,r)}))}},we=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("/1/dictionaries/%s/search",t),data:{query:r},cacheable:!0},n)}},Oe=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/clusters/mapping/search",data:{query:t}},r)}},Pe=function(e){return function(t,r){return f(e.transporter.write({method:I,path:"/1/dictionaries/*/settings",data:t},r),(function(t,r){return Se(e)(t.taskID,r)}))}},Te=function(e){return function(t,r){var o=Object.assign({},r),a=r||{},i=a.queryParameters,s=n(a,["queryParameters"]),u=i?{queryParameters:i}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:I,path:p("1/keys/%s",t),data:u},s),(function(r,n){return l((function(r){return ee(e)(t,n).then((function(e){return function(e){return Object.keys(o).filter((function(e){return-1!==c.indexOf(e)})).every((function(t){return e[t]===o[t]}))}(e)?Promise.resolve():r()}))}))}))}},Se=function(e){return function(t,r){return l((function(n){return te(e)(t,r).then((function(e){return"published"!==e.status?n():void 0}))}))}},Ie=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},r),(function(t,r){return ft(e)(t.taskID,r)}))}},De=function(e){return function(t){return W(r(r({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(r){return e.transporter.read({method:S,path:p("1/indexes/%s/browse",e.indexName),data:r},t)}}))}},ke=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return W(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return ut(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},je=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return W(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return ct(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},Ce=function(e){return function(t,r,o){var a=o||{},i=a.batchSize,s=n(a,["batchSize"]),u={taskIDs:[],objectIDs:[]};return f(function n(){var o,a=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(a.push(t[o]),a.length!==(i||1e3));o++);return 0===a.length?Promise.resolve(u):Ie(e)(a.map((function(e){return{action:r,body:e}})),s).then((function(e){return u.objectIDs=u.objectIDs.concat(e.objectIDs),u.taskIDs.push(e.taskID),o++,n(o)}))}(),(function(t,r){return Promise.all(t.taskIDs.map((function(t){return ft(e)(t,r)})))}))}},Ee=function(e){return function(t){return f(e.transporter.write({method:S,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,r){return ft(e)(t.taskID,r)}))}},xe=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=g(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/clear",e.indexName)},a),(function(t,r){return ft(e)(t.taskID,r)}))}},Re=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=g(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/clear",e.indexName)},a),(function(t,r){return ft(e)(t.taskID,r)}))}},Ne=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},r),(function(t,r){return ft(e)(t.taskID,r)}))}},Me=function(e){return function(t){return f(e.transporter.write({method:P,path:p("1/indexes/%s",e.indexName)},t),(function(t,r){return ft(e)(t.taskID,r)}))}},Ae=function(e){return function(t,r){return f(Ue(e)([t],r).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,r){return ft(e)(t.taskID,r)}))}},Ue=function(e){return function(t,r){var n=t.map((function(e){return{objectID:e}}));return Ce(e)(n,dt.DeleteObject,r)}},qe=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=g(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:P,path:p("1/indexes/%s/rules/%s",e.indexName,t)},i),(function(t,r){return ft(e)(t.taskID,r)}))}},He=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=g(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:P,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},i),(function(t,r){return ft(e)(t.taskID,r)}))}},Be=function(e){return function(t){return Ke(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Fe=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},We=function(e){return function(t,a){var i=a||{},s=i.query,u=i.paginate,c=n(i,["query","paginate"]),l=0;return function n(){return it(e)(s||"",r(r({},c),{},{page:l})).then((function(e){for(var r=0,a=Object.entries(e.hits);r<a.length;r++){var i=o(a[r],2),s=i[0],c=i[1];if(t(c))return{object:c,position:parseInt(s,10),page:l}}if(l++,!1===u||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return n()}))}()}},Le=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/indexes/%s/%s",e.indexName,t)},r)}},ze=function(){return function(e,t){for(var r=0,n=Object.entries(e.hits);r<n.length;r++){var a=o(n[r],2),i=a[0];if(a[1].objectID===t)return parseInt(i,10)}return-1}},Ye=function(e){return function(t,o){var a=o||{},i=a.attributesToRetrieve,s=n(a,["attributesToRetrieve"]),u=t.map((function(t){return r({indexName:e.indexName,objectID:t},i?{attributesToRetrieve:i}:{})}));return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:u}},s)}},Ge=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},r)}},Ke=function(e){return function(t){return e.transporter.read({method:T,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Je=function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},r)}},Qe=function(e){return function(t,r){return f(Ve(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return ft(e)(t.taskID,r)}))}},Ve=function(e){return function(t,r){var o=r||{},a=o.createIfNotExists,i=n(o,["createIfNotExists"]),s=a?dt.PartialUpdateObject:dt.PartialUpdateObjectNoCreate;return Ce(e)(t,s,i)}},Xe=function(e){return function(t,i){var s=i||{},u=s.safe,c=s.autoGenerateObjectIDIfNotExist,l=s.batchSize,d=n(s,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,r,n,o){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:n,destination:r}},o),(function(t,r){return ft(e)(t.taskID,r)}))},v=Math.random().toString(36).substring(7),g="".concat(e.indexName,"_tmp_").concat(v),m=tt({appId:e.appId,transporter:e.transporter,indexName:g}),y=[],b=h(e.indexName,g,"copy",r(r({},d),{},{scope:["settings","synonyms","rules"]}));return y.push(b),f((u?b.wait(d):b).then((function(){var e=m(t,r(r({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return y.push(e),u?e.wait(d):e})).then((function(){var t=h(g,e.indexName,"move",d);return y.push(t),u?t.wait(d):t})).then((function(){return Promise.all(y)})).then((function(e){var t=o(e,3),r=t[0],n=t[1],i=t[2];return{objectIDs:n.objectIDs,taskIDs:[r.taskID].concat(a(n.taskIDs),[i.taskID])}})),(function(e,t){return Promise.all(y.map((function(e){return e.wait(t)})))}))}},$e=function(e){return function(t,n){return nt(e)(t,r(r({},n),{},{clearExistingRules:!0}))}},Ze=function(e){return function(t,n){return at(e)(t,r(r({},n),{},{clearExistingSynonyms:!0}))}},et=function(e){return function(t,r){return f(tt(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return ft(e)(t.taskID,r)}))}},tt=function(e){return function(t,r){var o=r||{},a=o.autoGenerateObjectIDIfNotExist,i=n(o,["autoGenerateObjectIDIfNotExist"]),s=a?dt.AddObject:dt.UpdateObject;if(s===dt.UpdateObject){var u=!0,c=!1,l=void 0;try{for(var d,h=t[Symbol.iterator]();!(u=(d=h.next()).done);u=!0)if(void 0===d.value.objectID)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}return Ce(e)(t,s,i)}},rt=function(e){return function(t,r){return nt(e)([t],r)}},nt=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingRules,s=g(n(o,["forwardToReplicas","clearExistingRules"]));return a&&(s.queryParameters.forwardToReplicas=1),i&&(s.queryParameters.clearExistingRules=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},s),(function(t,r){return ft(e)(t.taskID,r)}))}},ot=function(e){return function(t,r){return at(e)([t],r)}},at=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingSynonyms,s=o.replaceExistingSynonyms,u=g(n(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return a&&(u.queryParameters.forwardToReplicas=1),(s||i)&&(u.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},u),(function(t,r){return ft(e)(t.taskID,r)}))}},it=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},st=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},ut=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},r)}},ct=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},r)}},lt=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=g(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:I,path:p("1/indexes/%s/settings",e.indexName),data:t},i),(function(t,r){return ft(e)(t.taskID,r)}))}},ft=function(e){return function(t,r){return l((function(n){return function(e){return function(t,r){return e.transporter.read({method:T,path:p("1/indexes/%s/task/%s",e.indexName,t.toString())},r)}}(e)(t,r).then((function(e){return"published"!==e.status?n():void 0}))}))}},dt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},ht={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},pt=1,vt=2,gt=3;function mt(e,t,n){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,o=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=o(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=gt,{debug:function(e,t){return pt>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return vt>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:s({caches:[i({key:"".concat("4.14.0","-").concat(e)}),u()]}),userAgent:C("4.14.0").add({segment:"Browser"})},l=r(r({},a),n),f=function(){return function(e){return function(e){var t=e.region||"us",n=c(v.WithinHeaders,e.appId,e.apiKey),o=j(r(r({hosts:[{url:"personalization.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{getPersonalizationStrategy:B,setPersonalizationStrategy:F}}))}};return function(e){var t=e.appId,n=c(void 0!==e.authMode?e.authMode:v.WithinHeaders,t,e.apiKey),o=j(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:m.Read},{url:"".concat(t,".algolia.net"),accept:m.Write}].concat(d([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:o,appId:t,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}},e.methods)}(r(r({},l),{},{methods:{search:ve,searchForFacetValues:ge,multipleBatch:he,multipleGetObjects:pe,multipleQueries:ve,copyIndex:K,copySettings:Q,copySynonyms:V,copyRules:J,moveIndex:de,listIndices:le,getLogs:ne,listClusters:ce,multipleSearchForFacetValues:ge,getApiKey:ee,addApiKey:L,listApiKeys:ue,updateApiKey:Te,deleteApiKey:$,restoreApiKey:be,assignUserID:z,assignUserIDs:Y,getUserID:ae,searchUserIDs:Oe,listUserIDs:fe,getTopUserIDs:oe,removeUserID:me,hasPendingMappings:ie,clearDictionaryEntries:G,deleteDictionaryEntries:Z,getDictionarySettings:re,getAppTask:te,replaceDictionaryEntries:ye,saveDictionaryEntries:_e,searchDictionaryEntries:we,setDictionarySettings:Pe,waitAppTask:Se,customRequest:X,initIndex:function(e){return function(t){return se(e)(t,{methods:{batch:Ie,delete:Me,findAnswers:Fe,getObject:Le,getObjects:Ye,saveObject:et,saveObjects:tt,search:it,searchForFacetValues:st,waitTask:ft,setSettings:lt,getSettings:Ke,partialUpdateObject:Qe,partialUpdateObjects:Ve,deleteObject:Ae,deleteObjects:Ue,deleteBy:Ne,clearObjects:Ee,browseObjects:De,getObjectPosition:ze,findObject:We,exists:Be,saveSynonym:ot,saveSynonyms:at,getSynonym:Je,searchSynonyms:ct,browseSynonyms:je,deleteSynonym:He,clearSynonyms:Re,replaceAllObjects:Xe,replaceAllSynonyms:Ze,searchRules:ut,getRule:Ge,deleteRule:qe,saveRule:rt,saveRules:nt,replaceAllRules:$e,browseRules:ke,clearRules:xe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",n=c(v.WithinHeaders,e.appId,e.apiKey),o=j(r(r({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{addABTest:M,getABTest:U,getABTests:q,stopABTest:H,deleteABTest:A}}))}},initPersonalization:f,initRecommendation:function(){return function(e){return l.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),f()(e)}}}}))}return mt.version="4.14.0",mt}()})),gn=vn,mn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0;var r=Ee.__importDefault(gn);function n(e){return(0,fn.getTranslatedAttributes)(e,["placeName","hotelName"])}function o(e){var t=(0,fn.getTranslatedAttributes)(e,["placeName","placeADN","placeDN","hotelName"]);return Ee.__spreadArray(["objectType","objectID","placeType"],t,!0)}function a(e){var t="isDeleted != 1";if(null==e?void 0:e.length){var r=null==e?void 0:e.map((function(e){return'objectType: "'.concat(e,'"')})).join(" OR ");t="".concat(t," AND (").concat(r,")")}return t}function i(e,t,r){var i=this,s=e.search,u=t.autocompleteIndex,c=r.languages,l=r.suggestsTypes,f=r.suggestsCount,d=void 0===f?6:f;return function(e){return Ee.__awaiter(i,void 0,void 0,(function(){var t,r,i;return Ee.__generator(this,(function(f){switch(f.label){case 0:return t=[{indexName:u,params:{query:e,filters:a(l),hitsPerPage:d,attributesToRetrieve:o(c),attributesToHighlight:n(c)}}],[4,s(t)];case 1:return r=f.sent().results,[2,null===(i=r[0])||void 0===i?void 0:i.hits.map((function(e){return"hotel"===e.objectType?(0,fn.hitToHotelSuggest)(e,c):(0,fn.hitToPlaceSuggest)(e,c)}))]}}))}))}}t.suggest=function(e){var t=this,n=e.appConfig,o=e.options,a=(0,r.default)(n.algolia.appId,n.algolia.apiKey,o.algoliaClientOptions);return function(e,r,s){return Ee.__awaiter(t,void 0,void 0,(function(){var t;return Ee.__generator(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,i(a,n.algolia,{suggestsCount:r,suggestsTypes:s,languages:o.languages})(e)];case 1:return[2,u.sent()];case 2:throw t=u.sent(),(0,dn.createApiError)(null==t?void 0:t.message,null==t?void 0:t.status);case 3:return[2]}}))}))}}})),yn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var r=Ee.__importDefault(hn),n=Ee.__importDefault(Ae);function o(e,t,r){var o,a,i=t.hotelId,s=t.checkIn,u=t.checkOut,c=t.rooms,l=t.providerCode,f=t.cugDeals,d=t.tier,h=t.clickedOfferId,p=t.clickedOfferBaseRate,v=t.clickedOfferTaxes,g=t.clickedOfferHotelFees,m=t.preHeat,y=t.userId,b=t.emailDomain,_=t.searchId,w=(0,fn.removeEmpty)({hotelId:i,checkIn:s,checkOut:u,rooms:c,providerCode:l,cugDeals:f,tier:d,clickedOfferId:h,clickedOfferBaseRate:p,clickedOfferHotelFees:g,clickedOfferTaxes:v,deviceType:r.deviceType,language:r.language,currency:r.currency,aid:r.anonymousId,variations:null===(o=r.variations)||void 0===o?void 0:o.join(","),sapiOverride:(0,Ue.getSapiOverrideParameter)(),preHeat:m,label:null!==(a=t.label)&&void 0!==a?a:t.trafficSource,userId:y,emailDomain:b,searchId:_,profileId:e});return new n.default(w).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,n=e.appConfig,a=e.profileKey,i=e.options;return function(e){return Ee.__awaiter(t,void 0,void 0,(function(){var t,s,u,c,l;return Ee.__generator(this,(function(f){switch(f.label){case 0:return t=null!==(l=e.searchId)&&void 0!==l?l:(0,fn.generateSearchId)(),s=o(a,Ee.__assign(Ee.__assign({},e),{searchId:t}),i),[4,(0,r.default)("https://".concat(n.sapiBackend.baseUrl,"/").concat(n.sapiBackend.endpoints.roomsOffers,"?").concat(s))];case 1:return(u=f.sent()).ok?[4,u.json()]:[3,3];case 2:return c=f.sent(),[2,Ee.__assign({searchId:t,hotelId:e.hotelId,anonymousId:i.anonymousId},c)];case 3:return[4,(0,dn.createBackendError)(u,"Failed to get rooms offers")];case 4:throw f.sent()}}))}))}}})),bn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hotels=t.createHotelsRequestString=t.hotel=t.createRequestString=t.safToSapiHotel=void 0;var r=Ee.__importDefault(hn),n=Ee.__importDefault(Ae);function o(e,t){var r=e.checkInInst,n=e.checkInSpInst,o=e.feesMnd,a=e.feesOpt,i=e.policies,s=e.hotelName,u=e.placeDN,c=e.address,l=e.placeADName,f=e.propertyType,d=e.facilities,h=e.sentiments,p=e.themes,v=Ee.__assign(Ee.__assign({},e),{checkInInst:r&&(0,fn.toString)(r,t),checkInSpInst:n&&(0,fn.toString)(n,t),feesMnd:o&&(0,fn.toString)(o,t),feesOpt:a&&(0,fn.toString)(a,t),hotelName:(0,fn.toString)(s,t),policies:i&&(0,fn.toString)(i,t),placeDisplayName:u&&(0,fn.translatedArrayToString)(u,t),displayAddress:c&&l&&(0,fn.mergeTranslatedAttributes)(c,l,t),facilities:null==d?void 0:d.map((function(e){return Ee.__assign(Ee.__assign({},e),{value:(0,fn.toString)(e.value,t)})})),sentiments:null==h?void 0:h.map((function(e){return Ee.__assign(Ee.__assign({},e),{value:(0,fn.toString)(e.value,t)})})),themes:null==p?void 0:p.map((function(e){return Ee.__assign(Ee.__assign({},e),{value:(0,fn.toString)(e.value,t)})})),propertyType:f&&Ee.__assign(Ee.__assign({},f),{value:(0,fn.toString)(f.value,t)})});return(0,fn.omit)(["placeDN","placeADName","address"],v)}function a(e,t){var r,o=(0,fn.removeEmpty)({id:e,language:t.languages.join(","),attributes:["objectID","address","country","guestRating","isDeleted","starRating","_geoloc","placeADName","checkInSpInst","checkInMinAge","checkOutTime","checkInInst","checkInTime","checkInEnd","feesOpt","policies","phone","imageURIs","placeDN","reviewCount","chainID","parentChainID","lastBooked","feesMnd","reviewCountBkt","hotelName","sentiments","facilities","placeID","guestType","themes","propertyType","pricing","currency"].join(","),variations:null===(r=t.variations)||void 0===r?void 0:r.join(",")});return new n.default(o).toString()}function i(e,t){var r,o=(0,fn.removeEmpty)({ids:e.join(","),language:t.languages.join(","),attributes:["objectID","address","country","guestRating","isDeleted","starRating","_geoloc","placeADName","checkInSpInst","checkInMinAge","checkOutTime","checkInInst","checkInTime","checkInEnd","feesOpt","policies","phone","imageURIs","placeDN","reviewCount","chainID","parentChainID","lastBooked","feesMnd","reviewCountBkt","hotelName","sentiments","facilities","placeID","guestType","themes","propertyType","pricing","currency"].join(","),variations:null===(r=t.variations)||void 0===r?void 0:r.join(",")});return new n.default(o).toString()}t.safToSapiHotel=o,t.createRequestString=a,t.hotel=function(e){var t=this,n=e.appConfig,i=e.options;return function(e){return Ee.__awaiter(t,void 0,void 0,(function(){var t,s;return Ee.__generator(this,(function(u){switch(u.label){case 0:return t=a(e,i),[4,(0,r.default)("https://".concat(n.saf.baseUrl,"/").concat(n.saf.endpoints.hotel,"?").concat(t))];case 1:return(s=u.sent()).ok?[4,s.json()]:[3,3];case 2:return[2,o(u.sent(),i.languages)];case 3:return[4,(0,dn.createBackendError)(s,"Failed to fetch hotel data")];case 4:throw u.sent()}}))}))}},t.createHotelsRequestString=i,t.hotels=function(e){var t=this,n=e.appConfig,a=e.options;return function(e){return Ee.__awaiter(t,void 0,void 0,(function(){var t,s,u;return Ee.__generator(this,(function(c){switch(c.label){case 0:return t=i(e,a),[4,(0,r.default)("https://".concat(n.saf.baseUrl,"/").concat(n.saf.endpoints.hotels,"?").concat(t))];case 1:return(s=c.sent()).ok?[4,s.json()]:[3,3];case 2:return u=c.sent(),[2,Object.fromEntries(Object.entries(u).map((function(e){return[e[0],o(e[1],a.languages)]})))];case 3:return[4,(0,dn.createBackendError)(s,"Failed to fetch hotel data")];case 4:throw c.sent()}}))}))}}})),_n=t((function(e,t){function r(e,t){var r,n=e.hotelId,o=e.isAnchor,a=e.freeCancellation,i=e.rooms,s=void 0===i?t.client.defaultRooms:i,u=Ee.__rest(e,["hotelId","isAnchor","freeCancellation","rooms"]),c=(0,fn.getCheckInCheckOutDates)(e,t.client),l=c.checkIn,f=c.checkOut,d=Ee.__assign(Ee.__assign({},u),{checkIn:l,checkOut:f,rooms:s,label:null!==(r=e.label)&&void 0!==r?r:e.trafficSource});return a&&(d.filters={freeCancellation:!0}),e.searchId||(d.searchId=(0,fn.generateSearchId)()),o?d.anchorHotelId=n:d.hotelIds=[n],d}Object.defineProperty(t,"__esModule",{value:!0}),t.offers=t.getOffersParameters=void 0,t.getOffersParameters=r,t.offers=function(e){var t=this,n=e.offersClient,o=e.appConfig;return function(e,a){return void 0===a&&(a={}),Ee.__awaiter(t,void 0,void 0,(function(){var t,i,s,u,c,l,f,d;return Ee.__generator(this,(function(h){switch(h.label){case 0:return n?(t=e.isAnchor,i=a.onStart,s=a.onOffersReceived,u=a.onComplete,c=r(e,o),"function"==typeof i&&i(c),[4,n.getOffers(c,(function(e){var r;"function"==typeof s&&s(t?e.anchorHotelOfferEntity:null===(r=e.hotelOfferEntities)||void 0===r?void 0:r[0])}))]):[2];case 1:return l=h.sent(),"function"==typeof u&&u(t?l.anchorHotelOfferEntity:null===(f=l.hotelOfferEntities)||void 0===f?void 0:f[0]),[2,t?l.anchorHotelOfferEntity:null===(d=l.hotelOfferEntities)||void 0===d?void 0:d[0]]}}))}))}}})),wn=function(e,t){return wn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},wn(e,t)};function On(e,t){function r(){this.constructor=e}wn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function Pn(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function Tn(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pn(arguments[t]));return e}var Sn=function(e,t){this.target=t,this.type=e},In=function(e){function t(t,r){var n=e.call(this,"error",r)||this;return n.message=t.message,n.error=t,n}return On(t,e),t}(Sn),Dn=function(e){function t(t,r,n){void 0===t&&(t=1e3),void 0===r&&(r="");var o=e.call(this,"close",n)||this;return o.wasClean=!0,o.code=t,o.reason=r,o}return On(t,e),t}(Sn),kn=function(){if("undefined"!=typeof WebSocket)return WebSocket},jn={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},Cn=function(){function e(e,t,r){var n=this;void 0===r&&(r={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){n._debug("open event");var t=n._options.minUptime,r=void 0===t?jn.minUptime:t;clearTimeout(n._connectTimeout),n._uptimeTimeout=setTimeout((function(){return n._acceptOpen()}),r),n._ws.binaryType=n._binaryType,n._messageQueue.forEach((function(e){return n._ws.send(e)})),n._messageQueue=[],n.onopen&&n.onopen(e),n._listeners.open.forEach((function(t){return n._callEventListener(e,t)}))},this._handleMessage=function(e){n._debug("message event"),n.onmessage&&n.onmessage(e),n._listeners.message.forEach((function(t){return n._callEventListener(e,t)}))},this._handleError=function(e){n._debug("error event",e.message),n._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),n.onerror&&n.onerror(e),n._debug("exec error listeners"),n._listeners.error.forEach((function(t){return n._callEventListener(e,t)})),n._connect()},this._handleClose=function(e){n._debug("close event"),n._clearTimeouts(),n._shouldReconnect&&n._connect(),n.onclose&&n.onclose(e),n._listeners.close.forEach((function(t){return n._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,r=void 0===t?jn.maxEnqueuedMessages:t;this._messageQueue.length<r&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,r,n=this._listeners[e.type];if(n)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(n),a=o.next();!a.done;a=o.next()){var i=a.value;this._callEventListener(e,i)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,Tn(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,r=void 0===t?jn.reconnectionDelayGrowFactor:t,n=e.minReconnectionDelay,o=void 0===n?jn.minReconnectionDelay:n,a=e.maxReconnectionDelay,i=void 0===a?jn.maxReconnectionDelay:a,s=0;return this._retryCount>0&&(s=o*Math.pow(r,this._retryCount-1))>i&&(s=i),this._debug("next delay",s),s},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,r=t.maxRetries,n=void 0===r?jn.maxRetries:r,o=t.connectionTimeout,a=void 0===o?jn.connectionTimeout:o,i=t.WebSocket,s=void 0===i?kn():i;if(this._retryCount>=n)this._debug("max retries reached",this._retryCount,">=",n);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),!function(e){return void 0!==e&&!!e&&2===e.CLOSING}(s))throw Error("No valid WebSocket class provided");this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new s(t,e._protocols):new s(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),a))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new In(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new Dn(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),En=r(Object.freeze({__proto__:null,default:Cn})),xn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.offersClient=t.sapiResponseToHotelOfferEntity=t.createRequest=t.encodeMetadata=void 0;var r,n=Ee.__importDefault(Ae),o=Ee.__importDefault(En);function a(e){return encodeURIComponent(Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).join("&"))}function i(e,t,r){var n,o={checkIn:e.checkIn,checkOut:e.checkOut,anchorHotelId:e.anchorHotelId,hotelIds:e.hotelIds,rooms:e.rooms,searchId:e.searchId,cugDeals:e.cugDeals,tier:e.tier,language:t.language,deviceType:t.deviceType,anonymousId:t.anonymousId,currency:t.currency,originId:e.originId,brand:t.brand,clientRequestId:r,sortingBoost:(0,Zr.generateSortingBoost)(e),getAllOffers:Boolean(e.getAllOffers),preferredRate:e.preferredRate,label:e.label,countryCode:t.countryCode,variations:t.variations};e.metadata&&(o.metadata=a(e.metadata));try{n=JSON.stringify(o)}catch(e){console.log("WEBSOCKET: error serialising request")}return n}function s(e){var t;return{availableOffersCount:e.availableOffersCount,anchorRate:e.anchorRate,id:e.id,offers:null===(t=e.offers)||void 0===t?void 0:t.map((function(t){return function(e,t){var r;return(0,br.omit)(["roomID","occupancy"],Ee.__assign(Ee.__assign({},e),{roomName:null===(r=null==t?void 0:t[e.roomID])||void 0===r?void 0:r.name}))}(t,e.rooms)})),discount:e.discount}}!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(r||(r={})),t.encodeMetadata=a,t.createRequest=i,t.sapiResponseToHotelOfferEntity=s,t.offersClient=function(e,t){if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var a=(0,$r.removeEmpty)({sapiOverride:(0,Ue.getSapiOverrideParameter)(!0)}),u=new n.default(a).toString(),c="wss://".concat(e.baseUrl,"/").concat(e.endpoints.offers,"?").concat(u),l=new o.default(c,[],{maxRetries:15,WebSocket:t.WebSocket}),f={},d={};function h(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"sapi",code:e.code,reason:e.reason,wasClean:e.wasClean}})}function p(e){t.logger.log({name:"WebsocketError",value:Ee.__assign(Ee.__assign({},e),{service:"sapi"})})}function v(){for(var e=0,t=Object.keys(f);e<t.length;e++){var r=t[e],n=f[r];void 0!==n&&l.send(n)}}function g(e){var t;try{t=JSON.parse(e.data)}catch(e){return void console.log("WEBSOCKET: error parsing message")}var r=d[t.clientRequestId];"function"==typeof r&&r(t)}return l.addEventListener("open",v),l.addEventListener("close",h),l.addEventListener("error",p),l.addEventListener("message",g),{getOffers:function(e,n){return Ee.__awaiter(this,void 0,void 0,(function(){var o,a;return Ee.__generator(this,(function(u){return o={status:{anchorComplete:!1,nonAnchorComplete:!1}},a=(0,Qr.v4)(),f[a]=i(e,t,a),[2,new Promise((function(t){d[a]=function(r){var i,u;if(void 0!==r)if(r.status.complete)t(o),f[a]=void 0,d[a]=void 0;else{var c=null===(i=r.results)||void 0===i?void 0:i.find((function(t){return t.id===e.anchorHotelId}));c?(o.anchorHotelOfferEntity=s(c),o.status.anchorComplete||(o.status.anchorComplete=Boolean(r.status.anchorComplete))):(o.hotelOfferEntities=null===(u=r.results)||void 0===u?void 0:u.map((function(e){return s(e)})),o.status.nonAnchorComplete||(o.status.nonAnchorComplete=Boolean(r.status.nonAnchorComplete))),"function"==typeof n&&n(Ee.__assign({},o))}};var i=f[a];void 0!==i&&(l.readyState===r.Open?l.send(i):l.readyState===r.Closed&&(l._connectLock=!1,l.reconnect()))}))]}))}))}}}})),Rn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=t.variationsToArray=void 0;var r={log:function(){}};function n(e){void 0===e&&(e={});var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push("".concat(r,"-").concat(e[r]));return t}t.variationsToArray=n,t.sapi=function(e,t){var o,a,i,s,u,c,l;return Ee.__awaiter(this,void 0,void 0,(function(){function f(e){return h.client.features.includes(e)}function d(){var e,t;if(f("search")){if((null===(e=v.options.variations)||void 0===e?void 0:e.includes("sapi4eva-room-mapping-rsp-v8-1-a"))||(null===(t=v.options.variations)||void 0===t?void 0:t.includes("sapi4eva-room-mapping-rsp-v8-1-b"))){return function(e,t){return void 0===t&&(t={}),Ee.__awaiter(this,void 0,void 0,(function(){return Ee.__generator(this,(function(r){return[2,(0,pn.search)(v)(e,Ee.__assign(Ee.__assign({},t),{onComplete:function(e){var r,n,o=e.anchorHotelId,a=e.hotelOfferEntities,i=e.searchParameters,s=e.offset;if(!(0,fn.hasRequiredSearchParameters)(i))throw new Error("Dates must be set by client, SDK or response");if(o&&0===s){var u=a[o],c=null==u?void 0:u.offers.find((function(e){return"FHT"===e.intermediaryProvider}));if(c)try{(0,yn.rooms)(v)({hotelId:o,checkIn:i.checkIn,checkOut:i.checkOut,rooms:i.rooms,cugDeals:null===(r=i.cugDeals)||void 0===r?void 0:r.join(","),tier:i.tier,preHeat:1,label:null!==(n=i.label)&&void 0!==n?n:i.trafficSource,clickedOfferId:c.id,clickedOfferBaseRate:c.rate.base,clickedOfferHotelFees:c.rate.hotelFees,clickedOfferTaxes:c.rate.taxes})}catch(e){}}"function"==typeof t.onComplete&&t.onComplete(e)}}))]}))}))}}return(0,pn.search)(v)}return function(){throw new Error("Search is not enabled for this profile key")}}var h,p,v;return Ee.__generator(this,(function(g){if(!e)throw new Error("Profile key is required");return h=(0,xe.getAppConfig)(e,t.initWithAppConfig),p=Ee.__assign(Ee.__assign({},t),{logger:null!==(o=t.logger)&&void 0!==o?o:r,variations:n(t.variations),currency:null!==(i=null===(a=t.currency)||void 0===a?void 0:a.toUpperCase())&&void 0!==i?i:"USD",deviceType:null!==(s=t.deviceType)&&void 0!==s?s:"desktop",countryCode:t.countryCode,pageSize:null!==(u=t.pageSize)&&void 0!==u?u:20,getTotalRate:null!==(c=t.getTotalRate)&&void 0!==c?c:fn.getTotalRate,languages:Ee.__spreadArray(Ee.__spreadArray([t.language],null!==(l=h.client.fallbackLanguages[t.language])&&void 0!==l?l:[],!0),["en"],!1)}),v={appConfig:h,getFeatureEnabled:f,profileKey:e,options:p,offersClient:f("offers")?(0,xn.offersClient)(h.sapiBackend,p):void 0},[2,{rooms:f("rooms")?(0,yn.rooms)(v):function(){throw new Error("Rooms search is not enabled for this profile key")},search:d(),suggest:f("suggests")?(0,mn.suggest)(v):function(){throw new Error("Autosuggest is not enabled for this profile key")},hotel:f("get-hotel")?(0,bn.hotel)(v):function(){throw new Error("Get hotel is not allowed for this profile key")},hotels:f("get-hotel")?(0,bn.hotels)(v):function(){throw new Error("Get hotels is not allowed for this profile key")},offers:f("offers")?(0,_n.offers)(v):function(){throw new Error("Get offers is not allowed for this profile key")}}]}))}))}})),Nn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Mn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),An=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Un=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),qn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Hn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Bn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Fn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Wn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Ee.__exportStar(Nn,t),Ee.__exportStar(Mn,t),Ee.__exportStar(An,t),Ee.__exportStar(Un,t),Ee.__exportStar(qn,t),Ee.__exportStar(Hn,t),Ee.__exportStar(Bn,t),Ee.__exportStar(Fn,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0,(0,_r.enableES5)(),Ee.__exportStar(Rn,t),Ee.__exportStar(xe,t),Ee.__exportStar(Wn,t),Object.defineProperty(t,"generateSearchId",{enumerable:!0,get:function(){return fn.generateSearchId}})})))}));
|
|
@@ -40,6 +40,7 @@ export interface SafHotel {
|
|
|
40
40
|
currency?: Currency;
|
|
41
41
|
}
|
|
42
42
|
export declare type HotelHandler = (hotelId: HotelId) => Promise<ContentHotel>;
|
|
43
|
+
export declare type HotelsHandler = (hotelIds: HotelId[]) => Promise<Record<HotelId, ContentHotel>>;
|
|
43
44
|
export declare function safToSapiHotel(safHotel: SafHotel, languages: Language[]): ContentHotel;
|
|
44
45
|
/**
|
|
45
46
|
* Creates hotel request string
|
|
@@ -55,10 +56,29 @@ export interface Parameters {
|
|
|
55
56
|
options: ClientOptions;
|
|
56
57
|
}
|
|
57
58
|
/**
|
|
58
|
-
*
|
|
59
|
+
* @deprecated - use hotels instead
|
|
59
60
|
*
|
|
60
|
-
*
|
|
61
|
+
* Creates hotel function with bind in configuration object
|
|
62
|
+
*
|
|
63
|
+
* @param configuration - Configuration for hotel function initialization
|
|
61
64
|
*
|
|
62
65
|
* @returns function that asynchronously returns hotel's content by hotelId
|
|
63
66
|
*/
|
|
64
67
|
export declare function hotel({ appConfig, options }: Parameters): HotelHandler;
|
|
68
|
+
/**
|
|
69
|
+
* Creates hotels request string
|
|
70
|
+
*
|
|
71
|
+
* @param hotelIds - Requested hotel ids
|
|
72
|
+
* @param options - hotel request options - persistent within single SAPI instance
|
|
73
|
+
*
|
|
74
|
+
* @returns request string
|
|
75
|
+
*/
|
|
76
|
+
export declare function createHotelsRequestString(hotelIds: HotelId[], options: ClientOptions): string;
|
|
77
|
+
/**
|
|
78
|
+
* Creates hotels function with bind in configuration object
|
|
79
|
+
*
|
|
80
|
+
* @param configuration - Configuration for hotels function initialization
|
|
81
|
+
*
|
|
82
|
+
* @returns function that asynchronously returns hotels' content by hotelIds
|
|
83
|
+
*/
|
|
84
|
+
export declare function hotels({ appConfig, options }: Parameters): HotelsHandler;
|
|
@@ -2,7 +2,7 @@ import { ProfileKey } from './app-config';
|
|
|
2
2
|
import { SearchHandler } from './search';
|
|
3
3
|
import { SuggestHandler } from './suggest';
|
|
4
4
|
import { RoomsHandler } from './rooms';
|
|
5
|
-
import { HotelHandler } from './hotel';
|
|
5
|
+
import { HotelHandler, HotelsHandler } from './hotel';
|
|
6
6
|
import { OffersHandler } from './offers';
|
|
7
7
|
import { ClientOptions } from './types';
|
|
8
8
|
/**
|
|
@@ -15,7 +15,12 @@ export interface SapiClient {
|
|
|
15
15
|
rooms: RoomsHandler;
|
|
16
16
|
search: SearchHandler;
|
|
17
17
|
suggest: SuggestHandler;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated
|
|
20
|
+
* Use `hotels` method instead
|
|
21
|
+
*/
|
|
18
22
|
hotel: HotelHandler;
|
|
23
|
+
hotels: HotelsHandler;
|
|
19
24
|
offers: OffersHandler;
|
|
20
25
|
}
|
|
21
26
|
/**
|