/*! For license information please see list-controllers.min.js.LICENSE.txt */
(()=>{var e={5515:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});n(4697);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(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 o(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.analytics=window.__pt.fn.analytics,this.settings=window.__pt.settings,this.events=window.__pt.fn.analytics.events,this.pages=window.__pt.fn.analytics.pages,this.fn=window.__pt.fn||{}}var t,n,r;return t=e,n=[{key:"metricBookerHotel",value:function(e,t){var n=t.data,r=t.vmData,i=t.element,o={PT:{event:this.events.trackEvent,eventName:this.events.search,checkIn:n.checkin,checkOut:n.checkout,placeId_destination:n.placeId,rooms:n.rooms,nights:this.countNight(n.checkin,n.checkout),adults:n.adults,layer:this.settings.page,children:n.infants+n.kids,place_name_destination:r.place_name,search_type:"hotel"},TB:{event:"ga4.".concat(this.events.trackEvent),eventName:this.events.search,eventParams:{action:this.events.click,search_term:r.place_name,element:i,search_type:this.events.hotel,field_destination:n.placeId,field_date1:n.checkin,field_date2:n.checkout,field_rooms:n.rooms,field_total_nights:this.countNight(n.checkin,n.checkout),travelers_adults:n.adults,travelers_children:n.infants+n.kids,content_type:this.events.button,page_type:this.pages[this.settings.page],layer:this.events.hotels}},US:{event:"ga4.".concat(this.events.trackEvent),eventName:this.events.search,eventParams:{action:this.events.click,search_term:r.place_name,element:i,search_type:this.events.hotel,field_destination:n.placeId,field_date1:n.checkin,field_date2:n.checkout,field_rooms:n.rooms,field_total_nights:this.countNight(n.checkin,n.checkout),travelers_adults:n.adults,travelers_children:n.infants+n.kids,content_type:this.events.button,page_type:this.pages[this.settings.page],layer:this.events.hotels}}}[this.settings.site.metricsSuffix];this.analytics.set(o.event,o)}},{key:"metricBookerFlight",value:function(e,t){var n=t.data,r=t.vmData,i={event:this.events.trackEvent,eventName:this.events.search,checkIn:n.startingFromDateTime,checkOut:n.returningFromDateTime,placeId_destination:r.place_selected_to.id,rooms:1,typeFlight:1==n.mode?"redondo":0==n.mode?"sencillo":"",nameOrigin:r.place_selected.displayText,nights:this.countNight(n.startingFromDateTime,n.returningFromDateTime),adults:n.adults,layer:this.settings.page,children:n.kids,place_name_destination:r.place_selected_to.displayText,search_type:"vuelo"};this.analytics.set(i.event,i)}},{key:"metricModifiedSearchRecomendation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"recomendacion",t={event:this.events.trackEvent,eventName:this.events.selectContent,content_type:this.events.button,element:"".concat(e,"::modificar_busqueda"),layer:this.events.hotels,page_type:this.settings.page};this.analytics.set(this.events.trackEvent,t)}},{key:"metricBookerPackage",value:function(e,t){var n=t.data,r=t.vmData,i={event:this.events.trackEvent,eventName:this.events.search,field_date1:n.CheckIn,field_date2:n.CheckOut,field_destination:r.place_selected_to.placeId,field_rooms:n.rooms,field_total_nights:this.countNight(n.CheckIn,n.CheckOut),layer:this.settings.page,search_term:r.place_name,search_type:"hotel+vuelo",travelers_adults:n.adults,travelers_children:n.infants+n.kids};this.analytics.set(i.event,i)}},{key:"metricRecentSearch",value:function(e){var t={event:this.events.trackEvent,eventName:this.events.selectContent,layer:this.settings.page,content_type:this.events.link,element:"booker_recent_search:: ".concat(e),page_type:this.settings.page};this.analytics.set(t.event,t)}},{key:"availabilityCalendar",value:function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n],i={event:this.events.gtmEvent,eventName:this.events.gtmEvent,eventCategory:"calendar no dispo",eventAction:r.action,eventLabel:r.label};this.analytics.set(i.event,i)}}},{key:"countNight",value:function(e,t){var n=this.fn.getDate(e),r=this.fn.getDate(t);return this.fn.diffBetweenDays(n,r)}},{key:"metricDatesRecommended",value:function(e,t){var n=t.data,r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{event:this.events.trackEvent,eventName:e,hotelId:n.hotelId,checkIn:n.checkIn,checkOut:n.checkOut,nights:this.countNight(n.checkin,n.checkout),adults:n.adults,children:n.children,layer:this.settings.page,search_type:"hotel"});this.analytics.set(r.event,r)}}],n&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},4697:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(o=i.key,a=void 0,a=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===r(a)?a:String(a)),i)}var o,a}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}new(o((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),window.__pt.fn=window.__pt.fn||{},window.__pt.fn.analytics=window.__pt.fn.analytics||{},window.__pt.fn.analytics.events={gtmEvent:"gtmEvent",trackEvent:"trackEvent",viewSearchResults:"view_search_results",gtmEventAB:"ABTesting",hotel:"Hotel",hotels:"hoteles",ads:"ad",list:"list",impressionView:"event-impression-view",impressionClick:"event-impression-click",hotelList:"Hotel List",selectContent:"select_content",link:"enlace",button:"boton",search:"search",hotelFilter:"hotel_filter",filter:"filtro",viewItemList:"view_item_list",viewPromotion:"view_promotion",selectPromotion:"select_promotion",user_interaction:"user_interaction",selectItem:"select_item",productDetail:"event-product-detail",addToCart:"event-add-to-cart",pageView:"Pageview",typeHotel:"hotel :: detalle",paymentFunnel:"Hotels Payment Funnel",hotelError:"Hotels Error",errorQuote:"error_quote",beginCheckout:"begin_checkout",click:"click",mapOpen:"map_open",hotelistMap:"hotelist_map",home:"home",nameHotel:"Nombre hotel"},window.__pt.fn.analytics.pages={home:"home",hotels:"listado",hotel:"detalle"},window.__pt.fn.analytics.set=function(e,t){window.dataLayer&&window.dataLayer.push(t)},window.__pt.fn.analytics.gtagSet=function(e,t){window.gtag&&window.gtag("event",e,t)}})))},291:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var r=n(5515),i=n(7066);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(){a=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function h(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new C(i||[]);return r(a,"_invoke",{value:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=h;var p={};function f(){}function m(){}function v(){}var g={};u(g,s,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(O([])));w&&w!==t&&n.call(w,s)&&(g=w);var b=v.prototype=f.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(r,a,s,c){var l=d(e[r],e,a);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==o(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,s,c)}),(function(e){i("throw",e,s,c)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return i("throw",e,s,c)}))}c(l.arg)}var a;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function I(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=d(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return m.prototype=v,r(b,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:m,configurable:!0}),m.displayName=u(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,u(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new k(h(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(b),u(b,l,"Generator"),u(b,s,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=O,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function s(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,a=void 0,a=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===o(a)?a:String(a)),r)}var i,a}var l=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=window.__pt.settings.site,this.params=window.__pt.box,this.fn=window.__pt.fn,this.language=window.__pt.ln,this.memory={},this.mainElement=null,this.eventHandler=new r.Z}var t,n,o,l,u;return t=e,n=[{key:"getAvailability",value:(l=a().mark((function e(t,n,r){var o,s,c,l,u;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.getParams(t,n,r),s=this.fn.objectToQueryParams(o),c="".concat(t,"_").concat(n,"_").concat(r),this.memory[c]){e.next=9;break}return l=(0,i.w)(),e.next=7,fetch("".concat(this.config.endPoints.calendarAvailabilityUrl,"?").concat(s),{method:"GET",headers:l}).then((function(e){return e.json()})).catch((function(e){return console.log("error quote availability:",e.message)}));case 7:(u=e.sent)&&(this.memory[c]=u,this.eventHandler.availabilityCalendar(u.events||[]));case 9:return e.abrupt("return",this.memory[c]);case 10:case"end":return e.stop()}}),e,this)})),u=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=l.apply(e,t);function o(e){s(i,n,r,o,a,"next",e)}function a(e){s(i,n,r,o,a,"throw",e)}o(void 0)}))},function(e,t,n){return u.apply(this,arguments)})},{key:"build",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t&&t.daysByDate){var n=t.daysByDate||{};for(var r in n){var i=n[r],o=e[i.checkinFormat];this.buildElement(o,i)}this.footerBuild()}}},{key:"buildElement",value:function(e,t){if(e){var n=e.target.querySelector(".day-price")||document.createElement("span");n.className=t.available?"day-price available":"day-price unavailable",n.innerHTML=t.available?"".concat(t.avgPrice):"  ",e.target.append(n),t.color&&t.color.length&&e.target.classList.add(t.color)}}},{key:"setFooterElement",value:function(e){this.mainElement=e}},{key:"footerBuild",value:function(){if(this.mainElement&&Object.keys(this.memory).length){var e=this.mainElement.querySelector(".footer-price")||document.createElement("span");e.className="footer-price",e.innerHTML=this.language.price_calendar_footer.replace("{currency}",this.config.currency),this.mainElement.append(e)}}},{key:"getMemoryDate",value:function(e,t,n){if(n)return e="".concat(n,"_").concat(e),this.memory[e]?this.memory[e].daysByDate[t]:null}},{key:"overFlow",value:function(){if(this.config.mobile){document.body.classList.toggle("modal-open");var e=document.querySelector(".modal-backdrop.fade.show.modal-backdrop-custom");e?e.remove():((e=document.createElement("div")).className="modal-backdrop fade show modal-backdrop-custom",document.body.append(e))}}},{key:"setCalendarPriceContainer",value:function(){this.mainElement&&this.mainElement.parentElement.classList.add("container-price")}},{key:"removeCalendarPriceContainer",value:function(){this.mainElement&&this.mainElement.parentElement.classList.remove("container-price")}},{key:"getParams",value:function(e,t,n){return{site:this.config.domain.replace("https://",""),mobile:this.config.mobile,hotelId:e,year:t,month:n,type:"json"}}}],n&&c(t.prototype,n),o&&c(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}())},694:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(o=i.key,a=void 0,a=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===r(a)?a:String(a)),i)}var o,a}n.d(t,{Z:()=>o});var o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.paramQuery=t,this.config=n}var t,n,r;return t=e,(n=[{key:"getIsArray",value:function(e){return Array.isArray(e)}},{key:"getFirstPathSegment",value:function(){return window.location.pathname.split("/")[1]}},{key:"convertPaxesData",value:function(e){var t=e.reduce((function(e,t){return e.adults+=t.adults||0,e.children=e.children.concat(t.children||[]),e}),{adults:0,children:[]});return t.rooms=e.length,t}},{key:"getUserKey",value:function(e){var t=window.__pt.fn,n="anonimo-".concat(t.generateUUID()),r=t.getCookie("__ca__chat")||n,i=e.get("userKey");return!i||i||i.includes("anonimo")?r?(i&&i.includes("anonimo")||e.set("userKey",r),r):(setTimeout((function(){var r=t.getCookie("__ca__chat")||n;e.set("userKey",r)}),2e3),""):i}},{key:"getUserKeyFavorites",value:function(e){var t=window.__pt.fn,n=window.__pt.user||null,r="anonimo-".concat(t.generateUUID()),i=n&&n.firebaseId?n.firebaseId:t.getCookie("session_id")||r,o=e.get("userKey_fav");return o&&o===i?o:i?(e.set("userKey_fav",i),i):(setTimeout((function(){var i=n&&n.firebaseId?n.firebaseId:t.getCookie("session_id")||r;e.set("userKey_fav",i)}),2e3),"")}},{key:"getPaxes",value:function(e){for(var t=e.pax&&e.pax.length,n={adults:0,children:0,paxesFormat:[]},r=0;e.pax&&r<t;r++){var i=e.pax[r],o="";n.adults+=i.adults,o+="".concat(i.adults,"/"),i.children&&i.children.length?(n.children+=i.children.length,o+="".concat(i.children.map((function(e){return e.year})).join(","))):o+="n",n.paxesFormat.push(o)}return n}},{key:"getPaxesFavorites",value:function(e){for(var t=e&&e.length,n={adults:0,children:0,paxesFormat:[]},r=0;e&&r<t;r++){var i=e[r],o="";n.adults+=i.adults,o+="".concat(i.adults,"/"),i.children&&i.children.length?(n.children+=i.children.length,o+="".concat(i.children.map((function(e){return e.year})).join(","))):o+="n",n.paxesFormat.push(o)}return n}},{key:"getPaxesRates",value:function(e){for(var t=e.pax&&e.pax.length,n={adults:0,children:0,paxesFormat:[]},r=0;e.pax&&r<t;r++){var i=e.pax[r],o="";n.adults+=i.adults,o+="".concat(i.adults),i.children&&i.children.length&&(n.children+=i.children.length,o+="|".concat(i.children.map((function(e){return e.year})).join(","))),n.paxesFormat.push(o)}return n}},{key:"getPaxToMessages",value:function(e){return e.pax.map((function(e){return"".concat(e.adults).concat(e.children.length>0?"_":"").concat(e.children.map((function(e){return e.year})).join("_"))}))}},{key:"getAgeKids",value:function(e){return e.pax[0].children.map((function(e){return e.year})).join(",")}},{key:"getShowPromotion",value:function(e){var t=!1,n=!1,r=this.config.promotionKeyShow;if(r){var i=e?r.find((function(t){return t.key==e.promotionType})):"";i&&(t=i.active,n=i.blackFAndHotS)}return{activeKey:t,HotSBlackFri:n}}},{key:"windowScrollTop",value:function(){window.scrollTo(0,0)}}])&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2805:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7066);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){c=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function h(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new C(i||[]);return r(a,"_invoke",{value:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=h;var p={};function f(){}function m(){}function v(){}var g={};u(g,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(O([])));w&&w!==t&&n.call(w,a)&&(g=w);var b=v.prototype=f.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(r,a,s,c){var l=d(e[r],e,a);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==i(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){o("next",e,s,c)}),(function(e){o("throw",e,s,c)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return o("throw",e,s,c)}))}c(l.arg)}var a;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function I(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=d(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function O(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return m.prototype=v,r(b,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:m,configurable:!0}),m.displayName=u(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,u(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new k(h(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(b),u(b,l,"Generator"),u(b,a,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=O,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function l(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){l(o,r,i,a,s,"next",e)}function s(e){l(o,r,i,a,s,"throw",e)}a(void 0)}))}}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}const p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.baseUrl=t}var t,n,i,o,s,l,d,p;return t=e,n=[{key:"addHotel",value:(p=u(c().mark((function e(t){var n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(this.baseUrl,"/api/LowPriceNotifier/addhotel"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});case 2:return n=e.sent,e.abrupt("return",n.json());case 4:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"removeHotel",value:(d=u(c().mark((function e(t){var n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new URL("".concat(this.baseUrl,"/api/LowPriceNotifier/removehotel")),Object.keys(t).forEach((function(e){return n.searchParams.append(e,t[e])})),e.next=4,fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});case 4:return r=e.sent,e.abrupt("return",r.json());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"getHotelsByUser",value:(l=u(c().mark((function e(t){var n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new URL("".concat(this.baseUrl,"/api/LowPriceNotifier/gethotelsbyuser")),Object.keys(t).forEach((function(e){return n.searchParams.append(e,t[e])})),e.next=4,fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});case 4:return r=e.sent,e.abrupt("return",r.json());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getHotelsByUserFacade",value:(s=u(c().mark((function e(t){var n,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new URL("".concat(this.baseUrl,"/api/Favorites/get")),Object.keys(t).forEach((function(e){return n.searchParams.append(e,t[e])})),e.next=4,fetch(n,{method:"GET",headers:a({"Content-Type":"application/json"},(0,r.w)())});case 4:return i=e.sent,e.abrupt("return",i.json());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"copyByUser",value:(o=u(c().mark((function e(t){var n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new URL("".concat(this.baseUrl,"/api/LowPriceNotifier/copyByUser")),Object.keys(t).forEach((function(e){return n.searchParams.append(e,t[e])})),e.next=4,fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});case 4:return r=e.sent,e.abrupt("return",r.json());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})}],n&&h(t.prototype,n),i&&h(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7066:(e,t,n)=>{"use strict";function r(){return{"x-Token":window.__pt.settings.site.token}}n.d(t,{w:()=>r})},4155:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var s,c=[],l=!1,u=-1;function h(){l&&s&&(l=!1,s.length?c=s.concat(c):u=-1,c.length&&d())}function d(){if(!l){var e=a(h);l=!0;for(var t=c.length;t;){for(s=c,c=[];++u<t;)s&&s[u].run();u=-1,t=c.length}s=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),window.directives=window.directives||["LocalStorageModule","ngSanitize","firebase"],window.app=angular.module("app",window.directives).directive("offClick",["$document","$parse","$timeout",function(e,t,n){return{restrict:"A",compile:function(r,i){var o=t(i.offClick);return function(t,r,i){function a(n){var i=$(n.target);r[0].contains(n.target)||i.hasClass("no-autoclose")?e.one("click touchend",a):t.$apply((function(){o(t)}))}t.$watch(i.offClickActivator,(function(t){t?n((function(){e.one("click touchend",a)})):e.off("click touchend",a)}))}}}}]).directive("lazyLoad",(function(){return{restrict:"A",link:function(e,t,n){var r=new IntersectionObserver((function(e){e.forEach((function(e){e.intersectionRatio>0&&(e.target.src=e.target.getAttribute("data-src"),r.unobserve(e.target))}))})),i=angular.element(t)[0];r.observe(i)}}})).directive("bnLazySrc",["$window","$document",function(e,t){var n=function(){var n=[],r=null,i=$(e),o=t,a=o.height(),s=null,c=!1;function l(){if(!r){var e=o.height();e!==a&&(a=e,d())}}function u(){for(var e=[],t=[],r=i.height(),o=i.scrollTop(),a=o+r,s=0;s<n.length;s++){var c=n[s];c.isVisible(o,a)?e.push(c):t.push(c)}for(s=0;s<e.length;s++)e[s].render();n=t,h(),n.length||p()}function h(){clearTimeout(r),r=null}function d(){r=setTimeout(u,100)}function p(){c=!1,i.off("resize.bnLazySrc"),i.off("scroll.bnLazySrc"),clearInterval(s)}function f(){r||d()}return{addImage:function(e){n.push(e),r||d(),c||(c=!0,i.on("resize.bnLazySrc",f),i.on("scroll.bnLazySrc",f),s=setInterval(l,2e3))},removeImage:function(e){for(var t=0;t<n.length;t++)if(n[t]===e){n.splice(t,1);break}n.length||(h(),p())}}}();function r(e){var t=null,n=!1,r=null;function o(){e[0].onerror=function(){i(e[0],!0)},e[0].src=t,window.__pt.renderLazyload&&window.__pt.renderLazyload(e[0])}return i(e[0]),{isVisible:function(t,n){if(!e.is(":visible"))return!1;null===r&&(r=e.height());var i=e.offset().top,o=i+r;return i<=n&&i>=t||o<=n&&o>=t||i<=t&&o>=n},render:function(){n=!0,o()},setSource:function(e){t=e,n&&o()}}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];("hotel-card-img"===e.classList[0]&&!e.src||t)&&(e.src=window.__pt.settings.site.cloudCdn+"/assets/img/placeholder_img_".concat(window.__pt.settings.site.country,".png"))}return{link:function(e,t,i){var o=new r(t);n.addImage(o),i.$observe("bnLazySrc",(function(e){o.setSource(e)})),e.$on("$destroy",(function(){n.removeImage(o)}))},restrict:"A"}}]),window.app.config(["$locationProvider",function(e){e.html5Mode({enabled:!0,requireBase:!1,rewriteLinks:!1})}]),window.app.config(["localStorageServiceProvider",function(e){e.setPrefix("pt")}]),window.app.filter("asDate",(function(){return function(e){return window.__pt.fn.getDate(e)}})),window.app.filter("roundToInt",(function(){return function(e){return Math.round(e)}})),window.app.filter("resizeString",(function(){return function(e,t,n){return e.length<=t?e:n?e.substring(0,t)+"...":e}})),window.app.directive("inViewport",(function(){return{scope:{fn:"&inViewport"},restrict:"A",link:function(e,t,n){var r=new IntersectionObserver((function(t){t.forEach((function(t){e.fn({event:{isVisible:t.isIntersecting,element:i}})}))})),i=angular.element(t)[0];r.observe(i)}}})),window.app.filter("getIconStars",(function(){return function(e){return"icon-".concat(Math.floor(e)).concat(e%1==0?"-":"-half-","star")}})),window.app.filter("getRatingDesc",(function(){return function(e){for(var t=2*e,n=__pt.ln.rating_reviews_range,r=0;r<n.length;r++)if(t>=n[r].range[0]&&t<=n[r].range[1])return n[r].display}})),window.app.filter("highlights",(function(){return function(e){return e.slice(0,3).map((function(e){return e.info})).join(" \n• ")}})),window.app.filter("getUrlDetail",(function(){return function(e){return window.__pt.settings.site.siteUrl+"/hotel/"+e+window.location.search}})),window.app.filter("paginationRange",(function(){return function(e,t){var n={from:e.currentPage*e.pageSize,to:(e.currentPage+1)*e.pageSize,of:e.totalHotels};return t.replace("(from)",n.from+1).replace("(to)",n.to>=n.of?n.of:n.to).replace("(total)",n.of)}})),window.app.filter("commanseparatecolo",[function(){return function(e){var t=e?e.toString().replace(".",","):null;if(t){var n=t.split(",");n.length>1&&1===n[1].length&&(t+="0")}return t}}]),window.app.filter("capitalize",(function(){return function(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}})),window.app.filter("orderObjectByKey",(function(){return function(e,t){if(!e)return[];var n=[];return angular.forEach(e,(function(e,t){n.push({key:Number(t),value:e})})),n.sort((function(e,t){return e.key-t.key})),t&&n.reverse(),n}})),window.app.filter("tel",(function(){return function(e){if(!e)return"";var t,n,r,i=e.toString().trim().replace(/^\+/,"");if(i.match(/[^0-9]/))return e;switch(i.length){case 10:t=1,n=i.slice(0,2),r=i.slice(2);break;case 11:t=i[0],n=i.slice(1,4),r=i.slice(4);break;case 12:t=i.slice(0,3),n=i.slice(3,5),r=i.slice(5);break;default:return e}return 1==t&&(t=""),(t+" "+n+" "+(r=r.slice(0,4)+" "+r.slice(4))).trim()}})),window.app.filter("capacityString",(function(){return function(e){return window.__pt.ln.capacity.replace("{0}",e)+(e>0&&"s")}})),window.app.filter("capitalize",(function(){return function(e){return e.charAt(0).toUpperCase()+e.slice(1)}})),window.app.filter("kidsAgeRange",(function(){return function(e){return window.__pt.ln.kidsFreeTo.replace("{0}",e)}})),window.app.filter("setSizeParams",(function(){return function(e){var t=window.__pt.settings.screenSizes,n=window.__pt.fn.mediaQueries(t),r=n.mediaQueryDesktop,i=n.mediaQueryTablet,o=n.mediaQuerySmall,a=n.mediaQueryMobile;return r().matches?"?tx=w_552,h_368":i().matches||o().matches?"?tx=w_464,h_309":(a().matches,"?tx=w_390")}})),window.app.filter("separateHistory",(function(){return function(e){var t=e.split(" - ");return 2===t.length?"\n                <span><b>".concat(t[0],"</b></span>\n                <div><small>").concat(t[1],"</small></div>\n            "):e}})),window.app.filter("singularize",(function(){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t>1?e:e.substring(0,e.length-n)}})),window.app.filter("andmsi",(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(!e.length)return"";var r=e[0]+" msi*";return e.length>1&&(r=e.slice(0,e.length-1).join(", ")+" ".concat(t," ")+e.slice(-1)[0]+" "+n),r}})),window.app.filter("removeSpaces",[function(){return function(e){return angular.isString(e)?e.replace(/[\s]/g,""):e}}]),window.app.filter("cityScpecialChar",[function(){return function(e){var t={Bogota:"Bogot�"};return t[e]?t[e]:e}}]),window.app.filter("pluralize",[function(){return function(e,t,n){return t>1?e+n:e}}]),window.app.filter("orderByMaxItem",[function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.sort((function(e,n){var r=function(e){return Math.max.apply(null,e)};return r(e[t])<r(n[t])?1:r(e[t])>r(n[t])?-1:0}))}}]),window.app.filter("replace",(function(){return function(e,t,n){return e.replace(t,n)}})),window.app.filter("filter_titles",[function(){return function(e){var t=window.__pt.ln.overriteTitles;return t[e.replaceAll(" ","")]?t[e]:e}}]),(()=>{"use strict";var e=n(5515),t=n(291),r=n(694);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function a(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(){l=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function h(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new C(i||[]);return r(a,"_invoke",{value:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=h;var p={};function f(){}function m(){}function v(){}var g={};u(g,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(O([])));w&&w!==t&&n.call(w,a)&&(g=w);var b=v.prototype=f.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(r,a,s,c){var l=d(e[r],e,a);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==i(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){o("next",e,s,c)}),(function(e){o("throw",e,s,c)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return o("throw",e,s,c)}))}c(l.arg)}var a;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function I(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=d(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function O(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return m.prototype=v,r(b,"constructor",{value:v,configurable:!0}),r(v,"constructor",{value:m,configurable:!0}),m.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,u(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new k(h(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(b),u(b,c,"Generator"),u(b,a,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=O,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function u(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,s,"next",e)}function s(e){u(o,r,i,a,s,"throw",e)}a(void 0)}))}}function d(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(n,s,c,u,d,f,m){var v=this,g={},y=window.__pt.settings.site,w=window.__pt.settings,b=window.__pt.ln,_=window.__pt.fn,k=_.getDate(),I=window.__pt.place||{},E="",S="",P={},C=null,O=new e.Z,T=window.__pt.box||null,x=w.bookerHistorySize,D={format:w.formatBoxDate,formatMobile:w.formatBoxDateMobile,firstDay:0,applyLabel:b.ok,cancelLabel:b.cancel},A={},L={};window.__pt.user;v.submit=!1,v.years=[],v.suggestion={from:{results:[],show:!1},paxes:!1},v.hasResult=!1,v.validation={paxes:!0,checkIn:!0,checkOut:!0,dates:!0},v.siteUrl=window.__pt.settings.site.siteUrl,v.algoliaUrl="TB"!=window.__pt.settings.site.metricsSuffix?"https://pricetravel.com/assets/recent-search-imgs/places/":"https://www.tiquetesbaratos.com/assets/recent-search-imgs/places/",v.settingPaxes={minAdults:1,maxAdults:8,minChildren:0,maxChildren:6,minAge:0,maxAge:17,rooms:8};var N=new r.Z,j=N.getUserKey(d),R={weeksPrequote:0,daysPrequote:0,startDate:0};function F(e){var t=e.data||[];t.length>0&&t.forEach((function(e){var t=a(11==e.type?e.displayHtml.split("-").map((function(e){return e.trim()})):e.displayHtml.split(",").map((function(e){return e.trim()}))),n=t[0],r=t.slice(1);e.city=11==e.type?"".concat(r.join(", ").replace(" "+e.code+" ","")," (").concat(e.code,")"):n,e.location=11===e.type?n.replace(e.code+" ",""):r.join(", ")})),v.suggestion[E].results=t,v.suggestion[E].show=!0,v.placeInputHasFocus=!0,_.mobileAndTabletCheck()&&K("".concat(S,"_modal"))}function M(e){console.log(e)}function U(){var e={analyticsTags:Z(),from:0,language:y.language,placeTypes:0,site:y.code,size:5,usersearch:j,recommendation:!0};s.get(y.endPoints.suggestionHotelUrl,{params:e}).then(F,M)}function B(){_.mobileAndTabletCheck()?(R.weeksPrequote=y.configDaysPrequoteMobile.weeksPrequote,R.daysPrequote=y.configDaysPrequoteMobile.daysPrequote,R.startDate=y.configDaysPrequoteMobile.startDate):(R.weeksPrequote=y.configDaysPrequoteDesktop.weeksPrequote,R.daysPrequote=y.configDaysPrequoteDesktop.daysPrequote,R.startDate=y.configDaysPrequoteDesktop.startDate);var e=new Date(k);e.setDate(e.getDate()+7*R.weeksPrequote),e.setDate(e.getDate()-e.getDay()+R.startDate),v.data.checkIn=H(e),v.data.checkOut=H(e,R.daysPrequote)}function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_.getDate(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=_.getDate(_.formatDate(e,w.formatDate));return n.setDate(n.getDate()+t),n}function V(){var e=0,t=0;if(N.getIsArray(v.data.paxes)){var n,r=o(v.data.paxes);try{for(r.s();!(n=r.n()).done;){var a=n.value;e+=a.adults||0,t+=a.children?a.children.length:0}}catch(e){r.e(e)}finally{r.f()}}else"object"===i(v.data.paxes)&&(e=v.data.paxes.adults||0,t=v.data.paxes.children?v.data.paxes.children.length:0);var s=N.getIsArray(v.data.paxes)?v.data.paxes.length:v.data.paxes.rooms,c=1===s?b.room:b.rooms,l=1===e?b.adult:b.adults,u=1===t?b.child:b.children,h="";t>0&&(h=" ".concat(t," ").concat(u,", ")),v.data.paxes_name="".concat(e," ").concat(l,",").concat(h," ").concat(s," ").concat(c),v.data.paxes_people="".concat(e+t," ").concat(b.new_pers," ").concat(s," ").concat(b.new_room),v.data.capacityTotal=e+t}function q(e){var t=y.pathHome;switch(e){case 6:case 3:case 11:case 7:case 12:t=y.pathHoteles;break;case 14:t=y.pathHotelDetail}return t}function z(e){var t={},n=e.adults,r=0,i=0,a=[];if(t.group_adults=n,t.no_rooms=e.rooms,e.children&&e.children.length>0){r=e.children.length,t.group_children=r;var s,c=o(e.children);try{for(c.s();!(s=c.n()).done;){var l=s.value;a.push(l.year),l.year>5?r+=1:i+=1}}catch(e){c.e(e)}finally{c.f()}}return a.length>0&&(t.age=a.join(",")),i>0&&(t.infant=i),t}function G(e,t){for(var n=!0,r=(e.rooms,e.children.length),i=0;i<r;i++){if(t["children_".concat(i)].$invalid){n=!1;break}}return n}function W(e,t){var n=!0;return e.setHours(0,0,0,0),+e>+t&&(n=!1),n}function K(e){setTimeout((function(){var t=e&&document.getElementById(e);t&&t.focus()}),200)}function Y(e){"paxes"==e&&(v.validation.paxes=G(v.data.paxes,v.form))}function J(){if(v.data&&v.data.paxes){var e=v.data.paxes;if(e&&e.children&&e.children.length>0&&e.children.some((function(e){return null===e.year||void 0===e.year})))return!0}return!1}function Q(e){try{var t=d.get(w.historyStorageParam),n=[];if(t&&(n=t).some((function(t){return t.place_selected.id.toString()===e.place_selected.id.toString()})))return;n.length>=x&&(n=n.splice(0,x-1)),n.unshift(e),d.set(w.historyStorageParam,n)}catch(e){}}function X(e,t){g.setDataArgolia(e,t)}function Z(){var e=[];_.mobileAndTabletCheck()?e.push("web_mobile"):e.push("web_desktop");var t=N.getFirstPathSegment();return"hotel"==t?e.push("detail"):"hoteles"!=t&&"hotels"!=t||"home"!=w.page?"hoteles"!=t&&"hotels"!=t||"hotels"!=w.page?"landings"==w.page?e.push("landings"):e.push("home"):(e.push("list"),e.push(window.location.pathname.split("/")[2])):e.push("home"),e.join(",")}function ee(){C.setDateRange(v.data.checkIn,v.data.checkOut),V(),f.url(f.path());var e=_.search(),t=z(v.data.paxes),n=e.campaignTokenApi||e.CampaignTokenApi||e.campaigntokenapi||null,r=e.CampaignToken||e.campaignToken||n,i={placeId:v.data.place_selected.id,placeType:v.data.place_selected.type,adults:v.data.paxes.adults,checkin:_.formatDate(v.data.checkIn,w.formatDate),checkout:_.formatDate(v.data.checkOut,w.formatDate),campaignToken:r||null};for(var o in i=i=p(p({},i),t))i[o]&&f.search(o,i[o])}function te(e){window.innerWidth<=479?"auto"==e?document.body.classList.remove("modal-open"):"hidden"==e&&document.body.classList.add("modal-open"):document.body.classList.remove("modal-open")}v.data=w.defaultHotel,v.display=!0,v.keyPosition=0,v.placeInputHasFocus=!1,v.history=[],v.dataCopyCancel=w.defaultHotel,m.$on(w.bookerValuesEvent,(function(e,t){t&&t.pax?(v.data.checkIn=_.getDate(t.checkIn),v.data.checkOut=_.getDate(t.checkOut),v.data.paxes=t.pax,ee(),m.$broadcast(w.bookerChangeEvent,v.data)):(v.data.place_selected=t.place,v.data.paxes=t.box.pax,v.data.checkIn=_.getDate(t.box.checkIn),v.data.checkOut=_.getDate(t.box.checkOut),v.data.campaignTokenApi=t.campaignTokenApi,v.data.campaignToken=t.campaignToken,v.onSubmit(v.form,!0))})),m.$on(w.bookerSearchEvent,(function(e,t){O.metricModifiedSearchRecomendation(t.typeEvent),v.data.paxes=t.paxes,v.data.checkIn=t.checkIn,v.data.checkOut=t.checkOut,ee(),v.data.typeEvent=t.typeEvent,m.$broadcast(w.bookerChangeEvent,v.data)})),v.onSearch=function(e,t,n,r){if((""===e||null==e||e.length<3)&&U(),e&&!(e&&e.length<3)&&(v.hasResult=!1,v.form[n].$valid)){S=r,E=t;var i={query:e,language:y.language,placeTypes:y.placesTypeHotel,from:0,size:10,usersearch:j,site:y.code,analyticsTags:Z()};s.get(y.endPoints.suggestionHotelUrl,{params:i}).then(F,M)}},v.onSubmit=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;return function(e){var i=N.getFirstPathSegment();if(v.validation.paxes=G(v.data.paxes,e),n&&"hotel"==i)e.$valid&&v.validation.paxes?(v.data.typeEvent=r,m.$broadcast(w.bookerSearchEvent,v.data),m.$broadcast(w.bookerSearchEventSmall,v.data),v.form.$pristine=!1,v.form.$dirty=!1,v.form.$submitted=!1):v.validation.paxes||(v.suggestion.paxes=!0);else{if(n&&"hotel"!=i)return;if(v.submit=!0,t?e.$valid=!0:(v.validation.paxes=G(v.data.paxes,e),v.validation.checkIn=W(k,v.data.checkIn),v.validation.checkOut=W(k,v.data.checkOut),v.validation.dates=W(v.data.checkIn,v.data.checkOut)),e.$valid&&v.validation.paxes&&v.validation.checkIn&&v.validation.checkOut&&v.validation.dates){var o=_.search(),a=z(v.data.paxes),s=o.coupon,c={placeId:v.data.place_selected.id,placeType:v.data.place_selected.type,adults:v.data.paxes.adults,checkin:_.formatDate(v.data.checkIn,w.formatDate),checkout:_.formatDate(v.data.checkOut,w.formatDate)};s&&(c.coupon=s),v.data.place_selected.cityUrl&&y.algoliaDetailIs&&(c.profileId=v.data.place_selected.code),o.CampaignToken&&(c.CampaignToken=o.CampaignToken),o.campaignTokenApi&&(c.campaignTokenApi=o.campaignTokenApi),o.ctInternal&&(c.ctInternal=o.ctInternal),o.source&&(c.source=o.source),c=p(p({},c),a);var l=q(v.data.place_selected.cityUrl&&y.algoliaDetailIs?6:v.data.place_selected.type);try{O.metricBookerHotel("booker",{vmData:v.data,data:c})}catch(e){console.log(e)}e=document.createElement("form");for(var u in e.setAttribute("method","get"),e.setAttribute("action","".concat(y.siteUrl).concat(l).concat(v.data.place_selected.cityUrl&&y.algoliaDetailIs?v.data.place_selected.cityUrl:v.data.place_selected.uri)),c)if(c[u]){var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("name",u),h.setAttribute("value",c[u]),e.appendChild(h)}Q(v.data),d.set("bookerHotel_fam",v.data),$("#loader-page").removeClass("d-none"),document.body.appendChild(e),e.submit()}else v.validation.paxes||(v.suggestion.paxes=!0)}}(e)},v.onSelect=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];v.isSelected=!0,te("auto"),v.data.place_name=e.displayText,v.data.place_selected=e,v.suggestion[t].show=!1,v.placeInputHasFocus=!1,X(e,n),r&&O.metricRecentSearch(e.displayText)},v.showPaxes=function(){v.suggestion.paxes=!0,v.dataCopyCancel=angular.copy(v.data),te("hidden")},v.addRoom=function(e){v.settingPaxes.rooms<=v.data.paxes[e]||(v.data.paxes[e]+=1,V())},v.removeRoom=function(e){v.data.paxes[e]+1>2&&(v.data.paxes[e]-=1),V()},v.onFocus=function(e,t){E=e,S=t,v.hasResult=!0,setTimeout((function(){U()}),200),v.suggestion[e].results.length&&setTimeout((function(){n.$apply((function(){v.suggestion[e].show=!0,_.mobileAndTabletCheck()&&K("".concat(t,"_modal"))}))}),250)},v.getIcon=function(e){var t="icons-globe-outline";switch(e){case 6:t="icons-globe-outline";break;case 3:t="icons-location";break;case 11:t="icons-plane-airport";break;case 7:t="icons-compass";break;case 14:t="icons-hotel";break;case 12:t="icons-monument"}return[t]},v.removePax=function(e,t){v.data.paxes[e]-1>=t&&(v.data.paxes[e]-=1),V()},v.addPax=function(e,t){v.data.paxes[e]+1<=t&&(v.data.paxes[e]+=1),V()},v.removeChildren=function(e,t){v.data.paxes[e].length-1>=t&&v.data.paxes[e].splice(v.data.paxes[e].length-1,1),V()},v.addChildren=function(e,t){v.data.paxes[e].length+1<=t&&v.data.paxes[e].push({year:null}),V()},v.onClose=function(e,t){J()?v.form.$setSubmitted():(e[t]=!1,Y(t),v.placeInputHasFocus=!1,te("auto"))},v.onCloseCancel=function(e,t){v.data=v.dataCopyCancel,e[t]=!1,Y(t),te("auto")},v.onCloseSubmitForm=function(e,t,n){te("auto"),J()||v.form.$invalid?v.onClose(e,t):n?(v.onClose(e,t),m.$broadcast(w.bookerSearchEvent,v.data),m.$broadcast(w.bookerSearchEventSmall,v.data),v.form.$pristine=!1,v.form.$dirty=!1,v.form.$submitted=!1):v.onSubmit(v.form,!1)},v.onRemove=function(e,t,n){e[t].splice(n,1),V()},v.hasError=function(e,t){var n=e[t];return e.$submitted&&n.$invalid},v.isInvalidInput=function(e,t,n){return e.$submitted&&e["".concat(t,"_").concat(n)].$invalid},v.onClickOutside=function(e,t){v.placeInputHasFocus=!1,e[t]=!1,Y(t),v.placeInputHasFocus=!1,te("auto")},v.deleteSelection=function(e,t,n,r){v.data[e]=null,v.data["".concat(t).concat(n.length?"_"+n:"")]={},K(r)},v.showBooker=function(){v.display=!v.display},v.keysNavigation=function(){var e=h(l().mark((function e(t,n){var r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r=v.suggestion[n])&&r.results.length&&r.show)){e.next=10;break}if(40==t.keyCode&&(v.keyPosition=v.keyPosition<r.results.length-1?v.keyPosition+1:v.keyPosition),38==t.keyCode&&(v.keyPosition=v.keyPosition>0?v.keyPosition-1:v.keyPosition),13!=t.keyCode){e.next=10;break}return t.preventDefault(),v.onSelect(r.results[v.keyPosition],n,v.keyPosition),e.next=9,_.sleep(100);case 9:v.keySelected=0;case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),v.clickInputInMobile=function(e){te("hidden"),S=e,v.placeInputHasFocus=!0,_.mobileAndTabletCheck()&&(K("".concat(S,"_modal")),v.data.place_name&&v.data.place_name.length>3&&setTimeout((function(){var e=document.getElementById("".concat(S,"_modal"));e&&e.setSelectionRange(0,e.value.length)}),200))},g.setDataArgolia=function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items.queryID,r=e.items.objectID,i=t+1,o=j;if(window.sessionStorage){var a={objectIDs:r,queryID:n,userToken:o,posicion:i,indexName:y.algoliaSearch};d.set("_key_argo_object",JSON.stringify(a))}window.aa("clickedObjectIDsAfterSearch",{userToken:o,eventName:"Buscador Click",index:y.algoliaSearch,queryID:n,objectIDs:[r],positions:[i]})}};var ne=function(){var e=h(l().mark((function e(){var n,r,i,o;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!y.showCalendarAvailability){e.next=15;break}if(!(n=v.data.place_selected)||14!=n.type||!n.code&&!n.id){e.next=15;break}t.D.setCalendarPriceContainer(),e.t0=l().keys(L);case 5:if((e.t1=e.t0()).done){e.next=14;break}return r=e.t1.value,i=r.split("_"),e.next=10,t.D.getAvailability(n.code||n.id,i[0],i[1]);case 10:o=e.sent,t.D.build(A,o),e.next=5;break;case 14:t.D.footerBuild();case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();!function(){var e;B(),function(){var e,t;"hotels"!=w.page&&"hotel"!=w.page||(v.display=!_.mobileAndTabletCheck());"home"!=w.page?e=function(){var e=_.search(),t={},n=I;t.place_name=n.displayText||"",t.place_selected=n,t.checkIn=e.checkin||v.data.checkIn,t.checkOut=e.checkout||v.data.checkOut;var r={adults:0,children:[],rooms:0};if(e["room1.adults"]){var i=+e.rooms;r.rooms=i;for(var o=0;o<i;o++){var a=o+1;r.adults=parseInt(r.adults)+parseInt(e["room".concat(a,".adults")])||2;var s=e["room".concat(a,".agekids")];if(s)for(var c=s.split(","),l=0;l<c.length;l++)r.children.push({year:+c[l]||0})}}else{for(var u=+e.group_adults||2,h=+e.no_rooms||1,d=[],p=+e.group_children||0,f=0;f<p;f++){var m=+(e.age||"").split(",")[f]||0;d.push({year:m})}r.adults=u,r.rooms=h,r.children=d}r||(r=v.data.paxes);return t.paxes=r,t}():t=d.get("bookerHotel_fam");t&&(t.place_name=null,t.place_selected={});v.data=e||t||v.data,N.getIsArray(v.data.paxes)&&(v.data.paxes=N.convertPaxesData(v.data.paxes));(e||t)&&(v.data.checkIn=_.getDate(v.data.checkIn),v.data.checkOut=_.getDate(v.data.checkOut),(+v.data.checkIn<=+k||+v.data.checkOut<=+k)&&B())}(),function(){var e=_.search();if((k<_.getDate(v.data.checkOut)||k>=_.getDate(v.data.checkOut))&&T)if(e.daysToArrival&&e.daystostay){var n=new Date;n.setDate(n.getDate()+parseInt(e.daysToArrival)),v.data.checkIn=n;var r=new Date(n);r.setDate(r.getDate()+parseInt(e.daystostay)),v.data.checkOut=r}else v.data.checkIn=_.getDate(T.checkIn),v.data.checkOut=_.getDate(T.checkOut);i=["calendar-checkIn-hotel","calendar-checkOut-hotel"],o=v.data.checkIn,a=v.data.checkOut,s="checkIn",c="checkOut",l=N.getFirstPathSegment(),u=w.rb?[]:["".concat(y.cloudCdn,"/assets/css/dist/").concat(y.siteName,"/booker.css?id=").concat(+new Date)],P={element:document.getElementById(i[0]),css:u,zIndex:10,grid:2,calendars:2,autoApply:!0,readonly:!0,lang:y.culture,date:o,format:_.mobileAndTabletCheck()&&"hotel"==l?D.formatMobile:D.format,plugins:["RangePlugin","LockPlugin"],LockPlugin:{minDate:k,minDays:2},RangePlugin:{tooltip:!0,startDate:o,endDate:a,tooltipNumber:function(e){return e-1},locale:{one:b.night,other:b.night+"s"}},setup:function(e){e.on("select",(function(e){var t=e.detail,n=t.start,r=t.end;v.data[s]=n.toJSDate(),v.data[c]=r.toJSDate(),v.onSubmit(v.form,!0,"",!0,"recomendacion")})),e.on("view",(function(e){var n=e.detail,r=n.view,i=n.date,o=n.target;if("CalendarDay"===r){var a=v.data.place_selected,s=i.format("YYYY_MM"),c=i.format("YYYY-MM-DD");L[s]=s,A[c]={date:i.format("YYYY-MM-DD"),target:o};var l=t.D.getMemoryDate(s,c,a.code||a.id);l&&t.D.buildElement(A[c],l)}"Main"===r&&(t.D.setFooterElement(o),t.D.footerBuild())})),e.on("show",(function(e){ne(),t.D.overFlow()})),e.on("hide",(function(e){t.D.overFlow(),A={},L={}})),e.on("click",(function(t){e.isCalendarHeaderButton(t.target)&&(A={},L={},setTimeout((function(){ne()}),100)),e.isCalendarDay(t.target)&&setTimeout((function(){ne()}),100)}))}},C=new easepick.create(P);var i,o,a,s,c,l,u}(),V(),(e=d.get(w.historyStorageParam))&&(v.history=e,v.history=v.history.every((function(e){return e.place_selected.hasOwnProperty("city")}))?v.history:[]);for(var n=v.settingPaxes.minAge;n<=v.settingPaxes.maxAge;n++)v.years.push({year:n})}()}window.app.controller("BookerHotelController",m),m.$inject=["$scope","$http","$q","$timeout","localStorageService","$location","$rootScope"]})(),(()=>{"use strict";n(4697);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(o=i.key,a=void 0,a=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(o,"string"),"symbol"===e(a)?a:String(a)),i)}var o,a}var o=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._paxes=t,this._hotelParam=n,this._rateParam=r,this.analytics=window.__pt.fn.analytics,this.events=window.__pt.fn.analytics.events,this.place=window.__pt.place||{},this.booker=window.__pt.box||{},this.settings=window.__pt.settings||{},this.pages=window.__pt.fn.analytics.pages,this.fn=window.__pt.fn||{},this.waitingList=[],this.onRenderCardImageFn(),window.__pt.renderLazyload=this.onRenderCardImage,this.initialize(),this.setCurrentSearch(),this.setViewSearchResult()}var n,r,o;return n=e,r=[{key:"initialize",value:function(){this.date=this.fn.getDate(),this.url="".concat(location.origin).concat(location.pathname),this.url_full="".concat(location.href),this.checkIn=this.fn.getDate(this.booker.checkIn),this.checkOut=this.fn.getDate(this.booker.checkOut),this.days=this.fn.diffBetweenDays(this.checkIn,this.checkOut);var e=t(this.booker.checkIn.split("-"),3);this.CheckInYear=e[0],this.CheckInMon=e[1],this.CheckInDay=e[2];var n=t(this.booker.checkOut.split("-"),3);this.CheckOutYear=n[0],this.CheckOutMon=n[1],this.CheckOutDay=n[2]}},{key:"setCurrentSearch",value:function(){var e={event:this.events.gtmEvent,eventAction:this.events.hotel,eventCategory:"Hotels Search",eventLabel:"".concat(this.place.displayText," | ").concat(this.place.code," | p").concat(this.place.id),eventValue:0};this.analytics.set(this.events.gtmEvent,e)}},{key:"setViewSearchResult",value:function(){var e={event:this.events.trackEvent,eventName:this.events.viewSearchResults,search_term:"".concat(this.place.displayText.toLowerCase()),search_type:this.events.hotel};this.analytics.set(this.events.gtmEvent,e)}},{key:"ad",value:function(e,t,n){var r={event:"ad-skyscraper-".concat(e)};r["adSkyscraper".concat(e)]={adDivId:"ad-skyscraper-".concat(e),destination:this.place.displayText,hotelId:"",hotelStars:"",paymentType:"",placeid:this.place.id,step:this.events.list,product:"ro",productCountry:"",adults:t.adults,kids:t.children,rooms:this.booker.pax.length,nights:this.days,checkinDay:this.CheckInDay,checkinMonth:this.CheckInMon,checkinYear:this.CheckInYear,checkoutDay:this.CheckOutDay,checkoutMonth:this.CheckOutMon,checkoutYear:this.CheckOutYear,campaignToken:n.CampaignToken,profileId:n.profileId},this.analytics.set(this.events.ads,r)}},{key:"selectedFilter",value:function(e,t){var n={event:this.events.trackEvent,eventName:this.events.selectContent,content_type:this.events.filter,element:"".concat(e," :: ").concat(t),layer:this.events.hotels};this.analytics.set(this.events.trackEvent,n)}},{key:"onClickOpenMap",value:function(e){var t={event:this.events.gtmEvent,eventName:this.events.mapOpen,eventCategory:"Hotels Map",eventAction:"open",eventLabel:"".concat(this.place.displayText," | ").concat(this.booker.checkIn," | ").concat(this.booker.checkOut," | ").concat(e.adults," | p").concat(e.children)};this.analytics.set(this.events.hotelistMap,t)}},{key:"onClickMapToDetail",value:function(e){var t={event:this.events.gtmEvent,eventName:this.events.mapOpen,eventCategory:"Hotels Map",eventAction:"opendetail",eventLabel:"".concat(this.place.displayText," | ").concat(this.booker.checkIn," | ").concat(this.booker.checkOut," | ").concat(e.adults," | p").concat(e.children)};this.analytics.set(this.events.hotelistMap,t)}},{key:"onClickImpression",value:function(e){if(["TB","US"].includes(this.settings.site.metricsSuffix))this.viewItemListTB([e],"ga4.".concat(this.events.trackEvent),this.events.selectItem);else{var t=this.impressionBase(e),n={event:this.events.impressionClick,EECImpressionClickList:this.events.hotelList,EECIDestinationUrl:t.EECIImpressionBaseDestinationUrl,EECImpressionImageUrl:t.EECImpressionBaseImageUrl,EECImpressionPlaceText:t.EECImpressionBasePlaceText,EECImpressionProductUrl:t.EECImpressionBaseProductUrl,EECImpressionClickAdults:t.EECImpressionBaseAdults,EECImpressionClickAvailable:t.EECImpressionBaseAvailable,EECImpressionClickCheckin:t.EECImpressionBaseCheckin,EECImpressionClickCheckout:t.EECImpressionBaseCheckout,EECImpressionClickCity:t.EECImpressionBaseCity,EECImpressionClickCountry:t.EECImpressionBaseCountry,EECImpressionClickId:t.EECImpressionBaseId,EECImpressionClickKids:t.EECImpressionBaseKids,EECImpressionClickMealplan:t.EECImpressionBaseMealplan,EECImpressionClickName:t.EECImpressionBaseName,EECImpressionClickNights:t.EECImpressionBaseNights,EECImpressionClickPlaceId:t.EECImpressionBasePlaceId,EECImpressionClickPosition:t.EECImpressionBasePosition,EECImpressionClickProfileId:t.EECImpressionBaseProfileId,EECImpressionClickQuantity:t.EECImpressionBaseQuantity,EECImpressionClickRating:t.EECImpressionBaseRating,EECImpressionClickStars:t.EECImpressionBaseStars,EECImpressionClickState:t.EECImpressionBaseState,EECImpressionClickWeek:t.EECImpressionBaseWeek,EECImpressionClickWeekDay:t.EECImpressionBaseWeekDay};this.selectItem(e),this.analytics.set(this.events.impressionView,n)}}},{key:"onRenderCardImageFn",value:function(){var e=this;this.onRenderCardImage=function(t){var n=window.__pt.hotels||[],r=e.fn.findObject(n,"hotelId",t.dataset.hotel);if(r){var i=e.impressionBase(r),o={EECImpressionViewList:e.events.hotelList,EECIDestinationUrl:i.EECIImpressionBaseDestinationUrl,EECImpressionImageUrl:i.EECImpressionBaseImageUrl,EECImpressionPlaceText:i.EECImpressionBasePlaceText,EECImpressionProductUrl:i.EECImpressionBaseProductUrl,EECImpressionViewAdults:i.EECImpressionBaseAdults,EECImpressionViewAvailable:i.EECImpressionBaseAvailable,EECImpressionViewCheckin:i.EECImpressionBaseCheckin,EECImpressionViewCheckout:i.EECImpressionBaseCheckout,EECImpressionViewCity:i.EECImpressionBaseCity,EECImpressionViewCountry:i.EECImpressionBaseCountry,EECImpressionViewId:i.EECImpressionBaseId,EECImpressionViewKids:i.EECImpressionBaseKids,EECImpressionViewMealplan:i.EECImpressionBaseMealplan,EECImpressionViewName:i.EECImpressionBaseName,EECImpressionViewNights:i.EECImpressionBaseNights,EECImpressionViewPage:i.EECImpressionBasePage,EECImpressionViewPlaceId:i.EECImpressionBasePlaceId,EECImpressionViewPosition:i.EECImpressionBasePosition,EECImpressionViewProfileId:i.EECImpressionBaseProfileId,EECImpressionViewQuantity:i.EECImpressionBaseQuantity,EECImpressionViewRating:i.EECImpressionBaseRating,EECImpressionViewStars:i.EECImpressionBaseStars,EECImpressionViewState:i.EECImpressionBaseState,EECImpressionViewWeek:i.EECImpressionBaseWeek,EECImpressionViewWeekDay:i.EECImpressionBaseWeekDay,EECImpressionViewChannel:i.EEImpressionViewChannel},a={event:e.events.impressionView,EECImpressionViewImpressions:[o]};void 0===r.taxes?e.waitingList.push([r,o]):e.analytics.set(e.events.impressionView,a)}}}},{key:"setEventFilterHotelName",value:function(e,t,n,r){this._paxes;var i={event:this.events.trackEvent,eventName:this.events.selectContent,element:"".concat(this.events.nameHotel," :: ").concat(t),content_type:this.events.filter,field_destination_id:r.id,field_destination_name:r.name,field_hotel_name:n};this.analytics.set(this.events.gtmEvent,i)}},{key:"afterLoadRates",value:function(){var e=this;this.waitingList.map((function(t){t[1].EECImpressionViewAvailable=null!=t[0].taxes;var n={event:e.events.impressionView,EECImpressionViewImpressions:[t[1]]};e.analytics.set(e.events.impressionView,n)})),this.waitingList=[]}},{key:"viewItemList",value:function(e){var t=this;if(["TB","US"].includes(this.settings.site.metricsSuffix))this.viewItemListTB(e,"ga4.".concat(this.events.trackEvent));else if(!window.dataLayer||!window.dataLayer.some((function(e){return e.event===t.events.viewItemList}))){for(var n=e.length,r={event:this.events.viewItemList,ecommerce:{items:[]}},i=0;i<n;i++){var o=e[i],a=this.itemBase(o);r.ecommerce.items.push({item_id:a.itemId,item_name:a.itemName,price:a.price,item_brand:a.itemBrand,item_category:a.itemCategory,item_list_name:a.itemList,index:a.position})}this.analytics.set(this.events.viewItemList,r)}}},{key:"viewItemListTB",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i={event:t,eventName:n?t:this.events.viewItemList,eventParams:{currency:this.settings.site.currency,field_destination:this.place.id,field_date1:this.fn.formatDate(this.checkIn,this.settings.formatDate),field_date2:this.fn.formatDate(this.checkOut,this.settings.formatDate),field_rooms:this.booker.pax.rooms,field_total_nights:this.days,travelers_adults:this.booker.pax.adults,travelers_children:this.booker.pax.children,page_type:this.pages[this.settings.page],layer:this.events.hotels,timestamp:Date.now(),items:[]}},o=0;o<r;o++){var a=e[o],s=this.itemBase(a);i.eventParams.items.push({item_id:s.itemId,item_name:s.itemName,item_brand:s.itemBrand,item_category:s.itemCategory,item_category2:s.itemCategory,item_variant:null,price:s.price,coupon:s.coupon,item_list_name:s.itemList,item_list_id:""})}this.analytics.set(this.events.viewItemList,i)}},{key:"selectItem",value:function(e){var t=this.itemBase(e),n={event:this.events.selectItem,ecommerce:{items:[{item_id:t.itemId,item_name:t.itemName,price:t.price,item_brand:t.itemBrand,item_category:t.itemCategory,item_list_name:t.itemList,index:t.position}],currency:this.settings.site.currency,item_list_name:this.place.name,item_list_id:this.place.id}};this.analytics.set(this.events.selectItem,n)}},{key:"itemBase",value:function(e){return{itemId:e.hotelId,itemName:e.name,price:e.price||0,itemBrand:e.uri,itemCategory:this.settings.page,itemList:this.place.name,position:e.position,coupon:e.taxes?e.taxes.promotionId:null}}},{key:"impressionBase",value:function(e){var t=this._rateParam,n=this._paxes,r=this._hotelParam,i=e||{};return{EECIImpressionBaseDestinationUrl:this.url,EECImpressionBaseImageUrl:i.mainPhoto&&i.mainPhoto.cloudUri,EECImpressionBasePlaceText:this.place.displayText,EECImpressionBaseProductUrl:i.url,EECImpressionBaseAdults:n.adults,EECImpressionBaseAvailable:null!=i.taxes,EECImpressionBaseCheckin:r.checkIn,EECImpressionBaseCheckout:r.checkOut,EECImpressionBaseCity:i.locationInfo&&i.locationInfo.city,EECImpressionBaseCountry:i.locationInfo&&i.locationInfo.country,EECImpressionBaseId:i.hotelId,EECImpressionBaseKids:n.children,EECImpressionBaseMealplan:"",EECImpressionBaseName:i.name,EECImpressionBaseNights:this.days,EECImpressionBasePage:i.page,EECImpressionBasePlaceId:this.place.id,EECImpressionBasePosition:i.position,EECImpressionBaseProfileId:t.profileId||"",EECImpressionBaseQuantity:n.paxesFormat.length,EECImpressionBaseRating:2*(i.surveyAverage&&i.surveyAverage.averageValue||0),EECImpressionBaseStars:i.stars,EECImpressionBaseState:i.locationInfo&&i.locationInfo.state,EECImpressionBaseWeek:this.date.getDate(),EECImpressionBaseWeekDay:this.date.getDay(),EEImpressionViewChannel:this.settings.site.channelFac}}},{key:"orderEvent",value:function(e){var t={event:this.events.trackEvent,eventName:"select_content",content_type:this.events.button,element:"ordertype :: ".concat({"order-price|desc":"mayor_menor","order-price|asc":"menor_mayor","recommended|desc":"recomendacion"}[e]),layer:this.events.hotels,page_type:this.pages[this.settings.page]};this.analytics.set(this.events.trackEvent,t)}},{key:"errorQuote",value:function(e,t){var n=e?e.guid||"":"NA",r=JSON.stringify(e||{}),i=this._hotelParam,o=this._paxes,a={event:this.events.errorQuote,eq_destination:this.place.displayText,eq_arrival:i.checkIn,eq_departure:i.checkOut,eq_adults:o.adults,eq_children:o.children,eq_detail:r,eq_step:t,eq_guid:n,eq_path:this.url,eq_url:this.url_full};this.analytics.set(this.events.errorQuote,a)}},{key:"selectDateSuggested",value:function(e){var t=this._paxes,n={event:"ga4.".concat(this.events.trackEvent),eventName:this.events.selectContent,eventParams:{element:"available_dates:: <<".concat(e.CheckIn,"|").concat(e.CheckOut,">"),field_date1:e.CheckIn,field_date2:e.CheckOut,field_hotel_name:e.hotelName,travelers_adults:t.adults,travelers_children:t.paxes.children,field_hotel_id:e.hotelId,field_rooms:this.booker.pax.rooms,page_type:this.pages[this.settings.page],layer:this.events.hotels,content_type:this.events.button}};this.analytics.set(this.events.gtmEvent,n)}}],r&&i(n.prototype,r),o&&i(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}();function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,o=void 0,o=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===a(o)?o:String(o)),r)}var i,o}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.analytics=window.__pt.fn.analytics,this.settings=window.__pt.settings,this.events=window.__pt.fn.analytics.events}var t,n,r;return t=e,(n=[{key:"clickLink",value:function(e){var t={content_type:this.events.link,element:e,event:this.events.trackEvent,eventName:this.events.selectContent,layer:this.settings.page};this.analytics.set(t.event,t)}},{key:"selectContent",value:function(e,t){var n={content_type:this.events.button,element:"".concat(e," :: ").concat(t),event:this.events.trackEvent,eventName:this.events.selectContent,layer:this.settings.page};this.analytics.set(n.event,n)}}])&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var u=["OverlayView"];function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,o=void 0,o=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===l(o)?o:String(o)),r)}var i,o}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m(e);if(t){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}function f(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var g=function(e){var t=e.OverlayView,n=void 0===t?google.maps.OverlayView:t,r=v(e,u);return new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(a,e);var t,n,i,o=p(a);function a(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this)).id=r.id,e.uri=r.uri,e.wellId=r.hotelId,e.latlng=r.latlng,e.name=r.name,e.stars=r.stars,e.cloudUri=r.cloudUri,e.surveyAverage=r.surveyAverage,e.price=r.price,e.beforePromo=r.beforePromo,e.discount=r.discount,e.showPromotion=r.showPromotion,e.showHotSBlackFri=r.showHotSBlackFri,e.tax=r.tax,e.html=r.html,e.highlightedAttributes=r.highlightedAttributes,e.setMap(r.map),e}return t=a,(n=[{key:"createDiv",value:function(){var e=this;this.div=document.createElement("div"),this.div.style.position="absolute",this.html&&(this.div.innerHTML=this.html),google.maps.event.addDomListener(this.div,"click",(function(t){google.maps.event.trigger(e,"click")}))}},{key:"update",value:function(e){this.div?this.div.innerHTML=e:console.warn("createDiv() has not been called on this point",this)}},{key:"appendDivToOverlay",value:function(){this.getPanes().overlayImage.appendChild(this.div)}},{key:"positionDiv",value:function(){var e=this.getProjection().fromLatLngToDivPixel(this.latlng);e&&(this.div.style.left="".concat(e.x-25,"px"),this.div.style.top="".concat(e.y-25,"px"))}},{key:"draw",value:function(){this.div||(this.createDiv(),this.appendDivToOverlay()),this.positionDiv()}},{key:"remove",value:function(){this.div&&(this.div.parentNode.removeChild(this.div),this.div=null)}},{key:"getPosition",value:function(){return this.latlng}},{key:"getDraggable",value:function(){return!1}},{key:"getVisible",value:function(){return!0}}])&&h(t.prototype,n),i&&h(t,i),Object.defineProperty(t,"prototype",{writable:!1}),a}(n))},y={reviews_cexcellent:"reviews_cexcellent"};function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function b(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,o=void 0,o=function(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===w(o)?o:String(o)),r)}var i,o}var I=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.paramQuery=t,this.config=n,this.place=window.__pt.place||{},this.separator=r}var t,n,r;return t=e,n=[{key:"getExternalAvailability",value:function(){var e=!0,t=this.paramQuery.getexternalavailability||null;return null!=t?e=t:this.place&&this.place.locationInfo&&this.config.externalAvailability&&(e=-1==this.config.externalAvailability.indexOf(this.place.locationInfo.countryA2))&&(e=-1==this.config.externalAvailability.indexOf(this.place.locationInfo.countryISO)),e}},{key:"groupItems",value:function(e,t){for(var n=[],r=0,i=t,o=0;o<e.length;o++)window.angular.isUndefined(n[r])&&(n[r]=[]),n[r].push(e[o]),(o+1)%i==0&&i==t&&(i*=this.config.listItemsCount,r++);return n}},{key:"buildPaginator",value:function(e,t,n){var r={currentPage:n};if(r.totalPages=Math.ceil(e/this.config.listItemsCount),r.buttons=Array.from({length:r.totalPages},(function(e,t){return t+1})),r.startPage=1+18*r.currentPage,r.endPage=r.startPage+t-1,r.endPage>r.totalHotels&&(r.endPage=r.totalHotels),r.totalPages<=4)return r.render=r.buttons,r;if(r.render=[],r.currentPage<3)r.render=r.buttons.slice(0,4),r.render.push(this.separator),r.render.push(r.totalPages);else if(r.currentPage>r.totalPages-4){var i;r.render.push(r.buttons[0]),r.render.push(this.separator),(i=r.render).push.apply(i,b(r.buttons.slice(r.totalPages-4,r.totalPages)))}else{var o;r.render.push(r.buttons[0]),r.render.push(this.separator),(o=r.render).push.apply(o,b(r.buttons.slice(r.currentPage-1,r.currentPage+2))),r.render.push(this.separator),r.render.push(r.totalPages)}return r}},{key:"ptUsaProvisionalOrder",value:function(e){var t=e.findIndex((function(e){return"without category"===e.display}));if(t>-1){var n=e[t];return n.display="Unrated",e.splice(t,1),e.push(n),e}return e}},{key:"getUrlToDetail",value:function(e,t){return"".concat(this.config.siteUrl).concat(this.config.pathHotelDetail).concat(e.uri,"?").concat(t)}},{key:"getHotelsIds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((function(e){return e.hotelId}))}},{key:"setIsSelectCustomFilter",value:function(e){var t=[];return e&&(t=e.map((function(e,t){var n=e.filters?e.filters.find((function(e){return e.isSelected})):null;if(e.isSelected=!n,"reviews"===e.uri){var r=e.filters.find((function(e){return"reviews_bverygood"===e.display})),i=e.filters.find((function(e){return"reviews_cexcellent"===e.display}));r&&i&&(r.total+=i.total),e.filters=e.filters.filter((function(e){return!y[e.display]}))}return e}))),t}}],n&&k(t.prototype,n),r&&k(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),E=n(7066),S={wireless_internet:{es:"Internet inalámbrico",en:"Wireless internet",order:1,icon:"icons-internet",highlited:!1},internet:{es:"Internet",en:"Internet",order:1,icon:"icons-internet",highlited:!1},high_speed_wifi:{es:"Internet inalámbrico de alta velocidad",en:"High-speed WiFi",order:1,icon:"icons-internet",highlited:!1},beach:{es:"Playa",en:"Beach",order:2,icon:"icons-beach-club",highlited:!1},parking:{es:"Estacionamiento",en:"Parking",order:3,icon:"icons-parking",highlited:!1},beach_club:{es:"Club de playa",en:"Beach club",order:2,icon:"icons-beach-club",highlited:!1},pool:{es:"Piscina",en:"Pool",order:4,icon:"icons-pool1",highlited:!1},fitness_center:{es:"Gimnasio",en:"Fitness center",order:5,icon:"icons-fitness-center",highlited:!1},spa:{es:"Spa",en:"Spa",order:6,icon:"icons-spa",highlited:!1},spa_services:{es:"Servicios de spa",en:"Spa services",order:6,icon:"icons-spa",highlited:!1},childrens_area:{es:"Área para niños",en:"Children's area",order:7,icon:"icons-childrens-club",highlited:!1},childrens_club:{es:"Club de niños",en:"Children's club",order:7,icon:"icons-childrens-club",highlited:!1},childrens_activities:{es:"Actividades para niños",en:"Children's activities",order:7,icon:"icons-childrens-club",highlited:!1},accessible_rooms:{es:"Habitaciones para personas con discapacidad",en:"Accessible rooms",order:8,icon:"icons-accessible-rooms",highlited:!1},pets:{es:"Acepta Mascotas",en:"Pets accepted",order:9,icon:"icons-pets",highlited:!1}};function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}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 x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e,t,n){return(t=R(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(){A=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new S(i||[]);return r(a,"_invoke",{value:_(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h={};function d(){}function p(){}function f(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(C([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=f.prototype=d.prototype=Object.create(m);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var c=u(e[r],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==P(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return i("throw",e,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function k(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=u(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=f,r(y,"constructor",{value:f,configurable:!0}),r(f,"constructor",{value:p,configurable:!0}),p.displayName=c(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},w(b.prototype),c(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(y),c(y,s,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=C,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function L(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function N(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){L(o,r,i,a,s,"next",e)}function s(e){L(o,r,i,a,s,"throw",e)}a(void 0)}))}}function j(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,R(r.key),r)}}function R(e){var t=function(e,t){if("object"!==P(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===P(t)?t:String(t)}var F=function(){function e(t,n,r,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a=window.__pt.settings.site;this.vm=t,this.http=n,this.filter=r,this.scope=i,this.fn=window.__pt.fn,this.config=window.__pt.settings.site,this.settings=window.__pt.settings,this.box=window.__pt.box,this.markers=[],this.params={},this.paramsRates={},this.paramsFilter={},this.paxes={},this.map=null,this._userKeyFac=o,this.showServices=a.showServices}var t,n,r,i,o,a;return t=e,n=[{key:"initialize",value:function(){this.hotels=[],this.rates=[],this.itemsHotel=null,this.vm.showMapDetail=!1,this.vm.detailCardMap={},this.vm.loading_refresh_map=null,this.onRenderMap()&&this.getHotels(),this.clearMarkers()}},{key:"openMap",value:function(e,t,n,r,i){$("#modal-mapsearch").modal("show"),this.params=e,this.paramsRates=t,this.paxes=n,this.campaignToken=r,this.paramsFilter=i,this.initialize(),this._listUtil=new I(e,this.config,"...")}},{key:"getHotels",value:(a=N(A().mark((function e(){var t,n,r;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.vm.loading=!0,t=this.fn.clone(this.paramsFilter),this.paxes.paxesFormat.join("/"),n=(0,E.w)(),t.page=1,t.pageSize=this.config.listItemsMapCount,t.filters=this.vm.filtersSelectedArrayString.join(","),t.filters=this.vm.filtersSelectedArrayString.join(","),t.filtersCustom=this.vm.filterCustomList.map((function(e){return e.uri})).join(","),e.next=11,this.http.get(this.config.endPoints.filterUrl,{params:t,headers:n});case 11:(r=e.sent)&&r.data&&r.data.hotels&&(this.hotels=r.data.hotels,this.vm.pagination.totalHotels=r.data.totalHotels,this.vm.onLoadFilters(r.data.filterGroups),this.vm.hotelFilters.filterCustoms.filterGroups=this._listUtil.setIsSelectCustomFilter(r.data.filterCustoms.filterGroups)),this.vm.loading=!1,this.getRates();case 15:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getRates",value:(o=N(A().mark((function e(){var t=this;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.vm.loading_refresh_map=!0,this.scope.$apply((function(){t.vm.no_result_map=!0})),this.createUrlDetail(),this.centerMap(),this.scope.$apply((function(){t.vm.loading_refresh_map=!1}));case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"createUrlDetail",value:function(){var e=this.hotels.length,t=this.fn.mapPaxToUrl(this.box.pax),n={checkin:this.box.checkIn,checkout:this.box.checkOut};n=x(x({},n),t),this.campaignToken&&(n.CampaignToken=this.campaignToken);for(var r=this.fn.objectToQueryParams(n),i=0;i<e;i++){var o=this.hotels[i];o.url="".concat(this.config.siteUrl).concat(this.config.pathHotelDetail).concat(o.uri,"?").concat(r)}}},{key:"onRenderMap",value:function(){var e=this,t={lat:35.275,lng:-96.624};return"google"in window&&google.maps?(this.initializeGoogleMap(t,4),!0):(this.fn.getScript(this.config.endPoints.googleMapsApi,"",(function(){e.initializeGoogleMap(t,4),e.getHotels()})),!1)}},{key:"centerMap",value:(i=N(A().mark((function e(){var t,n,r,i,o=this;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=function(e,t){this.latitude=e,this.longitude=t},r=function(e){var t=Math.floor(.5*e.length);e.sort((function(e,t){return e.longitude-t.longitude}));var n=e[t];e.sort((function(e,t){return e.latitude-t.latitude}));var r=e[t],o=(r.latitude+n.latitude)/2,a=(r.longitude+n.longitude)/2;return new i(o,a)},this.itemsHotel=[],this.updateHotelTags(this.hotels),0!==(t=this.hotels.filter((function(e){return e.price})).map((function(e){var t,n=parseFloat(e.locationInfo.latitude),r=parseFloat(e.locationInfo.longitude);return o.itemsHotel.push((D(t={id:e.hotelId,url:e.url,name:e.name,price:e.price},"name",e.name),D(t,"latitude",n),D(t,"longitude",r),D(t,"cloudUri",e.mainPhoto.cloudUri),D(t,"stars",Math.round(e.stars)),D(t,"surveyAverage",e.surveyAverage),D(t,"highlightedAttributes",e.highlights),D(t,"showPromotion",e.showPromotion),D(t,"showHotSBlackFri",e.showHotSBlackFri),D(t,"taxes",e.taxes),D(t,"services",e.services),t)),{latitude:n,longitude:r}}))).length){e.next=8;break}return console.error("No valid points found for centering the map."),e.abrupt("return");case 8:return n=r(t),e.next=11,this.vm.getUSersFavorites();case 11:this.initializeMap(n.latitude,n.longitude,this.itemsHotel),this.scope.$apply((function(){o.vm.no_result_map=o.itemsHotel.length}));case 13:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"initializeMap",value:function(e,t,n){var r=this,i={lat:e,lng:t};this.initializeGoogleMap(i),this.markers=n.map((function(e){console.log(r.vm.isFavoriteHotel(e.id)),console.log("Nombre del hotel: ",e.name);var t=new google.maps.LatLng(e.latitude,e.longitude),n=g({latlng:t,map:r.map,id:e.id,uri:e.uri,wellId:e.id,name:e.name,price:e.price,discount:e.discount,beforePromo:e.beforePromo,tax:e.taxPerRoomPerNight,cloudUri:e.cloudUri,stars:Math.round(e.stars),surveyAverage:e.surveyAverage,highlightedAttributes:e.highlightedAttributes,showPromotion:e.showPromotion,showHotSBlackFri:e.showHotSBlackFri,url:e.url,taxes:e.taxes,html:'<div id="hotel_bubble_'.concat(e.id,'" class="speech-bubble">\n                    ').concat(r.vm.isFavoriteHotel(e.id)?' <i class="icons-heart d-inline-flex"></i>':"","\n                    ").concat(r.filter("currency")(e.price,r.config.currencySymbol,0)," \n                </div>")});return n.addListener("click",(function(){r.clearBubble(),$("#hotel_bubble_".concat(e.id)).addClass("speech-bubble-active"),r.vm.showMapDetailCard=!!r.vm.detailCardMap.show,r.scope.$apply((function(){r.vm.detailCardMap.id=n.id,r.vm.detailCardMap.name=n.name,r.vm.detailCardMap.stars=n.stars,r.vm.detailCardMap.cloudUri=e.cloudUri,r.vm.detailCardMap.surveyAverage=n.surveyAverage,r.vm.detailCardMap.price=n.price,r.vm.detailCardMap.discount=n.discount,r.vm.detailCardMap.beforePromo=n.beforePromo,r.vm.detailCardMap.taxPerRoomPerNight=n.tax,r.vm.detailCardMap.showPromotion=n.showPromotion,r.vm.detailCardMap.showHotSBlackFri=n.showHotSBlackFri,r.vm.detailCardMap.highlights=n.highlightedAttributes,r.vm.detailCardMap.url=e.url,r.vm.detailCardMap.taxes=e.taxes,r.vm.detailCardMap.isFavorite=r.vm.isFavoriteHotel(n.id),r.vm.detailCardMap.show=!0,r.vm.detailCardMap.services=e.services,setTimeout((function(){$("#image-map-card").css("background-image","url("+e.cloudUri+")")}),200)}))})),n}))}},{key:"clearMarkers",value:function(){for(var e=this.markers.length,t=0;t<e;t++)this.markers[t].setMap(null);this.markers=new Array}},{key:"clearBubble",value:function(){$(".speech-bubble.rounded.speech-bubble-active").removeClass("speech-bubble-active")}},{key:"initializeGoogleMap",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;this.map=new window.google.maps.Map(document.getElementById("map"),{zoom:t,center:e,disableDefaultUI:!0,zoomControl:!0,gestureHandling:"greedy",styles:[{featureType:"poi.business",stylers:[{visibility:"off"}]}]})}},{key:"updateHotelTags",value:function(e){var t=this;e.forEach((function(e){e.services&&Array.isArray(e.services)&&(e.services=e.services.map((function(e){return t.findReviewByText(e.name)})).filter(Boolean).sort((function(e,t){return e.order-t.order})).reduce((function(e,t){return e.some((function(e){return e.order===t.order}))||e.push(t),e}),[]).slice(0,3).map((function(e){return 1===e.order&&(e.text="Wi-fi"),e})))}))}},{key:"findReviewByText",value:function(e){for(var t=0,n=Object.entries(S);t<n.length;t++){var r=C(n[t],2),i=r[0],o=r[1];if(o.es.toLocaleLowerCase().includes(e.toLocaleLowerCase())||o.en.toLocaleLowerCase().includes(e.toLocaleLowerCase()))return x({key:i,text:"es"===this.config.language?o.es:o.en},o)}return null}}],n&&j(t.prototype,n),r&&j(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),M=n(694);function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function B(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 H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function V(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==U(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==U(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===U(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.adults,i=e.children,o=e.rooms,a=i.length,s=n?G({adults:r,kids:a,kidsSlit:i,rooms:t?1:o}):z({adults:r,kids:a,kidsSlit:i,rooms:t?1:o});return s.distribution||(s.distribution=[],s.distribution.push("".concat(r).concat(i.length>0?"|":"").concat(i.map((function(e){return null==e?void 0:e.year})).join(",")))),{paxes:{adults:r,children:i,rooms:o},adults:r,children:a,paxesFormat:s.distribution,roomExtra:s.roomExtra}}function z(e){var t=e.adults,n=e.kids,r=e.kidsSlit;return W(t,n,e.rooms,r)}function G(e){var t,n,r,i,o,a,s,c,l,u,h,d,p,f,m,v,g,y,w,b,_,k,I,E,S,P,C,O,T,x,D,A,L,N,j=e.adults,R=e.kids,F=e.kidsSlit,M=e.rooms,U={"2x2":["1|".concat(null===(t=F[0])||void 0===t?void 0:t.year),"1|".concat(null===(n=F[1])||void 0===n?void 0:n.year)],"2x3":["1|".concat(null===(r=F[0])||void 0===r?void 0:r.year),"1|".concat(null===(i=F[1])||void 0===i?void 0:i.year,",").concat(null===(o=F[2])||void 0===o?void 0:o.year)],"3x1":["2","1|".concat(null===(a=F[0])||void 0===a?void 0:a.year)],"3x2":["2|".concat(null===(s=F[0])||void 0===s?void 0:s.year),"1|".concat(null===(c=F[1])||void 0===c?void 0:c.year)],"3x3":["2|".concat(null===(l=F[0])||void 0===l?void 0:l.year,",").concat(null===(u=F[1])||void 0===u?void 0:u.year),"1|".concat(null===(h=F[2])||void 0===h?void 0:h.year)],"2x4":["1|".concat(null===(d=F[0])||void 0===d?void 0:d.year,",").concat(null===(p=F[1])||void 0===p?void 0:p.year),"1|".concat(null===(f=F[2])||void 0===f?void 0:f.year,",").concat(null===(m=F[3])||void 0===m?void 0:m.year)],"3x4":["2|".concat(null===(v=F[0])||void 0===v?void 0:v.year,",").concat(null===(g=F[1])||void 0===g?void 0:g.year),"1|".concat(null===(y=F[2])||void 0===y?void 0:y.year,",").concat(null===(w=F[3])||void 0===w?void 0:w.year)],"4x4":["2|".concat(null===(b=F[0])||void 0===b?void 0:b.year,",").concat(null===(_=F[1])||void 0===_?void 0:_.year),"2|".concat(null===(k=F[2])||void 0===k?void 0:k.year,",").concat(null===(I=F[3])||void 0===I?void 0:I.year)],"5x0":["3","2"],"5x1":["3","2|".concat(null===(E=F[0])||void 0===E?void 0:E.year)],"5x2":["3|".concat(null===(S=F[0])||void 0===S?void 0:S.year),"2|".concat(null===(P=F[1])||void 0===P?void 0:P.year)],"4x2":["2|".concat(null===(C=F[0])||void 0===C?void 0:C.year),"2|".concat(null===(O=F[1])||void 0===O?void 0:O.year)],"6x0":["3","3"],"6x1":["2","2","2|".concat(null===(T=F[0])||void 0===T?void 0:T.year)],"7x1":["3","2","2|".concat(null===(x=F[0])||void 0===x?void 0:x.year)],"7x2":["3","2|".concat(null===(D=F[0])||void 0===D?void 0:D.year),"2|".concat(null===(A=F[1])||void 0===A?void 0:A.year)],"8x2":["3","3|".concat(null===(L=F[0])||void 0===L?void 0:L.year),"2|".concat(null===(N=F[1])||void 0===N?void 0:N.year)],"8x0":["4","4"]};return{distribution:U["".concat(j,"x").concat(R)]?U["".concat(j,"x").concat(R)]:null,roomExtra:W(j,R,M,F).roomExtra}}function W(e,t,n,r){var i=!1;if(0===e)return["No hay adultos para distribuir."];for(var o=Math.ceil(e/n),a=Math.ceil(t/n),s=e,c=Math.ceil(t%n),l=[],u=0;u<n;u++){var h=[];if(s>0?(h.push(o),s-=o):(h.push(o+1),i=!0),e/n%2!=0&&(o=Math.ceil(s/(n-(0==l.length?1:l.length+1)))),c>0){var d=r.slice(u*a).slice(0,a).map((function(e){return null==e?void 0:e.year}));d.length>0&&(h.push(d.join(",")),c--)}else{var p=r.slice(u*a).slice(0,a).map((function(e){return null==e?void 0:e.year}));p.length>0&&h.push(p.join(","))}h.length>0&&l.push(h.join("|"))}for(;l.length<n;)l.push("1"),i=!0;return{distribution:l,roomExtra:i}}function K(e){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(e)}function Y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,o=void 0,o=function(e,t){if("object"!==K(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==K(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===K(o)?o:String(o)),r)}var i,o}var J=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fn=window.__pt.fn||{};var n=new M.Z;this._userKey=n.getUserKey(t)}var t,n,r;return t=e,(n=[{key:"clickedObjectIDsAfterSearch",value:function(e,t,n){if(window.aa){var r={userToken:this._userKey,eventType:"click",index:t,eventName:"Hit Clicked",queryID:n.queryId,objectIDs:e,positions:[n.position]};return window.aa("clickedObjectIDsAfterSearch",r),r}}},{key:"clickedObjectIDs",value:function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items,r=n.queryID,i=n.objectID,o={userToken:this._userKey,authenticatedUserToken:"",index:config.algoliaSearch,eventName:"Buscador Click",queryID:r,objectIDs:[i]};window.aa("clickedObjectIDs",o)}}},{key:"clickedFilters",value:function(e,t,n){window.aa&&window.aa("clickedFilters",{userToken:this._userKey,index:e,eventName:n+" Clicked",filters:t})}},{key:"viewedFilters",value:function(e,t,n){window.aa&&aa("viewedFilters",{userToken:this._userKey,index:e,eventName:n+" Viewed",filters:t})}},{key:"convertedObjectIDsAfterSearch",value:function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items.objectID,r=e.items.queryID;window.aa("convertedObjectIDsAfterSearch",{userToken:this._userKey,authenticatedUserToken:"",index:config.algoliaSearch,eventName:"Buscador Click",queryID:r,objectIDs:[n]})}}},{key:"convertedObjectIDs",value:function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items.objectID;e.items.queryID,window.aa("convertedObjectIDs",{userToken:this._userKey,authenticatedUserToken:"",index:config.algoliaSearch,eventName:"Buscador Click",objectIDs:[n]})}}},{key:"convertedFilters",value:function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items.objectID;e.items.queryID,window.aa("convertedFilters",{userToken:this._userKey,authenticatedUserToken:"",index:config.algoliaSearch,eventName:"Buscador Click",filters:[n]})}}},{key:"addedToCartObjectIDsAfterSearch",value:function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items.objectID,r=e.items.queryID;window.aa("addedToCartObjectIDsAfterSearch",{userToken:this._userKey,authenticatedUserToken:"",eventName:"Buscador Click",index:config.algoliaSearch,queryID:r,objectIDs:[n],objectData:[n],value:"",currency:""})}}},{key:"addedToCartObjectIDs",value:function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items.objectID,r=e.items.queryID;window.aa("addedToCartObjectIDs",{userToken:this._userKey,authenticatedUserToken:"",eventName:"Buscador Click",index:config.algoliaSearch,queryID:r,objectIDs:[n],objectData:[n],value:"",currency:""})}}},{key:"purchasedObjectIDsAfterSearch",value:function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items.objectID,r=e.items.queryID;window.aa("purchasedObjectIDsAfterSearch",{userToken:this._userKey,authenticatedUserToken:"",eventName:"Buscador Click",index:config.algoliaSearch,queryID:r,objectIDs:[n],objectData:[n],value:"",currency:""})}}},{key:"purchasedObjectIDs",value:function(e,t){if(e&&e.items&&e.items.queryID&&e.items.objectID&&window.aa){var n=e.items.objectID,r=e.items.queryID;window.aa("purchasedObjectIDs",{userToken:this._userKey,authenticatedUserToken:"",eventName:"Buscador Click",index:config.algoliaSearch,queryID:r,objectIDs:[n],objectData:[n],value:"",currency:""})}}},{key:"viewedObjectIDs",value:function(e,t){window.aa&&window.aa("viewedObjectIDs",{userToken:this._userKey,eventName:"Hits Viewed",eventType:"view",index:t,objectIDs:e})}},{key:"trackEvent",value:function(e,t){window.aa&&window.aa(e,t)}}])&&Y(t.prototype,n),r&&Y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Q=n(2805),X={es:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],en:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Z={es:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],en:["January","February","March","April","May","June","July","August","September","October","November","December"]};function ee(e,t){var n=new Date(e),r=X[t][n.getUTCDay()],i=n.getUTCDate(),o=Z[t][n.getUTCMonth()];return{dayOfWeek:r,dayAndMonth:"es"===t?"".concat(i," ").concat(o):"".concat(o," ").concat(i," ")}}function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function ne(){ne=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new S(i||[]);return r(a,"_invoke",{value:_(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h={};function d(){}function p(){}function f(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(P([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=f.prototype=d.prototype=Object.create(m);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var c=u(e[r],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==te(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return i("throw",e,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function k(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=u(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function P(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return p.prototype=f,r(y,"constructor",{value:f,configurable:!0}),r(f,"constructor",{value:p,configurable:!0}),p.displayName=c(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},w(b.prototype),c(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(y),c(y,s,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=P,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:P(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function re(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 ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oe(e,t,n){return(t=le(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ae(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function se(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ae(o,r,i,a,s,"next",e)}function s(e){ae(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,le(r.key),r)}}function le(e){var t=function(e,t){if("object"!==te(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==te(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===te(t)?t:String(t)}var ue=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.analytics=window.__pt.fn.analytics,this.settings=window.__pt.settings,this.events=window.__pt.fn.analytics.events,this.pages=window.__pt.fn.analytics.pages,this.fn=window.__pt.fn||{}}var t,n,r,i,o,a,s;return t=e,n=[{key:"logAddFav",value:(s=se(ne().mark((function e(t,n){var r;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={event:this.events.trackEvent,layer:"hoteles",content_type:n.toString(),search_type:t.uri||"",element:"".concat(t.id," :: ").concat(t.name)},this.analytics.set(this.events.gtmEvent,ie({eventName:"favs_add"},r));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"logDeleteFav",value:(a=se(ne().mark((function e(t,n){var r;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={event:this.events.trackEvent,layer:"hoteles",content_type:n.toString(),element:"".concat(t.id," :: ").concat(t.name)},this.analytics.set(this.events.gtmEvent,ie({eventName:"favs_delete"},r));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"logOpenFav",value:(o=se(ne().mark((function e(t,n,r){var i,o,a,s;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.checkin?this.fn.getDate(t.checkin):"",o=t.checkout?this.fn.getDate(t.checkout):"",a="=",t.totalRoomRatePerNight<t.originalPrice?a="bajó":t.totalRoomRatePerNight>t.originalPrice&&(a="subió"),s={event:this.events.trackEvent,layer:"hoteles",content_type:n.toString(),element:"".concat(t.id," :: ").concat(t.name),field_date1:i,field_date2:o,extra_info:"".concat(a," :: ").concat(r)},this.analytics.set(this.events.gtmEvent,ie({eventName:"favs_open_item"},s));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"logOpenFavsList",value:(i=se(ne().mark((function e(t,n){var r;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={event:this.events.trackEvent,layer:"hoteles",content_type:t.toString(),element:"".concat(n)},this.analytics.set(this.events.gtmEvent,ie({eventName:"favs_open_list"},r));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})}],n&&ce(t.prototype,n),r&&ce(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function de(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||me(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(){pe=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new S(i||[]);return r(a,"_invoke",{value:_(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h={};function d(){}function p(){}function f(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(P([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=f.prototype=d.prototype=Object.create(m);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var c=u(e[r],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==he(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return i("throw",e,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function k(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=u(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function P(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return p.prototype=f,r(y,"constructor",{value:f,configurable:!0}),r(f,"constructor",{value:p,configurable:!0}),p.displayName=c(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},w(b.prototype),c(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(y),c(y,s,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=P,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:P(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function fe(e){return function(e){if(Array.isArray(e))return ve(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||me(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function me(e,t){if(e){if("string"==typeof e)return ve(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ve(e,t):void 0}}function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ge(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function ye(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 we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach((function(t){be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function be(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==he(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===he(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e,t,n,r,i,a,s,l){var u,h=window.__pt.settings.site,d=this,p=window.__pt.fn,f=window.__pt.settings,m=window.__pt.place||{},v=window.__pt.box||{},g=window.__pt.hotelResponse||{},y=window.__pt.ln||{},w={},b={},_={},k={},P=null,C="",O="",T=null,x=window.__pt.user||null,D=!!x,A=p.search(),L=new I(A,h,"..."),N=new M.Z(A,h),j=N.getUserKey(i),R=N.getUserKeyFavorites(i),U=null,B=new c,V=new J(i),z=p.mobileAndTabletCheck(),G=!1,W={},K=["slick-next","slick-prev"],Y=!1,X=!1,Z=null,te=null,ne=null,re={loaded:!1,data:{}},ie=q(v.pax),oe={from:"",site:h.domain,ids:"",countryCode:h.country.toUpperCase(),format:!1,cache:f.rb,CampaignToken:P,profileId:null},ae=(be(u={culture:h.culture,pageSize:h.listItemsCount,organizationId:h.organization,propertyId:h.property,getFilters:!0,filters:null,placeId:null,currentPage:+v.page,page:+v.page,site:h.site,countryCode:h.country.toUpperCase(),format:!1,cache:f.rb,placeName:m.displayText},"placeId",m.id),be(u,"checkIn",v.checkIn),be(u,"checkOut",v.checkOut),be(u,"profileId",null),be(u,"filters",null),be(u,"pax",""),u),se=new ue,ce={checkInDate:ae.checkIn,checkOutDate:ae.checkOut,placeId:m.id,adultQuantity:0,kidQuantity:0,hotelId:0,stepId:2};d.keyPosition=0;var le="";d.suggestionSearchHotel={from:{results:[],show:!1}},d.placeInputHasFocus=!1;var he=null;d.showServices=h.showServices,d.code=h.code,d.hotels=[],d.isActive=void 0,d.mealplans=y.mealplans,d.loading=!0,d.loadingRefresh=!1,d.showMapDetail=!1,d.onRendeCenter=!1,d.loadingRates=!0,d.showAd=!1,d.hasError=!1,d.mapContent=!0,d.notQuote=!1,d.filters=[],d.filtersSelectedArray=[],d.filterCustomList=[],d.filtersSelectedArrayString=v.filters||[],d.currency=h.currencySymbol||"",d.currencyList=h.currencySymbolList||"",d.currencyFormat=h.currencySymbol||"",d.phoneBase=h.phoneDefault||"",d.profileId=null,d.input_hotel_name=v.hotel_name||"",d.label_hotel_name=v.hotel_name||"",d.title="",d.monthInterestData={},d.mealplans=y.mealplans,d.dataTotalCapacity=0,d.paxData={},d.showMapDetailCard=!1,d.filterUpDown=!1,d.nightsList=0,d.pricesSelected=[],d.user=x,d.toggleRange=!0,d.rangeApplyState=!1,d.toggleOrderBy=!1,d.togglePopularFilter=!0,d.textOrderBy="",d.limitFilterGroup=3,d._isLogin=D,d.popularFilters=null,d.detailCardMap={id:"",name:"",stars:0,discount:0,cloudUri:"",surveyAverage:"",highlightedAttributes:"",price:"",tax:"",showPromotion:!1,showHotSBlackFri:!1,highlights:[],rooms:0,isFavorite:!1,services:[]},d.paramsFilter={cache:!1,countryCode:h.country.toUpperCase(),culture:h.culture,filters:null,format:!1,getFilters:!0,hotelName:null,organizationId:h.organization,pageSize:h.listItemsCount,currentPage:+v.page,page:+v.page,placeName:m.displayText,placeId:m.id,propertyId:h.property,site:h.domain,responseTimeout:2e4,totalHotels:g.totalHotels,CampaignToken:P,uri:m.name},d.config={limitTextHighlight:h.limitTextHighlight,limitHighlightElement:h.limitHighlightElement},d.pagination={currentPage:ae.page-1,totalPages:0,startPage:0,endPage:0,breaker:0,selected:0,buttons:[],render:[],pageSize:h.listItemsCount,totalHotels:0},d.responsePayment={fixedPayments:[],monthInterestFree:[],loading:!0},d.hotelFilters={loading:!0,min:0,max:0},d.filterSelection={min:0,max:0};var me=new Q.Z(h.domainAPIUrl);d.alertsFavorites={notificationSuccess:!1,notificationError:!1,notificationWarning:!1,message:"",actionType:""},d.showTimer=!1;var ve=null;function ye(e){return e.reduce((function(e,t){return e.adults+=t.adults,e.children=e.children.concat(t.children.map((function(e){return{year:e}}))),e.rooms+=1,e}),{adults:0,children:[],rooms:0})}function _e(e){for(var t=e.adults,n=e.children,r=e.rooms,i=Math.floor(t/r),o=t%r,a=Math.floor(n.length/r),s=n.length%r,c=[],l=0,u=0;u<r;u++){for(var h=i+(u<o?1:0),d=a+(u<s?1:0),p=[],f=0;f<d;f++)p.push({year:n[l].year}),l++;c.push({adults:h,children:p})}return c}function ke(e){var t=e.data||[];t.push({name:'<span class="font-icons icons-search icon-search-hotel"></span>   <span class="text-search-hotel">Buscar "'.concat(d.input_hotel_name,'"</span>'),hotelId:null,search:d.input_hotel_name}),d.suggestionSearchHotel[le].results=t,d.suggestionSearchHotel[le].show=!0,d.placeInputHasFocus=!0}function Ie(e){console.log(e)}function Ee(){var e=A.campaignTokenApi||A.CampaignTokenApi||A.campaigntokenapi||null;P=A.CampaignToken||A.campaignToken||e,x&&x.firebaseId&&(P=h.campaignTokenUser)}function Se(){if(N.windowScrollTop(),G)return T.initialize(!0);ae.page=d.pagination.currentPage+1,d.paramsFilter.page=d.pagination.currentPage+1,Ae()}function Pe(e){e.forEach((function(e){e.forEach((function(e){e.services&&Array.isArray(e.services)&&(e.services=e.services.map((function(e){return function(e){for(var t=0,n=Object.entries(S);t<n.length;t++){var r=de(n[t],2),i=r[0],o=r[1];if(o.es.includes(e)||o.en.includes(e))return we({key:i,text:"es"===h.language?o.es:o.en},o)}return null}(e.name)})).filter(Boolean).sort((function(e,t){return e.order-t.order})).reduce((function(e,t){return e.some((function(e){return e.order===t.order}))||e.push(t),e}),[]).slice(0,3).map((function(e){return 1===e.order&&(e.text="Wi-fi"),e})))}))}))}function Ce(){if(!d.responsePayment.fixedPayments.length&&!d.responsePayment.monthInterestFree.length){var e={channel:f.site.channel,language:f.site.culture,currency:f.site.currency};t.get(f.site.endPoints.paymentMethodUrl,{params:e}).then(Ke,nt)}}function Oe(e){if(e){var t=e.findIndex((function(e){return 3===e.id}));t>-1&&(e[t].filters=e[t].filters.filter((function(e){return 24===e.id||20===e.id||70===e.id})).sort((function(e,t){var n=[24,70,20];return n.indexOf(e.id)-n.indexOf(t.id)}))),d.filters=Fe(e)||[]}}function Te(){var e,t,n,r=d.hotels.length,i=p.mapPaxToUrl(v.pax),o=p.mapPaxToUrl(ie.paxes),a=(be(e={checkin:v.checkIn,checkout:v.checkOut,placetype:m.type,placeid:m.id},"placeid",m.id),be(e,"source",A.source?A.source:""),be(e,"promotions",A.promotions),e),s=p.getDate(v.checkIn),c=p.getDate(v.checkOut),l=p.diffBetweenDays(s,c);P&&(a.CampaignToken=P),A.coupon&&(a.coupon=A.coupon);var u=we(we({},a),i),f=we(we({},a),o);t=p.objectToQueryParams(u),n=p.objectToQueryParams(f);for(var g=[],y="",w=function(){var e=d.hotels[b];y=e.indexName,g.push(e.hotelId.toString());var r=e.isRequote?n:t;e.url=L.getUrlToDetail(e,r),e.position=d.pagination.currentPage*d.pagination.pageSize+b+1,e.page=d.pagination.currentPage+1,e.rooms=e.isRequote?o.rooms:i.rooms,e.nights=l,e.showPromotion=!1,e.showHotSBlackFri=!1,e.notAmount=!!h.hotelsTagLogin&&h.hotelsTagLogin.listA.includes(e.hotelId),e.notMessage=!!h.hotelsTagLogin&&h.hotelsTagLogin.listB.includes(e.hotelId);var a=h.hotelsIdsPR?h.hotelsIdsPR.find((function(t){return t==e.hotelId})):-1;e.sourceTriGooHotelsIds=a>-1,e.isFavorite=!1,h.showPromotionsTags&&(_=N.getShowPromotion(e.taxes),e.showPromotion=_.activeKey,e.showHotSBlackFri=_.HotSBlackFri)},b=0;b<r;b++){var _;w()}g.length>0&&V.viewedObjectIDs(g,y||"searchHotelPlacesUS"),window.__pt.hotels=d.hotels}function xe(){x&&x.firebaseId?P=h.campaignTokenUser:Ee(),d.nightsList=v.pax.length||0;var e=L.getHotelsIds(d.hotels);oe.hotelIds=e.join(","),oe.rooms=ie.paxesFormat,oe.CampaignToken=P,oe.profileId=d.profileId,oe.userKey=j,oe.mobile=z,oe.responseTimeout=2e4,oe.checkIn=ae.checkIn,oe.checkOut=ae.checkOut,oe.login=D,oe.source=v.source?v.source:"SPA-Hotel-List",oe.filters=d.filtersSelectedArrayString.join(","),oe.channelId=z?h.chkSourceMobile:h.chkSourceDesktop,ot(oe,v.pax),t.get(h.endPoints.quoteUrl,{params:oe,headers:(0,E.w)()}).then($e,tt)}function De(){var e=d.hotels.map((function(e){return e.hotelId}));if(!f.rb&&e.length>0){var n=we({},oe);n.hotelIds=e.join(","),n.CampaignToken=null,n.userKey=null,n.login=!D,t.get(h.endPoints.quoteUrl,{params:n,headers:(0,E.w)()}).then(Be,nt)}}function Ae(){x&&x.firebaseId?P=h.campaignTokenUser:Ee();var e=ie.paxesFormat.map((function(e){return!e.includes("|")&&/^[0-9]+$/.test(e)&&(e+="/n"),e.replace(/\|/g,"/")})).join("/");d.hotelFilters.loading=!0,d.paramsFilter.pax="/".concat(e),d.paramsFilter.getexternalavailability=L.getExternalAvailability(),d.paramsFilter.channel=h.channelFac,d.paramsFilter.channelId=h.channelFac,d.paramsFilter.checkIn=ae.checkIn,d.paramsFilter.checkOut=ae.checkOut,d.paramsFilter.profileId=d.profileId,d.paramsFilter.CampaignToken=P,d.paramsFilter.login=D,d.paramsFilter.mobile=z,d.paramsFilter.filters=d.filtersSelectedArrayString.join(","),d.paramsFilter.filtersCustom=d.filterCustomList.map((function(e){return e.uri})).join(","),d.paramsFilter.userKey=j,d.paramsFilter.source=v.source?v.source:"SPA-Hotel-List",d.paramsFilter.searchDatesRecommended=!0,d.paramsFilter.uriPlace=g.place.uri,d.paramsFilter.promotions=a.search().promotions?a.search().promotions.split(","):null,Y&&(d.loading=!0),t.get(h.endPoints.filterUrl,{params:d.paramsFilter,loginFlag:D,headers:(0,E.w)()}).then(Ve,nt)}function Le(e){var t=e.data;console.log(t)}function Ne(e){d.filtersSelectedArray=e,d.filtersSelectedArrayString=e.map((function(e){return e.uri})),Re(),d.pricesSelected.length<1&&d.resetRangeFilter(!1),je(),N.windowScrollTop()}function je(){if(G)return T.initialize();ae.page=1,Ae()}function Re(){var e=window.location.pathname,t=window.location.search,n=e.split("/");t=function(e){var t=new URLSearchParams(window.location.search),n=Object.fromEntries(t.entries());parseInt(n.page)>1&&(n.page=1,e="?"+Object.keys(n).map((function(e){return e+"="+n[e]})).join("&"));return e}(t);var r=n[1],i=n[2],o="";d.filtersSelectedArrayString.length&&(o="/".concat(d.filtersSelectedArrayString.join("/")));var a="/".concat(r,"/").concat(i).concat(o).concat(t);window.history.pushState(null,"any",a)}function Fe(e){var t=[],n=[];return e&&(n=e.map((function(e,n){var r=e.filters?e.filters.find((function(e){return e.isSelected})):null;if(e.isSelected=!r,e.filters){var i=e.filters.map((function(n){return n.isMultiselect=e.isMultiselect,n.isSelected&&t.push(n),n}));e.filters=i}return 0===n&&(e.filters=L.ptUsaProvisionalOrder(e.filters)),e}))),d.filtersSelectedArray=t,d.filtersSelectedArrayString=t.map((function(e){return e.uri})),n}function Me(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];N.windowScrollTop();var n=e.data;n&&n.token?(d.loading=!1,d.showAd=!0,b=n,d.hotels=b.hotels||[],d.hotels=d.hotels.filter((function(e){return e.mainPhoto.idPhoto})),d.groupedHotel=L.groupItems(d.hotels,3),d.groupedHotel.forEach((function(e){e.forEach((function(e){e.price&&0!=e.price||Ue(e)}))})),d.pagination=L.buildPaginator(b.totalHotels,d.hotels.length,d.pagination.currentPage),d.pagination.totalHotels=b.totalHotels,d.pagination.pageSize=h.listItemsCount,Oe(b.filterGroups),Te(),h.showCardTags&&Pe(d.groupedHotel),t||(xe(),De()),t&&st(),d.hotels.length&&!f.rb&&it(d.hotels)):et(e)}function Ue(e){var t=h.culture.split("-")[0];e.dateRecommended&&e.dateRecommended.forEach((function(e){var n,r,i,o=ee(e.checkin,t),a=ee(e.checkout,t),s=(n=e.checkin,r=e.checkout,i=new Date(n),(new Date(r)-i)/864e5);e.checkinDayOfWeek=o.dayOfWeek,e.checkinDayAndMonth=o.dayAndMonth,e.checkoutDayOfWeek=a.dayOfWeek,e.checkoutDayAndMonth=a.dayAndMonth,e.dateDifference=s}))}function Be(e){re.loaded=!0,re.data=e.data.tax,He()}function He(){for(var e=D?-1:1,t=re.data,n=d.groupedHotel.length,r=0;r<n;r++)for(var i=d.groupedHotel[r],o=i.length,a=0;a<o;a++){var s=i[a],c=t["h".concat(s.hotelId)];if(c&&!h.hotelsTagLogin.listB.includes(s.hotelId)){var l=s.taxes?s.taxes.totalRoomRate:0,u=c?c.totalRoomRate:l,p=(l-u)*e,f=100*p/l>2||p>=50,m=we(we({},s),{},{price_with_login:u*e,total_saved:p>0&&f?p:0});d.groupedHotel[r][a]=m}}}function $e(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=L.getHotelsIds(d.hotels),i=v.pax,o=Object.keys(e.data.rates);he=r.filter((function(e){return!o.includes("h".concat(e))}));var a=q(i);if(d.nightsList=v.pax.length||0,n||ot(oe,i),he.length||(ne=e),he.length&&a&&a.validRequote){d.paxData=a.paxes,W=e;var s=p.clone(oe);s.hotelIds=he.join(","),s.rooms=a.paxesFormat,ot(s,i),t.get(h.endPoints.quoteUrl,{params:s,headers:(0,E.w)()}).then(ze,nt)}else n||qe(e)}function Ve(e){var t=e.data||{};200==e.status&&(Y=!0,d.loading=!1,d.loadingRates=!1,d.hotelFilters=t,d.hotelFilters.loading=!1,d.paramsFilter.searchDatesRecommended=!1,d.hotelFilters.filterCustoms.filterGroups=L.setIsSelectCustomFilter(t.filterCustoms.filterGroups),d.popularFilters=d.hotelFilters.filterCustoms.filterPopular||[],function(){var e=d.hotelFilters.filterCustoms||{};!d.paramsFilter.orderBy&&e.orderBy&&e.orderBy.length&&(d.paramsFilter.orderBy=e.orderBy[0].code,d.textOrderBy=e.orderBy[0].display);$(".collapse_filter").collapse("show"),d.toggleRange=!0}(),function(e){var t=d.paramsFilter.filterPriceMin||e.min,n=d.paramsFilter.filterPriceMax||e.max;0===d.pricesSelected.length&&e.min&&e.max&&(t=e.min,n=e.max);var r={min:e.min,max:e.max,value:[t,n]},i=document.getElementById("prices"),o=document.getElementById("prices_map");i&&(Z&&Z.destroy(),(Z=new Slider("#prices",r)).on("slide",Ye),Z.on("slideStop",Ze)),o&&(te&&te.destroy(),(te=new Slider("#prices_map",r)).on("slide",Ye),te.on("slideStop",Ze)),d.paramsFilter.filterPriceMin||d.paramsFilter.filterPriceMax||(d.filterSelection.min=t,d.filterSelection.max=n),d.pricesSelected.length&&d.filterSelection.max<=e.max?Xe(d.filterSelection.min,d.filterSelection.max):Xe(e.min,e.max),(d.filterSelection.min<e.min||d.filterSelection.max>e.max)&&(d.paramsFilter.filterPriceMin=void 0,d.paramsFilter.filterPriceMax=void 0,d.filterSelection.min=e.min,d.filterSelection.max=e.max),$(".min_slider_box").on("keyup",(function(e){Je(e,"min")})),$(".max_slider_box").on("keyup",(function(e){Je(e,"max")})),$(".min_slider_box").on("change",(function(e){Qe()})),$(".max_slider_box").on("change",(function(e){Qe()}))}(d.hotelFilters.filterCustoms.prices),Me(e,!0),X&&De(),X=!0,ne&&$e(ne,!0),He())}function qe(e){var t=e.data;t?(w=t||{},Y||function(){for(var e=d.hotels.length,t=0;t<e;t++){var n=d.hotels[t];if(n.price=null,n.taxes=null,n.isRequote=!1,w&&w.rates&&w.rates["h".concat(n.hotelId)]&&(n.price=w.rates["h".concat(n.hotelId)]),w&&w.tax&&w.tax["h".concat(n.hotelId)]&&(n.taxes=w.tax["h".concat(n.hotelId)],n.isRequote=!!n.taxes.isRequote,n.showPromotion=!1,n.showHotSBlackFri=!1,h.showPromotionsTags)){var r=N.getShowPromotion(n.taxes);n.showPromotion=r.activeKey,n.showHotSBlackFri=r.HotSBlackFri}}}(),d.loadingRates=!1,U.afterLoadRates(),U.viewItemList(d.hotels),t.campaignToken&&t.campaignToken.length&&a.search("ctInternal",t.campaignToken),P=t.campaignToken,st()):et(e),$(".seo-list-init").remove()}function ze(e){qe(function(e,t){if(t&&t.data&&t.data.tax)for(var n in t.data.tax)t.data.tax[n].isRequote=!0;var r=H(H({},e.data.rates),t.data.rates),i=H(H({},e.data.tax),t.data.tax);return e.data.rates=r,e.data.tax=i,e}(W,e)),Te(),He()}function Le(e){var n,r,i,o=e.data;if(o&&"ok"===o.status){var a=d.hotels[0]||{};n=a.hotelId,r=o.message,i={checkIn:v.checkIn,checkOut:v.checkOut,availabilityReasons:r,idHotel:n,channelId:h.channelFac,token:oe.CampaignToken?oe.CampaignToken:"",adults:k.adults,kids:k.children,providerId:1,placeIdDestination:m.id,kidsAge:N.getAgeKids(v)},t.post(h.endPoints.recommenderDatesUrl,i).then(Ge,nt)}}function Ge(e){if(e&&e.data&&e.data.message){var t=d.hotels[0],n=Object.values(e.data.message);t.checkIn=ae.checkIn,t.checkOut=ae.checkOut,t.recommendedDates=n.map((function(e){return we(we({},e),{},{people:k.adults+k.children,rooms:v.pax.rooms,hotelId:t.hotelId,hotelName:t.name})}))}}function We(e){var t=e.data;"200 - OK"==t.message?(_=t.result,d.phoneBase=_.did,$("#header-phonebase").attr("href","tel:".concat(d.phoneBase)),$(".skillbase_p").text(l("tel")(d.phoneBase))):nt(e)}function Ke(e){var t=e.data||[],n=(t.monthInterestFree?t.monthInterestFree.options:[]).reduce((function(e,t){var n=Math.max.apply(Math,fe(t.paymentPlans));return e[n]||(e[n]=[]),e[n].push(t),e}),{}),r=Object.entries(n).sort((function(e,t){var n=de(e,1)[0],r=de(t,1)[0];return Number(r)-Number(n)})),i={fixedPayments:t.fixedPayments.map((function(e){return e.options})).reduce((function(e,t){return e.concat(t)}),[]),monthInterestFree:r,quotasPayments:t.quotasPayments?t.quotasPayments.options:[],otherPayments:t.otherPayments?t.otherPayments.options:[],loading:!1,title:t.quotasPayments?t.quotasPayments.title:"",maxmsi:t.monthInterestFree?t.monthInterestFree.title:""};d.responsePayment=i,d.monthInterestData=t.monthInterestFree||[]}function Ye(t){e.$apply((function(){var e=t[0]||0,n=t[1]||0;d.filterSelection.min=e,d.filterSelection.max=n,Xe(e,n)}))}function Je(e,t){var n=e.target.value+"".replaceAll(",","");if(!n.includes(",")){var r=Math.abs(parseInt(n));"min"===t&&r<d.filterSelection.min||"max"===t&&r+1<d.filterSelection.min||(d.filterSelection[t]=isNaN(r)?d.hotelFilters.filterCustoms.prices[t]:r,Z.setValue([d.filterSelection.min,d.filterSelection.max],!0,!0),window.screen.width<920&&d.onSubmitFilter())}}function Qe(){Xe(d.filterSelection.min,d.filterSelection.max)}function Xe(e,t){$(".min_slider_box").val((Math.round(e)+"").replace(/\D/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,",")),$(".max_slider_box").val((Math.round(t)+"").replace(/\D/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,","))}function Ze(e){Ye(e),te&&te.setValue([d.filterSelection.min,d.filterSelection.max],!0,!0),Z&&Z.setValue([d.filterSelection.min,d.filterSelection.max],!0,!0),window.screen.width<920&&d.onSubmitFilter()}function et(e){var t=e.data;d.loadingRates=!1,d.loading=!1,d.hasError=!0,d.hotels=[],d.groupedHotel=[],d.filters=[],U.errorQuote(t,"Content Facade")}function tt(e){var t=e.data;d.loadingRates=!1,d.loading=!1,d.loadingRefresh=!1,U.errorQuote(t,"Rates"),console.log("error",t)}function nt(e){console.log(e)}function rt(e){U.ad(e.ad,k,oe)}function it(e){var t=i.get(f.recentDestinations)||[],n=t.findIndex((function(e){return e.place.id==m.id}));if(n>-1){var r=t[n];r.box=v,r.campaignTokenApi=P,t.splice(n,1),t.unshift(r)}else t.unshift({box:v,place:m,IdG:m.id,campaignTokenApi:P,icon:h.cloudCdn+"/assets/img/Hotel_icon.svg",title:y.hotel_lang,origin:"H",image:e[0].mainPhoto.cloudUri?e[0].mainPhoto.cloudUri:""});t.length>f.limitDestinations&&(t=t.slice(0,f.limitDestinations)),i.set(f.recentDestinations,t)}function ot(e,t){var n=p.getDate(e.checkIn),r=p.getDate(e.checkOut),i=p.diffBetweenDays(n,r),o=t.rooms,a=t.adults+t.children;d.boxData={rooms:o,nights:i,totalPax:a}}function at(){d.title="".concat(O," ").concat(m.displayText)}function st(){var e,n,r=d.hotels[0]||{};r&&!r.price&&h.recommenderDatesActive&&(e=r.hotelId,n={hotelId:e,checkIn:v.checkIn,checkOut:v.checkOut,placeId:m.id,channelId:h.channelFac,organizationId:h.organization,propertyId:h.property,culture:h.culture,pax:N.getPaxToMessages(v),imageProfileId:h.imageProfile},t.get(h.endPoints.availabilityReasonsListUrl,{params:n}).then(Le,nt))}d.favoriteHotels=[],d.onInit=function(n,r){$(".seo-list-init").css("display","none"),d.title=$("<div/>").html(n).text(),O=r,U=new o(k=ie,ae,oe),d.paxData=v.pax,d.dataTotalCapacity=k.adults+k.children,Ee(),d.profileId=A.profileId||A.ProfileId||A.profileid||null,z&&(ae.pageSize=h.listItemsMobileCount),Me({data:g}),f.rb||(""==h.sufix&&(ce.adultQuantity=k.adults,ce.kidQuantity=k.children,ce.checkInDate=ae.checkIn,ce.checkOutDate=ae.checkOut,t.get(h.endPoints.skillBaseUrl,{params:ce}).then(We,nt)),Ce(),Ae()),T=new F(d,t,l,e,R),p.onViewComponent("#ad-skyscraper-1",rt,{ad:1}),p.onViewComponent("#ad-skyscraper-2",rt,{ad:2}),p.onViewComponent("#ad-skyscraper-3",rt,{ad:3}),d.getUSersFavorites()},d.getUSersFavorites=function(){var e={UserId:R,country:h.country.toUpperCase()};me.getHotelsByUser(e).then((function(e){d.favoriteHotels=e.value})).catch((function(e){console.error("Error fetching hotels by user:",e)}))},d.updateHotelsState=function(t){d.detailCardMap.isFavorite=d.isFavoriteHotel(d.detailCardMap.id),d.hotels.forEach((function(t){e.$applyAsync((function(){t.isFavorite=d.isFavoriteHotel(t.hotelId)}))})),t&&(T.clearMarkers(),T.centerMap())},d.addFavorites=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.preventDefault(),t.stopPropagation();var i=_e(v.pax),o={hotelId:r?n.id:n.hotelId,userId:R,uri:n.uri,site:h.domain,channel:z?h.chkSourceMobile:h.chkSourceDesktop,originalPrice:r?n.price>0?n.price:0:n.taxes?n.taxes.totalRoomRatePerNight:0,checkin:ae.checkIn,checkout:ae.checkOut,rooms:i.map((function(e){return{adults:e.adults,children:e.children.map((function(e){return e.year}))}})),campaignToken:P||"",placeId:m.id,placeType:m.type,placeUri:m.uri,placeName:m.name,isMobile:z};if(d.isFavoriteHotel(o.hotelId)){var a=d.getFavoriteId(o.hotelId);a&&me.removeHotel({Id:a,UserId:R}).then((function(t){e.$applyAsync((function(){d.favoriteHotels=d.favoriteHotels.filter((function(e){return!(e.hotelId===o.hotelId&&e.checkin===v.checkIn&&e.checkout===v.checkOut&&angular.equals(ye(e.rooms),v.pax))}));var e=we(we({},o),{},{id:a,name:n.name});se.logDeleteFav(e,"list"),d.updateHotelsState(r),d.showNotification("error",n.name,"delete")}))})).catch((function(t){e.$applyAsync((function(){d.showNotification("error",t)}))}))}else me.addHotel(o).then((function(t){e.$applyAsync((function(){if(t.value){var e=we(we({},o),{},{id:t.value,name:n.name});d.favoriteHotels.push(e),se.logAddFav(e,"list"),d.updateHotelsState(r),d.showNotification("success",n.name,"save")}else d.showNotification("warning","","")}))})).catch((function(t){e.$applyAsync((function(){d.showNotification("error",t)}))}))},d.showNotification=function(e,t,n){ve&&r.cancel(ve),d.showTimer=!1,r((function(){d.showTimer=!0})),d.alertsFavorites.notificationSuccess="success"===e,d.alertsFavorites.notificationError="error"===e,d.alertsFavorites.notificationWarning="warning"===e,d.alertsFavorites.message=t,d.alertsFavorites.actionType=n,ve=r((function(){d.alertsFavorites.notificationSuccess=!1,d.alertsFavorites.notificationError=!1,d.alertsFavorites.notificationWarning=!1,d.alertsFavorites.message="",d.alertsFavorites.actionType=""}),6e3)},d.getFavoriteId=function(e){var t=d.favoriteHotels.find((function(t){return t.hotelId===e&&t.checkin===v.checkIn&&t.checkout===v.checkOut&&angular.equals(ye(t.rooms),v.pax)}));return console.log(t),t?t.id:null},d.isFavoriteHotel=function(e){return d.favoriteHotels.some((function(t){return t.hotelId===e&&t.checkin===v.checkIn&&t.checkout===v.checkOut&&angular.equals(ye(t.rooms),v.pax)}))},d.slideCarrousel=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ge(o,r,i,a,s,"next",e)}function s(e){ge(o,r,i,a,s,"throw",e)}a(void 0)}))}}(pe().mark((function e(n,i,o){var a,s;return pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),i.isLoadGallery){e.next=10;break}return i.isLoadGallery=!1,a={HotelId:i.hotelId,culture:ae.culture,organizationId:ae.organizationId,propertyId:ae.propertyId,imageProfileId:"desktop"},e.next=6,t.get(h.endPoints.galleryDetailUrl,{params:a});case 6:s=e.sent,i.gallery=p.clone([].concat(fe(s.data.gallery),[i.mainPhoto])),i.isLoadGallery=!0,i.galleryPosition=2;case 10:i.galleryPosition+="right"==o?1:-1,r((function(){i.mainPhoto=i.gallery[Math.abs((i.galleryPosition-1)%i.gallery.length)]}),0);case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),d.areAllServicesNotHighlighted=function(e){return 0!==e.length&&e.every((function(e){return!e.highlited}))},d.getTitleFilter=function(e,t){return 8==t.id&&"sin-categoria-estrellas"!=e.uri&&"without-stars-category"!=e.uri?'<i class="font-icons icon-'.concat(e.uri,'-star"></i>'):e.display},d.getTitleFilterCustom=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(102===e.categoryGuid&&!n)return'<i class="font-icons icon-'.concat(e.uri,'-star"></i>');var r=e.display.split("_");return y["".concat(r[0])]&&y["".concat(r[0])]["".concat(r[1])]?y["".concat(r[0])]["".concat(r[1])]:e.display},d.getTitleFilterPopular=function(e){return 0!=e.categoryGuid?d.getTitleFilterCustom(e,null):d.getTitleFilter(e,{})},d.onSelectRecommenderDate=function(e,t,n){e.preventDefault(),e.stopPropagation(),U.selectDateSuggested(t);var r=n.split("?"),i=p.searchUri(r[1]);i.checkin=t.CheckIn,i.checkout=t.CheckOut;var o=p.objectToQueryParams(i);window.location.href=r[0]+"?"+o},d.onEventMapToDetail=function(){U.onClickMapToDetail(k)},d.onSelectHotel=function(e,t){var n=[];n.push(e.hotelId.toString());var r=e.indexName;i.set("_key_argo_object_n",JSON.stringify(V.clickedObjectIDsAfterSearch(n,r||"searchHotelPlacesUS",e)));var o=t.target.className;o.includes(K[0])||o.includes(K[1])||(U.onClickImpression(e),e.hotelId==+[d.profileId]&&e.dateRecommended&&e.dateRecommended.length)},d.shouldDisplayCard=function(e){return+[d.profileId]==+[e.hotelId]?!(e.dateRecommended.length>0):d.profileId!=e.hotelId||void 0},d.onSelectDate=function(e,t,n){e.preventDefault();var r=n.checkin,i=n.checkout,o=function(e,t,n){var r=new URL(e);return r.searchParams.set("checkin",t),r.searchParams.set("checkout",n),r.toString()}(t.url,r,i),a=(we({checkIn:new Date("".concat(r,"T00:00:00")),checkOut:new Date("".concat(i,"T00:00:00")),paxes:k},t),"".concat(o,"&isFromDateRecommended=true"));window.open(a,"_blank")},d.sendContentFooter=function(e){B.clickLink("footer :: ".concat(e))},d.onClosed=function(e){$("#".concat(e)).modal("hide")},d.onCloseMapCardDetail=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=function(){e&&d.showMapDetailCard?d.showMapDetailCard=!1:(d.detailCardMap.show=!1,d.showMapDetailCard=!1,T.clearBubble())};r(t,400)},d.onEventMapToDetail=function(){U.onClickMapToDetail(k)},d.nextPage=function(){N.windowScrollTop(),d.pagination.currentPage<d.pagination.totalPages-1&&(d.pagination.currentPage+=1,Se())},d.prevPage=function(){N.windowScrollTop(),d.pagination.currentPage>0&&(d.pagination.currentPage-=1,Se())},d.selectPage=function(e){N.windowScrollTop(),"..."!=e&&(d.pagination.currentPage=e-1,Se())},d.onLoadPayment=function(e,t,n){C=e,d.showModal(C,t,n),Ce()},d.showModal=function(e,t,n){$("#".concat(e)).modal("show"),"modal-payform"!=e&&"modal-contact"!=e||B.selectContent(t,n)},d.hideModalList=function(e){$("#".concat(e)).modal("hide")},d.showModalMap=function(e){G=!0,U.onClickOpenMap(k),T.openMap(ae,oe,k,P,d.paramsFilter)},d.hideModalMapList=function(e){G=!1,Se(),$("#".concat(e)).modal("hide")},d.allowShowFilter=function(e){return-1==h.filtersDisabled.indexOf(e)},d.onSearchSearch=function(e,n,r,i){!e||e&&e.length<3||(le=n,d.paramsFilter.search=e,d.paramsFilter.hotelName="",t.get(h.endPoints.searchHotelUrl,{params:d.paramsFilter}).then(ke,Ie))},d.onSelectSearch=function(e,t,n){var r=d.input_hotel_name;e&&null==e.hotelId?(d.paramsFilter.hotelName=e.search,d.input_hotel_name=e.search,d.profileId=null):(d.paramsFilter.hotelName=null,d.profileId=e.hotelId,d.input_hotel_name=e.name),U.setEventFilterHotelName(e.hotelId,r,d.input_hotel_name,m),d.placeInputHasFocus=!1,je()},d.handleKeyPress=function(e){(13===e.which||13===e.keyCode)&&d.input_hotel_name&&d.input_hotel_name.length>=3&&(d.paramsFilter.hotelName=d.input_hotel_name,U.setEventFilterHotelName("",d.input_hotel_name,d.input_hotel_name,m),d.input_hotel_name=d.input_hotel_name,d.paramsFilter.search="",d.profileId=null,d.placeInputHasFocus=!1,je())},d.onRemoveSearch=function(){null!=d.profileId?(d.profileId=null,d.input_hotel_name="",d.placeInputHasFocus=!1,je()):d.paramsFilter.hotelName?(d.input_hotel_name="",d.placeInputHasFocus=!1,d.paramsFilter.hotelName=null,je()):(d.input_hotel_name="",d.placeInputHasFocus=!1)},d.onFocusSearch=function(t,n){d.suggestionSearchHotel[t].results.length&&setTimeout((function(){e.$apply((function(){d.suggestionSearchHotel[t].show=!0,d.placeInputHasFocus=!0}))}),250)},d.onClickOutsideSearch=function(e,t){d.placeInputHasFocus=!1,e[t]=!1,d.placeInputHasFocus=!1},d.deleteFilterHotel=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];d.input_hotel_name="",d.label_hotel_name="",d.pagination.currentPage=0,e&&Se()},d.filterSelected=function(e){d.paramsFilter.page=1,d.paramsFilter.currentPage=1,d.pagination.currentPage=0,Ne(d.filtersSelectedArray.filter((function(t){return t.groupId!=e.id}))),at(),U.selectedFilter(e.display,e.uri)},d.filterChildSelected=function(e,t){if(d.paramsFilter.page=1,d.paramsFilter.currentPage=1,d.pagination.currentPage=0,0==e.isMultiselect){var n=d.filtersSelectedArray.filter((function(t){return t.groupId!=e.groupId}));n.push(e),Ne(n)}else{var r=[];d.filtersSelectedArray.find((function(t){return t.id===e.id}))?r=d.filtersSelectedArray.filter((function(t){return t.id!=e.id})):(d.filtersSelectedArray.push(e),r=d.filtersSelectedArray),Ne(r)}if(at(),20===e.id){var i=t.filters.filter((function(e){return 69===e.id}));d.filtersSelectedArray.push(i[0]),U.selectedFilter(t.display,i[0].uri)}var o=[];o.push(t.uri+":"+e.uri),V.clickedFilters(d.hotels[0].indexName||"searchHotelPlacesUS",o,window.__pt.ln.filterslang[t.uri]||t.uri),U.selectedFilter(t.display,e.uri)},d.filterCustomSelected=function(e){d.paramsFilter.page=1,d.paramsFilter.currentPage=1,d.pagination.currentPage=0;var t=d.filterCustomList.filter((function(t){return t.categoryGuid!=e.id}));d.filterCustomList=t,U.selectedFilter(e.display,e.uri),d.pricesSelected.length<1&&d.resetRangeFilter(!1),Se()},d.filterCustomChildSelected=function(e,t){d.paramsFilter.page=1,d.paramsFilter.currentPage=1,d.pagination.currentPage=0;var n=d.filterCustomList;t.isMultiselect||(n=d.filterCustomList.filter((function(e){return e.categoryGuid!=t.id}))),e.isSelected?n.push(e):n=d.filterCustomList.filter((function(t){return t.uri!=e.uri})),d.pricesSelected.length<1&&d.resetRangeFilter(!1);var r=[];r.push(t.uri+":"+e.uri),V.clickedFilters(d.hotels[0].indexName||"searchHotelPlacesUS",r,window.__pt.ln.filterslang[t.uri]||t.uri),d.filterCustomList=n,U.selectedFilter(t.display,e.uri),Se()},d.deleteFilterArray=function(){d.filtersSelectedArray=[],d.filtersSelectedArrayString=[],d.filterCustomList=[],d.paramsFilter.hotelName="",d.paramsFilter.search,d.input_hotel_name="",d.paramsFilter.hotelName=null,d.profileId=null,d.deleteFilterHotel(!1),d.resetRangeFilter(!1),Re(),Se()},d.filterPillSelected=function(e){Ne(d.filtersSelectedArray.filter((function(t){return t.id!=e.id})))},d.filterCustomPillSelected=function(e,t){e.splice(t,1),Se()},d.onSubmitFilter=function(e){d.pagination.currentPage=0,d.hotelFilters.filterCustoms.prices.min==d.filterSelection.min&&d.hotelFilters.filterCustoms.prices.max==d.filterSelection.max||function(){d.paramsFilter.filterPriceMin=d.filterSelection.min,d.paramsFilter.filterPriceMax=d.filterSelection.max,Math.round(d.hotelFilters.filterCustoms.prices.min)===d.filterSelection.min?d.paramsFilter.filterPriceMin=d.hotelFilters.filterCustoms.prices.min:Math.round(d.hotelFilters.filterCustoms.prices.max)===d.filterSelection.max&&(d.paramsFilter.filterPriceMax=d.hotelFilters.filterCustoms.prices.max);Math.round(d.filterSelection.min)>Math.round(d.hotelFilters.filterCustoms.prices.min)||Math.round(d.filterSelection.max)<Math.round(d.hotelFilters.filterCustoms.prices.max)?d.pricesSelected=[{display:"De: $".concat((Math.round(d.filterSelection.min)+"").replace(/\D/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,",")," a \n                    $").concat((Math.round(d.filterSelection.max)+"").replace(/\D/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,","))}]:d.pricesSelected=[]}(),Se()},d.onChangeOrderBy=function(e){d.paramsFilter.orderBy=e.code,d.textOrderBy=e.display,U.orderEvent(d.paramsFilter.orderBy),d.onSubmitFilter()},d.closeFiltersMobile=function(){d.onSubmitFilter(),d.onClosed("modal-filters")},d.onLoadFilters=function(e){if(e){var t=e.findIndex((function(e){return 3===e.id}));t>-1&&(e[t].filters=e[t].filters.filter((function(e){return 24===e.id||20===e.id||70===e.id})).sort((function(e,t){var n=[24,70,20];return n.indexOf(e.id)-n.indexOf(t.id)}))),d.filters=Fe(e)||[]}},d.filterUpDownSet=function(e){d.filters[e].filterUpDown=!d.filters[e].filterUpDown},d.filterUpDownSetCustom=function(e){d.hotelFilters.filterCustoms.filterGroups[e].filterUpDown=!d.hotelFilters.filterCustoms.filterGroups[e].filterUpDown},d.renderNameFilter=function(e,t,n,r){var i=e?"_".concat(r):"";return"".concat(t,"_").concat(n).concat(i)},d.applyPopularFilter=function(e){if(0!=e.categoryGuid){var t=d.hotelFilters.filterCustoms.filterGroups.find((function(t){return t.id===e.categoryGuid}));d.filterCustomChildSelected(e,t)}else{var n=d.hotelFilters.filterGroups.find((function(t){return t.id===e.groupId}));d.filterChildSelected(e,n)}},d.resetRangeFilter=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];d.pricesSelected=[],d.paramsFilter.filterPriceMin=void 0,d.paramsFilter.filterPriceMax=void 0,d.filterSelection.min=d.hotelFilters.filterCustoms.prices.min,d.filterSelection.max=d.hotelFilters.filterCustoms.prices.max,Xe(d.filterSelection.min,d.filterSelection.max),e&&Se()}}window.app.controller("ListController",_e),_e.$inject=["$scope","$http","$q","$timeout","localStorageService","$location","$rootScope","$filter"]})(),(()=>{"use strict";n(4697);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(o=i.key,a=void 0,a=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(o,"string"),"symbol"===e(a)?a:String(a)),i)}var o,a}var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.analytics=window.__pt.fn.analytics,this.settings=window.__pt.settings,this.events=window.__pt.fn.analytics.events}var n,r,i;return n=e,(r=[{key:"metricLoginAction",value:function(e,t){var n=t.action,r={event:this.events.gtmEvent,eventAction:n,eventCategory:"Login",eventName:"Login"};this.analytics.set(r.event,r)}},{key:"metricHeaderSelectContent",value:function(e){var t=e.title,n={content_type:this.events.button,element:"header :: ".concat(t),event:this.events.trackEvent,eventName:this.events.selectContent,layer:this.settings.page};this.analytics.set(n.event,n)}},{key:"metricsErrorsLogin",value:function(e){var t={event:this.events.gtmEvent,eventAction:"login error",eventCategory:"Login",eventName:"Login",eventLabel:"".concat(e)};this.analytics.set(t.event,t)}}])&&t(n.prototype,r),i&&t(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}(),i=n(4155);const o=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},a={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){const i=e[t],o=t+1<e.length,a=o?e[t+1]:0,s=t+2<e.length,c=s?e[t+2]:0,l=i>>2,u=(3&i)<<4|a>>4;let h=(15&a)<<2|c>>6,d=63&c;s||(d=64,o||(h=64)),r.push(n[l],n[u],n[h],n[d])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(o(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const o=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else{const o=e[n++],a=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const i=n[e.charAt(t++)],o=t<e.length?n[e.charAt(t)]:0;++t;const a=t<e.length?n[e.charAt(t)]:64;++t;const c=t<e.length?n[e.charAt(t)]:64;if(++t,null==i||null==o||null==a||null==c)throw new s;const l=i<<2|o>>4;if(r.push(l),64!==a){const e=o<<4&240|a>>2;if(r.push(e),64!==c){const e=a<<6&192|c;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class s extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const c=function(e){return function(e){const t=o(e);return a.encodeByteArray(t,!0)}(e).replace(/\./g,"")},l=function(e){try{return a.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};const u=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,h=()=>{try{return u()||(()=>{if(void 0===i||void 0===i.env)return;const e=i.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&l(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},d=e=>{var t,n;return null===(n=null===(t=h())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},p=()=>{var e;return null===(e=h())||void 0===e?void 0:e.config},f=e=>{var t;return null===(t=h())||void 0===t?void 0:t[`_${e}`]};class m{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}}function v(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}class g extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,g.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,y.prototype.create)}}class y{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],o=i?function(e,t){return e.replace(w,((e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`}))}(i,n):"Error",a=`${this.serviceName}: ${o} (${r}).`;return new g(r,a,n)}}const w=/\{\$([^}]+)}/g;function b(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],o=t[i];if(_(n)&&_(o)){if(!b(n,o))return!1}else if(n!==o)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function _(e){return null!==e&&"object"==typeof e}function k(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach((e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function I(e){const t={};return e.replace(/^\?/,"").split("&").forEach((e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}})),t}function E(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}class S{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=P),void 0===r.error&&(r.error=P),void 0===r.complete&&(r.complete=P);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}})),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function P(){}function C(e){return e&&e._delegate?e._delegate:e}class O{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const T="[DEFAULT]";class x{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new m;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:T})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=T){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e=T){return this.instances.has(e)}getOptions(e=T){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(r)}return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const o=this.instances.get(r);return o&&e(o,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const r of n)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,r===T?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var r;return n||null}normalizeInstanceIdentifier(e=T){return this.component?this.component.multipleInstances?e:T:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class D{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new x(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const A=[];var L;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(L||(L={}));const N={debug:L.DEBUG,verbose:L.VERBOSE,info:L.INFO,warn:L.WARN,error:L.ERROR,silent:L.SILENT},j=L.INFO,R={[L.DEBUG]:"log",[L.VERBOSE]:"log",[L.INFO]:"info",[L.WARN]:"warn",[L.ERROR]:"error"},F=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=R[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}]  ${e.name}:`,...n)};class M{constructor(e){this.name=e,this._logLevel=j,this._logHandler=F,this._userLogHandler=null,A.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in L))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?N[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,L.DEBUG,...e),this._logHandler(this,L.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,L.VERBOSE,...e),this._logHandler(this,L.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,L.INFO,...e),this._logHandler(this,L.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,L.WARN,...e),this._logHandler(this,L.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,L.ERROR,...e),this._logHandler(this,L.ERROR,...e)}}let U,B;const H=new WeakMap,V=new WeakMap,q=new WeakMap,z=new WeakMap,G=new WeakMap;let W={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return V.get(e);if("objectStoreNames"===t)return e.objectStoreNames||q.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return J(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function K(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(B||(B=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Q(this),t),J(H.get(this))}:function(...t){return J(e.apply(Q(this),t))}:function(t,...n){const r=e.call(Q(this),t,...n);return q.set(r,t.sort?t.sort():[t]),J(r)}}function Y(e){return"function"==typeof e?K(e):(e instanceof IDBTransaction&&function(e){if(V.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)}));V.set(e,t)}(e),t=e,(U||(U=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,W):e);var t}function J(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(J(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",o)}));return t.then((t=>{t instanceof IDBCursor&&H.set(t,e)})).catch((()=>{})),G.set(t,e),t}(e);if(z.has(e))return z.get(e);const t=Y(e);return t!==e&&(z.set(e,t),G.set(t,e)),t}const Q=e=>G.get(e);const X=["get","getKey","getAll","getAllKeys","count"],Z=["put","add","delete","clear"],ee=new Map;function te(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ee.get(t))return ee.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=Z.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!X.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let a=o.store;return r&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),i&&o.done]))[0]};return ee.set(t,o),o}W=(e=>({...e,get:(t,n,r)=>te(t,n)||e.get(t,n,r),has:(t,n)=>!!te(t,n)||e.has(t,n)}))(W);class ne{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const re="@firebase/app",ie="0.9.20",oe=new M("@firebase/app"),ae="[DEFAULT]",se={[re]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},ce=new Map,le=new Map;function ue(e,t){try{e.container.addComponent(t)}catch(n){oe.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function he(e){const t=e.name;if(le.has(t))return oe.debug(`There were multiple attempts to register component ${t}.`),!1;le.set(t,e);for(const t of ce.values())ue(t,e);return!0}function de(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}const pe=new y("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."});class fe{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new O("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw pe.create("app-deleted",{appName:this._name})}}const me="10.5.0";function ve(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const r=Object.assign({name:ae,automaticDataCollectionEnabled:!1},t),i=r.name;if("string"!=typeof i||!i)throw pe.create("bad-app-name",{appName:String(i)});if(n||(n=p()),!n)throw pe.create("no-options");const o=ce.get(i);if(o){if(b(n,o.options)&&b(r,o.config))return o;throw pe.create("duplicate-app",{appName:i})}const a=new D(i);for(const e of le.values())a.addComponent(e);const s=new fe(n,r,a);return ce.set(i,s),s}function ge(e,t,n){var r;let i=null!==(r=se[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${i}" with version "${t}":`];return o&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void oe.warn(e.join(" "))}he(new O(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}const ye="firebase-heartbeat-store";let we=null;function be(){return we||(we=function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const a=indexedDB.open(e,t),s=J(a);return r&&a.addEventListener("upgradeneeded",(e=>{r(J(a.result),e.oldVersion,e.newVersion,J(a.transaction),e)})),n&&a.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),s.then((e=>{o&&e.addEventListener("close",(()=>o())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),s}("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(ye)}}).catch((e=>{throw pe.create("idb-open",{originalErrorMessage:e.message})}))),we}async function _e(e,t){try{const n=(await be()).transaction(ye,"readwrite"),r=n.objectStore(ye);await r.put(t,ke(e)),await n.done}catch(e){if(e instanceof g)oe.warn(e.message);else{const t=pe.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});oe.warn(t.message)}}}function ke(e){return`${e.name}!${e.options.appId}`}class Ie{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Se(t),this._heartbeatsCachePromise=this._storage.read().then((e=>(this._heartbeatsCache=e,e)))}async triggerHeartbeat(){const e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=Ee();if(null===this._heartbeatsCache&&(this._heartbeatsCache=await this._heartbeatsCachePromise),this._heartbeatsCache.lastSentHeartbeatDate!==t&&!this._heartbeatsCache.heartbeats.some((e=>e.date===t)))return this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null===this._heartbeatsCache||0===this._heartbeatsCache.heartbeats.length)return"";const e=Ee(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find((e=>e.agent===i.agent));if(e){if(e.dates.push(i.date),Pe(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Pe(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),r=c(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}}function Ee(){return(new Date).toISOString().substring(0,10)}class Se{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!function(){try{return"object"==typeof indexedDB}catch(e){return!1}}()&&new Promise(((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})).then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){return await async function(e){try{const t=await be();return await t.transaction(ye).objectStore(ye).get(ke(e))}catch(e){if(e instanceof g)oe.warn(e.message);else{const t=pe.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});oe.warn(t.message)}}}(this.app)||{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return _e(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return _e(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function Pe(e){return c(JSON.stringify({version:2,heartbeats:e})).length}var Ce;Ce="",he(new O("platform-logger",(e=>new ne(e)),"PRIVATE")),he(new O("heartbeat",(e=>new Ie(e)),"PRIVATE")),ge(re,ie,Ce),ge(re,ie,"esm2017"),ge("fire-js","");ge("firebase","10.5.0","app");function Oe(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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}Object.create;Object.create;function Te(e){return void 0!==e&&void 0!==e.enterprise}class xe{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some((e=>"EMAIL_PASSWORD_PROVIDER"===e.provider&&"OFF"!==e.enforcementState))}}function De(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Ae=De,Le=new y("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),Ne=new M("@firebase/auth");function je(e,...t){Ne.logLevel<=L.ERROR&&Ne.error(`Auth (${me}): ${e}`,...t)}function Re(e,...t){throw Be(e,...t)}function Fe(e,...t){return Be(e,...t)}function Me(e,t,n){const r=Object.assign(Object.assign({},Ae()),{[t]:n});return new y("auth","Firebase",r).create(t,{appName:e.name})}function Ue(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&Re(e,"argument-error"),Me(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Be(e,...t){if("string"!=typeof e){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return Le.create(e,...t)}function He(e,t,...n){if(!e)throw Be(t,...n)}function $e(e){const t="INTERNAL ASSERTION FAILED: "+e;throw je(t),new Error(t)}function Ve(e,t){e||$e(t)}function qe(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function ze(){return"http:"===Ge()||"https:"===Ge()}function Ge(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}function We(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(ze()||function(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}()||"connection"in navigator))||navigator.onLine}class Ke{constructor(e,t){this.shortDelay=e,this.longDelay=t,Ve(t>e,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return We()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function Ye(e,t){Ve(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class Je{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:void $e("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:void $e("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:void $e("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Qe={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Xe=new Ke(3e4,6e4);function Ze(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function et(e,t,n,r,i={}){return tt(e,i,(async()=>{let i={},o={};r&&("GET"===t?o=r:i={body:JSON.stringify(r)});const a=k(Object.assign({key:e.config.apiKey},o)).slice(1),s=await e._getAdditionalHeaders();return s["Content-Type"]="application/json",e.languageCode&&(s["X-Firebase-Locale"]=e.languageCode),Je.fetch()(rt(e,e.config.apiHost,n,a),Object.assign({method:t,headers:s,referrerPolicy:"no-referrer"},i))}))}async function tt(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},Qe),t);try{const t=new it(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw ot(e,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const t=i.ok?o.errorMessage:o.error.message,[n,a]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw ot(e,"credential-already-in-use",o);if("EMAIL_EXISTS"===n)throw ot(e,"email-already-in-use",o);if("USER_DISABLED"===n)throw ot(e,"user-disabled",o);const s=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(a)throw Me(e,s,a);Re(e,s)}}catch(t){if(t instanceof g)throw t;Re(e,"network-request-failed",{message:String(t)})}}async function nt(e,t,n,r,i={}){const o=await et(e,t,n,r,i);return"mfaPendingCredential"in o&&Re(e,"multi-factor-auth-required",{_serverResponse:o}),o}function rt(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?Ye(e.config,i):`${e.config.apiScheme}://${i}`}class it{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise(((e,t)=>{this.timer=setTimeout((()=>t(Fe(this.auth,"network-request-failed"))),Xe.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}function ot(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=Fe(e,t,r);return i.customData._tokenResponse=n,i}async function at(e,t){return et(e,"GET","/v2/recaptchaConfig",Ze(e,t))}function st(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function ct(e){return 1e3*Number(e)}function lt(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return je("JWT malformed, contained fewer than 3 sections"),null;try{const e=l(n);return e?JSON.parse(e):(je("Failed to decode base64 JWT payload"),null)}catch(e){return je("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}async function ut(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof g&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class ht{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout((async()=>{await this.iteration()}),t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===(null==e?void 0:e.code)&&this.schedule(!0))}this.schedule()}}class dt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=st(this.lastLoginAt),this.creationTime=st(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function pt(e){var t;const n=e.auth,r=await e.getIdToken(),i=await ut(e,async function(e,t){return et(e,"POST","/v1/accounts:lookup",t)}(n,{idToken:r}));He(null==i?void 0:i.users.length,n,"internal-error");const o=i.users[0];e._notifyReloadListener(o);const a=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?o.providerUserInfo.map((e=>{var{providerId:t}=e,n=Oe(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[];const s=(c=e.providerData,l=a,[...c.filter((e=>!l.some((t=>t.providerId===e.providerId)))),...l]);var c,l;const u=e.isAnonymous,h=!(e.email&&o.passwordHash||(null==s?void 0:s.length)),d=!!u&&h,p={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:s,metadata:new dt(o.createdAt,o.lastLoginAt),isAnonymous:d};Object.assign(e,p)}class ft{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){He(e.idToken,"internal-error"),He(void 0!==e.idToken,"internal-error"),He(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):function(e){const t=lt(e);return He(t,"internal-error"),He(void 0!==t.exp,"internal-error"),He(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return He(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired?this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:i}=await async function(e,t){const n=await tt(e,{},(async()=>{const n=k({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:i}=e.config,o=rt(e,r,"/v1/token",`key=${i}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Je.fetch()(o,{method:"POST",headers:a,body:n})}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(i))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,o=new ft;return n&&(He("string"==typeof n,"internal-error",{appName:e}),o.refreshToken=n),r&&(He("string"==typeof r,"internal-error",{appName:e}),o.accessToken=r),i&&(He("number"==typeof i,"internal-error",{appName:e}),o.expirationTime=i),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new ft,this.toJSON())}_performRefresh(){return $e("not implemented")}}function mt(e,t){He("string"==typeof e||void 0===e,"internal-error",{appName:t})}class vt{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=Oe(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ht(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new dt(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await ut(this,this.stsTokenManager.getToken(this.auth,e));return He(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=C(e),r=await n.getIdToken(t),i=lt(r);He(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const o="object"==typeof i.firebase?i.firebase:void 0,a=null==o?void 0:o.sign_in_provider;return{claims:i,token:r,authTime:st(ct(i.auth_time)),issuedAtTime:st(ct(i.iat)),expirationTime:st(ct(i.exp)),signInProvider:a||null,signInSecondFactor:(null==o?void 0:o.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=C(e);await pt(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(He(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map((e=>Object.assign({},e))),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new vt(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){He(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await pt(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await ut(this,async function(e,t){return et(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((e=>Object.assign({},e))),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,i,o,a,s,c,l;const u=null!==(n=t.displayName)&&void 0!==n?n:void 0,h=null!==(r=t.email)&&void 0!==r?r:void 0,d=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,p=null!==(o=t.photoURL)&&void 0!==o?o:void 0,f=null!==(a=t.tenantId)&&void 0!==a?a:void 0,m=null!==(s=t._redirectEventId)&&void 0!==s?s:void 0,v=null!==(c=t.createdAt)&&void 0!==c?c:void 0,g=null!==(l=t.lastLoginAt)&&void 0!==l?l:void 0,{uid:y,emailVerified:w,isAnonymous:b,providerData:_,stsTokenManager:k}=t;He(y&&k,e,"internal-error");const I=ft.fromJSON(this.name,k);He("string"==typeof y,e,"internal-error"),mt(u,e.name),mt(h,e.name),He("boolean"==typeof w,e,"internal-error"),He("boolean"==typeof b,e,"internal-error"),mt(d,e.name),mt(p,e.name),mt(f,e.name),mt(m,e.name),mt(v,e.name),mt(g,e.name);const E=new vt({uid:y,auth:e,email:h,emailVerified:w,displayName:u,isAnonymous:b,photoURL:p,phoneNumber:d,tenantId:f,stsTokenManager:I,createdAt:v,lastLoginAt:g});return _&&Array.isArray(_)&&(E.providerData=_.map((e=>Object.assign({},e)))),m&&(E._redirectEventId=m),E}static async _fromIdTokenResponse(e,t,n=!1){const r=new ft;r.updateFromServerResponse(t);const i=new vt({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await pt(i),i}}const gt=new Map;function yt(e){Ve(e instanceof Function,"Expected a class definition");let t=gt.get(e);return t?(Ve(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,gt.set(e,t),t)}class wt{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}wt.type="NONE";const bt=wt;function _t(e,t,n){return`firebase:${e}:${t}:${n}`}class kt{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=_t(this.userKey,r.apiKey,i),this.fullPersistenceKey=_t("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?vt._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new kt(yt(bt),e,n);const r=(await Promise.all(t.map((async e=>{if(await e._isAvailable())return e})))).filter((e=>e));let i=r[0]||yt(bt);const o=_t(n,e.config.apiKey,e.name);let a=null;for(const n of t)try{const t=await n._get(o);if(t){const r=vt._fromJSON(e,t);n!==i&&(a=r),i=n;break}}catch(e){}const s=r.filter((e=>e._shouldAllowMigration));return i._shouldAllowMigration&&s.length?(i=s[0],a&&await i._set(o,a.toJSON()),await Promise.all(t.map((async e=>{if(e!==i)try{await e._remove(o)}catch(e){}}))),new kt(i,e,n)):new kt(i,e,n)}}function It(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Ct(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Et(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Tt(t))return"Blackberry";if(xt(t))return"Webos";if(St(t))return"Safari";if((t.includes("chrome/")||Pt(t))&&!t.includes("edge/"))return"Chrome";if(Ot(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function Et(e=v()){return/firefox\//i.test(e)}function St(e=v()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Pt(e=v()){return/crios\//i.test(e)}function Ct(e=v()){return/iemobile/i.test(e)}function Ot(e=v()){return/android/i.test(e)}function Tt(e=v()){return/blackberry/i.test(e)}function xt(e=v()){return/webos/i.test(e)}function Dt(e=v()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function At(){return function(){const e=v();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function Lt(e=v()){return Dt(e)||Ot(e)||xt(e)||Tt(e)||/windows phone/i.test(e)||Ct(e)}function Nt(e,t=[]){let n;switch(e){case"Browser":n=It(v());break;case"Worker":n=`${It(v())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${me}/${r}`}class jt{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise(((n,r)=>{try{n(e(t))}catch(e){r(e)}}));n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const e of t)try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}class Rt{constructor(e){var t,n,r,i;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=o.minPasswordLength)&&void 0!==t?t:6,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),void 0!==o.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),void 0!==o.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),void 0!==o.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),void 0!==o.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(r=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==r?r:"",this.forceUpgradeOnSignin=null!==(i=e.forceUpgradeOnSignin)&&void 0!==i&&i,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,r,i,o,a;const s={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,s),this.validatePasswordCharacterOptions(e,s),s.isValid&&(s.isValid=null===(t=s.meetsMinPasswordLength)||void 0===t||t),s.isValid&&(s.isValid=null===(n=s.meetsMaxPasswordLength)||void 0===n||n),s.isValid&&(s.isValid=null===(r=s.containsLowercaseLetter)||void 0===r||r),s.isValid&&(s.isValid=null===(i=s.containsUppercaseLetter)||void 0===i||i),s.isValid&&(s.isValid=null===(o=s.containsNumericCharacter)||void 0===o||o),s.isValid&&(s.isValid=null===(a=s.containsNonAlphanumericCharacter)||void 0===a||a),s}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r<e.length;r++)n=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,r,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class Ft{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Ut(this),this.idTokenSubscription=new Ut(this),this.beforeStateQueue=new jt(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Le,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=yt(t)),this._initializationPromise=this.queue((async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await kt.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUser(e){var t;const n=await this.assertedPersistence.getCurrentUser();let r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,o=null==r?void 0:r._redirectEventId,a=await this.tryRedirectSignIn(e);n&&n!==o||!(null==a?void 0:a.user)||(r=a.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(e){r=n,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(e)))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return He(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await pt(e)}catch(e){if("auth/network-request-failed"!==(null==e?void 0:e.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?C(e):null;return t&&He(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&He(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue((async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()}))}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue((async()=>{await this.assertedPersistence.setPersistence(yt(e))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return et(e,"GET","/v2/passwordPolicy",Ze(e,t))}(this),t=new Rt(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new y("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise(((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged((()=>{n(),e()}),t)}}))}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&yt(e)||this._popupRedirectResolver;He(t,this,"argument-error"),this.redirectPersistenceManager=await kt.create(this,[yt(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue((async()=>{})),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(e)))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const i="function"==typeof t?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(He(a,this,"internal-error"),a.then((()=>{o||i(this.currentUser)})),"function"==typeof t){const i=e.addObserver(t,n,r);return()=>{o=!0,i()}}{const n=e.addObserver(t);return()=>{o=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return He(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Nt(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){Ne.logLevel<=L.WARN&&Ne.warn(`Auth (${me}): ${e}`,...t)}(`Error while retrieving App Check token: ${t.error}`),null==t?void 0:t.token}}function Mt(e){return C(e)}class Ut{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e,t){const n=new S(e,t);return n.subscribe.bind(n)}((e=>this.observer=e))}get next(){return He(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function Bt(e){return new Promise(((t,n)=>{const r=document.createElement("script");var i,o;r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=Fe("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",(null!==(o=null===(i=document.getElementsByTagName("head"))||void 0===i?void 0:i[0])&&void 0!==o?o:document).appendChild(r)}))}function Ht(e){return`__${e}${Math.floor(1e6*Math.random())}`}class $t{constructor(e){this.type="recaptcha-enterprise",this.auth=Mt(e)}async verify(e="verify",t=!1){function n(t,n,r){const i=window.grecaptcha;Te(i)?i.enterprise.ready((()=>{i.enterprise.execute(t,{action:e}).then((e=>{n(e)})).catch((()=>{n("NO_RECAPTCHA")}))})):r(Error("No reCAPTCHA enterprise script loaded."))}return new Promise(((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise((async(t,n)=>{at(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then((r=>{if(void 0!==r.recaptchaKey){const n=new xe(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))})).catch((e=>{n(e)}))}))})(this.auth).then((i=>{if(!t&&Te(window.grecaptcha))n(i,e,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));Bt("https://www.google.com/recaptcha/enterprise.js?render="+i).then((()=>{n(i,e,r)})).catch((e=>{r(e)}))}})).catch((e=>{r(e)}))}))}}async function Vt(e,t,n,r=!1){const i=new $t(e);let o;try{o=await i.verify(n)}catch(e){o=await i.verify(n,!0)}const a=Object.assign({},t);return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}function qt(e,t,n){const r=Mt(e);He(r._canInitEmulator,r,"emulator-config-failed"),He(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(null==n?void 0:n.disableWarnings),o=zt(t),{host:a,port:s}=function(e){const t=zt(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:Gt(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:Gt(t)}}}(t),c=null===s?"":`:${s}`;r.config.emulator={url:`${o}//${a}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:a,port:s,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.");"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function zt(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Gt(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Wt{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return $e("not implemented")}_getIdTokenResponse(e){return $e("not implemented")}_linkToIdToken(e,t){return $e("not implemented")}_getReauthenticationResolver(e){return $e("not implemented")}}async function Kt(e,t){return et(e,"POST","/v1/accounts:update",t)}async function Yt(e,t){return nt(e,"POST","/v1/accounts:signInWithPassword",Ze(e,t))}async function Jt(e,t){return et(e,"POST","/v1/accounts:sendOobCode",Ze(e,t))}async function Qt(e,t){return Jt(e,t)}class Xt extends Wt{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new Xt(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new Xt(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if((null==t?void 0:t.email)&&(null==t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){var t;switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};if(null===(t=e._getRecaptchaConfig())||void 0===t?void 0:t.emailPasswordEnabled){const t=await Vt(e,n,"signInWithPassword");return Yt(e,t)}return Yt(e,n).catch((async t=>{if("auth/missing-recaptcha-token"===t.code){console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const t=await Vt(e,n,"signInWithPassword");return Yt(e,t)}return Promise.reject(t)}));case"emailLink":return async function(e,t){return nt(e,"POST","/v1/accounts:signInWithEmailLink",Ze(e,t))}(e,{email:this._email,oobCode:this._password});default:Re(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Kt(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(e,t){return nt(e,"POST","/v1/accounts:signInWithEmailLink",Ze(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:Re(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Zt(e,t){return nt(e,"POST","/v1/accounts:signInWithIdp",Ze(e,t))}class en extends Wt{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new en(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):Re("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,i=Oe(t,["providerId","signInMethod"]);if(!n||!r)return null;const o=new en(n,r);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(e){return Zt(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Zt(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Zt(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=k(t)}return e}}const tn={USER_NOT_FOUND:"user-not-found"};class nn extends Wt{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new nn({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new nn({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return nt(e,"POST","/v1/accounts:signInWithPhoneNumber",Ze(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await nt(e,"POST","/v1/accounts:signInWithPhoneNumber",Ze(e,t));if(n.temporaryProof)throw ot(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return nt(e,"POST","/v1/accounts:signInWithPhoneNumber",Ze(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),tn)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new nn({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class rn{constructor(e){var t,n,r,i,o,a;const s=I(E(e)),c=null!==(t=s.apiKey)&&void 0!==t?t:null,l=null!==(n=s.oobCode)&&void 0!==n?n:null,u=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=s.mode)&&void 0!==r?r:null);He(c&&l&&u,"argument-error"),this.apiKey=c,this.operation=u,this.code=l,this.continueUrl=null!==(i=s.continueUrl)&&void 0!==i?i:null,this.languageCode=null!==(o=s.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(a=s.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=I(E(e)).link,n=t?I(E(t)).deep_link_id:null,r=I(E(e)).deep_link_id;return(r?I(E(r)).link:null)||r||n||t||e}(e);try{return new rn(t)}catch(e){return null}}}class on{constructor(){this.providerId=on.PROVIDER_ID}static credential(e,t){return Xt._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=rn.parseLink(t);return He(n,"argument-error"),Xt._fromEmailAndCode(e,n.code,n.tenantId)}}on.PROVIDER_ID="password",on.EMAIL_PASSWORD_SIGN_IN_METHOD="password",on.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class an{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class sn extends an{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class cn extends sn{constructor(){super("facebook.com")}static credential(e){return en._fromParams({providerId:cn.PROVIDER_ID,signInMethod:cn.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return cn.credentialFromTaggedObject(e)}static credentialFromError(e){return cn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return cn.credential(e.oauthAccessToken)}catch(e){return null}}}cn.FACEBOOK_SIGN_IN_METHOD="facebook.com",cn.PROVIDER_ID="facebook.com";class ln extends sn{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return en._fromParams({providerId:ln.PROVIDER_ID,signInMethod:ln.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return ln.credentialFromTaggedObject(e)}static credentialFromError(e){return ln.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return ln.credential(t,n)}catch(e){return null}}}ln.GOOGLE_SIGN_IN_METHOD="google.com",ln.PROVIDER_ID="google.com";class un extends sn{constructor(){super("github.com")}static credential(e){return en._fromParams({providerId:un.PROVIDER_ID,signInMethod:un.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return un.credentialFromTaggedObject(e)}static credentialFromError(e){return un.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return un.credential(e.oauthAccessToken)}catch(e){return null}}}un.GITHUB_SIGN_IN_METHOD="github.com",un.PROVIDER_ID="github.com";class hn extends sn{constructor(){super("twitter.com")}static credential(e,t){return en._fromParams({providerId:hn.PROVIDER_ID,signInMethod:hn.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return hn.credentialFromTaggedObject(e)}static credentialFromError(e){return hn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return hn.credential(t,n)}catch(e){return null}}}async function dn(e,t){return nt(e,"POST","/v1/accounts:signUp",Ze(e,t))}hn.TWITTER_SIGN_IN_METHOD="twitter.com",hn.PROVIDER_ID="twitter.com";class pn{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,r=!1){const i=await vt._fromIdTokenResponse(e,n,r),o=fn(n);return new pn({user:i,providerId:o,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=fn(n);return new pn({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function fn(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class mn extends g{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,mn.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new mn(e,t,n,r)}}function vn(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch((n=>{if("auth/multi-factor-auth-required"===n.code)throw mn._fromErrorAndOperation(e,n,t,r);throw n}))}async function gn(e,t,n=!1){const r=await ut(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return pn._forOperation(e,"link",r)}async function yn(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const o=await ut(e,vn(r,i,t,e),n);He(o.idToken,r,"internal-error");const a=lt(o.idToken);He(a,r,"internal-error");const{sub:s}=a;return He(e.uid===s,r,"user-mismatch"),pn._forOperation(e,i,o)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&Re(r,"user-mismatch"),e}}async function wn(e,t,n=!1){const r="signIn",i=await vn(e,r,t),o=await pn._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(o.user),o}async function bn(e,t){return wn(Mt(e),t)}function _n(e,t,n){var r;He((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"invalid-continue-uri"),He(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(He(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(He(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function kn(e){const t=Mt(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function In(e,t,n){var r;const i=Mt(e),o={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};if(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await Vt(i,o,"getOobCode",!0);n&&_n(i,e,n),await Qt(i,e)}else n&&_n(i,o,n),await Qt(i,o).catch((async e=>{if("auth/missing-recaptcha-token"!==e.code)return Promise.reject(e);{console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");const e=await Vt(i,o,"getOobCode",!0);n&&_n(i,e,n),await Qt(i,e)}}))}async function En(e,t,n){var r;const i=Mt(e),o={returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"};let a;if(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await Vt(i,o,"signUpPassword");a=dn(i,e)}else a=dn(i,o).catch((async e=>{if("auth/missing-recaptcha-token"===e.code){console.log("Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow.");const e=await Vt(i,o,"signUpPassword");return dn(i,e)}throw e}));const s=await a.catch((t=>{throw"auth/password-does-not-meet-requirements"===t.code&&kn(e),t})),c=await pn._fromIdTokenResponse(i,"signIn",s);return await i._updateCurrentUser(c.user),c}function Sn(e,t,n){return bn(C(e),on.credential(t,n)).catch((async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&kn(e),t}))}async function Pn(e,t){const n=C(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&_n(n.auth,r,t);const{email:i}=await async function(e,t){return Jt(e,t)}(n.auth,r);i!==e.email&&await e.reload()}function Cn(e){return C(e).signOut()}new WeakMap;const On="__sak";class Tn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(On,"1"),this.storage.removeItem(On),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class xn extends Tn{constructor(){super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const e=v();return St(e)||Dt(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=Lt(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys(((e,t,n)=>{this.notifyListeners(e,n)}));const n=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const r=this.storage.getItem(n);if(e.newValue!==r)null!==e.newValue?this.storage.setItem(n,e.newValue):this.storage.removeItem(n);else if(this.localCache[n]===e.newValue&&!t)return}const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},i=this.storage.getItem(n);At()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)}))}),1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}xn.type="LOCAL";const Dn=xn;class An extends Tn{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(e,t){}_removeListener(e,t){}}An.type="SESSION";const Ln=An;class Nn{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find((t=>t.isListeningto(e)));if(t)return t;const n=new Nn(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,o=this.handlersMap[r];if(!(null==o?void 0:o.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const a=Array.from(o).map((async e=>e(t.origin,i))),s=await function(e){return Promise.all(e.map((async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}})))}(a);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:s})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function jn(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}Nn.receivers=[];class Rn{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const r="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,o;return new Promise(((a,s)=>{const c=jn("",20);r.port1.start();const l=setTimeout((()=>{s(new Error("unsupported_event"))}),n);o={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===c)switch(t.data.status){case"ack":clearTimeout(l),i=setTimeout((()=>{s(new Error("timeout"))}),3e3);break;case"done":clearTimeout(i),a(t.data.response);break;default:clearTimeout(l),clearTimeout(i),s(new Error("invalid_response"))}}},this.handlers.add(o),r.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])})).finally((()=>{o&&this.removeMessageHandler(o)}))}}function Fn(){return window}function Mn(){return void 0!==Fn().WorkerGlobalScope&&"function"==typeof Fn().importScripts}const Un="firebaseLocalStorageDb",Bn="firebaseLocalStorage",Hn="fbase_key";class $n{constructor(e){this.request=e}toPromise(){return new Promise(((e,t)=>{this.request.addEventListener("success",(()=>{e(this.request.result)})),this.request.addEventListener("error",(()=>{t(this.request.error)}))}))}}function Vn(e,t){return e.transaction([Bn],t?"readwrite":"readonly").objectStore(Bn)}function qn(){const e=indexedDB.open(Un,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(Bn,{keyPath:Hn})}catch(e){n(e)}})),e.addEventListener("success",(async()=>{const n=e.result;n.objectStoreNames.contains(Bn)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(Un);return new $n(e).toPromise()}(),t(await qn()))}))}))}async function zn(e,t,n){const r=Vn(e,!0).put({[Hn]:t,value:n});return new $n(r).toPromise()}function Gn(e,t){const n=Vn(e,!0).delete(t);return new $n(n).toPromise()}class Wn{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await qn()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Mn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Nn._getInstance(Mn()?self:null),this.receiver._subscribe("keyChanged",(async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)}))),this.receiver._subscribe("ping",(async(e,t)=>["keyChanged"]))}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new Rn(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await qn();return await zn(e,On,"1"),await Gn(e,On),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite((async()=>(await this._withRetries((n=>zn(n,e,t))),this.localCache[e]=t,this.notifyServiceWorker(e))))}async _get(e){const t=await this._withRetries((t=>async function(e,t){const n=Vn(e,!1).get(t),r=await new $n(n).toPromise();return void 0===r?null:r.value}(t,e)));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite((async()=>(await this._withRetries((t=>Gn(t,e))),delete this.localCache[e],this.notifyServiceWorker(e))))}async _poll(){const e=await this._withRetries((e=>{const t=Vn(e,!1).getAll();return new $n(t).toPromise()}));if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;for(const{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}Wn.type="LOCAL";const Kn=Wn;Ht("rcb"),new Ke(3e4,6e4);const Yn="recaptcha";async function Jn(e,t,n){var r;const i=await n.verify();try{let o;if(He("string"==typeof i,e,"argument-error"),He(n.type===Yn,e,"argument-error"),o="string"==typeof t?{phoneNumber:t}:t,"session"in o){const t=o.session;if("phoneNumber"in o){He("enroll"===t.type,e,"internal-error");const n=await function(e,t){return et(e,"POST","/v2/accounts/mfaEnrollment:start",Ze(e,t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:o.phoneNumber,recaptchaToken:i}});return n.phoneSessionInfo.sessionInfo}{He("signin"===t.type,e,"internal-error");const n=(null===(r=o.multiFactorHint)||void 0===r?void 0:r.uid)||o.multiFactorUid;He(n,e,"missing-multi-factor-info");const a=await function(e,t){return et(e,"POST","/v2/accounts/mfaSignIn:start",Ze(e,t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:i}});return a.phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return et(e,"POST","/v1/accounts:sendVerificationCode",Ze(e,t))}(e,{phoneNumber:o.phoneNumber,recaptchaToken:i});return t}}finally{n._reset()}}class Qn{constructor(e){this.providerId=Qn.PROVIDER_ID,this.auth=Mt(e)}verifyPhoneNumber(e,t){return Jn(this.auth,e,C(t))}static credential(e,t){return nn._fromVerification(e,t)}static credentialFromResult(e){const t=e;return Qn.credentialFromTaggedObject(t)}static credentialFromError(e){return Qn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:n}=e;return t&&n?nn._fromTokenResponse(t,n):null}}function Xn(e,t){return t?yt(t):(He(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}Qn.PROVIDER_ID="phone",Qn.PHONE_SIGN_IN_METHOD="phone";class Zn extends Wt{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Zt(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Zt(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Zt(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function er(e){return wn(e.auth,new Zn(e),e.bypassAuthState)}function tr(e){const{auth:t,user:n}=e;return He(n,t,"internal-error"),yn(n,new Zn(e),e.bypassAuthState)}async function nr(e){const{auth:t,user:n}=e;return He(n,t,"internal-error"),gn(n,new Zn(e),e.bypassAuthState)}class rr{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}}))}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:o,type:a}=e;if(o)return void this.reject(o);const s={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(s))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return er;case"linkViaPopup":case"linkViaRedirect":return nr;case"reauthViaPopup":case"reauthViaRedirect":return tr;default:Re(this.auth,"internal-error")}}resolve(e){Ve(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Ve(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const ir=new Ke(2e3,1e4);async function or(e,t,n){const r=Mt(e);Ue(e,t,an);const i=Xn(r,n);return new ar(r,"signInViaPopup",t,i).executeNotNull()}class ar extends rr{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,ar.currentPopupAction&&ar.currentPopupAction.cancel(),ar.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return He(e,this.auth,"internal-error"),e}async onExecution(){Ve(1===this.filter.length,"Popup operations only handle one event");const e=jn();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch((e=>{this.reject(e)})),this.resolver._isIframeWebStorageSupported(this.auth,(e=>{e||this.reject(Fe(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(Fe(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,ar.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(Fe(this.auth,"popup-closed-by-user"))}),8e3):this.pollId=window.setTimeout(e,ir.get())};e()}}ar.currentPopupAction=null;const sr=new Map;class cr extends rr{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=sr.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=hr(t),r=ur(e);if(!await r._isAvailable())return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}sr.set(this.auth._key(),e)}return this.bypassAuthState||sr.set(this.auth._key(),(()=>Promise.resolve(null))),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function lr(e,t){sr.set(e._key(),t)}function ur(e){return yt(e._redirectPersistence)}function hr(e){return _t("pendingRedirect",e.config.apiKey,e.name)}async function dr(e,t,n=!1){const r=Mt(e),i=Xn(r,t),o=new cr(r,i,n),a=await o.execute();return a&&!n&&(delete a.user._redirectEventId,await r._persistUserIfCurrent(a.user),await r._setRedirectUser(null,t)),a}class pr{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach((n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))})),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return mr(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!mr(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(Fe(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(fr(e))}saveEventToCache(e){this.cachedEventUids.add(fr(e)),this.lastProcessedEventTime=Date.now()}}function fr(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((e=>e)).join("-")}function mr({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null==t?void 0:t.code)}const vr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,gr=/^https?/;async function yr(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return et(e,"GET","/v1/projects",t)}(e);for(const e of t)try{if(wr(e))return}catch(e){}Re(e,"unauthorized-domain")}function wr(e){const t=qe(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!gr.test(n))return!1;if(vr.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const br=new Ke(3e4,6e4);function _r(){const e=Fn().___jsl;if(null==e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}let kr=null;function Ir(e){return kr=kr||function(e){return new Promise(((t,n)=>{var r,i,o;function a(){_r(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{_r(),n(Fe(e,"network-request-failed"))},timeout:br.get()})}if(null===(i=null===(r=Fn().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(o=Fn().gapi)||void 0===o?void 0:o.load)){const t=Ht("iframefcb");return Fn()[t]=()=>{gapi.load?a():n(Fe(e,"network-request-failed"))},Bt(`https://apis.google.com/js/api.js?onload=${t}`).catch((e=>n(e)))}a()}})).catch((e=>{throw kr=null,e}))}(e),kr}const Er=new Ke(5e3,15e3),Sr={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Pr=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Cr(e){const t=e.config;He(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?Ye(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,r={apiKey:t.apiKey,appName:e.name,v:me},i=Pr.get(e.config.apiHost);i&&(r.eid=i);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${k(r).slice(1)}`}const Or={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Tr{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function xr(e,t,n,r=500,i=600){const o=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let s="";const c=Object.assign(Object.assign({},Or),{width:r.toString(),height:i.toString(),top:o,left:a}),l=v().toLowerCase();n&&(s=Pt(l)?"_blank":n),Et(l)&&(t=t||"http://localhost",c.scrollbars="yes");const u=Object.entries(c).reduce(((e,[t,n])=>`${e}${t}=${n},`),"");if(function(e=v()){var t;return Dt(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(l)&&"_self"!==s)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",s),new Tr(null);const h=window.open(t||"",s,u);He(h,e,"popup-blocked");try{h.focus()}catch(e){}return new Tr(h)}const Dr="__/auth/handler",Ar="emulator/auth/handler",Lr=encodeURIComponent("fac");async function Nr(e,t,n,r,i,o){He(e.config.authDomain,e,"auth-domain-config-required"),He(e.config.apiKey,e,"invalid-api-key");const a={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:me,eventId:i};if(t instanceof an){t.setDefaultLanguage(e.languageCode),a.providerId=t.providerId||"",function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(t.getCustomParameters())||(a.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(o||{}))a[e]=t}if(t instanceof sn){const e=t.getScopes().filter((e=>""!==e));e.length>0&&(a.scopes=e.join(","))}e.tenantId&&(a.tid=e.tenantId);const s=a;for(const e of Object.keys(s))void 0===s[e]&&delete s[e];const c=await e._getAppCheckToken(),l=c?`#${Lr}=${encodeURIComponent(c)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/${Dr}`;return Ye(e,Ar)}(e)}?${k(s).slice(1)}${l}`}const jr="webStorageSupport";const Rr=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Ln,this._completeRedirectFn=dr,this._overrideRedirectResult=lr}async _openPopup(e,t,n,r){var i;Ve(null===(i=this.eventManagers[e._key()])||void 0===i?void 0:i.manager,"_initialize() not called before _openPopup()");return xr(e,await Nr(e,t,n,qe(),r),jn())}async _openRedirect(e,t,n,r){await this._originValidation(e);return function(e){Fn().location.href=e}(await Nr(e,t,n,qe(),r)),new Promise((()=>{}))}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(Ve(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch((()=>{delete this.eventManagers[t]})),n}async initAndGetManager(e){const t=await async function(e){const t=await Ir(e),n=Fn().gapi;return He(n,e,"internal-error"),t.open({where:document.body,url:Cr(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Sr,dontclear:!0},(t=>new Promise((async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=Fe(e,"network-request-failed"),o=Fn().setTimeout((()=>{r(i)}),Er.get());function a(){Fn().clearTimeout(o),n(t)}t.ping(a).then(a,(()=>{r(i)}))}))))}(e),n=new pr(e);return t.register("authEvent",(t=>{He(null==t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(jr,{type:jr},(n=>{var r;const i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r[jr];void 0!==i&&t(!!i),Re(e,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=yr(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Lt()||St()||Dt()}};var Fr="@firebase/auth",Mr="1.3.0";class Ur{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged((t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)}));this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){He(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const Br=f("authIdTokenMaxAge")||300;let Hr=null;function $r(e=function(e=ae){const t=ce.get(e);if(!t&&e===ae&&p())return ve();if(!t)throw pe.create("no-app",{appName:e});return t}()){const t=de(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=de(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(b(n.getOptions(),null!=t?t:{}))return e;Re(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:Rr,persistence:[Kn,Dn,Ln]}),r=f("authTokenSyncURL");if(r){const e=(i=r,async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>Br)return;const r=null==t?void 0:t.token;Hr!==r&&(Hr=r,await fetch(i,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))});!function(e,t,n){C(e).beforeAuthStateChanged(t,n)}(n,e,(()=>e(n.currentUser))),function(e,t,n,r){C(e).onIdTokenChanged(t,n,r)}(n,(t=>e(t)))}var i;const o=d("auth");return o&&qt(n,`http://${o}`),n}var Vr;Vr="Browser",he(new O("auth",((e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=n.options;He(o&&!o.includes(":"),"invalid-api-key",{appName:n.name});const s={apiKey:o,authDomain:a,clientPlatform:Vr,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Nt(Vr)},c=new Ft(n,r,i,s);return function(e,t){const n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(yt);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(c,t),c}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((e,t,n)=>{e.getProvider("auth-internal").initialize()}))),he(new O("auth-internal",(e=>(e=>new Ur(e))(Mt(e.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),ge(Fr,Mr,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(Vr)),ge(Fr,Mr,"esm2017");var qr=n(2805),zr=n(694);function Gr(e){return Gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gr(e)}function Wr(){Wr=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new S(i||[]);return r(a,"_invoke",{value:_(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h={};function d(){}function p(){}function f(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(P([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=f.prototype=d.prototype=Object.create(m);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var c=u(e[r],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==Gr(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return i("throw",e,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function k(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=u(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function P(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return p.prototype=f,r(y,"constructor",{value:f,configurable:!0}),r(f,"constructor",{value:p,configurable:!0}),p.displayName=c(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},w(b.prototype),c(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(y),c(y,s,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=P,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:P(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function Kr(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Yr(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Kr(o,r,i,a,s,"next",e)}function s(e){Kr(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Jr(e,t,n,i,o){var a=window.__pt.settings.loginErrors,s=this,c=new r,l=window.__pt.fn,u=l.search(),h=window.__pt.settings.site,d=null,p=window.__pt.settings.site,f=ve(p.login.firebaseSettings);s.loginProviders=window.__pt.settings.site.login.providers,s.settings=window.__pt.settings.site.login.main||{},s.modalActive=!1,s.loadingSession=!1,s.loadingUserProfile=!1,s.dropdownListActive=!1,s.stepRegister=1,s.currenLink="",s.isResetpassword=!1,s.isProvider=!1,s.pageError={},s.userData={email:"",password:"",pwdconfirm:"",lastname:"",name:"",recatcha:""},s.emailInvalid=!1,s.sessionData={isLogin:!1},s.photoStyle={},s.currentErrorMsg=null,s.showBanner=!0,s.currentErrorMsgPerfil=null,s.avatarConf={color:"",avatar:""},s.eyeUser=!0,s.userDataWriten={name:"",phone:"",recaptchaToken:""},s.userProfile={name:null,contactEmail:null,phone:null,codePhone:null,birthdate:null,nationality:null,placeOfResidence:null,gender:null,createdAt:null,updatedAt:null,deletedAt:null,usersId:0,reservations:[],id:0,uid:""},s.dropdown_phones=!1,s.dropdown_lang=!1,s.dropdown_langMobile=!1,s.dropdown_nav=!1,s.dropdown_tablet=!1,s.iscodept=!1,s.codeData={},s.isResendCurrenUser=!1;var m=new qr.Z(p.domainAPIUrl),v=l.search(),g=new zr.Z(v,p),y=(g.getUserKey(o),g.getUserKeyFavorites(o));function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s.pageError.has=!0,s.pageError.type=t,s.loading=!1,s.loadingSession=!1}function b(){return(b=Yr(Wr().mark((function e(t,n){return Wr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(p.endPoints.contactCallUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)});case 2:e.sent,s.hideModalCall("modal-call",n),s.showModalHeader("modal-confirmation",null);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(){document.body.style.overflow="hidden"}function k(){document.body.style.overflow="auto"}function I(e){var t=angular.element(".bottom__container"),n=angular.element(".bottom__tab").eq(0),r=n.position().left+n.outerWidth(),i=angular.element(".bottom__mask--left"),o=angular.element(".bottom__mask--right");"left"===e&&r<0||r>70?i.hide():i.show();var a,s=(a=angular.element(".bottom__tab").last()).position().left;"right"===e&&s+a.outerWidth()>t.width()?o.hide():o.show(),angular.element(".bottom__tab").eq(0).position().left,(a=angular.element(".bottom__tab").last()).position().left+a.outerWidth()>t.width()&&o.show()}function E(e,t,n){return S.apply(this,arguments)}function S(){return S=Yr(Wr().mark((function e(n,r,i){var o,a;return Wr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.loadingSession=!0,o={headers:{"X-XSRF-TOKEN":P()}},a={uid:n,notSession:r,name:s.userData.name,lastname:s.userData.lastname,token:i||n,remember:!0},t.post(p.siteUrl+"/v1/api/login",a,o).then(function(){var e=Yr(Wr().mark((function e(t){var n;return Wr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.loadingSession=!1,200!=t.data.status){e.next=12;break}if(!r){e.next=6;break}s.stepRegister=7,e.next=10;break;case 6:return n={UserId:y,FirebaseId:a.uid,country:p.country.toUpperCase()},e.next=9,m.copyByUser(n).then((function(e){})).catch((function(e){console.error("Error fetching copyByUser:",e)}));case 9:u.redirectTo&&""!==u.redirectTo?window.location.href=p.siteUrl+u.redirectTo:window.location.href=p.siteUrl+"/";case 10:e.next=14;break;case 12:s.currentErrorMsg=t.data.response,s.stepRegister=1;case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),w);case 4:case"end":return e.stop()}}),e)}))),S.apply(this,arguments)}function P(){var e=document.querySelector("[name='_token']");return e?e.value:""}s.showModal=function(e){s.stepRegister=1,$("#".concat(e)).modal("show"),c.metricLoginAction("login",{action:"open modal"}),c.metricLoginAction("login",{action:"link header"}),c.metricHeaderSelectContent({title:"Mi cuenta"})},s.showModalHeader=function(e){$("#".concat(e)).modal("show"),s.cleaInputs()},s.hideModalCoupon=function(e){s.showBanner=!1},s.hideModalCall=function(e,t){$("#".concat(e)).modal("hide"),s.cleaInputs(t)},s.cleaInputs=function(e){s.userDataWriten={name:"",phone:"",recaptchaToken:""},e&&(e.$setPristine(),e.$setUntouched()),grecaptcha.enterprise.reset()},s.hideModal=function(e){$("#".concat(e)).modal("hide"),c.metricLoginAction("login",{action:"close modal"})},s.clickOutside=function(e,t){e.target.id===t&&s.hideModal(t)},s.clickOutsideCall=function(e,t,n){e.target.id===t&&s.hideModalCall(t,n)},s.submitForm=function(e){if(!e.$invalid)switch(s.stepRegister){case 1:e.$setPristine(),e.$setUntouched(),s.verifyEmail();break;case 2:s.loginWithEmailAndPassword(e);break;case 3:s.createUserWithEmailAndPassword(e);break;case 4:s.recoveryPassword()}},s.forgotPasswordForm=function(e){s.currentErrorMsg="",e.$setPristine(),e.$setUntouched(),s.recoveryPassword(),s.stepRegister=4},s.verifyEmail=Yr(Wr().mark((function t(){var n;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.loadingSession=!0,n=$r(f),t.prev=2,t.next=5,Sn(n,s.userData.email,"///0000");case 5:t.sent,e.$apply((function(){s.loadingSession=!1,s.stepRegister=2})),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),e.$apply((function(){s.loadingSession=!1,c.metricsErrorsLogin(t.t0.code),"auth/user-not-found"===t.t0.code||"EMAIL_NOT_FOUND"===t.t0.code?s.stepRegister=3:s.stepRegister=2}));case 12:case"end":return t.stop()}}),t,null,[[2,9]])}))),s.createUserWithEmailAndPassword=Yr(Wr().mark((function t(){var n,r;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.loadingSession=!0,n=$r(f),t.prev=2,t.next=5,En(n,s.userData.email,s.userData.password);case 5:r=t.sent,e.$apply(Yr(Wr().mark((function t(){var n,i;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.user,s.isResendCurrenUser=!1,t.prev=2,t.next=5,E(n.uid,!0,s.userData.recatcha);case 5:return i={url:p.siteUrl+"/login",handleCodeInApp:!0},t.prev=6,t.next=9,Pn(n,i);case 9:c.metricLoginAction("login",{action:"create account email"}),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(6),e.$apply((function(){s.loadingSession=!1,s.currentErrorMsg=a[t.t0.code]||"An unexpected error occurred during email verification.",c.metricsErrorsLogin(t.t0.code||s.currentErrorMsg)}));case 15:t.next=20;break;case 17:t.prev=17,t.t1=t.catch(2),e.$apply((function(){s.loadingSession=!1,s.currentErrorMsg=a[t.t1.code]||"An unexpected error occurred during session setup.",c.metricsErrorsLogin(t.t1.code||s.currentErrorMsg)}));case 20:s.loadingSession=!1;case 21:case"end":return t.stop()}}),t,null,[[2,17],[6,12]])})))),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),e.$apply((function(){s.loadingSession=!1,s.currentErrorMsg=a[t.t0.code]||"An unexpected error occurred.",c.metricsErrorsLogin(t.t0.code||s.currentErrorMsg),s.stepRegister=3}));case 12:case"end":return t.stop()}}),t,null,[[2,9]])}))),s.goToStepOne=function(){s.stepRegister=1,s.currentErrorMsg=""},e.$watch("vm.stepRegister",(function(t){window.grecaptcha&&3==t&&grecaptcha.ready((function(){grecaptcha.render("g-recaptcha-login",{sitekey:"6LdVzyYoAAAAAArBDZLZ-upafYoaZAxNT_iCpjGx",callback:function(t){e.$apply((function(){setTimeout((function(){e.$apply((function(){s.userData.recatcha=""}))}),6e4),s.userData.recatcha=t}))}})}))})),s.loginWithEmailAndPassword=Yr(Wr().mark((function t(){var n,r;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.loadingSession=!0,n=$r(f),t.prev=2,t.next=5,Sn(n,s.userData.email,s.userData.password);case 5:r=t.sent,e.$apply(Yr(Wr().mark((function t(){var i,o;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i=r.user).emailVerified){t.next=7;break}E(i.uid,!1),c.metricLoginAction("login",{action:"login email"}),s.loadingSession=!1,t.next=21;break;case 7:return s.isResendCurrenUser=!0,c.metricsErrorsLogin("Not emailVerified"),o=n.currentUser,t.prev=10,t.next=13,Pn(o);case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(10),e.$apply((function(){s.loadingSession=!1,s.currentErrorMsg=a[t.t0.code]||"An unexpected error occurred during email verification.",c.metricsErrorsLogin(t.t0.code||s.currentErrorMsg),s.stepRegister=2}));case 18:s.logout(!0),s.stepRegister=7,s.loadingSession=!1;case 21:case"end":return t.stop()}}),t,null,[[10,15]])})))),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(2),e.$apply((function(){s.loadingSession=!1,s.currentErrorMsg=a[t.t0.code]||"An unexpected error occurred.",c.metricsErrorsLogin(t.t0.code||s.currentErrorMsg),s.stepRegister=2}));case 12:case"end":return t.stop()}}),t,null,[[2,9]])}))),s.loginWithProvider=function(){var t=Yr(Wr().mark((function t(n){var r,i,o;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s.loadingSession=!0,r=$r(f),t.t0=n,t.next="Google"===t.t0?5:"Facebook"===t.t0?7:9;break;case 5:return i=new ln,t.abrupt("break",12);case 7:return i=new cn,t.abrupt("break",12);case 9:return console.error("Proveedor no admitido"),s.loadingSession=!1,t.abrupt("return");case 12:return t.prev=12,t.next=15,or(r,i);case 15:o=t.sent,e.$apply((function(){E(o.user.uid,!1),c.metricLoginAction("login",{action:"login ".concat(n)}),s.loadingSession=!1})),t.next=22;break;case 19:t.prev=19,t.t1=t.catch(12),e.$apply((function(){s.currentErrorMsg=a[t.t1.code]||"An unexpected error occurred.",c.metricsErrorsLogin(t.t1.code||"An unexpected error occurred."),s.stepRegister=1,s.loadingSession=!1}));case 22:case"end":return t.stop()}}),t,null,[[12,19]])})));return function(e){return t.apply(this,arguments)}}(),s.deleteAccount=function(){var t=$r().currentUser;t?async function(e){return C(e).delete()}(t).then((function(){e.$apply((function(){c.metricLoginAction("login",{action:"delete account"}),s.logout()}))})).catch((function(t){e.$apply((function(){s.currentErrorMsg="Error deleting account: "+(t.code||"An unexpected error occurred."),c.metricsErrorsLogin(t.code||"Error deleting account")}))})):e.$apply((function(){s.currentErrorMsg="No user is currently logged in."}))},s.recoveryPassword=Yr(Wr().mark((function t(){var n,r;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.loadingSession=!0,n=$r(f),r={url:p.siteUrl+"/login",handleCodeInApp:!0},t.prev=3,t.next=6,In(n,s.userData.email,r);case 6:e.$apply((function(){s.loadingSession=!1,c.metricLoginAction("login",{action:"forgot password"})})),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),e.$apply((function(){c.metricsErrorsLogin(t.t0.code||"Error sending password reset email"),s.currentErrorMsg=a[t.t0.code]||"An unexpected error occurred.",s.loadingSession=!1}));case 12:case"end":return t.stop()}}),t,null,[[3,9]])}))),s.logout=Yr(Wr().mark((function t(){var n,r,i=arguments;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>0&&void 0!==i[0]&&i[0],r=$r(f),t.prev=2,t.next=5,Cn(r);case 5:e.$apply((function(){s.sessionData={isLogin:!1},c.metricLoginAction("login",{action:"sign out"}),n||document.getElementById("logout-form").submit()})),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),e.$apply((function(){s.currentErrorMsg="Error signing out: "+(t.t0.code||"An unexpected error occurred."),c.metricsErrorsLogin(t.t0.code||"Error signing out")}));case 11:case"end":return t.stop()}}),t,null,[[2,8]])}))),s.reseendVerification=Yr(Wr().mark((function t(){var n,r;return Wr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.loadingSession=!0,n=$r(f),r=n.currentUser,t.prev=3,t.next=6,Pn(r);case 6:e.$apply((function(){s.loadingSession=!1})),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),e.$apply((function(){s.loadingSession=!1,s.currentErrorMsg="Error resending verification email: "+(t.t0.code||"An unexpected error occurred."),c.metricsErrorsLogin(t.t0.code||"Error resending verification email")}));case 12:case"end":return t.stop()}}),t,null,[[3,9]])}))),s.continueHome=function(){s.logout(),window.location.href="/"},s.isActive=function(e){return i.path()===e},s.setSessionDataObject=function(e){s.sessionData={token:e.token,displayName:e.userProfile.name||e.userProfile.contactEmail,uid:e.firebaseId,photoURL:e.image,isLogin:!0},s.userProfile.name=e.userProfile.name||null,s.userProfile.uid=e.firebaseId||null,s.userProfile.contactEmail=e.userProfile.contactEmail||null,s.userProfile.phone=e.userProfile.phone||null,s.userProfile.codePhone=e.userProfile.codePhone||null,s.userProfile.birthdate=e.userProfile.birthdate||null,s.userProfile.nationality=e.userProfile.nationality||null,s.userProfile.placeOfResidence=e.userProfile.placeOfResidence||null,s.userProfile.gender=e.userProfile.gender||null,s.userProfile.createdAt=e.userProfile.createdAt||null,s.userProfile.updatedAt=e.userProfile.updatedAt||null,s.userProfile.deletedAt=e.userProfile.deletedAt||null,s.userProfile.usersId=e.userProfile.usersId||0,s.userProfile.reservations=e.reservation||[],s.userProfile.id=e.id||0,s.avatarConf.avatar=s.userProfile.name?s.userProfile.name.substr(0,1):s.userProfile.contactEmail.substr(0,1),s.avatarConf.color=function(){var e=o.get("user_color");if(!e){var t=["#55c1ee","#5473b7","#5492cc","#fbac00","#fe6900","#ea0074","#573d95"];e=t[Math.floor(Math.random()*t.length)],o.set("user_color",e)}return e}(),s.setStyleAvatar(s.sessionData.photoURL,s.avatarConf),o.set("user",s.sessionData)},s.setStyleAvatar=function(e,t){s.photoStyle={"background-position":"center center","background-size":"cover","background-repeat":"no-repeat","background-color":"rgb("+t.color+")"},e&&(s.photoStyle["background-image"]="url("+e+")")},s.hasError=function(e,t){var n=e[t];return e.$submitted&&n.$invalid},s.isPasswordValid=function(e){return(null==e?void 0:e.length)>=8&&s.containsUppercase(e)&&s.containsNumber(e)},s.containsUppercase=function(e){return/[A-Z]/.test(e)},s.containsNumber=function(e){return/[0-9]/.test(e)},s.submitFormtWrite=function(e){s.userDataWriten.recaptchaToken=grecaptcha.enterprise.getResponse(d).length>0?grecaptcha.enterprise.getResponse(d):null,e.$invalid=!s.userDataWriten.recaptchaToken,!e.$invalid&&s.userDataWriten.phone&&s.userDataWriten.name&&function(e,t){b.apply(this,arguments)}(s.userDataWriten,e)},s.checkLoginParams=function(){var e=u.loginOpen,t=u.loginEmail,r=u.loginTimeout||s.settings.timeOpen;s.settings.autoOpen&&e&&n((function(){s.showModal("modal-login"),$("#navbarNav").addClass("show")}),1e3*r),t&&(s.userData.email=t)},s.sendContentHeader=function(e){c.metricHeaderSelectContent({title:e})},s.openDropdown=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];s[e]=!s[e],s[e]&&"dropdown_nav"===e?_():k(),s.dropdown_langMobile,s.dropdown_user,"dropdown_nav"!=e&&"dropdown_langMobile"!=e&&window.innerWidth<=991&&(s.dropdown_nav=!1),"dropdown_lang"!=e&&(s.dropdown_lang=!1),h.mobile&&s[e]&&t||s.setDatePopupLogin()},s.openDropdownClose=function(e){s[e]=!1},s.setDatePopupLogin=function(){var e=o.get("popup_auto_open");if(!(new Date(e)>new Date)){var t=new Date;t.setDate(t.getDate()+1),o.set("popup_auto_open",t)}},n((function(){var e=angular.element(".bottom__container"),t=e.scrollLeft();angular.element(".bottom__mask--left").hide(),e.bind("scroll",(function(){n((function(){var n=e.scrollLeft();n>t?I("right"):n<t&&I("left"),t=n}))}))})),function(){var e,n=u.coupon,r=l.getCookie("codept"),i=n||r;if(l.setCookie("codept",i,"1"),s.iscodept=!!i,s.iscodept&&(e=i,t.get("/v1/api/GetCoupon?DiscountCode=".concat(e)).then((function(e){"null"!=e.data?s.codeData=e.data:s.codeData={}})).catch((function(e){console.error("Error al obtener los datos del cupón:",e),s.codeData={}}))),window.__pt.settings.site.login&&window.__pt.settings.site.login.main.active&&(function(){var e=l.getCookie("session_token");if(e&&e.length>0)return!0;return!1}()&&window.__pt.user?(s.setSessionDataObject(window.__pt.user),"/login"==window.location.pathname&&(window.location.href="/")):"/login/perfil"==window.location.pathname&&(window.location.href="/login")),"TB"==h.code&&window.grecaptcha&&"/login"!=window.location.pathname&&(d=grecaptcha.enterprise.ready((function(){grecaptcha.enterprise.render("g-recaptcha",{sitekey:"6Lfl5-8eAAAAAECHbOBAyrnsbQah1X5kthYKYyvq"})}))),"PTMX"==h.code&&!s.loadingSession){var a=o.get("popup_auto_open");if(new Date>new Date(a)){s.dropdown_user=!0;var c=setTimeout((function(){s.dropdown_user&&$("#btn_start_session").click(),clearTimeout(c)}),1e4)}}}()}window.app.controller("LoginController",Jr),Jr.$inject=["$scope","$http","$timeout","$location","localStorageService"]})()})();
//# sourceMappingURL=list-controllers.min.js.map