@findhotel/sapi 0.24.0 → 0.24.1
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/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,n){return e(n={path:t,exports:{},require:function(e,t){return r(null==t&&n.path)}},n.exports),n.exports}function n(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function r(){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 n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};var a=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function u(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.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 f=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var l=Object.freeze({__proto__:null,__extends:function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return i},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},__decorate:function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},__generator:function(e,t){var n,r,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(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=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++,r=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],r=0}finally{n=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 n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)},__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,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r},__spreadArray:function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},__await:c,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof c?Promise.resolve(e.value.v).then(s,f):l(i[0][2],e)}(o[e](t))}catch(e){l(i[0][3],e)}}function s(e){u("next",e)}function f(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:c(e[r](t)),done:"return"===r}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=u(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return f(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},__classPrivateFieldSet:function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}});var d=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(n,r){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,n){i.push(t=t.toLowerCase()),a.push([t,n]),u[t]=u[t]?u[t]+","+n:n})),n(s())},o.onerror=r,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),h={};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;h.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,n){var r=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){p(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,n){this._ungap[e]=[t(n)]},forEach:function(e,n){var r=this;for(var o in r._ungap)r._ungap[o].forEach(i,o);function i(i){e.call(n,i,t(o),r)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var n=v(t),r=0,o=this._ungap[t];r<o.length;r++)e.push(n+"="+v(o[r]));return e.join("&")}};for(var f in c)o(l.prototype,f,{configurable:!0,writable:!0,value:c[f]});function l(e){var t=r(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?p(t,g(c.slice(0,s)),g(c.slice(s+1))):c.length&&p(t,g(c),"")}break;case n(e):for(a=0,u=e.length;a<u;a++){var c;p(t,(c=e[a])[0],c[1])}break;case"forEach"in e:e.forEach(d,t);break;default:for(var f in e)p(t,f,e[f])}}function d(e,t){p(this,t,e)}function p(e,t,r){var o=n(r)?r.join(","):r;t in e?e[t].push(o):e[t]=[o]}function g(e){return decodeURIComponent(e.replace(a,"%25").replace(u," "))}function v(e){return encodeURIComponent(e).replace(i,y)}function y(e){return s[e]}h.URLSearchParams=l}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function n(e,n){var r=[];return e.forEach(n,r),t?r[Symbol.iterator]():{next:function(){var e=r.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var n=this,r=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(o){o.length&&!(o in r)&&(r[o]=n.getAll(o)).forEach((function(r){e.call(t,r,o,n)}))}))}),"keys"in e||(e.keys=function(){return n(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return n(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return n(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,n,r=this.entries(),o=r.next(),i=o.done,a=[],u=Object.create(null);!i;)t=(n=o.value)[0],a.push(t),t in u||(u[t]=[]),u[t].push(n[1]),i=(o=r.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 n=t.defineProperty,r=t.getOwnPropertyDescriptor,o=function(t){var n=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=n},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,f=r(c,"searchParams"),l=r(c,"href"),d=r(c,"search");!f&&d&&d.set&&(s=function(t){function r(n,r){e.append.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function o(n){e.delete.call(this,n),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function i(n,r){e.set.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}return function(e,t){return e.append=r,e.delete=o,e.set=i,n(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),u=function(e,t){return n(e,"_searchParams",{configurable:!0,writable:!0,value:s(t,e)}),t},t.defineProperties(c,{href:{get:function(){return l.get.call(this)},set:function(e){var t=this._searchParams;l.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)}(h.URLSearchParams.prototype);var p=h.URLSearchParams,g=Object.freeze({__proto__:null,default:p}),v=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})))}})),y=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDiscount=void 0,t.calculateDiscount=function(e,t,n){return void 0===t||void 0===n||0===n?0:e<t?-1*(e-t)/t:e>n?-1*(e-n)/n:0}}));function m(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function b(e){m(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 _(e){m(1,arguments);var t=b(e);return!isNaN(t)}var w={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 O(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var I={date:O({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:O({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:O({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},S={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function P(e){return function(t,n){var r,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;r=e.formattingValues[a]||e.formattingValues[i]}else{var u=e.defaultWidth,s=o.width?String(o.width):e.defaultWidth;r=e.values[s]||e.values[u]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var T={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:P({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:P({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:P({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:P({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:P({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function E(e){return function(t,n){var r=String(t),o=n||{},i=o.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],u=r.match(a);if(!u)return null;var s,c=u[0],f=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth];return s="[object Array]"===Object.prototype.toString.call(f)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(f,(function(e){return e.test(c)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(f,(function(e){return e.test(c)})),s=e.valueCallback?e.valueCallback(s):s,{value:s=o.valueCallback?o.valueCallback(s):s,rest:r.slice(c.length)}}}var j,x={ordinalNumber:(j={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},o=n.match(j.matchPattern);if(!o)return null;var i=o[0],a=n.match(j.parsePattern);if(!a)return null;var u=j.valueCallback?j.valueCallback(a[0]):a[0];return{value:u=r.valueCallback?r.valueCallback(u):u,rest:n.slice(i.length)}}),era:E({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:E({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:E({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:E({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:E({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},D={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof w[e]?w[e]:1===t?w[e].one:w[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:I,formatRelative:function(e,t,n,r){return S[e]},localize:T,match:x,options:{weekStartsOn:0,firstWeekContainsDate:1}};function C(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 k(e,t){m(2,arguments);var n=b(e).getTime(),r=C(t);return new Date(n+r)}function A(e,t){m(2,arguments);var n=C(t);return k(e,-n)}function N(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var M=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return N("yy"===t?r%100:r,t.length)},R=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):N(n+1,2)},U=function(e,t){return N(e.getUTCDate(),t.length)},B=function(e,t){return N(e.getUTCHours()%12||12,t.length)},q=function(e,t){return N(e.getUTCHours(),t.length)},L=function(e,t){return N(e.getUTCMinutes(),t.length)},F=function(e,t){return N(e.getUTCSeconds(),t.length)},H=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return N(Math.floor(r*Math.pow(10,n-3)),t.length)},W=864e5;function z(e){m(1,arguments);var t=1,n=b(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function Y(e){m(1,arguments);var t=b(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=z(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=z(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function G(e){m(1,arguments);var t=Y(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=z(n);return r}var J=6048e5;function K(e,t){m(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,i=null==o?0:C(o),a=null==n.weekStartsOn?i:C(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=b(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 Q(e,t){m(1,arguments);var n=b(e,t),r=n.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,u=null==a?1:C(a),s=null==o.firstWeekContainsDate?u:C(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(r+1,0,s),c.setUTCHours(0,0,0,0);var f=K(c,t),l=new Date(0);l.setUTCFullYear(r,0,s),l.setUTCHours(0,0,0,0);var d=K(l,t);return n.getTime()>=f.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function V(e,t){m(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.firstWeekContainsDate,i=null==o?1:C(o),a=null==n.firstWeekContainsDate?i:C(n.firstWeekContainsDate),u=Q(e,t),s=new Date(0);s.setUTCFullYear(u,0,a),s.setUTCHours(0,0,0,0);var c=K(s,t);return c}var X=6048e5;var $="midnight",Z="noon",ee="morning",te="afternoon",ne="evening",re="night",oe={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return M(e,t)},Y:function(e,t,n,r){var o=Q(e,r),i=o>0?o:1-o;return"YY"===t?N(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):N(i,t.length)},R:function(e,t){return N(Y(e),t.length)},u:function(e,t){return N(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return N(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return N(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return R(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return N(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){m(1,arguments);var n=b(e),r=K(n,t).getTime()-V(n,t).getTime();return Math.round(r/X)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):N(o,t.length)},I:function(e,t,n){var r=function(e){m(1,arguments);var t=b(e),n=z(t).getTime()-G(t).getTime();return Math.round(n/J)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):N(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):U(e,t)},D:function(e,t,n){var r=function(e){m(1,arguments);var t=b(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/W)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):N(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return N(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return N(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return N(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?Z:0===o?$:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?ne:o>=12?te:o>=4?ee:re,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return B(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):q(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):N(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):N(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):L(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):F(e,t)},S:function(e,t){return H(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return ae(o);case"XXXX":case"XX":return ue(o);default:return ue(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return ae(o);case"xxxx":case"xx":return ue(o);default:return ue(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ie(o,":");default:return"GMT"+ue(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ie(o,":");default:return"GMT"+ue(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return N(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return N((r._originalDate||e).getTime(),t.length)}};function ie(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+N(i,2)}function ae(e,t){return e%60==0?(e>0?"-":"+")+N(Math.abs(e)/60,2):ue(e,t)}function ue(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+N(Math.floor(o/60),2)+n+N(o%60,2)}function se(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}}function ce(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}}var fe={p:ce,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),o=r[1],i=r[2];if(!i)return se(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",se(o,t)).replace("{{time}}",ce(i,t))}},le=6e4;function de(e){return e.getTime()%le}function he(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var r=n>0?(le+de(t))%le:de(t);return n*le+r}var pe=["D","DD"],ge=["YY","YYYY"];function ve(e){return-1!==pe.indexOf(e)}function ye(e){return-1!==ge.indexOf(e)}function me(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; 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(n,"`; 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(n,"`; 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(n,"`; see: https://git.io/fxCyr"))}var be=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,we=/^'([^]*?)'?$/,Oe=/''/g,Ie=/[a-zA-Z]/;function Se(e){return e.match(we)[1].replace(Oe,"'")}var Pe=Object.freeze({__proto__:null,default:function(e,t,n){m(2,arguments);var r=String(t),o=n||{},i=o.locale||D,a=i.options&&i.options.firstWeekContainsDate,u=null==a?1:C(a),s=null==o.firstWeekContainsDate?u:C(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,f=null==c?0:C(c),l=null==o.weekStartsOn?f:C(o.weekStartsOn);if(!(l>=0&&l<=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=b(e);if(!_(d))throw new RangeError("Invalid time value");var h=he(d),p=A(d,h),g={firstWeekContainsDate:s,weekStartsOn:l,locale:i,_originalDate:d},v=r.match(_e).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,fe[t])(e,i.formatLong,g):e})).join("").match(be).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return Se(n);var a=oe[r];if(a)return!o.useAdditionalWeekYearTokens&&ye(n)&&me(n,t,e),!o.useAdditionalDayOfYearTokens&&ve(n)&&me(n,t,e),a(p,n,i.localize,g);if(r.match(Ie))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return v}});function Te(e,t){m(2,arguments);var n=b(e),r=C(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}var Ee=Object.freeze({__proto__:null,default:Te});function je(e,t){m(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,i=null==o?0:C(o),a=null==n.weekStartsOn?i:C(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var u=b(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 xe=Object.freeze({__proto__:null,default:function(e){return m(1,arguments),je(e,{weekStartsOn:1})}});var De=Object.freeze({__proto__:null,default:function(e,t){m(2,arguments);var n=C(t),r=7*n;return Te(e,r)}}),Ce=36e5,ke={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ae=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Me=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Re(e){var t,n={},r=e.split(ke.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1],ke.timeZoneDelimiter.test(n.date)&&(n.date=e.split(ke.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var o=ke.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}function Ue(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:null};var o=r[1]&&parseInt(r[1]),i=r[2]&&parseInt(r[2]);return{year:null==i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}function Be(e,t){if(null===t)return null;var n=e.match(Ae);if(!n)return null;var r=!!n[4],o=qe(n[1]),i=qe(n[2])-1,a=qe(n[3]),u=qe(n[4]),s=qe(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,u,s)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}(t,u,s):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(We[t]||(ze(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(ze(e)?366:365)}(t,o)?(c.setUTCFullYear(t,i,Math.max(o,a)),c):new Date(NaN)}function qe(e){return e?parseInt(e):1}function Le(e){var t=e.match(Ne);if(!t)return null;var n=Fe(t[1]),r=Fe(t[2]),o=Fe(t[3]);return function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?n*Ce+6e4*r+1e3*o:NaN}function Fe(e){return e&&parseFloat(e.replace(",","."))||0}function He(e){if("Z"===e)return 0;var t=e.match(Me);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(r*Ce+6e4*o):NaN}var We=[31,null,31,30,31,30,31,31,30,31,30,31];function ze(e){return e%400==0||e%4==0&&e%100}var Ye=Object.freeze({__proto__:null,default:function(e,t){m(1,arguments);var n=t||{},r=null==n.additionalDigits?2:C(n.additionalDigits);if(2!==r&&1!==r&&0!==r)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=Re(e);if(i.date){var a=Ue(i.date,r);o=Be(a.restDateString,a.year)}if(isNaN(o)||!o)return new Date(NaN);var u,s=o.getTime(),c=0;if(i.time&&(c=Le(i.time),isNaN(c)||null===c))return new Date(NaN);if(!i.timezone){var f=new Date(s+c),l=new Date(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds());return l.setFullYear(f.getUTCFullYear()),l}return u=He(i.timezone),isNaN(u)?new Date(NaN):new Date(s+c+u)}}),Ge=n(l),Je=n(Pe),Ke=n(Ee),Qe=n(xe),Ve=n(De),Xe=n(Ye),$e=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var n=Ge.__importDefault(Je),r=Ge.__importDefault(Ke),o=Ge.__importDefault(Qe),i=Ge.__importDefault(Ve),a=Ge.__importDefault(Xe);function u(e){return(0,a.default)("".concat(e," 12:00:00"))}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=u;var s=function(e,t){return(0,r.default)(e,t)};t.getCheckInCheckOutDates=function(e,a){var c,f=e.checkIn,l=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h,g=u((0,n.default)(new Date,t.DATE_FORMAT));c=void 0!==f?u(f):d?s(g,d):function(e){for(var a,s=e.daysFromNow,c=e.blockedDefaultDates,f=u((0,n.default)(new Date,t.DATE_FORMAT)),l=(0,o.default)((0,r.default)(f,s));a=(0,n.default)(l,t.DATE_FORMAT),c.includes(a);)l=(0,i.default)(l,1);return l}(a);var v=void 0===l?s(c,p):u(l);return{checkIn:(0,n.default)(c,t.DATE_FORMAT),checkOut:(0,n.default)(v,t.DATE_FORMAT)}}})),Ze=t((function(e,t){function n(e){void 0===e&&(e=[]);var t={},n={};e.forEach((function(e){var n=e[0],r=e[1],o=e[2],i=e[3];r&&(t[n]=(0,y.calculateDiscount)(r,o,i))}));var r=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===r?1:(t[i]-r)/(o-r):void 0;void 0!==s&&(n[i]=Number(s.toFixed(2)))})),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getDealScores=t.calculateDealScores=void 0,t.calculateDealScores=n,t.getDealScores=function(e){var t=e.offset,r=e.anchorHotelId,o=e.hotelIds,i=e.hotelEntities,a=e.hotelOfferEntities,u=(void 0===r||t>0?o:Ge.__spreadArray([r],o,!0)).map((function(e){var t,n,r,o=i[e],u=a[e],s=null!==(t=null==o?void 0:o.regularPriceRange)&&void 0!==t?t:[],c=s[0],f=s[1];return[e,null===(r=null===(n=null==u?void 0:u.offers)||void 0===n?void 0:n[0])||void 0===r?void 0:r.nightlyRate,c,f]}));return n(u)}})),et=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var a in t)Object.prototype.hasOwnProperty.call(r,a)||(n[a]=t[a]);return n}}));function tt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("production"!==process.env.NODE_ENV){var o=Qt[e],i=o?"function"==typeof o?o.apply(null,n):o:"unknown error nr: "+e;throw Error("[Immer] "+i)}throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function nt(e){return!!e&&!!e[Jt]}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 n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Vt}(e)||Array.isArray(e)||!!e[Gt]||!!e.constructor[Gt]||ft(e)||lt(e))}function ot(e,t,n){void 0===n&&(n=!1),0===it(e)?(n?Object.keys:Xt)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function it(e){var t=e[Jt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:ft(e)?2:lt(e)?3:0}function at(e,t){return 2===it(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ut(e,t){return 2===it(e)?e.get(t):e[t]}function st(e,t,n){var r=it(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function ct(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function ft(e){return Ht&&e instanceof Map}function lt(e){return Wt&&e instanceof Set}function dt(e){return e.o||e.t}function ht(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=$t(e);delete t[Jt];for(var n=Xt(t),r=0;r<n.length;r++){var o=n[r],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 pt(e,t){return void 0===t&&(t=!1),vt(e)||nt(e)||!rt(e)||(it(e)>1&&(e.set=e.add=e.clear=e.delete=gt),Object.freeze(e),t&&ot(e,(function(e,t){return pt(t,!0)}),!0)),e}function gt(){tt(2)}function vt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function yt(e){var t=Zt[e];return t||tt(18,e),t}function mt(e,t){Zt[e]||(Zt[e]=t)}function bt(){return"production"===process.env.NODE_ENV||Lt||tt(0),Lt}function _t(e,t){t&&(yt("Patches"),e.u=[],e.s=[],e.v=t)}function wt(e){Ot(e),e.p.forEach(St),e.p=null}function Ot(e){e===Lt&&(Lt=e.l)}function It(e){return Lt={p:[],l:Lt,h:e,m:!0,_:0}}function St(e){var t=e[Jt];0===t.i||1===t.i?t.j():t.O=!0}function Pt(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||yt("ES5").S(t,e,r),r?(n[Jt].P&&(wt(t),tt(4)),rt(e)&&(e=Tt(t,e),t.l||jt(t,e)),t.u&&yt("Patches").M(n[Jt],e,t.u,t.s)):e=Tt(t,n,[]),wt(t),t.u&&t.v(t.u,t.s),e!==Yt?e:void 0}function Tt(e,t,n){if(vt(t))return t;var r=t[Jt];if(!r)return ot(t,(function(o,i){return Et(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return jt(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=ht(r.k):r.o;ot(3===r.i?new Set(o):o,(function(t,i){return Et(e,r,o,t,i,n)})),jt(e,o,!1),n&&e.u&&yt("Patches").R(r,n,e.u,e.s)}return r.o}function Et(e,t,n,r,o,i){if("production"!==process.env.NODE_ENV&&o===n&&tt(5),nt(o)){var a=Tt(e,o,i&&t&&3!==t.i&&!at(t.D,r)?i.concat(r):void 0);if(st(n,r,a),!nt(a))return;e.m=!1}if(rt(o)&&!vt(o)){if(!e.h.F&&e._<1)return;Tt(e,o),t&&t.A.l||jt(e,o)}}function jt(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&pt(t,n)}function xt(e,t){var n=e[Jt];return(n?dt(n):e)[t]}function Dt(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Ct(e){e.P||(e.P=!0,e.l&&Ct(e.l))}function kt(e){e.o||(e.o=ht(e.t))}function At(e,t,n){var r=ft(t)?yt("MapSet").N(t,n):lt(t)?yt("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:bt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=en;n&&(o=[r],i=tn);var a=Proxy.revocable(o,i),u=a.revoke,s=a.proxy;return r.k=s,r.j=u,s}(t,n):yt("ES5").J(t,n);return(n?n.A:bt()).p.push(r),r}function Nt(e){return nt(e)||tt(22,e),function e(t){if(!rt(t))return t;var n,r=t[Jt],o=it(t);if(r){if(!r.P&&(r.i<4||!yt("ES5").K(r)))return r.t;r.I=!0,n=Mt(t,o),r.I=!1}else n=Mt(t,o);return ot(n,(function(t,o){r&&ut(r.t,t)===o||st(n,t,e(o))})),3===o?new Set(n):n}(e)}function Mt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return ht(e)}function Rt(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Jt];return"production"!==process.env.NODE_ENV&&o(t),en.get(t,e)},set:function(t){var n=this[Jt];"production"!==process.env.NODE_ENV&&o(n),en.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Jt];if(!o.P)switch(o.i){case 5:r(o)&&Ct(o);break;case 4:n(o)&&Ct(o)}}}function n(e){for(var t=e.t,n=e.k,r=Xt(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==Jt){var a=t[i];if(void 0===a&&!at(t,i))return!0;var u=n[i],s=u&&u[Jt];if(s?s.t!==a:!ct(u,a))return!0}}var c=!!t[Jt];return r.length!==Xt(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!n||n.get)}function o(e){e.O&&tt(3,JSON.stringify(dt(e)))}var i={};mt("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var i=$t(n);delete i[Jt];for(var a=Xt(i),u=0;u<a.length;u++){var s=a[u];i[s]=e(s,t||!!i[s].enumerable)}return Object.create(Object.getPrototypeOf(n),i)}(r,t),i={i:r?5:4,A:n?n.A:bt(),P:!1,I:!1,D:{},l:n,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,Jt,{value:i,writable:!0}),o},S:function(e,n,o){o?nt(n)&&n[Jt].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[Jt];if(n){var o=n.t,i=n.k,a=n.D,u=n.i;if(4===u)ot(i,(function(t){t!==Jt&&(void 0!==o[t]||at(o,t)?a[t]||e(i[t]):(a[t]=!0,Ct(n)))})),ot(o,(function(e){void 0!==i[e]||at(i,e)||(a[e]=!1,Ct(n))}));else if(5===u){if(r(n)&&(Ct(n),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 f=Math.min(i.length,o.length),l=0;l<f;l++)void 0===a[l]&&e(i[l])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}function Ut(){function e(t){if(!rt(t))return t;if(Array.isArray(t))return t.map(e);if(ft(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(lt(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return at(t,Gt)&&(n[Gt]=t[Gt]),n}function t(t){return nt(t)?e(t):t}var n="add";mt("Patches",{$:function(t,r){return r.forEach((function(r){for(var o=r.path,i=r.op,a=t,u=0;u<o.length-1;u++){var s=it(a),c=""+o[u];0!==s&&1!==s||"__proto__"!==c&&"constructor"!==c||tt(24),"function"==typeof a&&"prototype"===c&&tt(24),"object"!=typeof(a=ut(a,c))&&tt(15,o.join("/"))}var f=it(a),l=e(r.value),d=o[o.length-1];switch(i){case"replace":switch(f){case 2:return a.set(d,l);case 3:tt(16);default:return a[d]=l}case n:switch(f){case 1:return a.splice(d,0,l);case 2:return a.set(d,l);case 3:return a.add(l);default:return a[d]=l}case"remove":switch(f){case 1:return a.splice(d,1);case 2:return a.delete(d);case 3:return a.delete(r.value);default:return delete a[d]}default:tt(17,i)}})),t},R:function(e,r,o,i){switch(e.i){case 0:case 4:case 2:return function(e,r,o,i){var a=e.t,u=e.o;ot(e.D,(function(e,s){var c=ut(a,e),f=ut(u,e),l=s?at(a,e)?"replace":n:"remove";if(c!==f||"replace"!==l){var d=r.concat(e);o.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:f}),i.push(l===n?{op:"remove",path:d}:"remove"===l?{op:n,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,r,o,i);case 5:case 1:return function(e,r,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 f=[i,o];o=f[0],i=f[1]}for(var l=0;l<a.length;l++)if(u[l]&&s[l]!==a[l]){var d=r.concat([l]);o.push({op:"replace",path:d,value:t(s[l])}),i.push({op:"replace",path:d,value:t(a[l])})}for(var h=a.length;h<s.length;h++){var p=r.concat([h]);o.push({op:n,path:p,value:t(s[h])})}a.length<s.length&&i.push({op:"replace",path:r.concat(["length"]),value:a.length})}(e,r,o,i);case 3:return function(e,t,r,o){var i=e.t,a=e.o,u=0;i.forEach((function(e){if(!a.has(e)){var i=t.concat([u]);r.push({op:"remove",path:i,value:e}),o.unshift({op:n,path:i,value:e})}u++})),u=0,a.forEach((function(e){if(!i.has(e)){var a=t.concat([u]);r.push({op:n,path:a,value:e}),o.unshift({op:"remove",path:a,value:e})}u++}))}(e,r,o,i)}},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t===Yt?void 0:t}),r.push({op:"replace",path:[],value:e.t})}})}function Bt(){function e(e,t){function n(){this.constructor=e}o(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(rt(t)){var n=At(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)})))}function r(e){e.O&&tt(3,JSON.stringify(dt(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},i=function(){function n(e,t){return this[Jt]={i:2,l:t,A:t?t.A:bt(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return dt(this[Jt]).size}}),o.has=function(e){return dt(this[Jt]).has(e)},o.set=function(e,n){var o=this[Jt];return r(o),dt(o).has(e)&&dt(o).get(e)===n||(t(o),Ct(o),o.D.set(e,!0),o.o.set(e,n),o.D.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var n=this[Jt];return r(n),t(n),Ct(n),n.D.set(e,!1),n.o.delete(e),!0},o.clear=function(){var e=this[Jt];r(e),dt(e).size&&(t(e),Ct(e),e.D=new Map,ot(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var n=this;dt(this[Jt]).forEach((function(r,o){e.call(t,n.get(o),o,n)}))},o.get=function(e){var n=this[Jt];r(n);var o=dt(n).get(e);if(n.I||!rt(o))return o;if(o!==n.t.get(e))return o;var i=At(n.A.h,o,n);return t(n),n.o.set(e,i),i},o.keys=function(){return dt(this[Jt]).keys()},o.values=function(){var e,t=this,n=this.keys();return(e={})[Kt]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,n=this.keys();return(e={})[Kt]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},o[Kt]=function(){return this.entries()},n}(),a=function(){function t(e,t){return this[Jt]={i:3,l:t,A:t?t.A:bt(),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 dt(this[Jt]).size}}),o.has=function(e){var t=this[Jt];return r(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[Jt];return r(t),this.has(e)||(n(t),Ct(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[Jt];return r(t),n(t),Ct(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[Jt];r(e),dt(e).size&&(n(e),Ct(e),e.o.clear())},o.values=function(){var e=this[Jt];return r(e),n(e),e.o.values()},o.entries=function(){var e=this[Jt];return r(e),n(e),e.o.entries()},o.keys=function(){return this.values()},o[Kt]=function(){return this.values()},o.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();mt("MapSet",{N:function(e,t){return new i(e,t)},T:function(e,t){return new a(e,t)}})}var qt,Lt,Ft="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Ht="undefined"!=typeof Map,Wt="undefined"!=typeof Set,zt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Yt=Ft?Symbol.for("immer-nothing"):((qt={})["immer-nothing"]=!0,qt),Gt=Ft?Symbol.for("immer-draftable"):"__$immer_draftable",Jt=Ft?Symbol.for("immer-state"):"__$immer_state",Kt="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Qt={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"},Vt=""+Object.prototype.constructor,Xt="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,$t=Object.getOwnPropertyDescriptors||function(e){var t={};return Xt(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Zt={},en={get:function(e,t){if(t===Jt)return e;var n=dt(e);if(!at(n,t))return function(e,t,n){var r,o=Dt(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!rt(r)?r:r===xt(e.t,t)?(kt(e),e.o[t]=At(e.A.h,r,e)):r},has:function(e,t){return t in dt(e)},ownKeys:function(e){return Reflect.ownKeys(dt(e))},set:function(e,t,n){var r=Dt(dt(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=xt(dt(e),t),i=null==o?void 0:o[Jt];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(ct(n,o)&&(void 0!==n||at(e.t,t)))return!0;kt(e),Ct(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==xt(e.t,t)||t in e.t?(e.D[t]=!1,kt(e),Ct(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=dt(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){tt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){tt(12)}},tn={};ot(en,(function(e,t){tn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),tn.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&tt(13),en.deleteProperty.call(this,e[0],t)},tn.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&tt(14),en.set.call(this,e[0],t,n,e[0])};var nn=function(){function e(e){var t=this;this.g=zt,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),u=1;u<r;u++)a[u-1]=arguments[u];return i.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(a))}))}}var a;if("function"!=typeof n&&tt(6),void 0!==r&&"function"!=typeof r&&tt(7),rt(e)){var u=It(t),s=At(t,e,void 0),c=!0;try{a=n(s),c=!1}finally{c?wt(u):Ot(u)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return _t(u,r),Pt(e,u)}),(function(e){throw wt(u),e})):(_t(u,r),Pt(a,u))}if(!e||"object"!=typeof e){if((a=n(e))===Yt)return;return void 0===a&&(a=e),t.F&&pt(a,!0),a}tt(21,e)},this.produceWithPatches=function(e,n){return"function"==typeof e?function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))}:[t.produce(e,n,(function(e,t){r=e,o=t})),r,o];var r,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)||tt(8),nt(e)&&(e=Nt(e));var t=It(this),n=At(this,e,void 0);return n[Jt].C=!0,Ot(t),n},t.finishDraft=function(e,t){var n=e&&e[Jt];"production"!==process.env.NODE_ENV&&(n&&n.C||tt(9),n.I&&tt(10));var r=n.A;return _t(r,t),Pt(void 0,r)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!zt&&tt(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var o=yt("Patches").$;return nt(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(n+1))}))},e}(),rn=new nn,on=rn.produce,an=rn.produceWithPatches.bind(rn),un=rn.setAutoFreeze.bind(rn),sn=rn.setUseProxies.bind(rn),cn=rn.applyPatches.bind(rn),fn=rn.createDraft.bind(rn),ln=rn.finishDraft.bind(rn),dn=Object.freeze({__proto__:null,default:on,Immer:nn,applyPatches:cn,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:fn,current:Nt,enableAllPlugins:function(){Rt(),Bt(),Ut()},enableES5:Rt,enableMapSet:Bt,enablePatches:Ut,finishDraft:ln,freeze:pt,immerable:Gt,isDraft:nt,isDraftable:rt,nothing:Yt,original:function(e){return nt(e)||tt(23,e),e[Jt].t},produce:on,produceWithPatches:an,setAutoFreeze:un,setUseProxies:sn}),hn=n(dn),pn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createState=void 0,t.createState=function(e){var t=e;return{current:function(){return t},get:function(e){return t[e]},update:function(e){t=(0,hn.produce)(t,e)}}}})),gn=t((function(e,t){e.exports=function e(t,n,o){function i(u,s){if(!n[u]){if(!t[u]){if(!s&&r)return r();if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=n[u]={exports:{}};t[u][0].call(c.exports,(function(e){return i(t[u][1][e]||e)}),c,c.exports,e,t,n,o)}return n[u].exports}for(var a=r,u=0;u<o.length;u++)i(o[u]);return i}({1:[function(e,t,n){(function(r,o,i,a,u,s,c,f,l){var d=e("crypto");function h(e,t){return function(e,t){var n;if(void 0===(n="passthrough"!==t.algorithm?d.createHash(t.algorithm):new b).write&&(n.write=n.update,n.end=n.update),m(t,n).dispatch(e),n.update||n.end(""),n.digest)return n.digest("buffer"===t.encoding?void 0:t.encoding);var r=n.read();return"buffer"!==t.encoding?r.toString(t.encoding):r}(e,t=v(e,t))}(n=t.exports=h).sha1=function(e){return h(e)},n.keys=function(e){return h(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},n.MD5=function(e){return h(e,{algorithm:"md5",encoding:"hex"})},n.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 n={};if(n.algorithm=t.algorithm||"sha1",n.encoding=t.encoding||"hex",n.excludeValues=!!t.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=!0===t.ignoreUnknown,n.respectType=!1!==t.respectType,n.respectFunctionNames=!1!==t.respectFunctionNames,n.respectFunctionProperties=!1!==t.respectFunctionProperties,n.unorderedArrays=!0===t.unorderedArrays,n.unorderedSets=!1!==t.unorderedSets,n.unorderedObjects=!1!==t.unorderedObjects,n.replacer=t.replacer||void 0,n.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var r=0;r<p.length;++r)p[r].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=p[r]);if(-1===p.indexOf(n.algorithm))throw new Error('Algorithm "'+n.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(n.encoding)&&"passthrough"!==n.algorithm)throw new Error('Encoding "'+n.encoding+'" not supported. supported values: '+g.join(", "));return n}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,n){function r(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return n=n||[],{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=n.indexOf(t)))return this.dispatch("[CIRCULAR:"+o+"]");if(n.push(t),void 0!==i&&i.isBuffer&&i.isBuffer(t))return r("buffer:"),r(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)}))),r("object:"+s.length+":");var c=this;return s.forEach((function(n){c.dispatch(n),r(":"),e.excludeValues||c.dispatch(t[n]),r(",")}))}if(!this["_"+u]){if(e.ignoreUnknown)return r("["+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(r("array:"+t.length+":"),!o||t.length<=1)return t.forEach((function(e){return i.dispatch(e)}));var a=[],u=t.map((function(t){var r=new b,o=n.slice();return m(e,r,o).dispatch(t),a=a.concat(o.slice(n.length)),r.read().toString()}));return n=n.concat(a),u.sort(),this._array(u,!1)},_date:function(e){return r("date:"+e.toJSON())},_symbol:function(e){return r("symbol:"+e.toString())},_error:function(e){return r("error:"+e.toString())},_boolean:function(e){return r("bool:"+e.toString())},_string:function(e){r("string:"+e.length+":"),r(e.toString())},_function:function(t){r("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 r("number:"+e.toString())},_xml:function(e){return r("xml:"+e.toString())},_null:function(){return r("Null")},_undefined:function(){return r("Undefined")},_regexp:function(e){return r("regex:"+e.toString())},_uint8array:function(e){return r("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return r("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return r("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return r("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return r("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return r("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return r("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return r("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return r("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return r("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return r("url:"+e.toString())},_map:function(t){r("map:");var n=Array.from(t);return this._array(n,!1!==e.unorderedSets)},_set:function(t){r("set:");var n=Array.from(t);return this._array(n,!1!==e.unorderedSets)},_file:function(e){return r("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return r("[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 r("domwindow")},_process:function(){return r("process")},_timer:function(){return r("timer")},_pipe:function(){return r("pipe")},_tcp:function(){return r("tcp")},_udp:function(){return r("udp")},_tty:function(){return r("tty")},_statwatcher:function(){return r("statwatcher")},_securecontext:function(){return r("securecontext")},_connection:function(){return r("connection")},_zlib:function(){return r("zlib")},_context:function(){return r("context")},_nodescript:function(){return r("nodescript")},_httpparser:function(){return r("httpparser")},_dataview:function(){return r("dataview")},_signal:function(){return r("signal")},_fsevent:function(){return r("fsevent")},_tlswrap:function(){return r("tlswrap")}}}function b(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}n.writeToStream=function(e,t,n){return void 0===n&&(n=t,t={}),m(t=v(e,t),n).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,n){(function(e,t,r,o,i,a,u,s,c){!function(e){var t="undefined"!=typeof Uint8Array?Uint8Array:Array,n="+".charCodeAt(0),r="/".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===n||t===u?62:t===r||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 n,r;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 f(e){a[s++]=e}for(n=0;n<u;n+=4,0)f((16711680&(r=c(e.charAt(n))<<18|c(e.charAt(n+1))<<12|c(e.charAt(n+2))<<6|c(e.charAt(n+3))))>>16),f((65280&r)>>8),f(255&r);return 2==i?f(255&(r=c(e.charAt(n))<<2|c(e.charAt(n+1))>>4)):1==i&&(f((r=c(e.charAt(n))<<10|c(e.charAt(n+1))<<4|c(e.charAt(n+2))>>2)>>8&255),f(255&r)),a},e.fromByteArray=function(e){var t,n,r,o,i=e.length%3,a="";function u(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t<r;t+=3)a+=u((o=n=(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((n=e[e.length-1])>>2),a+=u(n<<4&63),a+="==";break;case 2:a+=u((n=(e[e.length-2]<<8)+e[e.length-1])>>10),a+=u(n>>4&63),a+=u(n<<2&63),a+="="}return a}}(void 0===n?this.base64js={}: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/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,n){(function(t,r,o,i,a,u,s,c,f){var l=e("base64-js"),d=e("ieee754");function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);var r,i,a,u,s,c=typeof e;if("base64"===t&&"string"==c)for(e=(r=e).trim?r.trim():r.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==c)i=D(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=D(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(C(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&&!n)for(u=0;u<i;u++)a[u]=0;return a}function h(e,t,n,r){return o._charsWritten=M(function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function p(e,t,n,r){return o._charsWritten=M(function(e){for(var t,n,r,o=[],i=0;i<e.length;i++)n=(t=e.charCodeAt(i))>>8,r=t%256,o.push(r),o.push(n);return o}(t),e,n,r)}function g(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;o++)r+=String.fromCharCode(e[o]);return r}function v(e,t,n,r){r||(L("boolean"==typeof n,"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 n?(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,n,r){r||(L("boolean"==typeof n,"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 n?(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,n,r){if(r||(L("boolean"==typeof n,"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,n,!0);return 32768&o?-1*(65535-o+1):o}}function b(e,t,n,r){if(r||(L("boolean"==typeof n,"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,n,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function _(e,t,n,r){return r||(L("boolean"==typeof n,"missing or invalid endian"),L(t+3<e.length,"Trying to read beyond buffer length")),d.read(e,t,n,23,4)}function w(e,t,n,r){return r||(L("boolean"==typeof n,"missing or invalid endian"),L(t+7<e.length,"Trying to read beyond buffer length")),d.read(e,t,n,52,8)}function O(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+1<e.length,"trying to write beyond buffer length"),U(t,65535));var i=e.length;if(!(i<=n))for(var a=0,u=Math.min(i-n,2);a<u;a++)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function I(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+3<e.length,"trying to write beyond buffer length"),U(t,4294967295));var i=e.length;if(!(i<=n))for(var a=0,u=Math.min(i-n,4);a<u;a++)e[n+a]=t>>>8*(r?a:3-a)&255}function S(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+1<e.length,"Trying to write beyond buffer length"),B(t,32767,-32768)),e.length<=n||O(e,0<=t?t:65535+t+1,n,r,o)}function P(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+3<e.length,"Trying to write beyond buffer length"),B(t,2147483647,-2147483648)),e.length<=n||I(e,0<=t?t:4294967295+t+1,n,r,o)}function T(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+3<e.length,"Trying to write beyond buffer length"),q(t,34028234663852886e22,-34028234663852886e22)),e.length<=n||d.write(e,t,n,r,23,4)}function E(e,t,n,r,o){o||(L(null!=t,"missing value"),L("boolean"==typeof r,"missing or invalid endian"),L(null!=n,"missing offset"),L(n+7<e.length,"Trying to write beyond buffer length"),q(t,17976931348623157e292,-17976931348623157e292)),e.length<=n||d.write(e,t,n,r,52,8)}n.Buffer=o,n.SlowBuffer=o,n.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 n;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=A(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=N(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:throw new Error("Unknown encoding")}return n},o.concat=function(e,t){if(L(C(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 n=new o(t),r=0,i=0;i<e.length;i++){var a=e[i];a.copy(n,r),r+=a.length}return n},o.prototype.write=function(e,t,n,r){var i;isFinite(t)?isFinite(n)||(r=n,n=void 0):(i=r,r=t,t=n,n=i),t=Number(t)||0;var a,u,s,c,f,l,d,g,v,y=this.length-t;switch((!n||y<(n=Number(n)))&&(n=y),r=String(r||"utf8").toLowerCase()){case"hex":a=function(e,t,n,r){n=Number(n)||0;var i=e.length-n;(!r||i<(r=Number(r)))&&(r=i);var a=t.length;L(a%2==0,"Invalid hex string"),a/2<r&&(r=a/2);for(var u=0;u<r;u++){var s=parseInt(t.substr(2*u,2),16);L(!isNaN(s),"Invalid hex string"),e[n+u]=s}return o._charsWritten=2*u,u}(this,e,t,n);break;case"utf8":case"utf-8":l=this,d=e,g=t,v=n,a=o._charsWritten=M(A(d),l,g,v);break;case"ascii":case"binary":a=h(this,e,t,n);break;case"base64":u=this,s=e,c=t,f=n,a=o._charsWritten=M(N(s),u,c,f);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":a=p(this,e,t,n);break;default:throw new Error("Unknown encoding")}return a},o.prototype.toString=function(e,t,n){var r,o,i,a,u=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void 0!==n?Number(n):n=u.length)===t)return"";switch(e){case"hex":r=function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||r<n)&&(n=r);for(var o="",i=t;i<n;i++)o+=k(e[i]);return o}(u,t,n);break;case"utf8":case"utf-8":r=function(e,t,n){var r="",o="";n=Math.min(e.length,n);for(var i=t;i<n;i++)e[i]<=127?(r+=R(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return r+R(o)}(u,t,n);break;case"ascii":case"binary":r=g(u,t,n);break;case"base64":o=u,a=n,r=0===(i=t)&&a===o.length?l.fromByteArray(o):l.fromByteArray(o.slice(i,a));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=function(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}(u,t,n);break;default:throw new Error("Unknown encoding")}return r},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,n,r){if(n=n||0,r||0===r||(r=this.length),t=t||0,r!==n&&0!==e.length&&0!==this.length){L(n<=r,"sourceEnd < sourceStart"),L(0<=t&&t<e.length,"targetStart out of bounds"),L(0<=n&&n<this.length,"sourceStart out of bounds"),L(0<=r&&r<=this.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;if(i<100||!o._useTypedArrays)for(var a=0;a<i;a++)e[a+t]=this[a+n];else e._set(this.subarray(n,n+i),t)}},o.prototype.slice=function(e,t){var n=this.length;if(e=x(e,n,0),t=x(t,n,n),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var r=t-e,i=new o(r,void 0,!0),a=0;a<r;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,n){n||(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,n){O(this,e,t,!0,n)},o.prototype.writeUInt16BE=function(e,t,n){O(this,e,t,!1,n)},o.prototype.writeUInt32LE=function(e,t,n){I(this,e,t,!0,n)},o.prototype.writeUInt32BE=function(e,t,n){I(this,e,t,!1,n)},o.prototype.writeInt8=function(e,t,n){n||(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,n):this.writeUInt8(255+e+1,t,n))},o.prototype.writeInt16LE=function(e,t,n){S(this,e,t,!0,n)},o.prototype.writeInt16BE=function(e,t,n){S(this,e,t,!1,n)},o.prototype.writeInt32LE=function(e,t,n){P(this,e,t,!0,n)},o.prototype.writeInt32BE=function(e,t,n){P(this,e,t,!1,n)},o.prototype.writeFloatLE=function(e,t,n){T(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){T(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){E(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){E(this,e,t,!1,n)},o.prototype.fill=function(e,t,n){if(e=e||0,t=t||0,n=n||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),L("number"==typeof e&&!isNaN(e),"value is not a number"),L(t<=n,"end < start"),n!==t&&0!==this.length){L(0<=t&&t<this.length,"start out of bounds"),L(0<=n&&n<=this.length,"end out of bounds");for(var r=t;r<n;r++)this[r]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,r=0;r<t;r++)if(e[r]=k(this[r]),r===n.INSPECT_MAX_BYTES){e[r+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,n=e.length;t<n;t+=1)e[t]=this[t];return e.buffer};var j=o.prototype;function x(e,t,n){return"number"!=typeof e?n:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function D(e){return(e=~~Math.ceil(+e))<0?0:e}function C(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function k(e){return e<16?"0"+e.toString(16):e.toString(16)}function A(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=127)t.push(e.charCodeAt(n));else{var o=n;55296<=r&&r<=57343&&n++;for(var i=encodeURIComponent(e.slice(o,n+1)).substr(1).split("%"),a=0;a<i.length;a++)t.push(parseInt(i[a],16))}}return t}function N(e){return l.toByteArray(e)}function M(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function R(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,n){L("number"==typeof e,"cannot write a non-number as a number"),L(e<=t,"value larger than maximum allowed value"),L(n<=e,"value smaller than minimum allowed value"),L(Math.floor(e)===e,"value has a fractional component")}function q(e,t,n){L("number"==typeof e,"cannot write a non-number as a number"),L(e<=t,"value larger than maximum allowed value"),L(n<=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=j.get,e.set=j.set,e.write=j.write,e.toString=j.toString,e.toLocaleString=j.toString,e.toJSON=j.toJSON,e.copy=j.copy,e.slice=j.slice,e.readUInt8=j.readUInt8,e.readUInt16LE=j.readUInt16LE,e.readUInt16BE=j.readUInt16BE,e.readUInt32LE=j.readUInt32LE,e.readUInt32BE=j.readUInt32BE,e.readInt8=j.readInt8,e.readInt16LE=j.readInt16LE,e.readInt16BE=j.readInt16BE,e.readInt32LE=j.readInt32LE,e.readInt32BE=j.readInt32BE,e.readFloatLE=j.readFloatLE,e.readFloatBE=j.readFloatBE,e.readDoubleLE=j.readDoubleLE,e.readDoubleBE=j.readDoubleBE,e.writeUInt8=j.writeUInt8,e.writeUInt16LE=j.writeUInt16LE,e.writeUInt16BE=j.writeUInt16BE,e.writeUInt32LE=j.writeUInt32LE,e.writeUInt32BE=j.writeUInt32BE,e.writeInt8=j.writeInt8,e.writeInt16LE=j.writeInt16LE,e.writeInt16BE=j.writeInt16BE,e.writeInt32LE=j.writeInt32LE,e.writeInt32BE=j.writeInt32BE,e.writeFloatLE=j.writeFloatLE,e.writeFloatBE=j.writeFloatBE,e.writeDoubleLE=j.writeDoubleLE,e.writeDoubleBE=j.writeDoubleBE,e.fill=j.fill,e.inspect=j.inspect,e.toArrayBuffer=j.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,n){(function(n,r,o,i,a,u,s,c,f){o=e("buffer").Buffer;var l=4,d=new o(l);d.fill(0),t.exports={hash:function(e,t,n,r){return o.isBuffer(e)||(e=new o(e)),function(e,t,n){for(var r=new o(t),i=n?r.writeInt32BE:r.writeInt32LE,a=0;a<e.length;a++)i.call(r,e[a],4*a,!0);return r}(t(function(e,t){var n;e.length%l!=0&&(n=e.length+(l-e.length%l),e=o.concat([e,d],n));for(var r=[],i=t?e.readInt32BE:e.readInt32LE,a=0;a<e.length;a+=l)r.push(i.call(e,a));return r}(e,r),8*e.length),n,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/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(e,t,n){(function(t,r,o,i,a,u,s,c,f){o=e("buffer").Buffer;var l=e("./sha"),d=e("./sha256"),h=e("./rng"),p={sha1:l,sha256:d,md5:e("./md5")},g=64,v=new o(g);function y(e,t){var n=p[e=e||"sha1"],r=[];return n||m("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),r.push(e),e.length,this},digest:function(e){var i=o.concat(r),a=t?function(e,t,n){o.isBuffer(t)||(t=new o(t)),o.isBuffer(n)||(n=new o(n)),t.length>g?t=e(t):t.length<g&&(t=o.concat([t,v],g));for(var r=new o(g),i=new o(g),a=0;a<g;a++)r[a]=54^t[a],i[a]=92^t[a];var u=e(o.concat([r,n]));return e(o.concat([i,u]))}(n,t,i):n(i);return r=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),n.createHash=function(e){return y(e)},n.createHmac=y,n.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 n in e)t(e[n],n)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],(function(e){n[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,n){(function(n,r,o,i,a,u,s,c,f){var l=e("./helpers");function d(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,a=0;a<e.length;a+=16){var u=n,s=r,c=o,f=i;n=p(n,r,o,i,e[a+0],7,-680876936),i=p(i,n,r,o,e[a+1],12,-389564586),o=p(o,i,n,r,e[a+2],17,606105819),r=p(r,o,i,n,e[a+3],22,-1044525330),n=p(n,r,o,i,e[a+4],7,-176418897),i=p(i,n,r,o,e[a+5],12,1200080426),o=p(o,i,n,r,e[a+6],17,-1473231341),r=p(r,o,i,n,e[a+7],22,-45705983),n=p(n,r,o,i,e[a+8],7,1770035416),i=p(i,n,r,o,e[a+9],12,-1958414417),o=p(o,i,n,r,e[a+10],17,-42063),r=p(r,o,i,n,e[a+11],22,-1990404162),n=p(n,r,o,i,e[a+12],7,1804603682),i=p(i,n,r,o,e[a+13],12,-40341101),o=p(o,i,n,r,e[a+14],17,-1502002290),n=g(n,r=p(r,o,i,n,e[a+15],22,1236535329),o,i,e[a+1],5,-165796510),i=g(i,n,r,o,e[a+6],9,-1069501632),o=g(o,i,n,r,e[a+11],14,643717713),r=g(r,o,i,n,e[a+0],20,-373897302),n=g(n,r,o,i,e[a+5],5,-701558691),i=g(i,n,r,o,e[a+10],9,38016083),o=g(o,i,n,r,e[a+15],14,-660478335),r=g(r,o,i,n,e[a+4],20,-405537848),n=g(n,r,o,i,e[a+9],5,568446438),i=g(i,n,r,o,e[a+14],9,-1019803690),o=g(o,i,n,r,e[a+3],14,-187363961),r=g(r,o,i,n,e[a+8],20,1163531501),n=g(n,r,o,i,e[a+13],5,-1444681467),i=g(i,n,r,o,e[a+2],9,-51403784),o=g(o,i,n,r,e[a+7],14,1735328473),n=v(n,r=g(r,o,i,n,e[a+12],20,-1926607734),o,i,e[a+5],4,-378558),i=v(i,n,r,o,e[a+8],11,-2022574463),o=v(o,i,n,r,e[a+11],16,1839030562),r=v(r,o,i,n,e[a+14],23,-35309556),n=v(n,r,o,i,e[a+1],4,-1530992060),i=v(i,n,r,o,e[a+4],11,1272893353),o=v(o,i,n,r,e[a+7],16,-155497632),r=v(r,o,i,n,e[a+10],23,-1094730640),n=v(n,r,o,i,e[a+13],4,681279174),i=v(i,n,r,o,e[a+0],11,-358537222),o=v(o,i,n,r,e[a+3],16,-722521979),r=v(r,o,i,n,e[a+6],23,76029189),n=v(n,r,o,i,e[a+9],4,-640364487),i=v(i,n,r,o,e[a+12],11,-421815835),o=v(o,i,n,r,e[a+15],16,530742520),n=y(n,r=v(r,o,i,n,e[a+2],23,-995338651),o,i,e[a+0],6,-198630844),i=y(i,n,r,o,e[a+7],10,1126891415),o=y(o,i,n,r,e[a+14],15,-1416354905),r=y(r,o,i,n,e[a+5],21,-57434055),n=y(n,r,o,i,e[a+12],6,1700485571),i=y(i,n,r,o,e[a+3],10,-1894986606),o=y(o,i,n,r,e[a+10],15,-1051523),r=y(r,o,i,n,e[a+1],21,-2054922799),n=y(n,r,o,i,e[a+8],6,1873313359),i=y(i,n,r,o,e[a+15],10,-30611744),o=y(o,i,n,r,e[a+6],15,-1560198380),r=y(r,o,i,n,e[a+13],21,1309151649),n=y(n,r,o,i,e[a+4],6,-145523070),i=y(i,n,r,o,e[a+11],10,-1120210379),o=y(o,i,n,r,e[a+2],15,718787259),r=y(r,o,i,n,e[a+9],21,-343485551),n=m(n,u),r=m(r,s),o=m(o,c),i=m(i,f)}return Array(n,r,o,i)}function h(e,t,n,r,o,i){return m((a=m(m(t,e),m(r,i)))<<(u=o)|a>>>32-u,n);var a,u}function p(e,t,n,r,o,i,a){return h(t&n|~t&r,e,t,o,i,a)}function g(e,t,n,r,o,i,a){return h(t&r|n&~r,e,t,o,i,a)}function v(e,t,n,r,o,i,a){return h(t^n^r,e,t,o,i,a)}function y(e,t,n,r,o,i,a){return h(n^(t|~r),e,t,o,i,a)}function m(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return l.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,n){(function(e,n,r,o,i,a,u,s,c){var f;f=function(e){for(var t,n=new Array(e),r=0;r<e;r++)0==(3&r)&&(t=4294967296*Math.random()),n[r]=t>>>((3&r)<<3)&255;return n},t.exports=f}).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,n){(function(n,r,o,i,a,u,s,c,f){var l=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,o,i,a,u=Array(80),s=1732584193,c=-271733879,f=-1732584194,l=271733878,d=-1009589776,g=0;g<e.length;g+=16){for(var v=s,y=c,m=f,b=l,_=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=f,a=l,(r=w)<20?o&i|~o&a:!(r<40)&&r<60?o&i|o&a|i&a:o^i^a)),h(h(d,u[w]),(n=w)<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514));d=l,l=f,f=p(c,30),c=s,s=O}s=h(s,v),c=h(c,y),f=h(f,m),l=h(l,b),d=h(d,_)}return Array(s,c,f,l,d)}function h(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function p(e,t){return e<<t|e>>>32-t}t.exports=function(e){return l.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,n){(function(n,r,o,i,a,u,s,c,f){function l(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function d(e,t){return e>>>t|e<<32-t}function h(e,t){var n,r,o,i,a,u,s,c,f,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,I,S,P=0;P<e.length;P+=16){n=g[0],r=g[1],o=g[2],i=g[3],a=g[4],u=g[5],s=g[6],c=g[7];for(var T=0;T<64;T++)v[T]=T<16?e[T+P]:l(l(l(d(S=v[T-2],17)^d(S,19)^S>>>10,v[T-7]),d(I=v[T-15],7)^d(I,18)^I>>>3),v[T-16]),f=l(l(l(l(c,d(O=a,6)^d(O,11)^d(O,25)),(w=a)&u^~w&s),p[T]),v[T]),h=l(d(_=n,2)^d(_,13)^d(_,22),(y=n)&(m=r)^y&(b=o)^m&b),c=s,s=u,u=a,a=l(i,f),i=o,o=r,r=n,n=l(f,h);g[0]=l(n,g[0]),g[1]=l(r,g[1]),g[2]=l(o,g[2]),g[3]=l(i,g[3]),g[4]=l(a,g[4]),g[5]=l(u,g[5]),g[6]=l(s,g[6]),g[7]=l(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,n){(function(e,n,r,o,i,a,u,s,c){function f(){}(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 n=[];return window.addEventListener("message",(function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<n.length&&n.shift()())}),!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=f,e.addListener=f,e.once=f,e.off=f,e.removeListener=f,e.removeAllListeners=f,e.emit=f,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,n){(function(e,t,r,o,i,a,u,s,c){n.read=function(e,t,n,r,o){var i,a,u=8*o-r-1,s=(1<<u)-1,c=s>>1,f=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=u;0<f;i=256*i+e[t+l],l+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=r;0<f;a=256*a+e[t+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},n.write=function(e,t,n,r,o,i){var a,u,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?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=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),2<=(t+=1<=a+l?d/s:d*Math.pow(2,1-l))*s&&(a++,s/=2),f<=a+l?(u=0,a=f):1<=a+l?(u=(t*s-1)*Math.pow(2,o),a+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));8<=o;e[n+h]=255&u,h+=p,u/=256,o-=8);for(a=a<<o|u,c+=o;0<c;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+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)})),vn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0;var n=Ge.__importDefault(gn);t.generateSearchId=function(e,t){var r=t.anonymousId,o=t.language,i=t.currency,a=t.countryCode;return(0,n.default)(Ge.__assign(Ge.__assign({},e),{anonymousId:r,language:o,currency:i,countryCode:a}))}})),yn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.augmentHotelWithRegularPriceRange=void 0,t.augmentHotelWithRegularPriceRange=function(e,t,n){var r;if(void 0===(null===(r=e.pricing)||void 0===r?void 0:r.medianRateBkt)||void 0===n)return e;var o=e.pricing.medianRateBkt*n*t,i=(e.pricing.medianRateBkt+1)*n*t;return Ge.__assign(Ge.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(i)]})}})),mn=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,n){var r,o=n[0],i=n[1];return Ge.__assign(Ge.__assign({},t),((r={})[o]=i===new Object(i)?e(i):i,r))}),{})}})),bn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSortingBoost=void 0,t.generateSortingBoost=function(e){var t;return(null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.freeCancellation)?"freeCancellation=true:100":void 0}})),_n=t((function(e,t){function n(e,t,n,r){return!(void 0!==n&&e.nightlyRate<n)&&!(void 0!==r&&r<t&&e.nightlyRate>r)}function r(e,t){var r,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,f=i.priceMax,l=u*Math.round(a*s);if((void 0!==c||void 0!==f)&&!(null===(r=t.offers)||void 0===r?void 0:r.some((function(e){return n(e,l,c,f)}))))return Ge.__assign(Ge.__assign({},t),{offers:[]});return t}function o(e,t){var n=t.sortField,r=t.sortOrder;return"price"===n?function(e,t){return e.sort((function(e,n){var r,o,i=(null!==(r=(0,v.getCheapestRate)(e))&&void 0!==r?r:0)-(null!==(o=(0,v.getCheapestRate)(n))&&void 0!==o?o:0);return"ascending"===t?i:-i}))}(e,void 0===r?"ascending":r):e}Object.defineProperty(t,"__esModule",{value:!0}),t.buildOffersResponse=t.applyPriceFilter=t.isOfferInPriceRange=void 0,t.isOfferInPriceRange=n,t.applyPriceFilter=r,t.buildOffersResponse=function(e,t){var n,i=e.hotelOfferEntities,a=e.anchorHotelOfferEntity;i&&(n=i.map((function(e){return r(t,e)})),void 0!==t.sortField&&(n=o(n,t)));var u=[],s={};return null==n||n.forEach((function(e){u.push(e.id),s[e.id]=e})),void 0!==a&&(s[a.id]=a),{hotelIds:u,hotelOfferEntities:s}}})),wn=t((function(e,t){function n(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function r(e,t){for(var r=0,o=t;r<o.length;r++){var i=o[r];if(n(null==e?void 0:e[i]))return e[i]}return""}function o(e,t,o){void 0===o&&(o=", ");for(var i={},a=0,u=t;a<u.length;a++){var s=u[a],c=(null==e?void 0:e[s])||[];i[s]=c.map((function(r,o){if(n(r))return r;var i=t.find((function(t){var r;return n(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[o])}));return i?e[i][o]:""})).join("".concat(o))}return r(i,t)}function i(e,t,o){for(var i={},a=0,u=t;a<u.length;a++){var s=u[a],c=e[s]||[],f=-1===o?void 0:o+1,l=c.slice(o,f).toString();if(n(l))i[s]=l;else{var d=t.find((function(t){var r;return n(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[o])}));i[s]=d?e[d][o]:""}}return r(i,t)}function a(e,t){for(var o,i={},a=0,u=t;a<u.length;a++){var s=u[a],c=null===(o=e[s])||void 0===o?void 0:o.value;if(n(c))i[s]=c;else{var f=t.find((function(t){var r;return n(null===(r=e[t])||void 0===r?void 0:r.value)}));i[s]=f?e[f].value:""}}return r(i,t)}function u(e,t,n){var r,o=e[t];if(!o){var i=n.indexOf(t),a=null!==(r=n.slice(i).find((function(t){return e[t]})))&&void 0!==r?r:"en";o=e[a]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function s(e,t,n){if(void 0===e)return t;try{for(var r in t)if(void 0===e[r])throw new TypeError("Hotel ".concat(e.objectID," is missing ").concat(r," field"))}catch(e){n||console.error(e)}return Ge.__assign(Ge.__assign({},t),e)}function c(e){if(void 0===e)return"property";switch(e){case 0:return"country";case 23:return"city";case 64:case 1010:return"airport";case 199:case 232:case 251:case 1024:return"station";default:return"area"}}Object.defineProperty(t,"__esModule",{value:!0}),t.hitToPlaceSuggest=t.hitToHotelSuggest=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=void 0,t.isNotEmptyOrWhiteSpace=n,t.getTranslatedAttributes=function(e,t){for(var n=[],r=function(e){var r=t.map((function(t){return"".concat(t,".").concat(e)}));n.push.apply(n,r)},o=0,i=e;o<i.length;o++){r(i[o])}return n},t.toString=r,t.translatedArrayToString=o,t.getStringFromTranslatedArray=i,t.getValueFromTranslatedHightlightResult=a,t.attributeWithFallback=u,t.mergeTranslatedAttributes=function(e,t,n){for(var r={},i=0,a=n;i<a.length;i++){var s=a[i];r[s]=Ge.__spreadArray(Ge.__spreadArray([],u(e,s,n),!0),u(t,s,n),!0)}return o(r,n)},t.validateHit=s,t.placeTypeToPlaceTypeName=c,t.hitToHotelSuggest=function(e,t){var o=s(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),u=i(o.placeADN,t,-1),f=i(o.placeDN,t,1),l=n(f)?"".concat(f,", ").concat(u):u,d=a(o._highlightResult.hotelName,t);return{objectID:o.objectID.replace("".concat(o.objectType,":"),""),objectType:o.objectType,value:r(o.hotelName,t),highlightValue:d,placeDisplayName:l,placeTypeName:c()}},t.hitToPlaceSuggest=function(e,t){var o=s(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),u=i(o.placeADN,t,-1),f=i(o.placeDN,t,1),l=n(f)?"".concat(f,", ").concat(u):u,d=a(o._highlightResult.placeName,t);return{objectID:o.objectID.replace("".concat(o.objectType,":"),""),objectType:o.objectType,value:r(o.placeName,t),highlightValue:d,placeDisplayName:l,placeTypeName:c(o.placeType)}}})),On=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Ge.__exportStar(v,t),Ge.__exportStar(y,t),Ge.__exportStar($e,t),Ge.__exportStar(Ze,t),Ge.__exportStar(et,t),Ge.__exportStar(pn,t),Ge.__exportStar(vn,t),Ge.__exportStar(yn,t),Ge.__exportStar(mn,t),Ge.__exportStar(bn,t),Ge.__exportStar(_n,t),Ge.__exportStar(wn,t)})),In=n(d),Sn=n(g),Pn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.createAnchorRequestString=t.createSearchRequestString=t.prepareSearchParameters=void 0;var n=Ge.__importDefault(In),r=Ge.__importDefault(Sn),o=31;function i(e,t){var n,r=(0,On.getCheckInCheckOutDates)(e,t),o=r.checkIn,i=r.checkOut;return Ge.__assign(Ge.__assign({},e),{checkIn:o,checkOut:i,rooms:null!==(n=e.rooms)&&void 0!==n?n:"2"})}function a(){if("undefined"==typeof window)return null;var e,t=new r.default(window.location.search).get("sapiOverride");try{t?(window.sessionStorage.setItem("sapiOverride",t),e=t):e=window.sessionStorage.getItem("sapiOverride")}catch(e){}return e}function u(e){var t,n,o,i,u,s,c,f,l,d,h,p,g,v,y,m,b,_,w,O,I=e.profileKey,S=e.searchId,P=e.searchParameters,T=e.options,E=e.offset,j=e.attributes,x=(0,On.removeEmpty)({offset:E,searchId:S,profileId:I,query:P.query,hotelId:P.hotelId,placeId:P.hotelId?void 0:P.placeId,checkIn:P.checkIn,checkOut:P.checkOut,rooms:P.rooms,dayDistance:P.dayDistance,nights:P.nights,sortField:P.sortField,sortOrder:P.sortOrder,boundingBox:null===(t=P.boundingBox)||void 0===t?void 0:t.join(","),currency:T.currency,language:T.language,variations:null===(n=T.variations)||void 0===n?void 0:n.join(","),starRating:null===(i=null===(o=P.filters)||void 0===o?void 0:o.starRating)||void 0===i?void 0:i.join(","),guestRating:null===(s=null===(u=P.filters)||void 0===u?void 0:u.guestRating)||void 0===s?void 0:s.join(","),propertyTypeId:null===(f=null===(c=P.filters)||void 0===c?void 0:c.propertyTypeId)||void 0===f?void 0:f.join(","),facilities:null===(d=null===(l=P.filters)||void 0===l?void 0:l.facilities)||void 0===d?void 0:d.join(","),themeIds:null===(p=null===(h=P.filters)||void 0===h?void 0:h.themeIds)||void 0===p?void 0:p.join(","),chainIds:null===(v=null===(g=P.filters)||void 0===g?void 0:g.chainIds)||void 0===v?void 0:v.join(","),noHostels:null===(y=P.filters)||void 0===y?void 0:y.noHostels,priceMin:null===(m=P.filters)||void 0===m?void 0:m.priceMin,priceMax:null===(b=P.filters)||void 0===b?void 0:b.priceMax,hotelName:null===(_=P.filters)||void 0===_?void 0:_.hotelName,freeCancellation:null===(w=P.filters)||void 0===w?void 0:w.freeCancellation,attributes:null==j?void 0:j.join(","),anonymousId:T.anonymousId,cugDeals:null===(O=P.cugDeals)||void 0===O?void 0:O.join(","),deviceType:T.deviceType,originId:P.originId,brand:T.brand,sortingBoost:(0,On.generateSortingBoost)(P),preferredRate:P.preferredRate,label:P.trafficSource,countryCode:T.countryCode,sapiOverride:a()});return new r.default(x).toString()}function s(e,t){var r=e.baseUrl,o=e.endpoints;return Ge.__awaiter(this,void 0,void 0,(function(){var e,i,a,s,c,f;return Ge.__generator(this,(function(l){switch(l.label){case 0:return e=u(t),[4,(0,n.default)("https://".concat(r,"/").concat(o.search,"?").concat(e),{credentials:"include"})];case 1:return(i=l.sent()).ok?[2,i.json()]:(a=t.searchParameters,s=t.options,c=t.offset,f=t.attributes,s.logger.log({name:"SearchFailed",value:Ge.__assign(Ge.__assign({},a),{offset:c,attributes:f,language:s.language,currency:s.currency,deviceType:s.deviceType})}),[2,Promise.reject(i)])}}))}))}function c(e){var t,n,o=e.profileKey,i=e.searchId,a=e.searchParameters,u=e.options,s=e.attributes,c=(0,On.removeEmpty)({searchId:i,profileId:o,query:a.query,hotelId:a.hotelId,placeId:a.hotelId?void 0:a.placeId,boundingBox:null===(t=a.boundingBox)||void 0===t?void 0:t.join(","),currency:u.currency,language:u.language,variations:null===(n=u.variations)||void 0===n?void 0:n.join(","),attributes:null==s?void 0:s.join(","),anonymousId:u.anonymousId});return new r.default(c).toString()}function f(e,t){var r=e.baseUrl,o=e.endpoints;return Ge.__awaiter(this,void 0,void 0,(function(){var e,i,a,u,s;return Ge.__generator(this,(function(f){switch(f.label){case 0:return e=c(t),[4,(0,n.default)("https://".concat(r,"/").concat(o.anchor,"?").concat(e))];case 1:return(i=f.sent()).ok?[2,i.json()]:(a=t.searchParameters,u=t.options,s=t.attributes,u.logger.log({name:"AnchorSearchFailed",value:Ge.__assign(Ge.__assign({},a),{attributes:s,language:u.language,currency:u.currency,deviceType:u.deviceType})}),[2,Promise.reject(i)])}}))}))}t.prepareSearchParameters=i,t.createSearchRequestString=u,t.createAnchorRequestString=c,t.search=function(e){var t,n=this,r=e.getFeatureEnabled,a=e.profileKey,u=e.appConfig,c=e.offersClient,l=e.options,d=r("offers"),h=!1;return function(e,r){return void 0===r&&(r={}),Ge.__awaiter(n,void 0,void 0,(function(){var n,p,g,v,y,m,b,_,w,O,I,S,P,T=this;return Ge.__generator(this,(function(E){switch(E.label){case 0:return n=(0,On.createState)({}),p=r.onStart,g=r.onAnchorReceived,v=r.onHotelsReceived,y=r.onOffersReceived,m=r.onComplete,b=0,_=i(e,u.client),w=(0,On.generateSearchId)(e,l),n.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof p&&p(n.current()),O=function(e,r,i){return void 0===e&&(e=0),Ge.__awaiter(T,void 0,void 0,(function(){var i,f,p,b,O,I;return Ge.__generator(this,(function(S){switch(S.label){case 0:return[4,s(u.sapiBackend,{profileKey:a,searchParameters:_,options:l,offset:e,attributes:r,searchId:w})];case 1:return i=S.sent(),h||(t=i.exchangeRates[l.currency],(null===(I=l.callbacks)||void 0===I?void 0:I.onConfigReceived)&&l.callbacks.onConfigReceived({lov:i.lov,exchangeRates:i.exchangeRates}),h=!0),(void 0===r||r.includes("anchor"))&&(n.update((function(e){e.anchor=i.anchor,e.anchorHotelId=i.anchorHotelId,e.anchorType=i.anchorType,e.hotelEntities=i.hotelEntities})),"function"==typeof g&&g(n.current())),n.update((function(e){e.facets=i.facets,e.hotelEntities=i.hotelEntities,e.hotelIds=i.hotelIds,e.hotelsHaveStaticPosition=i.hotelsHaveStaticPosition,e.offset=i.offset,e.resultsCount=i.resultsCount,e.resultsCountTotal=i.resultsCountTotal})),"function"==typeof v&&v(n.current()),d&&void 0!==c?(f=n.get("hotelIds"),p=Ge.__assign(Ge.__assign({},_),{searchId:w,hotelIds:f,anchorHotelId:n.get("anchorHotelId")}),[4,c.getOffers(p,(function(e){var r=(0,On.buildOffersResponse)(e,Ge.__assign(Ge.__assign(Ge.__assign(Ge.__assign({},p),n.get("anchor")),l),{priceBucketsCount:o,exchangeRate:t}));n.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=Ge.__assign(Ge.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof y&&y(n.current())}))]):[3,3];case 2:b=S.sent(),O=(0,On.buildOffersResponse)(b,Ge.__assign(Ge.__assign(Ge.__assign(Ge.__assign({},p),n.get("anchor")),l),{priceBucketsCount:o,exchangeRate:t})),n.update((function(e){e.hotelIds=O.hotelIds,e.hotelOfferEntities=O.hotelOfferEntities})),n.update((function(e){e.dealScores=(0,On.getDealScores)(e)})),S.label=3;case 3:return"function"==typeof m&&m(n.current()),[2,n.current()]}}))}))},I=function(e,r,i){return void 0===e&&(e=0),void 0===i&&(i=!0),Ge.__awaiter(T,void 0,void 0,(function(){var p,b,O=this;return Ge.__generator(this,(function(I){switch(I.label){case 0:return p=function(){return Ge.__awaiter(O,void 0,void 0,(function(){var e,r,i,s;return Ge.__generator(this,(function(p){switch(p.label){case 0:return e=["anchor","anchorHotelId","anchorType","hotelEntities"],h||e.push("lov","exchangeRates"),[4,f(u.sapiBackend,{searchId:w,profileKey:a,searchParameters:_,options:l,attributes:e})];case 1:return r=p.sent(),h||(t=r.exchangeRates[l.currency],(null===(s=l.callbacks)||void 0===s?void 0:s.onConfigReceived)&&l.callbacks.onConfigReceived({lov:r.lov,exchangeRates:r.exchangeRates}),h=!0),n.update((function(e){e.anchor=r.anchor,e.anchorHotelId=r.anchorHotelId,e.anchorType=r.anchorType,e.hotelEntities=Ge.__assign(Ge.__assign({},e.hotelEntities),r.hotelEntities)})),"function"==typeof g&&g(n.current()),d&&void 0!==c&&"hotel"===r.anchorType?(i=Ge.__assign(Ge.__assign({},_),{anchorHotelId:r.anchorHotelId,searchId:w}),[4,c.getOffers(i,(function(e){var r=(0,On.buildOffersResponse)(e,Ge.__assign(Ge.__assign(Ge.__assign(Ge.__assign({},i),n.get("anchor")),l),{priceBucketsCount:o,exchangeRate:t}));n.update((function(e){e.hotelOfferEntities=Ge.__assign(Ge.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof y&&y(n.current())}))]):[3,3];case 2:p.sent(),p.label=3;case 3:return[2,n.current()]}}))}))},b=function(){return Ge.__awaiter(O,void 0,void 0,(function(){var r,f,h,p;return Ge.__generator(this,(function(g){switch(g.label){case 0:return[4,s(u.sapiBackend,{searchId:w,profileKey:a,searchParameters:_,options:l,offset:e,attributes:["facets","hotelEntities","hotelIds","hotelsHaveStaticPosition","offset","resultsCount","resultsCountTotal"]})];case 1:return r=g.sent(),n.update((function(e){e.facets=r.facets,e.hotelEntities=i?Ge.__assign(Ge.__assign({},e.hotelEntities),r.hotelEntities):r.hotelEntities,e.hotelIds=r.hotelIds,e.hotelsHaveStaticPosition=r.hotelsHaveStaticPosition,e.offset=r.offset,e.resultsCount=r.resultsCount,e.resultsCountTotal=r.resultsCountTotal})),"function"==typeof v&&v(n.current()),d&&void 0!==c?(f=Ge.__assign(Ge.__assign({},_),{searchId:w,hotelIds:n.get("hotelIds")}),[4,c.getOffers(f,(function(e){var r=(0,On.buildOffersResponse)(e,Ge.__assign(Ge.__assign(Ge.__assign(Ge.__assign({},f),n.get("anchor")),l),{priceBucketsCount:o,exchangeRate:t}));n.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=Ge.__assign(Ge.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof y&&y(n.current())}))]):[3,3];case 2:h=g.sent(),p=(0,On.buildOffersResponse)(h,Ge.__assign(Ge.__assign(Ge.__assign(Ge.__assign({},f),n.get("anchor")),l),{priceBucketsCount:o,exchangeRate:t})),n.update((function(e){e.hotelIds=p.hotelIds,e.hotelOfferEntities=i?Ge.__assign(Ge.__assign({},e.hotelOfferEntities),p.hotelOfferEntities):p.hotelOfferEntities})),n.update((function(e){e.dealScores=(0,On.getDealScores)(e)})),g.label=3;case 3:return[2,n.current()]}}))}))},[4,void 0===r||r.includes("anchor")?Promise.all([p(),b()]):b()];case 1:return I.sent(),"function"==typeof m&&m(n.current()),[2,n.current()]}}))}))},S=(null===(P=l.variations)||void 0===P?void 0:P.includes("sapi4eva2-magic-sort-b"))?I:O,[4,h?S(_.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition"]):S(_.offset)];case 1:return E.sent(),[2,{loadOffers:function(e){return Ge.__awaiter(T,void 0,void 0,(function(){var r,i,a,u,s;return Ge.__generator(this,(function(f){switch(f.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!d||!c)throw new Error("Offers loading is disabled");return r=e===n.get("anchorHotelId"),i=Ge.__assign(Ge.__assign({},_),{searchId:w,getAllOffers:!0,hotelIds:r?void 0:[e],anchorHotelId:r?e:void 0}),[4,c.getOffers(i)];case 1:return a=f.sent(),u=(0,On.buildOffersResponse)(a,Ge.__assign(Ge.__assign(Ge.__assign(Ge.__assign({},i),n.get("anchor")),l),{priceBucketsCount:o,exchangeRate:t})),[2,null===(s=u.hotelOfferEntities)||void 0===s?void 0:s[e]]}}))}))},loadMore:function(){return Ge.__awaiter(T,void 0,void 0,(function(){var e;return Ge.__generator(this,(function(t){return b+=(null===(e=l.variations)||void 0===e?void 0:e.includes("sapi4eva2-magic-sort-b"))?l.pageSize:function(e,t,n,r){var o,i,a=r.pageSize;return void 0!==e.pageSize&&e.pageSize>=a&&void 0===(null===(o=n.filters)||void 0===o?void 0:o.priceMin)&&void 0===(null===(i=n.filters)||void 0===i?void 0:i.priceMax)&&"price"!==n.sortField?e.pageSize:"hotel"===t?45:65}(n.get("anchor"),n.get("anchorType"),_,l),[2,S(b,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"],!1)]}))}))}}]}}))}))}}})),Tn=t((function(e,t){e.exports=function(){function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}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 n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}}(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,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(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,n="algoliasearch-client-js-".concat(e.key),r=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},i=function(){return JSON.parse(r().getItem(n)||"{}")};return{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var n=JSON.stringify(e),r=i()[n];return Promise.all([r||t(),void 0!==r])})).then((function(e){var t=o(e,2),r=t[0],i=t[1];return Promise.all([r,i||n.miss(r)])})).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,r().setItem(n,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=i();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function u(e){var t=i(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.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,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return u({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return u({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return u({caches:t}).delete(e)}))},clear:function(){return n.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(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},i=JSON.stringify(n);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);var a=r(),u=o&&o.miss||function(){return Promise.resolve()};return a.then((function(e){return u(e)})).then((function(){return a}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return e===g.WithinHeaders?r:{}},queryParameters:function(){return e===g.WithinQueryParameters?r:{}}}}function f(e){var t=0;return e((function n(){return t++,new Promise((function(r){setTimeout((function(){r(e(n))}),Math.min(100*t,1e3))}))}))}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(n){return l(e.then((function(e){return Promise.all([t(e,n),e])})).then((function(e){return e[1]})))}})}function d(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function h(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function p(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(n[o++])}))}var g={WithinQueryParameters:0,WithinHeaders:1};function v(e,t){var n=e||{},r=n.data||{};return Object.keys(n).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])})),{data:Object.entries(r).length>0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.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 n(n({},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 I="DELETE",S="GET",P="POST",T="PUT";function E(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return e.status===m||Date.now()-e.lastUpdate>12e4}(e)})),r=e.filter((function(e){return function(e){return e.status===_&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(i(n),i(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return O(e)})):t}}))}function j(e,t,r,o){var a=[],u=function(e,t){if(e.method!==S&&(void 0!==e.data||void 0!==t.data)){var r=Array.isArray(e.data)?e.data:n(n({},e.data),t.data);return JSON.stringify(r)}}(r,o),s=function(e,t){var r=n(n({},e.headers),t.headers),o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e.toLowerCase()]=t})),o}(e,o),c=r.method,f=r.method!==S?{}:n(n({},r.data),o.data),l=n(n(n({"x-algolia-agent":e.userAgent.value},e.queryParameters),f),o.queryParameters),d=0,h=function t(n,i){var f=n.pop();if(void 0===f)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:C(f,r.path,l),connectTimeout:i(d,e.timeouts.connect),responseTimeout:i(d,o.timeout)},p=function(e){var t={request:h,response:e,host:f,triesLeft:n.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(r){var o=p(r);return r.isTimedOut&&d++,Promise.all([e.logger.info("Retryable failure",N(o)),e.hostsCache.set(f,w(f,r.isTimedOut?_:b))]).then((function(){return t(n,i)}))},onFail:function(e){throw p(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(o,r,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,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,g)}))};return E(e.hostsCache,t).then((function(e){return h(i(e.statelessHosts).reverse(),e.getTimeout)}))}function x(e){var t=e.hostsCache,n=e.logger,r=e.requester,i=e.requestsCache,a=e.responsesCache,u=e.timeouts,s=e.userAgent,c=e.hosts,f=e.queryParameters,l={hostsCache:t,logger:n,requester:r,requestsCache:i,responsesCache:a,timeouts:u,userAgent:s,headers:e.headers,queryParameters:f,hosts:c.map((function(e){return O(e)})),read:function(e,t){var n=v(t,l.timeouts.read),r=function(){return j(l,l.hosts.filter((function(e){return 0!=(e.accept&y.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var i={request:e,mappedRequestOptions:n,transporter:{queryParameters:l.queryParameters,headers:l.headers}};return l.responsesCache.get(i,(function(){return l.requestsCache.get(i,(function(){return l.requestsCache.set(i,r()).then((function(e){return Promise.all([l.requestsCache.delete(i),e])}),(function(e){return Promise.all([l.requestsCache.delete(i),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return l.responsesCache.set(i,e)}})},write:function(e,t){return j(l,l.hosts.filter((function(e){return 0!=(e.accept&y.Write)})),e,v(t,l.timeouts.write))}};return l}function D(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function C(e,t,n){var r=k(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function k(e){return Object.keys(e).map((function(t){return p("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).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 n(n({},e),{},{request:n(n({},e.request),{},{headers:n(n({},e.request.headers),t)})})}var M=function(e){return function(t,n){return e.transporter.write({method:P,path:"2/abtests",data:t},n)}},R=function(e){return function(t,n){return e.transporter.write({method:I,path:p("2/abtests/%s",t)},n)}},U=function(e){return function(t,n){return e.transporter.read({method:S,path:p("2/abtests/%s",t)},n)}},B=function(e){return function(t){return e.transporter.read({method:S,path:"2/abtests"},t)}},q=function(e){return function(t,n){return e.transporter.write({method:P,path:p("2/abtests/%s/stop",t)},n)}},L=function(e){return function(t){return e.transporter.read({method:S,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,n){return e.transporter.write({method:P,path:"1/strategies/personalization",data:t},n)}};function H(e){return function t(n){return e.request(n).then((function(r){if(void 0!==e.batch&&e.batch(r.hits),!e.shouldStop(r))return r.cursor?t({cursor:r.cursor}):t({page:(n.page||0)+1})}))}({})}var W=function(e){return function(t,o){var i=o||{},a=i.queryParameters,u=r(i,["queryParameters"]),s=n({acl:t},void 0!==a?{queryParameters:a}:{});return l(e.transporter.write({method:P,path:"1/keys",data:s},u),(function(t,n){return f((function(r){return X(e)(t.key,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},z=function(e){return function(t,n,r){var o=v(r);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:P,path:"1/clusters/mapping",data:{cluster:n}},o)}},Y=function(e){return function(t,n,r){return e.transporter.write({method:P,path:"1/clusters/mapping/batch",data:{users:t,cluster:n}},r)}},G=function(e){return function(t,n,r){return l(e.transporter.write({method:P,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:n}},r),(function(n,r){return ne(e)(t,{methods:{waitTask:tt}}).waitTask(n.taskID,r)}))}},J=function(e){return function(t,r,o){return G(e)(t,r,n(n({},o),{},{scope:[rt.Rules]}))}},K=function(e){return function(t,r,o){return G(e)(t,r,n(n({},o),{},{scope:[rt.Settings]}))}},Q=function(e){return function(t,r,o){return G(e)(t,r,n(n({},o),{},{scope:[rt.Synonyms]}))}},V=function(e){return function(t,n){return l(e.transporter.write({method:I,path:p("1/keys/%s",t)},n),(function(n,r){return f((function(n){return X(e)(t,r).then(n).catch((function(e){if(404!==e.status)throw e}))}))}))}},X=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/keys/%s",t)},n)}},$=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,n){return e.transporter.read({method:S,path:p("1/clusters/mapping/%s",t)},n)}},te=function(e){return function(t){var n=t||{},o=n.retrieveMappings,i=r(n,["retrieveMappings"]);return!0===o&&(i.getClusters=!0),e.transporter.read({method:S,path:"1/clusters/mapping/pending"},i)}},ne=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},n.methods)}},re=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,n,r){return l(e.transporter.write({method:P,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:n}},r),(function(n,r){return ne(e)(t,{methods:{waitTask:tt}}).waitTask(n.taskID,r)}))}},se=function(e){return function(t,n){return l(e.transporter.write({method:P,path:"1/indexes/*/batch",data:{requests:t}},n),(function(t,n){return Promise.all(Object.keys(t.taskID).map((function(r){return ne(e)(r,{methods:{waitTask:tt}}).waitTask(t.taskID[r],n)})))}))}},ce=function(e){return function(t,n){return e.transporter.read({method:P,path:"1/indexes/*/objects",data:{requests:t}},n)}},fe=function(e){return function(t,r){var o=t.map((function(e){return n(n({},e),{},{params:k(e.params||{})})}));return e.transporter.read({method:P,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},r)}},le=function(e){return function(t,o){return Promise.all(t.map((function(t){var i=t.params,a=i.facetName,u=i.facetQuery,s=r(i,["facetName","facetQuery"]);return ne(e)(t.indexName,{methods:{searchForFacetValues:Xe}}).searchForFacetValues(a,u,n(n({},o),s))})))}},de=function(e){return function(t,n){var r=v(n);return r.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:I,path:"1/clusters/mapping"},r)}},he=function(e){return function(t,n){return l(e.transporter.write({method:P,path:p("1/keys/%s/restore",t)},n),(function(n,r){return f((function(n){return X(e)(t,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},pe=function(e){return function(t,n){return e.transporter.read({method:P,path:"1/clusters/mapping/search",data:{query:t}},n)}},ge=function(e){return function(t,n){var o=Object.assign({},n),i=n||{},a=i.queryParameters,u=r(i,["queryParameters"]),s=a?{queryParameters:a}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return l(e.transporter.write({method:T,path:p("1/keys/%s",t),data:s},u),(function(n,r){return f((function(n){return X(e)(t,r).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():n()}))}))}))}},ve=function(e){return function(t,n){return l(e.transporter.write({method:P,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},n),(function(t,n){return tt(e)(t.taskID,n)}))}},ye=function(e){return function(t){return H(n(n({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(n){return e.transporter.read({method:P,path:p("1/indexes/%s/browse",e.indexName),data:n},t)}}))}},me=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return H(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return $e(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},be=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return H(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return Ze(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},_e=function(e){return function(t,n,o){var i=o||{},a=i.batchSize,u=r(i,["batchSize"]),s={taskIDs:[],objectIDs:[]};return l(function r(){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:n,body:e}})),u).then((function(e){return s.objectIDs=s.objectIDs.concat(e.objectIDs),s.taskIDs.push(e.taskID),o++,r(o)}))}(),(function(t,n){return Promise.all(t.taskIDs.map((function(t){return tt(e)(t,n)})))}))}},we=function(e){return function(t){return l(e.transporter.write({method:P,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,n){return tt(e)(t.taskID,n)}))}},Oe=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,i=v(r(n,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),l(e.transporter.write({method:P,path:p("1/indexes/%s/rules/clear",e.indexName)},i),(function(t,n){return tt(e)(t.taskID,n)}))}},Ie=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,i=v(r(n,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),l(e.transporter.write({method:P,path:p("1/indexes/%s/synonyms/clear",e.indexName)},i),(function(t,n){return tt(e)(t.taskID,n)}))}},Se=function(e){return function(t,n){return l(e.transporter.write({method:P,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},n),(function(t,n){return tt(e)(t.taskID,n)}))}},Pe=function(e){return function(t){return l(e.transporter.write({method:I,path:p("1/indexes/%s",e.indexName)},t),(function(t,n){return tt(e)(t.taskID,n)}))}},Te=function(e){return function(t,n){return l(Ee(e)([t],n).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},Ee=function(e){return function(t,n){var r=t.map((function(e){return{objectID:e}}));return _e(e)(r,nt.DeleteObject,n)}},je=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=v(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),l(e.transporter.write({method:I,path:p("1/indexes/%s/rules/%s",e.indexName,t)},a),(function(t,n){return tt(e)(t.taskID,n)}))}},xe=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=v(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),l(e.transporter.write({method:I,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},a),(function(t,n){return tt(e)(t.taskID,n)}))}},De=function(e){return function(t){return Ue(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Ce=function(e){return function(t,n,r){return e.transporter.read({method:P,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},ke=function(e){return function(t,i){var a=i||{},u=a.query,s=a.paginate,c=r(a,["query","paginate"]),f=0;return function r(){return Ve(e)(u||"",n(n({},c),{},{page:f})).then((function(e){for(var n=0,i=Object.entries(e.hits);n<i.length;n++){var a=o(i[n],2),u=a[0],c=a[1];if(t(c))return{object:c,position:parseInt(u,10),page:f}}if(f++,!1===s||f>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return r()}))}()}},Ae=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/%s",e.indexName,t)},n)}},Ne=function(){return function(e,t){for(var n=0,r=Object.entries(e.hits);n<r.length;n++){var i=o(r[n],2),a=i[0];if(i[1].objectID===t)return parseInt(a,10)}return-1}},Me=function(e){return function(t,o){var i=o||{},a=i.attributesToRetrieve,u=r(i,["attributesToRetrieve"]),s=t.map((function(t){return n({indexName:e.indexName,objectID:t},a?{attributesToRetrieve:a}:{})}));return e.transporter.read({method:P,path:"1/indexes/*/objects",data:{requests:s}},u)}},Re=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/%s",e.indexName,t)},n)}},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,n){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},n)}},qe=function(e){return function(t,n){return l(Le(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},Le=function(e){return function(t,n){var o=n||{},i=o.createIfNotExists,a=r(o,["createIfNotExists"]),u=i?nt.PartialUpdateObject:nt.PartialUpdateObjectNoCreate;return _e(e)(t,u,a)}},Fe=function(e){return function(t,a){var u=a||{},s=u.safe,c=u.autoGenerateObjectIDIfNotExist,f=u.batchSize,d=r(u,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,n,r,o){return l(e.transporter.write({method:P,path:p("1/indexes/%s/operation",t),data:{operation:r,destination:n}},o),(function(t,n){return tt(e)(t.taskID,n)}))},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",n(n({},d),{},{scope:["settings","synonyms","rules"]}));return m.push(b),l((s?b.wait(d):b).then((function(){var e=y(t,n(n({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:f}));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),n=t[0],r=t[1],a=t[2];return{objectIDs:r.objectIDs,taskIDs:[n.taskID].concat(i(r.taskIDs),[a.taskID])}})),(function(e,t){return Promise.all(m.map((function(e){return e.wait(t)})))}))}},He=function(e){return function(t,r){return Je(e)(t,n(n({},r),{},{clearExistingRules:!0}))}},We=function(e){return function(t,r){return Qe(e)(t,n(n({},r),{},{clearExistingSynonyms:!0}))}},ze=function(e){return function(t,n){return l(Ye(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},Ye=function(e){return function(t,n){var o=n||{},i=o.autoGenerateObjectIDIfNotExist,a=r(o,["autoGenerateObjectIDIfNotExist"]),u=i?nt.AddObject:nt.UpdateObject;if(u===nt.UpdateObject){var s=!0,c=!1,f=void 0;try{for(var d,h=t[Symbol.iterator]();!(s=(d=h.next()).done);s=!0)if(void 0===d.value.objectID)return l(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,f=e}finally{try{s||null==h.return||h.return()}finally{if(c)throw f}}}return _e(e)(t,u,a)}},Ge=function(e){return function(t,n){return Je(e)([t],n)}},Je=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=o.clearExistingRules,u=v(r(o,["forwardToReplicas","clearExistingRules"]));return i&&(u.queryParameters.forwardToReplicas=1),a&&(u.queryParameters.clearExistingRules=1),l(e.transporter.write({method:P,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},u),(function(t,n){return tt(e)(t.taskID,n)}))}},Ke=function(e){return function(t,n){return Qe(e)([t],n)}},Qe=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=o.clearExistingSynonyms,u=o.replaceExistingSynonyms,s=v(r(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return i&&(s.queryParameters.forwardToReplicas=1),(u||a)&&(s.queryParameters.replaceExistingSynonyms=1),l(e.transporter.write({method:P,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(function(t,n){return tt(e)(t.taskID,n)}))}},Ve=function(e){return function(t,n){return e.transporter.read({method:P,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},Xe=function(e){return function(t,n,r){return e.transporter.read({method:P,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},$e=function(e){return function(t,n){return e.transporter.read({method:P,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},n)}},Ze=function(e){return function(t,n){return e.transporter.read({method:P,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},n)}},et=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=v(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),l(e.transporter.write({method:T,path:p("1/indexes/%s/settings",e.indexName),data:t},a),(function(t,n){return tt(e)(t.taskID,n)}))}},tt=function(e){return function(t,n){return f((function(r){return function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/task/%s",e.indexName,t.toString())},n)}}(e)(t,n).then((function(e){return"published"!==e.status?r():void 0}))}))}},nt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},rt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},ot=1,it=2,at=3;function ut(e,t,r){var o,i={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e)},i=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(i),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(i),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(i),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.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:D("4.8.0").add({segment:"Browser"})};return function(e){var t=e.appId,r=c(void 0!==e.authMode?e.authMode:g.WithinHeaders,t,e.apiKey),o=x(n(n({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:n(n(n({},r.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:n(n({},r.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)}(n(n(n({},i),r),{},{methods:{search:fe,searchForFacetValues:le,multipleBatch:se,multipleGetObjects:ce,multipleQueries:fe,copyIndex:G,copySettings:K,copySynonyms:Q,copyRules:J,moveIndex:ue,listIndices:ie,getLogs:$,listClusters:oe,multipleSearchForFacetValues:le,getApiKey:X,addApiKey:W,listApiKeys:re,updateApiKey:ge,deleteApiKey:V,restoreApiKey:he,assignUserID:z,assignUserIDs:Y,getUserID:ee,searchUserIDs:pe,listUserIDs:ae,getTopUserIDs:Z,removeUserID:de,hasPendingMappings:te,initIndex:function(e){return function(t){return ne(e)(t,{methods:{batch:ve,delete:Pe,findAnswers:Ce,getObject:Ae,getObjects:Me,saveObject:ze,saveObjects:Ye,search:Ve,searchForFacetValues:Xe,waitTask:tt,setSettings:et,getSettings:Ue,partialUpdateObject:qe,partialUpdateObjects:Le,deleteObject:Te,deleteObjects:Ee,deleteBy:Se,clearObjects:we,browseObjects:ye,getObjectPosition:Ne,findObject:ke,exists:De,saveSynonym:Ke,saveSynonyms:Qe,getSynonym:Be,searchSynonyms:Ze,browseSynonyms:be,deleteSynonym:xe,clearSynonyms:Ie,replaceAllObjects:Fe,replaceAllSynonyms:We,searchRules:$e,getRule:Re,deleteRule:je,saveRule:Ge,saveRules:Je,replaceAllRules:He,browseRules:me,clearRules:Oe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",r=c(g.WithinHeaders,e.appId,e.apiKey),o=x(n(n({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(n(n(n({},i),e),{},{methods:{addABTest:M,getABTest:U,getABTests:B,stopABTest:q,deleteABTest:R}}))}},initRecommendation:function(){return function(e){return function(e){var t=e.region||"us",r=c(g.WithinHeaders,e.appId,e.apiKey),o=x(n(n({hosts:[{url:"recommendation.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(n(n(n({},i),e),{},{methods:{getPersonalizationStrategy:L,setPersonalizationStrategy:F}}))}}}}))}return ut.version="4.8.0",ut}()})),En=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0;var n=Ge.__importDefault(Tn);function r(e){return(0,On.getTranslatedAttributes)(e,["placeName","hotelName"])}function o(e){var t=(0,On.getTranslatedAttributes)(e,["placeName","placeADN","placeDN","hotelName"]);return Ge.__spreadArray(["objectType","objectID","placeType"],t,!0)}function i(e,t,n){var i=this,a=e.search,u=t.autocompleteIndex,s=n.languages,c=n.suggestsCount,f=void 0===c?6:c;return function(e){return Ge.__awaiter(i,void 0,void 0,(function(){var t,n,i;return Ge.__generator(this,(function(c){switch(c.label){case 0:return t=[{indexName:u,params:{query:e,filters:"isDeleted != 1",hitsPerPage:f,attributesToRetrieve:o(s),attributesToHighlight:r(s)}}],[4,a(t)];case 1:return n=c.sent().results,[2,null===(i=n[0])||void 0===i?void 0:i.hits.map((function(e){return"hotel"===e.objectType?(0,On.hitToHotelSuggest)(e,s):(0,On.hitToPlaceSuggest)(e,s)}))]}}))}))}}t.suggest=function(e){var t=this,r=e.appConfig,o=e.options,a=o.languages,u=o.algoliaClientOptions,s=(0,n.default)(r.algolia.appId,r.algolia.apiKey,u);return function(e,n){return Ge.__awaiter(t,void 0,void 0,(function(){return Ge.__generator(this,(function(t){switch(t.label){case 0:return[4,i(s,r.algolia,{suggestsCount:n,languages:a})(e)];case 1:return[2,t.sent()]}}))}))}}})),jn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var n=Ge.__importDefault(In),r=Ge.__importDefault(Sn);function o(e,t){var n,o=e.hotelId,i=e.checkIn,a=e.checkOut,u=e.rooms,s=e.providerCode,c=e.cugDeals,f=e.clickedOfferId,l=(0,On.removeEmpty)({hotelId:o,checkIn:i,checkOut:a,rooms:u,providerCode:s,cugDeals:c,clickedOfferId:f,deviceType:t.deviceType,language:t.language,currency:t.currency,aid:t.anonymousId,variations:null===(n=t.variations)||void 0===n?void 0:n.join(",")});return new r.default(l).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,r=e.appConfig,i=e.options;return function(e){return Ge.__awaiter(t,void 0,void 0,(function(){var t,a,u;return Ge.__generator(this,(function(s){switch(s.label){case 0:return t=o(e,i),[4,(0,n.default)("https://".concat(r.saf.baseUrl,"/").concat(r.saf.endpoints.offersRooms,"?").concat(t))];case 1:return(a=s.sent()).ok?[4,a.json()]:[3,3];case 2:return u=s.sent(),[2,Ge.__assign({hotelId:e.hotelId,anonymousId:i.anonymousId},u)];case 3:return[2,Promise.reject(a)]}}))}))}}})),xn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hotel=t.createRequestString=t.safToSapiHotel=void 0;var n=Ge.__importDefault(In),r=Ge.__importDefault(Sn);function o(e,t){var n=e.checkInInst,r=e.checkInSpInst,o=e.feesMnd,i=e.feesOpt,a=e.policies,u=e.hotelName,s=e.placeDN,c=e.address,f=e.placeADName,l=e.propertyType,d=e.facilities,h=e.sentiments,p=e.themes,g=Ge.__assign(Ge.__assign({},e),{checkInInst:n&&(0,On.toString)(n,t),checkInSpInst:r&&(0,On.toString)(r,t),feesMnd:o&&(0,On.toString)(o,t),feesOpt:i&&(0,On.toString)(i,t),hotelName:(0,On.toString)(u,t),policies:a&&(0,On.toString)(a,t),placeDisplayName:s&&(0,On.translatedArrayToString)(s,t),displayAddress:c&&f&&(0,On.mergeTranslatedAttributes)(c,f,t),facilities:null==d?void 0:d.map((function(e){return Ge.__assign(Ge.__assign({},e),{value:(0,On.toString)(e.value,t)})})),sentiments:null==h?void 0:h.map((function(e){return Ge.__assign(Ge.__assign({},e),{value:(0,On.toString)(e.value,t)})})),themes:null==p?void 0:p.map((function(e){return Ge.__assign(Ge.__assign({},e),{value:(0,On.toString)(e.value,t)})})),propertyType:l&&Ge.__assign(Ge.__assign({},l),{value:(0,On.toString)(l.value,t)})});return(0,On.omit)(["placeDN","placeADName","address"],g)}function i(e,t){var n=(0,On.removeEmpty)({id:e,language:t.join(","),attributes:["objectID","address","country","guestRating","isDeleted","starRating","_geoloc","placeADName","checkInSpInst","checkInMinAge","checkOutTime","checkInInst","checkInTime","checkInEnd","feesOpt","policies","phone","imageURIs","placeDN","reviewCount","chainID","parentChainID","lastBooked","feesMnd","reviewCountBkt","hotelName","sentiments","facilities","placeID","guestType","themes","propertyType","pricing","currency"].join(",")});return new r.default(n).toString()}t.safToSapiHotel=o,t.createRequestString=i,t.hotel=function(e){var t=this,r=e.appConfig,a=e.options;return function(e){return Ge.__awaiter(t,void 0,void 0,(function(){var t,u;return Ge.__generator(this,(function(s){switch(s.label){case 0:return t=i(e,a.languages),[4,(0,n.default)("https://".concat(r.saf.baseUrl,"/").concat(r.saf.endpoints.hotel,"?").concat(t))];case 1:return(u=s.sent()).ok?[4,u.json()]:[3,3];case 2:return[2,o(s.sent(),a.languages)];case 3:return[2,Promise.reject(u)]}}))}))}}})),Dn=t((function(e,t){function n(e,t,n){var r=e.hotelId,o=e.isAnchor,i=e.freeCancellation,a=e.rooms,u=void 0===a?n.client.defaultRooms:a,s=Ge.__rest(e,["hotelId","isAnchor","freeCancellation","rooms"]),c=(0,On.getCheckInCheckOutDates)(e,n.client),f=c.checkIn,l=c.checkOut,d=Ge.__assign(Ge.__assign({},s),{checkIn:f,checkOut:l,rooms:u});return i&&(d.filters={freeCancellation:!0}),e.searchId||(d.searchId=(0,On.generateSearchId)(d,t)),o?d.anchorHotelId=r:d.hotelIds=[r],d}Object.defineProperty(t,"__esModule",{value:!0}),t.offers=t.getOffersParameters=void 0,t.getOffersParameters=n,t.offers=function(e){var t=this,r=e.offersClient,o=e.options,i=e.appConfig;return function(e,a){return void 0===a&&(a={}),Ge.__awaiter(t,void 0,void 0,(function(){var t,u,s,c,f,l,d,h;return Ge.__generator(this,(function(p){switch(p.label){case 0:return r?(t=e.isAnchor,u=a.onStart,s=a.onOffersReceived,c=a.onComplete,f=n(e,o,i),"function"==typeof u&&u(f),[4,r.getOffers(f,(function(e){var n;"function"==typeof s&&s(t?e.anchorHotelOfferEntity:null===(n=e.hotelOfferEntities)||void 0===n?void 0:n[0])}))]):[2];case 1:return l=p.sent(),"function"==typeof c&&c(t?l.anchorHotelOfferEntity:null===(d=l.hotelOfferEntities)||void 0===d?void 0:d[0]),[2,t?l.anchorHotelOfferEntity:null===(h=l.hotelOfferEntities)||void 0===h?void 0:h[0]]}}))}))}}})),Cn=function(e,t){return Cn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Cn(e,t)};function kn(e,t){function n(){this.constructor=e}Cn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function An(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Nn(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(An(arguments[t]));return e}var Mn,Rn=function(e,t){this.target=t,this.type=e},Un=function(e){function t(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return kn(t,e),t}(Rn),Bn=function(e){function t(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return kn(t,e),t}(Rn),qn=function(){if("undefined"!=typeof WebSocket)return WebSocket},Ln={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},Fn=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),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){r._debug("open event");var t=r._options.minUptime,n=void 0===t?Ln.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout((function(){return r._acceptOpen()}),n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach((function(e){return r._ws.send(e)})),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach((function(t){return r._callEventListener(e,t)}))},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach((function(t){return r._callEventListener(e,t)}))},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach((function(t){return r._callEventListener(e,t)})),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach((function(t){return r._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=n,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,n=void 0===t?Ln.maxEnqueuedMessages:t;this._messageQueue.length<n&&(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,n,r=this._listeners[e.type];if(r)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),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&&(n=o.return)&&n.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,Nn(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?Ln.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?Ln.minReconnectionDelay:r,i=e.maxReconnectionDelay,a=void 0===i?Ln.maxReconnectionDelay:i,u=0;return this._retryCount>0&&(u=o*Math.pow(n,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,n=t.maxRetries,r=void 0===n?Ln.maxRetries:n,o=t.connectionTimeout,i=void 0===o?Ln.connectionTimeout:o,a=t.WebSocket,u=void 0===a?qn():a;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);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 Un(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 Bn(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}(),Hn=Object.freeze({__proto__:null,default:Fn}),Wn=new Uint8Array(16);function zn(){if(!Mn&&!(Mn="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 Mn(Wn)}var Yn=/^(?:[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 Gn(e){return"string"==typeof e&&Yn.test(e)}for(var Jn,Kn,Qn=[],Vn=0;Vn<256;++Vn)Qn.push((Vn+256).toString(16).substr(1));function Xn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Qn[e[t+0]]+Qn[e[t+1]]+Qn[e[t+2]]+Qn[e[t+3]]+"-"+Qn[e[t+4]]+Qn[e[t+5]]+"-"+Qn[e[t+6]]+Qn[e[t+7]]+"-"+Qn[e[t+8]]+Qn[e[t+9]]+"-"+Qn[e[t+10]]+Qn[e[t+11]]+Qn[e[t+12]]+Qn[e[t+13]]+Qn[e[t+14]]+Qn[e[t+15]]).toLowerCase();if(!Gn(n))throw TypeError("Stringified UUID is invalid");return n}var $n=0,Zn=0;function er(e){if(!Gn(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function tr(e,t,n){function r(e,r,o,i){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=er(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(r),a.set(e,r.length),(a=n(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 Xn(a)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function nr(e){return 14+(e+64>>>9<<4)+1}function rr(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function or(e,t,n,r,o,i){return rr((a=rr(rr(t,e),rr(r,i)))<<(u=o)|a>>>32-u,n);var a,u}function ir(e,t,n,r,o,i,a){return or(t&n|~t&r,e,t,o,i,a)}function ar(e,t,n,r,o,i,a){return or(t&r|n&~r,e,t,o,i,a)}function ur(e,t,n,r,o,i,a){return or(t^n^r,e,t,o,i,a)}function sr(e,t,n,r,o,i,a){return or(n^(t|~r),e,t,o,i,a)}var cr=tr("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r="0123456789abcdef",o=0;o<n;o+=8){var i=e[o>>5]>>>o%32&255,a=parseInt(r.charAt(i>>>4&15)+r.charAt(15&i),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[nr(t)-1]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,a=0;a<e.length;a+=16){var u=n,s=r,c=o,f=i;n=ir(n,r,o,i,e[a],7,-680876936),i=ir(i,n,r,o,e[a+1],12,-389564586),o=ir(o,i,n,r,e[a+2],17,606105819),r=ir(r,o,i,n,e[a+3],22,-1044525330),n=ir(n,r,o,i,e[a+4],7,-176418897),i=ir(i,n,r,o,e[a+5],12,1200080426),o=ir(o,i,n,r,e[a+6],17,-1473231341),r=ir(r,o,i,n,e[a+7],22,-45705983),n=ir(n,r,o,i,e[a+8],7,1770035416),i=ir(i,n,r,o,e[a+9],12,-1958414417),o=ir(o,i,n,r,e[a+10],17,-42063),r=ir(r,o,i,n,e[a+11],22,-1990404162),n=ir(n,r,o,i,e[a+12],7,1804603682),i=ir(i,n,r,o,e[a+13],12,-40341101),o=ir(o,i,n,r,e[a+14],17,-1502002290),n=ar(n,r=ir(r,o,i,n,e[a+15],22,1236535329),o,i,e[a+1],5,-165796510),i=ar(i,n,r,o,e[a+6],9,-1069501632),o=ar(o,i,n,r,e[a+11],14,643717713),r=ar(r,o,i,n,e[a],20,-373897302),n=ar(n,r,o,i,e[a+5],5,-701558691),i=ar(i,n,r,o,e[a+10],9,38016083),o=ar(o,i,n,r,e[a+15],14,-660478335),r=ar(r,o,i,n,e[a+4],20,-405537848),n=ar(n,r,o,i,e[a+9],5,568446438),i=ar(i,n,r,o,e[a+14],9,-1019803690),o=ar(o,i,n,r,e[a+3],14,-187363961),r=ar(r,o,i,n,e[a+8],20,1163531501),n=ar(n,r,o,i,e[a+13],5,-1444681467),i=ar(i,n,r,o,e[a+2],9,-51403784),o=ar(o,i,n,r,e[a+7],14,1735328473),n=ur(n,r=ar(r,o,i,n,e[a+12],20,-1926607734),o,i,e[a+5],4,-378558),i=ur(i,n,r,o,e[a+8],11,-2022574463),o=ur(o,i,n,r,e[a+11],16,1839030562),r=ur(r,o,i,n,e[a+14],23,-35309556),n=ur(n,r,o,i,e[a+1],4,-1530992060),i=ur(i,n,r,o,e[a+4],11,1272893353),o=ur(o,i,n,r,e[a+7],16,-155497632),r=ur(r,o,i,n,e[a+10],23,-1094730640),n=ur(n,r,o,i,e[a+13],4,681279174),i=ur(i,n,r,o,e[a],11,-358537222),o=ur(o,i,n,r,e[a+3],16,-722521979),r=ur(r,o,i,n,e[a+6],23,76029189),n=ur(n,r,o,i,e[a+9],4,-640364487),i=ur(i,n,r,o,e[a+12],11,-421815835),o=ur(o,i,n,r,e[a+15],16,530742520),n=sr(n,r=ur(r,o,i,n,e[a+2],23,-995338651),o,i,e[a],6,-198630844),i=sr(i,n,r,o,e[a+7],10,1126891415),o=sr(o,i,n,r,e[a+14],15,-1416354905),r=sr(r,o,i,n,e[a+5],21,-57434055),n=sr(n,r,o,i,e[a+12],6,1700485571),i=sr(i,n,r,o,e[a+3],10,-1894986606),o=sr(o,i,n,r,e[a+10],15,-1051523),r=sr(r,o,i,n,e[a+1],21,-2054922799),n=sr(n,r,o,i,e[a+8],6,1873313359),i=sr(i,n,r,o,e[a+15],10,-30611744),o=sr(o,i,n,r,e[a+6],15,-1560198380),r=sr(r,o,i,n,e[a+13],21,1309151649),n=sr(n,r,o,i,e[a+4],6,-145523070),i=sr(i,n,r,o,e[a+11],10,-1120210379),o=sr(o,i,n,r,e[a+2],15,718787259),r=sr(r,o,i,n,e[a+9],21,-343485551),n=rr(n,u),r=rr(r,s),o=rr(o,c),i=rr(i,f)}return[n,r,o,i]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(nr(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}));function fr(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function lr(e,t){return e<<t|e>>>32-t}var dr=tr("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var o=0;o<r.length;++o)e.push(r.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),f=0;f<16;++f)c[f]=e[64*s+4*f]<<24|e[64*s+4*f+1]<<16|e[64*s+4*f+2]<<8|e[64*s+4*f+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 l=0;l<a;++l){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=u[l][h];for(var p=16;p<80;++p)d[p]=lr(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var g=n[0],v=n[1],y=n[2],m=n[3],b=n[4],_=0;_<80;++_){var w=Math.floor(_/20),O=lr(g,5)+fr(w,v,y,m)+b+t[w]+d[_]>>>0;b=m,m=y,y=lr(v,30)>>>0,v=g,g=O}n[0]=n[0]+g>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+y>>>0,n[3]=n[3]+m>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var hr=Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,o=t||new Array(16),i=(e=e||{}).node||Jn,a=void 0!==e.clockseq?e.clockseq:Kn;if(null==i||null==a){var u=e.random||(e.rng||zn)();null==i&&(i=Jn=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==a&&(a=Kn=16383&(u[6]<<8|u[7]))}var s=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:Zn+1,f=s-$n+(c-Zn)/1e4;if(f<0&&void 0===e.clockseq&&(a=a+1&16383),(f<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,Zn=c,Kn=a;var l=(1e4*(268435455&(s+=122192928e5))+c)%4294967296;o[r++]=l>>>24&255,o[r++]=l>>>16&255,o[r++]=l>>>8&255,o[r++]=255&l;var d=s/4294967296*1e4&268435455;o[r++]=d>>>8&255,o[r++]=255&d,o[r++]=d>>>24&15|16,o[r++]=d>>>16&255,o[r++]=a>>>8|128,o[r++]=255&a;for(var h=0;h<6;++h)o[r+h]=i[h];return t||Xn(o)},v3:cr,v4:function(e,t,n){var r=(e=e||{}).random||(e.rng||zn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Xn(r)},v5:dr,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!Gn(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:Gn,stringify:Xn,parse:er});function pr(e){m(1,arguments);var t=b(e);return t.setHours(0,0,0,0),t}var gr=864e5;function vr(e,t){m(2,arguments);var n=pr(e),r=pr(t),o=n.getTime()-he(n),i=r.getTime()-he(r);return Math.round((o-i)/gr)}function yr(e,t){var n=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 n<0?-1:n>0?1:n}var mr=Object.freeze({__proto__:null,default:function(e,t){m(2,arguments);var n=b(e),r=b(t),o=yr(n,r),i=Math.abs(vr(n,r));n.setDate(n.getDate()-o*i);var a=yr(n,r)===-o,u=o*(i-a);return 0===u?0:u}}),br=n(Hn),_r=n(hr),wr=n(mr),Or=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.offersClient=t.sapiResponseToHotelOfferEntity=t.hasAnchorPrice=void 0;var n,r=Ge.__importDefault(br),o=Ge.__importDefault(wr);function i(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.baseRate;return t&&(r+=e.taxes),n&&(r+=e.localTaxes),r}function a(e,t,n){var r=(0,o.default)((0,On.dateToMiddayUTC)(n),(0,On.dateToMiddayUTC)(t));if(r<1)throw new Error("checkOut cannot be the same or less than checkIn");return 1===r?e:e/r}!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(n||(n={}));function u(e,t){return t-e>.03*t}function s(e,t){var n,r={baseRate:e.anchorRate.base,localTaxes:e.anchorRate.hotelFees,taxes:e.anchorRate.taxes},o=i(r,t.includeTaxes,t.includeLocalTaxes),s=a(o,t.checkIn,t.checkOut);return{anchorPriceRateBreakdown:Ge.__assign(Ge.__assign({},r),{calculatedTotalRate:o,nightlyRate:s}),availableOffersCount:e.availableOffersCount,fetchedAllOffers:e.fetchedAllOffers,hasMoreOffers:e.hasMoreOffers,id:e.id,offers:null===(n=e.offers)||void 0===n?void 0:n.map((function(n){return function(e,t,n,r){var o,s,c,f,l,d,h={baseRate:e.rate.base,localTaxes:e.rate.hotelFees,taxes:e.rate.taxes},p=i(h,n.includeTaxes,n.includeLocalTaxes),g=a(p,n.checkIn,n.checkOut),v=null!==(o=e.tags)&&void 0!==o?o:[],y=v.includes("top_offer"),m=v.includes("anchor_price"),b=v.includes("exclusive_cheapest_offer"),_=null===(s=e.package.amenities)||void 0===s?void 0:s.filter((function(e){return["allInclusive","breakfast","partialBreakfast","lunch","dinner","fullBoard","halfBoard","meals"].includes(e)})),w=e.package.refundable&&(0===e.cancellationPenalties.length||e.cancellationPenalties.some((function(e){return 0===e.amount||0===e.percent||0===e.nights})));return{id:e.id,bookURI:e.url,providerCode:e.providerCode,proxyProviderCode:e.intermediaryProvider,rateBreakdown:h,nightlyRate:g,calculatedTotalRate:p,availableRooms:e.availableRooms,cug:e.accessTier?e.accessTier.split(","):null,currency:e.currency,meals:_,tags:v,canPayLater:e.package.canPayLater,hasAnchorPrice:!!y&&u(p,r),hasFreeCancellation:w,isAnchorPriceOffer:m,isTopOffer:y,isCheapest:b,roomID:e.roomID,roomName:null===(c=null==t?void 0:t[e.roomID])||void 0===c?void 0:c.name,additionalProviderParams:(0,On.removeEmpty)({feedId:null!==(l=null===(f=e.metadata)||void 0===f?void 0:f.feedID)&&void 0!==l?l:"",rateType:null===(d=e.metadata)||void 0===d?void 0:d.providerRateType})}}(n,e.rooms,t,o)})),topOfferData:{anchorPrice:o,anchorPriceNightly:s,offerIndexes:[0,1,2,3]}}}t.hasAnchorPrice=u,t.sapiResponseToHotelOfferEntity=s,t.offersClient=function(e,t){if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o="wss://".concat(e.baseUrl,"/").concat(e.endpoints.offers),i=new r.default(o,[],{maxRetries:15,WebSocket:t.WebSocket}),a={},u={};function c(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"sapi",code:e.code,reason:e.reason,wasClean:e.wasClean}})}function f(e){t.logger.log({name:"WebsocketError",value:Ge.__assign(Ge.__assign({},e),{service:"sapi"})})}function l(){for(var e=0,t=Object.keys(a);e<t.length;e++){var n=t[e],r=a[n];void 0!==r&&i.send(r)}}function d(e){var t;try{t=JSON.parse(e.data)}catch(e){return void console.log("WEBSOCKET: error parsing message")}var n=u[t.clientRequestId];"function"==typeof n&&n(t)}return i.addEventListener("open",l),i.addEventListener("close",c),i.addEventListener("error",f),i.addEventListener("message",d),{getOffers:function(e,r){return Ge.__awaiter(this,void 0,void 0,(function(){var o,c;return Ge.__generator(this,(function(f){return o={},c=(0,_r.v4)(),a[c]=function(e,t,n){var r,o={checkIn:e.checkIn,checkOut:e.checkOut,anchorHotelId:e.anchorHotelId,hotelIds:e.hotelIds,rooms:e.rooms,searchId:e.searchId,cugDeals:e.cugDeals,language:t.language,deviceType:t.deviceType,anonymousId:t.anonymousId,currency:t.currency,originId:e.originId,brand:t.brand,clientRequestId:n,sortingBoost:(0,On.generateSortingBoost)(e),getAllOffers:Boolean(e.getAllOffers),preferredRate:e.preferredRate,label:e.trafficSource,countryCode:t.countryCode,variations:t.variations};try{r=JSON.stringify(o)}catch(e){console.log("WEBSOCKET: error serialising request")}return r}(e,t,c),[2,new Promise((function(f){u[c]=function(n){var i,l;if(void 0!==n)if(n.status.complete)f(o),a[c]=void 0,u[c]=void 0;else{var d=null===(i=n.results)||void 0===i?void 0:i.find((function(t){return t.id===e.anchorHotelId}));d?o.anchorHotelOfferEntity=s(d,Ge.__assign(Ge.__assign({},e),t)):o.hotelOfferEntities=null===(l=n.results)||void 0===l?void 0:l.map((function(n){return s(n,Ge.__assign(Ge.__assign({},e),t))})),"function"==typeof r&&r(Ge.__assign({},o))}};var l=a[c];void 0!==l&&(i.readyState===n.Open?i.send(l):i.readyState===n.Closed&&(i._connectLock=!1,i.reconnect()))}))]}))}))}}}})),Ir=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Sr}(e)}(e)};var Sr="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Pr(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Dr((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Tr(e,t,n){return e.concat(t).map((function(e){return Pr(e,n)}))}function Er(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function jr(e,t){try{return t in e}catch(e){return!1}}function xr(e,t,n){var r={};return n.isMergeableObject(e)&&Er(e).forEach((function(t){r[t]=Pr(e[t],n)})),Er(t).forEach((function(o){(function(e,t){return jr(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(jr(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return Dr;var n=t.customMerge(e);return"function"==typeof n?n:Dr}(o,n)(e[o],t[o],n):r[o]=Pr(t[o],n))})),r}function Dr(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Tr,n.isMergeableObject=n.isMergeableObject||Ir,n.cloneUnlessOtherwiseSpecified=Pr;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):xr(e,t,n):Pr(t,n)}Dr.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Dr(e,n,t)}),{})};var Cr=Dr,kr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getAppConfig=void 0;var n=Ge.__importDefault(Cr),r={sapiBackend:{baseUrl:"dikcjxfwieazv.cloudfront.net",endpoints:{anchor:"anchor",search:"search",offers:"ws/offers"}},saf:{baseUrl:"sapi.findhotel.services",endpoints:{offersRooms:"1/offers-rooms",search:"1/search",hotel:"1/hotel"}},algolia:{appId:"4UYGJP42KQ",apiKey:"efa703d5c0057a24487bc9bdcb597770",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"}]},client:{defaultRooms:"2",features:["offers","search","suggests","configs","rooms","get-hotel"],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"]}}},o={"findhotel-website":r,"findhotel-website-e2e":Ge.__assign(Ge.__assign({},r),{saf:Ge.__assign(Ge.__assign({},r.saf),{baseUrl:"sapi-e2e.findhotel.services"}),sapiBackend:Ge.__assign(Ge.__assign({},r.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-website-stg":Ge.__assign(Ge.__assign({},r),{sapiBackend:Ge.__assign(Ge.__assign({},r.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})}),"findhotel-website-ci":Ge.__assign(Ge.__assign({},r),{sapiBackend:Ge.__assign(Ge.__assign({},r.sapiBackend),{baseUrl:"d1ue1wauc6u0m5.cloudfront.net"})}),"findhotel-website-dev":Ge.__assign(Ge.__assign({},r),{sapiBackend:Ge.__assign(Ge.__assign({},r.sapiBackend),{baseUrl:"d3b8t16k1aaypx.cloudfront.net"})}),"findhotel-checkout":Ge.__assign(Ge.__assign({},r),{client:Ge.__assign(Ge.__assign({},r.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-e2e":Ge.__assign(Ge.__assign({},r),{saf:Ge.__assign(Ge.__assign({},r.saf),{baseUrl:"sapi-e2e.findhotel.services"}),client:Ge.__assign(Ge.__assign({},r.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-stg":Ge.__assign(Ge.__assign({},r),{saf:Ge.__assign(Ge.__assign({},r.saf),{baseUrl:"sapi-stg.findhotel.services"}),client:Ge.__assign(Ge.__assign({},r.client),{features:["rooms","get-hotel"]})})};t.getAppConfig=function(e,t){var r=o[e];if(void 0===r)throw new Error("Profile key is not valid");return t&&(r=(0,n.default)(r,t)),r}})),Ar=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=t.variationsToArray=void 0;var n={log:function(){}};function r(e){void 0===e&&(e={});var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push("".concat(n,"-").concat(e[n]));return t}t.variationsToArray=r,t.sapi=function(e,t){var o,i,a,u,s,c,f,l;return Ge.__awaiter(this,void 0,void 0,(function(){function d(e){return b.client.features.includes(e)}function h(e){return d("search")?(0,Pn.search)(e):function(){throw new Error("Search is not enabled for this profile key")}}function p(e){return d("rooms")?(0,jn.rooms)(e):function(){throw new Error("Rooms search is not enabled for this profile key")}}function g(e){return d("suggests")?(0,En.suggest)(e):function(){throw new Error("Autosuggest is not enabled for this profile key")}}function v(e){return d("get-hotel")?(0,xn.hotel)(e):function(){throw new Error("Get hotel is not alowed for this profile key")}}function y(e){return d("offers")?(0,Dn.offers)(e):function(){throw new Error("Get offers is not alowed for this profile key")}}var m,b,_,w;return Ge.__generator(this,(function(O){if(!e)throw new Error("Profile key is required");return m=Ge.__assign(Ge.__assign({},t),{logger:null!==(o=t.logger)&&void 0!==o?o:n,variations:r(t.variations),currency:null!==(a=null===(i=t.currency)||void 0===i?void 0:i.toUpperCase())&&void 0!==a?a:"USD",deviceType:null!==(s=null!==(u=t.deviceType)&&void 0!==u?u:t.deviceCategory)&&void 0!==s?s:"desktop",countryCode:null!==(c=t.countryCode)&&void 0!==c?c:t.userCountry,pageSize:null!==(f=t.pageSize)&&void 0!==f?f:20}),b=(0,kr.getAppConfig)(e,m.initWithAppConfig),_=d("offers")?(0,Or.offersClient)(b.sapiBackend,m):void 0,[2,{rooms:p(w={appConfig:b,getFeatureEnabled:d,profileKey:e,offersClient:_,options:Ge.__assign(Ge.__assign({},m),{languages:Ge.__spreadArray(Ge.__spreadArray([m.language],null!==(l=b.client.fallbackLanguages[m.language])&&void 0!==l?l:[],!0),["en"],!1)})}),search:h(w),suggest:g(w),hotel:v(w),offers:y(w)}]}))}))}})),Nr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Mr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Rr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ur=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Br=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Ge.__exportStar(Nr,t),Ge.__exportStar(Mr,t),Ge.__exportStar(Rr,t),Ge.__exportStar(Ur,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),(0,hn.enableES5)(),Ge.__exportStar(Ar,t),Ge.__exportStar(Br,t),t.default=Ar.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,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}function n(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};var a=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function s(e){return this instanceof s?(this.v=e,this):new s(e)}var c=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var l=Object.freeze({__proto__:null,__extends:function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return o},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},__decorate:function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{s(r.next(e))}catch(e){a(e)}}function u(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}s((r=r.apply(e,t||[])).next())}))},__generator:function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},__createBinding:a,__exportStar:function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)},__values:i,__read:u,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(u(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,u=a.length;i<u;i++,o++)r[o]=a[i];return r},__spreadArray:function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},__await:s,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),a=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof s?Promise.resolve(e.value.v).then(c,l):f(a[0][2],e)}(o[e](t))}catch(e){f(a[0][3],e)}}function c(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),a.shift(),a.length&&u(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:s(e[r](t)),done:"return"===r}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=i(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return c(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},__classPrivateFieldSet:function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}});var f=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(n,r){var o=new XMLHttpRequest,a=[],i=[],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 a},entries:function(){return i},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,n){a.push(t=t.toLowerCase()),i.push([t,n]),u[t]=u[t]?u[t]+","+n:n})),n(s())},o.onerror=r,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),d={};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;d.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,n){var r=e.create,o=e.defineProperty,a=/[!'\(\)~]|%20|%00/g,i=/%(?![0-9a-fA-F]{2})/g,u=/\+/g,s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},c={append:function(e,t){p(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,n){this._ungap[e]=[t(n)]},forEach:function(e,n){var r=this;for(var o in r._ungap)r._ungap[o].forEach(a,o);function a(a){e.call(n,a,t(o),r)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var n=g(t),r=0,o=this._ungap[t];r<o.length;r++)e.push(n+"="+g(o[r]));return e.join("&")}};for(var l in c)o(f.prototype,l,{configurable:!0,writable:!0,value:c[l]});function f(e){var t=r(null);switch(o(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var a=e.split("&"),i=0,u=a.length;i<u;i++){var s=(c=a[i]).indexOf("=");-1<s?p(t,v(c.slice(0,s)),v(c.slice(s+1))):c.length&&p(t,v(c),"")}break;case n(e):for(i=0,u=e.length;i<u;i++){var c;p(t,(c=e[i])[0],c[1])}break;case"forEach"in e:e.forEach(h,t);break;default:for(var l in e)p(t,l,e[l])}}function h(e,t){p(this,t,e)}function p(e,t,r){var o=n(r)?r.join(","):r;t in e?e[t].push(o):e[t]=[o]}function v(e){return decodeURIComponent(e.replace(i,"%25").replace(u," "))}function g(e){return encodeURIComponent(e).replace(a,m)}function m(e){return s[e]}d.URLSearchParams=f}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function n(e,n){var r=[];return e.forEach(n,r),t?r[Symbol.iterator]():{next:function(){var e=r.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var n=this,r=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(o){o.length&&!(o in r)&&(r[o]=n.getAll(o)).forEach((function(r){e.call(t,r,o,n)}))}))}),"keys"in e||(e.keys=function(){return n(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return n(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return n(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,n,r=this.entries(),o=r.next(),a=o.done,i=[],u=Object.create(null);!a;)t=(n=o.value)[0],i.push(t),t in u||(u[t]=[]),u[t].push(n[1]),a=(o=r.next()).done;for(i.sort(),e=0;e<i.length;e++)this.delete(i[e]);for(e=0;e<i.length;e++)t=i[e],this.append(t,u[t].shift())}),function(t){var n=t.defineProperty,r=t.getOwnPropertyDescriptor,o=function(t){var n=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=n},a=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},i=function(i){var u,s,c=i.prototype,l=r(c,"searchParams"),f=r(c,"href"),d=r(c,"search");!l&&d&&d.set&&(s=function(t){function r(n,r){e.append.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function o(n){e.delete.call(this,n),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function a(n,r){e.set.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}return function(e,t){return e.append=r,e.delete=o,e.set=a,n(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),u=function(e,t){return n(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 a(this,i),this._searchParams||u(this,new URLSearchParams(this.search.slice(1)))},set:function(e){a(this,i),u(this,e)}}}))};try{i(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&i(URL)}catch(e){}}(Object)}(d.URLSearchParams.prototype);var h=d.URLSearchParams,p=Object.freeze({__proto__:null,default:h}),v=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})))}})),g=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDiscount=void 0,t.calculateDiscount=function(e,t,n){return void 0===t||void 0===n||0===n?0:e<t?-1*(e-t)/t:e>n?-1*(e-n)/n:0}}));function m(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function y(e){m(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 b(e){m(1,arguments);var t=y(e);return!isNaN(t)}var _={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 w(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var O={date:w({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:w({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:w({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},P={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function T(e){return function(t,n){var r,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;r=e.formattingValues[i]||e.formattingValues[a]}else{var u=e.defaultWidth,s=o.width?String(o.width):e.defaultWidth;r=e.values[s]||e.values[u]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var S={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:T({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:T({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:T({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:T({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:T({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function I(e){return function(t,n){var r=String(t),o=n||{},a=o.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],u=r.match(i);if(!u)return null;var s,c=u[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth];return s="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(l,(function(e){return e.test(c)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(l,(function(e){return e.test(c)})),s=e.valueCallback?e.valueCallback(s):s,{value:s=o.valueCallback?o.valueCallback(s):s,rest:r.slice(c.length)}}}var D,j={ordinalNumber:(D={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},o=n.match(D.matchPattern);if(!o)return null;var a=o[0],i=n.match(D.parsePattern);if(!i)return null;var u=D.valueCallback?D.valueCallback(i[0]):i[0];return{value:u=r.valueCallback?r.valueCallback(u):u,rest:n.slice(a.length)}}),era:I({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:I({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:I({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:I({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:I({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"})},x={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof _[e]?_[e]:1===t?_[e].one:_[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:O,formatRelative:function(e,t,n,r){return P[e]},localize:S,match:j,options:{weekStartsOn:0,firstWeekContainsDate:1}};function k(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 C(e,t){m(2,arguments);var n=y(e).getTime(),r=k(t);return new Date(n+r)}function E(e,t){m(2,arguments);var n=k(t);return C(e,-n)}function R(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var N=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return R("yy"===t?r%100:r,t.length)},M=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):R(n+1,2)},A=function(e,t){return R(e.getUTCDate(),t.length)},U=function(e,t){return R(e.getUTCHours()%12||12,t.length)},q=function(e,t){return R(e.getUTCHours(),t.length)},F=function(e,t){return R(e.getUTCMinutes(),t.length)},L=function(e,t){return R(e.getUTCSeconds(),t.length)},H=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return R(Math.floor(r*Math.pow(10,n-3)),t.length)},z=864e5;function W(e){m(1,arguments);var t=1,n=y(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function B(e){m(1,arguments);var t=y(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=W(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=W(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Y(e){m(1,arguments);var t=B(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=W(n);return r}var G=6048e5;function J(e,t){m(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:k(o),i=null==n.weekStartsOn?a:k(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=y(e),s=u.getUTCDay(),c=(s<i?7:0)+s-i;return u.setUTCDate(u.getUTCDate()-c),u.setUTCHours(0,0,0,0),u}function Q(e,t){m(1,arguments);var n=y(e,t),r=n.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,u=null==i?1:k(i),s=null==o.firstWeekContainsDate?u:k(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(r+1,0,s),c.setUTCHours(0,0,0,0);var l=J(c,t),f=new Date(0);f.setUTCFullYear(r,0,s),f.setUTCHours(0,0,0,0);var d=J(f,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function K(e,t){m(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.firstWeekContainsDate,a=null==o?1:k(o),i=null==n.firstWeekContainsDate?a:k(n.firstWeekContainsDate),u=Q(e,t),s=new Date(0);s.setUTCFullYear(u,0,i),s.setUTCHours(0,0,0,0);var c=J(s,t);return c}var V=6048e5;var X="midnight",$="noon",Z="morning",ee="afternoon",te="evening",ne="night",re={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return N(e,t)},Y:function(e,t,n,r){var o=Q(e,r),a=o>0?o:1-o;return"YY"===t?R(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):R(a,t.length)},R:function(e,t){return R(B(e),t.length)},u:function(e,t){return R(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return R(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return R(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return R(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){m(1,arguments);var n=y(e),r=J(n,t).getTime()-K(n,t).getTime();return Math.round(r/V)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):R(o,t.length)},I:function(e,t,n){var r=function(e){m(1,arguments);var t=y(e),n=W(t).getTime()-Y(t).getTime();return Math.round(n/G)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):R(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):A(e,t)},D:function(e,t,n){var r=function(e){m(1,arguments);var t=y(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/z)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):R(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return R(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return R(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return R(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?$:0===o?X:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?te:o>=12?ee:o>=4?Z:ne,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return U(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):q(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):R(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):R(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):F(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):L(e,t)},S:function(e,t){return H(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return ae(o);case"XXXX":case"XX":return ie(o);default:return ie(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return ae(o);case"xxxx":case"xx":return ie(o);default:return ie(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+oe(o,":");default:return"GMT"+ie(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+oe(o,":");default:return"GMT"+ie(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return R(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return R((r._originalDate||e).getTime(),t.length)}};function oe(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;if(0===a)return n+String(o);var i=t||"";return n+String(o)+i+R(a,2)}function ae(e,t){return e%60==0?(e>0?"-":"+")+R(Math.abs(e)/60,2):ie(e,t)}function ie(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+R(Math.floor(o/60),2)+n+R(o%60,2)}function ue(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}}function se(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}}var ce={p:se,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),o=r[1],a=r[2];if(!a)return ue(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",ue(o,t)).replace("{{time}}",se(a,t))}},le=6e4;function fe(e){return e.getTime()%le}function de(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var r=n>0?(le+fe(t))%le:fe(t);return n*le+r}var he=["D","DD"],pe=["YY","YYYY"];function ve(e){return-1!==he.indexOf(e)}function ge(e){return-1!==pe.indexOf(e)}function me(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; 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(n,"`; 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(n,"`; 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(n,"`; see: https://git.io/fxCyr"))}var ye=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,be=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_e=/^'([^]*?)'?$/,we=/''/g,Oe=/[a-zA-Z]/;function Pe(e){return e.match(_e)[1].replace(we,"'")}var Te=Object.freeze({__proto__:null,default:function(e,t,n){m(2,arguments);var r=String(t),o=n||{},a=o.locale||x,i=a.options&&a.options.firstWeekContainsDate,u=null==i?1:k(i),s=null==o.firstWeekContainsDate?u:k(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,l=null==c?0:k(c),f=null==o.weekStartsOn?l:k(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=y(e);if(!b(d))throw new RangeError("Invalid time value");var h=de(d),p=E(d,h),v={firstWeekContainsDate:s,weekStartsOn:f,locale:a,_originalDate:d},g=r.match(be).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,ce[t])(e,a.formatLong,v):e})).join("").match(ye).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return Pe(n);var i=re[r];if(i)return!o.useAdditionalWeekYearTokens&&ge(n)&&me(n,t,e),!o.useAdditionalDayOfYearTokens&&ve(n)&&me(n,t,e),i(p,n,a.localize,v);if(r.match(Oe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return g}});function Se(e,t){m(2,arguments);var n=y(e),r=k(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}var Ie=Object.freeze({__proto__:null,default:Se});function De(e,t){m(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:k(o),i=null==n.weekStartsOn?a:k(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var u=y(e),s=u.getDay(),c=6+(s<i?-7:0)-(s-i);return u.setHours(0,0,0,0),u.setDate(u.getDate()+c),u}var je=Object.freeze({__proto__:null,default:function(e){return m(1,arguments),De(e,{weekStartsOn:1})}});var xe=Object.freeze({__proto__:null,default:function(e,t){m(2,arguments);var n=k(t),r=7*n;return Se(e,r)}}),ke=36e5,Ce={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Re=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Ne=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Me(e){var t,n={},r=e.split(Ce.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1],Ce.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Ce.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var o=Ce.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}function Ae(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:null};var o=r[1]&&parseInt(r[1]),a=r[2]&&parseInt(r[2]);return{year:null==a?o:100*a,restDateString:e.slice((r[1]||r[2]).length)}}function Ue(e,t){if(null===t)return null;var n=e.match(Ee);if(!n)return null;var r=!!n[4],o=qe(n[1]),a=qe(n[2])-1,i=qe(n[3]),u=qe(n[4]),s=qe(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,u,s)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,a=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,u,s):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(ze[t]||(We(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(We(e)?366:365)}(t,o)?(c.setUTCFullYear(t,a,Math.max(o,i)),c):new Date(NaN)}function qe(e){return e?parseInt(e):1}function Fe(e){var t=e.match(Re);if(!t)return null;var n=Le(t[1]),r=Le(t[2]),o=Le(t[3]);return function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?n*ke+6e4*r+1e3*o:NaN}function Le(e){return e&&parseFloat(e.replace(",","."))||0}function He(e){if("Z"===e)return 0;var t=e.match(Ne);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(r*ke+6e4*o):NaN}var ze=[31,null,31,30,31,30,31,31,30,31,30,31];function We(e){return e%400==0||e%4==0&&e%100}var Be=Object.freeze({__proto__:null,default:function(e,t){m(1,arguments);var n=t||{},r=null==n.additionalDigits?2:k(n.additionalDigits);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,a=Me(e);if(a.date){var i=Ae(a.date,r);o=Ue(i.restDateString,i.year)}if(isNaN(o)||!o)return new Date(NaN);var u,s=o.getTime(),c=0;if(a.time&&(c=Fe(a.time),isNaN(c)||null===c))return new Date(NaN);if(!a.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=He(a.timezone),isNaN(u)?new Date(NaN):new Date(s+c+u)}}),Ye=n(l),Ge=n(Te),Je=n(Ie),Qe=n(je),Ke=n(xe),Ve=n(Be),Xe=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var n=Ye.__importDefault(Ge),r=Ye.__importDefault(Je),o=Ye.__importDefault(Qe),a=Ye.__importDefault(Ke),i=Ye.__importDefault(Ve);function u(e){return(0,i.default)("".concat(e," 12:00:00"))}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=u;var s=function(e,t){return(0,r.default)(e,t)};t.getCheckInCheckOutDates=function(e,i){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h,v=u((0,n.default)(new Date,t.DATE_FORMAT));c=void 0!==l?u(l):d?s(v,d):function(e){for(var i,s=e.daysFromNow,c=e.blockedDefaultDates,l=u((0,n.default)(new Date,t.DATE_FORMAT)),f=(0,o.default)((0,r.default)(l,s));i=(0,n.default)(f,t.DATE_FORMAT),c.includes(i);)f=(0,a.default)(f,1);return f}(i);var g=void 0===f?s(c,p):u(f);return{checkIn:(0,n.default)(c,t.DATE_FORMAT),checkOut:(0,n.default)(g,t.DATE_FORMAT)}}})),$e=t((function(e,t){function n(e){void 0===e&&(e=[]);var t={},n={};e.forEach((function(e){var n=e[0],r=e[1],o=e[2],a=e[3];r&&(t[n]=(0,g.calculateDiscount)(r,o,a))}));var r=Math.min.apply(Math,Object.values(t)),o=Math.max.apply(Math,Object.values(t));return e.forEach((function(e){var a=e[0],i=e[1],u=(e[2],e[3]),s=i&&u&&u>0?o===r?1:(t[a]-r)/(o-r):void 0;void 0!==s&&(n[a]=Number(s.toFixed(2)))})),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getDealScores=t.calculateDealScores=void 0,t.calculateDealScores=n,t.getDealScores=function(e){var t=e.offset,r=e.anchorHotelId,o=e.hotelIds,a=e.hotelEntities,i=e.hotelOfferEntities,u=(void 0===r||t>0?o:Ye.__spreadArray([r],o,!0)).map((function(e){var t,n,r,o=a[e],u=i[e],s=null!==(t=null==o?void 0:o.regularPriceRange)&&void 0!==t?t:[],c=s[0],l=s[1];return[e,null===(r=null===(n=null==u?void 0:u.offers)||void 0===n?void 0:n[0])||void 0===r?void 0:r.nightlyRate,c,l]}));return n(u)}})),Ze=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){for(var n={},r={},o=0,a=e.length;o<a;)r[e[o]]=1,o+=1;for(var i in t)Object.prototype.hasOwnProperty.call(r,i)||(n[i]=t[i]);return n}}));function et(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("production"!==process.env.NODE_ENV){var o=Qt[e],a=o?"function"==typeof o?o.apply(null,n):o:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function tt(e){return!!e&&!!e[Gt]}function nt(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Kt}(e)||Array.isArray(e)||!!e[Yt]||!!e.constructor[Yt]||ct(e)||lt(e))}function rt(e,t,n){void 0===n&&(n=!1),0===ot(e)?(n?Object.keys:Vt)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function ot(e){var t=e[Gt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:ct(e)?2:lt(e)?3:0}function at(e,t){return 2===ot(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function it(e,t){return 2===ot(e)?e.get(t):e[t]}function ut(e,t,n){var r=ot(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function st(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function ct(e){return Ht&&e instanceof Map}function lt(e){return zt&&e instanceof Set}function ft(e){return e.o||e.t}function dt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Xt(e);delete t[Gt];for(var n=Vt(t),r=0;r<n.length;r++){var o=n[r],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function ht(e,t){return void 0===t&&(t=!1),vt(e)||tt(e)||!nt(e)||(ot(e)>1&&(e.set=e.add=e.clear=e.delete=pt),Object.freeze(e),t&&rt(e,(function(e,t){return ht(t,!0)}),!0)),e}function pt(){et(2)}function vt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function gt(e){var t=$t[e];return t||et(18,e),t}function mt(e,t){$t[e]||($t[e]=t)}function yt(){return"production"===process.env.NODE_ENV||Ft||et(0),Ft}function bt(e,t){t&&(gt("Patches"),e.u=[],e.s=[],e.v=t)}function _t(e){wt(e),e.p.forEach(Pt),e.p=null}function wt(e){e===Ft&&(Ft=e.l)}function Ot(e){return Ft={p:[],l:Ft,h:e,m:!0,_:0}}function Pt(e){var t=e[Gt];0===t.i||1===t.i?t.j():t.O=!0}function Tt(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||gt("ES5").S(t,e,r),r?(n[Gt].P&&(_t(t),et(4)),nt(e)&&(e=St(t,e),t.l||Dt(t,e)),t.u&>("Patches").M(n[Gt],e,t.u,t.s)):e=St(t,n,[]),_t(t),t.u&&t.v(t.u,t.s),e!==Bt?e:void 0}function St(e,t,n){if(vt(t))return t;var r=t[Gt];if(!r)return rt(t,(function(o,a){return It(e,r,t,o,a,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return Dt(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=dt(r.k):r.o;rt(3===r.i?new Set(o):o,(function(t,a){return It(e,r,o,t,a,n)})),Dt(e,o,!1),n&&e.u&>("Patches").R(r,n,e.u,e.s)}return r.o}function It(e,t,n,r,o,a){if("production"!==process.env.NODE_ENV&&o===n&&et(5),tt(o)){var i=St(e,o,a&&t&&3!==t.i&&!at(t.D,r)?a.concat(r):void 0);if(ut(n,r,i),!tt(i))return;e.m=!1}if(nt(o)&&!vt(o)){if(!e.h.F&&e._<1)return;St(e,o),t&&t.A.l||Dt(e,o)}}function Dt(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&ht(t,n)}function jt(e,t){var n=e[Gt];return(n?ft(n):e)[t]}function xt(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function kt(e){e.P||(e.P=!0,e.l&&kt(e.l))}function Ct(e){e.o||(e.o=dt(e.t))}function Et(e,t,n){var r=ct(t)?gt("MapSet").N(t,n):lt(t)?gt("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:yt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,a=Zt;n&&(o=[r],a=en);var i=Proxy.revocable(o,a),u=i.revoke,s=i.proxy;return r.k=s,r.j=u,s}(t,n):gt("ES5").J(t,n);return(n?n.A:yt()).p.push(r),r}function Rt(e){return tt(e)||et(22,e),function e(t){if(!nt(t))return t;var n,r=t[Gt],o=ot(t);if(r){if(!r.P&&(r.i<4||!gt("ES5").K(r)))return r.t;r.I=!0,n=Nt(t,o),r.I=!1}else n=Nt(t,o);return rt(n,(function(t,o){r&&it(r.t,t)===o||ut(n,t,e(o))})),3===o?new Set(n):n}(e)}function Nt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return dt(e)}function Mt(){function e(e,t){var n=a[e];return n?n.enumerable=t:a[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Gt];return"production"!==process.env.NODE_ENV&&o(t),Zt.get(t,e)},set:function(t){var n=this[Gt];"production"!==process.env.NODE_ENV&&o(n),Zt.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Gt];if(!o.P)switch(o.i){case 5:r(o)&&kt(o);break;case 4:n(o)&&kt(o)}}}function n(e){for(var t=e.t,n=e.k,r=Vt(n),o=r.length-1;o>=0;o--){var a=r[o];if(a!==Gt){var i=t[a];if(void 0===i&&!at(t,a))return!0;var u=n[a],s=u&&u[Gt];if(s?s.t!==i:!st(u,i))return!0}}var c=!!t[Gt];return r.length!==Vt(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!n||n.get)}function o(e){e.O&&et(3,JSON.stringify(ft(e)))}var a={};mt("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var a=Xt(n);delete a[Gt];for(var i=Vt(a),u=0;u<i.length;u++){var s=i[u];a[s]=e(s,t||!!a[s].enumerable)}return Object.create(Object.getPrototypeOf(n),a)}(r,t),a={i:r?5:4,A:n?n.A:yt(),P:!1,I:!1,D:{},l:n,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,Gt,{value:a,writable:!0}),o},S:function(e,n,o){o?tt(n)&&n[Gt].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[Gt];if(n){var o=n.t,a=n.k,i=n.D,u=n.i;if(4===u)rt(a,(function(t){t!==Gt&&(void 0!==o[t]||at(o,t)?i[t]||e(a[t]):(i[t]=!0,kt(n)))})),rt(o,(function(e){void 0!==a[e]||at(a,e)||(i[e]=!1,kt(n))}));else if(5===u){if(r(n)&&(kt(n),i.length=!0),a.length<o.length)for(var s=a.length;s<o.length;s++)i[s]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var l=Math.min(a.length,o.length),f=0;f<l;f++)void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}function At(){function e(t){if(!nt(t))return t;if(Array.isArray(t))return t.map(e);if(ct(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(lt(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return at(t,Yt)&&(n[Yt]=t[Yt]),n}function t(t){return tt(t)?e(t):t}var n="add";mt("Patches",{$:function(t,r){return r.forEach((function(r){for(var o=r.path,a=r.op,i=t,u=0;u<o.length-1;u++){var s=ot(i),c=""+o[u];0!==s&&1!==s||"__proto__"!==c&&"constructor"!==c||et(24),"function"==typeof i&&"prototype"===c&&et(24),"object"!=typeof(i=it(i,c))&&et(15,o.join("/"))}var l=ot(i),f=e(r.value),d=o[o.length-1];switch(a){case"replace":switch(l){case 2:return i.set(d,f);case 3:et(16);default:return i[d]=f}case n:switch(l){case 1:return i.splice(d,0,f);case 2:return i.set(d,f);case 3:return i.add(f);default:return i[d]=f}case"remove":switch(l){case 1:return i.splice(d,1);case 2:return i.delete(d);case 3:return i.delete(r.value);default:return delete i[d]}default:et(17,a)}})),t},R:function(e,r,o,a){switch(e.i){case 0:case 4:case 2:return function(e,r,o,a){var i=e.t,u=e.o;rt(e.D,(function(e,s){var c=it(i,e),l=it(u,e),f=s?at(i,e)?"replace":n:"remove";if(c!==l||"replace"!==f){var d=r.concat(e);o.push("remove"===f?{op:f,path:d}:{op:f,path:d,value:l}),a.push(f===n?{op:"remove",path:d}:"remove"===f?{op:n,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,r,o,a);case 5:case 1:return function(e,r,o,a){var i=e.t,u=e.D,s=e.o;if(s.length<i.length){var c=[s,i];i=c[0],s=c[1];var l=[a,o];o=l[0],a=l[1]}for(var f=0;f<i.length;f++)if(u[f]&&s[f]!==i[f]){var d=r.concat([f]);o.push({op:"replace",path:d,value:t(s[f])}),a.push({op:"replace",path:d,value:t(i[f])})}for(var h=i.length;h<s.length;h++){var p=r.concat([h]);o.push({op:n,path:p,value:t(s[h])})}i.length<s.length&&a.push({op:"replace",path:r.concat(["length"]),value:i.length})}(e,r,o,a);case 3:return function(e,t,r,o){var a=e.t,i=e.o,u=0;a.forEach((function(e){if(!i.has(e)){var a=t.concat([u]);r.push({op:"remove",path:a,value:e}),o.unshift({op:n,path:a,value:e})}u++})),u=0,i.forEach((function(e){if(!a.has(e)){var i=t.concat([u]);r.push({op:n,path:i,value:e}),o.unshift({op:"remove",path:i,value:e})}u++}))}(e,r,o,a)}},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t===Bt?void 0:t}),r.push({op:"replace",path:[],value:e.t})}})}function Ut(){function e(e,t){function n(){this.constructor=e}o(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(nt(t)){var n=Et(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)})))}function r(e){e.O&&et(3,JSON.stringify(ft(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},a=function(){function n(e,t){return this[Gt]={i:2,l:t,A:t?t.A:yt(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return ft(this[Gt]).size}}),o.has=function(e){return ft(this[Gt]).has(e)},o.set=function(e,n){var o=this[Gt];return r(o),ft(o).has(e)&&ft(o).get(e)===n||(t(o),kt(o),o.D.set(e,!0),o.o.set(e,n),o.D.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var n=this[Gt];return r(n),t(n),kt(n),n.D.set(e,!1),n.o.delete(e),!0},o.clear=function(){var e=this[Gt];r(e),ft(e).size&&(t(e),kt(e),e.D=new Map,rt(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var n=this;ft(this[Gt]).forEach((function(r,o){e.call(t,n.get(o),o,n)}))},o.get=function(e){var n=this[Gt];r(n);var o=ft(n).get(e);if(n.I||!nt(o))return o;if(o!==n.t.get(e))return o;var a=Et(n.A.h,o,n);return t(n),n.o.set(e,a),a},o.keys=function(){return ft(this[Gt]).keys()},o.values=function(){var e,t=this,n=this.keys();return(e={})[Jt]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,n=this.keys();return(e={})[Jt]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},o[Jt]=function(){return this.entries()},n}(),i=function(){function t(e,t){return this[Gt]={i:3,l:t,A:t?t.A:yt(),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 ft(this[Gt]).size}}),o.has=function(e){var t=this[Gt];return r(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[Gt];return r(t),this.has(e)||(n(t),kt(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[Gt];return r(t),n(t),kt(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[Gt];r(e),ft(e).size&&(n(e),kt(e),e.o.clear())},o.values=function(){var e=this[Gt];return r(e),n(e),e.o.values()},o.entries=function(){var e=this[Gt];return r(e),n(e),e.o.entries()},o.keys=function(){return this.values()},o[Jt]=function(){return this.values()},o.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();mt("MapSet",{N:function(e,t){return new a(e,t)},T:function(e,t){return new i(e,t)}})}var qt,Ft,Lt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Ht="undefined"!=typeof Map,zt="undefined"!=typeof Set,Wt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Bt=Lt?Symbol.for("immer-nothing"):((qt={})["immer-nothing"]=!0,qt),Yt=Lt?Symbol.for("immer-draftable"):"__$immer_draftable",Gt=Lt?Symbol.for("immer-state"):"__$immer_state",Jt="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Qt={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"},Kt=""+Object.prototype.constructor,Vt="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Xt=Object.getOwnPropertyDescriptors||function(e){var t={};return Vt(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},$t={},Zt={get:function(e,t){if(t===Gt)return e;var n=ft(e);if(!at(n,t))return function(e,t,n){var r,o=xt(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!nt(r)?r:r===jt(e.t,t)?(Ct(e),e.o[t]=Et(e.A.h,r,e)):r},has:function(e,t){return t in ft(e)},ownKeys:function(e){return Reflect.ownKeys(ft(e))},set:function(e,t,n){var r=xt(ft(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=jt(ft(e),t),a=null==o?void 0:o[Gt];if(a&&a.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(st(n,o)&&(void 0!==n||at(e.t,t)))return!0;Ct(e),kt(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==jt(e.t,t)||t in e.t?(e.D[t]=!1,Ct(e),kt(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=ft(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){et(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){et(12)}},en={};rt(Zt,(function(e,t){en[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),en.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&et(13),Zt.deleteProperty.call(this,e[0],t)},en.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&et(14),Zt.set.call(this,e[0],t,n,e[0])};var tn,nn=function(){function e(e){var t=this;this.g=Wt,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,i=Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return a.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(i))}))}}var i;if("function"!=typeof n&&et(6),void 0!==r&&"function"!=typeof r&&et(7),nt(e)){var u=Ot(t),s=Et(t,e,void 0),c=!0;try{i=n(s),c=!1}finally{c?_t(u):wt(u)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return bt(u,r),Tt(e,u)}),(function(e){throw _t(u),e})):(bt(u,r),Tt(i,u))}if(!e||"object"!=typeof e){if((i=n(e))===Bt)return;return void 0===i&&(i=e),t.F&&ht(i,!0),i}et(21,e)},this.produceWithPatches=function(e,n){return"function"==typeof e?function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))}:[t.produce(e,n,(function(e,t){r=e,o=t})),r,o];var r,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){nt(e)||et(8),tt(e)&&(e=Rt(e));var t=Ot(this),n=Et(this,e,void 0);return n[Gt].C=!0,wt(t),n},t.finishDraft=function(e,t){var n=e&&e[Gt];"production"!==process.env.NODE_ENV&&(n&&n.C||et(9),n.I&&et(10));var r=n.A;return bt(r,t),Tt(void 0,r)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Wt&&et(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var o=gt("Patches").$;return tt(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(n+1))}))},e}(),rn=new nn,on=rn.produce,an=rn.produceWithPatches.bind(rn),un=rn.setAutoFreeze.bind(rn),sn=rn.setUseProxies.bind(rn),cn=rn.applyPatches.bind(rn),ln=rn.createDraft.bind(rn),fn=rn.finishDraft.bind(rn),dn=Object.freeze({__proto__:null,default:on,Immer:nn,applyPatches:cn,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:ln,current:Rt,enableAllPlugins:function(){Mt(),Ut(),At()},enableES5:Mt,enableMapSet:Ut,enablePatches:At,finishDraft:fn,freeze:ht,immerable:Yt,isDraft:tt,isDraftable:nt,nothing:Bt,original:function(e){return tt(e)||et(23,e),e[Gt].t},produce:on,produceWithPatches:an,setAutoFreeze:un,setUseProxies:sn}),hn=n(dn),pn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createState=void 0,t.createState=function(e){var t=e;return{current:function(){return t},get:function(e){return t[e]},update:function(e){t=(0,hn.produce)(t,e)}}}})),vn=new Uint8Array(16);function gn(){if(!tn&&!(tn="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 tn(vn)}var mn=/^(?:[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 yn(e){return"string"==typeof e&&mn.test(e)}for(var bn,_n,wn=[],On=0;On<256;++On)wn.push((On+256).toString(16).substr(1));function Pn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(wn[e[t+0]]+wn[e[t+1]]+wn[e[t+2]]+wn[e[t+3]]+"-"+wn[e[t+4]]+wn[e[t+5]]+"-"+wn[e[t+6]]+wn[e[t+7]]+"-"+wn[e[t+8]]+wn[e[t+9]]+"-"+wn[e[t+10]]+wn[e[t+11]]+wn[e[t+12]]+wn[e[t+13]]+wn[e[t+14]]+wn[e[t+15]]).toLowerCase();if(!yn(n))throw TypeError("Stringified UUID is invalid");return n}var Tn=0,Sn=0;function In(e){if(!yn(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function Dn(e,t,n){function r(e,r,o,a){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=In(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(r),i.set(e,r.length),(i=n(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){a=a||0;for(var u=0;u<16;++u)o[a+u]=i[u];return o}return Pn(i)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function jn(e){return 14+(e+64>>>9<<4)+1}function xn(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function kn(e,t,n,r,o,a){return xn((i=xn(xn(t,e),xn(r,a)))<<(u=o)|i>>>32-u,n);var i,u}function Cn(e,t,n,r,o,a,i){return kn(t&n|~t&r,e,t,o,a,i)}function En(e,t,n,r,o,a,i){return kn(t&r|n&~r,e,t,o,a,i)}function Rn(e,t,n,r,o,a,i){return kn(t^n^r,e,t,o,a,i)}function Nn(e,t,n,r,o,a,i){return kn(n^(t|~r),e,t,o,a,i)}var Mn=Dn("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r="0123456789abcdef",o=0;o<n;o+=8){var a=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(a>>>4&15)+r.charAt(15&a),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[jn(t)-1]=t;for(var n=1732584193,r=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var u=n,s=r,c=o,l=a;n=Cn(n,r,o,a,e[i],7,-680876936),a=Cn(a,n,r,o,e[i+1],12,-389564586),o=Cn(o,a,n,r,e[i+2],17,606105819),r=Cn(r,o,a,n,e[i+3],22,-1044525330),n=Cn(n,r,o,a,e[i+4],7,-176418897),a=Cn(a,n,r,o,e[i+5],12,1200080426),o=Cn(o,a,n,r,e[i+6],17,-1473231341),r=Cn(r,o,a,n,e[i+7],22,-45705983),n=Cn(n,r,o,a,e[i+8],7,1770035416),a=Cn(a,n,r,o,e[i+9],12,-1958414417),o=Cn(o,a,n,r,e[i+10],17,-42063),r=Cn(r,o,a,n,e[i+11],22,-1990404162),n=Cn(n,r,o,a,e[i+12],7,1804603682),a=Cn(a,n,r,o,e[i+13],12,-40341101),o=Cn(o,a,n,r,e[i+14],17,-1502002290),n=En(n,r=Cn(r,o,a,n,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=En(a,n,r,o,e[i+6],9,-1069501632),o=En(o,a,n,r,e[i+11],14,643717713),r=En(r,o,a,n,e[i],20,-373897302),n=En(n,r,o,a,e[i+5],5,-701558691),a=En(a,n,r,o,e[i+10],9,38016083),o=En(o,a,n,r,e[i+15],14,-660478335),r=En(r,o,a,n,e[i+4],20,-405537848),n=En(n,r,o,a,e[i+9],5,568446438),a=En(a,n,r,o,e[i+14],9,-1019803690),o=En(o,a,n,r,e[i+3],14,-187363961),r=En(r,o,a,n,e[i+8],20,1163531501),n=En(n,r,o,a,e[i+13],5,-1444681467),a=En(a,n,r,o,e[i+2],9,-51403784),o=En(o,a,n,r,e[i+7],14,1735328473),n=Rn(n,r=En(r,o,a,n,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=Rn(a,n,r,o,e[i+8],11,-2022574463),o=Rn(o,a,n,r,e[i+11],16,1839030562),r=Rn(r,o,a,n,e[i+14],23,-35309556),n=Rn(n,r,o,a,e[i+1],4,-1530992060),a=Rn(a,n,r,o,e[i+4],11,1272893353),o=Rn(o,a,n,r,e[i+7],16,-155497632),r=Rn(r,o,a,n,e[i+10],23,-1094730640),n=Rn(n,r,o,a,e[i+13],4,681279174),a=Rn(a,n,r,o,e[i],11,-358537222),o=Rn(o,a,n,r,e[i+3],16,-722521979),r=Rn(r,o,a,n,e[i+6],23,76029189),n=Rn(n,r,o,a,e[i+9],4,-640364487),a=Rn(a,n,r,o,e[i+12],11,-421815835),o=Rn(o,a,n,r,e[i+15],16,530742520),n=Nn(n,r=Rn(r,o,a,n,e[i+2],23,-995338651),o,a,e[i],6,-198630844),a=Nn(a,n,r,o,e[i+7],10,1126891415),o=Nn(o,a,n,r,e[i+14],15,-1416354905),r=Nn(r,o,a,n,e[i+5],21,-57434055),n=Nn(n,r,o,a,e[i+12],6,1700485571),a=Nn(a,n,r,o,e[i+3],10,-1894986606),o=Nn(o,a,n,r,e[i+10],15,-1051523),r=Nn(r,o,a,n,e[i+1],21,-2054922799),n=Nn(n,r,o,a,e[i+8],6,1873313359),a=Nn(a,n,r,o,e[i+15],10,-30611744),o=Nn(o,a,n,r,e[i+6],15,-1560198380),r=Nn(r,o,a,n,e[i+13],21,1309151649),n=Nn(n,r,o,a,e[i+4],6,-145523070),a=Nn(a,n,r,o,e[i+11],10,-1120210379),o=Nn(o,a,n,r,e[i+2],15,718787259),r=Nn(r,o,a,n,e[i+9],21,-343485551),n=xn(n,u),r=xn(r,s),o=xn(o,c),a=xn(a,l)}return[n,r,o,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(jn(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}));function An(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function Un(e,t){return e<<t|e>>>32-t}var qn=Dn("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var o=0;o<r.length;++o)e.push(r.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,i=Math.ceil(a/16),u=new Array(i),s=0;s<i;++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[i-1][14]=8*(e.length-1)/Math.pow(2,32),u[i-1][14]=Math.floor(u[i-1][14]),u[i-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=u[f][h];for(var p=16;p<80;++p)d[p]=Un(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var v=n[0],g=n[1],m=n[2],y=n[3],b=n[4],_=0;_<80;++_){var w=Math.floor(_/20),O=Un(v,5)+An(w,g,m,y)+b+t[w]+d[_]>>>0;b=y,y=m,m=Un(g,30)>>>0,g=v,v=O}n[0]=n[0]+v>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var Fn=Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,o=t||new Array(16),a=(e=e||{}).node||bn,i=void 0!==e.clockseq?e.clockseq:_n;if(null==a||null==i){var u=e.random||(e.rng||gn)();null==a&&(a=bn=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==i&&(i=_n=16383&(u[6]<<8|u[7]))}var s=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:Sn+1,l=s-Tn+(c-Sn)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||s>Tn)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Tn=s,Sn=c,_n=i;var f=(1e4*(268435455&(s+=122192928e5))+c)%4294967296;o[r++]=f>>>24&255,o[r++]=f>>>16&255,o[r++]=f>>>8&255,o[r++]=255&f;var d=s/4294967296*1e4&268435455;o[r++]=d>>>8&255,o[r++]=255&d,o[r++]=d>>>24&15|16,o[r++]=d>>>16&255,o[r++]=i>>>8|128,o[r++]=255&i;for(var h=0;h<6;++h)o[r+h]=a[h];return t||Pn(o)},v3:Mn,v4:function(e,t,n){var r=(e=e||{}).random||(e.rng||gn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Pn(r)},v5:qn,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!yn(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:yn,stringify:Pn,parse:In}),Ln=n(Fn),Hn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0,t.generateSearchId=function(){return(0,Ln.v4)()}})),zn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.augmentHotelWithRegularPriceRange=void 0,t.augmentHotelWithRegularPriceRange=function(e,t,n){var r;if(void 0===(null===(r=e.pricing)||void 0===r?void 0:r.medianRateBkt)||void 0===n)return e;var o=e.pricing.medianRateBkt*n*t,a=(e.pricing.medianRateBkt+1)*n*t;return Ye.__assign(Ye.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(a)]})}})),Wn=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,n){var r,o=n[0],a=n[1];return Ye.__assign(Ye.__assign({},t),((r={})[o]=a===new Object(a)?e(a):a,r))}),{})}})),Bn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSortingBoost=void 0,t.generateSortingBoost=function(e){var t;return(null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.freeCancellation)?"freeCancellation=true:100":void 0}})),Yn=t((function(e,t){function n(e,t,n,r){return!(void 0!==n&&e.nightlyRate<n)&&!(void 0!==r&&r<t&&e.nightlyRate>r)}function r(e,t){var r,o=e.filters,a=void 0===o?{}:o,i=e.priceBucketWidth,u=e.priceBucketsCount,s=e.exchangeRate;if(void 0===i)return t;var c=a.priceMin,l=a.priceMax,f=u*Math.round(i*s);if((void 0!==c||void 0!==l)&&!(null===(r=t.offers)||void 0===r?void 0:r.some((function(e){return n(e,f,c,l)}))))return Ye.__assign(Ye.__assign({},t),{offers:[]});return t}function o(e,t){var n=t.sortField,r=t.sortOrder;return"price"===n?function(e,t){return e.sort((function(e,n){var r,o,a=(null!==(r=(0,v.getCheapestRate)(e))&&void 0!==r?r:0)-(null!==(o=(0,v.getCheapestRate)(n))&&void 0!==o?o:0);return"ascending"===t?a:-a}))}(e,void 0===r?"ascending":r):e}Object.defineProperty(t,"__esModule",{value:!0}),t.buildOffersResponse=t.applyPriceFilter=t.isOfferInPriceRange=void 0,t.isOfferInPriceRange=n,t.applyPriceFilter=r,t.buildOffersResponse=function(e,t){var n,a=e.hotelOfferEntities,i=e.anchorHotelOfferEntity;a&&(n=a.map((function(e){return r(t,e)})),void 0!==t.sortField&&(n=o(n,t)));var u=[],s={};return null==n||n.forEach((function(e){u.push(e.id),s[e.id]=e})),void 0!==i&&(s[i.id]=i),{hotelIds:u,hotelOfferEntities:s}}})),Gn=t((function(e,t){function n(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function r(e,t){for(var r=0,o=t;r<o.length;r++){var a=o[r];if(n(null==e?void 0:e[a]))return e[a]}return""}function o(e,t,o){void 0===o&&(o=", ");for(var a={},i=0,u=t;i<u.length;i++){var s=u[i],c=(null==e?void 0:e[s])||[];a[s]=c.map((function(r,o){if(n(r))return r;var a=t.find((function(t){var r;return n(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[o])}));return a?e[a][o]:""})).join("".concat(o))}return r(a,t)}function a(e,t,o){for(var a={},i=0,u=t;i<u.length;i++){var s=u[i],c=e[s]||[],l=-1===o?void 0:o+1,f=c.slice(o,l).toString();if(n(f))a[s]=f;else{var d=t.find((function(t){var r;return n(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[o])}));a[s]=d?e[d][o]:""}}return r(a,t)}function i(e,t){for(var o,a={},i=0,u=t;i<u.length;i++){var s=u[i],c=null===(o=e[s])||void 0===o?void 0:o.value;if(n(c))a[s]=c;else{var l=t.find((function(t){var r;return n(null===(r=e[t])||void 0===r?void 0:r.value)}));a[s]=l?e[l].value:""}}return r(a,t)}function u(e,t,n){var r,o=e[t];if(!o){var a=n.indexOf(t),i=null!==(r=n.slice(a).find((function(t){return e[t]})))&&void 0!==r?r:"en";o=e[i]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function s(e,t,n){if(void 0===e)return t;try{for(var r in t)if(void 0===e[r])throw new TypeError("Hotel ".concat(e.objectID," is missing ").concat(r," field"))}catch(e){n||console.error(e)}return Ye.__assign(Ye.__assign({},t),e)}function c(e){if(void 0===e)return"property";switch(e){case 0:return"country";case 23:return"city";case 64:case 1010:return"airport";case 199:case 232:case 251:case 1024:return"station";default:return"area"}}Object.defineProperty(t,"__esModule",{value:!0}),t.hitToPlaceSuggest=t.hitToHotelSuggest=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=void 0,t.isNotEmptyOrWhiteSpace=n,t.getTranslatedAttributes=function(e,t){for(var n=[],r=function(e){var r=t.map((function(t){return"".concat(t,".").concat(e)}));n.push.apply(n,r)},o=0,a=e;o<a.length;o++){r(a[o])}return n},t.toString=r,t.translatedArrayToString=o,t.getStringFromTranslatedArray=a,t.getValueFromTranslatedHightlightResult=i,t.attributeWithFallback=u,t.mergeTranslatedAttributes=function(e,t,n){for(var r={},a=0,i=n;a<i.length;a++){var s=i[a];r[s]=Ye.__spreadArray(Ye.__spreadArray([],u(e,s,n),!0),u(t,s,n),!0)}return o(r,n)},t.validateHit=s,t.placeTypeToPlaceTypeName=c,t.hitToHotelSuggest=function(e,t){var o=s(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),u=a(o.placeADN,t,-1),l=a(o.placeDN,t,1),f=n(l)?"".concat(l,", ").concat(u):u,d=i(o._highlightResult.hotelName,t);return{objectID:o.objectID.replace("".concat(o.objectType,":"),""),objectType:o.objectType,value:r(o.hotelName,t),highlightValue:d,placeDisplayName:f,placeTypeName:c()}},t.hitToPlaceSuggest=function(e,t){var o=s(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),u=a(o.placeADN,t,-1),l=a(o.placeDN,t,1),f=n(l)?"".concat(l,", ").concat(u):u,d=i(o._highlightResult.placeName,t);return{objectID:o.objectID.replace("".concat(o.objectType,":"),""),objectType:o.objectType,value:r(o.placeName,t),highlightValue:d,placeDisplayName:f,placeTypeName:c(o.placeType)}}})),Jn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Ye.__exportStar(v,t),Ye.__exportStar(g,t),Ye.__exportStar(Xe,t),Ye.__exportStar($e,t),Ye.__exportStar(Ze,t),Ye.__exportStar(pn,t),Ye.__exportStar(Hn,t),Ye.__exportStar(zn,t),Ye.__exportStar(Wn,t),Ye.__exportStar(Bn,t),Ye.__exportStar(Yn,t),Ye.__exportStar(Gn,t)})),Qn=n(f),Kn=n(p),Vn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.createAnchorRequestString=t.createSearchRequestString=t.prepareSearchParameters=void 0;var n=Ye.__importDefault(Qn),r=Ye.__importDefault(Kn),o=31;function a(e,t){var n,r=(0,Jn.getCheckInCheckOutDates)(e,t),o=r.checkIn,a=r.checkOut;return Ye.__assign(Ye.__assign({},e),{checkIn:o,checkOut:a,rooms:null!==(n=e.rooms)&&void 0!==n?n:"2"})}function i(){if("undefined"==typeof window)return null;var e,t=new r.default(window.location.search).get("sapiOverride");try{t?(window.sessionStorage.setItem("sapiOverride",t),e=t):e=window.sessionStorage.getItem("sapiOverride")}catch(e){}return e}function u(e){var t,n,o,a,u,s,c,l,f,d,h,p,v,g,m,y,b,_,w,O,P=e.profileKey,T=e.searchId,S=e.searchParameters,I=e.options,D=e.offset,j=e.attributes,x=(0,Jn.removeEmpty)({offset:D,searchId:T,profileId:P,query:S.query,hotelId:S.hotelId,placeId:S.hotelId?void 0:S.placeId,checkIn:S.checkIn,checkOut:S.checkOut,rooms:S.rooms,dayDistance:S.dayDistance,nights:S.nights,sortField:S.sortField,sortOrder:S.sortOrder,boundingBox:null===(t=S.boundingBox)||void 0===t?void 0:t.join(","),currency:I.currency,language:I.language,variations:null===(n=I.variations)||void 0===n?void 0:n.join(","),starRating:null===(a=null===(o=S.filters)||void 0===o?void 0:o.starRating)||void 0===a?void 0:a.join(","),guestRating:null===(s=null===(u=S.filters)||void 0===u?void 0:u.guestRating)||void 0===s?void 0:s.join(","),propertyTypeId:null===(l=null===(c=S.filters)||void 0===c?void 0:c.propertyTypeId)||void 0===l?void 0:l.join(","),facilities:null===(d=null===(f=S.filters)||void 0===f?void 0:f.facilities)||void 0===d?void 0:d.join(","),themeIds:null===(p=null===(h=S.filters)||void 0===h?void 0:h.themeIds)||void 0===p?void 0:p.join(","),chainIds:null===(g=null===(v=S.filters)||void 0===v?void 0:v.chainIds)||void 0===g?void 0:g.join(","),noHostels:null===(m=S.filters)||void 0===m?void 0:m.noHostels,priceMin:null===(y=S.filters)||void 0===y?void 0:y.priceMin,priceMax:null===(b=S.filters)||void 0===b?void 0:b.priceMax,hotelName:null===(_=S.filters)||void 0===_?void 0:_.hotelName,freeCancellation:null===(w=S.filters)||void 0===w?void 0:w.freeCancellation,attributes:null==j?void 0:j.join(","),anonymousId:I.anonymousId,cugDeals:null===(O=S.cugDeals)||void 0===O?void 0:O.join(","),deviceType:I.deviceType,originId:S.originId,brand:I.brand,sortingBoost:(0,Jn.generateSortingBoost)(S),preferredRate:S.preferredRate,label:S.trafficSource,countryCode:I.countryCode,sapiOverride:i()});return new r.default(x).toString()}function s(e,t){var r=e.baseUrl,o=e.endpoints;return Ye.__awaiter(this,void 0,void 0,(function(){var e,a,i,s,c,l;return Ye.__generator(this,(function(f){switch(f.label){case 0:return e=u(t),[4,(0,n.default)("https://".concat(r,"/").concat(o.search,"?").concat(e),{credentials:"include"})];case 1:return(a=f.sent()).ok?[2,a.json()]:(i=t.searchParameters,s=t.options,c=t.offset,l=t.attributes,s.logger.log({name:"SearchFailed",value:Ye.__assign(Ye.__assign({},i),{offset:c,attributes:l,language:s.language,currency:s.currency,deviceType:s.deviceType})}),[2,Promise.reject(a)])}}))}))}function c(e){var t,n,o=e.profileKey,a=e.searchId,i=e.searchParameters,u=e.options,s=e.attributes,c=(0,Jn.removeEmpty)({searchId:a,profileId:o,query:i.query,hotelId:i.hotelId,placeId:i.hotelId?void 0:i.placeId,boundingBox:null===(t=i.boundingBox)||void 0===t?void 0:t.join(","),currency:u.currency,language:u.language,variations:null===(n=u.variations)||void 0===n?void 0:n.join(","),attributes:null==s?void 0:s.join(","),anonymousId:u.anonymousId});return new r.default(c).toString()}function l(e,t){var r=e.baseUrl,o=e.endpoints;return Ye.__awaiter(this,void 0,void 0,(function(){var e,a,i,u,s;return Ye.__generator(this,(function(l){switch(l.label){case 0:return e=c(t),[4,(0,n.default)("https://".concat(r,"/").concat(o.anchor,"?").concat(e))];case 1:return(a=l.sent()).ok?[2,a.json()]:(i=t.searchParameters,u=t.options,s=t.attributes,u.logger.log({name:"AnchorSearchFailed",value:Ye.__assign(Ye.__assign({},i),{attributes:s,language:u.language,currency:u.currency,deviceType:u.deviceType})}),[2,Promise.reject(a)])}}))}))}t.prepareSearchParameters=a,t.createSearchRequestString=u,t.createAnchorRequestString=c,t.search=function(e){var t,n=this,r=e.getFeatureEnabled,i=e.profileKey,u=e.appConfig,c=e.offersClient,f=e.options,d=r("offers"),h=!1;return function(e,r){return void 0===r&&(r={}),Ye.__awaiter(n,void 0,void 0,(function(){var n,p,v,g,m,y,b,_,w,O,P,T,S,I=this;return Ye.__generator(this,(function(D){switch(D.label){case 0:return n=(0,Jn.createState)({}),p=r.onStart,v=r.onAnchorReceived,g=r.onHotelsReceived,m=r.onOffersReceived,y=r.onComplete,b=0,_=a(e,u.client),w=(0,Jn.generateSearchId)(),n.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof p&&p(n.current()),O=function(e,r,a){return void 0===e&&(e=0),Ye.__awaiter(I,void 0,void 0,(function(){var a,l,p,b,O,P;return Ye.__generator(this,(function(T){switch(T.label){case 0:return[4,s(u.sapiBackend,{profileKey:i,searchParameters:_,options:f,offset:e,attributes:r,searchId:w})];case 1:return a=T.sent(),h||(t=a.exchangeRates[f.currency],(null===(P=f.callbacks)||void 0===P?void 0:P.onConfigReceived)&&f.callbacks.onConfigReceived({lov:a.lov,exchangeRates:a.exchangeRates}),h=!0),(void 0===r||r.includes("anchor"))&&(n.update((function(e){e.anchor=a.anchor,e.anchorHotelId=a.anchorHotelId,e.anchorType=a.anchorType,e.hotelEntities=a.hotelEntities})),"function"==typeof v&&v(n.current())),n.update((function(e){e.facets=a.facets,e.hotelEntities=a.hotelEntities,e.hotelIds=a.hotelIds,e.hotelsHaveStaticPosition=a.hotelsHaveStaticPosition,e.offset=a.offset,e.resultsCount=a.resultsCount,e.resultsCountTotal=a.resultsCountTotal})),"function"==typeof g&&g(n.current()),d&&void 0!==c?(l=n.get("hotelIds"),p=Ye.__assign(Ye.__assign({},_),{searchId:w,hotelIds:l,anchorHotelId:n.get("anchorHotelId")}),[4,c.getOffers(p,(function(e){var r=(0,Jn.buildOffersResponse)(e,Ye.__assign(Ye.__assign(Ye.__assign(Ye.__assign({},p),n.get("anchor")),f),{priceBucketsCount:o,exchangeRate:t}));n.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=Ye.__assign(Ye.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof m&&m(n.current())}))]):[3,3];case 2:b=T.sent(),O=(0,Jn.buildOffersResponse)(b,Ye.__assign(Ye.__assign(Ye.__assign(Ye.__assign({},p),n.get("anchor")),f),{priceBucketsCount:o,exchangeRate:t})),n.update((function(e){e.hotelIds=O.hotelIds,e.hotelOfferEntities=O.hotelOfferEntities})),n.update((function(e){e.dealScores=(0,Jn.getDealScores)(e)})),T.label=3;case 3:return"function"==typeof y&&y(n.current()),[2,n.current()]}}))}))},P=function(e,r,a){return void 0===e&&(e=0),void 0===a&&(a=!0),Ye.__awaiter(I,void 0,void 0,(function(){var p,b,O=this;return Ye.__generator(this,(function(P){switch(P.label){case 0:return p=function(){return Ye.__awaiter(O,void 0,void 0,(function(){var e,r,a,s;return Ye.__generator(this,(function(p){switch(p.label){case 0:return e=["anchor","anchorHotelId","anchorType","hotelEntities"],h||e.push("lov","exchangeRates"),[4,l(u.sapiBackend,{searchId:w,profileKey:i,searchParameters:_,options:f,attributes:e})];case 1:return r=p.sent(),h||(t=r.exchangeRates[f.currency],(null===(s=f.callbacks)||void 0===s?void 0:s.onConfigReceived)&&f.callbacks.onConfigReceived({lov:r.lov,exchangeRates:r.exchangeRates}),h=!0),n.update((function(e){e.anchor=r.anchor,e.anchorHotelId=r.anchorHotelId,e.anchorType=r.anchorType,e.hotelEntities=Ye.__assign(Ye.__assign({},e.hotelEntities),r.hotelEntities)})),"function"==typeof v&&v(n.current()),d&&void 0!==c&&"hotel"===r.anchorType?(a=Ye.__assign(Ye.__assign({},_),{anchorHotelId:r.anchorHotelId,searchId:w}),[4,c.getOffers(a,(function(e){var r=(0,Jn.buildOffersResponse)(e,Ye.__assign(Ye.__assign(Ye.__assign(Ye.__assign({},a),n.get("anchor")),f),{priceBucketsCount:o,exchangeRate:t}));n.update((function(e){e.hotelOfferEntities=Ye.__assign(Ye.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof m&&m(n.current())}))]):[3,3];case 2:p.sent(),p.label=3;case 3:return[2,n.current()]}}))}))},b=function(){return Ye.__awaiter(O,void 0,void 0,(function(){var r,l,h,p;return Ye.__generator(this,(function(v){switch(v.label){case 0:return[4,s(u.sapiBackend,{searchId:w,profileKey:i,searchParameters:_,options:f,offset:e,attributes:["facets","hotelEntities","hotelIds","hotelsHaveStaticPosition","offset","resultsCount","resultsCountTotal"]})];case 1:return r=v.sent(),n.update((function(e){e.facets=r.facets,e.hotelEntities=a?Ye.__assign(Ye.__assign({},e.hotelEntities),r.hotelEntities):r.hotelEntities,e.hotelIds=r.hotelIds,e.hotelsHaveStaticPosition=r.hotelsHaveStaticPosition,e.offset=r.offset,e.resultsCount=r.resultsCount,e.resultsCountTotal=r.resultsCountTotal})),"function"==typeof g&&g(n.current()),d&&void 0!==c?(l=Ye.__assign(Ye.__assign({},_),{searchId:w,hotelIds:n.get("hotelIds")}),[4,c.getOffers(l,(function(e){var r=(0,Jn.buildOffersResponse)(e,Ye.__assign(Ye.__assign(Ye.__assign(Ye.__assign({},l),n.get("anchor")),f),{priceBucketsCount:o,exchangeRate:t}));n.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=Ye.__assign(Ye.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof m&&m(n.current())}))]):[3,3];case 2:h=v.sent(),p=(0,Jn.buildOffersResponse)(h,Ye.__assign(Ye.__assign(Ye.__assign(Ye.__assign({},l),n.get("anchor")),f),{priceBucketsCount:o,exchangeRate:t})),n.update((function(e){e.hotelIds=p.hotelIds,e.hotelOfferEntities=a?Ye.__assign(Ye.__assign({},e.hotelOfferEntities),p.hotelOfferEntities):p.hotelOfferEntities})),n.update((function(e){e.dealScores=(0,Jn.getDealScores)(e)})),v.label=3;case 3:return[2,n.current()]}}))}))},[4,void 0===r||r.includes("anchor")?Promise.all([p(),b()]):b()];case 1:return P.sent(),"function"==typeof y&&y(n.current()),[2,n.current()]}}))}))},T=(null===(S=f.variations)||void 0===S?void 0:S.includes("sapi4eva2-magic-sort-b"))?P:O,[4,h?T(_.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition"]):T(_.offset)];case 1:return D.sent(),[2,{loadOffers:function(e){return Ye.__awaiter(I,void 0,void 0,(function(){var r,a,i,u,s;return Ye.__generator(this,(function(l){switch(l.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!d||!c)throw new Error("Offers loading is disabled");return r=e===n.get("anchorHotelId"),a=Ye.__assign(Ye.__assign({},_),{searchId:w,getAllOffers:!0,hotelIds:r?void 0:[e],anchorHotelId:r?e:void 0}),[4,c.getOffers(a)];case 1:return i=l.sent(),u=(0,Jn.buildOffersResponse)(i,Ye.__assign(Ye.__assign(Ye.__assign(Ye.__assign({},a),n.get("anchor")),f),{priceBucketsCount:o,exchangeRate:t})),[2,null===(s=u.hotelOfferEntities)||void 0===s?void 0:s[e]]}}))}))},loadMore:function(){return Ye.__awaiter(I,void 0,void 0,(function(){var e;return Ye.__generator(this,(function(t){return b+=(null===(e=f.variations)||void 0===e?void 0:e.includes("sapi4eva2-magic-sort-b"))?f.pageSize:function(e,t,n,r){var o,a,i=r.pageSize;return void 0!==e.pageSize&&e.pageSize>=i&&void 0===(null===(o=n.filters)||void 0===o?void 0:o.priceMin)&&void 0===(null===(a=n.filters)||void 0===a?void 0:a.priceMax)&&"price"!==n.sortField?e.pageSize:"hotel"===t?45:65}(n.get("anchor"),n.get("anchorType"),_,f),[2,T(b,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"],!1)]}))}))}}]}}))}))}}})),Xn=t((function(e,t){e.exports=function(){function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}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 n=[],r=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw a}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(r().getItem(n)||"{}")};return{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var n=JSON.stringify(e),r=a()[n];return Promise.all([r||t(),void 0!==r])})).then((function(e){var t=o(e,2),r=t[0],a=t[1];return Promise.all([r,a||n.miss(r)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]=t,r().setItem(n,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function u(e){var t=a(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.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,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return u({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return u({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return u({caches:t}).delete(e)}))},clear:function(){return n.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(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=r(),u=o&&o.miss||function(){return Promise.resolve()};return i.then((function(e){return u(e)})).then((function(){return i}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return e===v.WithinHeaders?r:{}},queryParameters:function(){return e===v.WithinQueryParameters?r:{}}}}function l(e){var t=0;return e((function n(){return t++,new Promise((function(r){setTimeout((function(){r(e(n))}),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(n){return f(e.then((function(e){return Promise.all([t(e,n),e])})).then((function(e){return e[1]})))}})}function d(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function h(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function p(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(n[o++])}))}var v={WithinQueryParameters:0,WithinHeaders:1};function g(e,t){var n=e||{},r=n.data||{};return Object.keys(n).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])})),{data:Object.entries(r).length>0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var m={Read:1,Write:2,Any:3},y=1,b=2,_=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y;return n(n({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:m.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||m.Any}}var P="DELETE",T="GET",S="POST",I="PUT";function D(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return e.status===y||Date.now()-e.lastUpdate>12e4}(e)})),r=e.filter((function(e){return function(e){return e.status===_&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(n),a(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return O(e)})):t}}))}function j(e,t,r,o){var i=[],u=function(e,t){if(e.method!==T&&(void 0!==e.data||void 0!==t.data)){var r=Array.isArray(e.data)?e.data:n(n({},e.data),t.data);return JSON.stringify(r)}}(r,o),s=function(e,t){var r=n(n({},e.headers),t.headers),o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e.toLowerCase()]=t})),o}(e,o),c=r.method,l=r.method!==T?{}:n(n({},r.data),o.data),f=n(n(n({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),d=0,h=function t(n,a){var l=n.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:R(i)};var h={data:u,headers:s,method:c,url:C(l,r.path,f),connectTimeout:a(d,e.timeouts.connect),responseTimeout:a(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:n.length};return i.push(t),t},v={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(r){var o=p(r);return r.isTimedOut&&d++,Promise.all([e.logger.info("Retryable failure",N(o)),e.hostsCache.set(l,w(l,r.isTimedOut?_:b))]).then((function(){return t(n,a)}))},onFail:function(e){throw p(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(o,r,t)}(e,R(i))}};return e.requester.send(h).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,v)}))};return D(e.hostsCache,t).then((function(e){return h(a(e.statelessHosts).reverse(),e.getTimeout)}))}function x(e){var t=e.hostsCache,n=e.logger,r=e.requester,a=e.requestsCache,i=e.responsesCache,u=e.timeouts,s=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:n,requester:r,requestsCache:a,responsesCache:i,timeouts:u,userAgent:s,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var n=g(t,f.timeouts.read),r=function(){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&m.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var a={request:e,mappedRequestOptions:n,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,r()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return j(f,f.hosts.filter((function(e){return 0!=(e.accept&m.Write)})),e,g(t,f.timeouts.write))}};return f}function k(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function C(e,t,n){var r=E(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function E(e){return Object.keys(e).map((function(t){return p("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function R(e){return e.map((function(e){return N(e)}))}function N(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return n(n({},e),{},{request:n(n({},e.request),{},{headers:n(n({},e.request.headers),t)})})}var M=function(e){return function(t,n){return e.transporter.write({method:S,path:"2/abtests",data:t},n)}},A=function(e){return function(t,n){return e.transporter.write({method:P,path:p("2/abtests/%s",t)},n)}},U=function(e){return function(t,n){return e.transporter.read({method:T,path:p("2/abtests/%s",t)},n)}},q=function(e){return function(t){return e.transporter.read({method:T,path:"2/abtests"},t)}},F=function(e){return function(t,n){return e.transporter.write({method:S,path:p("2/abtests/%s/stop",t)},n)}},L=function(e){return function(t){return e.transporter.read({method:T,path:"1/strategies/personalization"},t)}},H=function(e){return function(t,n){return e.transporter.write({method:S,path:"1/strategies/personalization",data:t},n)}};function z(e){return function t(n){return e.request(n).then((function(r){if(void 0!==e.batch&&e.batch(r.hits),!e.shouldStop(r))return r.cursor?t({cursor:r.cursor}):t({page:(n.page||0)+1})}))}({})}var W=function(e){return function(t,o){var a=o||{},i=a.queryParameters,u=r(a,["queryParameters"]),s=n({acl:t},void 0!==i?{queryParameters:i}:{});return f(e.transporter.write({method:S,path:"1/keys",data:s},u),(function(t,n){return l((function(r){return X(e)(t.key,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},B=function(e){return function(t,n,r){var o=g(r);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:S,path:"1/clusters/mapping",data:{cluster:n}},o)}},Y=function(e){return function(t,n,r){return e.transporter.write({method:S,path:"1/clusters/mapping/batch",data:{users:t,cluster:n}},r)}},G=function(e){return function(t,n,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:n}},r),(function(n,r){return ne(e)(t,{methods:{waitTask:tt}}).waitTask(n.taskID,r)}))}},J=function(e){return function(t,r,o){return G(e)(t,r,n(n({},o),{},{scope:[rt.Rules]}))}},Q=function(e){return function(t,r,o){return G(e)(t,r,n(n({},o),{},{scope:[rt.Settings]}))}},K=function(e){return function(t,r,o){return G(e)(t,r,n(n({},o),{},{scope:[rt.Synonyms]}))}},V=function(e){return function(t,n){return f(e.transporter.write({method:P,path:p("1/keys/%s",t)},n),(function(n,r){return l((function(n){return X(e)(t,r).then(n).catch((function(e){if(404!==e.status)throw e}))}))}))}},X=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/keys/%s",t)},n)}},$=function(e){return function(t){return e.transporter.read({method:T,path:"1/logs"},t)}},Z=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters/mapping/top"},t)}},ee=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/clusters/mapping/%s",t)},n)}},te=function(e){return function(t){var n=t||{},o=n.retrieveMappings,a=r(n,["retrieveMappings"]);return!0===o&&(a.getClusters=!0),e.transporter.read({method:T,path:"1/clusters/mapping/pending"},a)}},ne=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},n.methods)}},re=function(e){return function(t){return e.transporter.read({method:T,path:"1/keys"},t)}},oe=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters"},t)}},ae=function(e){return function(t){return e.transporter.read({method:T,path:"1/indexes"},t)}},ie=function(e){return function(t){return e.transporter.read({method:T,path:"1/clusters/mapping"},t)}},ue=function(e){return function(t,n,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:n}},r),(function(n,r){return ne(e)(t,{methods:{waitTask:tt}}).waitTask(n.taskID,r)}))}},se=function(e){return function(t,n){return f(e.transporter.write({method:S,path:"1/indexes/*/batch",data:{requests:t}},n),(function(t,n){return Promise.all(Object.keys(t.taskID).map((function(r){return ne(e)(r,{methods:{waitTask:tt}}).waitTask(t.taskID[r],n)})))}))}},ce=function(e){return function(t,n){return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:t}},n)}},le=function(e){return function(t,r){var o=t.map((function(e){return n(n({},e),{},{params:E(e.params||{})})}));return e.transporter.read({method:S,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},r)}},fe=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,i=a.facetName,u=a.facetQuery,s=r(a,["facetName","facetQuery"]);return ne(e)(t.indexName,{methods:{searchForFacetValues:Xe}}).searchForFacetValues(i,u,n(n({},o),s))})))}},de=function(e){return function(t,n){var r=g(n);return r.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:P,path:"1/clusters/mapping"},r)}},he=function(e){return function(t,n){return f(e.transporter.write({method:S,path:p("1/keys/%s/restore",t)},n),(function(n,r){return l((function(n){return X(e)(t,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},pe=function(e){return function(t,n){return e.transporter.read({method:S,path:"1/clusters/mapping/search",data:{query:t}},n)}},ve=function(e){return function(t,n){var o=Object.assign({},n),a=n||{},i=a.queryParameters,u=r(a,["queryParameters"]),s=i?{queryParameters:i}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:I,path:p("1/keys/%s",t),data:s},u),(function(n,r){return l((function(n){return X(e)(t,r).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():n()}))}))}))}},ge=function(e){return function(t,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},n),(function(t,n){return tt(e)(t.taskID,n)}))}},me=function(e){return function(t){return z(n(n({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(n){return e.transporter.read({method:S,path:p("1/indexes/%s/browse",e.indexName),data:n},t)}}))}},ye=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return z(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return $e(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},be=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return z(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return Ze(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},_e=function(e){return function(t,n,o){var a=o||{},i=a.batchSize,u=r(a,["batchSize"]),s={taskIDs:[],objectIDs:[]};return f(function r(){var o,a=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(a.push(t[o]),a.length!==(i||1e3));o++);return 0===a.length?Promise.resolve(s):ge(e)(a.map((function(e){return{action:n,body:e}})),u).then((function(e){return s.objectIDs=s.objectIDs.concat(e.objectIDs),s.taskIDs.push(e.taskID),o++,r(o)}))}(),(function(t,n){return Promise.all(t.taskIDs.map((function(t){return tt(e)(t,n)})))}))}},we=function(e){return function(t){return f(e.transporter.write({method:S,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,n){return tt(e)(t.taskID,n)}))}},Oe=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,a=g(r(n,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/clear",e.indexName)},a),(function(t,n){return tt(e)(t.taskID,n)}))}},Pe=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,a=g(r(n,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/clear",e.indexName)},a),(function(t,n){return tt(e)(t.taskID,n)}))}},Te=function(e){return function(t,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},n),(function(t,n){return tt(e)(t.taskID,n)}))}},Se=function(e){return function(t){return f(e.transporter.write({method:P,path:p("1/indexes/%s",e.indexName)},t),(function(t,n){return tt(e)(t.taskID,n)}))}},Ie=function(e){return function(t,n){return f(De(e)([t],n).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},De=function(e){return function(t,n){var r=t.map((function(e){return{objectID:e}}));return _e(e)(r,nt.DeleteObject,n)}},je=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=g(r(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:P,path:p("1/indexes/%s/rules/%s",e.indexName,t)},i),(function(t,n){return tt(e)(t.taskID,n)}))}},xe=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=g(r(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:P,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},i),(function(t,n){return tt(e)(t.taskID,n)}))}},ke=function(e){return function(t){return Ue(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Ce=function(e){return function(t,n,r){return e.transporter.read({method:S,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},Ee=function(e){return function(t,a){var i=a||{},u=i.query,s=i.paginate,c=r(i,["query","paginate"]),l=0;return function r(){return Ve(e)(u||"",n(n({},c),{},{page:l})).then((function(e){for(var n=0,a=Object.entries(e.hits);n<a.length;n++){var i=o(a[n],2),u=i[0],c=i[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 r()}))}()}},Re=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/indexes/%s/%s",e.indexName,t)},n)}},Ne=function(){return function(e,t){for(var n=0,r=Object.entries(e.hits);n<r.length;n++){var a=o(r[n],2),i=a[0];if(a[1].objectID===t)return parseInt(i,10)}return-1}},Me=function(e){return function(t,o){var a=o||{},i=a.attributesToRetrieve,u=r(a,["attributesToRetrieve"]),s=t.map((function(t){return n({indexName:e.indexName,objectID:t},i?{attributesToRetrieve:i}:{})}));return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:s}},u)}},Ae=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},n)}},Ue=function(e){return function(t){return e.transporter.read({method:T,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},qe=function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},n)}},Fe=function(e){return function(t,n){return f(Le(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},Le=function(e){return function(t,n){var o=n||{},a=o.createIfNotExists,i=r(o,["createIfNotExists"]),u=a?nt.PartialUpdateObject:nt.PartialUpdateObjectNoCreate;return _e(e)(t,u,i)}},He=function(e){return function(t,i){var u=i||{},s=u.safe,c=u.autoGenerateObjectIDIfNotExist,l=u.batchSize,d=r(u,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,n,r,o){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:r,destination:n}},o),(function(t,n){return tt(e)(t.taskID,n)}))},v=Math.random().toString(36).substring(7),g="".concat(e.indexName,"_tmp_").concat(v),m=Ye({appId:e.appId,transporter:e.transporter,indexName:g}),y=[],b=h(e.indexName,g,"copy",n(n({},d),{},{scope:["settings","synonyms","rules"]}));return y.push(b),f((s?b.wait(d):b).then((function(){var e=m(t,n(n({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return y.push(e),s?e.wait(d):e})).then((function(){var t=h(g,e.indexName,"move",d);return y.push(t),s?t.wait(d):t})).then((function(){return Promise.all(y)})).then((function(e){var t=o(e,3),n=t[0],r=t[1],i=t[2];return{objectIDs:r.objectIDs,taskIDs:[n.taskID].concat(a(r.taskIDs),[i.taskID])}})),(function(e,t){return Promise.all(y.map((function(e){return e.wait(t)})))}))}},ze=function(e){return function(t,r){return Je(e)(t,n(n({},r),{},{clearExistingRules:!0}))}},We=function(e){return function(t,r){return Ke(e)(t,n(n({},r),{},{clearExistingSynonyms:!0}))}},Be=function(e){return function(t,n){return f(Ye(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return tt(e)(t.taskID,n)}))}},Ye=function(e){return function(t,n){var o=n||{},a=o.autoGenerateObjectIDIfNotExist,i=r(o,["autoGenerateObjectIDIfNotExist"]),u=a?nt.AddObject:nt.UpdateObject;if(u===nt.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,i)}},Ge=function(e){return function(t,n){return Je(e)([t],n)}},Je=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=o.clearExistingRules,u=g(r(o,["forwardToReplicas","clearExistingRules"]));return a&&(u.queryParameters.forwardToReplicas=1),i&&(u.queryParameters.clearExistingRules=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},u),(function(t,n){return tt(e)(t.taskID,n)}))}},Qe=function(e){return function(t,n){return Ke(e)([t],n)}},Ke=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=o.clearExistingSynonyms,u=o.replaceExistingSynonyms,s=g(r(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return a&&(s.queryParameters.forwardToReplicas=1),(u||i)&&(s.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(function(t,n){return tt(e)(t.taskID,n)}))}},Ve=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},Xe=function(e){return function(t,n,r){return e.transporter.read({method:S,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},$e=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},n)}},Ze=function(e){return function(t,n){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},n)}},et=function(e){return function(t,n){var o=n||{},a=o.forwardToReplicas,i=g(r(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:I,path:p("1/indexes/%s/settings",e.indexName),data:t},i),(function(t,n){return tt(e)(t.taskID,n)}))}},tt=function(e){return function(t,n){return l((function(r){return function(e){return function(t,n){return e.transporter.read({method:T,path:p("1/indexes/%s/task/%s",e.indexName,t.toString())},n)}}(e)(t,n).then((function(e){return"published"!==e.status?r():void 0}))}))}},nt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},rt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},ot=1,at=2,it=3;function ut(e,t,r){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(a),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(a),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(a),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},logger:(o=it,{debug:function(e,t){return ot>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return at>=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:[i({key:"".concat("4.8.0","-").concat(e)}),s()]}),userAgent:k("4.8.0").add({segment:"Browser"})};return function(e){var t=e.appId,r=c(void 0!==e.authMode?e.authMode:v.WithinHeaders,t,e.apiKey),o=x(n(n({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:m.Read},{url:"".concat(t,".algolia.net"),accept:m.Write}].concat(d([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:n(n({},r.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)}(n(n(n({},a),r),{},{methods:{search:le,searchForFacetValues:fe,multipleBatch:se,multipleGetObjects:ce,multipleQueries:le,copyIndex:G,copySettings:Q,copySynonyms:K,copyRules:J,moveIndex:ue,listIndices:ae,getLogs:$,listClusters:oe,multipleSearchForFacetValues:fe,getApiKey:X,addApiKey:W,listApiKeys:re,updateApiKey:ve,deleteApiKey:V,restoreApiKey:he,assignUserID:B,assignUserIDs:Y,getUserID:ee,searchUserIDs:pe,listUserIDs:ie,getTopUserIDs:Z,removeUserID:de,hasPendingMappings:te,initIndex:function(e){return function(t){return ne(e)(t,{methods:{batch:ge,delete:Se,findAnswers:Ce,getObject:Re,getObjects:Me,saveObject:Be,saveObjects:Ye,search:Ve,searchForFacetValues:Xe,waitTask:tt,setSettings:et,getSettings:Ue,partialUpdateObject:Fe,partialUpdateObjects:Le,deleteObject:Ie,deleteObjects:De,deleteBy:Te,clearObjects:we,browseObjects:me,getObjectPosition:Ne,findObject:Ee,exists:ke,saveSynonym:Qe,saveSynonyms:Ke,getSynonym:qe,searchSynonyms:Ze,browseSynonyms:be,deleteSynonym:xe,clearSynonyms:Pe,replaceAllObjects:He,replaceAllSynonyms:We,searchRules:$e,getRule:Ae,deleteRule:je,saveRule:Ge,saveRules:Je,replaceAllRules:ze,browseRules:ye,clearRules:Oe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",r=c(v.WithinHeaders,e.appId,e.apiKey),o=x(n(n({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(n(n(n({},a),e),{},{methods:{addABTest:M,getABTest:U,getABTests:q,stopABTest:F,deleteABTest:A}}))}},initRecommendation:function(){return function(e){return function(e){var t=e.region||"us",r=c(v.WithinHeaders,e.appId,e.apiKey),o=x(n(n({hosts:[{url:"recommendation.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(n(n(n({},a),e),{},{methods:{getPersonalizationStrategy:L,setPersonalizationStrategy:H}}))}}}}))}return ut.version="4.8.0",ut}()})),$n=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0;var n=Ye.__importDefault(Xn);function r(e){return(0,Jn.getTranslatedAttributes)(e,["placeName","hotelName"])}function o(e){var t=(0,Jn.getTranslatedAttributes)(e,["placeName","placeADN","placeDN","hotelName"]);return Ye.__spreadArray(["objectType","objectID","placeType"],t,!0)}function a(e,t,n){var a=this,i=e.search,u=t.autocompleteIndex,s=n.languages,c=n.suggestsCount,l=void 0===c?6:c;return function(e){return Ye.__awaiter(a,void 0,void 0,(function(){var t,n,a;return Ye.__generator(this,(function(c){switch(c.label){case 0:return t=[{indexName:u,params:{query:e,filters:"isDeleted != 1",hitsPerPage:l,attributesToRetrieve:o(s),attributesToHighlight:r(s)}}],[4,i(t)];case 1:return n=c.sent().results,[2,null===(a=n[0])||void 0===a?void 0:a.hits.map((function(e){return"hotel"===e.objectType?(0,Jn.hitToHotelSuggest)(e,s):(0,Jn.hitToPlaceSuggest)(e,s)}))]}}))}))}}t.suggest=function(e){var t=this,r=e.appConfig,o=e.options,i=o.languages,u=o.algoliaClientOptions,s=(0,n.default)(r.algolia.appId,r.algolia.apiKey,u);return function(e,n){return Ye.__awaiter(t,void 0,void 0,(function(){return Ye.__generator(this,(function(t){switch(t.label){case 0:return[4,a(s,r.algolia,{suggestsCount:n,languages:i})(e)];case 1:return[2,t.sent()]}}))}))}}})),Zn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var n=Ye.__importDefault(Qn),r=Ye.__importDefault(Kn);function o(e,t){var n,o=e.hotelId,a=e.checkIn,i=e.checkOut,u=e.rooms,s=e.providerCode,c=e.cugDeals,l=e.clickedOfferId,f=(0,Jn.removeEmpty)({hotelId:o,checkIn:a,checkOut:i,rooms:u,providerCode:s,cugDeals:c,clickedOfferId:l,deviceType:t.deviceType,language:t.language,currency:t.currency,aid:t.anonymousId,variations:null===(n=t.variations)||void 0===n?void 0:n.join(",")});return new r.default(f).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,r=e.appConfig,a=e.options;return function(e){return Ye.__awaiter(t,void 0,void 0,(function(){var t,i,u;return Ye.__generator(this,(function(s){switch(s.label){case 0:return t=o(e,a),[4,(0,n.default)("https://".concat(r.saf.baseUrl,"/").concat(r.saf.endpoints.offersRooms,"?").concat(t))];case 1:return(i=s.sent()).ok?[4,i.json()]:[3,3];case 2:return u=s.sent(),[2,Ye.__assign({hotelId:e.hotelId,anonymousId:a.anonymousId},u)];case 3:return[2,Promise.reject(i)]}}))}))}}})),er=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hotel=t.createRequestString=t.safToSapiHotel=void 0;var n=Ye.__importDefault(Qn),r=Ye.__importDefault(Kn);function o(e,t){var n=e.checkInInst,r=e.checkInSpInst,o=e.feesMnd,a=e.feesOpt,i=e.policies,u=e.hotelName,s=e.placeDN,c=e.address,l=e.placeADName,f=e.propertyType,d=e.facilities,h=e.sentiments,p=e.themes,v=Ye.__assign(Ye.__assign({},e),{checkInInst:n&&(0,Jn.toString)(n,t),checkInSpInst:r&&(0,Jn.toString)(r,t),feesMnd:o&&(0,Jn.toString)(o,t),feesOpt:a&&(0,Jn.toString)(a,t),hotelName:(0,Jn.toString)(u,t),policies:i&&(0,Jn.toString)(i,t),placeDisplayName:s&&(0,Jn.translatedArrayToString)(s,t),displayAddress:c&&l&&(0,Jn.mergeTranslatedAttributes)(c,l,t),facilities:null==d?void 0:d.map((function(e){return Ye.__assign(Ye.__assign({},e),{value:(0,Jn.toString)(e.value,t)})})),sentiments:null==h?void 0:h.map((function(e){return Ye.__assign(Ye.__assign({},e),{value:(0,Jn.toString)(e.value,t)})})),themes:null==p?void 0:p.map((function(e){return Ye.__assign(Ye.__assign({},e),{value:(0,Jn.toString)(e.value,t)})})),propertyType:f&&Ye.__assign(Ye.__assign({},f),{value:(0,Jn.toString)(f.value,t)})});return(0,Jn.omit)(["placeDN","placeADName","address"],v)}function a(e,t){var n=(0,Jn.removeEmpty)({id:e,language:t.join(","),attributes:["objectID","address","country","guestRating","isDeleted","starRating","_geoloc","placeADName","checkInSpInst","checkInMinAge","checkOutTime","checkInInst","checkInTime","checkInEnd","feesOpt","policies","phone","imageURIs","placeDN","reviewCount","chainID","parentChainID","lastBooked","feesMnd","reviewCountBkt","hotelName","sentiments","facilities","placeID","guestType","themes","propertyType","pricing","currency"].join(",")});return new r.default(n).toString()}t.safToSapiHotel=o,t.createRequestString=a,t.hotel=function(e){var t=this,r=e.appConfig,i=e.options;return function(e){return Ye.__awaiter(t,void 0,void 0,(function(){var t,u;return Ye.__generator(this,(function(s){switch(s.label){case 0:return t=a(e,i.languages),[4,(0,n.default)("https://".concat(r.saf.baseUrl,"/").concat(r.saf.endpoints.hotel,"?").concat(t))];case 1:return(u=s.sent()).ok?[4,u.json()]:[3,3];case 2:return[2,o(s.sent(),i.languages)];case 3:return[2,Promise.reject(u)]}}))}))}}})),tr=t((function(e,t){function n(e,t,n){var r=e.hotelId,o=e.isAnchor,a=e.freeCancellation,i=e.rooms,u=void 0===i?n.client.defaultRooms:i,s=Ye.__rest(e,["hotelId","isAnchor","freeCancellation","rooms"]),c=(0,Jn.getCheckInCheckOutDates)(e,n.client),l=c.checkIn,f=c.checkOut,d=Ye.__assign(Ye.__assign({},s),{checkIn:l,checkOut:f,rooms:u});return a&&(d.filters={freeCancellation:!0}),e.searchId||(d.searchId=(0,Jn.generateSearchId)()),o?d.anchorHotelId=r:d.hotelIds=[r],d}Object.defineProperty(t,"__esModule",{value:!0}),t.offers=t.getOffersParameters=void 0,t.getOffersParameters=n,t.offers=function(e){var t=this,r=e.offersClient,o=(e.options,e.appConfig);return function(e,a){return void 0===a&&(a={}),Ye.__awaiter(t,void 0,void 0,(function(){var t,i,u,s,c,l,f,d;return Ye.__generator(this,(function(h){switch(h.label){case 0:return r?(t=e.isAnchor,i=a.onStart,u=a.onOffersReceived,s=a.onComplete,c=n(e,0,o),"function"==typeof i&&i(c),[4,r.getOffers(c,(function(e){var n;"function"==typeof u&&u(t?e.anchorHotelOfferEntity:null===(n=e.hotelOfferEntities)||void 0===n?void 0:n[0])}))]):[2];case 1:return l=h.sent(),"function"==typeof s&&s(t?l.anchorHotelOfferEntity:null===(f=l.hotelOfferEntities)||void 0===f?void 0:f[0]),[2,t?l.anchorHotelOfferEntity:null===(d=l.hotelOfferEntities)||void 0===d?void 0:d[0]]}}))}))}}})),nr=function(e,t){return nr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},nr(e,t)};function rr(e,t){function n(){this.constructor=e}nr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function or(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function ar(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(or(arguments[t]));return e}var ir=function(e,t){this.target=t,this.type=e},ur=function(e){function t(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return rr(t,e),t}(ir),sr=function(e){function t(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return rr(t,e),t}(ir),cr=function(){if("undefined"!=typeof WebSocket)return WebSocket},lr={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},fr=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),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){r._debug("open event");var t=r._options.minUptime,n=void 0===t?lr.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout((function(){return r._acceptOpen()}),n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach((function(e){return r._ws.send(e)})),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach((function(t){return r._callEventListener(e,t)}))},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach((function(t){return r._callEventListener(e,t)}))},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach((function(t){return r._callEventListener(e,t)})),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach((function(t){return r._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=n,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,n=void 0===t?lr.maxEnqueuedMessages:t;this._messageQueue.length<n&&(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,n,r=this._listeners[e.type];if(r)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),a=o.next();!a.done;a=o.next()){var i=a.value;this._callEventListener(e,i)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.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,ar(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?lr.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?lr.minReconnectionDelay:r,a=e.maxReconnectionDelay,i=void 0===a?lr.maxReconnectionDelay:a,u=0;return this._retryCount>0&&(u=o*Math.pow(n,this._retryCount-1))>i&&(u=i),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,n=t.maxRetries,r=void 0===n?lr.maxRetries:n,o=t.connectionTimeout,a=void 0===o?lr.connectionTimeout:o,i=t.WebSocket,u=void 0===i?cr():i;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);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()}),a))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new ur(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 sr(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}(),dr=Object.freeze({__proto__:null,default:fr});function hr(e){m(1,arguments);var t=y(e);return t.setHours(0,0,0,0),t}var pr=864e5;function vr(e,t){m(2,arguments);var n=hr(e),r=hr(t),o=n.getTime()-de(n),a=r.getTime()-de(r);return Math.round((o-a)/pr)}function gr(e,t){var n=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 n<0?-1:n>0?1:n}var mr=Object.freeze({__proto__:null,default:function(e,t){m(2,arguments);var n=y(e),r=y(t),o=gr(n,r),a=Math.abs(vr(n,r));n.setDate(n.getDate()-o*a);var i=gr(n,r)===-o,u=o*(a-i);return 0===u?0:u}}),yr=n(dr),br=n(mr),_r=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.offersClient=t.sapiResponseToHotelOfferEntity=t.hasAnchorPrice=void 0;var n,r=Ye.__importDefault(yr),o=Ye.__importDefault(br);function a(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.baseRate;return t&&(r+=e.taxes),n&&(r+=e.localTaxes),r}function i(e,t,n){var r=(0,o.default)((0,Jn.dateToMiddayUTC)(n),(0,Jn.dateToMiddayUTC)(t));if(r<1)throw new Error("checkOut cannot be the same or less than checkIn");return 1===r?e:e/r}!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(n||(n={}));function u(e,t){return t-e>.03*t}function s(e,t){var n,r={baseRate:e.anchorRate.base,localTaxes:e.anchorRate.hotelFees,taxes:e.anchorRate.taxes},o=a(r,t.includeTaxes,t.includeLocalTaxes),s=i(o,t.checkIn,t.checkOut);return{anchorPriceRateBreakdown:Ye.__assign(Ye.__assign({},r),{calculatedTotalRate:o,nightlyRate:s}),availableOffersCount:e.availableOffersCount,fetchedAllOffers:e.fetchedAllOffers,hasMoreOffers:e.hasMoreOffers,id:e.id,offers:null===(n=e.offers)||void 0===n?void 0:n.map((function(n){return function(e,t,n,r){var o,s,c,l,f,d,h={baseRate:e.rate.base,localTaxes:e.rate.hotelFees,taxes:e.rate.taxes},p=a(h,n.includeTaxes,n.includeLocalTaxes),v=i(p,n.checkIn,n.checkOut),g=null!==(o=e.tags)&&void 0!==o?o:[],m=g.includes("top_offer"),y=g.includes("anchor_price"),b=g.includes("exclusive_cheapest_offer"),_=null===(s=e.package.amenities)||void 0===s?void 0:s.filter((function(e){return["allInclusive","breakfast","partialBreakfast","lunch","dinner","fullBoard","halfBoard","meals"].includes(e)})),w=e.package.refundable&&(0===e.cancellationPenalties.length||e.cancellationPenalties.some((function(e){return 0===e.amount||0===e.percent||0===e.nights})));return{id:e.id,bookURI:e.url,providerCode:e.providerCode,proxyProviderCode:e.intermediaryProvider,rateBreakdown:h,nightlyRate:v,calculatedTotalRate:p,availableRooms:e.availableRooms,cug:e.accessTier?e.accessTier.split(","):null,currency:e.currency,meals:_,tags:g,canPayLater:e.package.canPayLater,hasAnchorPrice:!!m&&u(p,r),hasFreeCancellation:w,isAnchorPriceOffer:y,isTopOffer:m,isCheapest:b,roomID:e.roomID,roomName:null===(c=null==t?void 0:t[e.roomID])||void 0===c?void 0:c.name,additionalProviderParams:(0,Jn.removeEmpty)({feedId:null!==(f=null===(l=e.metadata)||void 0===l?void 0:l.feedID)&&void 0!==f?f:"",rateType:null===(d=e.metadata)||void 0===d?void 0:d.providerRateType})}}(n,e.rooms,t,o)})),topOfferData:{anchorPrice:o,anchorPriceNightly:s,offerIndexes:[0,1,2,3]}}}t.hasAnchorPrice=u,t.sapiResponseToHotelOfferEntity=s,t.offersClient=function(e,t){if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o="wss://".concat(e.baseUrl,"/").concat(e.endpoints.offers),a=new r.default(o,[],{maxRetries:15,WebSocket:t.WebSocket}),i={},u={};function c(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"sapi",code:e.code,reason:e.reason,wasClean:e.wasClean}})}function l(e){t.logger.log({name:"WebsocketError",value:Ye.__assign(Ye.__assign({},e),{service:"sapi"})})}function f(){for(var e=0,t=Object.keys(i);e<t.length;e++){var n=t[e],r=i[n];void 0!==r&&a.send(r)}}function d(e){var t;try{t=JSON.parse(e.data)}catch(e){return void console.log("WEBSOCKET: error parsing message")}var n=u[t.clientRequestId];"function"==typeof n&&n(t)}return a.addEventListener("open",f),a.addEventListener("close",c),a.addEventListener("error",l),a.addEventListener("message",d),{getOffers:function(e,r){return Ye.__awaiter(this,void 0,void 0,(function(){var o,c;return Ye.__generator(this,(function(l){return o={},c=(0,Ln.v4)(),i[c]=function(e,t,n){var r,o={checkIn:e.checkIn,checkOut:e.checkOut,anchorHotelId:e.anchorHotelId,hotelIds:e.hotelIds,rooms:e.rooms,searchId:e.searchId,cugDeals:e.cugDeals,language:t.language,deviceType:t.deviceType,anonymousId:t.anonymousId,currency:t.currency,originId:e.originId,brand:t.brand,clientRequestId:n,sortingBoost:(0,Jn.generateSortingBoost)(e),getAllOffers:Boolean(e.getAllOffers),preferredRate:e.preferredRate,label:e.trafficSource,countryCode:t.countryCode,variations:t.variations};try{r=JSON.stringify(o)}catch(e){console.log("WEBSOCKET: error serialising request")}return r}(e,t,c),[2,new Promise((function(l){u[c]=function(n){var a,f;if(void 0!==n)if(n.status.complete)l(o),i[c]=void 0,u[c]=void 0;else{var d=null===(a=n.results)||void 0===a?void 0:a.find((function(t){return t.id===e.anchorHotelId}));d?o.anchorHotelOfferEntity=s(d,Ye.__assign(Ye.__assign({},e),t)):o.hotelOfferEntities=null===(f=n.results)||void 0===f?void 0:f.map((function(n){return s(n,Ye.__assign(Ye.__assign({},e),t))})),"function"==typeof r&&r(Ye.__assign({},o))}};var f=i[c];void 0!==f&&(a.readyState===n.Open?a.send(f):a.readyState===n.Closed&&(a._connectLock=!1,a.reconnect()))}))]}))}))}}}})),wr=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Or}(e)}(e)};var Or="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Pr(e,t){return!1!==t.clone&&t.isMergeableObject(e)?jr((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Tr(e,t,n){return e.concat(t).map((function(e){return Pr(e,n)}))}function Sr(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function Ir(e,t){try{return t in e}catch(e){return!1}}function Dr(e,t,n){var r={};return n.isMergeableObject(e)&&Sr(e).forEach((function(t){r[t]=Pr(e[t],n)})),Sr(t).forEach((function(o){(function(e,t){return Ir(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(Ir(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return jr;var n=t.customMerge(e);return"function"==typeof n?n:jr}(o,n)(e[o],t[o],n):r[o]=Pr(t[o],n))})),r}function jr(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Tr,n.isMergeableObject=n.isMergeableObject||wr,n.cloneUnlessOtherwiseSpecified=Pr;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Dr(e,t,n):Pr(t,n)}jr.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return jr(e,n,t)}),{})};var xr=jr,kr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getAppConfig=void 0;var n=Ye.__importDefault(xr),r={sapiBackend:{baseUrl:"dikcjxfwieazv.cloudfront.net",endpoints:{anchor:"anchor",search:"search",offers:"ws/offers"}},saf:{baseUrl:"sapi.findhotel.services",endpoints:{offersRooms:"1/offers-rooms",search:"1/search",hotel:"1/hotel"}},algolia:{appId:"4UYGJP42KQ",apiKey:"efa703d5c0057a24487bc9bdcb597770",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"}]},client:{defaultRooms:"2",features:["offers","search","suggests","configs","rooms","get-hotel"],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"]}}},o={"findhotel-website":r,"findhotel-website-e2e":Ye.__assign(Ye.__assign({},r),{saf:Ye.__assign(Ye.__assign({},r.saf),{baseUrl:"sapi-e2e.findhotel.services"}),sapiBackend:Ye.__assign(Ye.__assign({},r.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-website-stg":Ye.__assign(Ye.__assign({},r),{sapiBackend:Ye.__assign(Ye.__assign({},r.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})}),"findhotel-website-ci":Ye.__assign(Ye.__assign({},r),{sapiBackend:Ye.__assign(Ye.__assign({},r.sapiBackend),{baseUrl:"d1ue1wauc6u0m5.cloudfront.net"})}),"findhotel-website-dev":Ye.__assign(Ye.__assign({},r),{sapiBackend:Ye.__assign(Ye.__assign({},r.sapiBackend),{baseUrl:"d3b8t16k1aaypx.cloudfront.net"})}),"findhotel-checkout":Ye.__assign(Ye.__assign({},r),{client:Ye.__assign(Ye.__assign({},r.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-e2e":Ye.__assign(Ye.__assign({},r),{saf:Ye.__assign(Ye.__assign({},r.saf),{baseUrl:"sapi-e2e.findhotel.services"}),client:Ye.__assign(Ye.__assign({},r.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-stg":Ye.__assign(Ye.__assign({},r),{saf:Ye.__assign(Ye.__assign({},r.saf),{baseUrl:"sapi-stg.findhotel.services"}),client:Ye.__assign(Ye.__assign({},r.client),{features:["rooms","get-hotel"]})})};t.getAppConfig=function(e,t){var r=o[e];if(void 0===r)throw new Error("Profile key is not valid");return t&&(r=(0,n.default)(r,t)),r}})),Cr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=t.variationsToArray=void 0;var n={log:function(){}};function r(e){void 0===e&&(e={});var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push("".concat(n,"-").concat(e[n]));return t}t.variationsToArray=r,t.sapi=function(e,t){var o,a,i,u,s,c,l,f;return Ye.__awaiter(this,void 0,void 0,(function(){function d(e){return b.client.features.includes(e)}function h(e){return d("search")?(0,Vn.search)(e):function(){throw new Error("Search is not enabled for this profile key")}}function p(e){return d("rooms")?(0,Zn.rooms)(e):function(){throw new Error("Rooms search is not enabled for this profile key")}}function v(e){return d("suggests")?(0,$n.suggest)(e):function(){throw new Error("Autosuggest is not enabled for this profile key")}}function g(e){return d("get-hotel")?(0,er.hotel)(e):function(){throw new Error("Get hotel is not alowed for this profile key")}}function m(e){return d("offers")?(0,tr.offers)(e):function(){throw new Error("Get offers is not alowed for this profile key")}}var y,b,_,w;return Ye.__generator(this,(function(O){if(!e)throw new Error("Profile key is required");return y=Ye.__assign(Ye.__assign({},t),{logger:null!==(o=t.logger)&&void 0!==o?o:n,variations:r(t.variations),currency:null!==(i=null===(a=t.currency)||void 0===a?void 0:a.toUpperCase())&&void 0!==i?i:"USD",deviceType:null!==(s=null!==(u=t.deviceType)&&void 0!==u?u:t.deviceCategory)&&void 0!==s?s:"desktop",countryCode:null!==(c=t.countryCode)&&void 0!==c?c:t.userCountry,pageSize:null!==(l=t.pageSize)&&void 0!==l?l:20}),b=(0,kr.getAppConfig)(e,y.initWithAppConfig),_=d("offers")?(0,_r.offersClient)(b.sapiBackend,y):void 0,[2,{rooms:p(w={appConfig:b,getFeatureEnabled:d,profileKey:e,offersClient:_,options:Ye.__assign(Ye.__assign({},y),{languages:Ye.__spreadArray(Ye.__spreadArray([y.language],null!==(f=b.client.fallbackLanguages[y.language])&&void 0!==f?f:[],!0),["en"],!1)})}),search:h(w),suggest:v(w),hotel:g(w),offers:m(w)}]}))}))}})),Er=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Rr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Nr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Mr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ar=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Ye.__exportStar(Er,t),Ye.__exportStar(Rr,t),Ye.__exportStar(Nr,t),Ye.__exportStar(Mr,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),(0,hn.enableES5)(),Ye.__exportStar(Cr,t),Ye.__exportStar(Ar,t),t.default=Cr.sapi})))}));
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import { AnonymousId, ApiSearchParameters, Country, Currency, Language } from '../types';
|
|
2
|
-
interface SearchIdOptions {
|
|
3
|
-
anonymousId: AnonymousId;
|
|
4
|
-
language: Language;
|
|
5
|
-
currency: Currency;
|
|
6
|
-
countryCode: Country;
|
|
7
|
-
}
|
|
8
1
|
/**
|
|
9
|
-
* Generates a
|
|
10
|
-
*
|
|
11
|
-
* @param parameters all relevant search parameters to generate an id
|
|
12
|
-
* @param options SAPI options used to generate an id
|
|
2
|
+
* Generates a random searchId string
|
|
13
3
|
*/
|
|
14
|
-
export declare function generateSearchId(
|
|
15
|
-
export {};
|
|
4
|
+
export declare function generateSearchId(): string;
|