@findhotel/sapi 0.22.14 → 0.22.15
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/CHANGELOG.md +6 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [0.22.15](https://github.com/FindHotel/sapi/compare/v0.22.14...v0.22.15) (2021-12-27)
|
|
2
|
+
### Added
|
|
3
|
+
- Forward `anonymousId` to SAPI/search() backend endpoint
|
|
4
|
+
|
|
5
|
+
|
|
1
6
|
## [0.22.14](https://github.com/FindHotel/sapi/compare/v0.22.13...v0.22.14) (2021-12-17)
|
|
2
7
|
### Added
|
|
3
8
|
- `isDeleted` filter for autosuggest module
|
|
@@ -19,7 +24,7 @@
|
|
|
19
24
|
|
|
20
25
|
## [0.22.10](https://github.com/FindHotel/sapi/compare/v0.22.9...v0.22.10) (2021-11-30)
|
|
21
26
|
### Added
|
|
22
|
-
- boundingBox parameter to SAF-search request
|
|
27
|
+
- `boundingBox` parameter to SAF-search request
|
|
23
28
|
|
|
24
29
|
## [0.22.9](https://github.com/FindHotel/sapi/compare/v0.22.8...v0.22.9) (2021-11-24)
|
|
25
30
|
### Added
|
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 n(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}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}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)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var i=function(){return(i=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}).apply(this,arguments)};var a=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function u(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,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function c(e){return this instanceof c?(this.v=e,this):new c(e)}var l=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var f=Object.freeze({__proto__:null,__extends:function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return i},__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,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},__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,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function u(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},__createBinding:a,__exportStar:function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)},__values:u,__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 i=arguments[t],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},__await:c,__asyncGenerator:function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){i.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof c?Promise.resolve(e.value.v).then(s,l):f(i[0][2],e)}(o[e](t))}catch(e){f(i[0][3],e)}}function s(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[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:c(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=u(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 l(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}}),d=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={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[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,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(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 a(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},i=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=i()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=o(e,2),n=t[0],i=t[1];return Promise.all([n,i||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=i();return o[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=i();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function u(e){var t=i(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 u({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return u({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return u({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return u({caches:t}).clear()}))}}}function s(){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()}},i=JSON.stringify(r);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);var a=n(),u=o&&o.miss||function(){return Promise.resolve()};return a.then((function(e){return u(e)})).then((function(){return a}))},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===g.WithinHeaders?n:{}},queryParameters:function(){return e===g.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 g={WithinQueryParameters:0,WithinHeaders:1};function v(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 y={Read:1,Write:2,Any:3},m=1,b=2,_=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:y.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||y.Any}}var T="DELETE",S="GET",x="POST",P="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===m||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(i(r),i(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 E(e,t,n,o){var a=[],u=function(e,t){if(e.method!==S&&(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),s=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!==S?{}: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,i){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:A(a)};var h={data:u,headers:s,method:c,url:D(l,n.path,f),connectTimeout:i(d,e.timeouts.connect),responseTimeout:i(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:r.length};return a.push(t),t},g={onSucess: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,i)}))},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,A(a))}};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.onSucess(e):t.onFail(e)}(e,g)}))};return I(e.hostsCache,t).then((function(e){return h(i(e.statelessHosts).reverse(),e.getTimeout)}))}function k(e){var t=e.hostsCache,r=e.logger,n=e.requester,i=e.requestsCache,a=e.responsesCache,u=e.timeouts,s=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:i,responsesCache:a,timeouts:u,userAgent:s,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var r=v(t,f.timeouts.read),n=function(){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var i={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(i,(function(){return f.requestsCache.get(i,(function(){return f.requestsCache.set(i,n()).then((function(e){return Promise.all([f.requestsCache.delete(i),e])}),(function(e){return Promise.all([f.requestsCache.delete(i),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(i,e)}})},write:function(e,t){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Write)})),e,v(t,f.timeouts.write))}};return f}function j(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 D(e,t,r){var n=C(r),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(o+="?".concat(n)),o}function C(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 A(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 R=function(e){return function(t,r){return e.transporter.write({method:x,path:"2/abtests",data:t},r)}},M=function(e){return function(t,r){return e.transporter.write({method:T,path:p("2/abtests/%s",t)},r)}},U=function(e){return function(t,r){return e.transporter.read({method:S,path:p("2/abtests/%s",t)},r)}},B=function(e){return function(t){return e.transporter.read({method:S,path:"2/abtests"},t)}},q=function(e){return function(t,r){return e.transporter.write({method:x,path:p("2/abtests/%s/stop",t)},r)}},L=function(e){return function(t){return e.transporter.read({method:S,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,r){return e.transporter.write({method:x,path:"1/strategies/personalization",data:t},r)}};function H(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 z=function(e){return function(t,o){var i=o||{},a=i.queryParameters,u=n(i,["queryParameters"]),s=r({acl:t},void 0!==a?{queryParameters:a}:{});return f(e.transporter.write({method:x,path:"1/keys",data:s},u),(function(t,r){return l((function(n){return X(e)(t.key,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},W=function(e){return function(t,r,n){var o=v(n);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:x,path:"1/clusters/mapping",data:{cluster:r}},o)}},Y=function(e){return function(t,r,n){return e.transporter.write({method:x,path:"1/clusters/mapping/batch",data:{users:t,cluster:r}},n)}},K=function(e){return function(t,r,n){return f(e.transporter.write({method:x,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},V=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Rules]}))}},G=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Settings]}))}},Q=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Synonyms]}))}},J=function(e){return function(t,r){return f(e.transporter.write({method:T,path:p("1/keys/%s",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).then(r).catch((function(e){if(404!==e.status)throw e}))}))}))}},X=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/keys/%s",t)},r)}},$=function(e){return function(t){return e.transporter.read({method:S,path:"1/logs"},t)}},Z=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping/top"},t)}},ee=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/clusters/mapping/%s",t)},r)}},te=function(e){return function(t){var r=t||{},o=r.retrieveMappings,i=n(r,["retrieveMappings"]);return!0===o&&(i.getClusters=!0),e.transporter.read({method:S,path:"1/clusters/mapping/pending"},i)}},re=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)}},ne=function(e){return function(t){return e.transporter.read({method:S,path:"1/keys"},t)}},oe=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters"},t)}},ie=function(e){return function(t){return e.transporter.read({method:S,path:"1/indexes"},t)}},ae=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping"},t)}},ue=function(e){return function(t,r,n){return f(e.transporter.write({method:x,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},se=function(e){return function(t,r){return f(e.transporter.write({method:x,path:"1/indexes/*/batch",data:{requests:t}},r),(function(t,r){return Promise.all(Object.keys(t.taskID).map((function(n){return re(e)(n,{methods:{waitTask:tt}}).waitTask(t.taskID[n],r)})))}))}},ce=function(e){return function(t,r){return e.transporter.read({method:x,path:"1/indexes/*/objects",data:{requests:t}},r)}},le=function(e){return function(t,n){var o=t.map((function(e){return r(r({},e),{},{params:C(e.params||{})})}));return e.transporter.read({method:x,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},n)}},fe=function(e){return function(t,o){return Promise.all(t.map((function(t){var i=t.params,a=i.facetName,u=i.facetQuery,s=n(i,["facetName","facetQuery"]);return re(e)(t.indexName,{methods:{searchForFacetValues:Xe}}).searchForFacetValues(a,u,r(r({},o),s))})))}},de=function(e){return function(t,r){var n=v(r);return n.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:T,path:"1/clusters/mapping"},n)}},he=function(e){return function(t,r){return f(e.transporter.write({method:x,path:p("1/keys/%s/restore",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},pe=function(e){return function(t,r){return e.transporter.read({method:x,path:"1/clusters/mapping/search",data:{query:t}},r)}},ge=function(e){return function(t,r){var o=Object.assign({},r),i=r||{},a=i.queryParameters,u=n(i,["queryParameters"]),s=a?{queryParameters:a}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:P,path:p("1/keys/%s",t),data:s},u),(function(r,n){return l((function(r){return X(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()}))}))}))}},ve=function(e){return function(t,r){return f(e.transporter.write({method:x,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},r),(function(t,r){return tt(e)(t.taskID,r)}))}},ye=function(e){return function(t){return H(r(r({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(r){return e.transporter.read({method:x,path:p("1/indexes/%s/browse",e.indexName),data:r},t)}}))}},me=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return $e(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},be=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return Ze(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},_e=function(e){return function(t,r,o){var i=o||{},a=i.batchSize,u=n(i,["batchSize"]),s={taskIDs:[],objectIDs:[]};return f(function n(){var o,i=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(i.push(t[o]),i.length!==(a||1e3));o++);return 0===i.length?Promise.resolve(s):ve(e)(i.map((function(e){return{action:r,body:e}})),u).then((function(e){return s.objectIDs=s.objectIDs.concat(e.objectIDs),s.taskIDs.push(e.taskID),o++,n(o)}))}(),(function(t,r){return Promise.all(t.taskIDs.map((function(t){return tt(e)(t,r)})))}))}},we=function(e){return function(t){return f(e.transporter.write({method:x,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},Oe=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,i=v(n(r,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/rules/clear",e.indexName)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},Te=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,i=v(n(r,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/synonyms/clear",e.indexName)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},Se=function(e){return function(t,r){return f(e.transporter.write({method:x,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},r),(function(t,r){return tt(e)(t.taskID,r)}))}},xe=function(e){return function(t){return f(e.transporter.write({method:T,path:p("1/indexes/%s",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},Pe=function(e){return function(t,r){return f(Ie(e)([t],r).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Ie=function(e){return function(t,r){var n=t.map((function(e){return{objectID:e}}));return _e(e)(n,rt.DeleteObject,r)}},Ee=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=v(n(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},ke=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=v(n(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},je=function(e){return function(t){return Ue(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},De=function(e){return function(t,r,n){return e.transporter.read({method:x,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},Ce=function(e){return function(t,i){var a=i||{},u=a.query,s=a.paginate,c=n(a,["query","paginate"]),l=0;return function n(){return Je(e)(u||"",r(r({},c),{},{page:l})).then((function(e){for(var r=0,i=Object.entries(e.hits);r<i.length;r++){var a=o(i[r],2),u=a[0],c=a[1];if(t(c))return{object:c,position:parseInt(u,10),page:l}}if(l++,!1===s||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return n()}))}()}},Ae=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/%s",e.indexName,t)},r)}},Ne=function(){return function(e,t){for(var r=0,n=Object.entries(e.hits);r<n.length;r++){var i=o(n[r],2),a=i[0];if(i[1].objectID===t)return parseInt(a,10)}return-1}},Re=function(e){return function(t,o){var i=o||{},a=i.attributesToRetrieve,u=n(i,["attributesToRetrieve"]),s=t.map((function(t){return r({indexName:e.indexName,objectID:t},a?{attributesToRetrieve:a}:{})}));return e.transporter.read({method:x,path:"1/indexes/*/objects",data:{requests:s}},u)}},Me=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/%s",e.indexName,t)},r)}},Ue=function(e){return function(t){return e.transporter.read({method:S,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Be=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},r)}},qe=function(e){return function(t,r){return f(Le(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Le=function(e){return function(t,r){var o=r||{},i=o.createIfNotExists,a=n(o,["createIfNotExists"]),u=i?rt.PartialUpdateObject:rt.PartialUpdateObjectNoCreate;return _e(e)(t,u,a)}},Fe=function(e){return function(t,a){var u=a||{},s=u.safe,c=u.autoGenerateObjectIDIfNotExist,l=u.batchSize,d=n(u,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,r,n,o){return f(e.transporter.write({method:x,path:p("1/indexes/%s/operation",t),data:{operation:n,destination:r}},o),(function(t,r){return tt(e)(t.taskID,r)}))},g=Math.random().toString(36).substring(7),v="".concat(e.indexName,"_tmp_").concat(g),y=Ye({appId:e.appId,transporter:e.transporter,indexName:v}),m=[],b=h(e.indexName,v,"copy",r(r({},d),{},{scope:["settings","synonyms","rules"]}));return m.push(b),f((s?b.wait(d):b).then((function(){var e=y(t,r(r({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return m.push(e),s?e.wait(d):e})).then((function(){var t=h(v,e.indexName,"move",d);return m.push(t),s?t.wait(d):t})).then((function(){return Promise.all(m)})).then((function(e){var t=o(e,3),r=t[0],n=t[1],a=t[2];return{objectIDs:n.objectIDs,taskIDs:[r.taskID].concat(i(n.taskIDs),[a.taskID])}})),(function(e,t){return Promise.all(m.map((function(e){return e.wait(t)})))}))}},He=function(e){return function(t,n){return Ve(e)(t,r(r({},n),{},{clearExistingRules:!0}))}},ze=function(e){return function(t,n){return Qe(e)(t,r(r({},n),{},{clearExistingSynonyms:!0}))}},We=function(e){return function(t,r){return f(Ye(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Ye=function(e){return function(t,r){var o=r||{},i=o.autoGenerateObjectIDIfNotExist,a=n(o,["autoGenerateObjectIDIfNotExist"]),u=i?rt.AddObject:rt.UpdateObject;if(u===rt.UpdateObject){var s=!0,c=!1,l=void 0;try{for(var d,h=t[Symbol.iterator]();!(s=(d=h.next()).done);s=!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{s||null==h.return||h.return()}finally{if(c)throw l}}}return _e(e)(t,u,a)}},Ke=function(e){return function(t,r){return Ve(e)([t],r)}},Ve=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=o.clearExistingRules,u=v(n(o,["forwardToReplicas","clearExistingRules"]));return i&&(u.queryParameters.forwardToReplicas=1),a&&(u.queryParameters.clearExistingRules=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},u),(function(t,r){return tt(e)(t.taskID,r)}))}},Ge=function(e){return function(t,r){return Qe(e)([t],r)}},Qe=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=o.clearExistingSynonyms,u=o.replaceExistingSynonyms,s=v(n(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return i&&(s.queryParameters.forwardToReplicas=1),(u||a)&&(s.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(function(t,r){return tt(e)(t.taskID,r)}))}},Je=function(e){return function(t,r){return e.transporter.read({method:x,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},Xe=function(e){return function(t,r,n){return e.transporter.read({method:x,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},$e=function(e){return function(t,r){return e.transporter.read({method:x,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},r)}},Ze=function(e){return function(t,r){return e.transporter.read({method:x,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},r)}},et=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=v(n(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:P,path:p("1/indexes/%s/settings",e.indexName),data:t},a),(function(t,r){return tt(e)(t.taskID,r)}))}},tt=function(e){return function(t,r){return l((function(n){return function(e){return function(t,r){return e.transporter.read({method:S,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}))}))}},rt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},nt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},ot=1,it=2,at=3;function ut(e,t,n){var o,i={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)},i=o(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(i),n=o(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(i),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(i),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=at,{debug:function(e,t){return ot>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return it>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:u({caches:[a({key:"".concat("4.8.0","-").concat(e)}),s()]}),userAgent:j("4.8.0").add({segment:"Browser"})};return function(e){var t=e.appId,n=c(void 0!==e.authMode?e.authMode:g.WithinHeaders,t,e.apiKey),o=k(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:y.Read},{url:"".concat(t,".algolia.net"),accept:y.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(r({},i),n),{},{methods:{search:le,searchForFacetValues:fe,multipleBatch:se,multipleGetObjects:ce,multipleQueries:le,copyIndex:K,copySettings:G,copySynonyms:Q,copyRules:V,moveIndex:ue,listIndices:ie,getLogs:$,listClusters:oe,multipleSearchForFacetValues:fe,getApiKey:X,addApiKey:z,listApiKeys:ne,updateApiKey:ge,deleteApiKey:J,restoreApiKey:he,assignUserID:W,assignUserIDs:Y,getUserID:ee,searchUserIDs:pe,listUserIDs:ae,getTopUserIDs:Z,removeUserID:de,hasPendingMappings:te,initIndex:function(e){return function(t){return re(e)(t,{methods:{batch:ve,delete:xe,findAnswers:De,getObject:Ae,getObjects:Re,saveObject:We,saveObjects:Ye,search:Je,searchForFacetValues:Xe,waitTask:tt,setSettings:et,getSettings:Ue,partialUpdateObject:qe,partialUpdateObjects:Le,deleteObject:Pe,deleteObjects:Ie,deleteBy:Se,clearObjects:we,browseObjects:ye,getObjectPosition:Ne,findObject:Ce,exists:je,saveSynonym:Ge,saveSynonyms:Qe,getSynonym:Be,searchSynonyms:Ze,browseSynonyms:be,deleteSynonym:ke,clearSynonyms:Te,replaceAllObjects:Fe,replaceAllSynonyms:ze,searchRules:$e,getRule:Me,deleteRule:Ee,saveRule:Ke,saveRules:Ve,replaceAllRules:He,browseRules:me,clearRules:Oe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.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({},i),e),{},{methods:{addABTest:R,getABTest:U,getABTests:B,stopABTest:q,deleteABTest:M}}))}},initRecommendation:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"recommendation.".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({},i),e),{},{methods:{getPersonalizationStrategy:L,setPersonalizationStrategy:F}}))}}}}))}return ut.version="4.8.0",ut}()})),h=function(e,t){return(h=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)};function p(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}var y,m=function(e,t){this.target=t,this.type=e},b=function(e){function t(t,r){var n=e.call(this,"error",r)||this;return n.message=t.message,n.error=t,n}return p(t,e),t}(m),_=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 p(t,e),t}(m),w=function(){if("undefined"!=typeof WebSocket)return WebSocket},O={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},T=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?O.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?O.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),i=o.next();!i.done;i=o.next()){var a=i.value;this._callEventListener(e,a)}}catch(e){t={error:e}}finally{try{i&&!i.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,v(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,r=void 0===t?O.reconnectionDelayGrowFactor:t,n=e.minReconnectionDelay,o=void 0===n?O.minReconnectionDelay:n,i=e.maxReconnectionDelay,a=void 0===i?O.maxReconnectionDelay:i,u=0;return this._retryCount>0&&(u=o*Math.pow(r,this._retryCount-1))>a&&(u=a),this._debug("next delay",u),u},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?O.maxRetries:r,o=t.connectionTimeout,i=void 0===o?O.connectionTimeout:o,a=t.WebSocket,u=void 0===a?w():a;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}(u))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 u(t,e._protocols):new u(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),i))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new b(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 _(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}(),S=Object.freeze({__proto__:null,default:T}),x=new Uint8Array(16);function P(){if(!y&&!(y="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 y(x)}var I=/^(?:[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 E(e){return"string"==typeof e&&I.test(e)}for(var k,j,D=[],C=0;C<256;++C)D.push((C+256).toString(16).substr(1));function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(D[e[t+0]]+D[e[t+1]]+D[e[t+2]]+D[e[t+3]]+"-"+D[e[t+4]]+D[e[t+5]]+"-"+D[e[t+6]]+D[e[t+7]]+"-"+D[e[t+8]]+D[e[t+9]]+"-"+D[e[t+10]]+D[e[t+11]]+D[e[t+12]]+D[e[t+13]]+D[e[t+14]]+D[e[t+15]]).toLowerCase();if(!E(r))throw TypeError("Stringified UUID is invalid");return r}var N=0,R=0;function M(e){if(!E(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 U(e,t,r){function n(e,n,o,i){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=M(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),(a=r(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,o){i=i||0;for(var u=0;u<16;++u)o[i+u]=a[u];return o}return A(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function B(e){return 14+(e+64>>>9<<4)+1}function q(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function L(e,t,r,n,o,i){return q((a=q(q(t,e),q(n,i)))<<(u=o)|a>>>32-u,r);var a,u}function F(e,t,r,n,o,i,a){return L(t&r|~t&n,e,t,o,i,a)}function H(e,t,r,n,o,i,a){return L(t&n|r&~n,e,t,o,i,a)}function z(e,t,r,n,o,i,a){return L(t^r^n,e,t,o,i,a)}function W(e,t,r,n,o,i,a){return L(r^(t|~n),e,t,o,i,a)}var Y=U("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 i=e[o>>5]>>>o%32&255,a=parseInt(n.charAt(i>>>4&15)+n.charAt(15&i),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[B(t)-1]=t;for(var r=1732584193,n=-271733879,o=-1732584194,i=271733878,a=0;a<e.length;a+=16){var u=r,s=n,c=o,l=i;r=F(r,n,o,i,e[a],7,-680876936),i=F(i,r,n,o,e[a+1],12,-389564586),o=F(o,i,r,n,e[a+2],17,606105819),n=F(n,o,i,r,e[a+3],22,-1044525330),r=F(r,n,o,i,e[a+4],7,-176418897),i=F(i,r,n,o,e[a+5],12,1200080426),o=F(o,i,r,n,e[a+6],17,-1473231341),n=F(n,o,i,r,e[a+7],22,-45705983),r=F(r,n,o,i,e[a+8],7,1770035416),i=F(i,r,n,o,e[a+9],12,-1958414417),o=F(o,i,r,n,e[a+10],17,-42063),n=F(n,o,i,r,e[a+11],22,-1990404162),r=F(r,n,o,i,e[a+12],7,1804603682),i=F(i,r,n,o,e[a+13],12,-40341101),o=F(o,i,r,n,e[a+14],17,-1502002290),r=H(r,n=F(n,o,i,r,e[a+15],22,1236535329),o,i,e[a+1],5,-165796510),i=H(i,r,n,o,e[a+6],9,-1069501632),o=H(o,i,r,n,e[a+11],14,643717713),n=H(n,o,i,r,e[a],20,-373897302),r=H(r,n,o,i,e[a+5],5,-701558691),i=H(i,r,n,o,e[a+10],9,38016083),o=H(o,i,r,n,e[a+15],14,-660478335),n=H(n,o,i,r,e[a+4],20,-405537848),r=H(r,n,o,i,e[a+9],5,568446438),i=H(i,r,n,o,e[a+14],9,-1019803690),o=H(o,i,r,n,e[a+3],14,-187363961),n=H(n,o,i,r,e[a+8],20,1163531501),r=H(r,n,o,i,e[a+13],5,-1444681467),i=H(i,r,n,o,e[a+2],9,-51403784),o=H(o,i,r,n,e[a+7],14,1735328473),r=z(r,n=H(n,o,i,r,e[a+12],20,-1926607734),o,i,e[a+5],4,-378558),i=z(i,r,n,o,e[a+8],11,-2022574463),o=z(o,i,r,n,e[a+11],16,1839030562),n=z(n,o,i,r,e[a+14],23,-35309556),r=z(r,n,o,i,e[a+1],4,-1530992060),i=z(i,r,n,o,e[a+4],11,1272893353),o=z(o,i,r,n,e[a+7],16,-155497632),n=z(n,o,i,r,e[a+10],23,-1094730640),r=z(r,n,o,i,e[a+13],4,681279174),i=z(i,r,n,o,e[a],11,-358537222),o=z(o,i,r,n,e[a+3],16,-722521979),n=z(n,o,i,r,e[a+6],23,76029189),r=z(r,n,o,i,e[a+9],4,-640364487),i=z(i,r,n,o,e[a+12],11,-421815835),o=z(o,i,r,n,e[a+15],16,530742520),r=W(r,n=z(n,o,i,r,e[a+2],23,-995338651),o,i,e[a],6,-198630844),i=W(i,r,n,o,e[a+7],10,1126891415),o=W(o,i,r,n,e[a+14],15,-1416354905),n=W(n,o,i,r,e[a+5],21,-57434055),r=W(r,n,o,i,e[a+12],6,1700485571),i=W(i,r,n,o,e[a+3],10,-1894986606),o=W(o,i,r,n,e[a+10],15,-1051523),n=W(n,o,i,r,e[a+1],21,-2054922799),r=W(r,n,o,i,e[a+8],6,1873313359),i=W(i,r,n,o,e[a+15],10,-30611744),o=W(o,i,r,n,e[a+6],15,-1560198380),n=W(n,o,i,r,e[a+13],21,1309151649),r=W(r,n,o,i,e[a+4],6,-145523070),i=W(i,r,n,o,e[a+11],10,-1120210379),o=W(o,i,r,n,e[a+2],15,718787259),n=W(n,o,i,r,e[a+9],21,-343485551),r=q(r,u),n=q(n,s),o=q(o,c),i=q(i,l)}return[r,n,o,i]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(B(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}));function K(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function V(e,t){return e<<t|e>>>32-t}var G=U("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 i=e.length/4+2,a=Math.ceil(i/16),u=new Array(a),s=0;s<a;++s){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*s+4*l]<<24|e[64*s+4*l+1]<<16|e[64*s+4*l+2]<<8|e[64*s+4*l+3];u[s]=c}u[a-1][14]=8*(e.length-1)/Math.pow(2,32),u[a-1][14]=Math.floor(u[a-1][14]),u[a-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<a;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=u[f][h];for(var p=16;p<80;++p)d[p]=V(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var g=r[0],v=r[1],y=r[2],m=r[3],b=r[4],_=0;_<80;++_){var w=Math.floor(_/20),O=V(g,5)+K(w,v,y,m)+b+t[w]+d[_]>>>0;b=m,m=y,y=V(v,30)>>>0,v=g,g=O}r[0]=r[0]+g>>>0,r[1]=r[1]+v>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+m>>>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]]}));var Q=Object.freeze({__proto__:null,v1:function(e,t,r){var n=t&&r||0,o=t||new Array(16),i=(e=e||{}).node||k,a=void 0!==e.clockseq?e.clockseq:j;if(null==i||null==a){var u=e.random||(e.rng||P)();null==i&&(i=k=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==a&&(a=j=16383&(u[6]<<8|u[7]))}var s=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:R+1,l=s-N+(c-R)/1e4;if(l<0&&void 0===e.clockseq&&(a=a+1&16383),(l<0||s>N)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");N=s,R=c,j=a;var f=(1e4*(268435455&(s+=122192928e5))+c)%4294967296;o[n++]=f>>>24&255,o[n++]=f>>>16&255,o[n++]=f>>>8&255,o[n++]=255&f;var d=s/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++]=a>>>8|128,o[n++]=255&a;for(var h=0;h<6;++h)o[n+h]=i[h];return t||A(o)},v3:Y,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||P)();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 A(n)},v5:G,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!E(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:E,stringify:A,parse:M}),J=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheapestRate=void 0,t.getCheapestRate=function(e){if(0!==e.offers.length)return Math.min.apply(Math,e.offers.map((function(e){return e.nightlyRate})))}})),X=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 $(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Z(e){$(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 ee(e){$(1,arguments);var t=Z(e);return!isNaN(t)}var te={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"}};function re(e){return function(t){var r=t||{},n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ne={date:re({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:re({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:re({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ie(e){return function(t,r){var n,o=r||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;n=e.formattingValues[a]||e.formattingValues[i]}else{var u=e.defaultWidth,s=o.width?String(o.width):e.defaultWidth;n=e.values[s]||e.values[u]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function ae(e){return function(t,r){var n=String(t),o=r||{},i=o.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],u=n.match(a);if(!u)return null;var s,c=u[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth];return s="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}(l,(function(e){return e.test(c)})):function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}(l,(function(e){return e.test(c)})),s=e.valueCallback?e.valueCallback(s):s,{value:s=o.valueCallback?o.valueCallback(s):s,rest:n.slice(c.length)}}}var ue,se={code:"en-US",formatDistance:function(e,t,r){var n;return r=r||{},n="string"==typeof te[e]?te[e]:1===t?te[e].one:te[e].other.replace("{{count}}",t),r.addSuffix?r.comparison>0?"in "+n:n+" ago":n},formatLong:ne,formatRelative:function(e,t,r,n){return oe[e]},localize:{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:ie({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ie({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 Number(e)-1}}),month:ie({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:ie({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:ie({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"})},match:{ordinalNumber:(ue={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var r=String(e),n=t||{},o=r.match(ue.matchPattern);if(!o)return null;var i=o[0],a=r.match(ue.parsePattern);if(!a)return null;var u=ue.valueCallback?ue.valueCallback(a[0]):a[0];return{value:u=n.valueCallback?n.valueCallback(u):u,rest:r.slice(i.length)}}),era:ae({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:ae({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:ae({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:ae({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:ae({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"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ce(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 le(e,t){$(2,arguments);var r=Z(e).getTime(),n=ce(t);return new Date(r+n)}function fe(e,t){$(2,arguments);var r=ce(t);return le(e,-r)}function de(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var he=function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return de("yy"===t?n%100:n,t.length)},pe=function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):de(r+1,2)},ge=function(e,t){return de(e.getUTCDate(),t.length)},ve=function(e,t){return de(e.getUTCHours()%12||12,t.length)},ye=function(e,t){return de(e.getUTCHours(),t.length)},me=function(e,t){return de(e.getUTCMinutes(),t.length)},be=function(e,t){return de(e.getUTCSeconds(),t.length)},_e=function(e,t){var r=t.length,n=e.getUTCMilliseconds();return de(Math.floor(n*Math.pow(10,r-3)),t.length)},we=864e5;function Oe(e){$(1,arguments);var t=1,r=Z(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 Te(e){$(1,arguments);var t=Z(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=Oe(n),i=new Date(0);i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0);var a=Oe(i);return t.getTime()>=o.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function Se(e){$(1,arguments);var t=Te(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=Oe(r);return n}var xe=6048e5;function Pe(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,i=null==o?0:ce(o),a=null==r.weekStartsOn?i:ce(r.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Z(e),s=u.getUTCDay(),c=(s<a?7:0)+s-a;return u.setUTCDate(u.getUTCDate()-c),u.setUTCHours(0,0,0,0),u}function Ie(e,t){$(1,arguments);var r=Z(e,t),n=r.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,u=null==a?1:ce(a),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,s),c.setUTCHours(0,0,0,0);var l=Pe(c,t),f=new Date(0);f.setUTCFullYear(n,0,s),f.setUTCHours(0,0,0,0);var d=Pe(f,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Ee(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.firstWeekContainsDate,i=null==o?1:ce(o),a=null==r.firstWeekContainsDate?i:ce(r.firstWeekContainsDate),u=Ie(e,t),s=new Date(0);s.setUTCFullYear(u,0,a),s.setUTCHours(0,0,0,0);var c=Pe(s,t);return c}var ke=6048e5;var je="midnight",De="noon",Ce="morning",Ae="afternoon",Ne="evening",Re="night",Me={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"});case"GGGG":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 he(e,t)},Y:function(e,t,r,n){var o=Ie(e,n),i=o>0?o:1-o;return"YY"===t?de(i%100,2):"Yo"===t?r.ordinalNumber(i,{unit:"year"}):de(i,t.length)},R:function(e,t){return de(Te(e),t.length)},u:function(e,t){return de(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 de(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"});case"QQQQ":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 de(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"});case"qqqq":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 pe(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"});case"MMMM":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 de(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"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var o=function(e,t){$(1,arguments);var r=Z(e),n=Pe(r,t).getTime()-Ee(r,t).getTime();return Math.round(n/ke)+1}(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):de(o,t.length)},I:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(e),r=Oe(t).getTime()-Se(t).getTime();return Math.round(r/xe)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):de(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):ge(e,t)},D:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(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/we)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):de(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"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return de(i,2);case"eo":return r.ordinalNumber(i,{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"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return de(i,t.length);case"co":return r.ordinalNumber(i,{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"});case"cccc":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 de(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"});case"iiii":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":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,o=e.getUTCHours();switch(n=12===o?De:0===o?je:o/12>=1?"pm":"am",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"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,o=e.getUTCHours();switch(n=o>=17?Ne:o>=12?Ae:o>=4?Ce:Re,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"});case"BBBB":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 ve(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ye(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):me(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):be(e,t)},S:function(e,t){return _e(e,t)},X:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Be(o);case"XXXX":case"XX":return qe(o);case"XXXXX":case"XXX":default:return qe(o,":")}},x:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Be(o);case"xxxx":case"xx":return qe(o);case"xxxxx":case"xxx":default:return qe(o,":")}},O:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ue(o,":");case"OOOO":default:return"GMT"+qe(o,":")}},z:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ue(o,":");case"zzzz":default:return"GMT"+qe(o,":")}},t:function(e,t,r,n){var o=n._originalDate||e;return de(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,r,n){return de((n._originalDate||e).getTime(),t.length)}};function Ue(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),i=n%60;if(0===i)return r+String(o);var a=t||"";return r+String(o)+a+de(i,2)}function Be(e,t){return e%60==0?(e>0?"-":"+")+de(Math.abs(e)/60,2):qe(e,t)}function qe(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+de(Math.floor(o/60),2)+r+de(o%60,2)}function Le(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"});case"PPPP":default:return t.date({width:"full"})}}function Fe(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"});case"pppp":default:return t.time({width:"full"})}}var He={p:Fe,P:function(e,t){var r,n=e.match(/(P+)(p+)?/),o=n[1],i=n[2];if(!i)return Le(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;case"PPPP":default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",Le(o,t)).replace("{{time}}",Fe(i,t))}},ze=6e4;function We(e){return e.getTime()%ze}function Ye(e){var t=new Date(e.getTime()),r=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var n=r>0?(ze+We(t))%ze:We(t);return r*ze+n}var Ke=["D","DD"],Ve=["YY","YYYY"];function Ge(e){return-1!==Ke.indexOf(e)}function Qe(e){return-1!==Ve.indexOf(e)}function Je(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 Xe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ze=/^'([^]*?)'?$/,et=/''/g,tt=/[a-zA-Z]/;function rt(e){return e.match(Ze)[1].replace(et,"'")}var nt=Object.freeze({__proto__:null,default:function(e,t,r){$(2,arguments);var n=String(t),o=r||{},i=o.locale||se,a=i.options&&i.options.firstWeekContainsDate,u=null==a?1:ce(a),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=i.options&&i.options.weekStartsOn,l=null==c?0:ce(c),f=null==o.weekStartsOn?l:ce(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var d=Z(e);if(!ee(d))throw new RangeError("Invalid time value");var h=Ye(d),p=fe(d,h),g={firstWeekContainsDate:s,weekStartsOn:f,locale:i,_originalDate:d},v=n.match($e).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,He[t])(e,i.formatLong,g):e})).join("").match(Xe).map((function(r){if("''"===r)return"'";var n=r[0];if("'"===n)return rt(r);var a=Me[n];if(a)return!o.useAdditionalWeekYearTokens&&Qe(r)&&Je(r,t,e),!o.useAdditionalDayOfYearTokens&&Ge(r)&&Je(r,t,e),a(p,r,i.localize,g);if(n.match(tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return r})).join("");return v}});function ot(e,t){$(2,arguments);var r=Z(e),n=ce(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}var it=Object.freeze({__proto__:null,default:ot});function at(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,i=null==o?0:ce(o),a=null==r.weekStartsOn?i:ce(r.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var u=Z(e),s=u.getDay(),c=6+(s<a?-7:0)-(s-a);return u.setHours(0,0,0,0),u.setDate(u.getDate()+c),u}var ut=Object.freeze({__proto__:null,default:function(e){return $(1,arguments),at(e,{weekStartsOn:1})}});var st=Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=ce(t),n=7*r;return ot(e,n)}}),ct=36e5,lt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ft=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,dt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ht=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pt(e){var t,r={},n=e.split(lt.dateTimeDelimiter);if(n.length>2)return r;if(/:/.test(n[0])?(r.date=null,t=n[0]):(r.date=n[0],t=n[1],lt.timeZoneDelimiter.test(r.date)&&(r.date=e.split(lt.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var o=lt.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function gt(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:null};var o=n[1]&&parseInt(n[1]),i=n[2]&&parseInt(n[2]);return{year:null==i?o:100*i,restDateString:e.slice((n[1]||n[2]).length)}}function vt(e,t){if(null===t)return null;var r=e.match(ft);if(!r)return null;var n=!!r[4],o=yt(r[1]),i=yt(r[2])-1,a=yt(r[3]),u=yt(r[4]),s=yt(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,u,s)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var o=n.getUTCDay()||7,i=7*(t-1)+r+1-o;return n.setUTCDate(n.getUTCDate()+i),n}(t,u,s):new Date(NaN);var c=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(wt[t]||(Ot(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(Ot(e)?366:365)}(t,o)?(c.setUTCFullYear(t,i,Math.max(o,a)),c):new Date(NaN)}function yt(e){return e?parseInt(e):1}function mt(e){var t=e.match(dt);if(!t)return null;var r=bt(t[1]),n=bt(t[2]),o=bt(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*ct+6e4*n+1e3*o:NaN}function bt(e){return e&&parseFloat(e.replace(",","."))||0}function _t(e){if("Z"===e)return 0;var t=e.match(ht);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*ct+6e4*o):NaN}var wt=[31,null,31,30,31,30,31,31,30,31,30,31];function Ot(e){return e%400==0||e%4==0&&e%100}var Tt=Object.freeze({__proto__:null,default:function(e,t){$(1,arguments);var r=t||{},n=null==r.additionalDigits?2:ce(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,i=pt(e);if(i.date){var a=gt(i.date,n);o=vt(a.restDateString,a.year)}if(isNaN(o)||!o)return new Date(NaN);var u,s=o.getTime(),c=0;if(i.time&&(c=mt(i.time),isNaN(c)||null===c))return new Date(NaN);if(!i.timezone){var l=new Date(s+c),f=new Date(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds());return f.setFullYear(l.getUTCFullYear()),f}return u=_t(i.timezone),isNaN(u)?new Date(NaN):new Date(s+c+u)}}),St=r(f),xt=r(nt),Pt=r(it),It=r(ut),Et=r(st),kt=r(Tt),jt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var r=St.__importDefault(xt),n=St.__importDefault(Pt),o=St.__importDefault(It),i=St.__importDefault(Et),a=St.__importDefault(kt);function u(e){return a.default(e+" 12:00:00")}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=u;var s=function(e,t){return n.default(e,t)};t.getCheckInCheckOutDates=function(e,a){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h,g=u(r.default(new Date,t.DATE_FORMAT));c=void 0!==l?u(l):d?s(g,d):function(e){for(var a,s=e.daysFromNow,c=e.blockedDefaultDates,l=u(r.default(new Date,t.DATE_FORMAT)),f=o.default(n.default(l,s));a=r.default(f,t.DATE_FORMAT),c.includes(a);)f=i.default(f,1);return f}(a);var v=void 0===f?s(c,p):u(f);return{checkIn:r.default(c,t.DATE_FORMAT),checkOut:r.default(v,t.DATE_FORMAT)}}})),Dt=t((function(e,t){function r(e){void 0===e&&(e=[]);var t={},r={};e.forEach((function(e){var r=e[0],n=e[1],o=e[2],i=e[3];n&&(t[r]=X.calculateDiscount(n,o,i))}));var n=Math.min.apply(Math,Object.values(t)),o=Math.max.apply(Math,Object.values(t));return e.forEach((function(e){var i=e[0],a=e[1],u=(e[2],e[3]),s=a&&u&&u>0?o===n?1:(t[i]-n)/(o-n):void 0;void 0!==s&&(r[i]=Number(s.toFixed(2)))})),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getDealScores=t.calculateDealScores=void 0,t.calculateDealScores=r,t.getDealScores=function(e){var t=e.offset,n=e.anchorHotelId,o=e.hotelIds,i=e.hotelEntities,a=e.hotelOfferEntities;return r((void 0===n||t>0?o:St.__spreadArrays([n],o)).map((function(e){var t,r,n,o=i[e],u=a[e],s=null!==(t=null==o?void 0:o.regularPriceRange)&&void 0!==t?t:[],c=s[0],l=s[1];return[e,null===(n=null===(r=null==u?void 0:u.offers)||void 0===r?void 0:r[0])||void 0===n?void 0:n.nightlyRate,c,l]})))}})),Ct=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,i=e.length;o<i;)n[e[o]]=1,o+=1;for(var a in t)Object.prototype.hasOwnProperty.call(n,a)||(r[a]=t[a]);return r}}));function At(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=Ir[e],i=o?"function"==typeof o?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+i)}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 Nt(e){return!!e&&!!e[xr]}function Rt(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)===Er}(e)||Array.isArray(e)||!!e[Sr]||!!e.constructor[Sr]||Ht(e)||zt(e))}function Mt(e,t,r){void 0===r&&(r=!1),0===Ut(e)?(r?Object.keys:kr)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function Ut(e){var t=e[xr];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ht(e)?2:zt(e)?3:0}function Bt(e,t){return 2===Ut(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function qt(e,t){return 2===Ut(e)?e.get(t):e[t]}function Lt(e,t,r){var n=Ut(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function Ft(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ht(e){return _r&&e instanceof Map}function zt(e){return wr&&e instanceof Set}function Wt(e){return e.o||e.t}function Yt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=jr(e);delete t[xr];for(var r=kr(t),n=0;n<r.length;n++){var o=r[n],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Kt(e,t){return void 0===t&&(t=!1),Gt(e)||Nt(e)||!Rt(e)||(Ut(e)>1&&(e.set=e.add=e.clear=e.delete=Vt),Object.freeze(e),t&&Mt(e,(function(e,t){return Kt(t,!0)}),!0)),e}function Vt(){At(2)}function Gt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Qt(e){var t=Dr[e];return t||At(18,e),t}function Jt(e,t){Dr[e]||(Dr[e]=t)}function Xt(){return"production"===process.env.NODE_ENV||mr||At(0),mr}function $t(e,t){t&&(Qt("Patches"),e.u=[],e.s=[],e.v=t)}function Zt(e){er(e),e.p.forEach(rr),e.p=null}function er(e){e===mr&&(mr=e.l)}function tr(e){return mr={p:[],l:mr,h:e,m:!0,_:0}}function rr(e){var t=e[xr];0===t.i||1===t.i?t.j():t.O=!0}function nr(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||Qt("ES5").S(t,e,n),n?(r[xr].P&&(Zt(t),At(4)),Rt(e)&&(e=or(t,e),t.l||ar(t,e)),t.u&&Qt("Patches").M(r[xr],e,t.u,t.s)):e=or(t,r,[]),Zt(t),t.u&&t.v(t.u,t.s),e!==Tr?e:void 0}function or(e,t,r){if(Gt(t))return t;var n=t[xr];if(!n)return Mt(t,(function(o,i){return ir(e,n,t,o,i,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return ar(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=Yt(n.k):n.o;Mt(3===n.i?new Set(o):o,(function(t,i){return ir(e,n,o,t,i,r)})),ar(e,o,!1),r&&e.u&&Qt("Patches").R(n,r,e.u,e.s)}return n.o}function ir(e,t,r,n,o,i){if("production"!==process.env.NODE_ENV&&o===r&&At(5),Nt(o)){var a=or(e,o,i&&t&&3!==t.i&&!Bt(t.D,n)?i.concat(n):void 0);if(Lt(r,n,a),!Nt(a))return;e.m=!1}if(Rt(o)&&!Gt(o)){if(!e.h.F&&e._<1)return;or(e,o),t&&t.A.l||ar(e,o)}}function ar(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&Kt(t,r)}function ur(e,t){var r=e[xr];return(r?Wt(r):e)[t]}function sr(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 cr(e){e.P||(e.P=!0,e.l&&cr(e.l))}function lr(e){e.o||(e.o=Yt(e.t))}function fr(e,t,r){var n=Ht(t)?Qt("MapSet").N(t,r):zt(t)?Qt("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:Xt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,i=Cr;r&&(o=[n],i=Ar);var a=Proxy.revocable(o,i),u=a.revoke,s=a.proxy;return n.k=s,n.j=u,s}(t,r):Qt("ES5").J(t,r);return(r?r.A:Xt()).p.push(n),n}function dr(e){return Nt(e)||At(22,e),function e(t){if(!Rt(t))return t;var r,n=t[xr],o=Ut(t);if(n){if(!n.P&&(n.i<4||!Qt("ES5").K(n)))return n.t;n.I=!0,r=hr(t,o),n.I=!1}else r=hr(t,o);return Mt(r,(function(t,o){n&&qt(n.t,t)===o||Lt(r,t,e(o))})),3===o?new Set(r):r}(e)}function hr(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Yt(e)}function pr(){function e(e,t){var r=i[e];return r?r.enumerable=t:i[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[xr];return"production"!==process.env.NODE_ENV&&o(t),Cr.get(t,e)},set:function(t){var r=this[xr];"production"!==process.env.NODE_ENV&&o(r),Cr.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][xr];if(!o.P)switch(o.i){case 5:n(o)&&cr(o);break;case 4:r(o)&&cr(o)}}}function r(e){for(var t=e.t,r=e.k,n=kr(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==xr){var a=t[i];if(void 0===a&&!Bt(t,i))return!0;var u=r[i],s=u&&u[xr];if(s?s.t!==a:!Ft(u,a))return!0}}var c=!!t[xr];return n.length!==kr(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);return!(!r||r.get)}function o(e){e.O&&At(3,JSON.stringify(Wt(e)))}var i={};Jt("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 i=jr(r);delete i[xr];for(var a=kr(i),u=0;u<a.length;u++){var s=a[u];i[s]=e(s,t||!!i[s].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,t),i={i:n?5:4,A:r?r.A:Xt(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,xr,{value:i,writable:!0}),o},S:function(e,r,o){o?Nt(r)&&r[xr].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[xr];if(r){var o=r.t,i=r.k,a=r.D,u=r.i;if(4===u)Mt(i,(function(t){t!==xr&&(void 0!==o[t]||Bt(o,t)?a[t]||e(i[t]):(a[t]=!0,cr(r)))})),Mt(o,(function(e){void 0!==i[e]||Bt(i,e)||(a[e]=!1,cr(r))}));else if(5===u){if(n(r)&&(cr(r),a.length=!0),i.length<o.length)for(var s=i.length;s<o.length;s++)a[s]=!1;else for(var c=o.length;c<i.length;c++)a[c]=!0;for(var l=Math.min(i.length,o.length),f=0;f<l;f++)void 0===a[f]&&e(i[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}function gr(){function e(t){if(!Rt(t))return t;if(Array.isArray(t))return t.map(e);if(Ht(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(zt(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 Bt(t,Sr)&&(r[Sr]=t[Sr]),r}function t(t){return Nt(t)?e(t):t}var r="add";Jt("Patches",{$:function(t,n){return n.forEach((function(n){for(var o=n.path,i=n.op,a=t,u=0;u<o.length-1;u++){var s=Ut(a),c=""+o[u];0!==s&&1!==s||"__proto__"!==c&&"constructor"!==c||At(24),"function"==typeof a&&"prototype"===c&&At(24),"object"!=typeof(a=qt(a,c))&&At(15,o.join("/"))}var l=Ut(a),f=e(n.value),d=o[o.length-1];switch(i){case"replace":switch(l){case 2:return a.set(d,f);case 3:At(16);default:return a[d]=f}case r:switch(l){case 1:return a.splice(d,0,f);case 2:return a.set(d,f);case 3:return a.add(f);default:return a[d]=f}case"remove":switch(l){case 1:return a.splice(d,1);case 2:return a.delete(d);case 3:return a.delete(n.value);default:return delete a[d]}default:At(17,i)}})),t},R:function(e,n,o,i){switch(e.i){case 0:case 4:case 2:return function(e,n,o,i){var a=e.t,u=e.o;Mt(e.D,(function(e,s){var c=qt(a,e),l=qt(u,e),f=s?Bt(a,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}),i.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,i);case 5:case 1:return function(e,n,o,i){var a=e.t,u=e.D,s=e.o;if(s.length<a.length){var c=[s,a];a=c[0],s=c[1];var l=[i,o];o=l[0],i=l[1]}for(var f=0;f<a.length;f++)if(u[f]&&s[f]!==a[f]){var d=n.concat([f]);o.push({op:"replace",path:d,value:t(s[f])}),i.push({op:"replace",path:d,value:t(a[f])})}for(var h=a.length;h<s.length;h++){var p=n.concat([h]);o.push({op:r,path:p,value:t(s[h])})}a.length<s.length&&i.push({op:"replace",path:n.concat(["length"]),value:a.length})}(e,n,o,i);case 3:return function(e,t,n,o){var i=e.t,a=e.o,u=0;i.forEach((function(e){if(!a.has(e)){var i=t.concat([u]);n.push({op:"remove",path:i,value:e}),o.unshift({op:r,path:i,value:e})}u++})),u=0,a.forEach((function(e){if(!i.has(e)){var a=t.concat([u]);n.push({op:r,path:a,value:e}),o.unshift({op:"remove",path:a,value:e})}u++}))}(e,n,o,i)}},M:function(e,t,r,n){r.push({op:"replace",path:[],value:t===Tr?void 0:t}),n.push({op:"replace",path:[],value:e.t})}})}function vr(){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(Rt(t)){var r=fr(e.A.h,t,e);e.p.set(t,r),e.o.add(r)}else e.o.add(t)})))}function n(e){e.O&&At(3,JSON.stringify(Wt(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)},i=function(){function r(e,t){return this[xr]={i:2,l:t,A:t?t.A:Xt(),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 Wt(this[xr]).size}}),o.has=function(e){return Wt(this[xr]).has(e)},o.set=function(e,r){var o=this[xr];return n(o),Wt(o).has(e)&&Wt(o).get(e)===r||(t(o),cr(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[xr];return n(r),t(r),cr(r),r.D.set(e,!1),r.o.delete(e),!0},o.clear=function(){var e=this[xr];n(e),Wt(e).size&&(t(e),cr(e),e.D=new Map,Mt(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var r=this;Wt(this[xr]).forEach((function(n,o){e.call(t,r.get(o),o,r)}))},o.get=function(e){var r=this[xr];n(r);var o=Wt(r).get(e);if(r.I||!Rt(o))return o;if(o!==r.t.get(e))return o;var i=fr(r.A.h,o,r);return t(r),r.o.set(e,i),i},o.keys=function(){return Wt(this[xr]).keys()},o.values=function(){var e,t=this,r=this.keys();return(e={})[Pr]=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={})[Pr]=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[Pr]=function(){return this.entries()},r}(),a=function(){function t(e,t){return this[xr]={i:3,l:t,A:t?t.A:Xt(),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 Wt(this[xr]).size}}),o.has=function(e){var t=this[xr];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[xr];return n(t),this.has(e)||(r(t),cr(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[xr];return n(t),r(t),cr(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[xr];n(e),Wt(e).size&&(r(e),cr(e),e.o.clear())},o.values=function(){var e=this[xr];return n(e),r(e),e.o.values()},o.entries=function(){var e=this[xr];return n(e),r(e),e.o.entries()},o.keys=function(){return this.values()},o[Pr]=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}();Jt("MapSet",{N:function(e,t){return new i(e,t)},T:function(e,t){return new a(e,t)}})}var yr,mr,br="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),_r="undefined"!=typeof Map,wr="undefined"!=typeof Set,Or="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Tr=br?Symbol.for("immer-nothing"):((yr={})["immer-nothing"]=!0,yr),Sr=br?Symbol.for("immer-draftable"):"__$immer_draftable",xr=br?Symbol.for("immer-state"):"__$immer_state",Pr="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Ir={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"},Er=""+Object.prototype.constructor,kr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,jr=Object.getOwnPropertyDescriptors||function(e){var t={};return kr(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},Dr={},Cr={get:function(e,t){if(t===xr)return e;var r=Wt(e);if(!Bt(r,t))return function(e,t,r){var n,o=sr(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||!Rt(n)?n:n===ur(e.t,t)?(lr(e),e.o[t]=fr(e.A.h,n,e)):n},has:function(e,t){return t in Wt(e)},ownKeys:function(e){return Reflect.ownKeys(Wt(e))},set:function(e,t,r){var n=sr(Wt(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=ur(Wt(e),t),i=null==o?void 0:o[xr];if(i&&i.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(Ft(r,o)&&(void 0!==r||Bt(e.t,t)))return!0;lr(e),cr(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!==ur(e.t,t)||t in e.t?(e.D[t]=!1,lr(e),cr(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Wt(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(){At(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){At(12)}},Ar={};Mt(Cr,(function(e,t){Ar[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ar.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&At(13),Cr.deleteProperty.call(this,e[0],t)},Ar.set=function(e,t,r){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&At(14),Cr.set.call(this,e[0],t,r,e[0])};var Nr=function(){function e(e){var t=this;this.g=Or,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,a=Array(n>1?n-1:0),u=1;u<n;u++)a[u-1]=arguments[u];return i.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(a))}))}}var a;if("function"!=typeof r&&At(6),void 0!==n&&"function"!=typeof n&&At(7),Rt(e)){var u=tr(t),s=fr(t,e,void 0),c=!0;try{a=r(s),c=!1}finally{c?Zt(u):er(u)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return $t(u,n),nr(e,u)}),(function(e){throw Zt(u),e})):($t(u,n),nr(a,u))}if(!e||"object"!=typeof e){if((a=r(e))===Tr)return;return void 0===a&&(a=e),t.F&&Kt(a,!0),a}At(21,e)},this.produceWithPatches=function(e,r){return"function"==typeof e?function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(o))}))}:[t.produce(e,r,(function(e,t){n=e,o=t})),n,o];var 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){Rt(e)||At(8),Nt(e)&&(e=dr(e));var t=tr(this),r=fr(this,e,void 0);return r[xr].C=!0,er(t),r},t.finishDraft=function(e,t){var r=e&&e[xr];"production"!==process.env.NODE_ENV&&(r&&r.C||At(9),r.I&&At(10));var n=r.A;return $t(n,t),nr(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Or&&At(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}}var o=Qt("Patches").$;return Nt(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(r+1))}))},e}(),Rr=new Nr,Mr=Rr.produce,Ur=Rr.produceWithPatches.bind(Rr),Br=Rr.setAutoFreeze.bind(Rr),qr=Rr.setUseProxies.bind(Rr),Lr=Rr.applyPatches.bind(Rr),Fr=Rr.createDraft.bind(Rr),Hr=Rr.finishDraft.bind(Rr),zr=r(Object.freeze({__proto__:null,default:Mr,Immer:Nr,applyPatches:Lr,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:Fr,current:dr,enableAllPlugins:function(){pr(),vr(),gr()},enableES5:pr,enableMapSet:vr,enablePatches:gr,finishDraft:Hr,freeze:Kt,immerable:Sr,isDraft:Nt,isDraftable:Rt,nothing:Tr,original:function(e){return Nt(e)||At(23,e),e[xr].t},produce:Mr,produceWithPatches:Ur,setAutoFreeze:Br,setUseProxies:qr})),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=zr.produce(t,e)}}}})),Yr=t((function(e,t){e.exports=function e(t,r,o){function i(u,s){if(!r[u]){if(!t[u]){if(!s&&n)return n();if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=r[u]={exports:{}};t[u][0].call(c.exports,(function(e){return i(t[u][1][e]||e)}),c,c.exports,e,t,r,o)}return r[u].exports}for(var a=n,u=0;u<o.length;u++)i(o[u]);return i}({1:[function(e,t,r){(function(n,o,i,a,u,s,c,l,f){var d=e("crypto");function h(e,t){return function(e,t){var r;if(void 0===(r="passthrough"!==t.algorithm?d.createHash(t.algorithm):new b).write&&(r.write=r.update,r.end=r.update),m(t,r).dispatch(e),r.update||r.end(""),r.digest)return r.digest("buffer"===t.encoding?void 0:t.encoding);var n=r.read();return"buffer"!==t.encoding?n.toString(t.encoding):n}(e,t=v(e,t))}(r=t.exports=h).sha1=function(e){return h(e)},r.keys=function(e){return h(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(e){return h(e,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(e){return h(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=d.getHashes?d.getHashes().slice():["sha1","md5"];p.push("passthrough");var g=["buffer","hex","binary","base64"];function v(e,t){t=t||{};var r={};if(r.algorithm=t.algorithm||"sha1",r.encoding=t.encoding||"hex",r.excludeValues=!!t.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=!0===t.ignoreUnknown,r.respectType=!1!==t.respectType,r.respectFunctionNames=!1!==t.respectFunctionNames,r.respectFunctionProperties=!1!==t.respectFunctionProperties,r.unorderedArrays=!0===t.unorderedArrays,r.unorderedSets=!1!==t.unorderedSets,r.unorderedObjects=!1!==t.unorderedObjects,r.replacer=t.replacer||void 0,r.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var n=0;n<p.length;++n)p[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=p[n]);if(-1===p.indexOf(r.algorithm))throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(r.encoding)&&"passthrough"!==r.algorithm)throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+g.join(", "));return r}function y(e){if("function"==typeof e)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}function m(e,t,r){function n(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return r=r||[],{dispatch:function(t){return e.replacer&&(t=e.replacer(t)),this["_"+(null===t?"null":typeof t)](t)},_object:function(t){var o,a=Object.prototype.toString.call(t),u=/\[object (.*)\]/i.exec(a);if(u=(u=u?u[1]:"unknown:["+a+"]").toLowerCase(),0<=(o=r.indexOf(t)))return this.dispatch("[CIRCULAR:"+o+"]");if(r.push(t),void 0!==i&&i.isBuffer&&i.isBuffer(t))return n("buffer:"),n(t);if("object"===u||"function"===u||"asyncfunction"===u){var s=Object.keys(t);e.unorderedObjects&&(s=s.sort()),!1===e.respectType||y(t)||s.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(s=s.filter((function(t){return!e.excludeKeys(t)}))),n("object:"+s.length+":");var c=this;return s.forEach((function(r){c.dispatch(r),n(":"),e.excludeValues||c.dispatch(t[r]),n(",")}))}if(!this["_"+u]){if(e.ignoreUnknown)return n("["+u+"]");throw new Error('Unknown object type "'+u+'"')}this["_"+u](t)},_array:function(t,o){o=void 0!==o?o:!1!==e.unorderedArrays;var i=this;if(n("array:"+t.length+":"),!o||t.length<=1)return t.forEach((function(e){return i.dispatch(e)}));var a=[],u=t.map((function(t){var n=new b,o=r.slice();return m(e,n,o).dispatch(t),a=a.concat(o.slice(r.length)),n.read().toString()}));return r=r.concat(a),u.sort(),this._array(u,!1)},_date:function(e){return n("date:"+e.toJSON())},_symbol:function(e){return n("symbol:"+e.toString())},_error:function(e){return n("error:"+e.toString())},_boolean:function(e){return n("bool:"+e.toString())},_string:function(e){n("string:"+e.length+":"),n(e.toString())},_function:function(t){n("fn:"),y(t)?this.dispatch("[native]"):this.dispatch(t.toString()),!1!==e.respectFunctionNames&&this.dispatch("function-name:"+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return n("number:"+e.toString())},_xml:function(e){return n("xml:"+e.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(e){return n("regex:"+e.toString())},_uint8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return n("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return n("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return n("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return n("url:"+e.toString())},_map:function(t){n("map:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_set:function(t){n("set:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_file:function(e){return n("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return n("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return n("domwindow")},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function b(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}r.writeToStream=function(e,t,r){return void 0===r&&(r=t,t={}),m(t=v(e,t),r).dispatch(e)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_5812b7fb.js","/")},{buffer:3,crypto:5,lYpoI2:10}],2:[function(e,t,r){(function(e,t,n,o,i,a,u,s,c){!function(e){var t="undefined"!=typeof Uint8Array?Uint8Array:Array,r="+".charCodeAt(0),n="/".charCodeAt(0),o="0".charCodeAt(0),i="a".charCodeAt(0),a="A".charCodeAt(0),u="-".charCodeAt(0),s="_".charCodeAt(0);function c(e){var t=e.charCodeAt(0);return t===r||t===u?62:t===n||t===s?63:t<o?-1:t<o+10?t-o+26+26:t<a+26?t-a:t<i+26?t-i+26:void 0}e.toByteArray=function(e){var r,n;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.length,i="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0,a=new t(3*e.length/4-i),u=0<i?e.length-4:e.length,s=0;function l(e){a[s++]=e}for(r=0;r<u;r+=4,0)l((16711680&(n=c(e.charAt(r))<<18|c(e.charAt(r+1))<<12|c(e.charAt(r+2))<<6|c(e.charAt(r+3))))>>16),l((65280&n)>>8),l(255&n);return 2==i?l(255&(n=c(e.charAt(r))<<2|c(e.charAt(r+1))>>4)):1==i&&(l((n=c(e.charAt(r))<<10|c(e.charAt(r+1))<<4|c(e.charAt(r+2))>>2)>>8&255),l(255&n)),a},e.fromByteArray=function(e){var t,r,n,o,i=e.length%3,a="";function u(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,n=e.length-i;t<n;t+=3)a+=u((o=r=(e[t]<<16)+(e[t+1]<<8)+e[t+2])>>18&63)+u(o>>12&63)+u(o>>6&63)+u(63&o);switch(i){case 1:a+=u((r=e[e.length-1])>>2),a+=u(r<<4&63),a+="==";break;case 2:a+=u((r=(e[e.length-2]<<8)+e[e.length-1])>>10),a+=u(r>>4&63),a+=u(r<<2&63),a+="="}return a}}(void 0===r?this.base64js={}:r)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,r){(function(t,n,o,i,a,u,s,c,l){var f=e("base64-js"),d=e("ieee754");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var n,i,a,u,s,c=typeof e;if("base64"===t&&"string"==c)for(e=(n=e).trim?n.trim():n.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==c)i=j(e);else if("string"==c)i=o.byteLength(e,t);else{if("object"!=c)throw new Error("First argument needs to be a number, array or string.");i=j(e.length)}if(o._useTypedArrays?a=o._augment(new Uint8Array(i)):((a=this).length=i,a._isBuffer=!0),o._useTypedArrays&&"number"==typeof e.byteLength)a._set(e);else if(D(s=e)||o.isBuffer(s)||s&&"object"==typeof s&&"number"==typeof s.length)for(u=0;u<i;u++)o.isBuffer(e)?a[u]=e.readUInt8(u):a[u]=e[u];else if("string"==c)a.write(e,0,t);else if("number"==c&&!o._useTypedArrays&&!r)for(u=0;u<i;u++)a[u]=0;return a}function h(e,t,r,n){return o._charsWritten=R(function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function p(e,t,r,n){return o._charsWritten=R(function(e){for(var t,r,n,o=[],i=0;i<e.length;i++)r=(t=e.charCodeAt(i))>>8,n=t%256,o.push(n),o.push(r);return o}(t),e,r,n)}function g(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;o++)n+=String.fromCharCode(e[o]);return n}function v(e,t,r,n){n||(L("boolean"==typeof r,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+1<e.length,"Trying to read beyond buffer length"));var o,i=e.length;if(!(i<=t))return r?(o=e[t],t+1<i&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<i&&(o|=e[t+1])),o}function y(e,t,r,n){n||(L("boolean"==typeof r,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+3<e.length,"Trying to read beyond buffer length"));var o,i=e.length;if(!(i<=t))return r?(t+2<i&&(o=e[t+2]<<16),t+1<i&&(o|=e[t+1]<<8),o|=e[t],t+3<i&&(o+=e[t+3]<<24>>>0)):(t+1<i&&(o=e[t+1]<<16),t+2<i&&(o|=e[t+2]<<8),t+3<i&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}function m(e,t,r,n){if(n||(L("boolean"==typeof r,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=v(e,t,r,!0);return 32768&o?-1*(65535-o+1):o}}function b(e,t,r,n){if(n||(L("boolean"==typeof r,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=y(e,t,r,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function _(e,t,r,n){return n||(L("boolean"==typeof r,"missing or invalid endian"),L(t+3<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,23,4)}function w(e,t,r,n){return n||(L("boolean"==typeof r,"missing or invalid endian"),L(t+7<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,52,8)}function O(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+1<e.length,"trying to write beyond buffer length"),U(t,65535));var i=e.length;if(!(i<=r))for(var a=0,u=Math.min(i-r,2);a<u;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function T(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+3<e.length,"trying to write beyond buffer length"),U(t,4294967295));var i=e.length;if(!(i<=r))for(var a=0,u=Math.min(i-r,4);a<u;a++)e[r+a]=t>>>8*(n?a:3-a)&255}function S(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+1<e.length,"Trying to write beyond buffer length"),B(t,32767,-32768)),e.length<=r||O(e,0<=t?t:65535+t+1,r,n,o)}function x(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+3<e.length,"Trying to write beyond buffer length"),B(t,2147483647,-2147483648)),e.length<=r||T(e,0<=t?t:4294967295+t+1,r,n,o)}function P(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+3<e.length,"Trying to write beyond buffer length"),q(t,34028234663852886e22,-34028234663852886e22)),e.length<=r||d.write(e,t,r,n,23,4)}function I(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+7<e.length,"Trying to write beyond buffer length"),q(t,17976931348623157e292,-17976931348623157e292)),e.length<=r||d.write(e,t,r,n,52,8)}r.Buffer=o,r.SlowBuffer=o,r.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=A(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=N(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},o.concat=function(e,t){if(L(D(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new o(0);if(1===e.length)return e[0];if("number"!=typeof t)for(i=t=0;i<e.length;i++)t+=e[i].length;for(var r=new o(t),n=0,i=0;i<e.length;i++){var a=e[i];a.copy(r,n),n+=a.length}return r},o.prototype.write=function(e,t,r,n){var i;isFinite(t)?isFinite(r)||(n=r,r=void 0):(i=n,n=t,t=r,r=i),t=Number(t)||0;var a,u,s,c,l,f,d,g,v,y=this.length-t;switch((!r||y<(r=Number(r)))&&(r=y),n=String(n||"utf8").toLowerCase()){case"hex":a=function(e,t,r,n){r=Number(r)||0;var i=e.length-r;(!n||i<(n=Number(n)))&&(n=i);var a=t.length;L(a%2==0,"Invalid hex string"),a/2<n&&(n=a/2);for(var u=0;u<n;u++){var s=parseInt(t.substr(2*u,2),16);L(!isNaN(s),"Invalid hex string"),e[r+u]=s}return o._charsWritten=2*u,u}(this,e,t,r);break;case"utf8":case"utf-8":f=this,d=e,g=t,v=r,a=o._charsWritten=R(A(d),f,g,v);break;case"ascii":case"binary":a=h(this,e,t,r);break;case"base64":u=this,s=e,c=t,l=r,a=o._charsWritten=R(N(s),u,c,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":a=p(this,e,t,r);break;default:throw new Error("Unknown encoding")}return a},o.prototype.toString=function(e,t,r){var n,o,i,a,u=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(r=void 0!==r?Number(r):r=u.length)===t)return"";switch(e){case"hex":n=function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||n<r)&&(r=n);for(var o="",i=t;i<r;i++)o+=C(e[i]);return o}(u,t,r);break;case"utf8":case"utf-8":n=function(e,t,r){var n="",o="";r=Math.min(e.length,r);for(var i=t;i<r;i++)e[i]<=127?(n+=M(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return n+M(o)}(u,t,r);break;case"ascii":case"binary":n=g(u,t,r);break;case"base64":o=u,a=r,n=0===(i=t)&&a===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(i,a));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=function(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(u,t,r);break;default:throw new Error("Unknown encoding")}return n},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,r,n){if(r=r||0,n||0===n||(n=this.length),t=t||0,n!==r&&0!==e.length&&0!==this.length){L(r<=n,"sourceEnd < sourceStart"),L(0<=t&&t<e.length,"targetStart out of bounds"),L(0<=r&&r<this.length,"sourceStart out of bounds"),L(0<=n&&n<=this.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(i<100||!o._useTypedArrays)for(var a=0;a<i;a++)e[a+t]=this[a+r];else e._set(this.subarray(r,r+i),t)}},o.prototype.slice=function(e,t){var r=this.length;if(e=k(e,r,0),t=k(t,r,r),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var n=t-e,i=new o(n,void 0,!0),a=0;a<n;a++)i[a]=this[a+e];return i},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.readUInt8=function(e,t){if(t||(L(null!=e,"missing offset"),L(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return v(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return v(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(L(null!=e,"missing offset"),L(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return b(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return b(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return _(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return _(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return w(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return w(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,r){r||(L(null!=e,"missing value"),L(null!=t,"missing offset"),L(t<this.length,"trying to write beyond buffer length"),U(e,255)),t>=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,r){O(this,e,t,!0,r)},o.prototype.writeUInt16BE=function(e,t,r){O(this,e,t,!1,r)},o.prototype.writeUInt32LE=function(e,t,r){T(this,e,t,!0,r)},o.prototype.writeUInt32BE=function(e,t,r){T(this,e,t,!1,r)},o.prototype.writeInt8=function(e,t,r){r||(L(null!=e,"missing value"),L(null!=t,"missing offset"),L(t<this.length,"Trying to write beyond buffer length"),B(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},o.prototype.writeInt16LE=function(e,t,r){S(this,e,t,!0,r)},o.prototype.writeInt16BE=function(e,t,r){S(this,e,t,!1,r)},o.prototype.writeInt32LE=function(e,t,r){x(this,e,t,!0,r)},o.prototype.writeInt32BE=function(e,t,r){x(this,e,t,!1,r)},o.prototype.writeFloatLE=function(e,t,r){P(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){P(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){I(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){I(this,e,t,!1,r)},o.prototype.fill=function(e,t,r){if(e=e||0,t=t||0,r=r||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),L("number"==typeof e&&!isNaN(e),"value is not a number"),L(t<=r,"end < start"),r!==t&&0!==this.length){L(0<=t&&t<this.length,"start out of bounds"),L(0<=r&&r<=this.length,"end out of bounds");for(var n=t;n<r;n++)this[n]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,n=0;n<t;n++)if(e[n]=C(this[n]),n===r.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;t<r;t+=1)e[t]=this[t];return e.buffer};var E=o.prototype;function k(e,t,r){return"number"!=typeof e?r:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function j(e){return(e=~~Math.ceil(+e))<0?0:e}function D(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function C(e){return e<16?"0"+e.toString(16):e.toString(16)}function A(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=127)t.push(e.charCodeAt(r));else{var o=r;55296<=n&&n<=57343&&r++;for(var i=encodeURIComponent(e.slice(o,r+1)).substr(1).split("%"),a=0;a<i.length;a++)t.push(parseInt(i[a],16))}}return t}function N(e){return f.toByteArray(e)}function R(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function U(e,t){L("number"==typeof e,"cannot write a non-number as a number"),L(0<=e,"specified a negative value for writing an unsigned value"),L(e<=t,"value is larger than maximum value for type"),L(Math.floor(e)===e,"value has a fractional component")}function B(e,t,r){L("number"==typeof e,"cannot write a non-number as a number"),L(e<=t,"value larger than maximum allowed value"),L(r<=e,"value smaller than minimum allowed value"),L(Math.floor(e)===e,"value has a fractional component")}function q(e,t,r){L("number"==typeof e,"cannot write a non-number as a number"),L(e<=t,"value larger than maximum allowed value"),L(r<=e,"value smaller than minimum allowed value")}function L(e,t){if(!e)throw new Error(t||"Failed assertion")}o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=E.get,e.set=E.set,e.write=E.write,e.toString=E.toString,e.toLocaleString=E.toString,e.toJSON=E.toJSON,e.copy=E.copy,e.slice=E.slice,e.readUInt8=E.readUInt8,e.readUInt16LE=E.readUInt16LE,e.readUInt16BE=E.readUInt16BE,e.readUInt32LE=E.readUInt32LE,e.readUInt32BE=E.readUInt32BE,e.readInt8=E.readInt8,e.readInt16LE=E.readInt16LE,e.readInt16BE=E.readInt16BE,e.readInt32LE=E.readInt32LE,e.readInt32BE=E.readInt32BE,e.readFloatLE=E.readFloatLE,e.readFloatBE=E.readFloatBE,e.readDoubleLE=E.readDoubleLE,e.readDoubleBE=E.readDoubleBE,e.writeUInt8=E.writeUInt8,e.writeUInt16LE=E.writeUInt16LE,e.writeUInt16BE=E.writeUInt16BE,e.writeUInt32LE=E.writeUInt32LE,e.writeUInt32BE=E.writeUInt32BE,e.writeInt8=E.writeInt8,e.writeInt16LE=E.writeInt16LE,e.writeInt16BE=E.writeInt16BE,e.writeInt32LE=E.writeInt32LE,e.writeInt32BE=E.writeInt32BE,e.writeFloatLE=E.writeFloatLE,e.writeFloatBE=E.writeFloatBE,e.writeDoubleLE=E.writeDoubleLE,e.writeDoubleBE=E.writeDoubleBE,e.fill=E.fill,e.inspect=E.inspect,e.toArrayBuffer=E.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(e,t,r){(function(r,n,o,i,a,u,s,c,l){o=e("buffer").Buffer;var f=4,d=new o(f);d.fill(0),t.exports={hash:function(e,t,r,n){return o.isBuffer(e)||(e=new o(e)),function(e,t,r){for(var n=new o(t),i=r?n.writeInt32BE:n.writeInt32LE,a=0;a<e.length;a++)i.call(n,e[a],4*a,!0);return n}(t(function(e,t){var r;e.length%f!=0&&(r=e.length+(f-e.length%f),e=o.concat([e,d],r));for(var n=[],i=t?e.readInt32BE:e.readInt32LE,a=0;a<e.length;a+=f)n.push(i.call(e,a));return n}(e,n),8*e.length),r,n)}}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(e,t,r){(function(t,n,o,i,a,u,s,c,l){o=e("buffer").Buffer;var f=e("./sha"),d=e("./sha256"),h=e("./rng"),p={sha1:f,sha256:d,md5:e("./md5")},g=64,v=new o(g);function y(e,t){var r=p[e=e||"sha1"],n=[];return r||m("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),n.push(e),e.length,this},digest:function(e){var i=o.concat(n),a=t?function(e,t,r){o.isBuffer(t)||(t=new o(t)),o.isBuffer(r)||(r=new o(r)),t.length>g?t=e(t):t.length<g&&(t=o.concat([t,v],g));for(var n=new o(g),i=new o(g),a=0;a<g;a++)n[a]=54^t[a],i[a]=92^t[a];var u=e(o.concat([n,r]));return e(o.concat([i,u]))}(r,t,i):r(i);return n=null,e?a.toString(e):a}}}function m(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}v.fill(0),r.createHash=function(e){return y(e)},r.createHmac=y,r.randomBytes=function(e,t){if(!t||!t.call)return new o(h(e));try{t.call(this,void 0,new o(h(e)))}catch(e){t(e)}},function(e,t){for(var r in e)t(e[r],r)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],(function(e){r[e]=function(){m("sorry,",e,"is not implemented yet")}}))}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:10}],6:[function(e,t,r){(function(r,n,o,i,a,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,n=-271733879,o=-1732584194,i=271733878,a=0;a<e.length;a+=16){var u=r,s=n,c=o,l=i;r=p(r,n,o,i,e[a+0],7,-680876936),i=p(i,r,n,o,e[a+1],12,-389564586),o=p(o,i,r,n,e[a+2],17,606105819),n=p(n,o,i,r,e[a+3],22,-1044525330),r=p(r,n,o,i,e[a+4],7,-176418897),i=p(i,r,n,o,e[a+5],12,1200080426),o=p(o,i,r,n,e[a+6],17,-1473231341),n=p(n,o,i,r,e[a+7],22,-45705983),r=p(r,n,o,i,e[a+8],7,1770035416),i=p(i,r,n,o,e[a+9],12,-1958414417),o=p(o,i,r,n,e[a+10],17,-42063),n=p(n,o,i,r,e[a+11],22,-1990404162),r=p(r,n,o,i,e[a+12],7,1804603682),i=p(i,r,n,o,e[a+13],12,-40341101),o=p(o,i,r,n,e[a+14],17,-1502002290),r=g(r,n=p(n,o,i,r,e[a+15],22,1236535329),o,i,e[a+1],5,-165796510),i=g(i,r,n,o,e[a+6],9,-1069501632),o=g(o,i,r,n,e[a+11],14,643717713),n=g(n,o,i,r,e[a+0],20,-373897302),r=g(r,n,o,i,e[a+5],5,-701558691),i=g(i,r,n,o,e[a+10],9,38016083),o=g(o,i,r,n,e[a+15],14,-660478335),n=g(n,o,i,r,e[a+4],20,-405537848),r=g(r,n,o,i,e[a+9],5,568446438),i=g(i,r,n,o,e[a+14],9,-1019803690),o=g(o,i,r,n,e[a+3],14,-187363961),n=g(n,o,i,r,e[a+8],20,1163531501),r=g(r,n,o,i,e[a+13],5,-1444681467),i=g(i,r,n,o,e[a+2],9,-51403784),o=g(o,i,r,n,e[a+7],14,1735328473),r=v(r,n=g(n,o,i,r,e[a+12],20,-1926607734),o,i,e[a+5],4,-378558),i=v(i,r,n,o,e[a+8],11,-2022574463),o=v(o,i,r,n,e[a+11],16,1839030562),n=v(n,o,i,r,e[a+14],23,-35309556),r=v(r,n,o,i,e[a+1],4,-1530992060),i=v(i,r,n,o,e[a+4],11,1272893353),o=v(o,i,r,n,e[a+7],16,-155497632),n=v(n,o,i,r,e[a+10],23,-1094730640),r=v(r,n,o,i,e[a+13],4,681279174),i=v(i,r,n,o,e[a+0],11,-358537222),o=v(o,i,r,n,e[a+3],16,-722521979),n=v(n,o,i,r,e[a+6],23,76029189),r=v(r,n,o,i,e[a+9],4,-640364487),i=v(i,r,n,o,e[a+12],11,-421815835),o=v(o,i,r,n,e[a+15],16,530742520),r=y(r,n=v(n,o,i,r,e[a+2],23,-995338651),o,i,e[a+0],6,-198630844),i=y(i,r,n,o,e[a+7],10,1126891415),o=y(o,i,r,n,e[a+14],15,-1416354905),n=y(n,o,i,r,e[a+5],21,-57434055),r=y(r,n,o,i,e[a+12],6,1700485571),i=y(i,r,n,o,e[a+3],10,-1894986606),o=y(o,i,r,n,e[a+10],15,-1051523),n=y(n,o,i,r,e[a+1],21,-2054922799),r=y(r,n,o,i,e[a+8],6,1873313359),i=y(i,r,n,o,e[a+15],10,-30611744),o=y(o,i,r,n,e[a+6],15,-1560198380),n=y(n,o,i,r,e[a+13],21,1309151649),r=y(r,n,o,i,e[a+4],6,-145523070),i=y(i,r,n,o,e[a+11],10,-1120210379),o=y(o,i,r,n,e[a+2],15,718787259),n=y(n,o,i,r,e[a+9],21,-343485551),r=m(r,u),n=m(n,s),o=m(o,c),i=m(i,l)}return Array(r,n,o,i)}function h(e,t,r,n,o,i){return m((a=m(m(t,e),m(n,i)))<<(u=o)|a>>>32-u,r);var a,u}function p(e,t,r,n,o,i,a){return h(t&r|~t&n,e,t,o,i,a)}function g(e,t,r,n,o,i,a){return h(t&n|r&~n,e,t,o,i,a)}function v(e,t,r,n,o,i,a){return h(t^r^n,e,t,o,i,a)}function y(e,t,r,n,o,i,a){return h(r^(t|~n),e,t,o,i,a)}function m(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return f.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,t,r){(function(e,r,n,o,i,a,u,s,c){var l;l=function(e){for(var t,r=new Array(e),n=0;n<e;n++)0==(3&n)&&(t=4294967296*Math.random()),r[n]=t>>>((3&n)<<3)&255;return r},t.exports=l}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(e,t,r){(function(r,n,o,i,a,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,o,i,a,u=Array(80),s=1732584193,c=-271733879,l=-1732584194,f=271733878,d=-1009589776,g=0;g<e.length;g+=16){for(var v=s,y=c,m=l,b=f,_=d,w=0;w<80;w++){u[w]=w<16?e[g+w]:p(u[w-3]^u[w-8]^u[w-14]^u[w-16],1);var O=h(h(p(s,5),(o=c,i=l,a=f,(n=w)<20?o&i|~o&a:!(n<40)&&n<60?o&i|o&a|i&a:o^i^a)),h(h(d,u[w]),(r=w)<20?1518500249:r<40?1859775393:r<60?-1894007588:-899497514));d=f,f=l,l=p(c,30),c=s,s=O}s=h(s,v),c=h(c,y),l=h(l,m),f=h(f,b),d=h(d,_)}return Array(s,c,l,f,d)}function h(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function p(e,t){return e<<t|e>>>32-t}t.exports=function(e){return f.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(e,t,r){(function(r,n,o,i,a,u,s,c,l){function f(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function d(e,t){return e>>>t|e<<32-t}function h(e,t){var r,n,o,i,a,u,s,c,l,h,p=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),g=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),v=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var y,m,b,_,w,O,T,S,x=0;x<e.length;x+=16){r=g[0],n=g[1],o=g[2],i=g[3],a=g[4],u=g[5],s=g[6],c=g[7];for(var P=0;P<64;P++)v[P]=P<16?e[P+x]:f(f(f(d(S=v[P-2],17)^d(S,19)^S>>>10,v[P-7]),d(T=v[P-15],7)^d(T,18)^T>>>3),v[P-16]),l=f(f(f(f(c,d(O=a,6)^d(O,11)^d(O,25)),(w=a)&u^~w&s),p[P]),v[P]),h=f(d(_=r,2)^d(_,13)^d(_,22),(y=r)&(m=n)^y&(b=o)^m&b),c=s,s=u,u=a,a=f(i,l),i=o,o=n,n=r,r=f(l,h);g[0]=f(r,g[0]),g[1]=f(n,g[1]),g[2]=f(o,g[2]),g[3]=f(i,g[3]),g[4]=f(a,g[4]),g[5]=f(u,g[5]),g[6]=f(s,g[6]),g[7]=f(c,g[7])}return g}var p=e("./helpers");t.exports=function(e){return p.hash(e,h,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,t,r){(function(e,r,n,o,i,a,u,s,c){function l(){}(e=t.exports={}).nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",(function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<r.length&&r.shift()())}),!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=l,e.addListener=l,e.once=l,e.off=l,e.removeListener=l,e.removeAllListeners=l,e.emit=l,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:10}],11:[function(e,t,r){(function(e,t,n,o,i,a,u,s,c){r.read=function(e,t,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=u;0<l;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;0<l;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},r.write=function(e,t,r,n,o,i){var a,u,s,c=8*i-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),2<=(t+=1<=a+f?d/s:d*Math.pow(2,1-f))*s&&(a++,s/=2),l<=a+f?(u=0,a=l):1<=a+f?(u=(t*s-1)*Math.pow(2,o),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));8<=o;e[r+h]=255&u,h+=p,u/=256,o-=8);for(a=a<<o|u,c+=o;0<c;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*g}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/ieee754/index.js","/node_modules/ieee754")},{buffer:3,lYpoI2:10}]},{},[1])(1)})),Kr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0;var r=St.__importDefault(Yr);t.generateSearchId=function(e,t){var n=t.anonymousId,o=t.language,i=t.currency,a=t.userCountry;return r.default(St.__assign(St.__assign({},e),{anonymousId:n,language:o,currency:i,userCountry:a}))}})),Vr=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,i=(e.pricing.medianRateBkt+1)*r*t;return St.__assign(St.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(i)]})}})),Gr=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],i=r[1];return St.__assign(St.__assign({},t),((n={})[o]=i===new Object(i)?e(i):i,n))}),{})}})),Qr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),St.__exportStar(J,t),St.__exportStar(X,t),St.__exportStar(jt,t),St.__exportStar(Dt,t),St.__exportStar(Ct,t),St.__exportStar(Wr,t),St.__exportStar(Kr,t),St.__exportStar(Vr,t),St.__exportStar(Gr,t)})),Jr=t((function(e,t){function r(e,t,r,n){return!(void 0!==r&&e.nightlyRate<r)&&!(void 0!==n&&n<t&&e.nightlyRate>n)}function n(e,t){var n,o=e.filters,i=void 0===o?{}:o,a=e.priceBucketWidth,u=e.priceBucketsCount,s=e.exchangeRate;if(void 0===a)return t;var c=i.priceMin,l=i.priceMax,f=u*Math.round(a*s);if((void 0!==c||void 0!==l)&&!(null===(n=t.offers)||void 0===n?void 0:n.some((function(e){return r(e,f,c,l)}))))return St.__assign(St.__assign({},t),{offers:[]});return t}function o(e,t){var r=t.sortField,n=t.sortOrder;return"price"===r?function(e,t){return e.sort((function(e,r){var n,o,i=(null!==(n=Qr.getCheapestRate(e))&&void 0!==n?n:0)-(null!==(o=Qr.getCheapestRate(r))&&void 0!==o?o:0);return"ascending"===t?i:-i}))}(e,void 0===n?"ascending":n):e}function i(e){var t=e.topOfferData,r=e.anchorPriceRateBreakdown,n=r.calculatedTotalRate,o=r.nightlyRate;return St.__assign(St.__assign({},t),{anchorPrice:n,anchorPriceNightly:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.augmentRaaResponse=t.augmentHotelOffersWithAnchorPrice=t.augmentOffersWithAnchorPrice=t.augmentTopOfferDataWithAnchorPrice=t.applyPriceFilter=t.isOfferInPriceRange=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},t.isOfferInPriceRange=r,t.applyPriceFilter=n,t.augmentTopOfferDataWithAnchorPrice=i;function a(e,t){var r=e.offers;if(!(null==r?void 0:r.length))return r;var n=t.anchorPrice;return void 0===n?r:r.map((function(e){return St.__assign(St.__assign({},e),{hasAnchorPrice:n-e.calculatedTotalRate>.03*n})}))}function u(e){var t=e.anchorPriceRateBreakdown,r=e.topOfferData;if(void 0===t||void 0===r)return e;var n=i(e),o=a(e,n);return St.__assign(St.__assign({},e),{topOfferData:n,offers:o})}t.augmentOffersWithAnchorPrice=a,t.augmentHotelOffersWithAnchorPrice=u,t.augmentRaaResponse=function(e,t){var r,i=e.hotels,a=e.anchorHotel;void 0!==i&&(r=i.map((function(e){return n(t,e)})),void 0!==t.sortField&&(r=o(r,t)));var s=[],c={};return null==r||r.forEach((function(e){s.push(e.id),c[e.id]=u(e)})),void 0!==a&&(c[a.id]=u(a)),{hotelIds:s,anchorHotelId:null==a?void 0:a.id,hotelOfferEntities:c}}})),Xr=r(S),$r=r(Q),Zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.raa=void 0;var r,n=St.__importDefault(Xr);!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.raa=function(e,t){if(void 0===e)throw new TypeError("RAA endpoint must be provided");if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,i=new n.default(e,[],{maxRetries:20,WebSocket:t.WebSocket}),a={};function u(){void 0!==a.current&&i.reconnect()}function s(){void 0!==a.current&&i.reconnect()}function c(){var e=a.current;void 0!==e&&i.send(e)}function l(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}void 0!==o&&o(t)}return i.addEventListener("open",c),i.addEventListener("close",u),i.addEventListener("error",s),i.addEventListener("message",l),{getOffers:function(e,n){return St.__awaiter(this,void 0,void 0,(function(){var u;return St.__generator(this,(function(s){return u={},a.current=function(e,t){var r,n,o,i={checkIn:e.checkIn,checkOut:e.checkOut,destination:null!==(r=e.destination)&&void 0!==r?r:"",getAllOffers:e.getAllOffers,highlightedHotelID:e.anchorDestination,rooms:e.rooms,cugDeals:e.cugDeals,profileId:e.profileId,searchId:e.searchId,useAlternativeRaaKeys:e.useAlternativeRaaKeys,preferredRate:e.preferredRate,trafficSource:e.trafficSource,deviceCategory:t.deviceCategory,languageCode:t.language,userCountryCode:t.userCountry,currencyCode:t.currency,anonymousId:t.anonymousId,includeLocalTaxes:t.includeLocalTaxes,includeTaxes:t.includeTaxes,skipBackendAugmentation:t.skipBackendAugmentation,facetsEnabled:t.facetsEnabled,sapiCliKey:t.sapiCliKey,sortingBoost:Jr.generateSortingBoost(e),clientRequestId:$r.v4()};(null===(n=t.variations)||void 0===n?void 0:n.includes("c6j5l9m6-room-limit-b"))&&(i.roomLimit=1,i.anchorRoomLimit=2);try{o=JSON.stringify(i)}catch(e){console.log("WEBSOCKET: error parsing query")}return o}(e,t),[2,new Promise((function(t){o=function(r){var o;if(void 0!==r)if(r.status.complete)t(u),a.current=void 0;else{var i=r.results.find((function(t){return t.id===e.anchorDestination}));i?u.anchorHotel=Qr.omit(["errors"],i):u.hotels=null===(o=r.results)||void 0===o?void 0:o.map((function(e){return Qr.omit(["errors"],e)})),"function"==typeof n&&n(St.__assign({},u))}},i.readyState===r.Open&&void 0!==a.current&&i.send(a.current)}))]}))}))}}}})),en=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),St.__exportStar(Zr,t),St.__exportStar(Jr,t)}));function tn(e){$(1,arguments);var t=Z(e);return t.setHours(0,0,0,0),t}var rn=864e5;function nn(e,t){$(2,arguments);var r=tn(e),n=tn(t),o=r.getTime()-Ye(r),i=n.getTime()-Ye(n);return Math.round((o-i)/rn)}function on(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 an=r(Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=Z(e),n=Z(t),o=on(r,n),i=Math.abs(nn(r,n));r.setDate(r.getDate()-o*i);var a=on(r,n)===-o,u=o*(i-a);return 0===u?0:u}})),un=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.pickIndexVariation=t.hitToPlaceSuggest=t.hitToHotelSuggest=t.hitToPlaceTypeAnchor=t.hitToHotelTypeAnchor=t.hitToHotel=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=t.getTagsFilter=t.getCheckInNights=void 0;var r=St.__importDefault(an),n=St.__importDefault(xt);function o(e,t){var o=Qr.dateToMiddayUTC(e),i=Qr.dateToMiddayUTC(t);return n.default(o,"yyMMdd")+"-"+r.default(i,o)}function i(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function a(e,t){for(var r=0,n=t;r<n.length;r++){var o=n[r];if(i(null==e?void 0:e[o]))return e[o]}return""}function u(e,t,r){void 0===r&&(r=", ");var n={};return t.forEach((function(o){var a=e[o]||[];n[o]=a.map((function(r,n){if(i(r))return r;var o=t.find((function(t){var r;return i(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[n])}));return o?e[o][n]:""})).join(""+r)})),a(n,t)}function s(e,t,r){var n={};return t.forEach((function(o){var a=e[o]||[],u=-1===r?void 0:r+1,s=a.slice(r,u).toString();if(i(s))n[o]=s;else{var c=t.find((function(t){var n;return i(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[r])}));n[o]=c?e[c][r]:""}})),a(n,t)}function c(e,t){var r={};return t.forEach((function(n){var o,a=null===(o=e[n])||void 0===o?void 0:o.value;if(i(a))r[n]=a;else{var u=t.find((function(t){var r;return i(null===(r=e[t])||void 0===r?void 0:r.value)}));r[n]=u?e[u].value:""}})),a(r,t)}function l(e,t,r){var n,o=e[t];if(!o){var i=r.indexOf(t),a=null!==(n=r.slice(i).find((function(t){return e[t]})))&&void 0!==n?n:"en";o=e[a]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function f(e,t,r){for(var n={},o=0,i=r;o<i.length;o++){var a=i[o];n[a]=St.__spreadArrays(l(e,a,r),l(t,a,r))}return u(n,r)}function d(e,t,r){if(void 0===e)return t;try{for(var n in t)if(void 0===e[n])throw new TypeError("Hotel "+e.objectID+" is missing "+n+" field")}catch(e){r||console.error(e)}return St.__assign(St.__assign({},t),e)}function h(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"}}t.getCheckInNights=o,t.getTagsFilter=function(e,t){return["tags:-u"+o(e,t)]},t.isNotEmptyOrWhiteSpace=i,t.getTranslatedAttributes=function(e,t){var r=[];return e.forEach((function(e){var n=t.map((function(t){return t+"."+e}));r.push.apply(r,n)})),r},t.toString=a,t.translatedArrayToString=u,t.getStringFromTranslatedArray=s,t.getValueFromTranslatedHightlightResult=c,t.attributeWithFallback=l,t.mergeTranslatedAttributes=f,t.validateHit=d,t.placeTypeToPlaceTypeName=h,t.hitToHotel=function(e,t){var r=d(e,{address:{},placeADName:{},placeDN:{},hotelName:{}}),n=St.__assign(St.__assign({},r),{displayAddress:f(r.address,r.placeADName,t),placeDisplayName:u(r.placeDN,t),hotelName:a(r.hotelName,t)});return Qr.omit(["address","placeDN","placeADName"],n)},t.hitToHotelTypeAnchor=function(e,t){var r=d(e,{hotelName:{},placeDN:{}}),n=St.__assign(St.__assign({},r),{hotelName:a(r.hotelName,t),placeDisplayName:u(r.placeDN,t)});return Qr.omit(["placeADN","placeDN"],n)},t.hitToPlaceTypeAnchor=function(e,t){var r=d(e,{placeName:{},placeDN:{}}),n=St.__assign(St.__assign({},r),{placeName:a(r.placeName,t),placeDisplayName:u(r.placeDN,t)});return Qr.omit(["placeADN","placeDN"],n)},t.hitToHotelSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=i(o)?o+", "+n:n,l=c(r._highlightResult.hotelName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:a(r.hotelName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h()}},t.hitToPlaceSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=i(o)?o+", "+n:n,l=c(r._highlightResult.placeName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:a(r.placeName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h(r.placeType)}},t.pickIndexVariation=function(e,t){var r=e.find((function(e){return e.variationID&&t.includes(e.variationID)}));return null!=r?r:e.find((function(e){return void 0===e.variationID}))}})),sn=t((function(e,t){var r;function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return St.__spreadArrays(["objectType","placeType","placeCategory","objectID","_geoloc","priceBucketWidth","polygon","pageSize"],t)}function o(e){var t=un.getTranslatedAttributes(e,["hotelName","placeADName","placeDN","address"]);return St.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.getAnchor=void 0,function(e){e[e.Hotel=0]="Hotel",e[e.Place=1]="Place",e[e.Location=2]="Location",e[e.Query=3]="Query",e[e.Unknown=4]="Unknown"}(r||(r={})),t.getAnchor=function(e,t,i){var a=this,u=e.search,s=i.languages;return function(e){return St.__awaiter(a,void 0,void 0,(function(){var i,a,c,l,f,d,h,p,g,v,y,m,b;return St.__generator(this,(function(_){switch(_.label){case 0:switch(i=function(e){return e.hotelId?r.Hotel:e.placeId?r.Place:e.geolocation?r.Location:e.query?r.Query:r.Unknown}(e),a=e.hotelId,c=e.placeId,l=e.query,f=[],i){case r.Query:f.push({indexName:t.autocompleteIndex,params:{query:l,hitsPerPage:1,attributesToRetrieve:n(s),attributesToHighlight:[]}}),f.push({indexName:t.hotelIndex,params:{query:l,hitsPerPage:1,attributesToRetrieve:o(s),attributesToHighlight:[]}});break;case r.Hotel:a&&f.push({indexName:t.autocompleteIndex,params:{facetFilters:[["objectID:hotel:"+a]],attributesToRetrieve:n(s),attributesToHighlight:[]}},{indexName:t.hotelIndex,params:{facetFilters:[["objectID:"+a]],attributesToRetrieve:o(s),attributesToHighlight:[]}});break;case r.Place:default:c&&f.push({indexName:t.autocompleteIndex,params:{facetFilters:[["objectID:place:"+c]],attributesToRetrieve:n(s),attributesToHighlight:[]}})}return[4,u(f)];case 1:switch(p=_.sent().results,g=null===(y=p[0])||void 0===y?void 0:y.hits[0],v=null===(m=p[1])||void 0===m?void 0:m.hits[0],null==g?void 0:g.objectType){case"hotel":d=un.hitToHotelTypeAnchor(g,s),h=un.hitToHotel(v,s);break;case"place":default:d=un.hitToPlaceTypeAnchor(g,s)}return[2,{anchor:d,anchorHotel:h,anchorType:null!==(b=null==g?void 0:g.objectType)&&void 0!==b?b:"place"}]}}))}))}}}));var cn=r(Object.freeze({__proto__:null,default:function(e){$(1,arguments);var t=Z(e),r=t.getDay();return 0===r||6===r}})),ln=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generatePriceFilter=t.generateSortByPriceFilter=void 0;var r=St.__importDefault(an),n=St.__importDefault(cn);t.generateSortByPriceFilter=function(e){for(var t=[],r=e;r>0;--r){var n=100*(e+1-r);t.push("pricing.minRateBkt:"+r+"<score="+n+">")}return t},t.generatePriceFilter=function(e){var t=e.priceMin,o=e.priceMax,i=e.priceBucketWidth,a=e.priceBucketsCount,u=e.checkIn,s=e.checkOut,c=e.margin,l=void 0===c?2:c,f=[];if(void 0===t&&void 0===o||void 0===i)return f;var d=t?Math.floor(t/i)-l:0,h=o?Math.ceil(o/i)+l:a;d<0&&(d=0),h>a&&(h=a);var p=d,g=function(e,t){if(!e||!t)return"pricing.medianRateBkt";var o=Qr.dateToMiddayUTC(e),i=Qr.dateToMiddayUTC(t);return 1===r.default(i,o)?n.default(o)?"pricing.medianRateSaSuBkt":"pricing.medianRateMoFrBkt":"pricing.medianRateBkt"}(u,s);do{f.push(g+":"+p+"<score=10000>"),p++}while(p<=h);return f}})),fn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getBackendConfig=t.getSafConfig=t.profiles=t.PRICE_BUCKET_COUNT=void 0,t.PRICE_BUCKET_COUNT=31;var r={features:[],blockedDefaultDates:["2022-02-27"],daysFromNow:45,fallbackLanguages:{"pt-BR":["pt"],"zh-CN":["zh"],"zh-HK":["zh"],"zh-TW":["zh"],iw:["he"],nb:["no"],nn:["no"]},hotelIndex:"prod_hotel_v3",autocompleteIndex:"prod_autocomplete_v2_os000007",lovIndex:"prod_lov_v2",currencyIndex:"prod_curr_v1",hsoIndex:[{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000003_tags"},{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000004_tags2",variationID:"pp000004-tags2-b"}],raa:{endpoint:"wss://d2jxsjsbxzs3ta.cloudfront.net"},algolia:{apiKey:"efa703d5c0057a24487bc9bdcb597770"}};t.profiles={"findhotel-website":St.__assign(St.__assign({},r),{features:["offers","search","suggests","configs"]}),"findhotel-checkout":St.__assign(St.__assign({},r),{features:["rooms"]}),"findhotel-website-e2e":St.__assign(St.__assign({},r),{features:["offers","search","suggests","configs"],raa:St.__assign(St.__assign({},r.raa),{endpoint:void 0})}),"findhotel-checkout-e2e":St.__assign(St.__assign({},r),{features:["rooms"]})};var n={baseUrl:"https://sapi.findhotel.services",baseCloudFrontUrl:"https://d6smt535eb7vn.cloudfront.net",endpoints:{offersRooms:"1/offers-rooms",search:"1/search"}},o={"findhotel-website":n,"findhotel-checkout":n,"findhotel-website-e2e":St.__assign(St.__assign({},n),{baseUrl:"https://sapi-e2e.findhotel.services"}),"findhotel-checkout-e2e":St.__assign(St.__assign({},n),{baseUrl:"https://sapi-e2e.findhotel.services"})};t.getSafConfig=function(e){var t=o[e];if(void 0===t)throw new Error("Profile key is not valid");return t};var i={baseUrl:"https://dikcjxfwieazv.cloudfront.net",endpoints:{search:"search"}},a={"findhotel-website":i,"findhotel-checkout":i,"findhotel-website-e2e":i,"findhotel-checkout-e2e":i};t.getBackendConfig=function(e){var t=a[e];if(void 0===t)throw new Error("Profile key is not valid");return t}})),dn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.geoSearch=void 0;function r(e){var t=e.anchorHotelId,r=e.checkIn,n=e.checkOut,o=e.filters,i=void 0===o?{}:o,a=i.facilities,u=i.starRating,s=i.propertyTypeId,c=i.themeIds,l=[];if(null==s?void 0:s.length){var f=s.map((function(e){return"propertyTypeId:"+e}));l.push(f)}if(null==a?void 0:a.length){var d=a.map((function(e){return"facilities:"+e}));l.push.apply(l,d)}if(null==c?void 0:c.length){var h=c.map((function(e){return"themeIds:"+e}));l.push.apply(l,h)}if(null==u?void 0:u.length){var p=[];u.forEach((function(e){p.push("starRating:"+Number(e)),p.push("starRating:"+(Number(e)+.5))})),l.push(p)}return t&&l.push("objectID:-"+t),r&&n&&l.push(un.getTagsFilter(r,n)),l}function n(e){var t=e.guestRating;return(null==t?void 0:t.length)?["guestRating.overall>="+t[0]]:[]}function o(e){var t="isDeleted = 0";return e.noHostels&&(t+=" AND propertyTypeId != 5"),t}function i(e,t){var r=e.filters,n=void 0===r?{}:r,o=e.checkIn,i=e.checkOut,a=e.sortField,u=n.priceMin,s=n.priceMax,c=t.hsoFilter,l=t.priceBucketWidth,f=t.exchangeRate,d=St.__spreadArrays(c);if("price"===a){var h=ln.generateSortByPriceFilter(fn.PRICE_BUCKET_COUNT);d=St.__spreadArrays(d,h)}if(u||s){var p=ln.generatePriceFilter({priceMin:u,priceMax:s,checkIn:o,checkOut:i,priceBucketsCount:fn.PRICE_BUCKET_COUNT,priceBucketWidth:l&&l*f});d=St.__spreadArrays(d,p)}return d}var a=["facilities","propertyTypeId","starRating","themeIds","pricing.medianRateBkt","pricing.medianRateMoFrBkt","pricing.medianRateSaSuBkt","pricing.minRateBkt","tags"];t.geoSearch=function(e,t,u){var s=this,c=e.search;return function(e){return St.__awaiter(s,void 0,void 0,(function(){var s,l,f,d,h,p,g,v,y,m,b,_,w,O,T,S,x,P,I,E,k,j,D;return St.__generator(this,(function(C){switch(C.label){case 0:return s=e.boundingBox,l=e.polygon,f=e.geolocation,d=e.length,h=void 0===d?u.requestSize:d,p=e.offset,g=void 0===p?0:p,v=e.filters,m={length:h,offset:g,facets:a,attributesToHighlight:[],getRankingInfo:!1,filters:o(y=void 0===v?{}:v),numericFilters:n(y),facetFilters:r(e),attributesToRetrieve:(A=u.languages,N=un.getTranslatedAttributes(A,["hotelName","placeADName","placeDN","address"]),St.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],N)),optionalFilters:i(e,u)},void 0!==y.hotelName&&(m.query=y.hotelName),s?m.insideBoundingBox=[s]:l?m.insidePolygon=l:f&&(m.aroundLatLng=f.lat+", "+f.lon,m.aroundRadius=null!==(P=f.radius)&&void 0!==P?P:2e4,m.aroundPrecision=null!==(I=f.precision)&&void 0!==I?I:5e3),[4,c([{indexName:t.hotelIndex,params:m}])];case 1:for(b=C.sent(),_=b.results[0],w=[],O={},T=0,S=_.hits;T<S.length;T++)x=S[T],O[x.objectID]=un.hitToHotel(x,u.languages),w.push(x.objectID);return[2,{hotelIds:w,hotelEntities:O,resultsCount:null!==(E=_.length)&&void 0!==E?E:0,resultsCountTotal:null!==(k=_.nbHits)&&void 0!==k?k:0,offset:null!==(j=_.offset)&&void 0!==j?j:0,facets:null!==(D=_.facets)&&void 0!==D?D:{}}]}var A,N}))}))}}})),hn=t((function(e,t){function r(e){return un.getTranslatedAttributes(e,["placeName","hotelName"])}function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return St.__spreadArrays(["objectType","objectID","placeType"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.loadSuggests=void 0,t.loadSuggests=function(e,t,o){var i=this,a=e.search,u=o.languages,s=o.suggestsCount,c=void 0===s?6:s;return function(e){return St.__awaiter(i,void 0,void 0,(function(){var o,i,s;return St.__generator(this,(function(l){switch(l.label){case 0:return o=[{indexName:t.autocompleteIndex,params:{query:e,filters:"isDeleted != 1",hitsPerPage:c,attributesToRetrieve:n(u),attributesToHighlight:r(u)}}],[4,a(o)];case 1:return i=l.sent().results,[2,null===(s=i[0])||void 0===s?void 0:s.hits.map((function(e){switch(e.objectType){case"hotel":return un.hitToHotelSuggest(e,u);case"place":default:return un.hitToPlaceSuggest(e,u)}}))]}}))}))}}})),pn=t((function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));e(pn);var gn=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e};var vn=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function yn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var mn=function(e,t,r){return t&&yn(e.prototype,t),r&&yn(e,r),e};var bn=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n};var _n=function(e){if(Array.isArray(e))return bn(e)};var wn=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)};var On=function(e,t){if(e){if("string"==typeof e)return bn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bn(e,t):void 0}};var Tn=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var Sn=pn((function(e){return _n(e)||wn(e)||On(e)||Tn()})),xn={functions:"Jexl Function",transforms:"Transform"},Pn={ArrayLiteral:function(e){return this.evalArray(e.value)},BinaryExpression:function(e){var t=this,r=this._grammar.elements[e.operator];if(r.evalOnDemand){var n=function(e){return{eval:function(){return t.eval(e)}}};return r.evalOnDemand(n(e.left),n(e.right))}return this.Promise.all([this.eval(e.left),this.eval(e.right)]).then((function(e){return r.eval(e[0],e[1])}))},ConditionalExpression:function(e){var t=this;return this.eval(e.test).then((function(r){return r?e.consequent?t.eval(e.consequent):r:t.eval(e.alternate)}))},FilterExpression:function(e){var t=this;return this.eval(e.subject).then((function(r){return e.relative?t._filterRelative(r,e.expr):t._filterStatic(r,e.expr)}))},Identifier:function(e){return e.from?this.eval(e.from).then((function(t){if(null!=t)return Array.isArray(t)&&(t=t[0]),t[e.value]})):e.relative?this._relContext[e.value]:this._context[e.value]},Literal:function(e){return e.value},ObjectLiteral:function(e){return this.evalMap(e.value)},FunctionCall:function(e){var t=xn[e.pool];if(!t)throw new Error("Corrupt AST: Pool '".concat(e.pool,"' not found"));var r=this._grammar[e.pool][e.name];if(!r)throw new Error("".concat(t," ").concat(e.name," is not defined."));return this.evalArray(e.args||[]).then((function(e){return r.apply(void 0,(0,Sn.default)(e))}))},UnaryExpression:function(e){var t=this;return this.eval(e.right).then((function(r){return t._grammar.elements[e.operator].eval(r)}))}},In=pn(vn),En=pn(mn),kn=function(){function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Promise;(0,In.default)(this,e),this._grammar=t,this._context=r||{},this._relContext=n||this._context,this.Promise=o}return(0,En.default)(e,[{key:"eval",value:function(e){var t=this;return this.Promise.resolve().then((function(){return Pn[e.type].call(t,e)}))}},{key:"evalArray",value:function(e){var t=this;return this.Promise.all(e.map((function(e){return t.eval(e)})))}},{key:"evalMap",value:function(e){var t=this,r=Object.keys(e),n={},o=r.map((function(r){return t.eval(e[r])}));return this.Promise.all(o).then((function(e){return e.forEach((function(e,t){n[r[t]]=e})),n}))}},{key:"_filterRelative",value:function(t,r){var n=this,o=[];return Array.isArray(t)||(t=void 0===t?[]:[t]),t.forEach((function(t){var i=new e(n._grammar,n._context,t,n.Promise);o.push(i.eval(r))})),this.Promise.all(o).then((function(e){var r=[];return e.forEach((function(e,n){e&&r.push(t[n])})),r}))}},{key:"_filterStatic",value:function(e,t){return this.eval(t).then((function(t){return"boolean"==typeof t?t?e:void 0:e[t]}))}}]),e}(),jn=pn(vn),Dn=pn(mn),Cn=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/,An=/^[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Zа-яА-Я0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/,Nn=/\\\\/,Rn=/^\s*$/,Mn=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Un=["[a-zA-Zа-яА-Я_À-ÖØ-öø-ÿ\\$][a-zA-Z0-9а-яА-Я_À-ÖØ-öø-ÿ\\$]*","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],Bn=["binaryOp","unaryOp","openParen","openBracket","question","colon"],qn=function(){function e(t){(0,jn.default)(this,e),this._grammar=t}return(0,Dn.default)(e,[{key:"getElements",value:function(e){var t=this._getSplitRegex();return e.split(t).filter((function(e){return e}))}},{key:"getTokens",value:function(e){for(var t=[],r=!1,n=0;n<e.length;n++)this._isWhitespace(e[n])?t.length&&(t[t.length-1].raw+=e[n]):"-"===e[n]&&this._isNegative(t)?r=!0:(r&&(e[n]="-"+e[n],r=!1),t.push(this._createToken(e[n])));return r&&t.push(this._createToken("-")),t}},{key:"tokenize",value:function(e){var t=this.getElements(e);return this.getTokens(t)}},{key:"_createToken",value:function(e){var t={type:"literal",value:e,raw:e};if('"'===e[0]||"'"===e[0])t.value=this._unquote(e);else if(e.match(Cn))t.value=parseFloat(e);else if("true"===e||"false"===e)t.value="true"===e;else if(this._grammar.elements[e])t.type=this._grammar.elements[e].type;else{if(!e.match(An))throw new Error("Invalid expression token: ".concat(e));t.type="identifier"}return t}},{key:"_escapeRegExp",value:function(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(An)&&(e="\\b"+e+"\\b"),e}},{key:"_getSplitRegex",value:function(){var e=this;if(!this._splitRegex){var t=Object.keys(this._grammar.elements).sort((function(e,t){return t.length-e.length})).map((function(t){return e._escapeRegExp(t)}),this);this._splitRegex=new RegExp("("+[Mn.join("|"),t.join("|"),Un.join("|")].join("|")+")")}return this._splitRegex}},{key:"_isNegative",value:function(e){return!e.length||Bn.some((function(t){return t===e[e.length-1].type}))}},{key:"_isWhitespace",value:function(e){return!!e.match(Rn)}},{key:"_unquote",value:function(e){var t=e[0],r=new RegExp("\\\\"+t,"g");return e.substr(1,e.length-2).replace(r,t).replace(Nn,"\\")}}]),e}(),Ln={argVal:function(e){e&&this._cursor.args.push(e)},arrayStart:function(){this._placeAtCursor({type:"ArrayLiteral",value:[]})},arrayVal:function(e){e&&this._cursor.value.push(e)},binaryOp:function(e){for(var t=this._grammar.elements[e.value].precedence||0,r=this._cursor._parent;r&&r.operator&&this._grammar.elements[r.operator].precedence>=t;)this._cursor=r,r=r._parent;var n={type:"BinaryExpression",operator:e.value,left:this._cursor};this._setParent(this._cursor,n),this._cursor=r,this._placeAtCursor(n)},dot:function(){this._nextIdentEncapsulate=this._cursor&&"UnaryExpression"!==this._cursor.type&&("BinaryExpression"!==this._cursor.type||"BinaryExpression"===this._cursor.type&&this._cursor.right),this._nextIdentRelative=!this._cursor||this._cursor&&!this._nextIdentEncapsulate,this._nextIdentRelative&&(this._relative=!0)},filter:function(e){this._placeBeforeCursor({type:"FilterExpression",expr:e,relative:this._subParser.isRelative(),subject:this._cursor})},functionCall:function(){this._placeBeforeCursor({type:"FunctionCall",name:this._cursor.value,args:[],pool:"functions"})},identifier:function(e){var t={type:"Identifier",value:e.value};this._nextIdentEncapsulate?(t.from=this._cursor,this._placeBeforeCursor(t),this._nextIdentEncapsulate=!1):(this._nextIdentRelative&&(t.relative=!0,this._nextIdentRelative=!1),this._placeAtCursor(t))},literal:function(e){this._placeAtCursor({type:"Literal",value:e.value})},objKey:function(e){this._curObjKey=e.value},objStart:function(){this._placeAtCursor({type:"ObjectLiteral",value:{}})},objVal:function(e){this._cursor.value[this._curObjKey]=e},subExpression:function(e){this._placeAtCursor(e)},ternaryEnd:function(e){this._cursor.alternate=e},ternaryMid:function(e){this._cursor.consequent=e},ternaryStart:function(){this._tree={type:"ConditionalExpression",test:this._tree},this._cursor=this._tree},transform:function(e){this._placeBeforeCursor({type:"FunctionCall",name:e.value,args:[this._cursor],pool:"transforms"})},unaryOp:function(e){this._placeAtCursor({type:"UnaryExpression",operator:e.value})}},Fn={states:{expectOperand:{tokenTypes:{literal:{toState:"expectBinOp"},identifier:{toState:"identifier"},unaryOp:{},openParen:{toState:"subExpression"},openCurl:{toState:"expectObjKey",handler:Ln.objStart},dot:{toState:"traverse"},openBracket:{toState:"arrayVal",handler:Ln.arrayStart}}},expectBinOp:{tokenTypes:{binaryOp:{toState:"expectOperand"},pipe:{toState:"expectTransform"},dot:{toState:"traverse"},question:{toState:"ternaryMid",handler:Ln.ternaryStart}},completable:!0},expectTransform:{tokenTypes:{identifier:{toState:"postTransform",handler:Ln.transform}}},expectObjKey:{tokenTypes:{identifier:{toState:"expectKeyValSep",handler:Ln.objKey},closeCurl:{toState:"expectBinOp"}}},expectKeyValSep:{tokenTypes:{colon:{toState:"objVal"}}},postTransform:{tokenTypes:{openParen:{toState:"argVal"},binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},postArgs:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},identifier:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},openParen:{toState:"argVal",handler:Ln.functionCall},pipe:{toState:"expectTransform"},question:{toState:"ternaryMid",handler:Ln.ternaryStart}},completable:!0},traverse:{tokenTypes:{identifier:{toState:"identifier"}}},filter:{subHandler:Ln.filter,endStates:{closeBracket:"identifier"}},subExpression:{subHandler:Ln.subExpression,endStates:{closeParen:"expectBinOp"}},argVal:{subHandler:Ln.argVal,endStates:{comma:"argVal",closeParen:"postArgs"}},objVal:{subHandler:Ln.objVal,endStates:{comma:"expectObjKey",closeCurl:"expectBinOp"}},arrayVal:{subHandler:Ln.arrayVal,endStates:{comma:"arrayVal",closeBracket:"expectBinOp"}},ternaryMid:{subHandler:Ln.ternaryMid,endStates:{colon:"ternaryEnd"}},ternaryEnd:{subHandler:Ln.ternaryEnd,completable:!0}}},Hn=pn(vn),zn=pn(mn),Wn=Fn.states,Yn=function(){function e(t,r,n){(0,Hn.default)(this,e),this._grammar=t,this._state="expectOperand",this._tree=null,this._exprStr=r||"",this._relative=!1,this._stopMap=n||{}}return(0,zn.default)(e,[{key:"addToken",value:function(e){if("complete"===this._state)throw new Error("Cannot add a new token to a completed Parser");var t=Wn[this._state],r=this._exprStr;if(this._exprStr+=e.raw,t.subHandler){this._subParser||this._startSubExpression(r);var n=this._subParser.addToken(e);if(n){if(this._endSubExpression(),this._parentStop)return n;this._state=n}}else{if(!t.tokenTypes[e.type]){if(this._stopMap[e.type])return this._stopMap[e.type];throw new Error("Token ".concat(e.raw," (").concat(e.type,") unexpected in expression: ").concat(this._exprStr))}var o=t.tokenTypes[e.type],i=Ln[e.type];o.handler&&(i=o.handler),i&&i.call(this,e),o.toState&&(this._state=o.toState)}return!1}},{key:"addTokens",value:function(e){e.forEach(this.addToken,this)}},{key:"complete",value:function(){if(this._cursor&&!Wn[this._state].completable)throw new Error("Unexpected end of expression: ".concat(this._exprStr));return this._subParser&&this._endSubExpression(),this._state="complete",this._cursor?this._tree:null}},{key:"isRelative",value:function(){return this._relative}},{key:"_endSubExpression",value:function(){Wn[this._state].subHandler.call(this,this._subParser.complete()),this._subParser=null}},{key:"_placeAtCursor",value:function(e){this._cursor?(this._cursor.right=e,this._setParent(e,this._cursor)):this._tree=e,this._cursor=e}},{key:"_placeBeforeCursor",value:function(e){this._cursor=this._cursor._parent,this._placeAtCursor(e)}},{key:"_setParent",value:function(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}},{key:"_startSubExpression",value:function(t){var r=Wn[this._state].endStates;r||(this._parentStop=!0,r=this._stopMap),this._subParser=new e(this._grammar,t,r)}}]),e}(),Kn=pn(vn),Vn=pn(mn),Gn=function(){function e(t){(0,Kn.default)(this,e),t(this._resolve.bind(this),this._reject.bind(this))}return(0,Vn.default)(e,[{key:"catch",value:function(e){if(this.error)try{this._resolve(e(this.error))}catch(e){this._reject(e)}return this}},{key:"then",value:function(e,t){if(!this.error)try{this._resolve(e(this.value))}catch(e){this._reject(e)}return t&&this.catch(t),this}},{key:"_reject",value:function(e){this.value=void 0,this.error=e}},{key:"_resolve",value:function(t){t instanceof e?t.error?this._reject(t.error):this._resolve(t.value):(this.value=t,this.error=void 0)}}]),e}();Gn.all=function(e){return new Gn((function(t){t(e.map((function(e){for(;e instanceof Gn;){if(e.error)throw Error(e.error);e=e.value}return e})))}))},Gn.resolve=function(e){return new Gn((function(t){return t(e)}))},Gn.reject=function(e){return new Gn((function(t,r){return r(e)}))};var Qn=Gn,Jn=pn(vn),Xn=pn(mn),$n=function(){function e(t,r){(0,Jn.default)(this,e),this._grammar=t,this._exprStr=r,this._ast=null}return(0,Xn.default)(e,[{key:"compile",value:function(){var e=new qn(this._grammar),t=new Yn(this._grammar),r=e.tokenize(this._exprStr);return t.addTokens(r),this._ast=t.complete(),this}},{key:"eval",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._eval(e,Promise)}},{key:"evalSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._eval(e,Qn);if(t.error)throw t.error;return t.value}},{key:"_eval",value:function(e,t){var r=this;return t.resolve().then((function(){var n=r._getAst();return new kn(r._grammar,e,void 0,t).eval(n)}))}},{key:"_getAst",value:function(){return this._ast||this.compile(),this._ast}}]),e}(),Zn=function(){return{elements:{".":{type:"dot"},"[":{type:"openBracket"},"]":{type:"closeBracket"},"|":{type:"pipe"},"{":{type:"openCurl"},"}":{type:"closeCurl"},":":{type:"colon"},",":{type:"comma"},"(":{type:"openParen"},")":{type:"closeParen"},"?":{type:"question"},"+":{type:"binaryOp",precedence:30,eval:function(e,t){return e+t}},"-":{type:"binaryOp",precedence:30,eval:function(e,t){return e-t}},"*":{type:"binaryOp",precedence:40,eval:function(e,t){return e*t}},"/":{type:"binaryOp",precedence:40,eval:function(e,t){return e/t}},"//":{type:"binaryOp",precedence:40,eval:function(e,t){return Math.floor(e/t)}},"%":{type:"binaryOp",precedence:50,eval:function(e,t){return e%t}},"^":{type:"binaryOp",precedence:50,eval:function(e,t){return Math.pow(e,t)}},"==":{type:"binaryOp",precedence:20,eval:function(e,t){return e==t}},"!=":{type:"binaryOp",precedence:20,eval:function(e,t){return e!=t}},">":{type:"binaryOp",precedence:20,eval:function(e,t){return e>t}},">=":{type:"binaryOp",precedence:20,eval:function(e,t){return e>=t}},"<":{type:"binaryOp",precedence:20,eval:function(e,t){return e<t}},"<=":{type:"binaryOp",precedence:20,eval:function(e,t){return e<=t}},"&&":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e?t.eval():e}))}},"||":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e||t.eval()}))}},in:{type:"binaryOp",precedence:20,eval:function(e,t){return"string"==typeof t?-1!==t.indexOf(e):!!Array.isArray(t)&&t.some((function(t){return t===e}))}},"!":{type:"unaryOp",precedence:1/0,eval:function(e){return!e}}},functions:{},transforms:{}}},eo=pn(gn),to=pn(vn),ro=pn(mn),no=Zn,oo=function(){function e(){(0,to.default)(this,e),this.expr=this.expr.bind(this),this._grammar=no()}return(0,ro.default)(e,[{key:"addBinaryOp",value:function(e,t,r,n){this._addGrammarElement(e,(0,eo.default)({type:"binaryOp",precedence:t},n?"evalOnDemand":"eval",r))}},{key:"addFunction",value:function(e,t){this._grammar.functions[e]=t}},{key:"addFunctions",value:function(e){for(var t in e)this._grammar.functions[t]=e[t]}},{key:"addUnaryOp",value:function(e,t){this._addGrammarElement(e,{type:"unaryOp",weight:1/0,eval:t})}},{key:"addTransform",value:function(e,t){this._grammar.transforms[e]=t}},{key:"addTransforms",value:function(e){for(var t in e)this._grammar.transforms[t]=e[t]}},{key:"compile",value:function(e){return this.createExpression(e).compile()}},{key:"createExpression",value:function(e){return new $n(this._grammar,e)}},{key:"getFunction",value:function(e){return this._grammar.functions[e]}},{key:"getTransform",value:function(e){return this._grammar.transforms[e]}},{key:"eval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.eval(t)}},{key:"evalSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.evalSync(t)}},{key:"expr",value:function(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=e.reduce((function(e,t,n){return e+=t+(n<r.length?r[n]:"")}),"");return this.createExpression(o)}},{key:"removeOp",value:function(e){!this._grammar.elements[e]||"binaryOp"!==this._grammar.elements[e].type&&"unaryOp"!==this._grammar.elements[e].type||delete this._grammar.elements[e]}},{key:"_addGrammarElement",value:function(e,t){this._grammar.elements[e]=t}}]),e}(),io=new oo,ao=oo;io.Jexl=ao;var uo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.loadConfigs=t.getLovAttributesToRetrieve=t.exchangeRatesFromResponse=t.evaluateHsoConfigs=void 0;var r=St.__importDefault(io);function n(e){var t={};return e.forEach((function(e){var r=e.objectID,n=e.rate;t[r]=n})),t}function o(e){var t=un.getTranslatedAttributes(e,["value"]);return St.__spreadArrays(["id","categoryID","objectID"],t)}r.default.addTransform("map",(function(e,t){return e.map((function(e){return t.replace(/%s/g,e)}))})),t.evaluateHsoConfigs=function(e,t){void 0===t&&(t=[]);var n=[];return t.some((function(t){try{r.default.evalSync(t.criteria,e)&&(n=t.value.map((function(t){return r.default.evalSync(t,e)})))}catch(e){}return n.length>0})),n},t.exchangeRatesFromResponse=n,t.getLovAttributesToRetrieve=o,t.loadConfigs=function(e,t,r){var i,a,u,s,c=e.search;return St.__awaiter(this,void 0,void 0,(function(){var e,l,f,d,h,p,g,v,y,m,b;return St.__generator(this,(function(_){switch(_.label){case 0:return e=r.currencies,l=r.languages,f=r.variations,d=e.map((function(e){return"objectID:"+e})),h=un.pickIndexVariation(t.hsoIndex,f),p=(null==h?void 0:h.objectID)?["objectID:"+h.objectID]:void 0,g=[{indexName:h.name,params:{facetFilters:p,attributesToHighlight:[],getRankingInfo:!1}},{indexName:t.lovIndex,params:{hitsPerPage:1e3,attributesToRetrieve:o(l),attributesToHighlight:[],getRankingInfo:!1}},{indexName:t.currencyIndex,params:{hitsPerPage:d.length,query:"",attributesToRetrieve:["rate"],attributesToHighlight:[],facetFilters:[d],getRankingInfo:!1}}],[4,c(g)];case 1:return v=_.sent().results,y=null===(i=v[0])||void 0===i?void 0:i.hits,m=null===(a=v[1])||void 0===a?void 0:a.hits,b=null===(u=v[2])||void 0===u?void 0:u.hits,[2,{hso:null===(s=y[0])||void 0===s?void 0:s.hso,lov:m,exchangeRates:n(b)}]}}))}))}})),so=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),St.__exportStar(sn,t),St.__exportStar(dn,t),St.__exportStar(un,t),St.__exportStar(ln,t),St.__exportStar(hn,t),St.__exportStar(uo,t)})),co=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.getRequestSize=t.prepareSearchParameters=void 0;function r(e,t,r,n){var o,i=St.__assign(St.__assign({},t),{offset:r,anchorHotelId:n});if(null===(o=i.boundingBox)||void 0===o?void 0:o.length)return i;var a=e.polygon;return(null==a?void 0:a.length)?St.__assign(St.__assign({},i),{polygon:a}):e._geoloc?St.__assign(St.__assign({},i),{geolocation:e._geoloc}):i}function n(e,t){var r=e.rooms,n=void 0===r?"2":r,o=Qr.getCheckInCheckOutDates(e,t),i=o.checkIn,a=o.checkOut;return St.__assign(St.__assign({},e),{checkIn:i,checkOut:a,rooms:n})}function o(e,t,r){var n,o,i=e.anchor,a=e.anchorType;return void 0!==i.pageSize&&i.pageSize>=r.pageSize&&void 0===(null===(n=t.filters)||void 0===n?void 0:n.priceMin)&&void 0===(null===(o=t.filters)||void 0===o?void 0:o.priceMax)&&"price"!==t.sortField?i.pageSize:"hotel"===a?45:65}t.prepareSearchParameters=n,t.getRequestSize=o,t.search=function(e){var t=this,i=e.getFeatureEnabled,a=e.profile,u=e.algoliaClient,s=e.raaClient,c=e.options,l=e.configs,f=l.hso,d=l.exchangeRates,h=c.languages,p=d[c.currency],g=i("offers");return function(e,i){return void 0===i&&(i={}),St.__awaiter(t,void 0,void 0,(function(){var t,l,d,v,y,m,b,_,w,O,T,S,x,P,I,E=this;return St.__generator(this,(function(k){switch(k.label){case 0:return t=Qr.createState({}),l=0,d=i.onStart,v=i.onAnchorReceived,y=i.onHotelsReceived,m=i.onOffersReceived,b=i.onComplete,_=n(e,a),w=Qr.generateSearchId(e,c),t.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof d&&d(t.current()),[4,so.getAnchor(u,a,c)(_)];case 1:return O=k.sent(),t.update((function(e){var t,r;if(e.anchor=O.anchor,e.anchorType=O.anchorType,void 0!==O.anchorHotel){var n=O.anchorHotel.objectID;e.anchorHotelId=n,e.hotelEntities=St.__assign(St.__assign({},null!==(r=e.hotelEntities)&&void 0!==r?r:{}),((t={})[n]=O.anchorHotel,t))}})),"function"==typeof v&&v(t.current()),T="hotel"===O.anchorType?"hotel_search":"place_search",S=f[T],x=so.geoSearch(u,a,{languages:h,exchangeRate:p,priceBucketWidth:O.anchor.priceBucketWidth,requestSize:o(O,_,c),hsoFilter:so.evaluateHsoConfigs({anchorHotel:O.anchorHotel,searchParameters:_,checkInNights:so.getCheckInNights(_.checkIn,_.checkOut)},S)}),[4,(P=function(e){return void 0===e&&(e=0),St.__awaiter(E,void 0,void 0,(function(){var n,o,i,a,u,l,f,d;return St.__generator(this,(function(h){switch(h.label){case 0:return!0===_.skipGeoSearch?[3,2]:[4,x(r(O.anchor,_,e,null===(l=O.anchorHotel)||void 0===l?void 0:l.objectID))];case 1:n=h.sent(),t.update((function(e){var t;e.facets=n.facets,e.resultsCount=n.resultsCount,e.resultsCountTotal=n.resultsCountTotal,e.offset=n.offset,e.hotelIds=n.hotelIds,e.hotelEntities=St.__assign(St.__assign({},null!==(t=e.hotelEntities)&&void 0!==t?t:{}),n.hotelEntities),e.hotelsHaveStaticPosition=function(e,t,r){var n,o,i,a;if("price"===e.sortField)return!1;if(void 0!==(null===(n=e.filters)||void 0===n?void 0:n.priceMin)||void 0!==(null===(o=e.filters)||void 0===o?void 0:o.priceMax))return!1;if(r){var u=so.getCheckInNights(e.checkIn,e.checkOut);return(null!==(a=null===(i=r.tags)||void 0===i?void 0:i["a"+u])&&void 0!==a?a:0)>=t}return!0}(_,c.pageSize,n.facets)})),t.update((function(e){Object.keys(e.hotelEntities).forEach((function(t){e.hotelEntities[t]=Qr.augmentHotelWithRegularPriceRange(e.hotelEntities[t],p,e.anchor.priceBucketWidth)}))})),h.label=2;case 2:return"function"==typeof y&&y(t.current()),g&&void 0!==s?(o=t.get("hotelIds"),i=St.__assign(St.__assign({},_),{searchId:w,destination:null!==(f=null==o?void 0:o.join(","))&&void 0!==f?f:"",anchorDestination:null===(d=O.anchorHotel)||void 0===d?void 0:d.objectID}),[4,s.getOffers(i,(function(e){var r=en.augmentRaaResponse(e,St.__assign(St.__assign(St.__assign(St.__assign({},i),O.anchor),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:p}));t.update((function(e){e.hotelIds=r.anchorHotelId?e.hotelIds:r.hotelIds,e.hotelOfferEntities=r.hotelOfferEntities})),"function"==typeof m&&m(t.current())}))]):[3,4];case 3:a=h.sent(),u=en.augmentRaaResponse(a,St.__assign(St.__assign(St.__assign(St.__assign({},i),O.anchor),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:p})),t.update((function(e){e.hotelIds=u.hotelIds,e.hotelOfferEntities=u.hotelOfferEntities})),t.update((function(e){e.dealScores=Qr.getDealScores(e)})),h.label=4;case 4:return"function"==typeof b&&b(t.current()),[2,t.current()]}}))}))})(_.offset)];case 2:return I=k.sent(),[2,{loadOffers:function(e){return St.__awaiter(E,void 0,void 0,(function(){var t,r,n,o,i;return St.__generator(this,(function(a){switch(a.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!g||!s)throw new Error("Offers loading is disabled");return t=e===I.anchorHotelId,r=St.__assign(St.__assign({},_),{searchId:w,getAllOffers:!0,destination:t?void 0:e,anchorDestination:t?e:void 0}),[4,s.getOffers(r)];case 1:return n=a.sent(),o=en.augmentRaaResponse(n,St.__assign(St.__assign(St.__assign(St.__assign({},r),O.anchor),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:p})),[2,null===(i=o.hotelOfferEntities)||void 0===i?void 0:i[e]]}}))}))},loadMore:function(){return St.__awaiter(E,void 0,void 0,(function(){return St.__generator(this,(function(e){return l+=o(O,_,c),[2,P(l)]}))}))}}]}}))}))}}}));var lo=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],a=[],u={},s=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:s,headers:{keys:function(){return i},entries:function(){return a},get:function(e){return u[e.toLowerCase()]},has:function(e){return e.toLowerCase()in u}}}};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){i.push(t=t.toLowerCase()),a.push([t,r]),u[t]=u[t]?u[t]+","+r:r})),r(s())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),fo={};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;fo.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,r){var n=e.create,o=e.defineProperty,i=/[!'\(\)~]|%20|%00/g,a=/%(?![0-9a-fA-F]{2})/g,u=/\+/g,s={"!":"%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(i,o);function i(i){e.call(r,i,t(o),n)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var r=g(t),n=0,o=this._ungap[t];n<o.length;n++)e.push(r+"="+g(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 i=e.split("&"),a=0,u=i.length;a<u;a++){var s=(c=i[a]).indexOf("=");-1<s?h(t,p(c.slice(0,s)),p(c.slice(s+1))):c.length&&h(t,p(c),"")}break;case r(e):for(a=0,u=e.length;a<u;a++){var c;h(t,(c=e[a])[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(a,"%25").replace(u," "))}function g(e){return encodeURIComponent(e).replace(i,v)}function v(e){return s[e]}fo.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(),i=o.done,a=[],u=Object.create(null);!i;)t=(r=o.value)[0],a.push(t),t in u||(u[t]=[]),u[t].push(r[1]),i=(o=n.next()).done;for(a.sort(),e=0;e<a.length;e++)this.delete(a[e]);for(e=0;e<a.length;e++)t=a[e],this.append(t,u[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},i=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},a=function(a){var u,s,c=a.prototype,l=n(c,"searchParams"),f=n(c,"href"),d=n(c,"search");!l&&d&&d.set&&(s=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 i(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=i,r(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),u=function(e,t){return r(e,"_searchParams",{configurable:!0,writable:!0,value:s(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 i(this,a),this._searchParams||u(this,new URLSearchParams(this.search.slice(1)))},set:function(e){i(this,a),u(this,e)}}}))};try{a(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&a(URL)}catch(e){}}(Object)}(fo.URLSearchParams.prototype);var ho=fo.URLSearchParams,po=Object.freeze({__proto__:null,default:ho}),go=r(lo),vo=r(po),yo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.backendSearch=t.createRequestString=void 0;var r=St.__importDefault(go),n=St.__importDefault(vo);function o(e){var t,r,o,i,a,u,s,c,l,f,d,h,p,g,v,y,m,b,_,w=e.profileKey,O=e.searchParameters,T=e.options,S=e.offset,x=e.attributes,P=Qr.removeEmpty({offset:S,profileId:w,query:O.query,hotelId:O.hotelId,placeId:O.placeId,checkIn:O.checkIn,checkOut:O.checkOut,rooms:O.rooms,dayDistance:O.dayDistance,nights:O.nights,sortField:O.sortField,sortOrder:O.sortOrder,boundingBox:null===(t=O.boundingBox)||void 0===t?void 0:t.join(","),currency:T.currency,language:T.language,variations:null===(r=T.variations)||void 0===r?void 0:r.join(","),starRating:null===(i=null===(o=O.filters)||void 0===o?void 0:o.starRating)||void 0===i?void 0:i.join(","),guestRating:null===(u=null===(a=O.filters)||void 0===a?void 0:a.guestRating)||void 0===u?void 0:u.join(","),propertyTypeId:null===(c=null===(s=O.filters)||void 0===s?void 0:s.propertyTypeId)||void 0===c?void 0:c.join(","),facilities:null===(f=null===(l=O.filters)||void 0===l?void 0:l.facilities)||void 0===f?void 0:f.join(","),themeIds:null===(h=null===(d=O.filters)||void 0===d?void 0:d.themeIds)||void 0===h?void 0:h.join(","),chainIds:null===(g=null===(p=O.filters)||void 0===p?void 0:p.chainIds)||void 0===g?void 0:g.join(","),noHostels:null===(v=O.filters)||void 0===v?void 0:v.noHostels,priceMin:null===(y=O.filters)||void 0===y?void 0:y.priceMin,priceMax:null===(m=O.filters)||void 0===m?void 0:m.priceMax,hotelName:null===(b=O.filters)||void 0===b?void 0:b.hotelName,freeCancellation:null===(_=O.filters)||void 0===_?void 0:_.freeCancellation,attributes:null==x?void 0:x.join(",")});return new n.default(P).toString()}function i(e,t){var n=e.baseUrl,i=e.endpoints;return St.__awaiter(this,void 0,void 0,(function(){var e,a,u,s,c,l;return St.__generator(this,(function(f){switch(f.label){case 0:return e=o(t),[4,r.default(n+"/"+i.search+"?"+e)];case 1:return(a=f.sent()).ok?[2,a.json()]:(u=t.searchParameters,s=t.options,c=t.offset,l=t.attributes,s.logger.log({name:"SafSearchFailed",value:St.__assign(St.__assign({},u),{offset:c,attributes:l,language:s.language,currency:s.currency,deviceCategory:s.deviceCategory})}),[2,Promise.reject(a)])}}))}))}t.createRequestString=o,t.backendSearch=function(e){var t,r=this,n=e.getFeatureEnabled,o=e.profile,a=e.profileKey,u=e.backendConfig,s=e.raaClient,c=e.options,l=n("offers"),f=!1;return function(e,n){return void 0===n&&(n={}),St.__awaiter(r,void 0,void 0,(function(){var r,d,h,p,g,v,y,m,b,_,w=this;return St.__generator(this,(function(O){switch(O.label){case 0:return r=Qr.createState({}),d=n.onStart,h=n.onAnchorReceived,p=n.onHotelsReceived,g=n.onOffersReceived,v=n.onComplete,y=0,m=co.prepareSearchParameters(e,o),b=Qr.generateSearchId(e,c),r.update((function(e){e.searchParameters=m,e.searchId=b})),"function"==typeof d&&d(r.current()),_=function(e,n){return void 0===e&&(e=0),St.__awaiter(w,void 0,void 0,(function(){var o,d,y,_,w,O,T;return St.__generator(this,(function(S){switch(S.label){case 0:return[4,i(u,{profileKey:a,searchParameters:m,options:c,offset:e,attributes:n})];case 1:return o=S.sent(),f||(t=o.exchangeRates[c.currency],(null===(O=c.callbacks)||void 0===O?void 0:O.onConfigReceived)&&c.callbacks.onConfigReceived({lov:o.lov,exchangeRates:o.exchangeRates}),f=!0),(void 0===n||n.includes("anchor"))&&(r.update((function(e){e.anchor=o.anchor,e.anchorHotelId=o.anchorHotelId,e.anchorType=o.anchorType,e.hotelEntities=o.hotelEntities})),"function"==typeof h&&h(r.current())),r.update((function(e){e.facets=o.facets,e.hotelEntities=o.hotelEntities,e.hotelIds=o.hotelIds,e.hotelsHaveStaticPosition=o.hotelsHaveStaticPosition,e.offset=o.offset,e.resultsCount=o.resultsCount,e.resultsCountTotal=o.resultsCountTotal})),"function"==typeof p&&p(r.current()),l&&void 0!==s?(d=r.get("hotelIds"),y=St.__assign(St.__assign({},m),{searchId:b,destination:null!==(T=null==d?void 0:d.join(","))&&void 0!==T?T:"",anchorDestination:r.get("anchorHotelId")}),[4,s.getOffers(y,(function(e){var n=en.augmentRaaResponse(e,St.__assign(St.__assign(St.__assign(St.__assign({},y),r.get("anchor")),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:t}));r.update((function(e){e.hotelIds=n.anchorHotelId?e.hotelIds:n.hotelIds,e.hotelOfferEntities=n.hotelOfferEntities})),"function"==typeof g&&g(r.current())}))]):[3,3];case 2:_=S.sent(),w=en.augmentRaaResponse(_,St.__assign(St.__assign(St.__assign(St.__assign({},y),r.get("anchor")),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:t})),r.update((function(e){e.hotelIds=w.hotelIds,e.hotelOfferEntities=w.hotelOfferEntities})),r.update((function(e){e.dealScores=Qr.getDealScores(e)})),S.label=3;case 3:return"function"==typeof v&&v(r.current()),[2,r.current()]}}))}))},[4,f?_(m.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition"]):_(m.offset)];case 1:return O.sent(),[2,{loadOffers:function(e){return St.__awaiter(w,void 0,void 0,(function(){var n,o,i,a,u;return St.__generator(this,(function(f){switch(f.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!l||!s)throw new Error("Offers loading is disabled");return n=e===r.get("anchorHotelId"),o=St.__assign(St.__assign({},m),{searchId:b,getAllOffers:!0,destination:n?void 0:e,anchorDestination:n?e:void 0}),[4,s.getOffers(o)];case 1:return i=f.sent(),a=en.augmentRaaResponse(i,St.__assign(St.__assign(St.__assign(St.__assign({},o),r.get("anchor")),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:t})),[2,null===(u=a.hotelOfferEntities)||void 0===u?void 0:u[e]]}}))}))},loadMore:function(){return St.__awaiter(w,void 0,void 0,(function(){return St.__generator(this,(function(e){var t,n;return y+=co.getRequestSize({anchor:r.get("anchor"),anchorHotel:(t=r.get("hotelEntities"),n=r.get("anchorHotelId"),n?t[n]:void 0),anchorType:r.get("anchorType")},m,c),[2,_(y,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"])]}))}))}}]}}))}))}}})),mo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0,t.suggest=function(e){var t=this,r=e.profile,n=e.algoliaClient,o=e.options.languages;return function(e,i){return St.__awaiter(t,void 0,void 0,(function(){return St.__generator(this,(function(t){switch(t.label){case 0:return[4,so.loadSuggests(n,r,{suggestsCount:i,languages:o})(e)];case 1:return[2,t.sent()]}}))}))}}})),bo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var r=St.__importDefault(go),n=St.__importDefault(vo);function o(e,t){var r,o=e.hotelId,i=e.checkIn,a=e.checkOut,u=e.rooms,s=e.providerCode,c=e.cugDeals,l=Qr.removeEmpty({hotelId:o,checkIn:i,checkOut:a,rooms:u,providerCode:s,cugDeals:c,deviceType:t.deviceCategory,language:t.language,currency:t.currency,aid:t.anonymousId,variations:null===(r=t.variations)||void 0===r?void 0:r.join(",")});return new n.default(l).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,n=e.options,i=e.safConfig,a=i.baseUrl,u=i.endpoints;return function(e){return St.__awaiter(t,void 0,void 0,(function(){var t,i,s;return St.__generator(this,(function(c){switch(c.label){case 0:return t=o(e,n),[4,r.default(a+"/"+u.offersRooms+"?"+t)];case 1:return(i=c.sent()).ok?[4,i.json()]:[3,3];case 2:return s=c.sent(),[2,St.__assign({hotelId:e.hotelId,anonymousId:n.anonymousId},s)];case 3:return[2,Promise.reject(i)]}}))}))}}})),_o=t((function(e,t){function r(){if("undefined"!=typeof location)return"http:"===location.protocol?"ws://"+location.host:"https:"===location.protocol?"wss://"+location.host:void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.getProfile=void 0,t.getProfile=function(e,t){var n,o,i=fn.profiles[e];if(void 0===i)throw new Error("Profile key is not valid");return void 0!==t&&(i=St.__assign(St.__assign({},i),t)),(null===(n=i.features)||void 0===n?void 0:n.includes("offers"))&&void 0===(null===(o=i.raa)||void 0===o?void 0:o.endpoint)&&(i=St.__assign(St.__assign({},i),{raa:{endpoint:r()}})),i}})),wo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=void 0;var r=St.__importDefault(d),n={log:function(){}};function o(e){void 0===e&&(e={});var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r+"-"+e[r]);return t}t.sapi=function(e,t){var i,a,u,s,c,l,f,d;return St.__awaiter(this,void 0,void 0,(function(){function h(e){return m.features.includes(e)}var p,g,v,y,m,b,_,w,O,T,S,x,P;return St.__generator(this,(function(I){switch(I.label){case 0:if(!e)throw new Error("Profile key is required");return p=St.__assign(St.__assign({},t),{logger:null!==(i=t.logger)&&void 0!==i?i:n,variations:o(t.variations),currency:null!==(u=null===(a=t.currency)||void 0===a?void 0:a.toUpperCase())&&void 0!==u?u:"USD",deviceCategory:null!==(s=t.deviceCategory)&&void 0!==s?s:"desktop",pageSize:null!==(c=t.pageSize)&&void 0!==c?c:20}),g=null===(l=p.variations)||void 0===l?void 0:l.includes("c48b82da-sapi-backend-b"),v=fn.getSafConfig(e),y=fn.getBackendConfig(e),m=_o.getProfile(e,p.initWithProfile),b=r.default("4UYGJP42KQ",m.algolia.apiKey,p.algoliaClientOptions),_=h("offers")&&m.raa.endpoint?en.raa(m.raa.endpoint,p):void 0,w={safConfig:v,backendConfig:y,algoliaClient:b,getFeatureEnabled:h,profile:m,profileKey:e,raaClient:_,options:St.__assign(St.__assign({},p),{languages:St.__spreadArrays([p.language],null!==(f=m.fallbackLanguages[p.language])&&void 0!==f?f:[],["en"])})},g||!h("configs")?[3,2]:[4,so.loadConfigs(b,m,St.__assign(St.__assign({},w.options),{currencies:[p.currency,"EUR"]}))];case 1:O=I.sent(),(null===(d=p.callbacks)||void 0===d?void 0:d.onConfigReceived)&&(T=O.exchangeRates,S=O.lov,p.callbacks.onConfigReceived({exchangeRates:T,lov:S})),w.configs=O,I.label=2;case 2:return x=function(e){return h("search")?g?yo.backendSearch(e):co.search(e):function(){throw new Error("Search is disabled for this Profile key")}},P=function(e){return h("suggests")?mo.suggest(e):function(){throw new Error("Autosuggest is disabled for this Profile key")}},[2,{rooms:function(e){return h("rooms")?bo.rooms(e):function(){throw new Error("Rooms search is disabled for this Profile key")}}(w),search:x(w),suggest:P(w)}]}}))}))}})),Oo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),To=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),So=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),xo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Po=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),St.__exportStar(Oo,t),St.__exportStar(To,t),St.__exportStar(So,t),St.__exportStar(xo,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),zr.enableES5(),St.__exportStar(wo,t),St.__exportStar(Po,t),t.default=wo.sapi})))}));
|
|
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 n(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}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}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)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var i=function(){return(i=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}).apply(this,arguments)};var a=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function u(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,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function c(e){return this instanceof c?(this.v=e,this):new c(e)}var l=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var f=Object.freeze({__proto__:null,__extends:function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return i},__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,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},__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,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function u(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}s((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},__createBinding:a,__exportStar:function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)},__values:u,__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 i=arguments[t],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},__await:c,__asyncGenerator:function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){i.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof c?Promise.resolve(e.value.v).then(s,l):f(i[0][2],e)}(o[e](t))}catch(e){f(i[0][3],e)}}function s(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[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:c(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=u(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 l(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}}),d=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={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[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,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(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 a(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},i=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=i()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=o(e,2),n=t[0],i=t[1];return Promise.all([n,i||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=i();return o[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=i();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function u(e){var t=i(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 u({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return u({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return u({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return u({caches:t}).clear()}))}}}function s(){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()}},i=JSON.stringify(r);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);var a=n(),u=o&&o.miss||function(){return Promise.resolve()};return a.then((function(e){return u(e)})).then((function(){return a}))},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===g.WithinHeaders?n:{}},queryParameters:function(){return e===g.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 g={WithinQueryParameters:0,WithinHeaders:1};function v(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 y={Read:1,Write:2,Any:3},m=1,b=2,_=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:y.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||y.Any}}var T="DELETE",S="GET",x="POST",P="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===m||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(i(r),i(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 E(e,t,n,o){var a=[],u=function(e,t){if(e.method!==S&&(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),s=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!==S?{}: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,i){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:A(a)};var h={data:u,headers:s,method:c,url:D(l,n.path,f),connectTimeout:i(d,e.timeouts.connect),responseTimeout:i(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:r.length};return a.push(t),t},g={onSucess: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,i)}))},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,A(a))}};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.onSucess(e):t.onFail(e)}(e,g)}))};return I(e.hostsCache,t).then((function(e){return h(i(e.statelessHosts).reverse(),e.getTimeout)}))}function k(e){var t=e.hostsCache,r=e.logger,n=e.requester,i=e.requestsCache,a=e.responsesCache,u=e.timeouts,s=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:i,responsesCache:a,timeouts:u,userAgent:s,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var r=v(t,f.timeouts.read),n=function(){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var i={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(i,(function(){return f.requestsCache.get(i,(function(){return f.requestsCache.set(i,n()).then((function(e){return Promise.all([f.requestsCache.delete(i),e])}),(function(e){return Promise.all([f.requestsCache.delete(i),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(i,e)}})},write:function(e,t){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Write)})),e,v(t,f.timeouts.write))}};return f}function j(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 D(e,t,r){var n=C(r),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(o+="?".concat(n)),o}function C(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 A(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 R=function(e){return function(t,r){return e.transporter.write({method:x,path:"2/abtests",data:t},r)}},M=function(e){return function(t,r){return e.transporter.write({method:T,path:p("2/abtests/%s",t)},r)}},U=function(e){return function(t,r){return e.transporter.read({method:S,path:p("2/abtests/%s",t)},r)}},B=function(e){return function(t){return e.transporter.read({method:S,path:"2/abtests"},t)}},q=function(e){return function(t,r){return e.transporter.write({method:x,path:p("2/abtests/%s/stop",t)},r)}},L=function(e){return function(t){return e.transporter.read({method:S,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,r){return e.transporter.write({method:x,path:"1/strategies/personalization",data:t},r)}};function H(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 z=function(e){return function(t,o){var i=o||{},a=i.queryParameters,u=n(i,["queryParameters"]),s=r({acl:t},void 0!==a?{queryParameters:a}:{});return f(e.transporter.write({method:x,path:"1/keys",data:s},u),(function(t,r){return l((function(n){return X(e)(t.key,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},W=function(e){return function(t,r,n){var o=v(n);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:x,path:"1/clusters/mapping",data:{cluster:r}},o)}},Y=function(e){return function(t,r,n){return e.transporter.write({method:x,path:"1/clusters/mapping/batch",data:{users:t,cluster:r}},n)}},K=function(e){return function(t,r,n){return f(e.transporter.write({method:x,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},V=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Rules]}))}},G=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Settings]}))}},Q=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Synonyms]}))}},J=function(e){return function(t,r){return f(e.transporter.write({method:T,path:p("1/keys/%s",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).then(r).catch((function(e){if(404!==e.status)throw e}))}))}))}},X=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/keys/%s",t)},r)}},$=function(e){return function(t){return e.transporter.read({method:S,path:"1/logs"},t)}},Z=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping/top"},t)}},ee=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/clusters/mapping/%s",t)},r)}},te=function(e){return function(t){var r=t||{},o=r.retrieveMappings,i=n(r,["retrieveMappings"]);return!0===o&&(i.getClusters=!0),e.transporter.read({method:S,path:"1/clusters/mapping/pending"},i)}},re=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)}},ne=function(e){return function(t){return e.transporter.read({method:S,path:"1/keys"},t)}},oe=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters"},t)}},ie=function(e){return function(t){return e.transporter.read({method:S,path:"1/indexes"},t)}},ae=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping"},t)}},ue=function(e){return function(t,r,n){return f(e.transporter.write({method:x,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},se=function(e){return function(t,r){return f(e.transporter.write({method:x,path:"1/indexes/*/batch",data:{requests:t}},r),(function(t,r){return Promise.all(Object.keys(t.taskID).map((function(n){return re(e)(n,{methods:{waitTask:tt}}).waitTask(t.taskID[n],r)})))}))}},ce=function(e){return function(t,r){return e.transporter.read({method:x,path:"1/indexes/*/objects",data:{requests:t}},r)}},le=function(e){return function(t,n){var o=t.map((function(e){return r(r({},e),{},{params:C(e.params||{})})}));return e.transporter.read({method:x,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},n)}},fe=function(e){return function(t,o){return Promise.all(t.map((function(t){var i=t.params,a=i.facetName,u=i.facetQuery,s=n(i,["facetName","facetQuery"]);return re(e)(t.indexName,{methods:{searchForFacetValues:Xe}}).searchForFacetValues(a,u,r(r({},o),s))})))}},de=function(e){return function(t,r){var n=v(r);return n.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:T,path:"1/clusters/mapping"},n)}},he=function(e){return function(t,r){return f(e.transporter.write({method:x,path:p("1/keys/%s/restore",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},pe=function(e){return function(t,r){return e.transporter.read({method:x,path:"1/clusters/mapping/search",data:{query:t}},r)}},ge=function(e){return function(t,r){var o=Object.assign({},r),i=r||{},a=i.queryParameters,u=n(i,["queryParameters"]),s=a?{queryParameters:a}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:P,path:p("1/keys/%s",t),data:s},u),(function(r,n){return l((function(r){return X(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()}))}))}))}},ve=function(e){return function(t,r){return f(e.transporter.write({method:x,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},r),(function(t,r){return tt(e)(t.taskID,r)}))}},ye=function(e){return function(t){return H(r(r({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(r){return e.transporter.read({method:x,path:p("1/indexes/%s/browse",e.indexName),data:r},t)}}))}},me=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return $e(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},be=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return Ze(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},_e=function(e){return function(t,r,o){var i=o||{},a=i.batchSize,u=n(i,["batchSize"]),s={taskIDs:[],objectIDs:[]};return f(function n(){var o,i=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(i.push(t[o]),i.length!==(a||1e3));o++);return 0===i.length?Promise.resolve(s):ve(e)(i.map((function(e){return{action:r,body:e}})),u).then((function(e){return s.objectIDs=s.objectIDs.concat(e.objectIDs),s.taskIDs.push(e.taskID),o++,n(o)}))}(),(function(t,r){return Promise.all(t.taskIDs.map((function(t){return tt(e)(t,r)})))}))}},we=function(e){return function(t){return f(e.transporter.write({method:x,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},Oe=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,i=v(n(r,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/rules/clear",e.indexName)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},Te=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,i=v(n(r,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/synonyms/clear",e.indexName)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},Se=function(e){return function(t,r){return f(e.transporter.write({method:x,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},r),(function(t,r){return tt(e)(t.taskID,r)}))}},xe=function(e){return function(t){return f(e.transporter.write({method:T,path:p("1/indexes/%s",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},Pe=function(e){return function(t,r){return f(Ie(e)([t],r).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Ie=function(e){return function(t,r){var n=t.map((function(e){return{objectID:e}}));return _e(e)(n,rt.DeleteObject,r)}},Ee=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=v(n(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},ke=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=v(n(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},je=function(e){return function(t){return Ue(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},De=function(e){return function(t,r,n){return e.transporter.read({method:x,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},Ce=function(e){return function(t,i){var a=i||{},u=a.query,s=a.paginate,c=n(a,["query","paginate"]),l=0;return function n(){return Je(e)(u||"",r(r({},c),{},{page:l})).then((function(e){for(var r=0,i=Object.entries(e.hits);r<i.length;r++){var a=o(i[r],2),u=a[0],c=a[1];if(t(c))return{object:c,position:parseInt(u,10),page:l}}if(l++,!1===s||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return n()}))}()}},Ae=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/%s",e.indexName,t)},r)}},Ne=function(){return function(e,t){for(var r=0,n=Object.entries(e.hits);r<n.length;r++){var i=o(n[r],2),a=i[0];if(i[1].objectID===t)return parseInt(a,10)}return-1}},Re=function(e){return function(t,o){var i=o||{},a=i.attributesToRetrieve,u=n(i,["attributesToRetrieve"]),s=t.map((function(t){return r({indexName:e.indexName,objectID:t},a?{attributesToRetrieve:a}:{})}));return e.transporter.read({method:x,path:"1/indexes/*/objects",data:{requests:s}},u)}},Me=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/%s",e.indexName,t)},r)}},Ue=function(e){return function(t){return e.transporter.read({method:S,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Be=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},r)}},qe=function(e){return function(t,r){return f(Le(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Le=function(e){return function(t,r){var o=r||{},i=o.createIfNotExists,a=n(o,["createIfNotExists"]),u=i?rt.PartialUpdateObject:rt.PartialUpdateObjectNoCreate;return _e(e)(t,u,a)}},Fe=function(e){return function(t,a){var u=a||{},s=u.safe,c=u.autoGenerateObjectIDIfNotExist,l=u.batchSize,d=n(u,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,r,n,o){return f(e.transporter.write({method:x,path:p("1/indexes/%s/operation",t),data:{operation:n,destination:r}},o),(function(t,r){return tt(e)(t.taskID,r)}))},g=Math.random().toString(36).substring(7),v="".concat(e.indexName,"_tmp_").concat(g),y=Ye({appId:e.appId,transporter:e.transporter,indexName:v}),m=[],b=h(e.indexName,v,"copy",r(r({},d),{},{scope:["settings","synonyms","rules"]}));return m.push(b),f((s?b.wait(d):b).then((function(){var e=y(t,r(r({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return m.push(e),s?e.wait(d):e})).then((function(){var t=h(v,e.indexName,"move",d);return m.push(t),s?t.wait(d):t})).then((function(){return Promise.all(m)})).then((function(e){var t=o(e,3),r=t[0],n=t[1],a=t[2];return{objectIDs:n.objectIDs,taskIDs:[r.taskID].concat(i(n.taskIDs),[a.taskID])}})),(function(e,t){return Promise.all(m.map((function(e){return e.wait(t)})))}))}},He=function(e){return function(t,n){return Ve(e)(t,r(r({},n),{},{clearExistingRules:!0}))}},ze=function(e){return function(t,n){return Qe(e)(t,r(r({},n),{},{clearExistingSynonyms:!0}))}},We=function(e){return function(t,r){return f(Ye(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Ye=function(e){return function(t,r){var o=r||{},i=o.autoGenerateObjectIDIfNotExist,a=n(o,["autoGenerateObjectIDIfNotExist"]),u=i?rt.AddObject:rt.UpdateObject;if(u===rt.UpdateObject){var s=!0,c=!1,l=void 0;try{for(var d,h=t[Symbol.iterator]();!(s=(d=h.next()).done);s=!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{s||null==h.return||h.return()}finally{if(c)throw l}}}return _e(e)(t,u,a)}},Ke=function(e){return function(t,r){return Ve(e)([t],r)}},Ve=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=o.clearExistingRules,u=v(n(o,["forwardToReplicas","clearExistingRules"]));return i&&(u.queryParameters.forwardToReplicas=1),a&&(u.queryParameters.clearExistingRules=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},u),(function(t,r){return tt(e)(t.taskID,r)}))}},Ge=function(e){return function(t,r){return Qe(e)([t],r)}},Qe=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=o.clearExistingSynonyms,u=o.replaceExistingSynonyms,s=v(n(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return i&&(s.queryParameters.forwardToReplicas=1),(u||a)&&(s.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(function(t,r){return tt(e)(t.taskID,r)}))}},Je=function(e){return function(t,r){return e.transporter.read({method:x,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},Xe=function(e){return function(t,r,n){return e.transporter.read({method:x,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},$e=function(e){return function(t,r){return e.transporter.read({method:x,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},r)}},Ze=function(e){return function(t,r){return e.transporter.read({method:x,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},r)}},et=function(e){return function(t,r){var o=r||{},i=o.forwardToReplicas,a=v(n(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:P,path:p("1/indexes/%s/settings",e.indexName),data:t},a),(function(t,r){return tt(e)(t.taskID,r)}))}},tt=function(e){return function(t,r){return l((function(n){return function(e){return function(t,r){return e.transporter.read({method:S,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}))}))}},rt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},nt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},ot=1,it=2,at=3;function ut(e,t,n){var o,i={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)},i=o(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(i),n=o(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(i),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(i),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=at,{debug:function(e,t){return ot>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return it>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:u({caches:[a({key:"".concat("4.8.0","-").concat(e)}),s()]}),userAgent:j("4.8.0").add({segment:"Browser"})};return function(e){var t=e.appId,n=c(void 0!==e.authMode?e.authMode:g.WithinHeaders,t,e.apiKey),o=k(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:y.Read},{url:"".concat(t,".algolia.net"),accept:y.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(r({},i),n),{},{methods:{search:le,searchForFacetValues:fe,multipleBatch:se,multipleGetObjects:ce,multipleQueries:le,copyIndex:K,copySettings:G,copySynonyms:Q,copyRules:V,moveIndex:ue,listIndices:ie,getLogs:$,listClusters:oe,multipleSearchForFacetValues:fe,getApiKey:X,addApiKey:z,listApiKeys:ne,updateApiKey:ge,deleteApiKey:J,restoreApiKey:he,assignUserID:W,assignUserIDs:Y,getUserID:ee,searchUserIDs:pe,listUserIDs:ae,getTopUserIDs:Z,removeUserID:de,hasPendingMappings:te,initIndex:function(e){return function(t){return re(e)(t,{methods:{batch:ve,delete:xe,findAnswers:De,getObject:Ae,getObjects:Re,saveObject:We,saveObjects:Ye,search:Je,searchForFacetValues:Xe,waitTask:tt,setSettings:et,getSettings:Ue,partialUpdateObject:qe,partialUpdateObjects:Le,deleteObject:Pe,deleteObjects:Ie,deleteBy:Se,clearObjects:we,browseObjects:ye,getObjectPosition:Ne,findObject:Ce,exists:je,saveSynonym:Ge,saveSynonyms:Qe,getSynonym:Be,searchSynonyms:Ze,browseSynonyms:be,deleteSynonym:ke,clearSynonyms:Te,replaceAllObjects:Fe,replaceAllSynonyms:ze,searchRules:$e,getRule:Me,deleteRule:Ee,saveRule:Ke,saveRules:Ve,replaceAllRules:He,browseRules:me,clearRules:Oe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.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({},i),e),{},{methods:{addABTest:R,getABTest:U,getABTests:B,stopABTest:q,deleteABTest:M}}))}},initRecommendation:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"recommendation.".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({},i),e),{},{methods:{getPersonalizationStrategy:L,setPersonalizationStrategy:F}}))}}}}))}return ut.version="4.8.0",ut}()})),h=function(e,t){return(h=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)};function p(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}var y,m=function(e,t){this.target=t,this.type=e},b=function(e){function t(t,r){var n=e.call(this,"error",r)||this;return n.message=t.message,n.error=t,n}return p(t,e),t}(m),_=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 p(t,e),t}(m),w=function(){if("undefined"!=typeof WebSocket)return WebSocket},O={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},T=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?O.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?O.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),i=o.next();!i.done;i=o.next()){var a=i.value;this._callEventListener(e,a)}}catch(e){t={error:e}}finally{try{i&&!i.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,v(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,r=void 0===t?O.reconnectionDelayGrowFactor:t,n=e.minReconnectionDelay,o=void 0===n?O.minReconnectionDelay:n,i=e.maxReconnectionDelay,a=void 0===i?O.maxReconnectionDelay:i,u=0;return this._retryCount>0&&(u=o*Math.pow(r,this._retryCount-1))>a&&(u=a),this._debug("next delay",u),u},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?O.maxRetries:r,o=t.connectionTimeout,i=void 0===o?O.connectionTimeout:o,a=t.WebSocket,u=void 0===a?w():a;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}(u))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 u(t,e._protocols):new u(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),i))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new b(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 _(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}(),S=Object.freeze({__proto__:null,default:T}),x=new Uint8Array(16);function P(){if(!y&&!(y="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 y(x)}var I=/^(?:[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 E(e){return"string"==typeof e&&I.test(e)}for(var k,j,D=[],C=0;C<256;++C)D.push((C+256).toString(16).substr(1));function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(D[e[t+0]]+D[e[t+1]]+D[e[t+2]]+D[e[t+3]]+"-"+D[e[t+4]]+D[e[t+5]]+"-"+D[e[t+6]]+D[e[t+7]]+"-"+D[e[t+8]]+D[e[t+9]]+"-"+D[e[t+10]]+D[e[t+11]]+D[e[t+12]]+D[e[t+13]]+D[e[t+14]]+D[e[t+15]]).toLowerCase();if(!E(r))throw TypeError("Stringified UUID is invalid");return r}var N=0,R=0;function M(e){if(!E(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 U(e,t,r){function n(e,n,o,i){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=M(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),(a=r(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,o){i=i||0;for(var u=0;u<16;++u)o[i+u]=a[u];return o}return A(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function B(e){return 14+(e+64>>>9<<4)+1}function q(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function L(e,t,r,n,o,i){return q((a=q(q(t,e),q(n,i)))<<(u=o)|a>>>32-u,r);var a,u}function F(e,t,r,n,o,i,a){return L(t&r|~t&n,e,t,o,i,a)}function H(e,t,r,n,o,i,a){return L(t&n|r&~n,e,t,o,i,a)}function z(e,t,r,n,o,i,a){return L(t^r^n,e,t,o,i,a)}function W(e,t,r,n,o,i,a){return L(r^(t|~n),e,t,o,i,a)}var Y=U("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 i=e[o>>5]>>>o%32&255,a=parseInt(n.charAt(i>>>4&15)+n.charAt(15&i),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[B(t)-1]=t;for(var r=1732584193,n=-271733879,o=-1732584194,i=271733878,a=0;a<e.length;a+=16){var u=r,s=n,c=o,l=i;r=F(r,n,o,i,e[a],7,-680876936),i=F(i,r,n,o,e[a+1],12,-389564586),o=F(o,i,r,n,e[a+2],17,606105819),n=F(n,o,i,r,e[a+3],22,-1044525330),r=F(r,n,o,i,e[a+4],7,-176418897),i=F(i,r,n,o,e[a+5],12,1200080426),o=F(o,i,r,n,e[a+6],17,-1473231341),n=F(n,o,i,r,e[a+7],22,-45705983),r=F(r,n,o,i,e[a+8],7,1770035416),i=F(i,r,n,o,e[a+9],12,-1958414417),o=F(o,i,r,n,e[a+10],17,-42063),n=F(n,o,i,r,e[a+11],22,-1990404162),r=F(r,n,o,i,e[a+12],7,1804603682),i=F(i,r,n,o,e[a+13],12,-40341101),o=F(o,i,r,n,e[a+14],17,-1502002290),r=H(r,n=F(n,o,i,r,e[a+15],22,1236535329),o,i,e[a+1],5,-165796510),i=H(i,r,n,o,e[a+6],9,-1069501632),o=H(o,i,r,n,e[a+11],14,643717713),n=H(n,o,i,r,e[a],20,-373897302),r=H(r,n,o,i,e[a+5],5,-701558691),i=H(i,r,n,o,e[a+10],9,38016083),o=H(o,i,r,n,e[a+15],14,-660478335),n=H(n,o,i,r,e[a+4],20,-405537848),r=H(r,n,o,i,e[a+9],5,568446438),i=H(i,r,n,o,e[a+14],9,-1019803690),o=H(o,i,r,n,e[a+3],14,-187363961),n=H(n,o,i,r,e[a+8],20,1163531501),r=H(r,n,o,i,e[a+13],5,-1444681467),i=H(i,r,n,o,e[a+2],9,-51403784),o=H(o,i,r,n,e[a+7],14,1735328473),r=z(r,n=H(n,o,i,r,e[a+12],20,-1926607734),o,i,e[a+5],4,-378558),i=z(i,r,n,o,e[a+8],11,-2022574463),o=z(o,i,r,n,e[a+11],16,1839030562),n=z(n,o,i,r,e[a+14],23,-35309556),r=z(r,n,o,i,e[a+1],4,-1530992060),i=z(i,r,n,o,e[a+4],11,1272893353),o=z(o,i,r,n,e[a+7],16,-155497632),n=z(n,o,i,r,e[a+10],23,-1094730640),r=z(r,n,o,i,e[a+13],4,681279174),i=z(i,r,n,o,e[a],11,-358537222),o=z(o,i,r,n,e[a+3],16,-722521979),n=z(n,o,i,r,e[a+6],23,76029189),r=z(r,n,o,i,e[a+9],4,-640364487),i=z(i,r,n,o,e[a+12],11,-421815835),o=z(o,i,r,n,e[a+15],16,530742520),r=W(r,n=z(n,o,i,r,e[a+2],23,-995338651),o,i,e[a],6,-198630844),i=W(i,r,n,o,e[a+7],10,1126891415),o=W(o,i,r,n,e[a+14],15,-1416354905),n=W(n,o,i,r,e[a+5],21,-57434055),r=W(r,n,o,i,e[a+12],6,1700485571),i=W(i,r,n,o,e[a+3],10,-1894986606),o=W(o,i,r,n,e[a+10],15,-1051523),n=W(n,o,i,r,e[a+1],21,-2054922799),r=W(r,n,o,i,e[a+8],6,1873313359),i=W(i,r,n,o,e[a+15],10,-30611744),o=W(o,i,r,n,e[a+6],15,-1560198380),n=W(n,o,i,r,e[a+13],21,1309151649),r=W(r,n,o,i,e[a+4],6,-145523070),i=W(i,r,n,o,e[a+11],10,-1120210379),o=W(o,i,r,n,e[a+2],15,718787259),n=W(n,o,i,r,e[a+9],21,-343485551),r=q(r,u),n=q(n,s),o=q(o,c),i=q(i,l)}return[r,n,o,i]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(B(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}));function K(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function V(e,t){return e<<t|e>>>32-t}var G=U("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 i=e.length/4+2,a=Math.ceil(i/16),u=new Array(a),s=0;s<a;++s){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*s+4*l]<<24|e[64*s+4*l+1]<<16|e[64*s+4*l+2]<<8|e[64*s+4*l+3];u[s]=c}u[a-1][14]=8*(e.length-1)/Math.pow(2,32),u[a-1][14]=Math.floor(u[a-1][14]),u[a-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<a;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=u[f][h];for(var p=16;p<80;++p)d[p]=V(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var g=r[0],v=r[1],y=r[2],m=r[3],b=r[4],_=0;_<80;++_){var w=Math.floor(_/20),O=V(g,5)+K(w,v,y,m)+b+t[w]+d[_]>>>0;b=m,m=y,y=V(v,30)>>>0,v=g,g=O}r[0]=r[0]+g>>>0,r[1]=r[1]+v>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+m>>>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]]}));var Q=Object.freeze({__proto__:null,v1:function(e,t,r){var n=t&&r||0,o=t||new Array(16),i=(e=e||{}).node||k,a=void 0!==e.clockseq?e.clockseq:j;if(null==i||null==a){var u=e.random||(e.rng||P)();null==i&&(i=k=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==a&&(a=j=16383&(u[6]<<8|u[7]))}var s=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:R+1,l=s-N+(c-R)/1e4;if(l<0&&void 0===e.clockseq&&(a=a+1&16383),(l<0||s>N)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");N=s,R=c,j=a;var f=(1e4*(268435455&(s+=122192928e5))+c)%4294967296;o[n++]=f>>>24&255,o[n++]=f>>>16&255,o[n++]=f>>>8&255,o[n++]=255&f;var d=s/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++]=a>>>8|128,o[n++]=255&a;for(var h=0;h<6;++h)o[n+h]=i[h];return t||A(o)},v3:Y,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||P)();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 A(n)},v5:G,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!E(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:E,stringify:A,parse:M}),J=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheapestRate=void 0,t.getCheapestRate=function(e){if(0!==e.offers.length)return Math.min.apply(Math,e.offers.map((function(e){return e.nightlyRate})))}})),X=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 $(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Z(e){$(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 ee(e){$(1,arguments);var t=Z(e);return!isNaN(t)}var te={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"}};function re(e){return function(t){var r=t||{},n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ne={date:re({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:re({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:re({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ie(e){return function(t,r){var n,o=r||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;n=e.formattingValues[a]||e.formattingValues[i]}else{var u=e.defaultWidth,s=o.width?String(o.width):e.defaultWidth;n=e.values[s]||e.values[u]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function ae(e){return function(t,r){var n=String(t),o=r||{},i=o.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],u=n.match(a);if(!u)return null;var s,c=u[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth];return s="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}(l,(function(e){return e.test(c)})):function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}(l,(function(e){return e.test(c)})),s=e.valueCallback?e.valueCallback(s):s,{value:s=o.valueCallback?o.valueCallback(s):s,rest:n.slice(c.length)}}}var ue,se={code:"en-US",formatDistance:function(e,t,r){var n;return r=r||{},n="string"==typeof te[e]?te[e]:1===t?te[e].one:te[e].other.replace("{{count}}",t),r.addSuffix?r.comparison>0?"in "+n:n+" ago":n},formatLong:ne,formatRelative:function(e,t,r,n){return oe[e]},localize:{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:ie({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ie({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 Number(e)-1}}),month:ie({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:ie({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:ie({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"})},match:{ordinalNumber:(ue={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var r=String(e),n=t||{},o=r.match(ue.matchPattern);if(!o)return null;var i=o[0],a=r.match(ue.parsePattern);if(!a)return null;var u=ue.valueCallback?ue.valueCallback(a[0]):a[0];return{value:u=n.valueCallback?n.valueCallback(u):u,rest:r.slice(i.length)}}),era:ae({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:ae({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:ae({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:ae({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:ae({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"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ce(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 le(e,t){$(2,arguments);var r=Z(e).getTime(),n=ce(t);return new Date(r+n)}function fe(e,t){$(2,arguments);var r=ce(t);return le(e,-r)}function de(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var he=function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return de("yy"===t?n%100:n,t.length)},pe=function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):de(r+1,2)},ge=function(e,t){return de(e.getUTCDate(),t.length)},ve=function(e,t){return de(e.getUTCHours()%12||12,t.length)},ye=function(e,t){return de(e.getUTCHours(),t.length)},me=function(e,t){return de(e.getUTCMinutes(),t.length)},be=function(e,t){return de(e.getUTCSeconds(),t.length)},_e=function(e,t){var r=t.length,n=e.getUTCMilliseconds();return de(Math.floor(n*Math.pow(10,r-3)),t.length)},we=864e5;function Oe(e){$(1,arguments);var t=1,r=Z(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 Te(e){$(1,arguments);var t=Z(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=Oe(n),i=new Date(0);i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0);var a=Oe(i);return t.getTime()>=o.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function Se(e){$(1,arguments);var t=Te(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=Oe(r);return n}var xe=6048e5;function Pe(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,i=null==o?0:ce(o),a=null==r.weekStartsOn?i:ce(r.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Z(e),s=u.getUTCDay(),c=(s<a?7:0)+s-a;return u.setUTCDate(u.getUTCDate()-c),u.setUTCHours(0,0,0,0),u}function Ie(e,t){$(1,arguments);var r=Z(e,t),n=r.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,u=null==a?1:ce(a),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,s),c.setUTCHours(0,0,0,0);var l=Pe(c,t),f=new Date(0);f.setUTCFullYear(n,0,s),f.setUTCHours(0,0,0,0);var d=Pe(f,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Ee(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.firstWeekContainsDate,i=null==o?1:ce(o),a=null==r.firstWeekContainsDate?i:ce(r.firstWeekContainsDate),u=Ie(e,t),s=new Date(0);s.setUTCFullYear(u,0,a),s.setUTCHours(0,0,0,0);var c=Pe(s,t);return c}var ke=6048e5;var je="midnight",De="noon",Ce="morning",Ae="afternoon",Ne="evening",Re="night",Me={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"});case"GGGG":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 he(e,t)},Y:function(e,t,r,n){var o=Ie(e,n),i=o>0?o:1-o;return"YY"===t?de(i%100,2):"Yo"===t?r.ordinalNumber(i,{unit:"year"}):de(i,t.length)},R:function(e,t){return de(Te(e),t.length)},u:function(e,t){return de(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 de(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"});case"QQQQ":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 de(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"});case"qqqq":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 pe(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"});case"MMMM":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 de(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"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var o=function(e,t){$(1,arguments);var r=Z(e),n=Pe(r,t).getTime()-Ee(r,t).getTime();return Math.round(n/ke)+1}(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):de(o,t.length)},I:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(e),r=Oe(t).getTime()-Se(t).getTime();return Math.round(r/xe)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):de(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):ge(e,t)},D:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(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/we)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):de(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"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return de(i,2);case"eo":return r.ordinalNumber(i,{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"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return de(i,t.length);case"co":return r.ordinalNumber(i,{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"});case"cccc":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 de(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"});case"iiii":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":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,o=e.getUTCHours();switch(n=12===o?De:0===o?je:o/12>=1?"pm":"am",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"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,o=e.getUTCHours();switch(n=o>=17?Ne:o>=12?Ae:o>=4?Ce:Re,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"});case"BBBB":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 ve(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ye(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):me(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):be(e,t)},S:function(e,t){return _e(e,t)},X:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Be(o);case"XXXX":case"XX":return qe(o);case"XXXXX":case"XXX":default:return qe(o,":")}},x:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Be(o);case"xxxx":case"xx":return qe(o);case"xxxxx":case"xxx":default:return qe(o,":")}},O:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ue(o,":");case"OOOO":default:return"GMT"+qe(o,":")}},z:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ue(o,":");case"zzzz":default:return"GMT"+qe(o,":")}},t:function(e,t,r,n){var o=n._originalDate||e;return de(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,r,n){return de((n._originalDate||e).getTime(),t.length)}};function Ue(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),i=n%60;if(0===i)return r+String(o);var a=t||"";return r+String(o)+a+de(i,2)}function Be(e,t){return e%60==0?(e>0?"-":"+")+de(Math.abs(e)/60,2):qe(e,t)}function qe(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+de(Math.floor(o/60),2)+r+de(o%60,2)}function Le(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"});case"PPPP":default:return t.date({width:"full"})}}function Fe(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"});case"pppp":default:return t.time({width:"full"})}}var He={p:Fe,P:function(e,t){var r,n=e.match(/(P+)(p+)?/),o=n[1],i=n[2];if(!i)return Le(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;case"PPPP":default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",Le(o,t)).replace("{{time}}",Fe(i,t))}},ze=6e4;function We(e){return e.getTime()%ze}function Ye(e){var t=new Date(e.getTime()),r=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var n=r>0?(ze+We(t))%ze:We(t);return r*ze+n}var Ke=["D","DD"],Ve=["YY","YYYY"];function Ge(e){return-1!==Ke.indexOf(e)}function Qe(e){return-1!==Ve.indexOf(e)}function Je(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 Xe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ze=/^'([^]*?)'?$/,et=/''/g,tt=/[a-zA-Z]/;function rt(e){return e.match(Ze)[1].replace(et,"'")}var nt=Object.freeze({__proto__:null,default:function(e,t,r){$(2,arguments);var n=String(t),o=r||{},i=o.locale||se,a=i.options&&i.options.firstWeekContainsDate,u=null==a?1:ce(a),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=i.options&&i.options.weekStartsOn,l=null==c?0:ce(c),f=null==o.weekStartsOn?l:ce(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var d=Z(e);if(!ee(d))throw new RangeError("Invalid time value");var h=Ye(d),p=fe(d,h),g={firstWeekContainsDate:s,weekStartsOn:f,locale:i,_originalDate:d},v=n.match($e).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,He[t])(e,i.formatLong,g):e})).join("").match(Xe).map((function(r){if("''"===r)return"'";var n=r[0];if("'"===n)return rt(r);var a=Me[n];if(a)return!o.useAdditionalWeekYearTokens&&Qe(r)&&Je(r,t,e),!o.useAdditionalDayOfYearTokens&&Ge(r)&&Je(r,t,e),a(p,r,i.localize,g);if(n.match(tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return r})).join("");return v}});function ot(e,t){$(2,arguments);var r=Z(e),n=ce(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}var it=Object.freeze({__proto__:null,default:ot});function at(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,i=null==o?0:ce(o),a=null==r.weekStartsOn?i:ce(r.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var u=Z(e),s=u.getDay(),c=6+(s<a?-7:0)-(s-a);return u.setHours(0,0,0,0),u.setDate(u.getDate()+c),u}var ut=Object.freeze({__proto__:null,default:function(e){return $(1,arguments),at(e,{weekStartsOn:1})}});var st=Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=ce(t),n=7*r;return ot(e,n)}}),ct=36e5,lt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ft=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,dt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ht=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pt(e){var t,r={},n=e.split(lt.dateTimeDelimiter);if(n.length>2)return r;if(/:/.test(n[0])?(r.date=null,t=n[0]):(r.date=n[0],t=n[1],lt.timeZoneDelimiter.test(r.date)&&(r.date=e.split(lt.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var o=lt.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function gt(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:null};var o=n[1]&&parseInt(n[1]),i=n[2]&&parseInt(n[2]);return{year:null==i?o:100*i,restDateString:e.slice((n[1]||n[2]).length)}}function vt(e,t){if(null===t)return null;var r=e.match(ft);if(!r)return null;var n=!!r[4],o=yt(r[1]),i=yt(r[2])-1,a=yt(r[3]),u=yt(r[4]),s=yt(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,u,s)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var o=n.getUTCDay()||7,i=7*(t-1)+r+1-o;return n.setUTCDate(n.getUTCDate()+i),n}(t,u,s):new Date(NaN);var c=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(wt[t]||(Ot(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(Ot(e)?366:365)}(t,o)?(c.setUTCFullYear(t,i,Math.max(o,a)),c):new Date(NaN)}function yt(e){return e?parseInt(e):1}function mt(e){var t=e.match(dt);if(!t)return null;var r=bt(t[1]),n=bt(t[2]),o=bt(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*ct+6e4*n+1e3*o:NaN}function bt(e){return e&&parseFloat(e.replace(",","."))||0}function _t(e){if("Z"===e)return 0;var t=e.match(ht);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*ct+6e4*o):NaN}var wt=[31,null,31,30,31,30,31,31,30,31,30,31];function Ot(e){return e%400==0||e%4==0&&e%100}var Tt=Object.freeze({__proto__:null,default:function(e,t){$(1,arguments);var r=t||{},n=null==r.additionalDigits?2:ce(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,i=pt(e);if(i.date){var a=gt(i.date,n);o=vt(a.restDateString,a.year)}if(isNaN(o)||!o)return new Date(NaN);var u,s=o.getTime(),c=0;if(i.time&&(c=mt(i.time),isNaN(c)||null===c))return new Date(NaN);if(!i.timezone){var l=new Date(s+c),f=new Date(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds());return f.setFullYear(l.getUTCFullYear()),f}return u=_t(i.timezone),isNaN(u)?new Date(NaN):new Date(s+c+u)}}),St=r(f),xt=r(nt),Pt=r(it),It=r(ut),Et=r(st),kt=r(Tt),jt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var r=St.__importDefault(xt),n=St.__importDefault(Pt),o=St.__importDefault(It),i=St.__importDefault(Et),a=St.__importDefault(kt);function u(e){return a.default(e+" 12:00:00")}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=u;var s=function(e,t){return n.default(e,t)};t.getCheckInCheckOutDates=function(e,a){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h,g=u(r.default(new Date,t.DATE_FORMAT));c=void 0!==l?u(l):d?s(g,d):function(e){for(var a,s=e.daysFromNow,c=e.blockedDefaultDates,l=u(r.default(new Date,t.DATE_FORMAT)),f=o.default(n.default(l,s));a=r.default(f,t.DATE_FORMAT),c.includes(a);)f=i.default(f,1);return f}(a);var v=void 0===f?s(c,p):u(f);return{checkIn:r.default(c,t.DATE_FORMAT),checkOut:r.default(v,t.DATE_FORMAT)}}})),Dt=t((function(e,t){function r(e){void 0===e&&(e=[]);var t={},r={};e.forEach((function(e){var r=e[0],n=e[1],o=e[2],i=e[3];n&&(t[r]=X.calculateDiscount(n,o,i))}));var n=Math.min.apply(Math,Object.values(t)),o=Math.max.apply(Math,Object.values(t));return e.forEach((function(e){var i=e[0],a=e[1],u=(e[2],e[3]),s=a&&u&&u>0?o===n?1:(t[i]-n)/(o-n):void 0;void 0!==s&&(r[i]=Number(s.toFixed(2)))})),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getDealScores=t.calculateDealScores=void 0,t.calculateDealScores=r,t.getDealScores=function(e){var t=e.offset,n=e.anchorHotelId,o=e.hotelIds,i=e.hotelEntities,a=e.hotelOfferEntities;return r((void 0===n||t>0?o:St.__spreadArrays([n],o)).map((function(e){var t,r,n,o=i[e],u=a[e],s=null!==(t=null==o?void 0:o.regularPriceRange)&&void 0!==t?t:[],c=s[0],l=s[1];return[e,null===(n=null===(r=null==u?void 0:u.offers)||void 0===r?void 0:r[0])||void 0===n?void 0:n.nightlyRate,c,l]})))}})),Ct=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,i=e.length;o<i;)n[e[o]]=1,o+=1;for(var a in t)Object.prototype.hasOwnProperty.call(n,a)||(r[a]=t[a]);return r}}));function At(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=Ir[e],i=o?"function"==typeof o?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+i)}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 Nt(e){return!!e&&!!e[xr]}function Rt(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)===Er}(e)||Array.isArray(e)||!!e[Sr]||!!e.constructor[Sr]||Ht(e)||zt(e))}function Mt(e,t,r){void 0===r&&(r=!1),0===Ut(e)?(r?Object.keys:kr)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function Ut(e){var t=e[xr];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ht(e)?2:zt(e)?3:0}function Bt(e,t){return 2===Ut(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function qt(e,t){return 2===Ut(e)?e.get(t):e[t]}function Lt(e,t,r){var n=Ut(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function Ft(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ht(e){return _r&&e instanceof Map}function zt(e){return wr&&e instanceof Set}function Wt(e){return e.o||e.t}function Yt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=jr(e);delete t[xr];for(var r=kr(t),n=0;n<r.length;n++){var o=r[n],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Kt(e,t){return void 0===t&&(t=!1),Gt(e)||Nt(e)||!Rt(e)||(Ut(e)>1&&(e.set=e.add=e.clear=e.delete=Vt),Object.freeze(e),t&&Mt(e,(function(e,t){return Kt(t,!0)}),!0)),e}function Vt(){At(2)}function Gt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Qt(e){var t=Dr[e];return t||At(18,e),t}function Jt(e,t){Dr[e]||(Dr[e]=t)}function Xt(){return"production"===process.env.NODE_ENV||mr||At(0),mr}function $t(e,t){t&&(Qt("Patches"),e.u=[],e.s=[],e.v=t)}function Zt(e){er(e),e.p.forEach(rr),e.p=null}function er(e){e===mr&&(mr=e.l)}function tr(e){return mr={p:[],l:mr,h:e,m:!0,_:0}}function rr(e){var t=e[xr];0===t.i||1===t.i?t.j():t.O=!0}function nr(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||Qt("ES5").S(t,e,n),n?(r[xr].P&&(Zt(t),At(4)),Rt(e)&&(e=or(t,e),t.l||ar(t,e)),t.u&&Qt("Patches").M(r[xr],e,t.u,t.s)):e=or(t,r,[]),Zt(t),t.u&&t.v(t.u,t.s),e!==Tr?e:void 0}function or(e,t,r){if(Gt(t))return t;var n=t[xr];if(!n)return Mt(t,(function(o,i){return ir(e,n,t,o,i,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return ar(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=Yt(n.k):n.o;Mt(3===n.i?new Set(o):o,(function(t,i){return ir(e,n,o,t,i,r)})),ar(e,o,!1),r&&e.u&&Qt("Patches").R(n,r,e.u,e.s)}return n.o}function ir(e,t,r,n,o,i){if("production"!==process.env.NODE_ENV&&o===r&&At(5),Nt(o)){var a=or(e,o,i&&t&&3!==t.i&&!Bt(t.D,n)?i.concat(n):void 0);if(Lt(r,n,a),!Nt(a))return;e.m=!1}if(Rt(o)&&!Gt(o)){if(!e.h.F&&e._<1)return;or(e,o),t&&t.A.l||ar(e,o)}}function ar(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&Kt(t,r)}function ur(e,t){var r=e[xr];return(r?Wt(r):e)[t]}function sr(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 cr(e){e.P||(e.P=!0,e.l&&cr(e.l))}function lr(e){e.o||(e.o=Yt(e.t))}function fr(e,t,r){var n=Ht(t)?Qt("MapSet").N(t,r):zt(t)?Qt("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:Xt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,i=Cr;r&&(o=[n],i=Ar);var a=Proxy.revocable(o,i),u=a.revoke,s=a.proxy;return n.k=s,n.j=u,s}(t,r):Qt("ES5").J(t,r);return(r?r.A:Xt()).p.push(n),n}function dr(e){return Nt(e)||At(22,e),function e(t){if(!Rt(t))return t;var r,n=t[xr],o=Ut(t);if(n){if(!n.P&&(n.i<4||!Qt("ES5").K(n)))return n.t;n.I=!0,r=hr(t,o),n.I=!1}else r=hr(t,o);return Mt(r,(function(t,o){n&&qt(n.t,t)===o||Lt(r,t,e(o))})),3===o?new Set(r):r}(e)}function hr(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Yt(e)}function pr(){function e(e,t){var r=i[e];return r?r.enumerable=t:i[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[xr];return"production"!==process.env.NODE_ENV&&o(t),Cr.get(t,e)},set:function(t){var r=this[xr];"production"!==process.env.NODE_ENV&&o(r),Cr.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][xr];if(!o.P)switch(o.i){case 5:n(o)&&cr(o);break;case 4:r(o)&&cr(o)}}}function r(e){for(var t=e.t,r=e.k,n=kr(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==xr){var a=t[i];if(void 0===a&&!Bt(t,i))return!0;var u=r[i],s=u&&u[xr];if(s?s.t!==a:!Ft(u,a))return!0}}var c=!!t[xr];return n.length!==kr(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);return!(!r||r.get)}function o(e){e.O&&At(3,JSON.stringify(Wt(e)))}var i={};Jt("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 i=jr(r);delete i[xr];for(var a=kr(i),u=0;u<a.length;u++){var s=a[u];i[s]=e(s,t||!!i[s].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,t),i={i:n?5:4,A:r?r.A:Xt(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,xr,{value:i,writable:!0}),o},S:function(e,r,o){o?Nt(r)&&r[xr].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[xr];if(r){var o=r.t,i=r.k,a=r.D,u=r.i;if(4===u)Mt(i,(function(t){t!==xr&&(void 0!==o[t]||Bt(o,t)?a[t]||e(i[t]):(a[t]=!0,cr(r)))})),Mt(o,(function(e){void 0!==i[e]||Bt(i,e)||(a[e]=!1,cr(r))}));else if(5===u){if(n(r)&&(cr(r),a.length=!0),i.length<o.length)for(var s=i.length;s<o.length;s++)a[s]=!1;else for(var c=o.length;c<i.length;c++)a[c]=!0;for(var l=Math.min(i.length,o.length),f=0;f<l;f++)void 0===a[f]&&e(i[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}function gr(){function e(t){if(!Rt(t))return t;if(Array.isArray(t))return t.map(e);if(Ht(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(zt(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 Bt(t,Sr)&&(r[Sr]=t[Sr]),r}function t(t){return Nt(t)?e(t):t}var r="add";Jt("Patches",{$:function(t,n){return n.forEach((function(n){for(var o=n.path,i=n.op,a=t,u=0;u<o.length-1;u++){var s=Ut(a),c=""+o[u];0!==s&&1!==s||"__proto__"!==c&&"constructor"!==c||At(24),"function"==typeof a&&"prototype"===c&&At(24),"object"!=typeof(a=qt(a,c))&&At(15,o.join("/"))}var l=Ut(a),f=e(n.value),d=o[o.length-1];switch(i){case"replace":switch(l){case 2:return a.set(d,f);case 3:At(16);default:return a[d]=f}case r:switch(l){case 1:return a.splice(d,0,f);case 2:return a.set(d,f);case 3:return a.add(f);default:return a[d]=f}case"remove":switch(l){case 1:return a.splice(d,1);case 2:return a.delete(d);case 3:return a.delete(n.value);default:return delete a[d]}default:At(17,i)}})),t},R:function(e,n,o,i){switch(e.i){case 0:case 4:case 2:return function(e,n,o,i){var a=e.t,u=e.o;Mt(e.D,(function(e,s){var c=qt(a,e),l=qt(u,e),f=s?Bt(a,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}),i.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,i);case 5:case 1:return function(e,n,o,i){var a=e.t,u=e.D,s=e.o;if(s.length<a.length){var c=[s,a];a=c[0],s=c[1];var l=[i,o];o=l[0],i=l[1]}for(var f=0;f<a.length;f++)if(u[f]&&s[f]!==a[f]){var d=n.concat([f]);o.push({op:"replace",path:d,value:t(s[f])}),i.push({op:"replace",path:d,value:t(a[f])})}for(var h=a.length;h<s.length;h++){var p=n.concat([h]);o.push({op:r,path:p,value:t(s[h])})}a.length<s.length&&i.push({op:"replace",path:n.concat(["length"]),value:a.length})}(e,n,o,i);case 3:return function(e,t,n,o){var i=e.t,a=e.o,u=0;i.forEach((function(e){if(!a.has(e)){var i=t.concat([u]);n.push({op:"remove",path:i,value:e}),o.unshift({op:r,path:i,value:e})}u++})),u=0,a.forEach((function(e){if(!i.has(e)){var a=t.concat([u]);n.push({op:r,path:a,value:e}),o.unshift({op:"remove",path:a,value:e})}u++}))}(e,n,o,i)}},M:function(e,t,r,n){r.push({op:"replace",path:[],value:t===Tr?void 0:t}),n.push({op:"replace",path:[],value:e.t})}})}function vr(){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(Rt(t)){var r=fr(e.A.h,t,e);e.p.set(t,r),e.o.add(r)}else e.o.add(t)})))}function n(e){e.O&&At(3,JSON.stringify(Wt(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)},i=function(){function r(e,t){return this[xr]={i:2,l:t,A:t?t.A:Xt(),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 Wt(this[xr]).size}}),o.has=function(e){return Wt(this[xr]).has(e)},o.set=function(e,r){var o=this[xr];return n(o),Wt(o).has(e)&&Wt(o).get(e)===r||(t(o),cr(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[xr];return n(r),t(r),cr(r),r.D.set(e,!1),r.o.delete(e),!0},o.clear=function(){var e=this[xr];n(e),Wt(e).size&&(t(e),cr(e),e.D=new Map,Mt(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var r=this;Wt(this[xr]).forEach((function(n,o){e.call(t,r.get(o),o,r)}))},o.get=function(e){var r=this[xr];n(r);var o=Wt(r).get(e);if(r.I||!Rt(o))return o;if(o!==r.t.get(e))return o;var i=fr(r.A.h,o,r);return t(r),r.o.set(e,i),i},o.keys=function(){return Wt(this[xr]).keys()},o.values=function(){var e,t=this,r=this.keys();return(e={})[Pr]=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={})[Pr]=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[Pr]=function(){return this.entries()},r}(),a=function(){function t(e,t){return this[xr]={i:3,l:t,A:t?t.A:Xt(),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 Wt(this[xr]).size}}),o.has=function(e){var t=this[xr];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[xr];return n(t),this.has(e)||(r(t),cr(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[xr];return n(t),r(t),cr(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[xr];n(e),Wt(e).size&&(r(e),cr(e),e.o.clear())},o.values=function(){var e=this[xr];return n(e),r(e),e.o.values()},o.entries=function(){var e=this[xr];return n(e),r(e),e.o.entries()},o.keys=function(){return this.values()},o[Pr]=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}();Jt("MapSet",{N:function(e,t){return new i(e,t)},T:function(e,t){return new a(e,t)}})}var yr,mr,br="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),_r="undefined"!=typeof Map,wr="undefined"!=typeof Set,Or="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Tr=br?Symbol.for("immer-nothing"):((yr={})["immer-nothing"]=!0,yr),Sr=br?Symbol.for("immer-draftable"):"__$immer_draftable",xr=br?Symbol.for("immer-state"):"__$immer_state",Pr="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Ir={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"},Er=""+Object.prototype.constructor,kr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,jr=Object.getOwnPropertyDescriptors||function(e){var t={};return kr(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},Dr={},Cr={get:function(e,t){if(t===xr)return e;var r=Wt(e);if(!Bt(r,t))return function(e,t,r){var n,o=sr(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||!Rt(n)?n:n===ur(e.t,t)?(lr(e),e.o[t]=fr(e.A.h,n,e)):n},has:function(e,t){return t in Wt(e)},ownKeys:function(e){return Reflect.ownKeys(Wt(e))},set:function(e,t,r){var n=sr(Wt(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=ur(Wt(e),t),i=null==o?void 0:o[xr];if(i&&i.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(Ft(r,o)&&(void 0!==r||Bt(e.t,t)))return!0;lr(e),cr(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!==ur(e.t,t)||t in e.t?(e.D[t]=!1,lr(e),cr(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Wt(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(){At(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){At(12)}},Ar={};Mt(Cr,(function(e,t){Ar[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ar.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&At(13),Cr.deleteProperty.call(this,e[0],t)},Ar.set=function(e,t,r){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&At(14),Cr.set.call(this,e[0],t,r,e[0])};var Nr=function(){function e(e){var t=this;this.g=Or,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,a=Array(n>1?n-1:0),u=1;u<n;u++)a[u-1]=arguments[u];return i.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(a))}))}}var a;if("function"!=typeof r&&At(6),void 0!==n&&"function"!=typeof n&&At(7),Rt(e)){var u=tr(t),s=fr(t,e,void 0),c=!0;try{a=r(s),c=!1}finally{c?Zt(u):er(u)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return $t(u,n),nr(e,u)}),(function(e){throw Zt(u),e})):($t(u,n),nr(a,u))}if(!e||"object"!=typeof e){if((a=r(e))===Tr)return;return void 0===a&&(a=e),t.F&&Kt(a,!0),a}At(21,e)},this.produceWithPatches=function(e,r){return"function"==typeof e?function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(o))}))}:[t.produce(e,r,(function(e,t){n=e,o=t})),n,o];var 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){Rt(e)||At(8),Nt(e)&&(e=dr(e));var t=tr(this),r=fr(this,e,void 0);return r[xr].C=!0,er(t),r},t.finishDraft=function(e,t){var r=e&&e[xr];"production"!==process.env.NODE_ENV&&(r&&r.C||At(9),r.I&&At(10));var n=r.A;return $t(n,t),nr(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Or&&At(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}}var o=Qt("Patches").$;return Nt(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(r+1))}))},e}(),Rr=new Nr,Mr=Rr.produce,Ur=Rr.produceWithPatches.bind(Rr),Br=Rr.setAutoFreeze.bind(Rr),qr=Rr.setUseProxies.bind(Rr),Lr=Rr.applyPatches.bind(Rr),Fr=Rr.createDraft.bind(Rr),Hr=Rr.finishDraft.bind(Rr),zr=r(Object.freeze({__proto__:null,default:Mr,Immer:Nr,applyPatches:Lr,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:Fr,current:dr,enableAllPlugins:function(){pr(),vr(),gr()},enableES5:pr,enableMapSet:vr,enablePatches:gr,finishDraft:Hr,freeze:Kt,immerable:Sr,isDraft:Nt,isDraftable:Rt,nothing:Tr,original:function(e){return Nt(e)||At(23,e),e[xr].t},produce:Mr,produceWithPatches:Ur,setAutoFreeze:Br,setUseProxies:qr})),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=zr.produce(t,e)}}}})),Yr=t((function(e,t){e.exports=function e(t,r,o){function i(u,s){if(!r[u]){if(!t[u]){if(!s&&n)return n();if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=r[u]={exports:{}};t[u][0].call(c.exports,(function(e){return i(t[u][1][e]||e)}),c,c.exports,e,t,r,o)}return r[u].exports}for(var a=n,u=0;u<o.length;u++)i(o[u]);return i}({1:[function(e,t,r){(function(n,o,i,a,u,s,c,l,f){var d=e("crypto");function h(e,t){return function(e,t){var r;if(void 0===(r="passthrough"!==t.algorithm?d.createHash(t.algorithm):new b).write&&(r.write=r.update,r.end=r.update),m(t,r).dispatch(e),r.update||r.end(""),r.digest)return r.digest("buffer"===t.encoding?void 0:t.encoding);var n=r.read();return"buffer"!==t.encoding?n.toString(t.encoding):n}(e,t=v(e,t))}(r=t.exports=h).sha1=function(e){return h(e)},r.keys=function(e){return h(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(e){return h(e,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(e){return h(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=d.getHashes?d.getHashes().slice():["sha1","md5"];p.push("passthrough");var g=["buffer","hex","binary","base64"];function v(e,t){t=t||{};var r={};if(r.algorithm=t.algorithm||"sha1",r.encoding=t.encoding||"hex",r.excludeValues=!!t.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=!0===t.ignoreUnknown,r.respectType=!1!==t.respectType,r.respectFunctionNames=!1!==t.respectFunctionNames,r.respectFunctionProperties=!1!==t.respectFunctionProperties,r.unorderedArrays=!0===t.unorderedArrays,r.unorderedSets=!1!==t.unorderedSets,r.unorderedObjects=!1!==t.unorderedObjects,r.replacer=t.replacer||void 0,r.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var n=0;n<p.length;++n)p[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=p[n]);if(-1===p.indexOf(r.algorithm))throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(r.encoding)&&"passthrough"!==r.algorithm)throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+g.join(", "));return r}function y(e){if("function"==typeof e)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}function m(e,t,r){function n(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return r=r||[],{dispatch:function(t){return e.replacer&&(t=e.replacer(t)),this["_"+(null===t?"null":typeof t)](t)},_object:function(t){var o,a=Object.prototype.toString.call(t),u=/\[object (.*)\]/i.exec(a);if(u=(u=u?u[1]:"unknown:["+a+"]").toLowerCase(),0<=(o=r.indexOf(t)))return this.dispatch("[CIRCULAR:"+o+"]");if(r.push(t),void 0!==i&&i.isBuffer&&i.isBuffer(t))return n("buffer:"),n(t);if("object"===u||"function"===u||"asyncfunction"===u){var s=Object.keys(t);e.unorderedObjects&&(s=s.sort()),!1===e.respectType||y(t)||s.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(s=s.filter((function(t){return!e.excludeKeys(t)}))),n("object:"+s.length+":");var c=this;return s.forEach((function(r){c.dispatch(r),n(":"),e.excludeValues||c.dispatch(t[r]),n(",")}))}if(!this["_"+u]){if(e.ignoreUnknown)return n("["+u+"]");throw new Error('Unknown object type "'+u+'"')}this["_"+u](t)},_array:function(t,o){o=void 0!==o?o:!1!==e.unorderedArrays;var i=this;if(n("array:"+t.length+":"),!o||t.length<=1)return t.forEach((function(e){return i.dispatch(e)}));var a=[],u=t.map((function(t){var n=new b,o=r.slice();return m(e,n,o).dispatch(t),a=a.concat(o.slice(r.length)),n.read().toString()}));return r=r.concat(a),u.sort(),this._array(u,!1)},_date:function(e){return n("date:"+e.toJSON())},_symbol:function(e){return n("symbol:"+e.toString())},_error:function(e){return n("error:"+e.toString())},_boolean:function(e){return n("bool:"+e.toString())},_string:function(e){n("string:"+e.length+":"),n(e.toString())},_function:function(t){n("fn:"),y(t)?this.dispatch("[native]"):this.dispatch(t.toString()),!1!==e.respectFunctionNames&&this.dispatch("function-name:"+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return n("number:"+e.toString())},_xml:function(e){return n("xml:"+e.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(e){return n("regex:"+e.toString())},_uint8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return n("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return n("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return n("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return n("url:"+e.toString())},_map:function(t){n("map:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_set:function(t){n("set:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_file:function(e){return n("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return n("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return n("domwindow")},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function b(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}r.writeToStream=function(e,t,r){return void 0===r&&(r=t,t={}),m(t=v(e,t),r).dispatch(e)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_5812b7fb.js","/")},{buffer:3,crypto:5,lYpoI2:10}],2:[function(e,t,r){(function(e,t,n,o,i,a,u,s,c){!function(e){var t="undefined"!=typeof Uint8Array?Uint8Array:Array,r="+".charCodeAt(0),n="/".charCodeAt(0),o="0".charCodeAt(0),i="a".charCodeAt(0),a="A".charCodeAt(0),u="-".charCodeAt(0),s="_".charCodeAt(0);function c(e){var t=e.charCodeAt(0);return t===r||t===u?62:t===n||t===s?63:t<o?-1:t<o+10?t-o+26+26:t<a+26?t-a:t<i+26?t-i+26:void 0}e.toByteArray=function(e){var r,n;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.length,i="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0,a=new t(3*e.length/4-i),u=0<i?e.length-4:e.length,s=0;function l(e){a[s++]=e}for(r=0;r<u;r+=4,0)l((16711680&(n=c(e.charAt(r))<<18|c(e.charAt(r+1))<<12|c(e.charAt(r+2))<<6|c(e.charAt(r+3))))>>16),l((65280&n)>>8),l(255&n);return 2==i?l(255&(n=c(e.charAt(r))<<2|c(e.charAt(r+1))>>4)):1==i&&(l((n=c(e.charAt(r))<<10|c(e.charAt(r+1))<<4|c(e.charAt(r+2))>>2)>>8&255),l(255&n)),a},e.fromByteArray=function(e){var t,r,n,o,i=e.length%3,a="";function u(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,n=e.length-i;t<n;t+=3)a+=u((o=r=(e[t]<<16)+(e[t+1]<<8)+e[t+2])>>18&63)+u(o>>12&63)+u(o>>6&63)+u(63&o);switch(i){case 1:a+=u((r=e[e.length-1])>>2),a+=u(r<<4&63),a+="==";break;case 2:a+=u((r=(e[e.length-2]<<8)+e[e.length-1])>>10),a+=u(r>>4&63),a+=u(r<<2&63),a+="="}return a}}(void 0===r?this.base64js={}:r)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,r){(function(t,n,o,i,a,u,s,c,l){var f=e("base64-js"),d=e("ieee754");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var n,i,a,u,s,c=typeof e;if("base64"===t&&"string"==c)for(e=(n=e).trim?n.trim():n.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==c)i=j(e);else if("string"==c)i=o.byteLength(e,t);else{if("object"!=c)throw new Error("First argument needs to be a number, array or string.");i=j(e.length)}if(o._useTypedArrays?a=o._augment(new Uint8Array(i)):((a=this).length=i,a._isBuffer=!0),o._useTypedArrays&&"number"==typeof e.byteLength)a._set(e);else if(D(s=e)||o.isBuffer(s)||s&&"object"==typeof s&&"number"==typeof s.length)for(u=0;u<i;u++)o.isBuffer(e)?a[u]=e.readUInt8(u):a[u]=e[u];else if("string"==c)a.write(e,0,t);else if("number"==c&&!o._useTypedArrays&&!r)for(u=0;u<i;u++)a[u]=0;return a}function h(e,t,r,n){return o._charsWritten=R(function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function p(e,t,r,n){return o._charsWritten=R(function(e){for(var t,r,n,o=[],i=0;i<e.length;i++)r=(t=e.charCodeAt(i))>>8,n=t%256,o.push(n),o.push(r);return o}(t),e,r,n)}function g(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;o++)n+=String.fromCharCode(e[o]);return n}function v(e,t,r,n){n||(L("boolean"==typeof r,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+1<e.length,"Trying to read beyond buffer length"));var o,i=e.length;if(!(i<=t))return r?(o=e[t],t+1<i&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<i&&(o|=e[t+1])),o}function y(e,t,r,n){n||(L("boolean"==typeof r,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+3<e.length,"Trying to read beyond buffer length"));var o,i=e.length;if(!(i<=t))return r?(t+2<i&&(o=e[t+2]<<16),t+1<i&&(o|=e[t+1]<<8),o|=e[t],t+3<i&&(o+=e[t+3]<<24>>>0)):(t+1<i&&(o=e[t+1]<<16),t+2<i&&(o|=e[t+2]<<8),t+3<i&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}function m(e,t,r,n){if(n||(L("boolean"==typeof r,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=v(e,t,r,!0);return 32768&o?-1*(65535-o+1):o}}function b(e,t,r,n){if(n||(L("boolean"==typeof r,"missing or invalid endian"),L(null!=t,"missing offset"),L(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=y(e,t,r,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function _(e,t,r,n){return n||(L("boolean"==typeof r,"missing or invalid endian"),L(t+3<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,23,4)}function w(e,t,r,n){return n||(L("boolean"==typeof r,"missing or invalid endian"),L(t+7<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,52,8)}function O(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+1<e.length,"trying to write beyond buffer length"),U(t,65535));var i=e.length;if(!(i<=r))for(var a=0,u=Math.min(i-r,2);a<u;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function T(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+3<e.length,"trying to write beyond buffer length"),U(t,4294967295));var i=e.length;if(!(i<=r))for(var a=0,u=Math.min(i-r,4);a<u;a++)e[r+a]=t>>>8*(n?a:3-a)&255}function S(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+1<e.length,"Trying to write beyond buffer length"),B(t,32767,-32768)),e.length<=r||O(e,0<=t?t:65535+t+1,r,n,o)}function x(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+3<e.length,"Trying to write beyond buffer length"),B(t,2147483647,-2147483648)),e.length<=r||T(e,0<=t?t:4294967295+t+1,r,n,o)}function P(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+3<e.length,"Trying to write beyond buffer length"),q(t,34028234663852886e22,-34028234663852886e22)),e.length<=r||d.write(e,t,r,n,23,4)}function I(e,t,r,n,o){o||(L(null!=t,"missing value"),L("boolean"==typeof n,"missing or invalid endian"),L(null!=r,"missing offset"),L(r+7<e.length,"Trying to write beyond buffer length"),q(t,17976931348623157e292,-17976931348623157e292)),e.length<=r||d.write(e,t,r,n,52,8)}r.Buffer=o,r.SlowBuffer=o,r.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=A(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=N(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},o.concat=function(e,t){if(L(D(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new o(0);if(1===e.length)return e[0];if("number"!=typeof t)for(i=t=0;i<e.length;i++)t+=e[i].length;for(var r=new o(t),n=0,i=0;i<e.length;i++){var a=e[i];a.copy(r,n),n+=a.length}return r},o.prototype.write=function(e,t,r,n){var i;isFinite(t)?isFinite(r)||(n=r,r=void 0):(i=n,n=t,t=r,r=i),t=Number(t)||0;var a,u,s,c,l,f,d,g,v,y=this.length-t;switch((!r||y<(r=Number(r)))&&(r=y),n=String(n||"utf8").toLowerCase()){case"hex":a=function(e,t,r,n){r=Number(r)||0;var i=e.length-r;(!n||i<(n=Number(n)))&&(n=i);var a=t.length;L(a%2==0,"Invalid hex string"),a/2<n&&(n=a/2);for(var u=0;u<n;u++){var s=parseInt(t.substr(2*u,2),16);L(!isNaN(s),"Invalid hex string"),e[r+u]=s}return o._charsWritten=2*u,u}(this,e,t,r);break;case"utf8":case"utf-8":f=this,d=e,g=t,v=r,a=o._charsWritten=R(A(d),f,g,v);break;case"ascii":case"binary":a=h(this,e,t,r);break;case"base64":u=this,s=e,c=t,l=r,a=o._charsWritten=R(N(s),u,c,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":a=p(this,e,t,r);break;default:throw new Error("Unknown encoding")}return a},o.prototype.toString=function(e,t,r){var n,o,i,a,u=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(r=void 0!==r?Number(r):r=u.length)===t)return"";switch(e){case"hex":n=function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||n<r)&&(r=n);for(var o="",i=t;i<r;i++)o+=C(e[i]);return o}(u,t,r);break;case"utf8":case"utf-8":n=function(e,t,r){var n="",o="";r=Math.min(e.length,r);for(var i=t;i<r;i++)e[i]<=127?(n+=M(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return n+M(o)}(u,t,r);break;case"ascii":case"binary":n=g(u,t,r);break;case"base64":o=u,a=r,n=0===(i=t)&&a===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(i,a));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=function(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(u,t,r);break;default:throw new Error("Unknown encoding")}return n},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,r,n){if(r=r||0,n||0===n||(n=this.length),t=t||0,n!==r&&0!==e.length&&0!==this.length){L(r<=n,"sourceEnd < sourceStart"),L(0<=t&&t<e.length,"targetStart out of bounds"),L(0<=r&&r<this.length,"sourceStart out of bounds"),L(0<=n&&n<=this.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(i<100||!o._useTypedArrays)for(var a=0;a<i;a++)e[a+t]=this[a+r];else e._set(this.subarray(r,r+i),t)}},o.prototype.slice=function(e,t){var r=this.length;if(e=k(e,r,0),t=k(t,r,r),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var n=t-e,i=new o(n,void 0,!0),a=0;a<n;a++)i[a]=this[a+e];return i},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.readUInt8=function(e,t){if(t||(L(null!=e,"missing offset"),L(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return v(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return v(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(L(null!=e,"missing offset"),L(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return b(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return b(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return _(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return _(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return w(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return w(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,r){r||(L(null!=e,"missing value"),L(null!=t,"missing offset"),L(t<this.length,"trying to write beyond buffer length"),U(e,255)),t>=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,r){O(this,e,t,!0,r)},o.prototype.writeUInt16BE=function(e,t,r){O(this,e,t,!1,r)},o.prototype.writeUInt32LE=function(e,t,r){T(this,e,t,!0,r)},o.prototype.writeUInt32BE=function(e,t,r){T(this,e,t,!1,r)},o.prototype.writeInt8=function(e,t,r){r||(L(null!=e,"missing value"),L(null!=t,"missing offset"),L(t<this.length,"Trying to write beyond buffer length"),B(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},o.prototype.writeInt16LE=function(e,t,r){S(this,e,t,!0,r)},o.prototype.writeInt16BE=function(e,t,r){S(this,e,t,!1,r)},o.prototype.writeInt32LE=function(e,t,r){x(this,e,t,!0,r)},o.prototype.writeInt32BE=function(e,t,r){x(this,e,t,!1,r)},o.prototype.writeFloatLE=function(e,t,r){P(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){P(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){I(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){I(this,e,t,!1,r)},o.prototype.fill=function(e,t,r){if(e=e||0,t=t||0,r=r||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),L("number"==typeof e&&!isNaN(e),"value is not a number"),L(t<=r,"end < start"),r!==t&&0!==this.length){L(0<=t&&t<this.length,"start out of bounds"),L(0<=r&&r<=this.length,"end out of bounds");for(var n=t;n<r;n++)this[n]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,n=0;n<t;n++)if(e[n]=C(this[n]),n===r.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;t<r;t+=1)e[t]=this[t];return e.buffer};var E=o.prototype;function k(e,t,r){return"number"!=typeof e?r:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function j(e){return(e=~~Math.ceil(+e))<0?0:e}function D(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function C(e){return e<16?"0"+e.toString(16):e.toString(16)}function A(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=127)t.push(e.charCodeAt(r));else{var o=r;55296<=n&&n<=57343&&r++;for(var i=encodeURIComponent(e.slice(o,r+1)).substr(1).split("%"),a=0;a<i.length;a++)t.push(parseInt(i[a],16))}}return t}function N(e){return f.toByteArray(e)}function R(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function U(e,t){L("number"==typeof e,"cannot write a non-number as a number"),L(0<=e,"specified a negative value for writing an unsigned value"),L(e<=t,"value is larger than maximum value for type"),L(Math.floor(e)===e,"value has a fractional component")}function B(e,t,r){L("number"==typeof e,"cannot write a non-number as a number"),L(e<=t,"value larger than maximum allowed value"),L(r<=e,"value smaller than minimum allowed value"),L(Math.floor(e)===e,"value has a fractional component")}function q(e,t,r){L("number"==typeof e,"cannot write a non-number as a number"),L(e<=t,"value larger than maximum allowed value"),L(r<=e,"value smaller than minimum allowed value")}function L(e,t){if(!e)throw new Error(t||"Failed assertion")}o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=E.get,e.set=E.set,e.write=E.write,e.toString=E.toString,e.toLocaleString=E.toString,e.toJSON=E.toJSON,e.copy=E.copy,e.slice=E.slice,e.readUInt8=E.readUInt8,e.readUInt16LE=E.readUInt16LE,e.readUInt16BE=E.readUInt16BE,e.readUInt32LE=E.readUInt32LE,e.readUInt32BE=E.readUInt32BE,e.readInt8=E.readInt8,e.readInt16LE=E.readInt16LE,e.readInt16BE=E.readInt16BE,e.readInt32LE=E.readInt32LE,e.readInt32BE=E.readInt32BE,e.readFloatLE=E.readFloatLE,e.readFloatBE=E.readFloatBE,e.readDoubleLE=E.readDoubleLE,e.readDoubleBE=E.readDoubleBE,e.writeUInt8=E.writeUInt8,e.writeUInt16LE=E.writeUInt16LE,e.writeUInt16BE=E.writeUInt16BE,e.writeUInt32LE=E.writeUInt32LE,e.writeUInt32BE=E.writeUInt32BE,e.writeInt8=E.writeInt8,e.writeInt16LE=E.writeInt16LE,e.writeInt16BE=E.writeInt16BE,e.writeInt32LE=E.writeInt32LE,e.writeInt32BE=E.writeInt32BE,e.writeFloatLE=E.writeFloatLE,e.writeFloatBE=E.writeFloatBE,e.writeDoubleLE=E.writeDoubleLE,e.writeDoubleBE=E.writeDoubleBE,e.fill=E.fill,e.inspect=E.inspect,e.toArrayBuffer=E.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(e,t,r){(function(r,n,o,i,a,u,s,c,l){o=e("buffer").Buffer;var f=4,d=new o(f);d.fill(0),t.exports={hash:function(e,t,r,n){return o.isBuffer(e)||(e=new o(e)),function(e,t,r){for(var n=new o(t),i=r?n.writeInt32BE:n.writeInt32LE,a=0;a<e.length;a++)i.call(n,e[a],4*a,!0);return n}(t(function(e,t){var r;e.length%f!=0&&(r=e.length+(f-e.length%f),e=o.concat([e,d],r));for(var n=[],i=t?e.readInt32BE:e.readInt32LE,a=0;a<e.length;a+=f)n.push(i.call(e,a));return n}(e,n),8*e.length),r,n)}}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(e,t,r){(function(t,n,o,i,a,u,s,c,l){o=e("buffer").Buffer;var f=e("./sha"),d=e("./sha256"),h=e("./rng"),p={sha1:f,sha256:d,md5:e("./md5")},g=64,v=new o(g);function y(e,t){var r=p[e=e||"sha1"],n=[];return r||m("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),n.push(e),e.length,this},digest:function(e){var i=o.concat(n),a=t?function(e,t,r){o.isBuffer(t)||(t=new o(t)),o.isBuffer(r)||(r=new o(r)),t.length>g?t=e(t):t.length<g&&(t=o.concat([t,v],g));for(var n=new o(g),i=new o(g),a=0;a<g;a++)n[a]=54^t[a],i[a]=92^t[a];var u=e(o.concat([n,r]));return e(o.concat([i,u]))}(r,t,i):r(i);return n=null,e?a.toString(e):a}}}function m(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}v.fill(0),r.createHash=function(e){return y(e)},r.createHmac=y,r.randomBytes=function(e,t){if(!t||!t.call)return new o(h(e));try{t.call(this,void 0,new o(h(e)))}catch(e){t(e)}},function(e,t){for(var r in e)t(e[r],r)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],(function(e){r[e]=function(){m("sorry,",e,"is not implemented yet")}}))}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:10}],6:[function(e,t,r){(function(r,n,o,i,a,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,n=-271733879,o=-1732584194,i=271733878,a=0;a<e.length;a+=16){var u=r,s=n,c=o,l=i;r=p(r,n,o,i,e[a+0],7,-680876936),i=p(i,r,n,o,e[a+1],12,-389564586),o=p(o,i,r,n,e[a+2],17,606105819),n=p(n,o,i,r,e[a+3],22,-1044525330),r=p(r,n,o,i,e[a+4],7,-176418897),i=p(i,r,n,o,e[a+5],12,1200080426),o=p(o,i,r,n,e[a+6],17,-1473231341),n=p(n,o,i,r,e[a+7],22,-45705983),r=p(r,n,o,i,e[a+8],7,1770035416),i=p(i,r,n,o,e[a+9],12,-1958414417),o=p(o,i,r,n,e[a+10],17,-42063),n=p(n,o,i,r,e[a+11],22,-1990404162),r=p(r,n,o,i,e[a+12],7,1804603682),i=p(i,r,n,o,e[a+13],12,-40341101),o=p(o,i,r,n,e[a+14],17,-1502002290),r=g(r,n=p(n,o,i,r,e[a+15],22,1236535329),o,i,e[a+1],5,-165796510),i=g(i,r,n,o,e[a+6],9,-1069501632),o=g(o,i,r,n,e[a+11],14,643717713),n=g(n,o,i,r,e[a+0],20,-373897302),r=g(r,n,o,i,e[a+5],5,-701558691),i=g(i,r,n,o,e[a+10],9,38016083),o=g(o,i,r,n,e[a+15],14,-660478335),n=g(n,o,i,r,e[a+4],20,-405537848),r=g(r,n,o,i,e[a+9],5,568446438),i=g(i,r,n,o,e[a+14],9,-1019803690),o=g(o,i,r,n,e[a+3],14,-187363961),n=g(n,o,i,r,e[a+8],20,1163531501),r=g(r,n,o,i,e[a+13],5,-1444681467),i=g(i,r,n,o,e[a+2],9,-51403784),o=g(o,i,r,n,e[a+7],14,1735328473),r=v(r,n=g(n,o,i,r,e[a+12],20,-1926607734),o,i,e[a+5],4,-378558),i=v(i,r,n,o,e[a+8],11,-2022574463),o=v(o,i,r,n,e[a+11],16,1839030562),n=v(n,o,i,r,e[a+14],23,-35309556),r=v(r,n,o,i,e[a+1],4,-1530992060),i=v(i,r,n,o,e[a+4],11,1272893353),o=v(o,i,r,n,e[a+7],16,-155497632),n=v(n,o,i,r,e[a+10],23,-1094730640),r=v(r,n,o,i,e[a+13],4,681279174),i=v(i,r,n,o,e[a+0],11,-358537222),o=v(o,i,r,n,e[a+3],16,-722521979),n=v(n,o,i,r,e[a+6],23,76029189),r=v(r,n,o,i,e[a+9],4,-640364487),i=v(i,r,n,o,e[a+12],11,-421815835),o=v(o,i,r,n,e[a+15],16,530742520),r=y(r,n=v(n,o,i,r,e[a+2],23,-995338651),o,i,e[a+0],6,-198630844),i=y(i,r,n,o,e[a+7],10,1126891415),o=y(o,i,r,n,e[a+14],15,-1416354905),n=y(n,o,i,r,e[a+5],21,-57434055),r=y(r,n,o,i,e[a+12],6,1700485571),i=y(i,r,n,o,e[a+3],10,-1894986606),o=y(o,i,r,n,e[a+10],15,-1051523),n=y(n,o,i,r,e[a+1],21,-2054922799),r=y(r,n,o,i,e[a+8],6,1873313359),i=y(i,r,n,o,e[a+15],10,-30611744),o=y(o,i,r,n,e[a+6],15,-1560198380),n=y(n,o,i,r,e[a+13],21,1309151649),r=y(r,n,o,i,e[a+4],6,-145523070),i=y(i,r,n,o,e[a+11],10,-1120210379),o=y(o,i,r,n,e[a+2],15,718787259),n=y(n,o,i,r,e[a+9],21,-343485551),r=m(r,u),n=m(n,s),o=m(o,c),i=m(i,l)}return Array(r,n,o,i)}function h(e,t,r,n,o,i){return m((a=m(m(t,e),m(n,i)))<<(u=o)|a>>>32-u,r);var a,u}function p(e,t,r,n,o,i,a){return h(t&r|~t&n,e,t,o,i,a)}function g(e,t,r,n,o,i,a){return h(t&n|r&~n,e,t,o,i,a)}function v(e,t,r,n,o,i,a){return h(t^r^n,e,t,o,i,a)}function y(e,t,r,n,o,i,a){return h(r^(t|~n),e,t,o,i,a)}function m(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return f.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,t,r){(function(e,r,n,o,i,a,u,s,c){var l;l=function(e){for(var t,r=new Array(e),n=0;n<e;n++)0==(3&n)&&(t=4294967296*Math.random()),r[n]=t>>>((3&n)<<3)&255;return r},t.exports=l}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(e,t,r){(function(r,n,o,i,a,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,o,i,a,u=Array(80),s=1732584193,c=-271733879,l=-1732584194,f=271733878,d=-1009589776,g=0;g<e.length;g+=16){for(var v=s,y=c,m=l,b=f,_=d,w=0;w<80;w++){u[w]=w<16?e[g+w]:p(u[w-3]^u[w-8]^u[w-14]^u[w-16],1);var O=h(h(p(s,5),(o=c,i=l,a=f,(n=w)<20?o&i|~o&a:!(n<40)&&n<60?o&i|o&a|i&a:o^i^a)),h(h(d,u[w]),(r=w)<20?1518500249:r<40?1859775393:r<60?-1894007588:-899497514));d=f,f=l,l=p(c,30),c=s,s=O}s=h(s,v),c=h(c,y),l=h(l,m),f=h(f,b),d=h(d,_)}return Array(s,c,l,f,d)}function h(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function p(e,t){return e<<t|e>>>32-t}t.exports=function(e){return f.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(e,t,r){(function(r,n,o,i,a,u,s,c,l){function f(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function d(e,t){return e>>>t|e<<32-t}function h(e,t){var r,n,o,i,a,u,s,c,l,h,p=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),g=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),v=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var y,m,b,_,w,O,T,S,x=0;x<e.length;x+=16){r=g[0],n=g[1],o=g[2],i=g[3],a=g[4],u=g[5],s=g[6],c=g[7];for(var P=0;P<64;P++)v[P]=P<16?e[P+x]:f(f(f(d(S=v[P-2],17)^d(S,19)^S>>>10,v[P-7]),d(T=v[P-15],7)^d(T,18)^T>>>3),v[P-16]),l=f(f(f(f(c,d(O=a,6)^d(O,11)^d(O,25)),(w=a)&u^~w&s),p[P]),v[P]),h=f(d(_=r,2)^d(_,13)^d(_,22),(y=r)&(m=n)^y&(b=o)^m&b),c=s,s=u,u=a,a=f(i,l),i=o,o=n,n=r,r=f(l,h);g[0]=f(r,g[0]),g[1]=f(n,g[1]),g[2]=f(o,g[2]),g[3]=f(i,g[3]),g[4]=f(a,g[4]),g[5]=f(u,g[5]),g[6]=f(s,g[6]),g[7]=f(c,g[7])}return g}var p=e("./helpers");t.exports=function(e){return p.hash(e,h,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,t,r){(function(e,r,n,o,i,a,u,s,c){function l(){}(e=t.exports={}).nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",(function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<r.length&&r.shift()())}),!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=l,e.addListener=l,e.once=l,e.off=l,e.removeListener=l,e.removeAllListeners=l,e.emit=l,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:10}],11:[function(e,t,r){(function(e,t,n,o,i,a,u,s,c){r.read=function(e,t,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=u;0<l;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;0<l;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},r.write=function(e,t,r,n,o,i){var a,u,s,c=8*i-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),2<=(t+=1<=a+f?d/s:d*Math.pow(2,1-f))*s&&(a++,s/=2),l<=a+f?(u=0,a=l):1<=a+f?(u=(t*s-1)*Math.pow(2,o),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));8<=o;e[r+h]=255&u,h+=p,u/=256,o-=8);for(a=a<<o|u,c+=o;0<c;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*g}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/ieee754/index.js","/node_modules/ieee754")},{buffer:3,lYpoI2:10}]},{},[1])(1)})),Kr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0;var r=St.__importDefault(Yr);t.generateSearchId=function(e,t){var n=t.anonymousId,o=t.language,i=t.currency,a=t.userCountry;return r.default(St.__assign(St.__assign({},e),{anonymousId:n,language:o,currency:i,userCountry:a}))}})),Vr=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,i=(e.pricing.medianRateBkt+1)*r*t;return St.__assign(St.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(i)]})}})),Gr=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],i=r[1];return St.__assign(St.__assign({},t),((n={})[o]=i===new Object(i)?e(i):i,n))}),{})}})),Qr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),St.__exportStar(J,t),St.__exportStar(X,t),St.__exportStar(jt,t),St.__exportStar(Dt,t),St.__exportStar(Ct,t),St.__exportStar(Wr,t),St.__exportStar(Kr,t),St.__exportStar(Vr,t),St.__exportStar(Gr,t)})),Jr=t((function(e,t){function r(e,t,r,n){return!(void 0!==r&&e.nightlyRate<r)&&!(void 0!==n&&n<t&&e.nightlyRate>n)}function n(e,t){var n,o=e.filters,i=void 0===o?{}:o,a=e.priceBucketWidth,u=e.priceBucketsCount,s=e.exchangeRate;if(void 0===a)return t;var c=i.priceMin,l=i.priceMax,f=u*Math.round(a*s);if((void 0!==c||void 0!==l)&&!(null===(n=t.offers)||void 0===n?void 0:n.some((function(e){return r(e,f,c,l)}))))return St.__assign(St.__assign({},t),{offers:[]});return t}function o(e,t){var r=t.sortField,n=t.sortOrder;return"price"===r?function(e,t){return e.sort((function(e,r){var n,o,i=(null!==(n=Qr.getCheapestRate(e))&&void 0!==n?n:0)-(null!==(o=Qr.getCheapestRate(r))&&void 0!==o?o:0);return"ascending"===t?i:-i}))}(e,void 0===n?"ascending":n):e}function i(e){var t=e.topOfferData,r=e.anchorPriceRateBreakdown,n=r.calculatedTotalRate,o=r.nightlyRate;return St.__assign(St.__assign({},t),{anchorPrice:n,anchorPriceNightly:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.augmentRaaResponse=t.augmentHotelOffersWithAnchorPrice=t.augmentOffersWithAnchorPrice=t.augmentTopOfferDataWithAnchorPrice=t.applyPriceFilter=t.isOfferInPriceRange=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},t.isOfferInPriceRange=r,t.applyPriceFilter=n,t.augmentTopOfferDataWithAnchorPrice=i;function a(e,t){var r=e.offers;if(!(null==r?void 0:r.length))return r;var n=t.anchorPrice;return void 0===n?r:r.map((function(e){return St.__assign(St.__assign({},e),{hasAnchorPrice:n-e.calculatedTotalRate>.03*n})}))}function u(e){var t=e.anchorPriceRateBreakdown,r=e.topOfferData;if(void 0===t||void 0===r)return e;var n=i(e),o=a(e,n);return St.__assign(St.__assign({},e),{topOfferData:n,offers:o})}t.augmentOffersWithAnchorPrice=a,t.augmentHotelOffersWithAnchorPrice=u,t.augmentRaaResponse=function(e,t){var r,i=e.hotels,a=e.anchorHotel;void 0!==i&&(r=i.map((function(e){return n(t,e)})),void 0!==t.sortField&&(r=o(r,t)));var s=[],c={};return null==r||r.forEach((function(e){s.push(e.id),c[e.id]=u(e)})),void 0!==a&&(c[a.id]=u(a)),{hotelIds:s,anchorHotelId:null==a?void 0:a.id,hotelOfferEntities:c}}})),Xr=r(S),$r=r(Q),Zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.raa=void 0;var r,n=St.__importDefault(Xr);!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.raa=function(e,t){if(void 0===e)throw new TypeError("RAA endpoint must be provided");if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,i=new n.default(e,[],{maxRetries:20,WebSocket:t.WebSocket}),a={};function u(){void 0!==a.current&&i.reconnect()}function s(){void 0!==a.current&&i.reconnect()}function c(){var e=a.current;void 0!==e&&i.send(e)}function l(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}void 0!==o&&o(t)}return i.addEventListener("open",c),i.addEventListener("close",u),i.addEventListener("error",s),i.addEventListener("message",l),{getOffers:function(e,n){return St.__awaiter(this,void 0,void 0,(function(){var u;return St.__generator(this,(function(s){return u={},a.current=function(e,t){var r,n,o,i={checkIn:e.checkIn,checkOut:e.checkOut,destination:null!==(r=e.destination)&&void 0!==r?r:"",getAllOffers:e.getAllOffers,highlightedHotelID:e.anchorDestination,rooms:e.rooms,cugDeals:e.cugDeals,profileId:e.profileId,searchId:e.searchId,useAlternativeRaaKeys:e.useAlternativeRaaKeys,preferredRate:e.preferredRate,trafficSource:e.trafficSource,deviceCategory:t.deviceCategory,languageCode:t.language,userCountryCode:t.userCountry,currencyCode:t.currency,anonymousId:t.anonymousId,includeLocalTaxes:t.includeLocalTaxes,includeTaxes:t.includeTaxes,skipBackendAugmentation:t.skipBackendAugmentation,facetsEnabled:t.facetsEnabled,sapiCliKey:t.sapiCliKey,sortingBoost:Jr.generateSortingBoost(e),clientRequestId:$r.v4()};(null===(n=t.variations)||void 0===n?void 0:n.includes("c6j5l9m6-room-limit-b"))&&(i.roomLimit=1,i.anchorRoomLimit=2);try{o=JSON.stringify(i)}catch(e){console.log("WEBSOCKET: error parsing query")}return o}(e,t),[2,new Promise((function(t){o=function(r){var o;if(void 0!==r)if(r.status.complete)t(u),a.current=void 0;else{var i=r.results.find((function(t){return t.id===e.anchorDestination}));i?u.anchorHotel=Qr.omit(["errors"],i):u.hotels=null===(o=r.results)||void 0===o?void 0:o.map((function(e){return Qr.omit(["errors"],e)})),"function"==typeof n&&n(St.__assign({},u))}},i.readyState===r.Open&&void 0!==a.current&&i.send(a.current)}))]}))}))}}}})),en=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),St.__exportStar(Zr,t),St.__exportStar(Jr,t)}));function tn(e){$(1,arguments);var t=Z(e);return t.setHours(0,0,0,0),t}var rn=864e5;function nn(e,t){$(2,arguments);var r=tn(e),n=tn(t),o=r.getTime()-Ye(r),i=n.getTime()-Ye(n);return Math.round((o-i)/rn)}function on(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 an=r(Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=Z(e),n=Z(t),o=on(r,n),i=Math.abs(nn(r,n));r.setDate(r.getDate()-o*i);var a=on(r,n)===-o,u=o*(i-a);return 0===u?0:u}})),un=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.pickIndexVariation=t.hitToPlaceSuggest=t.hitToHotelSuggest=t.hitToPlaceTypeAnchor=t.hitToHotelTypeAnchor=t.hitToHotel=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=t.getTagsFilter=t.getCheckInNights=void 0;var r=St.__importDefault(an),n=St.__importDefault(xt);function o(e,t){var o=Qr.dateToMiddayUTC(e),i=Qr.dateToMiddayUTC(t);return n.default(o,"yyMMdd")+"-"+r.default(i,o)}function i(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function a(e,t){for(var r=0,n=t;r<n.length;r++){var o=n[r];if(i(null==e?void 0:e[o]))return e[o]}return""}function u(e,t,r){void 0===r&&(r=", ");var n={};return t.forEach((function(o){var a=e[o]||[];n[o]=a.map((function(r,n){if(i(r))return r;var o=t.find((function(t){var r;return i(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[n])}));return o?e[o][n]:""})).join(""+r)})),a(n,t)}function s(e,t,r){var n={};return t.forEach((function(o){var a=e[o]||[],u=-1===r?void 0:r+1,s=a.slice(r,u).toString();if(i(s))n[o]=s;else{var c=t.find((function(t){var n;return i(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[r])}));n[o]=c?e[c][r]:""}})),a(n,t)}function c(e,t){var r={};return t.forEach((function(n){var o,a=null===(o=e[n])||void 0===o?void 0:o.value;if(i(a))r[n]=a;else{var u=t.find((function(t){var r;return i(null===(r=e[t])||void 0===r?void 0:r.value)}));r[n]=u?e[u].value:""}})),a(r,t)}function l(e,t,r){var n,o=e[t];if(!o){var i=r.indexOf(t),a=null!==(n=r.slice(i).find((function(t){return e[t]})))&&void 0!==n?n:"en";o=e[a]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function f(e,t,r){for(var n={},o=0,i=r;o<i.length;o++){var a=i[o];n[a]=St.__spreadArrays(l(e,a,r),l(t,a,r))}return u(n,r)}function d(e,t,r){if(void 0===e)return t;try{for(var n in t)if(void 0===e[n])throw new TypeError("Hotel "+e.objectID+" is missing "+n+" field")}catch(e){r||console.error(e)}return St.__assign(St.__assign({},t),e)}function h(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"}}t.getCheckInNights=o,t.getTagsFilter=function(e,t){return["tags:-u"+o(e,t)]},t.isNotEmptyOrWhiteSpace=i,t.getTranslatedAttributes=function(e,t){var r=[];return e.forEach((function(e){var n=t.map((function(t){return t+"."+e}));r.push.apply(r,n)})),r},t.toString=a,t.translatedArrayToString=u,t.getStringFromTranslatedArray=s,t.getValueFromTranslatedHightlightResult=c,t.attributeWithFallback=l,t.mergeTranslatedAttributes=f,t.validateHit=d,t.placeTypeToPlaceTypeName=h,t.hitToHotel=function(e,t){var r=d(e,{address:{},placeADName:{},placeDN:{},hotelName:{}}),n=St.__assign(St.__assign({},r),{displayAddress:f(r.address,r.placeADName,t),placeDisplayName:u(r.placeDN,t),hotelName:a(r.hotelName,t)});return Qr.omit(["address","placeDN","placeADName"],n)},t.hitToHotelTypeAnchor=function(e,t){var r=d(e,{hotelName:{},placeDN:{}}),n=St.__assign(St.__assign({},r),{hotelName:a(r.hotelName,t),placeDisplayName:u(r.placeDN,t)});return Qr.omit(["placeADN","placeDN"],n)},t.hitToPlaceTypeAnchor=function(e,t){var r=d(e,{placeName:{},placeDN:{}}),n=St.__assign(St.__assign({},r),{placeName:a(r.placeName,t),placeDisplayName:u(r.placeDN,t)});return Qr.omit(["placeADN","placeDN"],n)},t.hitToHotelSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=i(o)?o+", "+n:n,l=c(r._highlightResult.hotelName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:a(r.hotelName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h()}},t.hitToPlaceSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=i(o)?o+", "+n:n,l=c(r._highlightResult.placeName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:a(r.placeName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h(r.placeType)}},t.pickIndexVariation=function(e,t){var r=e.find((function(e){return e.variationID&&t.includes(e.variationID)}));return null!=r?r:e.find((function(e){return void 0===e.variationID}))}})),sn=t((function(e,t){var r;function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return St.__spreadArrays(["objectType","placeType","placeCategory","objectID","_geoloc","priceBucketWidth","polygon","pageSize"],t)}function o(e){var t=un.getTranslatedAttributes(e,["hotelName","placeADName","placeDN","address"]);return St.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.getAnchor=void 0,function(e){e[e.Hotel=0]="Hotel",e[e.Place=1]="Place",e[e.Location=2]="Location",e[e.Query=3]="Query",e[e.Unknown=4]="Unknown"}(r||(r={})),t.getAnchor=function(e,t,i){var a=this,u=e.search,s=i.languages;return function(e){return St.__awaiter(a,void 0,void 0,(function(){var i,a,c,l,f,d,h,p,g,v,y,m,b;return St.__generator(this,(function(_){switch(_.label){case 0:switch(i=function(e){return e.hotelId?r.Hotel:e.placeId?r.Place:e.geolocation?r.Location:e.query?r.Query:r.Unknown}(e),a=e.hotelId,c=e.placeId,l=e.query,f=[],i){case r.Query:f.push({indexName:t.autocompleteIndex,params:{query:l,hitsPerPage:1,attributesToRetrieve:n(s),attributesToHighlight:[]}}),f.push({indexName:t.hotelIndex,params:{query:l,hitsPerPage:1,attributesToRetrieve:o(s),attributesToHighlight:[]}});break;case r.Hotel:a&&f.push({indexName:t.autocompleteIndex,params:{facetFilters:[["objectID:hotel:"+a]],attributesToRetrieve:n(s),attributesToHighlight:[]}},{indexName:t.hotelIndex,params:{facetFilters:[["objectID:"+a]],attributesToRetrieve:o(s),attributesToHighlight:[]}});break;case r.Place:default:c&&f.push({indexName:t.autocompleteIndex,params:{facetFilters:[["objectID:place:"+c]],attributesToRetrieve:n(s),attributesToHighlight:[]}})}return[4,u(f)];case 1:switch(p=_.sent().results,g=null===(y=p[0])||void 0===y?void 0:y.hits[0],v=null===(m=p[1])||void 0===m?void 0:m.hits[0],null==g?void 0:g.objectType){case"hotel":d=un.hitToHotelTypeAnchor(g,s),h=un.hitToHotel(v,s);break;case"place":default:d=un.hitToPlaceTypeAnchor(g,s)}return[2,{anchor:d,anchorHotel:h,anchorType:null!==(b=null==g?void 0:g.objectType)&&void 0!==b?b:"place"}]}}))}))}}}));var cn=r(Object.freeze({__proto__:null,default:function(e){$(1,arguments);var t=Z(e),r=t.getDay();return 0===r||6===r}})),ln=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generatePriceFilter=t.generateSortByPriceFilter=void 0;var r=St.__importDefault(an),n=St.__importDefault(cn);t.generateSortByPriceFilter=function(e){for(var t=[],r=e;r>0;--r){var n=100*(e+1-r);t.push("pricing.minRateBkt:"+r+"<score="+n+">")}return t},t.generatePriceFilter=function(e){var t=e.priceMin,o=e.priceMax,i=e.priceBucketWidth,a=e.priceBucketsCount,u=e.checkIn,s=e.checkOut,c=e.margin,l=void 0===c?2:c,f=[];if(void 0===t&&void 0===o||void 0===i)return f;var d=t?Math.floor(t/i)-l:0,h=o?Math.ceil(o/i)+l:a;d<0&&(d=0),h>a&&(h=a);var p=d,g=function(e,t){if(!e||!t)return"pricing.medianRateBkt";var o=Qr.dateToMiddayUTC(e),i=Qr.dateToMiddayUTC(t);return 1===r.default(i,o)?n.default(o)?"pricing.medianRateSaSuBkt":"pricing.medianRateMoFrBkt":"pricing.medianRateBkt"}(u,s);do{f.push(g+":"+p+"<score=10000>"),p++}while(p<=h);return f}})),fn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getBackendConfig=t.getSafConfig=t.profiles=t.PRICE_BUCKET_COUNT=void 0,t.PRICE_BUCKET_COUNT=31;var r={features:[],blockedDefaultDates:["2022-02-27"],daysFromNow:45,fallbackLanguages:{"pt-BR":["pt"],"zh-CN":["zh"],"zh-HK":["zh"],"zh-TW":["zh"],iw:["he"],nb:["no"],nn:["no"]},hotelIndex:"prod_hotel_v3",autocompleteIndex:"prod_autocomplete_v2_os000007",lovIndex:"prod_lov_v2",currencyIndex:"prod_curr_v1",hsoIndex:[{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000003_tags"},{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000004_tags2",variationID:"pp000004-tags2-b"}],raa:{endpoint:"wss://d2jxsjsbxzs3ta.cloudfront.net"},algolia:{apiKey:"efa703d5c0057a24487bc9bdcb597770"}};t.profiles={"findhotel-website":St.__assign(St.__assign({},r),{features:["offers","search","suggests","configs"]}),"findhotel-checkout":St.__assign(St.__assign({},r),{features:["rooms"]}),"findhotel-website-e2e":St.__assign(St.__assign({},r),{features:["offers","search","suggests","configs"],raa:St.__assign(St.__assign({},r.raa),{endpoint:void 0})}),"findhotel-checkout-e2e":St.__assign(St.__assign({},r),{features:["rooms"]})};var n={baseUrl:"https://sapi.findhotel.services",baseCloudFrontUrl:"https://d6smt535eb7vn.cloudfront.net",endpoints:{offersRooms:"1/offers-rooms",search:"1/search"}},o={"findhotel-website":n,"findhotel-checkout":n,"findhotel-website-e2e":St.__assign(St.__assign({},n),{baseUrl:"https://sapi-e2e.findhotel.services"}),"findhotel-checkout-e2e":St.__assign(St.__assign({},n),{baseUrl:"https://sapi-e2e.findhotel.services"})};t.getSafConfig=function(e){var t=o[e];if(void 0===t)throw new Error("Profile key is not valid");return t};var i={baseUrl:"https://dikcjxfwieazv.cloudfront.net",endpoints:{search:"search"}},a={"findhotel-website":i,"findhotel-checkout":i,"findhotel-website-e2e":i,"findhotel-checkout-e2e":i};t.getBackendConfig=function(e){var t=a[e];if(void 0===t)throw new Error("Profile key is not valid");return t}})),dn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.geoSearch=void 0;function r(e){var t=e.anchorHotelId,r=e.checkIn,n=e.checkOut,o=e.filters,i=void 0===o?{}:o,a=i.facilities,u=i.starRating,s=i.propertyTypeId,c=i.themeIds,l=[];if(null==s?void 0:s.length){var f=s.map((function(e){return"propertyTypeId:"+e}));l.push(f)}if(null==a?void 0:a.length){var d=a.map((function(e){return"facilities:"+e}));l.push.apply(l,d)}if(null==c?void 0:c.length){var h=c.map((function(e){return"themeIds:"+e}));l.push.apply(l,h)}if(null==u?void 0:u.length){var p=[];u.forEach((function(e){p.push("starRating:"+Number(e)),p.push("starRating:"+(Number(e)+.5))})),l.push(p)}return t&&l.push("objectID:-"+t),r&&n&&l.push(un.getTagsFilter(r,n)),l}function n(e){var t=e.guestRating;return(null==t?void 0:t.length)?["guestRating.overall>="+t[0]]:[]}function o(e){var t="isDeleted = 0";return e.noHostels&&(t+=" AND propertyTypeId != 5"),t}function i(e,t){var r=e.filters,n=void 0===r?{}:r,o=e.checkIn,i=e.checkOut,a=e.sortField,u=n.priceMin,s=n.priceMax,c=t.hsoFilter,l=t.priceBucketWidth,f=t.exchangeRate,d=St.__spreadArrays(c);if("price"===a){var h=ln.generateSortByPriceFilter(fn.PRICE_BUCKET_COUNT);d=St.__spreadArrays(d,h)}if(u||s){var p=ln.generatePriceFilter({priceMin:u,priceMax:s,checkIn:o,checkOut:i,priceBucketsCount:fn.PRICE_BUCKET_COUNT,priceBucketWidth:l&&l*f});d=St.__spreadArrays(d,p)}return d}var a=["facilities","propertyTypeId","starRating","themeIds","pricing.medianRateBkt","pricing.medianRateMoFrBkt","pricing.medianRateSaSuBkt","pricing.minRateBkt","tags"];t.geoSearch=function(e,t,u){var s=this,c=e.search;return function(e){return St.__awaiter(s,void 0,void 0,(function(){var s,l,f,d,h,p,g,v,y,m,b,_,w,O,T,S,x,P,I,E,k,j,D;return St.__generator(this,(function(C){switch(C.label){case 0:return s=e.boundingBox,l=e.polygon,f=e.geolocation,d=e.length,h=void 0===d?u.requestSize:d,p=e.offset,g=void 0===p?0:p,v=e.filters,m={length:h,offset:g,facets:a,attributesToHighlight:[],getRankingInfo:!1,filters:o(y=void 0===v?{}:v),numericFilters:n(y),facetFilters:r(e),attributesToRetrieve:(A=u.languages,N=un.getTranslatedAttributes(A,["hotelName","placeADName","placeDN","address"]),St.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],N)),optionalFilters:i(e,u)},void 0!==y.hotelName&&(m.query=y.hotelName),s?m.insideBoundingBox=[s]:l?m.insidePolygon=l:f&&(m.aroundLatLng=f.lat+", "+f.lon,m.aroundRadius=null!==(P=f.radius)&&void 0!==P?P:2e4,m.aroundPrecision=null!==(I=f.precision)&&void 0!==I?I:5e3),[4,c([{indexName:t.hotelIndex,params:m}])];case 1:for(b=C.sent(),_=b.results[0],w=[],O={},T=0,S=_.hits;T<S.length;T++)x=S[T],O[x.objectID]=un.hitToHotel(x,u.languages),w.push(x.objectID);return[2,{hotelIds:w,hotelEntities:O,resultsCount:null!==(E=_.length)&&void 0!==E?E:0,resultsCountTotal:null!==(k=_.nbHits)&&void 0!==k?k:0,offset:null!==(j=_.offset)&&void 0!==j?j:0,facets:null!==(D=_.facets)&&void 0!==D?D:{}}]}var A,N}))}))}}})),hn=t((function(e,t){function r(e){return un.getTranslatedAttributes(e,["placeName","hotelName"])}function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return St.__spreadArrays(["objectType","objectID","placeType"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.loadSuggests=void 0,t.loadSuggests=function(e,t,o){var i=this,a=e.search,u=o.languages,s=o.suggestsCount,c=void 0===s?6:s;return function(e){return St.__awaiter(i,void 0,void 0,(function(){var o,i,s;return St.__generator(this,(function(l){switch(l.label){case 0:return o=[{indexName:t.autocompleteIndex,params:{query:e,filters:"isDeleted != 1",hitsPerPage:c,attributesToRetrieve:n(u),attributesToHighlight:r(u)}}],[4,a(o)];case 1:return i=l.sent().results,[2,null===(s=i[0])||void 0===s?void 0:s.hits.map((function(e){switch(e.objectType){case"hotel":return un.hitToHotelSuggest(e,u);case"place":default:return un.hitToPlaceSuggest(e,u)}}))]}}))}))}}})),pn=t((function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));e(pn);var gn=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e};var vn=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function yn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var mn=function(e,t,r){return t&&yn(e.prototype,t),r&&yn(e,r),e};var bn=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n};var _n=function(e){if(Array.isArray(e))return bn(e)};var wn=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)};var On=function(e,t){if(e){if("string"==typeof e)return bn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bn(e,t):void 0}};var Tn=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var Sn=pn((function(e){return _n(e)||wn(e)||On(e)||Tn()})),xn={functions:"Jexl Function",transforms:"Transform"},Pn={ArrayLiteral:function(e){return this.evalArray(e.value)},BinaryExpression:function(e){var t=this,r=this._grammar.elements[e.operator];if(r.evalOnDemand){var n=function(e){return{eval:function(){return t.eval(e)}}};return r.evalOnDemand(n(e.left),n(e.right))}return this.Promise.all([this.eval(e.left),this.eval(e.right)]).then((function(e){return r.eval(e[0],e[1])}))},ConditionalExpression:function(e){var t=this;return this.eval(e.test).then((function(r){return r?e.consequent?t.eval(e.consequent):r:t.eval(e.alternate)}))},FilterExpression:function(e){var t=this;return this.eval(e.subject).then((function(r){return e.relative?t._filterRelative(r,e.expr):t._filterStatic(r,e.expr)}))},Identifier:function(e){return e.from?this.eval(e.from).then((function(t){if(null!=t)return Array.isArray(t)&&(t=t[0]),t[e.value]})):e.relative?this._relContext[e.value]:this._context[e.value]},Literal:function(e){return e.value},ObjectLiteral:function(e){return this.evalMap(e.value)},FunctionCall:function(e){var t=xn[e.pool];if(!t)throw new Error("Corrupt AST: Pool '".concat(e.pool,"' not found"));var r=this._grammar[e.pool][e.name];if(!r)throw new Error("".concat(t," ").concat(e.name," is not defined."));return this.evalArray(e.args||[]).then((function(e){return r.apply(void 0,(0,Sn.default)(e))}))},UnaryExpression:function(e){var t=this;return this.eval(e.right).then((function(r){return t._grammar.elements[e.operator].eval(r)}))}},In=pn(vn),En=pn(mn),kn=function(){function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Promise;(0,In.default)(this,e),this._grammar=t,this._context=r||{},this._relContext=n||this._context,this.Promise=o}return(0,En.default)(e,[{key:"eval",value:function(e){var t=this;return this.Promise.resolve().then((function(){return Pn[e.type].call(t,e)}))}},{key:"evalArray",value:function(e){var t=this;return this.Promise.all(e.map((function(e){return t.eval(e)})))}},{key:"evalMap",value:function(e){var t=this,r=Object.keys(e),n={},o=r.map((function(r){return t.eval(e[r])}));return this.Promise.all(o).then((function(e){return e.forEach((function(e,t){n[r[t]]=e})),n}))}},{key:"_filterRelative",value:function(t,r){var n=this,o=[];return Array.isArray(t)||(t=void 0===t?[]:[t]),t.forEach((function(t){var i=new e(n._grammar,n._context,t,n.Promise);o.push(i.eval(r))})),this.Promise.all(o).then((function(e){var r=[];return e.forEach((function(e,n){e&&r.push(t[n])})),r}))}},{key:"_filterStatic",value:function(e,t){return this.eval(t).then((function(t){return"boolean"==typeof t?t?e:void 0:e[t]}))}}]),e}(),jn=pn(vn),Dn=pn(mn),Cn=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/,An=/^[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Zа-яА-Я0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/,Nn=/\\\\/,Rn=/^\s*$/,Mn=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Un=["[a-zA-Zа-яА-Я_À-ÖØ-öø-ÿ\\$][a-zA-Z0-9а-яА-Я_À-ÖØ-öø-ÿ\\$]*","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],Bn=["binaryOp","unaryOp","openParen","openBracket","question","colon"],qn=function(){function e(t){(0,jn.default)(this,e),this._grammar=t}return(0,Dn.default)(e,[{key:"getElements",value:function(e){var t=this._getSplitRegex();return e.split(t).filter((function(e){return e}))}},{key:"getTokens",value:function(e){for(var t=[],r=!1,n=0;n<e.length;n++)this._isWhitespace(e[n])?t.length&&(t[t.length-1].raw+=e[n]):"-"===e[n]&&this._isNegative(t)?r=!0:(r&&(e[n]="-"+e[n],r=!1),t.push(this._createToken(e[n])));return r&&t.push(this._createToken("-")),t}},{key:"tokenize",value:function(e){var t=this.getElements(e);return this.getTokens(t)}},{key:"_createToken",value:function(e){var t={type:"literal",value:e,raw:e};if('"'===e[0]||"'"===e[0])t.value=this._unquote(e);else if(e.match(Cn))t.value=parseFloat(e);else if("true"===e||"false"===e)t.value="true"===e;else if(this._grammar.elements[e])t.type=this._grammar.elements[e].type;else{if(!e.match(An))throw new Error("Invalid expression token: ".concat(e));t.type="identifier"}return t}},{key:"_escapeRegExp",value:function(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(An)&&(e="\\b"+e+"\\b"),e}},{key:"_getSplitRegex",value:function(){var e=this;if(!this._splitRegex){var t=Object.keys(this._grammar.elements).sort((function(e,t){return t.length-e.length})).map((function(t){return e._escapeRegExp(t)}),this);this._splitRegex=new RegExp("("+[Mn.join("|"),t.join("|"),Un.join("|")].join("|")+")")}return this._splitRegex}},{key:"_isNegative",value:function(e){return!e.length||Bn.some((function(t){return t===e[e.length-1].type}))}},{key:"_isWhitespace",value:function(e){return!!e.match(Rn)}},{key:"_unquote",value:function(e){var t=e[0],r=new RegExp("\\\\"+t,"g");return e.substr(1,e.length-2).replace(r,t).replace(Nn,"\\")}}]),e}(),Ln={argVal:function(e){e&&this._cursor.args.push(e)},arrayStart:function(){this._placeAtCursor({type:"ArrayLiteral",value:[]})},arrayVal:function(e){e&&this._cursor.value.push(e)},binaryOp:function(e){for(var t=this._grammar.elements[e.value].precedence||0,r=this._cursor._parent;r&&r.operator&&this._grammar.elements[r.operator].precedence>=t;)this._cursor=r,r=r._parent;var n={type:"BinaryExpression",operator:e.value,left:this._cursor};this._setParent(this._cursor,n),this._cursor=r,this._placeAtCursor(n)},dot:function(){this._nextIdentEncapsulate=this._cursor&&"UnaryExpression"!==this._cursor.type&&("BinaryExpression"!==this._cursor.type||"BinaryExpression"===this._cursor.type&&this._cursor.right),this._nextIdentRelative=!this._cursor||this._cursor&&!this._nextIdentEncapsulate,this._nextIdentRelative&&(this._relative=!0)},filter:function(e){this._placeBeforeCursor({type:"FilterExpression",expr:e,relative:this._subParser.isRelative(),subject:this._cursor})},functionCall:function(){this._placeBeforeCursor({type:"FunctionCall",name:this._cursor.value,args:[],pool:"functions"})},identifier:function(e){var t={type:"Identifier",value:e.value};this._nextIdentEncapsulate?(t.from=this._cursor,this._placeBeforeCursor(t),this._nextIdentEncapsulate=!1):(this._nextIdentRelative&&(t.relative=!0,this._nextIdentRelative=!1),this._placeAtCursor(t))},literal:function(e){this._placeAtCursor({type:"Literal",value:e.value})},objKey:function(e){this._curObjKey=e.value},objStart:function(){this._placeAtCursor({type:"ObjectLiteral",value:{}})},objVal:function(e){this._cursor.value[this._curObjKey]=e},subExpression:function(e){this._placeAtCursor(e)},ternaryEnd:function(e){this._cursor.alternate=e},ternaryMid:function(e){this._cursor.consequent=e},ternaryStart:function(){this._tree={type:"ConditionalExpression",test:this._tree},this._cursor=this._tree},transform:function(e){this._placeBeforeCursor({type:"FunctionCall",name:e.value,args:[this._cursor],pool:"transforms"})},unaryOp:function(e){this._placeAtCursor({type:"UnaryExpression",operator:e.value})}},Fn={states:{expectOperand:{tokenTypes:{literal:{toState:"expectBinOp"},identifier:{toState:"identifier"},unaryOp:{},openParen:{toState:"subExpression"},openCurl:{toState:"expectObjKey",handler:Ln.objStart},dot:{toState:"traverse"},openBracket:{toState:"arrayVal",handler:Ln.arrayStart}}},expectBinOp:{tokenTypes:{binaryOp:{toState:"expectOperand"},pipe:{toState:"expectTransform"},dot:{toState:"traverse"},question:{toState:"ternaryMid",handler:Ln.ternaryStart}},completable:!0},expectTransform:{tokenTypes:{identifier:{toState:"postTransform",handler:Ln.transform}}},expectObjKey:{tokenTypes:{identifier:{toState:"expectKeyValSep",handler:Ln.objKey},closeCurl:{toState:"expectBinOp"}}},expectKeyValSep:{tokenTypes:{colon:{toState:"objVal"}}},postTransform:{tokenTypes:{openParen:{toState:"argVal"},binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},postArgs:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},identifier:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},openParen:{toState:"argVal",handler:Ln.functionCall},pipe:{toState:"expectTransform"},question:{toState:"ternaryMid",handler:Ln.ternaryStart}},completable:!0},traverse:{tokenTypes:{identifier:{toState:"identifier"}}},filter:{subHandler:Ln.filter,endStates:{closeBracket:"identifier"}},subExpression:{subHandler:Ln.subExpression,endStates:{closeParen:"expectBinOp"}},argVal:{subHandler:Ln.argVal,endStates:{comma:"argVal",closeParen:"postArgs"}},objVal:{subHandler:Ln.objVal,endStates:{comma:"expectObjKey",closeCurl:"expectBinOp"}},arrayVal:{subHandler:Ln.arrayVal,endStates:{comma:"arrayVal",closeBracket:"expectBinOp"}},ternaryMid:{subHandler:Ln.ternaryMid,endStates:{colon:"ternaryEnd"}},ternaryEnd:{subHandler:Ln.ternaryEnd,completable:!0}}},Hn=pn(vn),zn=pn(mn),Wn=Fn.states,Yn=function(){function e(t,r,n){(0,Hn.default)(this,e),this._grammar=t,this._state="expectOperand",this._tree=null,this._exprStr=r||"",this._relative=!1,this._stopMap=n||{}}return(0,zn.default)(e,[{key:"addToken",value:function(e){if("complete"===this._state)throw new Error("Cannot add a new token to a completed Parser");var t=Wn[this._state],r=this._exprStr;if(this._exprStr+=e.raw,t.subHandler){this._subParser||this._startSubExpression(r);var n=this._subParser.addToken(e);if(n){if(this._endSubExpression(),this._parentStop)return n;this._state=n}}else{if(!t.tokenTypes[e.type]){if(this._stopMap[e.type])return this._stopMap[e.type];throw new Error("Token ".concat(e.raw," (").concat(e.type,") unexpected in expression: ").concat(this._exprStr))}var o=t.tokenTypes[e.type],i=Ln[e.type];o.handler&&(i=o.handler),i&&i.call(this,e),o.toState&&(this._state=o.toState)}return!1}},{key:"addTokens",value:function(e){e.forEach(this.addToken,this)}},{key:"complete",value:function(){if(this._cursor&&!Wn[this._state].completable)throw new Error("Unexpected end of expression: ".concat(this._exprStr));return this._subParser&&this._endSubExpression(),this._state="complete",this._cursor?this._tree:null}},{key:"isRelative",value:function(){return this._relative}},{key:"_endSubExpression",value:function(){Wn[this._state].subHandler.call(this,this._subParser.complete()),this._subParser=null}},{key:"_placeAtCursor",value:function(e){this._cursor?(this._cursor.right=e,this._setParent(e,this._cursor)):this._tree=e,this._cursor=e}},{key:"_placeBeforeCursor",value:function(e){this._cursor=this._cursor._parent,this._placeAtCursor(e)}},{key:"_setParent",value:function(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}},{key:"_startSubExpression",value:function(t){var r=Wn[this._state].endStates;r||(this._parentStop=!0,r=this._stopMap),this._subParser=new e(this._grammar,t,r)}}]),e}(),Kn=pn(vn),Vn=pn(mn),Gn=function(){function e(t){(0,Kn.default)(this,e),t(this._resolve.bind(this),this._reject.bind(this))}return(0,Vn.default)(e,[{key:"catch",value:function(e){if(this.error)try{this._resolve(e(this.error))}catch(e){this._reject(e)}return this}},{key:"then",value:function(e,t){if(!this.error)try{this._resolve(e(this.value))}catch(e){this._reject(e)}return t&&this.catch(t),this}},{key:"_reject",value:function(e){this.value=void 0,this.error=e}},{key:"_resolve",value:function(t){t instanceof e?t.error?this._reject(t.error):this._resolve(t.value):(this.value=t,this.error=void 0)}}]),e}();Gn.all=function(e){return new Gn((function(t){t(e.map((function(e){for(;e instanceof Gn;){if(e.error)throw Error(e.error);e=e.value}return e})))}))},Gn.resolve=function(e){return new Gn((function(t){return t(e)}))},Gn.reject=function(e){return new Gn((function(t,r){return r(e)}))};var Qn=Gn,Jn=pn(vn),Xn=pn(mn),$n=function(){function e(t,r){(0,Jn.default)(this,e),this._grammar=t,this._exprStr=r,this._ast=null}return(0,Xn.default)(e,[{key:"compile",value:function(){var e=new qn(this._grammar),t=new Yn(this._grammar),r=e.tokenize(this._exprStr);return t.addTokens(r),this._ast=t.complete(),this}},{key:"eval",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._eval(e,Promise)}},{key:"evalSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._eval(e,Qn);if(t.error)throw t.error;return t.value}},{key:"_eval",value:function(e,t){var r=this;return t.resolve().then((function(){var n=r._getAst();return new kn(r._grammar,e,void 0,t).eval(n)}))}},{key:"_getAst",value:function(){return this._ast||this.compile(),this._ast}}]),e}(),Zn=function(){return{elements:{".":{type:"dot"},"[":{type:"openBracket"},"]":{type:"closeBracket"},"|":{type:"pipe"},"{":{type:"openCurl"},"}":{type:"closeCurl"},":":{type:"colon"},",":{type:"comma"},"(":{type:"openParen"},")":{type:"closeParen"},"?":{type:"question"},"+":{type:"binaryOp",precedence:30,eval:function(e,t){return e+t}},"-":{type:"binaryOp",precedence:30,eval:function(e,t){return e-t}},"*":{type:"binaryOp",precedence:40,eval:function(e,t){return e*t}},"/":{type:"binaryOp",precedence:40,eval:function(e,t){return e/t}},"//":{type:"binaryOp",precedence:40,eval:function(e,t){return Math.floor(e/t)}},"%":{type:"binaryOp",precedence:50,eval:function(e,t){return e%t}},"^":{type:"binaryOp",precedence:50,eval:function(e,t){return Math.pow(e,t)}},"==":{type:"binaryOp",precedence:20,eval:function(e,t){return e==t}},"!=":{type:"binaryOp",precedence:20,eval:function(e,t){return e!=t}},">":{type:"binaryOp",precedence:20,eval:function(e,t){return e>t}},">=":{type:"binaryOp",precedence:20,eval:function(e,t){return e>=t}},"<":{type:"binaryOp",precedence:20,eval:function(e,t){return e<t}},"<=":{type:"binaryOp",precedence:20,eval:function(e,t){return e<=t}},"&&":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e?t.eval():e}))}},"||":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e||t.eval()}))}},in:{type:"binaryOp",precedence:20,eval:function(e,t){return"string"==typeof t?-1!==t.indexOf(e):!!Array.isArray(t)&&t.some((function(t){return t===e}))}},"!":{type:"unaryOp",precedence:1/0,eval:function(e){return!e}}},functions:{},transforms:{}}},eo=pn(gn),to=pn(vn),ro=pn(mn),no=Zn,oo=function(){function e(){(0,to.default)(this,e),this.expr=this.expr.bind(this),this._grammar=no()}return(0,ro.default)(e,[{key:"addBinaryOp",value:function(e,t,r,n){this._addGrammarElement(e,(0,eo.default)({type:"binaryOp",precedence:t},n?"evalOnDemand":"eval",r))}},{key:"addFunction",value:function(e,t){this._grammar.functions[e]=t}},{key:"addFunctions",value:function(e){for(var t in e)this._grammar.functions[t]=e[t]}},{key:"addUnaryOp",value:function(e,t){this._addGrammarElement(e,{type:"unaryOp",weight:1/0,eval:t})}},{key:"addTransform",value:function(e,t){this._grammar.transforms[e]=t}},{key:"addTransforms",value:function(e){for(var t in e)this._grammar.transforms[t]=e[t]}},{key:"compile",value:function(e){return this.createExpression(e).compile()}},{key:"createExpression",value:function(e){return new $n(this._grammar,e)}},{key:"getFunction",value:function(e){return this._grammar.functions[e]}},{key:"getTransform",value:function(e){return this._grammar.transforms[e]}},{key:"eval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.eval(t)}},{key:"evalSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.evalSync(t)}},{key:"expr",value:function(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=e.reduce((function(e,t,n){return e+=t+(n<r.length?r[n]:"")}),"");return this.createExpression(o)}},{key:"removeOp",value:function(e){!this._grammar.elements[e]||"binaryOp"!==this._grammar.elements[e].type&&"unaryOp"!==this._grammar.elements[e].type||delete this._grammar.elements[e]}},{key:"_addGrammarElement",value:function(e,t){this._grammar.elements[e]=t}}]),e}(),io=new oo,ao=oo;io.Jexl=ao;var uo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.loadConfigs=t.getLovAttributesToRetrieve=t.exchangeRatesFromResponse=t.evaluateHsoConfigs=void 0;var r=St.__importDefault(io);function n(e){var t={};return e.forEach((function(e){var r=e.objectID,n=e.rate;t[r]=n})),t}function o(e){var t=un.getTranslatedAttributes(e,["value"]);return St.__spreadArrays(["id","categoryID","objectID"],t)}r.default.addTransform("map",(function(e,t){return e.map((function(e){return t.replace(/%s/g,e)}))})),t.evaluateHsoConfigs=function(e,t){void 0===t&&(t=[]);var n=[];return t.some((function(t){try{r.default.evalSync(t.criteria,e)&&(n=t.value.map((function(t){return r.default.evalSync(t,e)})))}catch(e){}return n.length>0})),n},t.exchangeRatesFromResponse=n,t.getLovAttributesToRetrieve=o,t.loadConfigs=function(e,t,r){var i,a,u,s,c=e.search;return St.__awaiter(this,void 0,void 0,(function(){var e,l,f,d,h,p,g,v,y,m,b;return St.__generator(this,(function(_){switch(_.label){case 0:return e=r.currencies,l=r.languages,f=r.variations,d=e.map((function(e){return"objectID:"+e})),h=un.pickIndexVariation(t.hsoIndex,f),p=(null==h?void 0:h.objectID)?["objectID:"+h.objectID]:void 0,g=[{indexName:h.name,params:{facetFilters:p,attributesToHighlight:[],getRankingInfo:!1}},{indexName:t.lovIndex,params:{hitsPerPage:1e3,attributesToRetrieve:o(l),attributesToHighlight:[],getRankingInfo:!1}},{indexName:t.currencyIndex,params:{hitsPerPage:d.length,query:"",attributesToRetrieve:["rate"],attributesToHighlight:[],facetFilters:[d],getRankingInfo:!1}}],[4,c(g)];case 1:return v=_.sent().results,y=null===(i=v[0])||void 0===i?void 0:i.hits,m=null===(a=v[1])||void 0===a?void 0:a.hits,b=null===(u=v[2])||void 0===u?void 0:u.hits,[2,{hso:null===(s=y[0])||void 0===s?void 0:s.hso,lov:m,exchangeRates:n(b)}]}}))}))}})),so=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),St.__exportStar(sn,t),St.__exportStar(dn,t),St.__exportStar(un,t),St.__exportStar(ln,t),St.__exportStar(hn,t),St.__exportStar(uo,t)})),co=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.getRequestSize=t.prepareSearchParameters=void 0;function r(e,t,r,n){var o,i=St.__assign(St.__assign({},t),{offset:r,anchorHotelId:n});if(null===(o=i.boundingBox)||void 0===o?void 0:o.length)return i;var a=e.polygon;return(null==a?void 0:a.length)?St.__assign(St.__assign({},i),{polygon:a}):e._geoloc?St.__assign(St.__assign({},i),{geolocation:e._geoloc}):i}function n(e,t){var r=e.rooms,n=void 0===r?"2":r,o=Qr.getCheckInCheckOutDates(e,t),i=o.checkIn,a=o.checkOut;return St.__assign(St.__assign({},e),{checkIn:i,checkOut:a,rooms:n})}function o(e,t,r){var n,o,i=e.anchor,a=e.anchorType;return void 0!==i.pageSize&&i.pageSize>=r.pageSize&&void 0===(null===(n=t.filters)||void 0===n?void 0:n.priceMin)&&void 0===(null===(o=t.filters)||void 0===o?void 0:o.priceMax)&&"price"!==t.sortField?i.pageSize:"hotel"===a?45:65}t.prepareSearchParameters=n,t.getRequestSize=o,t.search=function(e){var t=this,i=e.getFeatureEnabled,a=e.profile,u=e.algoliaClient,s=e.raaClient,c=e.options,l=e.configs,f=l.hso,d=l.exchangeRates,h=c.languages,p=d[c.currency],g=i("offers");return function(e,i){return void 0===i&&(i={}),St.__awaiter(t,void 0,void 0,(function(){var t,l,d,v,y,m,b,_,w,O,T,S,x,P,I,E=this;return St.__generator(this,(function(k){switch(k.label){case 0:return t=Qr.createState({}),l=0,d=i.onStart,v=i.onAnchorReceived,y=i.onHotelsReceived,m=i.onOffersReceived,b=i.onComplete,_=n(e,a),w=Qr.generateSearchId(e,c),t.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof d&&d(t.current()),[4,so.getAnchor(u,a,c)(_)];case 1:return O=k.sent(),t.update((function(e){var t,r;if(e.anchor=O.anchor,e.anchorType=O.anchorType,void 0!==O.anchorHotel){var n=O.anchorHotel.objectID;e.anchorHotelId=n,e.hotelEntities=St.__assign(St.__assign({},null!==(r=e.hotelEntities)&&void 0!==r?r:{}),((t={})[n]=O.anchorHotel,t))}})),"function"==typeof v&&v(t.current()),T="hotel"===O.anchorType?"hotel_search":"place_search",S=f[T],x=so.geoSearch(u,a,{languages:h,exchangeRate:p,priceBucketWidth:O.anchor.priceBucketWidth,requestSize:o(O,_,c),hsoFilter:so.evaluateHsoConfigs({anchorHotel:O.anchorHotel,searchParameters:_,checkInNights:so.getCheckInNights(_.checkIn,_.checkOut)},S)}),[4,(P=function(e){return void 0===e&&(e=0),St.__awaiter(E,void 0,void 0,(function(){var n,o,i,a,u,l,f,d;return St.__generator(this,(function(h){switch(h.label){case 0:return!0===_.skipGeoSearch?[3,2]:[4,x(r(O.anchor,_,e,null===(l=O.anchorHotel)||void 0===l?void 0:l.objectID))];case 1:n=h.sent(),t.update((function(e){var t;e.facets=n.facets,e.resultsCount=n.resultsCount,e.resultsCountTotal=n.resultsCountTotal,e.offset=n.offset,e.hotelIds=n.hotelIds,e.hotelEntities=St.__assign(St.__assign({},null!==(t=e.hotelEntities)&&void 0!==t?t:{}),n.hotelEntities),e.hotelsHaveStaticPosition=function(e,t,r){var n,o,i,a;if("price"===e.sortField)return!1;if(void 0!==(null===(n=e.filters)||void 0===n?void 0:n.priceMin)||void 0!==(null===(o=e.filters)||void 0===o?void 0:o.priceMax))return!1;if(r){var u=so.getCheckInNights(e.checkIn,e.checkOut);return(null!==(a=null===(i=r.tags)||void 0===i?void 0:i["a"+u])&&void 0!==a?a:0)>=t}return!0}(_,c.pageSize,n.facets)})),t.update((function(e){Object.keys(e.hotelEntities).forEach((function(t){e.hotelEntities[t]=Qr.augmentHotelWithRegularPriceRange(e.hotelEntities[t],p,e.anchor.priceBucketWidth)}))})),h.label=2;case 2:return"function"==typeof y&&y(t.current()),g&&void 0!==s?(o=t.get("hotelIds"),i=St.__assign(St.__assign({},_),{searchId:w,destination:null!==(f=null==o?void 0:o.join(","))&&void 0!==f?f:"",anchorDestination:null===(d=O.anchorHotel)||void 0===d?void 0:d.objectID}),[4,s.getOffers(i,(function(e){var r=en.augmentRaaResponse(e,St.__assign(St.__assign(St.__assign(St.__assign({},i),O.anchor),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:p}));t.update((function(e){e.hotelIds=r.anchorHotelId?e.hotelIds:r.hotelIds,e.hotelOfferEntities=r.hotelOfferEntities})),"function"==typeof m&&m(t.current())}))]):[3,4];case 3:a=h.sent(),u=en.augmentRaaResponse(a,St.__assign(St.__assign(St.__assign(St.__assign({},i),O.anchor),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:p})),t.update((function(e){e.hotelIds=u.hotelIds,e.hotelOfferEntities=u.hotelOfferEntities})),t.update((function(e){e.dealScores=Qr.getDealScores(e)})),h.label=4;case 4:return"function"==typeof b&&b(t.current()),[2,t.current()]}}))}))})(_.offset)];case 2:return I=k.sent(),[2,{loadOffers:function(e){return St.__awaiter(E,void 0,void 0,(function(){var t,r,n,o,i;return St.__generator(this,(function(a){switch(a.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!g||!s)throw new Error("Offers loading is disabled");return t=e===I.anchorHotelId,r=St.__assign(St.__assign({},_),{searchId:w,getAllOffers:!0,destination:t?void 0:e,anchorDestination:t?e:void 0}),[4,s.getOffers(r)];case 1:return n=a.sent(),o=en.augmentRaaResponse(n,St.__assign(St.__assign(St.__assign(St.__assign({},r),O.anchor),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:p})),[2,null===(i=o.hotelOfferEntities)||void 0===i?void 0:i[e]]}}))}))},loadMore:function(){return St.__awaiter(E,void 0,void 0,(function(){return St.__generator(this,(function(e){return l+=o(O,_,c),[2,P(l)]}))}))}}]}}))}))}}}));var lo=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],a=[],u={},s=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:s,headers:{keys:function(){return i},entries:function(){return a},get:function(e){return u[e.toLowerCase()]},has:function(e){return e.toLowerCase()in u}}}};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){i.push(t=t.toLowerCase()),a.push([t,r]),u[t]=u[t]?u[t]+","+r:r})),r(s())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),fo={};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;fo.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,r){var n=e.create,o=e.defineProperty,i=/[!'\(\)~]|%20|%00/g,a=/%(?![0-9a-fA-F]{2})/g,u=/\+/g,s={"!":"%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(i,o);function i(i){e.call(r,i,t(o),n)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var r=g(t),n=0,o=this._ungap[t];n<o.length;n++)e.push(r+"="+g(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 i=e.split("&"),a=0,u=i.length;a<u;a++){var s=(c=i[a]).indexOf("=");-1<s?h(t,p(c.slice(0,s)),p(c.slice(s+1))):c.length&&h(t,p(c),"")}break;case r(e):for(a=0,u=e.length;a<u;a++){var c;h(t,(c=e[a])[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(a,"%25").replace(u," "))}function g(e){return encodeURIComponent(e).replace(i,v)}function v(e){return s[e]}fo.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(),i=o.done,a=[],u=Object.create(null);!i;)t=(r=o.value)[0],a.push(t),t in u||(u[t]=[]),u[t].push(r[1]),i=(o=n.next()).done;for(a.sort(),e=0;e<a.length;e++)this.delete(a[e]);for(e=0;e<a.length;e++)t=a[e],this.append(t,u[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},i=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},a=function(a){var u,s,c=a.prototype,l=n(c,"searchParams"),f=n(c,"href"),d=n(c,"search");!l&&d&&d.set&&(s=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 i(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=i,r(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),u=function(e,t){return r(e,"_searchParams",{configurable:!0,writable:!0,value:s(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 i(this,a),this._searchParams||u(this,new URLSearchParams(this.search.slice(1)))},set:function(e){i(this,a),u(this,e)}}}))};try{a(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&a(URL)}catch(e){}}(Object)}(fo.URLSearchParams.prototype);var ho=fo.URLSearchParams,po=Object.freeze({__proto__:null,default:ho}),go=r(lo),vo=r(po),yo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.backendSearch=t.createRequestString=void 0;var r=St.__importDefault(go),n=St.__importDefault(vo);function o(e){var t,r,o,i,a,u,s,c,l,f,d,h,p,g,v,y,m,b,_,w=e.profileKey,O=e.searchParameters,T=e.options,S=e.offset,x=e.attributes,P=Qr.removeEmpty({offset:S,profileId:w,query:O.query,hotelId:O.hotelId,placeId:O.placeId,checkIn:O.checkIn,checkOut:O.checkOut,rooms:O.rooms,dayDistance:O.dayDistance,nights:O.nights,sortField:O.sortField,sortOrder:O.sortOrder,boundingBox:null===(t=O.boundingBox)||void 0===t?void 0:t.join(","),currency:T.currency,language:T.language,variations:null===(r=T.variations)||void 0===r?void 0:r.join(","),starRating:null===(i=null===(o=O.filters)||void 0===o?void 0:o.starRating)||void 0===i?void 0:i.join(","),guestRating:null===(u=null===(a=O.filters)||void 0===a?void 0:a.guestRating)||void 0===u?void 0:u.join(","),propertyTypeId:null===(c=null===(s=O.filters)||void 0===s?void 0:s.propertyTypeId)||void 0===c?void 0:c.join(","),facilities:null===(f=null===(l=O.filters)||void 0===l?void 0:l.facilities)||void 0===f?void 0:f.join(","),themeIds:null===(h=null===(d=O.filters)||void 0===d?void 0:d.themeIds)||void 0===h?void 0:h.join(","),chainIds:null===(g=null===(p=O.filters)||void 0===p?void 0:p.chainIds)||void 0===g?void 0:g.join(","),noHostels:null===(v=O.filters)||void 0===v?void 0:v.noHostels,priceMin:null===(y=O.filters)||void 0===y?void 0:y.priceMin,priceMax:null===(m=O.filters)||void 0===m?void 0:m.priceMax,hotelName:null===(b=O.filters)||void 0===b?void 0:b.hotelName,freeCancellation:null===(_=O.filters)||void 0===_?void 0:_.freeCancellation,attributes:null==x?void 0:x.join(","),anonymousId:T.anonymousId});return new n.default(P).toString()}function i(e,t){var n=e.baseUrl,i=e.endpoints;return St.__awaiter(this,void 0,void 0,(function(){var e,a,u,s,c,l;return St.__generator(this,(function(f){switch(f.label){case 0:return e=o(t),[4,r.default(n+"/"+i.search+"?"+e)];case 1:return(a=f.sent()).ok?[2,a.json()]:(u=t.searchParameters,s=t.options,c=t.offset,l=t.attributes,s.logger.log({name:"SafSearchFailed",value:St.__assign(St.__assign({},u),{offset:c,attributes:l,language:s.language,currency:s.currency,deviceCategory:s.deviceCategory})}),[2,Promise.reject(a)])}}))}))}t.createRequestString=o,t.backendSearch=function(e){var t,r=this,n=e.getFeatureEnabled,o=e.profile,a=e.profileKey,u=e.backendConfig,s=e.raaClient,c=e.options,l=n("offers"),f=!1;return function(e,n){return void 0===n&&(n={}),St.__awaiter(r,void 0,void 0,(function(){var r,d,h,p,g,v,y,m,b,_,w=this;return St.__generator(this,(function(O){switch(O.label){case 0:return r=Qr.createState({}),d=n.onStart,h=n.onAnchorReceived,p=n.onHotelsReceived,g=n.onOffersReceived,v=n.onComplete,y=0,m=co.prepareSearchParameters(e,o),b=Qr.generateSearchId(e,c),r.update((function(e){e.searchParameters=m,e.searchId=b})),"function"==typeof d&&d(r.current()),_=function(e,n){return void 0===e&&(e=0),St.__awaiter(w,void 0,void 0,(function(){var o,d,y,_,w,O,T;return St.__generator(this,(function(S){switch(S.label){case 0:return[4,i(u,{profileKey:a,searchParameters:m,options:c,offset:e,attributes:n})];case 1:return o=S.sent(),f||(t=o.exchangeRates[c.currency],(null===(O=c.callbacks)||void 0===O?void 0:O.onConfigReceived)&&c.callbacks.onConfigReceived({lov:o.lov,exchangeRates:o.exchangeRates}),f=!0),(void 0===n||n.includes("anchor"))&&(r.update((function(e){e.anchor=o.anchor,e.anchorHotelId=o.anchorHotelId,e.anchorType=o.anchorType,e.hotelEntities=o.hotelEntities})),"function"==typeof h&&h(r.current())),r.update((function(e){e.facets=o.facets,e.hotelEntities=o.hotelEntities,e.hotelIds=o.hotelIds,e.hotelsHaveStaticPosition=o.hotelsHaveStaticPosition,e.offset=o.offset,e.resultsCount=o.resultsCount,e.resultsCountTotal=o.resultsCountTotal})),"function"==typeof p&&p(r.current()),l&&void 0!==s?(d=r.get("hotelIds"),y=St.__assign(St.__assign({},m),{searchId:b,destination:null!==(T=null==d?void 0:d.join(","))&&void 0!==T?T:"",anchorDestination:r.get("anchorHotelId")}),[4,s.getOffers(y,(function(e){var n=en.augmentRaaResponse(e,St.__assign(St.__assign(St.__assign(St.__assign({},y),r.get("anchor")),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:t}));r.update((function(e){e.hotelIds=n.anchorHotelId?e.hotelIds:n.hotelIds,e.hotelOfferEntities=n.hotelOfferEntities})),"function"==typeof g&&g(r.current())}))]):[3,3];case 2:_=S.sent(),w=en.augmentRaaResponse(_,St.__assign(St.__assign(St.__assign(St.__assign({},y),r.get("anchor")),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:t})),r.update((function(e){e.hotelIds=w.hotelIds,e.hotelOfferEntities=w.hotelOfferEntities})),r.update((function(e){e.dealScores=Qr.getDealScores(e)})),S.label=3;case 3:return"function"==typeof v&&v(r.current()),[2,r.current()]}}))}))},[4,f?_(m.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition"]):_(m.offset)];case 1:return O.sent(),[2,{loadOffers:function(e){return St.__awaiter(w,void 0,void 0,(function(){var n,o,i,a,u;return St.__generator(this,(function(f){switch(f.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!l||!s)throw new Error("Offers loading is disabled");return n=e===r.get("anchorHotelId"),o=St.__assign(St.__assign({},m),{searchId:b,getAllOffers:!0,destination:n?void 0:e,anchorDestination:n?e:void 0}),[4,s.getOffers(o)];case 1:return i=f.sent(),a=en.augmentRaaResponse(i,St.__assign(St.__assign(St.__assign(St.__assign({},o),r.get("anchor")),c),{priceBucketsCount:fn.PRICE_BUCKET_COUNT,exchangeRate:t})),[2,null===(u=a.hotelOfferEntities)||void 0===u?void 0:u[e]]}}))}))},loadMore:function(){return St.__awaiter(w,void 0,void 0,(function(){return St.__generator(this,(function(e){var t,n;return y+=co.getRequestSize({anchor:r.get("anchor"),anchorHotel:(t=r.get("hotelEntities"),n=r.get("anchorHotelId"),n?t[n]:void 0),anchorType:r.get("anchorType")},m,c),[2,_(y,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"])]}))}))}}]}}))}))}}})),mo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0,t.suggest=function(e){var t=this,r=e.profile,n=e.algoliaClient,o=e.options.languages;return function(e,i){return St.__awaiter(t,void 0,void 0,(function(){return St.__generator(this,(function(t){switch(t.label){case 0:return[4,so.loadSuggests(n,r,{suggestsCount:i,languages:o})(e)];case 1:return[2,t.sent()]}}))}))}}})),bo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var r=St.__importDefault(go),n=St.__importDefault(vo);function o(e,t){var r,o=e.hotelId,i=e.checkIn,a=e.checkOut,u=e.rooms,s=e.providerCode,c=e.cugDeals,l=Qr.removeEmpty({hotelId:o,checkIn:i,checkOut:a,rooms:u,providerCode:s,cugDeals:c,deviceType:t.deviceCategory,language:t.language,currency:t.currency,aid:t.anonymousId,variations:null===(r=t.variations)||void 0===r?void 0:r.join(",")});return new n.default(l).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,n=e.options,i=e.safConfig,a=i.baseUrl,u=i.endpoints;return function(e){return St.__awaiter(t,void 0,void 0,(function(){var t,i,s;return St.__generator(this,(function(c){switch(c.label){case 0:return t=o(e,n),[4,r.default(a+"/"+u.offersRooms+"?"+t)];case 1:return(i=c.sent()).ok?[4,i.json()]:[3,3];case 2:return s=c.sent(),[2,St.__assign({hotelId:e.hotelId,anonymousId:n.anonymousId},s)];case 3:return[2,Promise.reject(i)]}}))}))}}})),_o=t((function(e,t){function r(){if("undefined"!=typeof location)return"http:"===location.protocol?"ws://"+location.host:"https:"===location.protocol?"wss://"+location.host:void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.getProfile=void 0,t.getProfile=function(e,t){var n,o,i=fn.profiles[e];if(void 0===i)throw new Error("Profile key is not valid");return void 0!==t&&(i=St.__assign(St.__assign({},i),t)),(null===(n=i.features)||void 0===n?void 0:n.includes("offers"))&&void 0===(null===(o=i.raa)||void 0===o?void 0:o.endpoint)&&(i=St.__assign(St.__assign({},i),{raa:{endpoint:r()}})),i}})),wo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=void 0;var r=St.__importDefault(d),n={log:function(){}};function o(e){void 0===e&&(e={});var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r+"-"+e[r]);return t}t.sapi=function(e,t){var i,a,u,s,c,l,f,d;return St.__awaiter(this,void 0,void 0,(function(){function h(e){return m.features.includes(e)}var p,g,v,y,m,b,_,w,O,T,S,x,P;return St.__generator(this,(function(I){switch(I.label){case 0:if(!e)throw new Error("Profile key is required");return p=St.__assign(St.__assign({},t),{logger:null!==(i=t.logger)&&void 0!==i?i:n,variations:o(t.variations),currency:null!==(u=null===(a=t.currency)||void 0===a?void 0:a.toUpperCase())&&void 0!==u?u:"USD",deviceCategory:null!==(s=t.deviceCategory)&&void 0!==s?s:"desktop",pageSize:null!==(c=t.pageSize)&&void 0!==c?c:20}),g=null===(l=p.variations)||void 0===l?void 0:l.includes("c48b82da-sapi-backend-b"),v=fn.getSafConfig(e),y=fn.getBackendConfig(e),m=_o.getProfile(e,p.initWithProfile),b=r.default("4UYGJP42KQ",m.algolia.apiKey,p.algoliaClientOptions),_=h("offers")&&m.raa.endpoint?en.raa(m.raa.endpoint,p):void 0,w={safConfig:v,backendConfig:y,algoliaClient:b,getFeatureEnabled:h,profile:m,profileKey:e,raaClient:_,options:St.__assign(St.__assign({},p),{languages:St.__spreadArrays([p.language],null!==(f=m.fallbackLanguages[p.language])&&void 0!==f?f:[],["en"])})},g||!h("configs")?[3,2]:[4,so.loadConfigs(b,m,St.__assign(St.__assign({},w.options),{currencies:[p.currency,"EUR"]}))];case 1:O=I.sent(),(null===(d=p.callbacks)||void 0===d?void 0:d.onConfigReceived)&&(T=O.exchangeRates,S=O.lov,p.callbacks.onConfigReceived({exchangeRates:T,lov:S})),w.configs=O,I.label=2;case 2:return x=function(e){return h("search")?g?yo.backendSearch(e):co.search(e):function(){throw new Error("Search is disabled for this Profile key")}},P=function(e){return h("suggests")?mo.suggest(e):function(){throw new Error("Autosuggest is disabled for this Profile key")}},[2,{rooms:function(e){return h("rooms")?bo.rooms(e):function(){throw new Error("Rooms search is disabled for this Profile key")}}(w),search:x(w),suggest:P(w)}]}}))}))}})),Oo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),To=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),So=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),xo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Po=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),St.__exportStar(Oo,t),St.__exportStar(To,t),St.__exportStar(So,t),St.__exportStar(xo,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),zr.enableES5(),St.__exportStar(wo,t),St.__exportStar(Po,t),t.default=wo.sapi})))}));
|