/*! For license information please see detail-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 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 i(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 o=n.call(e,t||"default");if("object"!==r(o))return o;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){try{var n=t.data,r=t.vmData,o=t.element,i={PT:{event:"ga4.".concat(this.events.trackEvent),eventName:this.events.search,eventParams:{action:this.events.click,search_term:r.place_name,element:o,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}},TB:{event:"ga4.".concat(this.events.trackEvent),eventName:this.events.search,eventParams:{action:this.events.click,search_term:r.place_name,element:o,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:o,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(i.event,i)}catch(e){console.log(e)}}},{key:"metricBookerFlight",value:function(e,t){try{var n=t.data,r=t.vmData,o={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(o.event,o)}catch(e){console.log(e)}}},{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){try{var n=t.data,r=t.vmData,o={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(o.event,o)}catch(e){console.log(e)}}},{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],o={event:this.events.gtmEvent,eventName:this.events.gtmEvent,eventCategory:"calendar no dispo",eventAction:r.action,eventLabel:r.label,eventExtra:""};this.analytics.set(o.event,o)}}},{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?o(Object(n),!0).forEach((function(t){i(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}({},{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 o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(i=o.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 o=n.call(e,t||"default");if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===r(a)?a:String(a)),o)}var i,a}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}new(i((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",notRooms:"Hotels Empty Rooms",hotelError:"Hotels Error",hotelErrorImg:"Hotel sin imagenes en habitacion",hotelErrorDuplicate:"Hotel con habitaciones duplicadas",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)}})))},4943:(e,t,n)=>{"use strict";n.d(t,{Tc:()=>i,UK:()=>c,Uo:()=>s,bs:()=>a});var r=null,o={checkin:null,checkout:null};function i(e){r=e}function a(e,t){r&&(r.setDateRange(e,t),o.checkin=e,o.checkout=t)}function s(){return o}function c(){o.checkin=null,o.checkout=null}},291:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var r=n(5515),o=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 a(){a=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:{},s=o.iterator||"@@iterator",c=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 d(e,t,n,o){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),s=new C(o||[]);return r(a,"_invoke",{value:E(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function m(){}function v(){}var g={};u(g,s,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(T([])));w&&w!==t&&n.call(w,s)&&(g=w);var b=v.prototype=f.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function o(r,a,s,c){var l=h(e[r],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==i(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,c)}),(function(e){o("throw",e,s,c)})):t.resolve(d).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 E(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=I(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=h(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 I(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,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=h(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(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 T(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,o=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 o.next=o}}return{next:x}}function x(){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(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new _(d(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(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=T,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 o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.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 o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}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,(o=r.key,a=void 0,a=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)}(o,"string"),"symbol"===i(a)?a:String(a)),r)}var o,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.exchange=window.__pt.exchange,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,i,l,u;return t=e,n=[{key:"getAvailability",value:(l=a().mark((function e(t,n,r){var i,s,c,l,u;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.getParams(t,n,r),s=this.fn.objectToQueryParams(i),c="".concat(t,"_").concat(n,"_").concat(r),this.memory[c]){e.next=9;break}return l=(0,o.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 o=l.apply(e,t);function i(e){s(o,n,r,i,a,"next",e)}function a(e){s(o,n,r,i,a,"throw",e)}i(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 o=n[r],i=e[o.checkinFormat];this.buildElement(i,o)}this.footerBuild()}}},{key:"buildElement",value:function(e,t){if(e){var n,r=e.target.querySelector(".day-price")||document.createElement("span");r.className=t.available?"day-price available":"day-price unavailable",n=this.roundNumber(t.avgPrice),r.innerHTML=t.available?"".concat(n):"  ",e.target.append(r),t.color&&t.color.length&&e.target.classList.add(t.color)}}},{key:"roundNumber",value:function(e){var t=__pt.settings.site.currency;if("COP"===t){var n=e.slice(-1),r=parseFloat(e.slice(0,-1));return"".concat(this.customRound(r)).concat(n)}return"COP"!==t&&(e.endsWith("K")||e.endsWith("M"))?e:this.customRound(e)}},{key:"customRound",value:function(e){var t=e%1,n=Math.floor(e);return t>.5?n+1:e}},{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,currency:this.exchange.currency,type:"json"}}}],n&&c(t.prototype,n),i&&c(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}())},694:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9586);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 i(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 a=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,o;return t=e,n=[{key:"vibrate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[300];"vibrate"in navigator&&navigator.vibrate(e)}},{key:"getIsArray",value:function(e){return Array.isArray(e)}},{key:"getFirstPathSegment",value:function(){return window.location.pathname.split("/")[1]}},{key:"getPathSegment",value:function(e){return window.location.pathname.split("/")[e]}},{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(){var e=window.__pt.fn,t="anonimo-".concat(e.generateUUID()),n=e.getCookie("__ca__chat")||t,o=r.V.get("userKey");return o&&!o.includes("anonimo")?o:n?(r.V.set("userKey",n),n):(setTimeout((function(){var n=e.getCookie("__ca__chat")||t;r.V.set("userKey",n)}),2e3),"")}},{key:"getUserKeyFavorites",value:function(){var e=window.__pt.fn,t=window.__pt.user||null,n="anonimo-".concat(e.generateUUID()),o=t&&t.firebaseId?t.firebaseId:e.getCookie("session_id")||n,i=r.V.get("userKey_fav");return i&&i===o?i:o?(r.V.set("userKey_fav",o),o):(setTimeout((function(){var o=t&&t.firebaseId?t.firebaseId:e.getCookie("session_id")||n;r.V.set("userKey_fav",o)}),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 o=e.pax[r],i="";n.adults+=o.adults,i+="".concat(o.adults,"/"),o.children&&o.children.length?(n.children+=o.children.length,i+="".concat(o.children.map((function(e){return e.year})).join(","))):i+="n",n.paxesFormat.push(i)}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 o=e[r],i="";n.adults+=o.adults,i+="".concat(o.adults,"/"),o.children&&o.children.length?(n.children+=o.children.length,i+="".concat(o.children.map((function(e){return e.year})).join(","))):i+="n",n.paxesFormat.push(i)}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 o=e.pax[r],i="";n.adults+=o.adults,i+="".concat(o.adults),o.children&&o.children.length&&(n.children+=o.children.length,i+="|".concat(o.children.map((function(e){return e.year})).join(","))),n.paxesFormat.push(i)}return n}},{key:"getPaxToMessages",value:function(e){return e.paxesFormat.map((function(e){var t=e.split("|"),n=t[0],r=t.length>1?t[1].split(",").join("_"):"";return"".concat(n).concat(r?"_":"").concat(r)}))}},{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 o=e?r.find((function(t){return t.key==e.promotionType})):"";o&&(t=o.active,n=o.blackFAndHotS)}return{activeKey:t,HotSBlackFri:n}}},{key:"windowScrollTop",value:function(){window.scrollTo(0,0)}}],n&&i(t.prototype,n),o&&i(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2805:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=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 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 a(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){s(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}function s(e,t,n){return(t=h(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},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=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 d(e,t,n,o){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),s=new C(o||[]);return r(a,"_invoke",{value:E(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function m(){}function v(){}var g={};u(g,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(T([])));w&&w!==t&&n.call(w,a)&&(g=w);var b=v.prototype=f.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function i(r,a,s,c){var l=h(e[r],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,s,c)}),(function(e){i("throw",e,s,c)})):t.resolve(d).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 E(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=I(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=h(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 I(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,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=h(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(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 T(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,o=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 o.next=o}}return{next:x}}function x(){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(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new _(d(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(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=T,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 o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.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 o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function l(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){l(i,r,o,a,s,"next",e)}function s(e){l(i,r,o,a,s,"throw",e)}a(void 0)}))}}function d(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,h(r.key),r)}}function h(e){var t=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)}(e,"string");return"symbol"===o(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,o,i,s,l,h,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:(h=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 h.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,o;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 o=e.sent,e.abrupt("return",o.json());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"copyByUser",value:(i=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 i.apply(this,arguments)})}],n&&d(t.prototype,n),o&&d(t,o),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})},9586:(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 o(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),r)}}function i(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}n.d(t,{V:()=>a});var a=new(function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r="pt.",(n=i(n="prefix"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r}var t,n,r;return t=e,(n=[{key:"getSession",value:function(e){var t=null;try{if(window.sessionStorage){var n=window.sessionStorage.getItem("".concat(this.prefix).concat(e));try{t=JSON.parse(n)}catch(e){t=n}}return t}catch(e){return""}}},{key:"setSession",value:function(e,t){var n=null;try{window.sessionStorage&&(n=JSON.stringify(t),window.sessionStorage.setItem("".concat(this.prefix).concat(e),n))}catch(e){}}},{key:"get",value:function(e){var t=null;try{if(window.localStorage){var n=window.localStorage.getItem("".concat(this.prefix).concat(e));try{t=JSON.parse(n)}catch(e){t=n}}return t}catch(e){return""}}},{key:"set",value:function(e,t){var n=null;try{window.localStorage&&(n=JSON.stringify(t),window.localStorage.setItem("".concat(this.prefix).concat(e),n))}catch(e){}}}])&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}())},4155:e=>{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!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:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,c=[],l=!1,u=-1;function d(){l&&s&&(l=!1,s.length?c=s.concat(c):u=-1,c.length&&h())}function h(){if(!l){var e=a(d);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===i||!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(h)},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 o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.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"];var e=window.__pt.exchange||{},t=window.__pt.settings.site||{};window.__pt.cultureData;window.app=angular.module("app",window.directives).directive("offClick",["$document","$parse","$timeout",function(e,t,n){return{restrict:"A",compile:function(r,o){var i=t(o.offClick);return function(t,r,o){function a(n){var o=$(n.target);r[0].contains(n.target)||o.hasClass("no-autoclose")?e.one("click touchend",a):t.$apply((function(){i(t)}))}t.$watch(o.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))}))})),o=angular.element(t)[0];r.observe(o)}}})).directive("bnLazySrc",["$window","$document",function(e,t){var n=function(){var n=[],r=null,o=$(e),i=t,a=i.height(),s=null,c=!1;function l(){if(!r){var e=i.height();e!==a&&(a=e,h())}}function u(){for(var e=[],t=[],r=o.height(),i=o.scrollTop(),a=i+r,s=0;s<n.length;s++){var c=n[s];c.isVisible(i,a)?e.push(c):t.push(c)}for(s=0;s<e.length;s++)e[s].render();n=t,d(),n.length||p()}function d(){clearTimeout(r),r=null}function h(){r=setTimeout(u,100)}function p(){c=!1,o.off("resize.bnLazySrc"),o.off("scroll.bnLazySrc"),clearInterval(s)}function f(){r||h()}return{addImage:function(e){n.push(e),r||h(),c||(c=!0,o.on("resize.bnLazySrc",f),o.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||(d(),p())}}}();function r(e){var t=null,n=!1,r=null;function i(){e[0].onerror=function(){o(e[0],!0)},e[0].src=t,window.__pt.renderLazyload&&window.__pt.renderLazyload(e[0])}return o(e[0]),{isVisible:function(t,n){if(!e.is(":visible"))return!1;null===r&&(r=e.height());var o=e.offset().top,i=o+r;return o<=n&&o>=t||i<=n&&i>=t||o<=t&&i>=n},render:function(){n=!0,i()},setSource:function(e){t=e,n&&i()}}}function o(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,o){var i=new r(t);n.addImage(i),o.$observe("bnLazySrc",(function(e){i.setSource(e)})),e.$on("$destroy",(function(){n.removeImage(i)}))},restrict:"A"}}]).config(["$provide",function(n){n.decorator("currencyFilter",["$delegate",function(n){return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.decimalDigits,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=new Intl.NumberFormat(__pt.settings.site.cultureSite,{style:"decimal",minimumFractionDigits:r,maximumFractionDigits:r});return i.format(n*(o?e.rate:1))}}])}]).component("currencyDisplay",{bindings:{amount:"<",currencyCode:"<",showCurrencyCode:"<",applyConvertion:"@",applyDecimals:"<",reduceIsoFont:"<"},controller:["$filter",function(e){this.$onInit=function(){this.formatCurrency(),this.currencySymbol=t.currencySymbol,this.currencyCodeMain=this.currencyCode?this.currencyCode:t.currencyCodeName},this.formatCurrency=function(){this.formattedAmount=e("currency")(this.amount,this.applyDecimals?t.decimalDigits:0,!this.applyConvertion)},this.$onChanges=function(e){(e.amount||e.currencySymbol||e.fractionSize)&&this.formatCurrency(),e.showCurrencyCode&&(this.showCurrencyCode=!!this.showCurrencyCode)}}],template:"{{ $ctrl.currencySymbol }} {{ $ctrl.formattedAmount }}<span ng-if=\"$ctrl.showCurrencyCode\" ng-style=\"{'font-size': $ctrl.reduceIsoFont ? '1rem' : ''}\"> {{ $ctrl.currencyCodeMain }}</span>"}),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:o}})}))})),o=angular.element(t)[0];r.observe(o)}}})),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(",");if(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,o=e.toString().trim().replace(/^\+/,"");if(o.match(/[^0-9]/))return e;switch(o.length){case 10:t=1,n=o.slice(0,2),r=o.slice(2);break;case 11:t=o[0],n=o.slice(1,4),r=o.slice(4);break;case 12:t=o.slice(0,3),n=o.slice(3,5),r=o.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,o=n.mediaQueryTablet,i=n.mediaQuerySmall,a=n.mediaQueryMobile;return r().matches?"?tx=w_552,h_368":o().matches||i().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),o=n(9586);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 a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=c(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function s(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)||c(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 c(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}function l(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 u(){u=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 l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,o){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),s=new C(o||[]);return r(a,"_invoke",{value:E(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function m(){}function v(){}var g={};l(g,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(T([])));w&&w!==t&&n.call(w,a)&&(g=w);var b=v.prototype=f.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function o(r,a,s,c){var l=h(e[r],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==i(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,c)}),(function(e){o("throw",e,s,c)})):t.resolve(d).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 E(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=I(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=h(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 I(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,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=h(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(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 T(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,o=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 o.next=o}}return{next:x}}function x(){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=l(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,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},k(_.prototype),l(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new _(d(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(b),l(b,c,"Generator"),l(b,a,(function(){return this})),l(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=T,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 o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.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 o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function d(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function h(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){d(i,r,o,a,s,"next",e)}function s(e){d(i,r,o,a,s,"throw",e)}a(void 0)}))}}function p(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 f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(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 v(n,c,l,d,p,m,v){var g=this,y={},w=window.__pt.settings.site,b=window.__pt.settings,k=window.__pt.ln,_=(window.__pt.cultureData,window.__pt.fn),E=_.getDate(),I=window.__pt.place||{},S="",P="",C={},T=null,x=new e.Z,D=window.__pt.box||null,R=b.bookerHistorySize,A={format:b.formatBoxDate,formatMobile:b.formatBoxDateMobile,firstDay:0,applyLabel:k.ok,cancelLabel:k.cancel},O={},L={};window.__pt.user;g.submit=!1,g.years=[],g.suggestion={from:{results:[],show:!1},paxes:!1},g.hasResult=!1,g.validation={paxes:!0,checkIn:!0,checkOut:!0,dates:!0},g.siteUrl=window.__pt.settings.site.siteUrl,g.algoliaUrl="TB"!=window.__pt.settings.site.metricsSuffix?"https://pricetravel.com/assets/recent-search-imgs/places/":"https://www.tiquetesbaratos.com/assets/recent-search-imgs/places/",g.settingPaxes={minAdults:1,maxAdults:8,minChildren:0,maxChildren:6,minAge:0,maxAge:17,rooms:8};var N=new r.Z,M=N.getUserKey(),j={weeksPrequote:0,daysPrequote:0,startDate:0};function U(e){var t=e.data||[];t.length>0&&t.forEach((function(e){var t=s(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(", ")})),g.suggestion[S].results=t,g.suggestion[S].show=!0,g.placeInputHasFocus=!0,_.mobileAndTabletCheck()&&Y("".concat(P,"_modal"))}function F(e){console.log(e)}function B(){var e={analyticsTags:ee(),from:0,language:w.language,placeTypes:0,site:w.code,size:5,usersearch:M,recommendation:!0};c.get(w.endPoints.suggestionHotelUrl,{params:e}).then(U,F)}function H(){_.mobileAndTabletCheck()?(j.weeksPrequote=w.configDaysPrequoteMobile.weeksPrequote,j.daysPrequote=w.configDaysPrequoteMobile.daysPrequote,j.startDate=w.configDaysPrequoteMobile.startDate):(j.weeksPrequote=w.configDaysPrequoteDesktop.weeksPrequote,j.daysPrequote=w.configDaysPrequoteDesktop.daysPrequote,j.startDate=w.configDaysPrequoteDesktop.startDate);var e=new Date(E);e.setDate(e.getDate()+7*j.weeksPrequote),e.setDate(e.getDate()-e.getDay()+j.startDate),g.data.checkIn=V(e),g.data.checkOut=V(e,j.daysPrequote)}function V(){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,b.formatDate));return n.setDate(n.getDate()+t),n}function W(){var e=0,t=0;if(N.getIsArray(g.data.paxes)){var n,r=a(g.data.paxes);try{for(r.s();!(n=r.n()).done;){var o=n.value;e+=o.adults||0,t+=o.children?o.children.length:0}}catch(e){r.e(e)}finally{r.f()}}else"object"===i(g.data.paxes)&&(e=g.data.paxes.adults||0,t=g.data.paxes.children?g.data.paxes.children.length:0);var s=N.getIsArray(g.data.paxes)?g.data.paxes.length:g.data.paxes.rooms,c=1===s?k.room:k.rooms,l=1===e?k.adult:k.adults,u=1===t?k.child:k.children,d="";t>0&&(d=" ".concat(t," ").concat(u,", ")),g.data.paxes_name="".concat(e," ").concat(l,",").concat(d," ").concat(s," ").concat(c),g.data.paxes_people="".concat(e+t," ").concat(k.new_pers," ").concat(s," ").concat(k.new_room),g.data.capacityTotal=e+t}function q(e){var t=w.pathHome;switch(e){case 6:case 3:case 11:case 7:case 12:t=w.pathHoteles;break;case 14:t=w.pathHotelDetail}return t}function z(e){var t={},n=e.adults,r=0,o=0,i=[];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=a(e.children);try{for(c.s();!(s=c.n()).done;){var l=s.value;i.push(l.year),l.year>5?r+=1:o+=1}}catch(e){c.e(e)}finally{c.f()}}return i.length>0&&(t.age=i.join(",")),o>0&&(t.infant=o),t}function G(e,t){for(var n=!0,r=e.children.length,o=0;o<r;o++){var i=t["children_".concat(o)];if(i&&i.$invalid){n=!1;break}}return n}function K(e,t){var n=!0;return e.setHours(0,0,0,0),+e>+t&&(n=!1),n}function Y(e){setTimeout((function(){var t=e&&document.getElementById(e);t&&t.focus()}),200)}function J(e){"paxes"==e&&(g.validation.paxes=G(g.data.paxes,g.form))}function Q(){if(g.data&&g.data.paxes){var e=g.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 Z(e){try{var t=o.V.get(b.historyStorageParam),n=[];if(t&&(n=t).some((function(t){return t.place_selected.id.toString()===e.place_selected.id.toString()})))return;n.length>=R&&(n=n.splice(0,R-1)),n.unshift(e),o.V.set(b.historyStorageParam,n)}catch(e){}}function X(e,t){y.setDataArgolia(e,t)}function ee(){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"!=b.page?"hoteles"!=t&&"hotels"!=t||"hotels"!=b.page?"landings"==b.page?e.push("landings"):e.push("home"):(e.push("list"),e.push(window.location.pathname.split("/")[2])):e.push("home"),e.join(",")}function te(){T.setDateRange(g.data.checkIn,g.data.checkOut),W(),m.url(m.path());var e=_.search(),t=z(g.data.paxes),n=e.campaignTokenApi||e.CampaignTokenApi||e.campaigntokenapi||null,r=e.CampaignToken||e.campaignToken||n,o={placeId:g.data.place_selected.id,placeType:g.data.place_selected.type,adults:g.data.paxes.adults,checkin:_.formatDate(g.data.checkIn,b.formatDate),checkout:_.formatDate(g.data.checkOut,b.formatDate),campaignToken:r||null};for(var i in o=o=f(f({},o),t))o[i]&&m.search(i,o[i])}function ne(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")}g.data=b.defaultHotel,g.display=!0,g.keyPosition=0,g.placeInputHasFocus=!1,g.history=[],g.dataCopyCancel=b.defaultHotel,v.$on(b.bookerValuesEvent,(function(e,t){t&&t.pax?(g.data.checkIn=_.getDate(t.checkIn),g.data.checkOut=_.getDate(t.checkOut),g.data.paxes=t.pax,te(),v.$broadcast(b.bookerChangeEvent,g.data)):(g.data.place_selected=t.place,g.data.paxes=t.box.pax,g.data.checkIn=_.getDate(t.box.checkIn),g.data.checkOut=_.getDate(t.box.checkOut),g.data.campaignTokenApi=t.campaignTokenApi,g.data.campaignToken=t.campaignToken,g.onSubmit(g.form,!0))})),v.$on(b.bookerSearchEvent,(function(e,t){x.metricModifiedSearchRecomendation(t.typeEvent),g.data.paxes=t.paxes,g.data.checkIn=t.checkIn,g.data.checkOut=t.checkOut,te(),g.data.typeEvent=t.typeEvent,v.$broadcast(b.bookerChangeEvent,g.data)})),g.onSearch=function(e,t,n,r){if((""===e||null==e||e.length<3)&&B(),e&&!(e&&e.length<3)&&(g.hasResult=!1,g.form[n].$valid)){P=r,S=t;var o={query:e,language:w.language,placeTypes:w.placesTypeHotel,from:0,size:10,usersearch:M,site:w.code,analyticsTags:ee()};c.get(w.endPoints.suggestionHotelUrl,{params:o}).then(U,F)}},g.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){N.getPathSegment(2);if(g.validation.paxes=G(g.data.paxes,e),n&&"hotel"==b.page)e.$valid&&g.validation.paxes?(g.data.typeEvent=r,v.$broadcast(b.bookerSearchEvent,g.data),v.$broadcast(b.bookerSearchEventSmall,g.data),g.form.$pristine=!1,g.form.$dirty=!1,g.form.$submitted=!1):g.validation.paxes||(g.suggestion.paxes=!0);else{if(n&&"hotel"!=b.page)return;if(g.submit=!0,t?e.$valid=!0:(g.validation.paxes=G(g.data.paxes,e),g.validation.checkIn=K(E,g.data.checkIn),g.validation.checkOut=K(E,g.data.checkOut),g.validation.dates=K(g.data.checkIn,g.data.checkOut)),e.$valid&&g.validation.paxes&&g.validation.checkIn&&g.validation.checkOut&&g.validation.dates){var i=_.search(),a=z(g.data.paxes),s=i.coupon,c={adults:g.data.paxes.adults,checkin:_.formatDate(g.data.checkIn,b.formatDate),checkout:_.formatDate(g.data.checkOut,b.formatDate)};s&&(c.coupon=s),g.data.place_selected.cityUrl&&w.algoliaDetailIs&&(c.profileId=g.data.place_selected.code),i.CampaignToken&&(c.CampaignToken=i.CampaignToken),i.campaignTokenApi&&(c.campaignTokenApi=i.campaignTokenApi),i.ctInternal&&(c.ctInternal=i.ctInternal),i.source&&(c.source=i.source),c=f(f({},c),a);var l=q(g.data.place_selected.type),u=14==g.data.place_selected.type?"_a".concat(g.data.place_selected.code||g.data.place_selected.id):"_d".concat(g.data.place_selected.id);x.metricBookerHotel("booker",{vmData:g.data,data:c});e=document.createElement("form");for(var d in e.setAttribute("method","get"),e.setAttribute("action","".concat(w.siteUrl).concat(l).concat(g.data.place_selected.uri).concat(u)),c)if(c[d]){var h=document.createElement("input");h.setAttribute("type","hidden"),h.setAttribute("name",d),h.setAttribute("value",c[d]),e.appendChild(h)}Z(g.data),o.V.set("bookerHotel_fam",g.data),$("#loader-page").removeClass("d-none"),document.body.appendChild(e),e.submit()}else g.validation.paxes||(g.suggestion.paxes=!0)}}(e)},g.onSelect=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];g.isSelected=!0,ne("auto"),g.data.place_name=e.displayText,g.data.place_selected=e,g.suggestion[t].show=!1,g.placeInputHasFocus=!1,X(e,n),r&&x.metricRecentSearch(e.displayText)},g.showPaxes=function(){g.suggestion.paxes=!0,g.dataCopyCancel=angular.copy(g.data),ne("hidden")},g.addRoom=function(e){g.settingPaxes.rooms<=g.data.paxes[e]||(g.data.paxes[e]+=1,W())},g.removeRoom=function(e){g.data.paxes[e]+1>2&&(g.data.paxes[e]-=1),W()},g.onFocus=function(e,t){S=e,P=t,g.hasResult=!0,setTimeout((function(){B()}),200),g.suggestion[e].results.length&&setTimeout((function(){n.$apply((function(){g.suggestion[e].show=!0,_.mobileAndTabletCheck()&&Y("".concat(t,"_modal"))}))}),250)},g.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]},g.removePax=function(e,t){g.data.paxes[e]-1>=t&&(g.data.paxes[e]-=1),W()},g.addPax=function(e,t){g.data.paxes[e]+1<=t&&(g.data.paxes[e]+=1),W()},g.removeChildren=function(e,t){g.data.paxes[e].length-1>=t&&g.data.paxes[e].splice(g.data.paxes[e].length-1,1),W()},g.addChildren=function(e,t){g.data.paxes[e].length+1<=t&&g.data.paxes[e].push({year:null}),W()},g.onClose=function(e,t){Q()?g.form.$setSubmitted():(e[t]=!1,J(t),g.placeInputHasFocus=!1,ne("auto"))},g.onCloseCancel=function(e,t){g.data=g.dataCopyCancel,e[t]=!1,J(t),ne("auto")},g.onCloseSubmitForm=function(e,t,n){ne("auto"),Q()||g.form.$invalid?g.onClose(e,t):n?(g.onClose(e,t),v.$broadcast(b.bookerSearchEvent,g.data),v.$broadcast(b.bookerSearchEventSmall,g.data),g.form.$pristine=!1,g.form.$dirty=!1,g.form.$submitted=!1):g.onSubmit(g.form,!1)},g.onRemove=function(e,t,n){e[t].splice(n,1),W()},g.hasError=function(e,t){var n=e[t];return e.$submitted&&n.$invalid},g.isInvalidInput=function(e,t,n){return e.$submitted&&e["".concat(t,"_").concat(n)].$invalid},g.onClickOutside=function(e,t){g.placeInputHasFocus=!1,e[t]=!1,J(t),g.placeInputHasFocus=!1,ne("auto")},g.deleteSelection=function(e,t,n,r){g.data[e]=null,g.data["".concat(t).concat(n.length?"_"+n:"")]={},Y(r)},g.showBooker=function(){g.display=!g.display},g.keysNavigation=function(){var e=h(u().mark((function e(t,n){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r=g.suggestion[n])&&r.results.length&&r.show)){e.next=10;break}if(40==t.keyCode&&(g.keyPosition=g.keyPosition<r.results.length-1?g.keyPosition+1:g.keyPosition),38==t.keyCode&&(g.keyPosition=g.keyPosition>0?g.keyPosition-1:g.keyPosition),13!=t.keyCode){e.next=10;break}return t.preventDefault(),g.onSelect(r.results[g.keyPosition],n,g.keyPosition),e.next=9,_.sleep(100);case 9:g.keySelected=0;case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),g.clickInputInMobile=function(e){ne("hidden"),P=e,g.placeInputHasFocus=!0,_.mobileAndTabletCheck()&&(Y("".concat(P,"_modal")),g.data.place_name&&g.data.place_name.length>3&&setTimeout((function(){var e=document.getElementById("".concat(P,"_modal"));e&&e.setSelectionRange(0,e.value.length)}),200))},y.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,a=M,s={objectIDs:r,queryID:n,userToken:a,posicion:i,indexName:w.algoliaSearch};o.V.set("_key_argo_object",JSON.stringify(s)),window.aa("clickedObjectIDsAfterSearch",{userToken:a,eventName:"Buscador Click",index:w.algoliaSearch,queryID:n,objectIDs:[r],positions:[i]})}};var re=function(){var e=h(u().mark((function e(){var n,r,o,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!w.showCalendarAvailability){e.next=15;break}if(!(n=g.data.place_selected)||14!=n.type||!n.code&&!n.id){e.next=15;break}t.D.setCalendarPriceContainer(),e.t0=u().keys(L);case 5:if((e.t1=e.t0()).done){e.next=14;break}return r=e.t1.value,o=r.split("_"),e.next=10,t.D.getAvailability(n.code||n.id,o[0],o[1]);case 10:i=e.sent,t.D.build(O,i),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;H(),function(){var e,t;"hotels"!=b.page&&"hotel"!=b.page||(g.display=!_.mobileAndTabletCheck());"home"!=b.page?e=function(){var e=_.search(),t={},n=I;t.place_name=n.displayText||"",t.place_selected=n,t.checkIn=e.checkin||g.data.checkIn,t.checkOut=e.checkout||g.data.checkOut;var r={adults:0,children:[],rooms:0};if(e["room1.adults"]){var o=+e.rooms;r.rooms=o;for(var i=0;i<o;i++){var a=i+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,d=+e.no_rooms||1,h=[],p=+e.group_children||0,f=0;f<p;f++){var m=+(e.age||"").split(",")[f]||0;h.push({year:m})}r.adults=u,r.rooms=d,r.children=h}r||(r=g.data.paxes);return t.paxes=r,t}():t=o.V.get("bookerHotel_fam");t&&(t.place_name=null,t.place_selected={});g.data=e||t||g.data,N.getIsArray(g.data.paxes)&&(g.data.paxes=N.convertPaxesData(g.data.paxes));(e||t)&&(g.data.checkIn=_.getDate(g.data.checkIn),g.data.checkOut=_.getDate(g.data.checkOut),(+g.data.checkIn<=+E||+g.data.checkOut<=+E)&&H())}(),function(){var e=_.search();if((E<_.getDate(g.data.checkOut)||E>=_.getDate(g.data.checkOut))&&D)if(e.daysToArrival&&e.daystostay){var n=new Date;n.setDate(n.getDate()+parseInt(e.daysToArrival)),g.data.checkIn=n;var r=new Date(n);r.setDate(r.getDate()+parseInt(e.daystostay)),g.data.checkOut=r}else g.data.checkIn=_.getDate(D.checkIn),g.data.checkOut=_.getDate(D.checkOut);o=["calendar-checkIn-hotel","calendar-checkOut-hotel"],i=g.data.checkIn,a=g.data.checkOut,s="checkIn",c="checkOut",l=N.getFirstPathSegment(),u=b.rb?[]:["".concat(w.cloudCdn,"/assets/css/dist/").concat(w.siteName,"/booker.css?id=").concat(+new Date)],C={element:document.getElementById(o[0]),css:u,zIndex:10,grid:2,calendars:2,autoApply:!0,readonly:!0,lang:w.culture,date:i,format:_.mobileAndTabletCheck()&&"hotel"==l?A.formatMobile:A.format,plugins:["RangePlugin","LockPlugin"],LockPlugin:{minDate:E,minDays:2},RangePlugin:{tooltip:!0,startDate:i,endDate:a,tooltipNumber:function(e){return e-1},locale:{one:k.night,other:k.night+"s"}},setup:function(e){e.on("render",(function(t){var n=e.ui.container.querySelectorAll(".calendars .next-button"),r=e.ui.container.querySelectorAll(".calendars .previous-button");n&&n.forEach((function(e){e.setAttribute("aria-label","Siguiente mes")})),r&&r.forEach((function(e){e.setAttribute("aria-label","Anterior mes")}))})),e.on("select",(function(e){var t=e.detail,n=t.start,r=t.end;g.data[s]=n.toJSDate(),g.data[c]=r.toJSDate(),g.onSubmit(g.form,!0,"",!0,"recomendacion")})),e.on("view",(function(e){var n=e.detail,r=n.view,o=n.date,i=n.target;if("CalendarDay"===r){var a=g.data.place_selected,s=o.format("YYYY_MM"),c=o.format("YYYY-MM-DD");L[s]=s,O[c]={date:o.format("YYYY-MM-DD"),target:i};var l=t.D.getMemoryDate(s,c,a.code||a.id);l&&t.D.buildElement(O[c],l)}"Main"===r&&(t.D.setFooterElement(i),t.D.footerBuild())})),e.on("show",(function(e){re(),t.D.overFlow()})),e.on("hide",(function(e){t.D.overFlow(),O={},L={}})),e.on("click",(function(t){e.isCalendarHeaderButton(t.target)&&(O={},L={},setTimeout((function(){re()}),100)),e.isCalendarDay(t.target)&&setTimeout((function(){re()}),100)}))}},T=new easepick.create(C);var o,i,a,s,c,l,u}(),W(),(e=o.V.get(b.historyStorageParam))&&(g.history=e,g.history=g.history.every((function(e){return e.place_selected.hasOwnProperty("city")}))?g.history:[]);for(var n=g.settingPaxes.minAge;n<=g.settingPaxes.maxAge;n++)g.years.push({year:n})}()}window.app.controller("BookerHotelController",v),v.$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){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(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 r(e,t){if(e){if("string"==typeof e)return o(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)?o(e,t):void 0}}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 i(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.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 o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(a)?a:String(a)),o)}var i,a}var a=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._roomRates={},this.analytics=window.__pt.fn.analytics,this.events=window.__pt.fn.analytics.events,this.pages=window.__pt.fn.analytics.pages,this.config=window.__pt.settings||{},this.place=window.__pt.place||{},this.hotel=window.__pt.hotel||{},this.placeContainer=window.__pt.placeContainer||{},this.box=window.__pt.box||{},this.fn=window.__pt.fn||{},this.roomsAval=n,this.roomsTax=r,this.initData()}var n,o,a;return n=e,o=[{key:"initData",value:function(){var e;this.nights=this.countNight(this.box.checkIn,this.box.checkOut),this.location=this.hotel.location||{},this.url="".concat(location.origin).concat(location.pathname),this.rating=null!==(e=this.hotel.surveyAverage)&&void 0!==e&&e.averageValue?2*this.hotel.surveyAverage.averageValue:0,this.checkIn=this.box.checkIn,this.checkOut=this.box.checkOut}},{key:"initialLayers",value:function(e){this._roomRates=e,this.setViewSearchResult(),this.detailPageViewEvent(),this.setHotelImpressionView(),this.sendPaymentFunnel()}},{key:"setHotelImpressionView",value:function(){var e=this.productDetailBase(),t={event:this.events.productDetail,eventName:this.events.productDetail,EECProductDetailAdults:e.EECProductDetailBaseAdults,EECProductDetailBrand:e.EECProductDetailBaseBrand,EECProductDetailCheckin:e.EECProductDetailBaseCheckin,EECProductDetailCheckout:e.EECProductDetailBaseCheckout,EECProductDetailCity:e.EECProductDetailBaseCity,EECProductDetailContractOwner:e.EECProductDetailBaseContractOwner,EECProductDetailCountry:e.EECProductDetailBaseCountry,EECProductDetailDestination:e.EECProductDetailBaseDestination,EECProductDetailId:e.EECProductDetailBaseId,EECProductDetailKids:e.EECProductDetailBaseKids,EECProductDetailName:e.EECProductDetailBaseName,EECProductDetailNights:e.EECProductDetailBaseNights,EECProductDetailQuantity:e.EECProductDetailBaseQuantity,EECProductDetailRating:e.EECProductDetailBaseRating,EECProductDetailRoomTypes:e.EECProductDetailBaseRoomTypes,EECProductDetailRoomTypesAvailable:e.EECProductDetailBaseRoomTypesAvailable,EECProductDetailRoomTypesOnRequest:e.EECProductDetailBaseRoomTypesOnRequest,EECProductDetailRoomTypesUAllotment:e.EECProductDetailBaseRoomTypesUAllotment,EECProductDetailRoomTypesUClosedDate:e.EECProductDetailBaseRoomTypesUClosedDate,EECProductDetailRoomTypesUClosedToArrival:e.EECProductDetailBaseRoomTypesUClosedToArrival,EECProductDetailRoomTypesUCutoff:e.EECProductDetailBaseRoomTypesUCutoff,EECProductDetailRoomTypesUMaxStay:e.EECProductDetailBaseRoomTypesUMaxStay,EECProductDetailRoomTypesUMinStay:e.EECProductDetailBaseRoomTypesUMinStay,EECProductDetailRoomTypesUPax:e.EECProductDetailBaseRoomTypesUPax,EECProductDetailStars:e.EECProductDetailBaseStars,EECProductDetailState:e.EECProductDetailBaseState,EECProductDetailWeek:e.EECProductDetailBaseWeek,EECProductDetailWeekDay:e.EECProductDetailBaseWeekDay,EECProductDetailZone:e.EECProductDetailBaseZone,EECProductDetailPrice:e.EECProductDetailBasePrice,EECProductDetailPlaceId:e.EECProductBasePlaceId,EECProductDetailAvailable:e.EECProductDetailBaseAvailable,RAPA:e.BaseRAPA,RAPD:e.BaseRAPD,EECImpressionProductUrl:e.EECImpressionBaseProductUrl,EECIDestinationUrl:e.EECIBaseDestinationUrl,EECImpressionImageUrl:e.EECImpressionBaseImageUrl,EECProductDetailNoAvailable:e.EECProductDetailBaseNoAvailable,EECProductDetailNoAvailableMaxCapacity:e.EECProductDetailBaseNoAvailableMaxCapacity,EECProductDetailNoAvailableMinCapacity:e.EECProductDetailBaseNoAvailableMinCapacity,EECProductDetailNoAvailableMaxStay:e.EECProductDetailBaseNoAvailableMaxStay,EECProductDetailNoAvailableMinStay:e.EECProductDetailBaseNoAvailableMinStay,EECProductDetailChannel:e.EECProductDetailBaseChannel};this.analytics.set(this.events.productDetail,t)}},{key:"setAddToCart",value:function(e,t){var n=this.addToCartBase(e,t),r={event:this.events.addToCart,EECAddToCartName:n.EECAddToCartBaseName,EEAddToCartId:n.EEAddToCartBaseId,EECAddToCartRating:n.EECAddToCartBaseRating,EECAddToCartStars:n.EECAddToCartBaseStars,EECAddToCartPrice:n.EECAddToCartBasePrice,EECAddToCartQuantity:n.EECAddToCartBaseQuantity,EECAddToCartAdults:n.EECAddToCartBaseAdults,EEAddToCartKids:n.EEAddToCartBaseKids,EECAddToCartCity:n.EECAddToCartBaseCity,EECAddToCartState:n.EECAddToCartBaseState,EECAddToCartCountry:n.EECAddToCartBaseCountry,EECAddToCartCheckin:n.EECAddToCartBaseCheckin,EECAddToCartCheckout:n.EECAddToCartBaseCheckout,EECAddToCartNights:n.EECAddToCartBaseNights,EECAddToCartPlaceId:n.EECAddToCartBasePlaceId,EECAddToCartMealPlan:n.EECAddToCartBaseMealPlan,EECAddToCartAvailable:n.EECAddToCartBaseAvailable,EECAddToCartBookNowPayLater:n.EECAddToCartBaseBookNowPayLater};this.analytics.set(this.events.addToCart,r)}},{key:"productDetailBase",value:function(){var e=this.isoWeekNumber(),n=this.getWeekDay(this.box.checkIn),r=this._paxes,o=(this.hotel.rooms,this._roomRates.rooms||[]),i=this.hotel.gallery&&this.hotel.gallery.length?this.hotel.gallery[0]:{},a=((o.length&&o[0].rate.length?o[0].rate[0]:{}).Taxes,this.location),s=this.isRAPD(),c=this._roomRates.rooms.length>0,l="".concat(this.config.site.siteUrl).concat(this.config.site.pathHoteles).concat(this.placeContainer.uri);return{EECProductDetailBaseAdults:r.adults,EECProductDetailBaseBrand:"",EECProductDetailBaseCheckin:this.checkIn,EECProductDetailBaseCheckout:this.checkOut,EECProductDetailBaseCity:a.city,EECProductDetailBaseContractOwner:"",EECProductDetailBaseCountry:a.country,EECProductDetailBaseDestination:a.city,EECProductDetailBaseId:"".concat(this.hotel.hotelId),EECProductDetailBaseKids:r.children.length,EECProductDetailBaseName:this.hotel.name,EECProductDetailBaseNights:this.nights,EECProductDetailBaseQuantity:this.box.pax.rooms,EECProductDetailBaseRating:"".concat(this.rating),EECProductDetailBaseRoomTypes:this.roomsAval.length+o.length,EECProductDetailBaseRoomTypesAvailable:o.length,EECProductDetailBaseRoomTypesOnRequest:0,EECProductDetailBaseRoomTypesUAllotment:0,EECProductDetailBaseRoomTypesUClosedDate:0,EECProductDetailBaseRoomTypesUClosedToArrival:0,EECProductDetailBaseRoomTypesUCutoff:0,EECProductDetailBaseRoomTypesUMaxStay:0,EECProductDetailBaseRoomTypesUMinStay:0,EECProductDetailBaseRoomTypesUPax:0,EECProductDetailBaseStars:this.hotel.stars,EECProductDetailBaseState:a.state,EECProductDetailBaseWeek:Number(e),EECProductDetailBaseWeekDay:n,EECProductDetailBaseZone:"",EECProductDetailBasePrice:o.length>0?Math.min.apply(Math,t(o.map((function(e){return e.lessRate})))):0,EECProductBasePlaceId:this.hotel.placeId,EECProductDetailBaseAvailable:c,BaseRAPA:!this._roomRates.isBlockRAPD&&0!=o.length,BaseRAPD:s,EECImpressionBaseProductUrl:this.url,EECIBaseDestinationUrl:l,EECImpressionBaseImageUrl:i.cloudUri,EECProductDetailBaseNoAvailable:this.getavailableGetRooms(),EECProductDetailBaseNoAvailableMaxCapacity:this.getMaxMinCapacity(!0),EECProductDetailBaseNoAvailableMinCapacity:this.getMaxMinCapacity(!1),EECProductDetailBaseNoAvailableMaxStay:this.getMaxMinStay(!0),EECProductDetailBaseNoAvailableMinStay:this.getMaxMinStay(!1),EECProductDetailBaseChannel:this.config.site.channelFac}}},{key:"addToCartBase",value:function(e,t){var n=this.location,r=this._roomRates.rooms.length,o=r>0,i=t.map((function(e){return e.mealPlanCode})).join(":");return{EECAddToCartBaseName:this.hotel.name,EEAddToCartBaseId:"".concat(this.hotel.hotelId),EECAddToCartBaseRating:"".concat(this.rating),EECAddToCartBaseStars:this.hotel.stars,EECAddToCartBasePrice:e.Amount,EECAddToCartBaseQuantity:r,EECAddToCartBaseAdults:e.Adults,EEAddToCartBaseKids:e.Kids,EECAddToCartBaseCity:n.city,EECAddToCartBaseState:n.state,EECAddToCartBaseCountry:n.country,EECAddToCartBaseCheckin:this.checkIn,EECAddToCartBaseCheckout:this.checkOut,EECAddToCartBaseNights:this.nights,EECAddToCartBasePlaceId:this.hotel.placeId,EECAddToCartBaseBookNowPayLater:e.isBookNowPayLater,EECAddToCartBaseMealPlan:i,EECAddToCartBaseAvailable:o}}},{key:"detailPageViewEvent",value:function(){}},{key:"setViewSearchResult",value:function(){var e={event:this.events.gtmEvent,eventName:this.events.viewSearchResults,eventCategory:this.events.hotels,eventAction:"HotelDetail",eventLabel:"".concat(this.place.displayText),eventExtra:this.pages[this.config.page]};this.analytics.set(this.events.gtmEvent,e)}},{key:"selectedFilter",value:function(e){var t={event:this.events.gtmEvent,eventName:this.events.selectContent,eventCategory:this.events.hotels,eventAction:"HotelDetail",eventLabel:"".concat(this.events.typeHotel," :: ").concat(e),eventExtra:this.pages[this.config.page]};this.analytics.set(this.events.trackEvent,t)}},{key:"selectedReviews",value:function(e){var t=this._paxes,n={event:this.events.trackEvent,eventName:this.events.selectContent,content_type:this.events[e.content_type],element:"".concat(e.elementText," :: ").concat(e.calf),layer:this.events.hotels,page_type:this.events.typeHotel,field_hotel_name:this.hotel.name,field_hotel_id:this.hotel.hotelId,field_date1:this.checkIn,field_date2:this.checkOut,field_rooms:this.box.pax.rooms,travelers_adults:t.adults,travelers_children:t.children.length,field_score_descr:e.calfDesc};this.analytics.set(this.events.trackEvent,n)}},{key:"sendPaymentFunnel",value:function(){var e=this._paxes,t=this.isRAPD()?"RAPD":"RAPA",n={event:this.events.gtmEvent,eventName:this.events.paymentFunnel,eventAction:"HotelDetail | hotelId:".concat(this.hotel.hotelId," | ").concat(this.hotel.name),eventCategory:this.events.hotels,eventLabel:"".concat(this.checkIn," | ").concat(this.checkOut," | adults:").concat(e.adults," | kids:").concat(e.children.length," | ").concat(t),eventExtra:""};this.analytics.set(this.events.gtmEvent,n)}},{key:"unavailableHotelImg",value:function(e,t){var n={event:this.events.gtmEvent,eventName:"unavailableHotelImg",eventAction:"HotelDetail",eventCategory:this.events.hotelErrorImg,eventLabel:"habitaciones:".concat(e),eventExtra:t};this.analytics.set(this.events.gtmEvent,n)}},{key:"roomDuplicate",value:function(e,t){var n={event:this.events.gtmEvent,eventName:"roomDuplicate",eventAction:"HotelDetail",eventCategory:this.events.hotelErrorDuplicate,eventLabel:"habitaciones:".concat(Array.from(e).join(",")),eventExtra:t};this.analytics.set(this.events.gtmEvent,n)}},{key:"unavailableHotel",value:function(e,t){if(!(this._roomRates.rooms.length>0)){var n=this.buildPaxLabel(t),r={event:this.events.gtmEvent,eventName:this.events.hotelError,eventAction:"HotelDetail-".concat(e||"None"),eventCategory:this.events.hotelError,eventLabel:"hotelId:".concat(this.hotel.hotelId," | ci:").concat(this.checkIn," | co:").concat(this.checkOut," | ").concat(n),eventExtra:"unavailableHotel"};this.analytics.set(this.events.gtmEvent,r)}}},{key:"setAB",value:function(e){var t=this._paxes,n=this.isRAPD()?"RAPD":"RAPA",r={event:this.events.gtmEvent,eventName:this.events.gtmEventAB,eventCategory:e.cookieValue,eventAction:"HotelDetail | hotelId:".concat(this.hotel.hotelId," | ").concat(this.hotel.name," | ").concat(e.code),eventLabel:"".concat(this.checkIn," | ").concat(this.checkOut," | adults:").concat(t.adults," | kids:").concat(t.children.length," | ").concat(n),eventExtra:""};this.analytics.set(this.events.gtmEvent,r)}},{key:"viewItemListTB",value:function(e){for(var t=this._paxes,n=e.length,r={event:"ga4.".concat(this.events.trackEvent),eventName:"view_item",eventParams:{currency:this.config.site.currency,channel:this.config.site.channelFac,field_destination:this.placeContainer.id,field_date1:this.checkIn,field_date2:this.checkOut,field_rooms:this.box.pax.rooms,field_total_nights:this.nights,travelers_adults:t.adults,travelers_children:t.children.length,page_type:this.pages[this.config.page],layer:this.events.hotels,timestamp:Date.now(),items:[]}},o=0;o<n;o++){var i=e[o];i.taxes=this.roomsTax[o].rate.rate[o].taxes;var a=this.itemBase(i);r.eventParams.items.push({item_id:a.itemId,item_name:a.itemName,item_brand:a.itemBrand,item_category:"hotel",item_category2:"hotel",item_variant:null,price:a.price,coupon:a.coupon,item_list_name:this.place.name})}this.analytics.set("view_item",r)}},{key:"itemBase",value:function(e){return{itemId:e.hotelId,itemName:e.name,price:e.taxes?e.taxes.totalRoomRatePerNight:0,itemBrand:e.uri,itemCategory:this.config.page,itemList:this.place.name,position:e.position,coupon:e.taxes?e.taxes.promotionType:null}}},{key:"setUserInteraction",value:function(e){var t=e?"Paga despues":"Paga ahora",n={event:this.events.gtmEvent,eventName:this.events.user_interaction,eventCategory:this.events.hotels,eventAction:this.events.click,eventLabel:t,eventExtra:this.pages[this.config.page]};this.analytics.set(this.events.gtmEvent,n)}},{key:"beginCheckOutTB",value:function(e,t){var n=this,r=this._paxes,o=(e.rate,t.map((function(e){return e.mealPlanCode})).join(":")),i=t.map((function(e){return{item_id:e.idRoom,item_name:e.name,item_brand:n.place.name,item_category:"habitaciones",item_category2:null,item_variant:null,price:e.totalRoomRatePerNight,coupon:e.promotionValue,item_list_name:"rooms",item_list_id:e.index}})),a={event:"ga4.".concat(this.events.trackEvent),eventName:"detail_to_checkout",eventParams:{currency:this.config.site.currency,value:e.Amount,field_destination:this.place.id,field_date1:this.checkIn,field_date2:this.checkOut,field_rooms:this.box.pax.rooms,field_total_nights:this.nights,travelers_adults:r.adults,travelers_children:r.children.length,arrival_id:this.place.id,meal_plan:o,purchase_type:e.isBookNowPayLater?"pagar despues":"pagar ahora",content_type:this.events.button,page_type:this.pages[this.config.page],layer:this.events.hotels,timestamp:Date.now(),items:i}};this.analytics.set(this.events.gtmEvent,a)}},{key:"setHotelNotRooms",value:function(){var e=this._paxes,t=this.isRAPD()?"RAPD":"RAPA",n={event:this.events.gtmEvent,eventName:this.events.notRooms,eventAction:"HotelDetail | hotelId:".concat(this.hotel.hotelId," | ").concat(this.hotel.name),eventCategory:this.events.hotels,eventLabel:"".concat(this.checkIn," | ").concat(this.checkOut," | adults:").concat(e.adults," | kids:").concat(e.children.length," | ").concat(t),eventExtra:""};this.analytics.set(this.events.gtmEvent,n)}},{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:this.hotel.name,travelers_adults:t.adults,travelers_children:t.children.length,field_hotel_id:this.hotel.hotelId,field_rooms:this.box.pax.length,page_type:this.pages[this.config.page],layer:this.events.hotels,content_type:this.events.button}};this.analytics.set(this.events.gtmEvent,n)}},{key:"setEventFamilyDetail",value:function(e){var t={event:this.events.gtmEvent,eventName:this.events.selectContent,eventCategory:this.events.hotels,eventAction:this.events.button,eventLabel:"".concat(e),eventExtra:this.pages[this.config.page]};this.analytics.set(this.events.gtmEvent,t)}},{key:"countNight",value:function(e,t){return Math.abs(new Date(t).getTime()-new Date(e).getTime())/864e5}},{key:"getWeekDay",value:function(e){var t=e.split("-");return new Date(t.join("/")).getDay()}},{key:"isoWeekNumber",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=new Date(e),n=e.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-n);var r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return"".concat(Math.ceil(((t.getTime()-r.getTime())/864e5+1)/7))}},{key:"buildPaxLabel",value:function(e){var t,n=0,o=[],i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},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 a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;n+=1;var s=a.split("|"),c=s[0]?Number(s[0]):0,l=s[1]?s[1].split(","):[];l.map((function(e){return{year:Number(e)}})),o.push("room".concat(n,".adults:").concat(c,"|room").concat(n,".kids:").concat(l))}}catch(e){i.e(e)}finally{i.f()}return o.join(",")}},{key:"isRAPD",value:function(){return!!this._roomRates.rooms&&this._roomRates.rooms.map((function(e){return e.rate.some((function(e){return e.IsBookNowPayLaterApplicable}))})).some((function(e){return e}))}},{key:"getavailableGetRooms",value:function(){var e=this,t="";return this.roomsTax.map((function(n){e.roomsAval.find((function(e){return e.roomId==n.roomId}))&&(n.unavailableStatus.availabilityStatus.includes("RoomCapacity")?t="capacity":n.unavailableStatus.availabilityStatus.includes("MinimumStay")&&(t="stay"))})),t}},{key:"getMaxMinStay",value:function(e){var t=this,n=0;return this.roomsTax.map((function(e){if(t.roomsAval.find((function(t){return t.roomId==e.roomId}))&&e.unavailableStatus.availabilityStatus.includes("MinimumStay")){var r=parseInt(e.unavailableStatus.availabilityValue);n<r&&(n=r)}})),e?0:n}},{key:"getMaxMinCapacity",value:function(e){var n=this,r=0,o=0;return this.roomsTax.map((function(e){n.roomsAval.find((function(t){return t.roomId==e.roomId}))&&e.unavailableStatus.availabilityStatus.includes("RoomCapacity")&&(r<Math.max.apply(Math,t(e.capacityList))+1&&(r=Math.max.apply(Math,t(e.capacityList))+1),o<Math.min.apply(Math,t(e.capacityList))+1&&(o=Math.min.apply(Math,t(e.capacityList))+1))})),e?r:o}}],o&&i(n.prototype,o),a&&i(n,a),Object.defineProperty(n,"prototype",{writable:!1}),e}();function s(e){return s="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},s(e)}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,(o=r.key,i=void 0,i=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===s(i)?i:String(i)),r)}var o,i}var l=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.events=window.__pt.fn.analytics.events,this.hotel=window.__pt.hotel||{}}var t,n,r;return t=e,(n=[{key:"sendEventTracker",value:function(e,t){var n={event:this.events.gtmEvent,eventAction:"".concat(this.hotel.hotelId),eventCategory:e,eventLabel:t,eventName:this.events.gtmEvent,eventExtra:""};this.analytics.set(this.events.gtmEvent,n)}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 d(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,(o=r.key,i=void 0,i=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)}(o,"string"),"symbol"===u(i)?i:String(i)),r)}var o,i}var h=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)}}])&&d(t.prototype,n),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 f(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 m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(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"!==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)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=function(e){for(var t=e.map((function(e,t){return m(m({},e),{},{idx:t})})),n=[],r=[],o=0;o<t.length;o+=4){var i=t.slice(o,o+4);n.push(i)}for(var a,s,c=0,l=n;c<l.length;c++)for(var u=l[c],d=0;d<u.length;d++)r.push({classname:"grid-item ".concat((a=d,s=void 0,s="",0===a&&(s="tall"),1===a&&(s=""),2===a&&(s="wide"),3===a&&(s=""),s)),uri:u[d].cloudUri,index:u[d].idx,description:u[d].description});return r},y=n(7066);function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.adults,o=e.children,i=e.rooms,a=o.length,s=t?1:i,c={},l={adults:r,kids:a,kidsSlit:o,rooms:s};return(c=n?k(l):b(l)).distribution||(c.distribution=[],c.distribution.push("".concat(r).concat(o.length>0?"|":"").concat(o.map((function(e){return null==e?void 0:e.year})).join(",")))),{paxes:{adults:r,children:o,rooms:i},adults:r,children:a,paxesFormat:c.distribution,roomExtra:c.roomExtra}}function b(e){var t=e.adults,n=e.kids,r=e.kidsSlit;return _(t,n,e.rooms,r)}function k(e){var t,n,r,o,i,a,s,c,l,u,d,h,p,f,m,v,g,y,w,b,k,E,I,S,P,C,T,x,D,R,A,O,L,N,M,j,U,F=e.adults,B=e.kids,$=e.kidsSlit,H=e.rooms,V={"2x2":["1|".concat(null===(t=$[0])||void 0===t?void 0:t.year),"1|".concat(null===(n=$[1])||void 0===n?void 0:n.year)],"2x3":["1|".concat(null===(r=$[0])||void 0===r?void 0:r.year),"1|".concat(null===(o=$[1])||void 0===o?void 0:o.year,",").concat(null===(i=$[2])||void 0===i?void 0:i.year)],"3x1":["2","1|".concat(null===(a=$[0])||void 0===a?void 0:a.year)],"3x2":["2|".concat(null===(s=$[0])||void 0===s?void 0:s.year),"1|".concat(null===(c=$[1])||void 0===c?void 0:c.year)],"3x3":["2|".concat(null===(l=$[0])||void 0===l?void 0:l.year,",").concat(null===(u=$[1])||void 0===u?void 0:u.year),"1|".concat(null===(d=$[2])||void 0===d?void 0:d.year)],"2x4":["1|".concat(null===(h=$[0])||void 0===h?void 0:h.year,",").concat(null===(p=$[1])||void 0===p?void 0:p.year),"1|".concat(null===(f=$[2])||void 0===f?void 0:f.year,",").concat(null===(m=$[3])||void 0===m?void 0:m.year)],"3x4":["2|".concat(null===(v=$[0])||void 0===v?void 0:v.year,",").concat(null===(g=$[1])||void 0===g?void 0:g.year),"1|".concat(null===(y=$[2])||void 0===y?void 0:y.year,",").concat(null===(w=$[3])||void 0===w?void 0:w.year)],"4x4":["2|".concat(null===(b=$[0])||void 0===b?void 0:b.year,",").concat(null===(k=$[1])||void 0===k?void 0:k.year),"2|".concat(null===(E=$[2])||void 0===E?void 0:E.year,",").concat(null===(I=$[3])||void 0===I?void 0:I.year)],"5x0":["3","2"],"5x1":["3","2|".concat(null===(S=$[0])||void 0===S?void 0:S.year)],"5x2":["3|".concat(null===(P=$[0])||void 0===P?void 0:P.year),"2|".concat(null===(C=$[1])||void 0===C?void 0:C.year)],"4x2":["2|".concat(null===(T=$[0])||void 0===T?void 0:T.year),"2|".concat(null===(x=$[1])||void 0===x?void 0:x.year)],"4x3":["2|".concat(null===(D=$[0])||void 0===D?void 0:D.year),"2|".concat(null===(R=$[1])||void 0===R?void 0:R.year,",").concat(null===(A=$[2])||void 0===A?void 0:A.year)],"6x0":["3","3"],"6x1":["2","2","2|".concat(null===(O=$[0])||void 0===O?void 0:O.year)],"7x0":["4","3"],"7x1":["3","2","2|".concat(null===(L=$[0])||void 0===L?void 0:L.year)],"7x2":["3","2|".concat(null===(N=$[0])||void 0===N?void 0:N.year),"2|".concat(null===(M=$[1])||void 0===M?void 0:M.year)],"8x2":["3","3|".concat(null===(j=$[0])||void 0===j?void 0:j.year),"2|".concat(null===(U=$[1])||void 0===U?void 0:U.year)],"8x0":["4","4"]};return{distribution:V["".concat(F,"x").concat(B)]?V["".concat(F,"x").concat(B)]:null,roomExtra:_(F,B,H,$).roomExtra}}function _(e,t,n,r){var o=!1;if(0===e)return["No hay adultos para distribuir."];for(var i=Math.ceil(e/n),a=Math.ceil(t/n),s=e,c=Math.ceil(t%n),l=[],u=0;u<n;u++){var d=[];if(s>0?(d.push(i),s-=i):(d.push(i+1),o=!0),e/n%2!=0&&(i=Math.ceil(s/(n-(0==l.length?1:l.length+1)))),c>0){var h=r.slice(u*a).slice(0,a).map((function(e){return null==e?void 0:e.year}));h.length>0&&(d.push(h.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&&d.push(p.join(","))}d.length>0&&l.push(d.join("|"))}for(;l.length<n;)l.push("1"),o=!0;return{distribution:l,roomExtra:o}}var E={es:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],en:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},I={es:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function S(e,t){var n=new Date(e),r=E[t][n.getUTCDay()],o=n.getUTCDate(),i=I[t][n.getUTCMonth()];return{dayOfWeek:r,dayAndMonth:"es"===t?"".concat(o," ").concat(i):"".concat(i," ").concat(o)}}var P=n(5515),C=n(4943),T=n(2805),x=n(694);function D(e){return D="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},D(e)}function R(){R=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:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.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,o){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),s=new S(o||[]);return r(a,"_invoke",{value:k(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 d={};function h(){}function p(){}function f(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(P([])));g&&g!==t&&n.call(g,i)&&(m=g);var y=f.prototype=h.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 o(r,i,a,s){var c=u(e[r],e,i);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==D(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function k(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return C()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===d)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===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function _(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,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,d;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=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 o.next=o}}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,o,i){void 0===i&&(i=Promise);var a=new b(l(t,n,r,o),i);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,i,(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(I),!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 o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):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),d},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),I(n),d}},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 o=r.arg;I(n)}return o}}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),d}},e}function A(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){A(i,r,o,a,s,"next",e)}function s(e){A(i,r,o,a,s,"throw",e)}a(void 0)}))}}function L(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,(o=r.key,i=void 0,i=function(e,t){if("object"!==D(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===D(i)?i:String(i)),r)}var o,i}var N=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,o,i,a,s;return t=e,n=[{key:"logAddFav",value:(s=O(R().mark((function e(t,n){var r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={event:this.events.gtmEvent,eventName:"favs_add",eventCategory:this.events.hotels,eventAction:n.toString(),eventLabel:"".concat(t.id," :: ").concat(t.name),eventExtra:n+"|"+t.uri},this.analytics.set(this.events.gtmEvent,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"logDeleteFav",value:(a=O(R().mark((function e(t,n){var r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={event:this.events.gtmEvent,eventName:'"favs_delete"',eventCategory:this.events.hotels,eventAction:n.toString(),eventLabel:"".concat(t.id," :: ").concat(t.name),eventExtra:n+"|"+t.uri},this.analytics.set(this.events.gtmEvent,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"logOpenFav",value:(i=O(R().mark((function e(t,n,r){var o,i,a,s;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=t.checkin?this.fn.getDate(t.checkin):"",i=t.checkout?this.fn.getDate(t.checkout):"",a="=",t.totalRoomRatePerNight<t.originalPrice?a="bajó":t.totalRoomRatePerNight>t.originalPrice&&(a="subió"),s={event:this.events.gtmEvent,eventName:"favs_open_item",eventCategory:this.events.hotels,eventAction:n.toString(),eventLabel:"".concat(t.id," :: ").concat(t.name," :: ").concat(o,"-").concat(i),eventExtra:"".concat(a," :: ").concat(r)},this.analytics.set(this.events.gtmEvent,s);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"logOpenFavsList",value:(o=O(R().mark((function e(t,n){var r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={event:this.events.trackEvent,eventName:"favs_open_list",eventCategory:this.events.hotels,eventAction:t.toString(),eventLabel:"".concat(n),eventExtra:""},this.analytics.set(this.events.gtmEvent,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})}],n&&L(t.prototype,n),r&&L(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),M=n(9586);function j(e){return j="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},j(e)}function U(e){return function(e){if(Array.isArray(e))return V(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||H(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 F(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,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||H(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 B(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=H(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function H(e,t){if(e){if("string"==typeof e)return V(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)?V(e,t):void 0}}function V(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 W(){W=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:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.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,o){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),s=new S(o||[]);return r(a,"_invoke",{value:k(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 d={};function h(){}function p(){}function f(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(P([])));g&&g!==t&&n.call(g,i)&&(m=g);var y=f.prototype=h.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 o(r,i,a,s){var c=u(e[r],e,i);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==j(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function k(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return C()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===d)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===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function _(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,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,d;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=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 o.next=o}}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,o,i){void 0===i&&(i=Promise);var a=new b(l(t,n,r,o),i);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,i,(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(I),!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 o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):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),d},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),I(n),d}},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 o=r.arg;I(n)}return o}}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),d}},e}function q(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function z(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){q(i,r,o,a,s,"next",e)}function s(e){q(i,r,o,a,s,"throw",e)}a(void 0)}))}}function G(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 K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){Y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==j(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==j(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===j(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J(e,t,n,r,o,i,s){var c=window.__pt.settings.site,u=this,d=window.__pt.fn,p=window.__pt.hotel||{},f=window.__pt.settings,m=window.innerWidth||document.documentElement.clientWidth,v=window.__pt.settings.rb||!1,b=window.__pt.box||{},k=window.__pt.place||{},_=window.__pt.placeContainer||{},E=window.__pt.cultureData||{},I=window.__pt.ln||{},D=window.__pt.user||null,R={},A=window.__pt.userLocation,O={},L=!0,j=null,H=null,V=new x.Z,q=V.getUserKey(),G=V.getUserKeyFavorites(),Y=!!D,J="#price-modal-info",Z=[" Special Price."," Precio Especial.","Precio especial"],X=d.search(),ee={},te=new h,ne=null,re=null,oe=d.mobileAndTabletCheck(),ie="",ae={checkIn:b.checkIn,checkOut:b.checkOut},se=new P.Z,ce=new N,le=new l,ue={checkInDate:null,checkOutDate:null,placeId:_.id,adultQuantity:0,kidQuantity:0,hotelId:p.hotelId,stepId:3};u.roomsTotal=X.rooms||0;var de={checkin:b.checkIn,checkout:b.checkOut,hotelid:p.hotelId,CampaignToken:j,source:b.source?b.source:"SPA-Hotel-List",ispackage:!1,site:c.domain,culture:E.internalCultureCode,rooms:2,promotions:X.promotions?X.promotions.split(","):null},he={checkin:b.checkIn,checkout:b.checkOut,hotelid:p.hotelId,ispackage:!1,site:c.domain},pe=[];u.customLimit=0,u.RAPDObject={totalSticky:0,totalHasTaxSticky:!1,totalImpSticky:0},u.allImagesText='@viewHelper.Localizer("all_images")',u.isFilterMenuOpen=!1,u.selectedClasificationName=null,u.galleryIndexIndex=null,u.defaultHotel=f.defaultHotel,u.checkIn=b.checkIn,u.checkOut=b.checkOut,u._isLogin=Y,u.dateConfig=f.formatDateSlash,u.dateConfigbook=f.formatDateSlashBook,u.configPrefix=f.site.sufix,u.mealplans=I.mealplans,u.lnMessages=I,u.hotel=p,u.rooms=[],u.availableRooms=[],u.unavailableRooms=[],u.reviewsLoadingModal=!0,u.gallery=[],u.grid=[],u.isTrivagoModal=!1,u.modalRapdCurrentData=null,u.getRecomedationLabelSticky="",u.currentRoom=null,u.cheaperRoomRate={messages:"",disabled:!0,loading:!0},u.clasifications=[],u.filteredImages=[],u.code=c.code,u.boxData={rooms:0,nights:0,totalPax:0},u.assigRateSet={},u.assigRoomRateModal={},u.isTrivagoRate=!!X.room_search,u.listReviews={},u.showDetailScoreReviews=!1,u.sliderIsInit=!1,u.loading=!0,u.toggleDescription=!0,u.toggleDescriptionAbout=!0,u.isIncompletePax="",u.overViewMinors="",u.averageDetailToggle=!1,u.phoneBase=c.phoneDefault||"",u.currency=c.currencyCodeName,u.roomsLimit=c.limitRoomsRates||0,u.ratesLimit=c.limitRates||0,u.roomsAvailables=0,u.limitRoomsFilter=u.roomsLimit,u.roomRateMobileSelected={},u.source_origin="",u.mealplanCodesList=[],u.sizeDescriptionString=c.hotelAboutConfigIdeal,u.responsePayment={fixedPayments:[],monthInterestFree:[]},u.TitleModalRAPD="",u.dateRAPDSticky="",u.isCancelation=!1,u.selectModalRoom=0,u.totalSticky=0,u.totalPromoDiscount=0,u.totalImpSticky=0,u.totalRoomSticky=0,u.viewDetailSticky=!1,u.totalHasTaxSticky=!1,u.datesRecommended=[],u.pageError={has:!1,type:null},u.responseroomsAvailables=[],u.monthInterestData={},u.ratesResponse={rooms:[]},u.sumTotalSticky=0,u.ratesResponse={},u.onSubmitLoading=!1,u.onSubmitLoadingRecomendation=!1,u.hasCancellationFree=!1,u.hasPayLater=!1,u.isBlockRAPD=!1,u.RateForRAPD={},u.roomsForRAPD="",u.headTabs={rooms:"#rooms",amenities:"#amenities",map:"#location",current:""},u.featuredRoom={},u.isRequote=!1,u.boxData={rooms:0,nights:0,totalPax:0},u.roomDelTrivago={},u.indexRoomTrivago=-1,u.recommendedDates=null,u.sourceTriGooHotelsIds=!1,u.isMsiAvailable=!1,u.msiMonthsAllow=[],u.notAmount=!1,u.notMessage=!1;u.isRAPDRecomendation=!1,u.hasErrorHandle=!1,u.rateModal={},u.roomModal={totalRooms:0},u.roomIndexModal={},u.isGoSection=!1;var fe=new T.Z(c.domainAPIUrl);u.alertsFavorites={notificationSuccess:!1,notificationError:!1,notificationWarning:!1,message:"",actionType:""},u.favoriteHotels=[],u.showTimer=!1;var me,ve,ge,ye=null;u.sourceOrigen="",u.filteredServices=(me=u.hotel.services,ve=me&&me.filter((function(e){return!0===e.hasExtraCharge})),ge=me&&me.filter((function(e){return!1===e.hasExtraCharge})),{servicesHasCharge:ve,servicesNotHasCharge:ge}),u.visibleServicesCount=9,u.visibleSInfoHotelCount=2,u.toggleDescription=!1,u.toggleServices=!1,u.toggleSellingPoints=!1,u.stickyRates=[],u.totalTotalSticky=0,u.isRecomendationCheckout=!1,u.recomendationsList={loading:!0,rooms:[],checkoutHash:[]},u.recomendationsListCopy={rooms:[]},u.showStickyHeader=!1,u.quantityLoop=0;var we=window.__pt.ln;u.roomsAvailLoading=!1;var be={},ke={};u.lengthPaxes=Se(b.pax),u.paxFam=be,u.applicableRAPDSticky=!1,u.appicableExperiment=m>=992,u.openServicesSections={},u.nearbyPlacesCategory=0,u.applicableGallery=window.innerWidth<=767;var _e=p.tags&&p.tags.some((function(e){var t=e.name.toLowerCase();return"solo adultos"===t||"adults only"===t}));function Ee(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 Ie(){ee=function(){for(var e=b.pax&&b.pax.length,t={adults:0,children:0,paxesFormat:[]},n=0;b.pax&&n<e;n++){var r=b.pax[n],o="";t.adults+=r.adults,o+="".concat(r.adults),r.children&&r.children.length&&(o+="|",t.children+=r.children.length,o+="".concat(r.children.map((function(e){return e.year})).join(","))),t.paxesFormat.push(o)}return t}(),u.gallery=u.hotel.gallery,u.rooms=u.hotel.rooms,c.showReviews&&!f.rb&&(u.reviewsLoadingModal=!0,u.getReviews(u.hotel.hotelId,!1)),Ge()}function Se(e){var t=e.adults;return e.children&&e.children.length>0&&(t+=e.children.length),t}function Pe(){D&&D.firebaseId?j=c.campaignTokenUser:Ge(),u.loading=!0,u.hasCancellationFree=!1,u.hasPayLater=!1,u.roomsAvailables=0,u.recommendedDates=null,u.checkIn=de.checkin,u.checkOut=de.checkout,de.rooms=be.paxesFormat,de.CampaignToken=j,de.userKey=q,de.mobile=oe,de.login=Y,de.culture=E.internalCultureCode,de.responseTimeout=2e4,de.source=b.source?b.source:"SPA-Hotel-List",de.channelId=oe?c.chkSourceMobile:c.chkSourceDesktop,de.isOnlyA=u.onlyAdults,u.datesRecommended=[],t.get(u.appicableExperiment?c.endPoints.detailQuoteUrlFam:c.endPoints.detailQuoteUrl,{params:de,headers:(0,y.w)()}).then(xe,(function(e){Me(),Ye(e)}))}function Ce(){if(!f.rb){var e,n,r=K({},de);r.rooms=be.paxesFormat,r.userKey=null,r.CampaignToken=null,r.login=!Y,r.channelId=oe?0!=(null===(e=c.channelConfigDefault)||void 0===e?void 0:e.mobileLogin.channelId)?c.channelConfigDefault.mobileLogin.channelId:r.channelId:0!=(null===(n=c.channelConfigDefault)||void 0===n?void 0:n.desktopLogin.channelId)?c.channelConfigDefault.desktopLogin.channelId:r.channelId,r.isOnlyA=u.onlyAdults,t.get(u.appicableExperiment?c.endPoints.detailQuoteUrlFam:c.endPoints.detailQuoteUrl,{params:r,headers:(0,y.w)()}).then(Re,(function(e){}))}}function Te(e){u.totalSticky=0,u.totalImpSticky=0,u.totalRoomSticky=0,u.totalPromoDiscount=0,u.totalTotalSticky=0,u.imgSticky="";var t=d.getDate(de.checkin),n=d.getDate(de.checkout),r=d.diffBetweenDays(t,n),o=0,i=0;u.totalHasTaxSticky=!1,u.getRecomedationLabelSticky="",u.sumTotalSticky=0,u.applicableRAPDSticky=!0,u.applicableMonthsIntereses=!0,u.dateRAPDSticky="",u.isCancelation=!1,u.AgesMenors="",u.totalChildrens=0;var a,s={},c=B(e);try{var l=function(){var e=a.value;if(e.selectedRoomValue){u.totalRoomSticky+=e.selectedRoomValue,u.totalSticky+=e.taxes.totalRoomRatePerNight*e.selectedRoomValue,u.totalTotalSticky+=e.taxes.totalRoomRate*e.selectedRoomValue,u.totalHasTaxSticky=e.taxes.hasTaxes,e.taxes.totalTaxesPerRoomPerNight>0&&(u.totalImpSticky+=e.taxes.totalTaxes*e.selectedRoomValue),u.imgSticky=e.img,u.isDiscount=e.taxes.discount,u.totalPromoDiscount+=e.taxes.totalRoomRateBeforePromoExclusive*e.selectedRoomValue;var t=e.paxFam.split("|"),n=t[0]?parseInt(t[0]):0,r=t[1]?parseInt(t[1].split(",").length):0;o+=n*e.selectedRoomValue,i+=r*e.selectedRoomValue,u.AgesMenors+=t[1]?u.AgesMenors?",".concat(t[1]):t[1]:"",(t[1]?t[1].split(",").map(Number):[]).forEach((function(t){s.hasOwnProperty(t)?s[t]+=e.selectedRoomValue:s[t]=e.selectedRoomValue})),2==e.collectType&&(u.applicableMonthsIntereses=!1),!u.isBlockRAPD&&e.bookNowPayLaterTimeLimit&&e.isBookNowPayLaterApplicable&&2!=e.collectType?(u.dateRAPDSticky=e.bookNowPayLaterTimeLimit,u.isCancelation=!e.isNonRefundable&&e.cancellationPolicies.freeCancellationExpire):u.applicableRAPDSticky=!1}};for(c.s();!(a=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}var h=1==r?we.night:we.nights,p=1==o?we.adult:we.adults,f=i>0?", ".concat(i," ").concat(1==i?we.child:we.children):"",m=1==u.AgesMenors.split(",").length&&1==u.AgesMenors.split(",")?we.year:we.years;u.sumTotalSticky=o+i;var v=i>0&&i>2?"".concat(f):i>0?"".concat(f," (").concat(u.AgesMenors," ").concat(m,")"):"";u.getRecomedationLabelSticky="".concat(u.totalRoomSticky," ").concat(u.totalRoomSticky>1?we.rooms:we.room,", ").concat(u.getNights()," ").concat(h," <br>").concat(we.for," ").concat(o," ").concat(p).concat(v);var g=be.paxes.adults+be.paxes.children.length,y=o+i;u.totalChildrens=i,u.isIncompletePax=y<g?function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.replace(/{(\d+)}/g,(function(e,t){return n[t]||""}))}(we.yourSelectionIncludes,y,1==y?we.person:we.persons,g):"";var w=Object.entries(s).map((function(e){var t=F(e,2),n=t[0],r=t[1];return"".concat(r," ").concat(r>1?we.children:we.child," ").concat(we.the," ").concat(n," ").concat(1!=n?we.years:we.year)})).join(", <br>");u.overViewMinors=w}function xe(e){e.data.rooms;var n=w(b.pax,!0,!0);if(u.isRequote=!1,Le(de,n),0!==e.data.rooms.length||u.appicableExperiment)0===e.data.rooms.length&&u.appicableExperiment?Oe(e):(u.isRequote=!1,Fe(e));else{n=w(b.pax,!0,!0);var r=d.clone(de);r.rooms=n.paxesFormat,Le(r,n),t.get(u.appicableExperiment?c.endPoints.detailQuoteUrlFam:c.endPoints.detailQuoteUrl,{params:r,headers:(0,y.w)()}).then(Oe,Ye)}}function De(e){var t=K(K(K({},b),p),ee);se.metricDatesRecommended("show_suggested_dates",{data:t});var n=c.culture.split("-")[0],r=e.data;r.forEach((function(e){var t,r,o,i=S(e.checkin,n),a=S(e.checkout,n),s=(t=e.checkin,r=e.checkout,o=new Date(t),(new Date(r)-o)/864e5);e.checkinDayOfWeek=i.dayOfWeek,e.checkinDayAndMonth=i.dayAndMonth,e.checkoutDayOfWeek=a.dayOfWeek,e.checkoutDayAndMonth=a.dayAndMonth,e.dateDifference=s})),u.datesRecommended=r}function Re(e){pe=e.data.rooms,u.rooms.length&&Ae()}function Ae(){for(var e=Y?-1:1,t=function(){var t=u.rooms[n],r=pe.find((function(e){return""+e.roomId==""+t.roomId}));if(r&&t.rate)for(var o=function(){var n,o=t.rate.rate[i];if(n=r.rate.find((function(e){return e.paxFam==o.paxFam&&e.mealPlanCode==o.mealPlanCode}))){var a=(o.taxes.totalRoomRate-n.taxes.totalRoomRate)*e;100*a/o.taxes.totalRoomRate>2&&a>=d.thresHold(c.code)&&!u.notMessage&&(o.total_saved=a)}},i=0;i<t.rate.rate.length;i++)o()},n=0;n<u.rooms.length;n++)t()}function Oe(e){var n=e.data.rooms,r=w(b.pax,!0,!0);if(r.paxes.rooms=r.paxesFormat.length,e.data.isRequote=!0,u.isRequote=!0,ke=r,!n.length){var o=d.getDate(de.checkin),i={site:de.site,mobile:de.mobile,hotelId:de.hotelid,year:o.getFullYear(),month:o.getMonth()+1,type:"json",channelId:oe?c.chkSourceMobile:c.chkSourceDesktop,rooms:u.appicableExperiment?be.paxesFormat:r.paxesFormat,checkin:de.checkin,checkout:de.checkout,userKey:q,login:Y,source:b.source?b.source:"SPA-Hotel-List",applicable:u.appicableExperiment};t.get((u.appicableExperiment,c.endPoints.dateRecommended),{params:i,headers:(0,y.w)()}).then(De,(function(e){}))}Fe(e)}function Le(e,t){var n=d.getDate(e.checkin),r=d.getDate(e.checkout),o=d.diffBetweenDays(n,r),i=e.rooms.length,a=t.adults+t.children;u.boxData={rooms:i,nights:o,totalPax:a}}function Ne(){ue.adultQuantity=be.adults,ue.kidQuantity=be.children,ue.checkInDate=ae.checkIn,ue.checkOutDate=ae.checkOut,t.get(c.endPoints.skillBaseUrl,{params:ue}).then(We)}function Me(){var e={rid:p.rooms.map((function(e){return e.roomId})),checkin:ae.checkIn,checkout:ae.checkOut,p:be.paxesFormat.map((function(e){var t=e.split("|"),n=t[0],r=t.length>1?t[1].split(",").join("_"):"";return"".concat(n).concat(r?"_":"").concat(r)}))};t.get(c.endPoints.availabilityReasonsUrl,{params:e}).then(qe,Je)}function je(e){var t=e.data;t.length?(u.clasifications=t.map((function(e){return K(K({},e),{},{isSelected:"all"===e.name})})),u.filteredImages=g(u.clasifications[0].images),u.clasifications&&u.clasifications.length>0&&(u.selectedClasificationName=u.clasifications[0].name,u.selectedClasification(u.clasifications[0],0),1==u.clasifications.length&&le.sendEventTracker("Hotel Sin Categorias en Galeria","fotos:".concat(u.clasifications[0].images.length)))):u.filteredImages=g(u.gallery)}function Ue(e){var t=e.data;u.recomendationsTrivago=t.rooms||u.recomendationsTrivago;for(var n=p.gallery.find((function(e){return e&&e.cloudUri&&e.cloudUri.includes(".jpg")}))||{},r=p.rooms.length,o=[],i=new Set,a=0;a<r;a++){var s=p.rooms[a];if(!i.has(s.roomId)){i.add(s.roomId);var c=d.findObject(u.recomendationsTrivago,"roomId",s.roomId);if(c){var l=angular.copy(s),h=l.pictures&&l.pictures.find((function(e){return e&&e.cloudUri&&e.cloudUri.length}))||{};l.instructions="",l.capacityList=Array.from({length:l.capacity},(function(e,t){return t})),l.picture=l.picture||{},l.picture.cloudUri=oe?h.cloudUri||"":h.cloudUri||n.cloudUri||"",l.rate=c,o.push(l)}}}u.recomendationsTrivago=o,u.recomendationsTrivago.loading=!1;var f=X.room_search||null;if(u.recomendationsTrivago.length>0&&f&&u.isTrivagoRate){var m=f.split("|").length<2?f.split("%"):f.split("|"),v=u.recomendationsTrivago.findIndex((function(e){return e.roomId==m[0]}));if(-1==v)u.isTrivagoRate=!1;else{var g=-1!=v?u.recomendationsTrivago[v].rate.rate.findIndex((function(e){return e.rateId==m[1]})):null;if(-1==g||null==g)u.isTrivagoRate=!1;else{var y=JSON.stringify(u.recomendationsTrivago);(y=(y=JSON.parse(y))[v]).rate.rate=y.rate.rate.filter((function(e){return e.rateId==m[1]})),y.rate.rate.selectedRoomValue=1,u.featuredRoom=y,setTimeout((function(){u.goSection("roomSection",320)}),500)}}}}function Fe(e){var t=e.data;u.recomendationsList=t.recomendations||u.recomendationsList;for(var n=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg"],o=p.gallery.find((function(e){return e&&e.cloudUri&&n.some((function(t){return e.cloudUri.toLowerCase().endsWith(t)}))}))||{},i=p.rooms.length,s=[],c=new Set,l=0;l<i;l++){var h=p.rooms[l];if(!c.has(h.roomId)){c.add(h.roomId);var f=d.findObject(u.recomendationsList.rooms,"roomId",h.roomId);if(f){var m=angular.copy(h),g=m.pictures&&m.pictures.find((function(e){return e&&e.cloudUri&&e.cloudUri.length}))||{};m.instructions="",m.capacityList=Array.from({length:m.capacity},(function(e,t){return t})),m.picture=m.picture||{},m.picture.cloudUri=oe?g.cloudUri||"":g.cloudUri||o.cloudUri||"",m.rate=f,s.push(m)}}}u.recomendationsList.rooms=s;var y=Object.values(u.recomendationsList.rooms).every((function(e){var t=e.rate.rate;return!(!(t&&t.bookNowPayLaterTimeLimit&&t.isBookNowPayLaterApplicable)||u.isBlockRAPD||2==t.collectType)}));u.isRAPDRecomendation=y,Me(),u.loading=!1,u.recomendationsList.loading=!1,u.ratesResponse=t,u.cheaperRoomRate=function(e){var t={messages:"",disabled:!0,loading:!1},n=X.room_search||null;if(n&&u.isTrivagoRate){var r=n.split("|").length<2?n.split("%"):n.split("|"),o=e.filter((function(e){return e.roomId==r[0]})),i=o&&o.length>0?o[0].rate.filter((function(e){return e.rateId==r[1]})):null;(t=i&&i.length>0?i[0]:e[0].rate[0]).disabled=!1,t.loading=!1}else e&&e.length&&e[0].rate&&e[0].rate.length&&((t=e[0].rate[0]).disabled=!1,t.loading=!1);return t}(u.ratesResponse.rooms),u.RateForRAPD=u.cheaperRoomRate,u.roomsForRAPD=u.cheaperRoomRate;for(var w=p.rooms.length,b=new Set,k=!1,_=new Set,E=new Set,S=0;S<w;S++){var P=p.rooms[S];if(_.has(P.roomId))E.add(P.roomId),T={rate:[],disabled:!0},P.isRateSelectedMobile=!1,P.roomRateMobileSelected={};else{_.add(P.roomId);var C=P.pictures&&P.pictures.find((function(e){return e&&e.cloudUri&&e.cloudUri.length}))||{},T=d.findObject(u.ratesResponse.rooms,"roomId",P.roomId);if(P.instructions="",P.capacityList=Array.from(Array(P.capacity).keys()),k||(k=!C.cloudUri),P.picture=P.picture||{},P.picture.cloudUri=oe?C.cloudUri||"":C.cloudUri||o.cloudUri||"",P.galleryPosition=1,T){P.recommended=T.recommended,P.recommendedRate=T.recommendedRate,P.recommendedRates=T.recommendedRates,u.roomsAvailables+=1,P.instructions=T.rate[0].externalSalesAdvisory||"",T.rate[0].selected=!0,Qe(T);var x=Be(T.rate[0]);P.expedia=x.expedia,P.derbysoft=x.derbysoft,P.hotelbeds=x.hotelbeds,P.synxis=x.synxis,P.isRateSelectedMobile=!0,P.limitRoom=u.ratesLimit;var D,R=B(T.rate);try{for(R.s();!(D=R.n()).done;){var A=D.value;A.selectedRoomValue=0,A.roomsSelectection=Array.from({length:9},(function(e,t){return{value:t,selected:!0,title:t<=1?we.room:we.rooms,total:0}}))}}catch(e){R.e(e)}finally{R.f()}P.showMoreRate=!1,P.roomRateMobileSelected=T.rate[0]}else T={rate:[],disabled:!0},P.isRateSelectedMobile=!1,P.roomRateMobileSelected={};P.rate=T;var O,L=B(T.rate);try{for(L.s();!(O=L.n()).done;){var N=O.value;b.add(N.mealPlanCode)}}catch(e){L.e(e)}finally{L.f()}P.limitOriginal=P.rate.rate.length}}u.isMsiAvailable=!(t.isMsiAvailable&&t.isMsiAvailableMonths.length>0),u.msiMonthsAllow=t.isMsiAvailableMonths,u.isGoSection&&setTimeout((function(){u.goSection("recomendations",350)}),500);var M=function(e,t){var n,r,o=null===(n=e.rate)||void 0===n?void 0:n.lessRate,i=null===(r=t.rate)||void 0===r?void 0:r.lessRate,a=void 0!==o&&!e.rate.disabled,s=void 0!==i&&!t.rate.disabled;return a&&!s?-1:!a&&s?1:a&&s?o-i:0},F=function(e){var t,n;return null===(t=e.rate)||void 0===t||null===(n=t.rate)||void 0===n?void 0:n.some((function(e){return e.paxFam==be.paxesFormat[0]}))},$=K({},p),H=$.rooms.filter(F),V=$.rooms.filter((function(e){return!F(e)}));H.sort(M),V.sort(M),$.rooms=[].concat(U(H),U(V)),p.rooms=$.rooms,u.rooms=p.rooms,u.isBlockRAPD=t.isBlockRAPD,t.campaignToken&&t.campaignToken.length&&r.search("ctInternal",t.campaignToken),u.customLimit=v?2:u.rooms.length,j=t.campaignToken;var W=X.room_search||null;if(u.rooms.length>0&&W&&u.isTrivagoRate)if(u.appicableExperiment)setTimeout((function(){u.goSection("highligth_rooms",320)}),500);else{var q=W.split("|").length<2?W.split("%"):W.split("|"),z=u.rooms.findIndex((function(e){return e.roomId==q[0]}));if(-1==z)u.isTrivagoRate=!1;else{var G=-1!=z?u.rooms[z].rate.rate.findIndex((function(e){return e.rateId==q[1]})):null;if(-1==G||null==G)u.isTrivagoRate=!1;else{var Y=JSON.stringify(u.rooms);(Y=(Y=JSON.parse(Y))[z]).rate.rate=Y.rate.rate.filter((function(e){return e.rateId==q[1]})),Y.rate.rate.selectedRoomValue=1,u.featuredRoom=Y,setTimeout((function(){u.goSection("highligth_rooms",320)}),500)}}}(ne=new a(be.paxes,u.responseroomsAvailables,u.rooms)).initialLayers(u.ratesResponse),ne.unavailableHotel(re,be.paxesFormat),0==u.rooms.length&&(u.roomsAvailLoading=!0,ne.setHotelNotRooms()),u.roomsAvailables>0&&ne.viewItemListTB([p]),k&&ne.unavailableHotelImg(u.roomsAvailables,p.hotelId),E&&E.size>0&&ne.roomDuplicate(E,p.hotelId),et("hotel_price"),pe.length&&Ae();var J=new Map;u.rooms.forEach((function(e){var t,n=new Set;null===(t=e.rate)||void 0===t||t.rate.forEach((function(e){var t=e.mealPlanCode;if(!n.has(t))if(n.add(t),J.has(t))J.get(t).count+=1;else{var r=u.mealplans[t];J.set(t,{mealPlanCode:t,mealPlan:r,count:1,selected:!1})}}))})),u.mealplanCodesList=Array.from(J.values());var Q=u.mealplanCodesList.reduce((function(e,t){return e+t.count}),0);u.mealplanCodesList.unshift({mealPlanCode:"",mealPlan:I.all_options,count:Q,selected:!0}),u.validPaxCompleted()}function Be(e){var t={expedia:"",derbysoft:"",hotelbeds:"",synxis:""};return 4==e.provider?t.expedia=".":97==e.provider?t.derbysoft=".":100==e.provider?t.hotelbeds=".":130==e.provider&&(t.synxis="."),t}u.toltipSticky=!1,u.totalChildrens=0,u.validPax=!1,u.onlyAdults=_e,u.currentSlideIndex=1,u.currentSlideTitle="",u.getFavoriteHotelDetails=function(){return u.favoriteHotels.find((function(e){return e.hotelId===u.hotel.hotelId&&e.checkin===b.checkIn&&e.checkout===b.checkOut&&angular.equals(Ee(e.rooms),b.pax)}))},u.updateHotelsState=function(){var e=u.getFavoriteHotelDetails();e?(u.hotel.isFavorite=!0,u.hotel.favoriteDetails=e):(u.hotel.isFavorite=!1,u.hotel.favoriteDetails=null)},u.addFavorites=function(t){t.preventDefault(),t.stopPropagation();var n=function(e){for(var t=e.adults,n=e.children,r=e.rooms,o=Math.floor(t/r),i=t%r,a=Math.floor(n.length/r),s=n.length%r,c=[],l=0,u=0;u<r;u++){for(var d=o+(u<i?1:0),h=a+(u<s?1:0),p=[],f=0;f<h;f++)p.push({year:n[l].year}),l++;c.push({adults:d,children:p})}return c}(b.pax),r={hotelId:p.hotelId,userId:G,uri:k.uri,site:c.domain,channel:oe?c.chkSourceMobile:c.chkSourceDesktop,originalPrice:u.cheaperRoomRate.disabled?0:u.cheaperRoomRate.taxes.totalRoomRatePerNight,checkin:b.checkIn,checkout:b.checkOut,rooms:n.map((function(e){return{adults:e.adults,children:e.children.map((function(e){return e.year}))}})),campaignToken:j||"",placeId:_.id,placeUri:_.uri,placeType:_.type,placeName:_.displayText,isMobile:oe};if(u.hotel.isFavorite){var o=u.getFavoriteId(p.favoriteDetails.id,b.checkIn,b.checkOut);o&&fe.removeHotel({Id:o,UserId:G}).then((function(t){e.$applyAsync((function(){u.favoriteHotels=u.favoriteHotels.filter((function(e){return!(e.hotelId===p.hotelId&&e.checkin===b.checkIn&&e.checkout===b.checkOut&&angular.equals(Ee(e.rooms),b.pax))}));var e=K(K({},r),{},{id:o,name:p.name});ce.logDeleteFav(e,"details"),u.updateHotelsState(),u.showNotification("error",p.name,"delete")}))})).catch((function(t){e.$applyAsync((function(){u.showNotification("error",t)}))}))}else fe.addHotel(r).then((function(t){e.$applyAsync((function(){if(t.value){var e=K(K({},r),{},{id:t.value,name:p.name});u.favoriteHotels.push(e),ce.logAddFav(e,"details"),u.updateHotelsState(),u.showNotification("success",p.name,"save")}else u.showNotification("warning","","")}))})).catch((function(t){e.$applyAsync((function(){u.showNotification("error",t)}))}));V.vibrate()},u.showNotification=function(e,t,n){ye&&s.cancel(ye),u.showTimer=!1,s((function(){u.showTimer=!0})),u.alertsFavorites.notificationSuccess="success"===e,u.alertsFavorites.notificationError="error"===e,u.alertsFavorites.notificationWarning="warning"===e,u.alertsFavorites.message=t,u.alertsFavorites.actionType=n,ye=s((function(){u.alertsFavorites.notificationSuccess=!1,u.alertsFavorites.notificationError=!1,u.alertsFavorites.notificationWarning=!1,u.alertsFavorites.message="",u.alertsFavorites.actionType=""}),6e3)},u.getFavoriteId=function(e,t,n){var r=u.favoriteHotels.find((function(r){return r.id===e&&r.checkin===t&&r.checkout===n&&angular.equals(Ee(r.rooms),b.pax)}));return r?r.id:null},u.isFavoriteHotel=function(){return u.favoriteHotels.some((function(e){return e.hotelId===p.hotelId&&e.checkin===b.checkIn&&e.checkout===b.checkOut&&angular.equals(Ee(e.rooms),b.pax)}))},o.$on(f.bookerChangeEvent,(function(e,t){u.roomsAvailLoading=!1,u.validPax=!1;var n=d.clone(t);u.recomendationsList={loading:!0,rooms:[],checkoutHash:[]},u.recomendationsListCopy={rooms:[]},u.hasErrorHandle=!1,pe=[],u.isTrivagoRate=!1,b.pax=n.paxes,de.checkin=d.formatDate(t.checkIn,f.formatDate),de.checkout=d.formatDate(t.checkOut,f.formatDate),b.checkIn=de.checkin,b.checkOut=de.checkout,he.checkin=d.formatDate(t.checkIn,f.formatDate),he.checkout=d.formatDate(t.checkOut,f.formatDate),u.updateHotelsState(),be=w(b.pax,u.appicableExperiment),u.lengthPaxes=Se(b.pax),d.clone(b),u.paxFam=be,Ie(),u.stickyRates=[],u.isGoSection=!0,Pe(),u.notMessage||Ce(),"MX"==A.country&&Ne()})),u.setRecomedationLabel=function(){var e=1==u.recomendationsList.totalRooms?we.room:we.rooms,t=1==be.paxes.adults?we.adult:we.adults,n=1==be.paxes.children.length?we.child:we.children,r=be.paxes.children.length>0?", ".concat(be.paxes.children.length," ").concat(n):"";return"".concat(u.recomendationsList.totalRooms," ").concat(e," ").concat(we.for," ").concat(be.paxes.adults," ").concat(t).concat(r)},u.setRecomendationMetas=function(){var e=1==u.roomsTotal?we.room:we.rooms,t=1==be.paxes.adults?we.adult:we.adults,n=1==be.paxes.children.length?we.child:we.children,r=be.paxes.children.length>0?", ".concat(be.paxes.children.length," ").concat(n):"";return"".concat(u.roomsTotal," ").concat(e," ").concat(we.for," ").concat(be.paxes.adults," ").concat(t).concat(r)},u.getRecomendateDatePaxNight=function(e){var t=1==e?we.night:we.nights;return"".concat(e," ").concat(t)},u.getRecomendateDatePax=function(e){var t=1==be.paxes.adults?we.adult:we.adults,n=1==be.paxes.children.length?we.child:we.children,r=be.paxes.children.length>0?" ".concat(we.and," ").concat(be.paxes.children.length," ").concat(n,":"):":";return"".concat(we.for," ").concat(be.paxes.adults," ").concat(t).concat(r)},u.getIsPaxesDefined=function(){return 2==be.paxes.adults&&0==be.paxes.children.length},u.getRoom=function(e){return"".concat(1==e?we.room:we.rooms)},u.getTitleStickyDetail=function(e,t){if(ae){var n=e.split("|"),r=n[0]*t.selectedRoomValue==1?we.adult:we.adults;if(n[1]?n[1].split(",").length*t.selectedRoomValue:""){var o=n[1].split(",").length*t.selectedRoomValue==1?we.child:we.children;return"".concat(n[0]*t.selectedRoomValue," ").concat(r,", ").concat(n[1].split(",").length*t.selectedRoomValue," ").concat(o)}return"".concat(n[0]*t.selectedRoomValue," ").concat(r)}},u.getNumDistri=function(e,t){if(e){var n=e.split("|"),r=1==n[0]?we.adult:we.adults;if(n.length>1){var o=1==n[1].split(",").length?we.child:we.children;return t?"".concat(n[0]," ").concat(r):"".concat(n[1].split(",").length," ").concat(o)}return t?"".concat(n[0]," ").concat(r):0}},u.getTitleRecomendedPax=function(e){if(e){var t=e.split("|"),n=1==t[0]?we.adult:we.adults;if(t.length>1){var r=1==t[1].split(",").length?we.child:we.children;return"".concat(t[0]," ").concat(n,", ").concat(t[1].split(",").length," ").concat(r)}return"".concat(t[0]," ").concat(n)}},u.getNumDistriToltip=function(e){var t=e.split("|"),n=(1==t[0]?we.adult:we.adults,t[1]?t[1].split(",").join(", "):"");if(n){1==t[1].length?we.child:we.children;return"(".concat(n," años)")}},u.getNumDistriMovil=function(e,t){if(e){var n=e.split("|");return n.length>1?t?parseInt(n[0]):parseInt(n[1].split(",").length):t?parseInt(n[0]):0}},u.distriTablePax=function(e){if(e){var t=e.split("|"),n=1==t[0]?we.adult:we.adults,r=t[1]&&1==t[1].split(",").length?we.child:we.children,o=t[1]?t[1].split(",").join(", "):"";return o?"".concat(parseInt(t[0])," ").concat(n,", ").concat(t[1].split(",").length," ").concat(r," ").concat(we.the," ").concat(o," ").concat(1==t[1].split(",").length&&"1"==o?we.year:we.years):"".concat(parseInt(t[0])," ").concat(n)}},u.getNumDistriToltipMovil=function(e){var t=e.split("|"),n=1==t[0]?we.adult:we.adults,r=t[1]?t[1].split(",").join(", "):"";if(r){var o=1==t[1].split(",").length?we.child:we.children;return"".concat(t[0]," ").concat(n," y ").concat(t[1].split(",").length," ").concat(o," (de ").concat(r," ").concat(we.years,")")}return"".concat(t[0]," ").concat(n)},u.getRecomendationTitlePax=function(e){var t=e.split("|"),n=be.paxes.rooms>1?"".concat(we.fora," ").concat(we.room):"";if(t.length>1){var r=1==t[0]?we.adult:we.adults,o=1==t[1].split(",").length?we.child:we.children;return"".concat(we.for," ").concat(t[0]," ").concat(r,",  ").concat(t[1].split(",").length," ").concat(o," ").concat(n)}var i=1==t[0]?we.adult:we.adults;return"".concat(we.for," ").concat(t[0]," ").concat(i," ").concat(n)},u.titlePax=function(){var e=1==u.recomendationsList.totalRooms?we.room:we.rooms,t=d.getDate(de.checkin),n=d.getDate(de.checkout),r=d.diffBetweenDays(t,n),o=1==r?we.night:we.nights;return"".concat(u.recomendationsList.totalRooms," ").concat(e,", ").concat(r," ").concat(o," ")},u.titlePaxMeta=function(){var e=1==u.roomsTotal?we.room:we.rooms,t=d.getDate(de.checkin),n=d.getDate(de.checkout),r=d.diffBetweenDays(t,n),o=1==r?we.night:we.nights;return"".concat(u.roomsTotal," ").concat(e,", ").concat(r," ").concat(o," ")},u.getTitleSticky=function(){var e=1==u.getNights()?we.night:we.nights;return"".concat(u.totalRoomSticky," ").concat(u.totalRoomSticky>1?we.rooms:we.room,", ").concat(u.getNights()," ").concat(e)},u.getNights=function(){var e=d.getDate(de.checkin),t=d.getDate(de.checkout);return d.diffBetweenDays(e,t)},u.getTitleModalRAPD=function(e){if(e){var t=be.paxes.adults+be.children;return"".concat(we.total," ").concat(u.recomendationsList.totalRooms," ").concat(u.recomendationsList.totalRooms>1?we.rooms:we.room,", ").concat(t," ").concat(t>1?we.persons:we.person,":")}return"".concat(we.total," ").concat(u.totalRoomSticky," ").concat(u.totalRoomSticky>1?we.rooms:we.room,", ").concat(u.sumTotalSticky," ").concat(u.sumTotalSticky>1?we.persons:we.person,":")},u.getRecomendationTitleTotal=function(){var e=1==be.paxes.adults?we.adult:we.adults,t=be.children>0?", ".concat(be.children," ").concat(1==be.children?we.child:we.children):"",n=d.getDate(de.checkin),r=d.getDate(de.checkout),o=d.diffBetweenDays(n,r),i=1==o?we.night:we.nights;return"".concat(o," ").concat(i,", ").concat(be.paxes.adults," ").concat(e).concat(t)},u.asigRateModal=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u.assigRateSet=e,u.selectModalRoom=null!==(t=u.assigRateSet.selectedRoomValue)&&void 0!==t?t:0,u.assigRoomRateModal=n},u.showModal=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if($("#".concat(e)).modal("show"),"modal-payform"!=e&&"modal-contact"!=e||te.selectContent(n,r),"gallery-modal"===e){O={};var o={hotelId:u.hotel.hotelId,culture:E.internalCultureCode};t.get(c.endPoints.clasificationsUrl,{params:o,headers:(0,y.w)()}).then(je,(function(e){Ke(e)}))}},u.showModalReviews=function(e,t){var n,r,o,i,a,s,c=new Object;c.calf=null===(n=u.listReviews)||void 0===n||null===(r=n.ratings)||void 0===r||null===(o=r.guest)||void 0===o?void 0:o.overall,c.calfDesc=u.getOverallText(Math.round(null===(i=u.listReviews)||void 0===i||null===(a=i.ratings)||void 0===a||null===(s=a.guest)||void 0===s?void 0:s.overall)),c.content_type="link","galery"==t?c.elementText="reviews_header":(t="detail")&&(c.elementText="reviews_content"),ne.selectedReviews(c),u.getReviews(u.hotel.hotelId,!0),$("#".concat(e)).modal("show")},u.getHotelFeeDescription=function(){var e;return e=u.hotel.fees?u.hotel.fees.description+(u.hotel.fees.alternative||""):u.cheaperRoomRate.externalSalesAdvisory,!u.cheaperRoomRate.showAditional&&e.length>500?e.substring(0,500)+"...":e},u.eventSetReviews=function(){u.showDetailScoreReviews=!u.showDetailScoreReviews;var e=new Object;e.calf=u.listReviews.ratings.guest.overall,e.calfDesc=u.getOverallText(Math.round(u.listReviews.ratings.guest.overall)),e.elementText="reviews_scoredetail",e.content_type="button",ne.selectedReviews(e)},u.showModalRAPDOrigin=function(e,t,n){t&&(u.RateForRAPD=t,u.roomsForRAPD=n),$("#".concat(e)).modal("show")},u.showModalRAPD=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];t&&(u.rateModal=t,u.roomModal=n,u.roomModal.totalRooms=u.isRequote?ke.paxes.rooms:be.paxes.rooms,u.roomIndexModal=r,u.isTrivagoModal=o),$("#".concat(e)).modal("show")},u.showModalRAPDFam=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u.isTrivagoModal=!1,0!=u.stickyRates||t)if(u.hasErrorHandle=!1,u.modalRapdCurrentData=null,u.RAPDObject={totalSticky:0,totalHasTaxSticky:!1,totalImpSticky:0,totalTotalSticky:0},t){var n=0,r=0,o=Object.values(u.recomendationsList.rooms).every((function(e){var t=e.rate.rate,o=t.paxFam.split("|"),i=o[0]?parseInt(o[0]):0,a=o[1]?parseInt(o[1].split(",").length):0;return n+=i,r+=a,!(!(t&&t.bookNowPayLaterTimeLimit&&t.isBookNowPayLaterApplicable)||u.isBlockRAPD||2==t.collectType)&&(u.dateRAPDSticky=t.bookNowPayLaterTimeLimit,!0)}));if(o&&e){var i=d.getDate(de.checkin),a=d.getDate(de.checkout),s=d.diffBetweenDays(i,a),c=1==s?we.night:we.nights,l=1==n?we.adult:we.adults,h=r>0?", ".concat(r," ").concat(1==r?we.child:we.children):"";u.sumTotalSticky=n+r,u.getRecomedationLabelSticky="".concat(s," ").concat(c,", ").concat(n," ").concat(l).concat(h),u.isRecomendationCheckout=!0,u.applicableRAPDSticky=!0,u.RAPDObject.totalSticky=u.recomendationsList.totalRoomRatePerNight,u.RAPDObject.totalHasTaxSticky=u.recomendationsList.hasTaxes,u.RAPDObject.totalImpSticky=u.recomendationsList.totalTaxesPerRoomPerNight,u.RAPDObject.totalTotalSticky=u.recomendationsList.totalRoomRate;var p=be.paxes.adults+be.children;u.RAPDObject.TotalPersons=p,u.RAPDObject.TotalRooms=u.recomendationsList.totalRooms,u.TitleModalRAPD=u.getTitleModalRAPD(t),$("#".concat(e)).modal("show")}else u.applicableRAPDSticky=!1,u.onSubmit(null,null,null,!1,t)}else u.applicableRAPDSticky&&e?(u.isRecomendationCheckout=!1,u.RAPDObject.totalSticky=u.totalSticky,u.RAPDObject.totalHasTaxSticky=u.totalHasTaxSticky,u.RAPDObject.totalImpSticky=u.totalImpSticky,u.RAPDObject.TotalPersons=u.sumTotalSticky,u.RAPDObject.totalTotalSticky=u.totalTotalSticky,u.RAPDObject.TotalRooms=u.totalRoomSticky,u.TitleModalRAPD=u.getTitleModalRAPD(!1),$("#".concat(e)).modal("show")):u.onSubmit(null,null,null,!1,!1);else u.hasErrorHandle=!0},u.showModalShared=function(e){$("#".concat(e)).modal("show")},u.showAmenitiesModal=function(e,t){u.showModal(e),u.currentRoom=K({},t)},u.slideCarrousel=function(){var e=z(W().mark((function e(t,n,r){return W().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),n.galleryPosition+="right"==r?1:-1,s((function(){n.picture.cloudUri=n.pictures[Math.abs((n.galleryPosition-1)%n.pictures.length)].cloudUri}),0);case 3:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),u.showInclusiveModal=function(e){u.showModal(e)},u.onClosed=function(e){$("#".concat(e)).modal("hide")},u.lazyLoadImage=function(e,t){var n=e.isVisible,r=e.element,o=u.filteredImages.find((function(e){return e.uri===t}));n&&o&&!o.loaded&&(r.style.backgroundImage=n?"url(".concat(t,")"):r.style.backgroundImage,o.loaded=!0)},u.renderMap=function(){var e=u;new Promise((function(e,t){"undefined"!=typeof google&&google.maps||document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]')?e():d.getScript(c.endPoints.googleMapsApi,"",(function(){"undefined"!=typeof google&&google.maps?e():t(new Error("Failed to load Google Maps API"))}))})).then((function(){var t=document.getElementById("map");if(t&&e.hotel&&e.hotel.location&&void 0!==e.hotel.location.latitude&&void 0!==e.hotel.location.longitude){var n={lat:+e.hotel.location.latitude,lng:+e.hotel.location.longitude},r=new google.maps.Map(t,{center:n,zoom:13});r.setOptions({styles:Q});var o=new google.maps.Marker({position:n,map:r,title:e.hotel.name});d.mobileAndTabletCheck()&&function(e,t){var n=document.createElement("div");n.style.position="absolute",n.style.top="60px",n.style.width="40px",n.style.height="40px",n.style.backgroundColor="white",n.style.borderRadius="50%",n.style.display="flex",n.style.justifyContent="center",n.style.alignItems="center",n.style.left="88vw";var r=document.createElement("img");r.style.width="30px",r.style.height="30px",r.style.cursor="pointer",r.src="".concat(c.cloudCdn,"/assets/img/current_position.svg"),n.appendChild(r),t.controls[e].push(n),n.addEventListener("click",(function(){navigator.geolocation?navigator.geolocation.getCurrentPosition((function(e){var n={lat:e.coords.latitude,lng:e.coords.longitude};new google.maps.Marker({position:n,map:t,icon:{url:"".concat(c.cloudCdn,"/assets/img/point.png"),scaledSize:new google.maps.Size(25,25)}}),t.setCenter(n)}),(function(e){switch(e.code){case e.PERMISSION_DENIED:console.log("El usuario denegó la solicitud de geolocalización.");break;case e.POSITION_UNAVAILABLE:console.log("La información de ubicación no está disponible.");break;case e.TIMEOUT:console.log("Se ha agotado el tiempo de espera para obtener la ubicación del usuario.");break;case e.UNKNOWN_ERROR:console.log("Se produjo un error desconocido al obtener la ubicación del usuario.")}})):console.log("El navegador no soporta la geolocalización.")}))}(google.maps.ControlPosition.RIGHT_TOP,r);var i=new google.maps.InfoWindow,a=function(e){var t,n,r=null===(t=$(J).get(0))||void 0===t?void 0:t.outerHTML,o=null===(n=$(".stars-div").get(0))||void 0===n?void 0:n.outerHTML;if(r&&o)return r=r.replace("h6","font-weight-bold").replace("h3","h5"),'<p class="h5 mt-4"> '.concat(e.getTitle(),' </p> \n            <div class="" style="gap: 20px;">\n                ').concat(o,"\n                ").concat(r,"\n            </div>");return'<p class="h5 mt-4"> '.concat(p.name,' </p> \n\n        <div class="" style="gap: 20px;"> \n\n              ').concat(o,' \n\n        </div> \n\n        <p class="hotel-heading-price-current skeleton-secondary h6 text-right text-pink  mt-2"> \n\n            ').concat(u.rooms[0].unavailableStatus.messages.title1,"\n        </p>")}(o);o.addListener("click",(function(){i.close(),i.setContent(a),i.open(o.getMap(),o)})),r.addListener("tilesloaded",(function(){tt(r,18,r.getZoom()),google.maps.event.clearListeners(r,"tilesloaded"),setTimeout((function(){i.close(),i.setContent(a),i.open(o.getMap(),o)}),1e3)}))}})).catch((function(){}))},u.sendContentFooter=function(e){te.clickLink("footer :: ".concat(e))},u.showMoreRooms=function(){(L=!L)?(ne.selectedFilter("Ver todas las habitaciones"),u.limitRoomsFilter=u.roomsLimit):u.limitRoomsFilter=u.roomsAvailables},u.sharedBy=function(e){var n={Key:""};n.Url=window.location.pathname+window.location.search+"&utm_source="+(e||"copy_link")+"&utm_medium=social&utm_campaign=share_hotel",t.get(c.uriShared,{params:n}).then((function(t){$e(t,e)}),Ve)},u.onSelectDate=function(e){var t=e.checkin,n=e.checkout;u.defaultHotel.checkIn=new Date("".concat(t,"T00:00:00")),u.defaultHotel.checkOut=new Date("".concat(n,"T00:00:00")),de.CampaignToken=j,de.userKey=q,de.mobile=oe,de.login=Y,de.responseTimeout=2e4,de.source=b.source?b.source:"SPA-Hotel-List",de.channelId=oe?c.chkSourceMobile:c.chkSourceDesktop,de.checkin=t,de.checkout=n,b.checkIn=t,b.checkOut=n,u.datesRecommended=[];var r=K({paxes:be.paxes,checkIn:new Date("".concat(t,"T00:00:00")),checkOut:new Date("".concat(n,"T00:00:00"))},de);o.$broadcast(f.bookerSearchEvent,r),(0,C.bs)(u.defaultHotel.checkIn,u.defaultHotel.checkOut)},u.handleClick=function(){var e=K(K(K({},b),p),ee);void 0!==se&&"function"==typeof se.metricDatesRecommended&&se.metricDatesRecommended("click_suggested_dates",{data:e});var t=document.getElementById("rooms").getBoundingClientRect().top+window.pageYOffset;window.scrollTo({top:t-250,behavior:"smooth"})},u.isSubmitOrRAPD=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.bookNowPayLaterTimeLimit&&t.isBookNowPayLaterApplicable&&!u.isBlockRAPD&&2!=t.collectType?u.showModalRAPD("modal-rapd-mini",t,e,n,r):u.onSubmit(e,t,n,!1,!1,!0)},u.onSubmit=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=[];i?a=be.paxesFormat:o||u.isRecomendationCheckout?(u.onSubmitLoadingRecomendation=!0,u.recomendationsList.checkoutHash.forEach((function(e){a.push(e.paxFam)}))):(u.onSubmitLoading=!0,u.stickyRates.forEach((function(e){var t=e.paxFam.split("|"),n=e.selectedRoomValue,r=parseInt(t)*n,o="";t[1]&&t[1].length>0&&(o=Array.from({length:n},(function(){return t[1]})).flat().join(","));var i=o&&""!=o?r.toString()+"|"+o:r.toString();a.push(i)})));var s=d.mapPaxToUrlNew(a,!0,!0),l=Ze(),h=[];i?h.push({idRate:t.rateId,idRoom:e.roomId,promotionValue:t.promotionValue,totalRoomRatePerNight:t.taxes.totalRoomRatePerNight,name:e.name,mealPlanCode:t.mealPlanCode,totalAmount:t.totalAmount,checkoutHash:t.checkoutHash,isBookNowPayLater:r,rooms:u.isRequote?ke.paxes.rooms:be.paxes.rooms,pax:t.paxFam,index:n,provider:t.provider}):o||u.isRecomendationCheckout?u.recomendationsList.checkoutHash.forEach((function(e,t){h.push({idRate:e.rateId,idRoom:e.roomId,promotionValue:e.promotionValue,totalRoomRatePerNight:e.taxes.totalRoomRatePerNight,name:e.name,mealPlanCode:e.mealPlanCode,totalAmount:e.totalAmount,checkoutHash:e.checkoutHash,isBookNowPayLater:r,rooms:1,pax:e.paxFam,index:t+1,provider:e.provider})})):u.stickyRates.forEach((function(e,t){h.push({idRate:e.rateId,idRoom:e.roomId,promotionValue:e.promotionValue,totalRoomRatePerNight:e.taxes.totalRoomRatePerNight,name:e.name,mealPlanCode:e.mealPlanCode,totalAmount:e.totalAmount,checkoutHash:e.checkoutHash,isBookNowPayLater:r,rooms:e.selectedRoomValue,pax:e.paxFam,index:t+1,provider:e.provider})}));var m={idHotel:p.hotelId,hotelCheckIn:b.checkIn,CheckIn:b.checkIn,CheckOut:b.checkOut,Source:c.source,ChkSource:oe?c.chkSourceMobile:c.chkSourceDesktop,ChkSourceGroup:oe?c.chkSourceGroupMobile:c.chkSourceGroupDesktop,isBookNowPayLater:r,index:1,pageUrl:window.location.pathname+window.location.search,isMetaSearchEngine:""!==u.source_origin,Amount:i?t.totalAmount:o||u.isRecomendationCheckout?u.recomendationsList.totalRoomRatePerNight:u.totalSticky,useNewConfig:!0,applicable:i,promotions:de.promotions};m=K(K(K(K({},m),s),l),{},{site:f.site.siteName});var v=document.createElement("form");for(var g in v.setAttribute("method","POST"),v.setAttribute("action","/".concat(E.cultureCode).concat(c.checkoutUrl)),M.V.setSession(m),m)if(null!=m[g]){var y=document.createElement("input");y.setAttribute("type","hidden"),y.setAttribute("name",g),y.setAttribute("value",m[g]),v.appendChild(y)}h.map((function(e,t){for(var n in e){var r=document.createElement("input");r.setAttribute("type","hidden"),r.setAttribute("name","roomList[".concat(t,"][").concat(n,"]")),r.setAttribute("value",e[n]),v.appendChild(r)}}));var w=K({},m);ne.setUserInteraction(r),ne.setAddToCart(w,h),ne.beginCheckOutTB(w,h),$("#loader-page").removeClass("d-none"),document.body.appendChild(v),v.submit()},u.getReviews=function(e,n){u.reviewsLoadingModal=!0;var r={};r.PropertyId=e,r.Language=c.cultureReviews,r.IsReviews=n,t.get(c.expediaReviewsURL,{params:r}).then((function(e){!function(e){var t=e.data;if(null!=t.verified){var n=e.data.verified.recent.sort((function(e,t){return new Date(t.date_submitted).getTime()-new Date(e.date_submitted).getTime()})),r=n.filter((function(e){return""==e.text&&""==e.title}));n=(n=n.filter((function(e){return""!=e.text||""!=e.title}))).concat(r),t.verified.recent=n}null!=t.ratings&&setTimeout((function(){!function(e){var t,n,r,o,i,a,s,c,l,u,d,h;$(".condition").css({width:10*(null===(t=e.ratings)||void 0===t||null===(n=t.guest)||void 0===n?void 0:n.condition)+"%"}),$(".cleanliness").css({width:10*(null===(r=e.ratings)||void 0===r||null===(o=r.guest)||void 0===o?void 0:o.cleanliness)+"%"}),$(".service").css({width:10*(null===(i=e.ratings)||void 0===i||null===(a=i.guest)||void 0===a?void 0:a.service)+"%"}),$(".comfort").css({width:10*(null===(s=e.ratings)||void 0===s||null===(c=s.guest)||void 0===c?void 0:c.comfort)+"%"}),$(".amenities").css({width:10*(null===(l=e.ratings)||void 0===l||null===(u=l.guest)||void 0===u?void 0:u.amenities)+"%"}),$(".neighborhood").css({width:10*(null===(d=e.ratings)||void 0===d||null===(h=d.guest)||void 0===h?void 0:h.neighborhood)+"%"})}(t)}),300);u.reviewsLoadingModal=!1,u.listReviews=t}(e)}),Ve)},u.getOverallText=function(e){return I.rating_reviews[e]},u.getStart=function(e){for(var t="",n=0;n<5;n++)t+=e>n?e-n==.5?"<i class='bi bi-star-half'></i>":"<i class='bi bi-star-fill'></i>":"";return t},u.goSection=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:45,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=document.getElementById("".concat(e));r&&r.scrollIntoView?setTimeout((function(){r.scrollIntoView({behavior:"smooth"})}),n):$("html, body").scrollTop($("#".concat(e)).offset().top-t)},u.goSectCloseModal=function(e,t){$("#".concat(e)).modal("hide"),u.goSection(t)},u.showSpecialPrice=function(e){return!(!e||0===Object.keys(e).length)&&(e.promotionValue&&Z.includes(e.promotionValue)||Z.includes(e.promotion)&&!e.bookingDates&&!e.travelDates)},u.setLimitRoom=function(){if(u.ratesResponse&&u.ratesResponse.rooms&&u.ratesResponse.rooms.length>0){var e=u.ratesResponse.rooms.length;if(u.roomsAvailables=e,e<5)return u.showMoreRoomsButton=!1,e;if(e>=5)return u.showMoreRoomsButton=e>u.limitRoomsFilter,Math.min(e,u.limitRoomsFilter)}return u.showMoreRoomsButton=!1,1},u.getShowPromotion=function(e){var t=c.promotionKeyShow;if(t){var n=e?t.find((function(t){return t.key==e.promotionType})):"";if(n)return n.blackFAndHotS}return!1},u.onSelectRecommenderDate=function(e,t){e.preventDefault(),e.stopPropagation(),ne.selectDateSuggested(t);var n=window.location.href.split("?"),r=d.searchUri(n[1]);r.checkin=t.CheckIn,r.checkout=t.CheckOut;var o=d.objectToQueryParams(r);window.location.href=n[0]+"?"+o},u.selectRateMobile=function(e,t,n){u.rooms[t].rate.rate.forEach((function(e){e.selected=!1})),u.rooms[t].rate.rate[n].selected=!!u.rooms[t].rate.rate[n].selected||!u.rooms[t].rate.rate[n].selected,u.rooms[t].roomRateMobileSelected=e},u.toggleDropdown=function(e,n){e.showDron=!e.showDron,e.showDron&&(e.loadingAvailibles=!0,function(e,n,r){he.rooms=n,he.mobile=oe,he.responseTimeout=2e4,he.channelId=oe?c.chkSourceMobile:c.chkSourceDesktop,he.roomId=r,he.CampaignToken=j,t.get(c.endPoints.revalidateUrl,{params:he,headers:(0,y.w)()}).then((function(t){e.loadingAvailibles=!1,t.data.roomsAvailibles>0?e.limitAvailibles=t.data.roomsAvailibles:e.limitAvailibles=1}),(function(t){e.loadingAvailibles=!1,e.limitAvailibles=1}))}(e,e.paxFam,n.roomId))},u.selectedRateRoom=function(e,t,n){if(u.hasErrorHandle=!1,!(t.value>1&&e.loadingAvailibles))if(e.showDron=!e.showDron,e.selectedRoomValue=t.value,0!==t.value){var r=u.stickyRates.findIndex((function(t){return t.rateId===e.rateId&&t.paxFam===e.paxFam}));-1!==r?u.stickyRates[r].selectedRoomValue=t.value:(e.name=n.name,e.roomId=n.roomId,e.img=n.picture.cloudUri,u.stickyRates.push(e))}else{var o=u.stickyRates.findIndex((function(t){return t.rateId===e.rateId&&t.paxFam===e.paxFam}));-1!==o&&u.stickyRates.splice(o,1)}},u.incrementQuantity=function(e){if(e.selectedRoomValue+1<e.roomsSelectection){var t=u.stickyRates.findIndex((function(t){return t.rateId===e.rateId&&t.paxFam===e.paxFam}));return-1!==t&&(u.stickyRates[t].selectedRoomValue+=1),e.selectedRoomValue+=1}},u.decrementQuantity=function(e,t){var n=u.stickyRates.findIndex((function(t){return t.rateId===e.rateId&&t.paxFam===e.paxFam}));return e.selectedRoomValue-1==0?(-1!==n&&u.stickyRates.splice(n,1),e.selectedRoomValue=0):(-1!==n&&(u.stickyRates[n].selectedRoomValue-=1),e.selectedRoomValue-=1)},u.setValueModalRoom=function(e){u.selectModalRoom=e,u.assigRateSet.roomsSelectection.forEach((function(e){e.active=!1,e.value==u.selectModalRoom&&(e.active=!0)}))},u.deleteStickyDetail=function(e){var t=u.stickyRates.findIndex((function(t){return t.rateId===e.rateId&&t.paxFam===e.paxFam}));if(-1!==t){u.stickyRates.splice(t,1);var n=u.rooms.find((function(t){return t.roomId===e.roomId}));if(n&&n.rate){var r=n.rate.rate.findIndex((function(t){return t.rateId===e.rateId&&t.paxFam===e.paxFam}));-1!==r&&(n.rate.rate[r].selectedRoomValue=0)}}},u.selectedRateRoomModal=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((t=0===Object.keys(n).length?u.rooms.find((function(t){return t.roomId===e.roomId})):n)&&t.rate){var r=t.rate.rate.findIndex((function(t){return t.rateId===e.rateId&&t.paxFam===e.paxFam}));if(-1!==r){var o=u.selectModalRoom,i=u.stickyRates.findIndex((function(t){return t.rateId===e.rateId&&t.paxFam===e.paxFam}));if(t.rate.rate[r].selectedRoomValue=o,-1!==i){if(u.stickyRates[i].selectedRoomValue=o,0===u.selectModalRoom){var a=u.stickyRates.indexOf(t.rate.rate[r]);-1!==a&&u.stickyRates.splice(a,1)}}else if(0!==o){t.rate.rate[r].name=n.name,t.rate.rate[r].roomId=n.roomId;var s=angular.copy(t.rate.rate[r]);u.stickyRates.push(s)}}}},e.$watch("vm.stickyRates",(function(e,t){angular.equals(e,t)||Te(e)}),!0),e.$watch("vm.stickyRates",(function(e,t){angular.equals(e,t)||Te(e)}),!0),u.cloneRate=function(e){return angular.copy(e)},u.onBlur=function(e){s((function(){e.showDron=!1}))},u.openSlider=function(t,n,r){u.showModal(t),u.currentSlideIndex=n+1;var o="".concat(".slider-gallery-view","_").concat(r);O[o]||($(o).slick({lazyLoad:"progressive",slickSetOption:!0,initialSlide:n,arrows:!0,autoplay:!1,responsive:[{breakpoint:768,settings:{arrows:!1}}]}),O[o]=$(o)),O[o].slick("slickGoTo",n),u.currentSlideTitle="",$(o).on("afterChange",(function(t,n,r){var i=n.$slides.get(r).querySelector("figure.slider-gallery-item"),a=$(o).find(".btnIcon--left");0===r?a.addClass("hidden-c"):a.removeClass("hidden-c");var s="";i&&(s=i.getAttribute("data-titles")),e.$applyAsync((function(){u.currentSlideIndex=r+1,u.currentSlideTitle=s}))}))},u.selectClasification=function(e){u.selectedClasificationName=e,u.isFilterMenuOpen=!1;var t=u.clasifications.findIndex((function(t){return t.name===e})),n=u.clasifications.find((function(t){return t.name===e}));-1!==t&&(u.clasificationIndex=t),u.selectedClasification(n,t)},u.getDisplayClasificationName=function(){return"all"===u.selectedClasificationName?u.allImagesText:u.selectedClasificationName},u.selectedClasification=function(e,t){u.clasifications=u.clasifications.map((function(t){return K(K({},t),{},{isSelected:t.name===e.name,loaded:!1})}));var n=u.clasifications.find((function(t){return t.name==e.name}));u.filteredImages=g(n.images),u.clasificationIndex=t,u.selectedClasificationName=n.name},u.getClasificationByName=function(e){return u.clasifications.find((function(t){return t.name===e}))},u.toggleFilterMenu=function(){u.isFilterMenuOpen=!u.isFilterMenuOpen},u.validPaxCompleted=function(){u.validPax=u.rooms.some((function(e){var t,n,r;return!(!e||null!==(t=e.rate)&&void 0!==t&&t.disabled)&&(null===(n=e.rate)||void 0===n||null===(r=n.rate)||void 0===r?void 0:r.every((function(e){var t=F(e.paxFam.split("|"),2),n=t[0],r=t[1];return!(n==be.adults&&(r?r.split(",").length:0)==be.children)})))}))};var $e=function(){var e=z(W().mark((function e(t,n){var r,o;return W().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ie=t.data.key,t.data.url,"facebook"!==n){e.next=6;break}window.open(c.uriFacebook+c.siteUrl+"/r?data="+ie),e.next=21;break;case 6:if("whatsapp"!==n){e.next=10;break}window.open(c.uriwhatsapp+c.siteUrl+"/r?data="+ie),e.next=21;break;case 10:return r=document.querySelector("body"),o=document.createElement("textarea"),r.appendChild(o),o.value=c.siteUrl+"/r?data="+ie,o.select(),document.execCommand("copy"),r.removeChild(o),$(".copied-link").show("fast"),e.next=20,d.sleep(1500);case 20:$(".copied-link").hide("fast");case 21:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();function He(e){var t=e.data||[];u.monthInterestData=t.monthInterestFree;var n=(t.monthInterestFree?t.monthInterestFree.options:[]).reduce((function(e,t){var n=Math.max.apply(Math,U(t.paymentPlans));return e[n]||(e[n]=[]),e[n].push(t),e}),{}),r=Object.entries(n).sort((function(e,t){var n=F(e,1)[0],r=F(t,1)[0];return Number(r)-Number(n)})),o={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:""};u.responsePayment=o}function Ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;u.pageError.has=!0,u.pageError.type=t,u.loading=!1,u.reviewsLoadingModal=!1}function We(e){var t=e.data;"200 - OK"==t.message&&(R=t.result,u.phoneBase=R.did,$(".header-phonebase").attr("href","tel:".concat(u.phoneBase)),$(".skillbase_p").text(n("tel")(u.phoneBase)))}function qe(e){for(var n=e.data,r=n&&n.length?n:[],o=0;o<u.rooms.length;o++){var i=u.rooms[o],a=d.findObject(r,"roomId",i.roomId);u.rooms[o].unavailableStatus=Xe(a)}r.length&&(re=r[0].availabilityStatus),u.responseroomsAvailables=n,!u.isRequote&&u.ratesResponse.rooms&&!u.ratesResponse.rooms.length&&c.recommenderDatesActive&&function(e){var n={roomID:u.rooms[0].roomId,availabilityStatus:"None",availabilityValue:"",explanation:"No known problems"},r={checkIn:b.checkIn,checkOut:b.checkOut,availabilityReasons:e.length?e:[n],idHotel:p.hotelId,channelId:c.channelFac,token:de.CampaignToken?de.CampaignToken:"",adults:ee.adults,kids:ee.children,providerId:1,placeIdDestination:k.placeId,kidsAge:nt()};t.post(c.endPoints.recommenderDatesUrl,r).then(ze,re)}(r)}function ze(e){e.data&&"OK"===e.data.status&&(p.checkIn=b.checkIn,p.checkOut=b.checkOut,u.recommendedDates=e.data.message)}function Ge(){var e=X.campaignTokenApi||X.CampaignTokenApi||X.campaigntokenapi||null;j=X.CampaignToken||X.campaignToken||e,H=X.CampaignId||X.campaignid||null,D&&D.firebaseId&&(j=c.campaignTokenUser)}function Ke(e){u.filteredImages=g(u.gallery),le.sendEventTracker("Hotel Sin Categorias en Galeria","fotos: 0 | Error API")}function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;u.pageError.has=!0,u.pageError.type=t,u.recomendationsList={loading:!0,rooms:[]},u.recomendationsListCopy={rooms:[]},u.recomendationsList.loading=!1,u.loading=!1,u.cheaperRoomRate.loading=!1,u.rooms=u.rooms.map((function(e){return e.rate={disabled:!0},e})),et("hotel_price")}function Je(e){console.log(e)}function Qe(e){for(var t=e.rate.length,n=0;n<t;n++){var r=e.rate[n];r.paymentNow=!1,u.hasCancellationFree||(u.hasCancellationFree=!r.isNonRefundable),!u.hasPayLater&&r.isBookNowPayLaterApplicable&&(u.hasPayLater=r.isBookNowPayLaterApplicable)}}function Ze(){return{CampaignToken:j,CampaignId:H}}function Xe(e){var t=I.availabilityMessages;try{if(!e)return{explanation:"",availabilityValue:"",availabilityStatus:"None",messages:t.none};var n=e.availabilityStatus.toLocaleLowerCase();if("roomcapacity"==n&&b&&b.pax){var r=JSON.parse(e.availabilityValue);n=b.pax.some((function(e){return e.adults+e.children.length>r.Max}))?"peoplemax":b.pax.some((function(e){return e.adults>r.A}))?"adultsmax":b.pax.some((function(e){return e.children.length>r.K}))?r.K<1?"kidszero":"kidsmax":"peoplemax"}var o=K(K({},e),{},{messages:t["".concat(n)]});return"none"!=n&&(o.messages.title2=o.messages.title2.replace("{{days}}",+e.availabilityValue||t.defaults[n])),o}catch(e){return{explanation:"",availabilityValue:"",availabilityStatus:"None",messages:t.none}}}function et(e){var t=$(".".concat(e));t.length&&t.remove()}function tt(e,t,n){if(!(n>=t)){var r=google.maps.event.addListener(e,"zoom_changed",(function(o){google.maps.event.removeListener(r),tt(e,t,n+1)}));setTimeout((function(){e.setZoom(n)}),80)}}function nt(){return b.pax[0].children.map((function(e){return e.year})).join(",")}u.getPathToList=function(){var e="",t=K({},r.search());if(t.checkout||(t.checkout=b.checkOut),t.checkin||(t.checkin=b.checkIn),p.hotelId&&(t.profileId=p.hotelId.toString()),_&&_.uri)e="".concat(c.siteUrl).concat(c.pathHoteles).concat(_.uri,"_d").concat(_.id,"?").concat($.param(t));else{var n,o=null===(n=p.location.state)||void 0===n?void 0:n.normalize("NFD").replace(/[^a-zA-Z0-9 ]/g,"").replace(/\s+/g,"-").toLowerCase();e="".concat(c.siteUrl).concat(c.pathHoteles).concat(o,"_d0?").concat($.param(t))}return e},function(){u.roomsAvailLoading=!1,u.recomendationsList={loading:!0,rooms:[]},u.recomendationsListCopy={rooms:[]},function(e,t){if(0!=$(t).length){var n=$(t).offset().top-$(window).outerHeight();if(n<$(window).scrollTop())return $(t).slick(e),void $(t).removeClass("visibility-none");$(window).scroll((function(r){n>$(window).scrollTop()||($(t).slick(e),$(t).removeClass("visibility-none"),$(this).off(r))}))}}({dots:!1,infinite:!1,speed:300,initialSlide:0,centerMode:!1,variableWidth:!1,lazyLoad:"ondemand",slidesToShow:3,slidesToScroll:3,responsive:[{breakpoint:1023,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:700,settings:{slidesToShow:1,slidesToScroll:1,centerMode:!0,variableWidth:!0}},{breakpoint:432,settings:{slidesToShow:1,slidesToScroll:1,variableWidth:!0}},{breakpoint:375,settings:{slidesToShow:1,slidesToScroll:1,variableWidth:!0}}]},"#carousel-restaurants"),u.validPax=!1,u.notAmount=!!c.hotelsTagLogin&&c.hotelsTagLogin.listA.includes(p.hotelId),u.notMessage=!!c.hotelsTagLogin&&c.hotelsTagLogin.listB.includes(p.hotelId);var n=X.source||null;d.setCookie("source_origin",n,"1"),u.source_origin=d.getCookie("source_origin");var r,o=X.coupon,i=d.getCookie("codept"),a=o||i;d.setCookie("codept",a,"1"),(c.hotelsIdsPR?c.hotelsIdsPR.find((function(e){return e==p.hotelId})):-1)>-1&&(u.sourceTriGooHotelsIds=!0),d.clone(b),Ie(),be=w(b.pax,u.appicableExperiment),u.paxFam=be,u.isGoSection=!1,u.source_origin&&function(){D&&D.firebaseId?j=c.campaignTokenUser:Ge();u.loading=!0,u.recomendationsList.loading=!0,u.hasCancellationFree=!1,u.hasPayLater=!1,u.roomsAvailables=0,u.recommendedDates=null,u.checkIn=de.checkin,u.checkOut=de.checkout;var e=K({},de);e.rooms=function(){for(var e=d.search(),t=+e.rooms,n=[],r=0;r<t;r++){var o=r+1,i={adults:+(e["room".concat(o,".adults")]||2),children:[]},a=e["room".concat(o,".agekids")];if(a)for(var s=a.split(","),c=0;c<s.length;c++)i.children.push({year:+s[c]||0});n.push(i)}return function(e){for(var t=e&&e.length,n={adults:0,children:0,paxesFormat:[]},r=0;e&&r<t;r++){var o=e[r],i="";n.adults+=o.adults,i+="".concat(o.adults),o.children&&o.children.length&&(n.children+=o.children.length,i+="|".concat(o.children.map((function(e){return e.year})).join(","))),n.paxesFormat.push(i)}return n}(n)}().paxesFormat,e.CampaignToken=j,e.userKey=q,e.culture=E.internalCultureCode,e.mobile=oe,e.login=Y,e.responseTimeout=2e4,e.source=b.source?b.source:"SPA-Hotel-List",e.channelId=oe?c.chkSourceMobile:c.chkSourceDesktop,t.get(c.endPoints.detailQuoteUrl,{params:e,headers:(0,y.w)()}).then(Ue,(function(e){Ye(e)}))}(),Pe(),r={UserId:G,country:c.country.toUpperCase()},fe.getHotelsByUser(r).then((function(t){e.$applyAsync((function(){u.favoriteHotels=t.value,u.updateHotelsState()}))})).catch((function(e){console.error("Error fetching hotels by user:",e)})),u.notMessage||Ce(),f.rb||("MX"==A.country&&Ne(),function(){if(u.responsePayment.fixedPayments.length||u.responsePayment.monthInterestFree.length)return;var e={channel:c.channel,language:E.internalCultureCode,currency:E.currency};t.get(c.endPoints.paymentMethodUrl,{params:e}).then(He)}(),$(window).scroll((function(){var e=$(window).scrollTop(),t=$("#container-detail").offset();t&&(t.top<e?$("#searchbox").addClass("sticky"):$("#searchbox").removeClass("sticky"))})),function(){if(u.hotel.description){if(u.hotel.description.length<=u.sizeDescriptionString)return void(u.hotel.shortDescription=u.hotel.description);u.hotel.description=u.hotel.description?u.hotel.description.split("\n").map((function(e){return"\r"==e?"<p></p>":e})).join(""):u.hotel.description,u.hotel.shortDescription=u.hotel.description.substring(0,u.sizeDescriptionString)+" ..."}}(),$(window).on("scroll",(function(){d.isInViewport(u.headTabs.amenities)?u.headTabs.current=u.headTabs.amenities:d.isInViewport(u.headTabs.rooms,295)?u.headTabs.current=u.headTabs.rooms:d.isInViewport(u.headTabs.map)?u.headTabs.current=u.headTabs.map:u.headTabs.current="",e.$apply()})),u.grid=g(u.gallery),function(e){var t=M.V.get(f.recentDestinations)||[],n=t.findIndex((function(e){return e.place.id==k.id}));if(n>-1){var r=t[n];r.box=b,r.campaignTokenApi=j,t.splice(n,1),t.unshift(r)}else t.unshift({box:b,place:k,IdG:e.hotelId,campaignTokenApi:j,title:I.hotel_lang,icon:c.cloudCdn+"/assets/img/Hotel_icon.svg",origin:"H",image:e.gallery&&e.gallery.length>0?e.gallery[0].cloudUri:e.gallery[0]||""});t.length>f.limitDestinations&&(t=t.slice(0,f.limitDestinations));M.V.set(f.recentDestinations,t)}(p))}(),u.toggleServicesSection=function(e){u.openServicesSections[e]=!u.openServicesSections[e]},u.isServicesSectionOpen=function(e){return!u.openServicesSections[e]},u.selectNearbyPlacesCategory=function(e){u.nearbyPlacesCategory=e}}window.app.controller("DetailController",J),J.$inject=["$scope","$http","$filter","$location","$rootScope","localStorageService","$timeout"];var Q=[{featureType:"poi.business",stylers:[{visibility:"off"}]}]})(),(()=>{"use strict";var e=n(291),t=n(4943),r=n(694),o=n(9586);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 a(){a=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:{},s=o.iterator||"@@iterator",c=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 d(e,t,n,o){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),s=new C(o||[]);return r(a,"_invoke",{value:E(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function m(){}function v(){}var g={};u(g,s,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(T([])));w&&w!==t&&n.call(w,s)&&(g=w);var b=v.prototype=f.prototype=Object.create(g);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function o(r,a,s,c){var l=h(e[r],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==i(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,c)}),(function(e){o("throw",e,s,c)})):t.resolve(d).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 E(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=I(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=h(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 I(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,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=h(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(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 T(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,o=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 o.next=o}}return{next:x}}function x(){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(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new _(d(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(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=T,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 o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.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 o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function c(n,i,c,l,u,d,h){var p=this,f=window.__pt.settings.site,m=window.__pt.settings,v=window.__pt.ln,g=window.__pt.fn,y=g.getDate(),w=window.__pt.place||{},b={},k=null,_=window.__pt.box||null,E=new r.Z,I={formatMobile:m.formatBoxDateMobile,firstDay:0,applyLabel:v.ok,cancelLabel:v.cancel},S={},P={};p.submit=!1,p.years=[],p.suggestion={paxes:!1},p.dataCopyCancel=m.defaultHotel,p.validation={paxes:!0,checkIn:!0,checkOut:!0,dates:!0},p.settingPaxes={minAdults:1,maxAdults:8,minChildren:0,maxChildren:6,minAge:0,maxAge:17,rooms:8};var C={weeksPrequote:0,daysPrequote:0,startDate:0};function T(){g.mobileAndTabletCheck()?(C.weeksPrequote=f.configDaysPrequoteMobile.weeksPrequote,C.daysPrequote=f.configDaysPrequoteMobile.daysPrequote,C.startDate=f.configDaysPrequoteMobile.startDate):(C.weeksPrequote=f.configDaysPrequoteDesktop.weeksPrequote,C.daysPrequote=f.configDaysPrequoteDesktop.daysPrequote,C.startDate=f.configDaysPrequoteDesktop.startDate);var e=new Date(y);e.setDate(e.getDate()+7*C.weeksPrequote),e.setDate(e.getDate()-e.getDay()+C.startDate),p.data.checkIn=x(e),p.data.checkOut=x(e,C.daysPrequote)}function x(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.getDate(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=g.getDate(g.formatDate(e,m.formatDate));return n.setDate(n.getDate()+t),n}function D(){var e,t,n=p.data.paxes.rooms;e=p.data.paxes.adults,t=p.data.paxes.children.length;var r=1==n?v.room:v.rooms,o=1==e?v.adult:v.adults,i=1==t?v.child:v.children,a="";t>0&&(a=" ".concat(t," ").concat(i,", ")),p.data.paxes_name="".concat(e," ").concat(o,",").concat(a," ").concat(n," ").concat(r),p.data.paxes_people="".concat(e+t," ").concat(v.new_pers," ").concat(n," ").concat(v.new_room),p.data.capacityTotal=e+t}function R(e,t){for(var n=!0,r=(e.rooms,e.children.length),o=0;o<r;o++){if(t["children_".concat(o)].$invalid){n=!1;break}}return n}function R(e,t){for(var n=!0,r=e.length,o=0;o<r;o++){for(var i=e[o].children.length,a=0;a<i;a++){var s=t["children_".concat(o,"_").concat(a)];if(s&&s.$invalid){n=!1;break}}if(!n)break}return n}function A(e){"paxes"==e&&(p.validation.paxes=R(p.data.paxes,p.form2))}function O(){if(p.data&&p.data.paxes){var e=p.data.paxes.children;if(e&&e.length>0&&e.some((function(e){return null===e.year||void 0===e.year})))return!0}return!1}function L(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")}p.data=m.defaultHotel,p.display=!0,p.onSubmit=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(0,t.Uo)(),o=r.checkin,i=r.checkout;o&&i&&!n&&(p.data.checkIn=o,p.data.checkOut=i),(0,t.UK)(),p.validation.paxes=R(p.data.paxes,e),e.$valid&&p.validation.paxes?(p.data.typeEvent="habitaciones",h.$broadcast(m.bookerSearchEvent,p.data),p.form2.$pristine=!1,p.form2.$dirty=!1,p.form2.$submitted=!1):p.validation.paxes||(p.suggestion.paxes=!0)},h.$on(m.bookerSearchEventSmall,(function(e,t){p.data.paxes=t.paxes,p.data.checkIn=t.checkIn,p.data.checkOut=t.checkOut,k.setDateRange(p.data.checkIn,p.data.checkOut),D()})),p.showPaxes=function(){p.suggestion.paxes=!0,p.dataCopyCancel=angular.copy(p.data),L("hidden")},p.addRoom=function(){if(p.settingPaxes.rooms>p.data.paxes.length){var e=g.clone(m.defaultPaxes);p.data.paxes.push(e),D()}},p.onFocus=function(e,t){p.suggestion[e].results.length&&setTimeout((function(){n.$apply((function(){var n;p.suggestion[e].show=!0,g.mobileAndTabletCheck()&&(n="".concat(t,"_modal"),setTimeout((function(){var e=n&&document.getElementById(n);e&&e.focus()}),200))}))}),250)},p.removePax=function(e,t){p.data.paxes[e]-1>=t&&(p.data.paxes[e]-=1),D()},p.addPax=function(e,t){p.data.paxes[e]+1<=t&&(p.data.paxes[e]+=1),D()},p.removeChildren=function(e,t){p.data.paxes[e].length-1>=t&&p.data.paxes[e].splice(p.data.paxes[e].length-1,1),D()},p.addChildren=function(e,t){p.data.paxes[e].length+1<=t&&p.data.paxes[e].push({year:null}),D()},p.addRoom=function(e){p.settingPaxes.rooms<=p.data.paxes[e]||(p.data.paxes[e]+=1,D())},p.removeRoom=function(e){p.data.paxes[e]+1>2&&(p.data.paxes[e]-=1),D()},p.onClose=function(e,t){O()?p.form2.$setSubmitted():(L("auto"),e[t]=!1,A(t))},p.onCloseCancel=function(e,t){p.data=p.dataCopyCancel,e[t]=!1,A(t),L("auto")},p.onCloseSubmitForm=function(e,t){O()||p.form2.$invalid?p.form2.$setSubmitted():(L("auto"),p.placeInputHasFocus=!1,e[t]=!1,p.onSubmit(p.form2))},p.onRemove=function(e,t,n){e[t].splice(n,1),D()},p.hasError=function(e,t){var n=e[t];return e.$submitted&&n.$invalid},p.onClickOutside=function(e,t){L("auto"),p.placeInputHasFocus=!1,e[t]=!1,A(t),p.placeInputHasFocus=!1},p.showBooker=function(){p.display=!p.display},p.isInvalidInput=function(e,t,n){return e.$submitted&&e["".concat(t,"_").concat(n)].$invalid};var N=function(){var t=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,c,"next",e)}function c(e){s(i,r,o,a,c,"throw",e)}a(void 0)}))}}(a().mark((function t(){var n,r,o,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!f.showCalendarAvailability){t.next=14;break}if(!(n=p.data.place_selected)||14!=n.type||!n.code&&!n.id){t.next=14;break}t.t0=a().keys(P);case 4:if((t.t1=t.t0()).done){t.next=13;break}return r=t.t1.value,o=r.split("_"),t.next=9,e.D.getAvailability(n.code||n.id,o[0],o[1]);case 9:i=t.sent,e.D.build(S,i),t.next=4;break;case 13:e.D.footerBuild();case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();!function(){T(),function(){var e,t;"hotels"!=m.page&&"hotel"!=m.page||(p.display=!g.mobileAndTabletCheck(),m.rb&&(p.display=!0));"home"!=m.page?e=function(){var e=g.search(),t={},n=w;t.place_name=n.displayText||"",t.place_selected=n,t.checkIn=e.checkin||p.data.checkIn,t.checkOut=e.checkout||p.data.checkOut;var r={adults:0,children:[],rooms:0};if(e["room1.adults"]){var o=+e.rooms;r.rooms=o;for(var i=0;i<o;i++){var a=i+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,d=+e.no_rooms||1,h=[],f=+e.group_children||0,m=0;m<f;m++){var v=+(e.age||"").split(",")[m]||0;h.push({year:v})}r.adults=u,r.rooms=d,r.children=h}r||(r=p.data.paxes);return t.paxes=r,t}():t=o.V.get("bookerHotel_fam");t&&(t.place_name=null);p.data=e||t||p.data,E.getIsArray(p.data.paxes)&&(p.data.paxes=E.convertPaxesData(p.data.paxes));(e||t)&&(p.data.checkIn=g.getDate(p.data.checkIn),p.data.checkOut=g.getDate(p.data.checkOut),(+p.data.checkIn<=+y||+p.data.checkOut<=+y)&&T())}(),function(){(y<g.getDate(p.data.checkOut)||y>=g.getDate(p.data.checkOut))&&_&&(p.data.checkIn=g.getDate(_.checkIn),p.data.checkOut=g.getDate(_.checkOut));n=["calendar-checkIn-hotel-small","calendar-checkOut-hotel-small"],r=p.data.checkIn,o=p.data.checkOut,i="checkIn",a="checkOut",s=E.getFirstPathSegment(),c=m.rb?[]:["".concat(f.cloudCdn,"/assets/css/dist/").concat(f.siteName,"/booker.css?id=").concat(+new Date)],b={element:document.getElementById(n[0]),css:c,zIndex:100,grid:2,calendars:2,autoApply:!0,readonly:!0,lang:f.culture,date:r,format:g.mobileAndTabletCheck()&&"hotel"==s?I.formatMobile:I.format,plugins:["RangePlugin","LockPlugin"],LockPlugin:{minDate:y,minDays:2},RangePlugin:{tooltip:!0,startDate:r,endDate:o,tooltipNumber:function(e){return e-1},locale:{one:v.night,other:v.night+"s"}},setup:function(t){t.on("render",(function(e){var n=t.ui.container.querySelectorAll(".calendars .next-button"),r=t.ui.container.querySelectorAll(".calendars .previous-button");n&&n.forEach((function(e){e.setAttribute("aria-label","Siguiente mes")})),r&&r.forEach((function(e){e.setAttribute("aria-label","Anterior mes")}))})),t.on("select",(function(e){var t=e.detail,n=t.start,r=t.end;p.data[i]=n.toJSDate(),p.data[a]=r.toJSDate(),p.onSubmit(p.form2,!0)})),t.on("view",(function(t){var n=t.detail,r=n.view,o=n.date,i=n.target;if("CalendarDay"===r){var a=p.data.place_selected,s=o.format("YYYY_MM"),c=o.format("YYYY-MM-DD");P[s]=s,S[c]={date:o.format("YYYY-MM-DD"),target:i};var l=e.D.getMemoryDate(s,c,a.code||a.id);l&&e.D.buildElement(S[c],l)}"Main"===r&&(e.D.setFooterElement(i),e.D.footerBuild())})),t.on("show",(function(t){N(),e.D.overFlow()})),t.on("hide",(function(t){e.D.overFlow(),S={},P={}})),t.on("click",(function(e){t.isCalendarHeaderButton(e.target)&&(S={},P={},setTimeout((function(){N()}),100)),t.isCalendarDay(e.target)&&setTimeout((function(){N()}),100)}))}},k=new easepick.create(b),(0,t.Tc)(k);var n,r,o,i,a,s,c}(),D();for(var n=p.settingPaxes.minAge;n<=p.settingPaxes.maxAge;n++)p.years.push({year:n})}()}window.app.controller("SmallBookerController",c),c.$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(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.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 o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(a)?a:String(a)),o)}var i,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,this.cultureData=window.__pt.cultureData,this.pages=window.__pt.fn.analytics.pages}var n,r,o;return n=e,(r=[{key:"metricLoginAction",value:function(e,t){var n=t.action,r={event:this.events.gtmEvent,eventName:"Login",eventCategory:"Login",eventAction:n,eventLabel:"",eventExtra:""};this.analytics.set(r.event,r)}},{key:"newsLetter",value:function(e){var t={event:"newsletterSubscription",newsletterUser:e};this.analytics.set(t.event,t)}},{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:"metricHeaderSelectModalOption",value:function(e){var t=e.title,n=e.currency,r=e.language,o={content_type:this.events.button,element:"header :: ".concat(t," :: ").concat(r||this.cultureData.cultureCode,"-").concat(n||this.cultureData.currency),event:this.events.trackEvent,eventName:this.events.selectContent,layer:this.settings.page};this.analytics.set(o.event,o)}},{key:"metricHeaderSelectContentLanguageModal",value:function(e){var t=e.title,n={content_type:this.events.button,element:"form :: ".concat(t),event:this.events.trackEvent,eventName:this.events.selectContent,layer:this.settings.page,page_type:this.pages[this.settings.page],extra_info:"".concat(this.cultureData.cultureCode,"|").concat(this.cultureData.currency)};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),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}(),o=n(4155);const i=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=63&o|128):55296==(64512&o)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++r)),t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|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 o=e[t],i=t+1<e.length,a=i?e[t+1]:0,s=t+2<e.length,c=s?e[t+2]:0,l=o>>2,u=(3&o)<<4|a>>4;let d=(15&a)<<2|c>>6,h=63&c;s||(h=64,i||(d=64)),r.push(n[l],n[u],n[d],n[h])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(i(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 o=e[n++];if(o<128)t[r++]=String.fromCharCode(o);else if(o>191&&o<224){const i=e[n++];t[r++]=String.fromCharCode((31&o)<<6|63&i)}else if(o>239&&o<365){const i=((7&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(i>>10)),t[r++]=String.fromCharCode(56320+(1023&i))}else{const i=e[n++],a=e[n++];t[r++]=String.fromCharCode((15&o)<<12|(63&i)<<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 o=n[e.charAt(t++)],i=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==o||null==i||null==a||null==c)throw new s;const l=o<<2|i>>4;if(r.push(l),64!==a){const e=i<<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=i(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__,d=()=>{try{return u()||(()=>{if(void 0===o||void 0===o.env)return;const e=o.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}`)}},h=e=>{var t,n;return null===(n=null===(t=d())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},p=()=>{var e;return null===(e=d())||void 0===e?void 0:e.config},f=e=>{var t;return null===(t=d())||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}`,o=this.errors[e],i=o?function(e,t){return e.replace(w,((e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`}))}(o,n):"Error",a=`${this.serviceName}: ${i} (${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 o of n){if(!r.includes(o))return!1;const n=e[o],i=t[o];if(k(n)&&k(i)){if(!b(n,i))return!1}else if(n!==i)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function k(e){return null!==e&&"object"==typeof e}function _(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 E(e){const t={};return e.replace(/^\?/,"").split("&").forEach((e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}})),t}function I(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 o=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),o}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 T{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 x="[DEFAULT]";class D{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:x})}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=x){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=x){return this.instances.has(e)}getOptions(e=x){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),o=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;o.add(e),this.onInitCallbacks.set(r,o);const i=this.instances.get(r);return i&&e(i,r),()=>{o.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===x?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=x){return this.component?this.component.multipleInstances?e:x:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class R{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 D(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const A=[];var O;!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"}(O||(O={}));const L={debug:O.DEBUG,verbose:O.VERBOSE,info:O.INFO,warn:O.WARN,error:O.ERROR,silent:O.SILENT},N=O.INFO,M={[O.DEBUG]:"log",[O.VERBOSE]:"log",[O.INFO]:"info",[O.WARN]:"warn",[O.ERROR]:"error"},j=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),o=M[t];if(!o)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[o](`[${r}]  ${e.name}:`,...n)};class U{constructor(e){this.name=e,this._logLevel=N,this._logHandler=j,this._userLogHandler=null,A.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in O))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?L[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,O.DEBUG,...e),this._logHandler(this,O.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,O.VERBOSE,...e),this._logHandler(this,O.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,O.INFO,...e),this._logHandler(this,O.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,O.WARN,...e),this._logHandler(this,O.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,O.ERROR,...e),this._logHandler(this,O.ERROR,...e)}}let F,B;const H=new WeakMap,V=new WeakMap,W=new WeakMap,q=new WeakMap,z=new WeakMap;let G={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return V.get(e);if("objectStoreNames"===t)return e.objectStoreNames||W.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 W.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",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),r()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)}));V.set(e,t)}(e),t=e,(F||(F=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,G):e);var t}function J(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(J(e.result)),r()},i=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",i)}));return t.then((t=>{t instanceof IDBCursor&&H.set(t,e)})).catch((()=>{})),z.set(t,e),t}(e);if(q.has(e))return q.get(e);const t=Y(e);return t!==e&&(q.set(e,t),z.set(t,e)),t}const Q=e=>z.get(e);const Z=["get","getKey","getAll","getAllKeys","count"],X=["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,o=X.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!Z.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let a=i.store;return r&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),o&&i.done]))[0]};return ee.set(t,i),i}G=(e=>({...e,get:(t,n,r)=>te(t,n)||e.get(t,n,r),has:(t,n)=>!!te(t,n)||e.has(t,n)}))(G);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",oe="0.9.20",ie=new U("@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){ie.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function de(e){const t=e.name;if(le.has(t))return ie.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 he(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 T("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),o=r.name;if("string"!=typeof o||!o)throw pe.create("bad-app-name",{appName:String(o)});if(n||(n=p()),!n)throw pe.create("no-options");const i=ce.get(o);if(i){if(b(n,i.options)&&b(r,i.config))return i;throw pe.create("duplicate-app",{appName:o})}const a=new R(o);for(const e of le.values())a.addComponent(e);const s=new fe(n,r,a);return ce.set(o,s),s}function ge(e,t,n){var r;let o=null!==(r=se[e])&&void 0!==r?r:e;n&&(o+=`-${n}`);const i=o.match(/\s|\//),a=t.match(/\s|\//);if(i||a){const e=[`Unable to register library "${o}" with version "${t}":`];return i&&e.push(`library name "${o}" contains illegal characters (whitespace or "/")`),i&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void ie.warn(e.join(" "))}de(new T(`${o}-version`,(()=>({library:o,version:t})),"VERSION"))}const ye="firebase-heartbeat-store";let we=null;function be(){return we||(we=function(e,t,{blocked:n,upgrade:r,blocking:o,terminated:i}={}){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=>{i&&e.addEventListener("close",(()=>i())),o&&e.addEventListener("versionchange",(e=>o(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 ke(e,t){try{const n=(await be()).transaction(ye,"readwrite"),r=n.objectStore(ye);await r.put(t,_e(e)),await n.done}catch(e){if(e instanceof g)ie.warn(e.message);else{const t=pe.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});ie.warn(t.message)}}}function _e(e){return`${e.name}!${e.options.appId}`}class Ee{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=Ie();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=Ie(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let r=e.slice();for(const o of e){const e=n.find((e=>e.agent===o.agent));if(e){if(e.dates.push(o.date),Pe(n)>t){e.dates.pop();break}}else if(n.push({agent:o.agent,dates:[o.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 Ie(){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",o=self.indexedDB.open(r);o.onsuccess=()=>{o.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},o.onupgradeneeded=()=>{n=!1},o.onerror=()=>{var e;t((null===(e=o.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(_e(e))}catch(e){if(e instanceof g)ie.warn(e.message);else{const t=pe.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});ie.warn(t.message)}}}(this.app)||{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ke(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 ke(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="",de(new T("platform-logger",(e=>new ne(e)),"PRIVATE")),de(new T("heartbeat",(e=>new Ee(e)),"PRIVATE")),ge(re,oe,Ce),ge(re,oe,"esm2017"),ge("fire-js","");ge("firebase","10.5.0","app");function Te(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}Object.create;Object.create;function xe(e){return void 0!==e&&void 0!==e.enterprise}class De{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 Re(){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=Re,Oe=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."}),Le=new U("@firebase/auth");function Ne(e,...t){Le.logLevel<=O.ERROR&&Le.error(`Auth (${me}): ${e}`,...t)}function Me(e,...t){throw Be(e,...t)}function je(e,...t){return Be(e,...t)}function Ue(e,t,n){const r=Object.assign(Object.assign({},Ae()),{[t]:n});return new y("auth","Firebase",r).create(t,{appName:e.name})}function Fe(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&Me(e,"argument-error"),Ue(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 Oe.create(e,...t)}function $e(e,t,...n){if(!e)throw Be(t,...n)}function He(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Ne(t),new Error(t)}function Ve(e,t){e||He(t)}function We(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function qe(){return"http:"===ze()||"https:"===ze()}function ze(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}function Ge(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(qe()||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 Ge()?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 He("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 He("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 He("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"},Ze=new Ke(3e4,6e4);function Xe(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function et(e,t,n,r,o={}){return tt(e,o,(async()=>{let o={},i={};r&&("GET"===t?i=r:o={body:JSON.stringify(r)});const a=_(Object.assign({key:e.config.apiKey},i)).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"},o))}))}async function tt(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},Qe),t);try{const t=new ot(e),o=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw it(e,"account-exists-with-different-credential",i);if(o.ok&&!("errorMessage"in i))return i;{const t=o.ok?i.errorMessage:i.error.message,[n,a]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw it(e,"credential-already-in-use",i);if("EMAIL_EXISTS"===n)throw it(e,"email-already-in-use",i);if("USER_DISABLED"===n)throw it(e,"user-disabled",i);const s=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(a)throw Ue(e,s,a);Me(e,s)}}catch(t){if(t instanceof g)throw t;Me(e,"network-request-failed",{message:String(t)})}}async function nt(e,t,n,r,o={}){const i=await et(e,t,n,r,o);return"mfaPendingCredential"in i&&Me(e,"multi-factor-auth-required",{_serverResponse:i}),i}function rt(e,t,n,r){const o=`${t}${n}?${r}`;return e.config.emulator?Ye(e.config,o):`${e.config.apiScheme}://${o}`}class ot{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise(((e,t)=>{this.timer=setTimeout((()=>t(je(this.auth,"network-request-failed"))),Ze.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}function it(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const o=je(e,t,r);return o.customData._tokenResponse=n,o}async function at(e,t){return et(e,"GET","/v2/recaptchaConfig",Xe(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 Ne("JWT malformed, contained fewer than 3 sections"),null;try{const e=l(n);return e?JSON.parse(e):(Ne("Failed to decode base64 JWT payload"),null)}catch(e){return Ne("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 dt{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 ht{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(),o=await ut(e,async function(e,t){return et(e,"POST","/v1/accounts:lookup",t)}(n,{idToken:r}));$e(null==o?void 0:o.users.length,n,"internal-error");const i=o.users[0];e._notifyReloadListener(i);const a=(null===(t=i.providerUserInfo)||void 0===t?void 0:t.length)?i.providerUserInfo.map((e=>{var{providerId:t}=e,n=Te(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,d=!(e.email&&i.passwordHash||(null==s?void 0:s.length)),h=!!u&&d,p={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new ht(i.createdAt,i.lastLoginAt),isAnonymous:h};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){$e(e.idToken,"internal-error"),$e(void 0!==e.idToken,"internal-error"),$e(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 $e(t,"internal-error"),$e(void 0!==t.exp,"internal-error"),$e(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 $e(!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:o}=await async function(e,t){const n=await tt(e,{},(async()=>{const n=_({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:o}=e.config,i=rt(e,r,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Je.fetch()(i,{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(o))}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:o}=t,i=new ft;return n&&($e("string"==typeof n,"internal-error",{appName:e}),i.refreshToken=n),r&&($e("string"==typeof r,"internal-error",{appName:e}),i.accessToken=r),o&&($e("number"==typeof o,"internal-error",{appName:e}),i.expirationTime=o),i}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 He("not implemented")}}function mt(e,t){$e("string"==typeof e||void 0===e,"internal-error",{appName:t})}class vt{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,o=Te(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new dt(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new ht(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(e){const t=await ut(this,this.stsTokenManager.getToken(this.auth,e));return $e(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),o=lt(r);$e(o&&o.exp&&o.auth_time&&o.iat,n.auth,"internal-error");const i="object"==typeof o.firebase?o.firebase:void 0,a=null==i?void 0:i.sign_in_provider;return{claims:o,token:r,authTime:st(ct(o.auth_time)),issuedAtTime:st(ct(o.iat)),expirationTime:st(ct(o.exp)),signInProvider:a||null,signInSecondFactor:(null==i?void 0:i.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&&($e(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){$e(!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,o,i,a,s,c,l;const u=null!==(n=t.displayName)&&void 0!==n?n:void 0,d=null!==(r=t.email)&&void 0!==r?r:void 0,h=null!==(o=t.phoneNumber)&&void 0!==o?o:void 0,p=null!==(i=t.photoURL)&&void 0!==i?i: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:k,stsTokenManager:_}=t;$e(y&&_,e,"internal-error");const E=ft.fromJSON(this.name,_);$e("string"==typeof y,e,"internal-error"),mt(u,e.name),mt(d,e.name),$e("boolean"==typeof w,e,"internal-error"),$e("boolean"==typeof b,e,"internal-error"),mt(h,e.name),mt(p,e.name),mt(f,e.name),mt(m,e.name),mt(v,e.name),mt(g,e.name);const I=new vt({uid:y,auth:e,email:d,emailVerified:w,displayName:u,isAnonymous:b,photoURL:p,phoneNumber:h,tenantId:f,stsTokenManager:E,createdAt:v,lastLoginAt:g});return k&&Array.isArray(k)&&(I.providerData=k.map((e=>Object.assign({},e)))),m&&(I._redirectEventId=m),I}static async _fromIdTokenResponse(e,t,n=!1){const r=new ft;r.updateFromServerResponse(t);const o=new vt({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await pt(o),o}}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 kt(e,t,n){return`firebase:${e}:${t}:${n}`}class _t{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:o}=this.auth;this.fullUserKey=kt(this.userKey,r.apiKey,o),this.fullPersistenceKey=kt("persistence",r.apiKey,o),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 _t(yt(bt),e,n);const r=(await Promise.all(t.map((async e=>{if(await e._isAvailable())return e})))).filter((e=>e));let o=r[0]||yt(bt);const i=kt(n,e.config.apiKey,e.name);let a=null;for(const n of t)try{const t=await n._get(i);if(t){const r=vt._fromJSON(e,t);n!==o&&(a=r),o=n;break}}catch(e){}const s=r.filter((e=>e._shouldAllowMigration));return o._shouldAllowMigration&&s.length?(o=s[0],a&&await o._set(i,a.toJSON()),await Promise.all(t.map((async e=>{if(e!==o)try{await e._remove(i)}catch(e){}}))),new _t(o,e,n)):new _t(o,e,n)}}function Et(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(It(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(xt(t))return"Blackberry";if(Dt(t))return"Webos";if(St(t))return"Safari";if((t.includes("chrome/")||Pt(t))&&!t.includes("edge/"))return"Chrome";if(Tt(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 It(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 Tt(e=v()){return/android/i.test(e)}function xt(e=v()){return/blackberry/i.test(e)}function Dt(e=v()){return/webos/i.test(e)}function Rt(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 Ot(e=v()){return Rt(e)||Tt(e)||Dt(e)||xt(e)||/windows phone/i.test(e)||Ct(e)}function Lt(e,t=[]){let n;switch(e){case"Browser":n=Et(v());break;case"Worker":n=`${Et(v())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${me}/${r}`}class Nt{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 Mt{constructor(e){var t,n,r,o;const i=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=i.minPasswordLength)&&void 0!==t?t:6,i.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=i.maxPasswordLength),void 0!==i.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=i.containsLowercaseCharacter),void 0!==i.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=i.containsUppercaseCharacter),void 0!==i.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=i.containsNumericCharacter),void 0!==i.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=i.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!==(o=e.forceUpgradeOnSignin)&&void 0!==o&&o,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,r,o,i,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===(o=s.containsUppercaseLetter)||void 0===o||o),s.isValid&&(s.isValid=null===(i=s.containsNumericCharacter)||void 0===i||i),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,o){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=o))}}class jt{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 Ft(this),this.idTokenSubscription=new Ft(this),this.beforeStateQueue=new Nt(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=Oe,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 _t.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,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,i=null==r?void 0:r._redirectEventId,a=await this.tryRedirectSignIn(e);n&&n!==i||!(null==a?void 0:a.user)||(r=a.user,o=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(o)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 $e(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&&$e(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&&$e(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",Xe(e,t))}(this),t=new Mt(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;$e(t,this,"argument-error"),this.redirectPersistenceManager=await _t.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 o="function"==typeof t?t:t.next.bind(t);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if($e(a,this,"internal-error"),a.then((()=>{i||o(this.currentUser)})),"function"==typeof t){const o=e.addObserver(t,n,r);return()=>{i=!0,o()}}{const n=e.addObserver(t);return()=>{i=!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 $e(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Lt(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){Le.logLevel<=O.WARN&&Le.warn(`Auth (${me}): ${e}`,...t)}(`Error while retrieving App Check token: ${t.error}`),null==t?void 0:t.token}}function Ut(e){return C(e)}class Ft{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 $e(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 o,i;r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=je("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",(null!==(i=null===(o=document.getElementsByTagName("head"))||void 0===o?void 0:o[0])&&void 0!==i?i:document).appendChild(r)}))}function $t(e){return`__${e}${Math.floor(1e6*Math.random())}`}class Ht{constructor(e){this.type="recaptcha-enterprise",this.auth=Ut(e)}async verify(e="verify",t=!1){function n(t,n,r){const o=window.grecaptcha;xe(o)?o.enterprise.ready((()=>{o.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 De(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((o=>{if(!t&&xe(window.grecaptcha))n(o,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="+o).then((()=>{n(o,e,r)})).catch((e=>{r(e)}))}})).catch((e=>{r(e)}))}))}}async function Vt(e,t,n,r=!1){const o=new Ht(e);let i;try{i=await o.verify(n)}catch(e){i=await o.verify(n,!0)}const a=Object.assign({},t);return r?Object.assign(a,{captchaResp:i}):Object.assign(a,{captchaResponse:i}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}function Wt(e,t,n){const r=Ut(e);$e(r._canInitEmulator,r,"emulator-config-failed"),$e(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const o=!!(null==n?void 0:n.disableWarnings),i=qt(t),{host:a,port:s}=function(e){const t=qt(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",o=/^(\[[^\]]+\])(:|$)/.exec(r);if(o){const e=o[1];return{host:e,port:zt(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:zt(t)}}}(t),c=null===s?"":`:${s}`;r.config.emulator={url:`${i}//${a}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:a,port:s,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:o})}),o||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 qt(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function zt(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Gt{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return He("not implemented")}_getIdTokenResponse(e){return He("not implemented")}_linkToIdToken(e,t){return He("not implemented")}_getReauthenticationResolver(e){return He("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",Xe(e,t))}async function Jt(e,t){return et(e,"POST","/v1/accounts:sendOobCode",Xe(e,t))}async function Qt(e,t){return Jt(e,t)}class Zt extends Gt{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new Zt(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new Zt(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",Xe(e,t))}(e,{email:this._email,oobCode:this._password});default:Me(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",Xe(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:Me(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Xt(e,t){return nt(e,"POST","/v1/accounts:signInWithIdp",Xe(e,t))}class en extends Gt{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):Me("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,o=Te(t,["providerId","signInMethod"]);if(!n||!r)return null;const i=new en(n,r);return i.idToken=o.idToken||void 0,i.accessToken=o.accessToken||void 0,i.secret=o.secret,i.nonce=o.nonce,i.pendingToken=o.pendingToken||null,i}_getIdTokenResponse(e){return Xt(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Xt(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Xt(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=_(t)}return e}}const tn={USER_NOT_FOUND:"user-not-found"};class nn extends Gt{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",Xe(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await nt(e,"POST","/v1/accounts:signInWithPhoneNumber",Xe(e,t));if(n.temporaryProof)throw it(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",Xe(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:o}=e;return n||t||r||o?new nn({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:o}):null}}class rn{constructor(e){var t,n,r,o,i,a;const s=E(I(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);$e(c&&l&&u,"argument-error"),this.apiKey=c,this.operation=u,this.code=l,this.continueUrl=null!==(o=s.continueUrl)&&void 0!==o?o:null,this.languageCode=null!==(i=s.languageCode)&&void 0!==i?i:null,this.tenantId=null!==(a=s.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=E(I(e)).link,n=t?E(I(t)).deep_link_id:null,r=E(I(e)).deep_link_id;return(r?E(I(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 Zt._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=rn.parseLink(t);return $e(n,"argument-error"),Zt._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 dn extends sn{constructor(){super("twitter.com")}static credential(e,t){return en._fromParams({providerId:dn.PROVIDER_ID,signInMethod:dn.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return dn.credentialFromTaggedObject(e)}static credentialFromError(e){return dn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return dn.credential(t,n)}catch(e){return null}}}async function hn(e,t){return nt(e,"POST","/v1/accounts:signUp",Xe(e,t))}dn.TWITTER_SIGN_IN_METHOD="twitter.com",dn.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 o=await vt._fromIdTokenResponse(e,n,r),i=fn(n);return new pn({user:o,providerId:i,_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 o;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,mn.prototype),this.customData={appName:e.name,tenantId:null!==(o=e.tenantId)&&void 0!==o?o: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,o="reauthenticate";try{const i=await ut(e,vn(r,o,t,e),n);$e(i.idToken,r,"internal-error");const a=lt(i.idToken);$e(a,r,"internal-error");const{sub:s}=a;return $e(e.uid===s,r,"user-mismatch"),pn._forOperation(e,o,i)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&Me(r,"user-mismatch"),e}}async function wn(e,t,n=!1){const r="signIn",o=await vn(e,r,t),i=await pn._fromIdTokenResponse(e,r,o);return n||await e._updateCurrentUser(i.user),i}async function bn(e,t){return wn(Ut(e),t)}function kn(e,t,n){var r;$e((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"invalid-continue-uri"),$e(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&&($e(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&($e(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 _n(e){const t=Ut(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function En(e,t,n){var r;const o=Ut(e),i={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};if(null===(r=o._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await Vt(o,i,"getOobCode",!0);n&&kn(o,e,n),await Qt(o,e)}else n&&kn(o,i,n),await Qt(o,i).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(o,i,"getOobCode",!0);n&&kn(o,e,n),await Qt(o,e)}}))}async function In(e,t,n){var r;const o=Ut(e),i={returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"};let a;if(null===(r=o._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await Vt(o,i,"signUpPassword");a=hn(o,e)}else a=hn(o,i).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(o,i,"signUpPassword");return hn(o,e)}throw e}));const s=await a.catch((t=>{throw"auth/password-does-not-meet-requirements"===t.code&&_n(e),t})),c=await pn._fromIdTokenResponse(o,"signIn",s);return await o._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&&_n(e),t}))}async function Pn(e,t){const n=C(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&kn(n.auth,r,t);const{email:o}=await async function(e,t){return Jt(e,t)}(n.auth,r);o!==e.email&&await e.reload()}function Cn(e){return C(e).signOut()}new WeakMap;const Tn="__sak";class xn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Tn,"1"),this.storage.removeItem(Tn),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 Dn extends xn{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)||Rt(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=Ot(),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)},o=this.storage.getItem(n);At()&&o!==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]}}Dn.type="LOCAL";const Rn=Dn;class An extends xn{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(e,t){}_removeListener(e,t){}}An.type="SESSION";const On=An;class Ln{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 Ln(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:o}=t.data,i=this.handlersMap[r];if(!(null==i?void 0:i.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const a=Array.from(i).map((async e=>e(t.origin,o))),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 Nn(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}Ln.receivers=[];class Mn{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 o,i;return new Promise(((a,s)=>{const c=Nn("",20);r.port1.start();const l=setTimeout((()=>{s(new Error("unsupported_event"))}),n);i={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===c)switch(t.data.status){case"ack":clearTimeout(l),o=setTimeout((()=>{s(new Error("timeout"))}),3e3);break;case"done":clearTimeout(o),a(t.data.response);break;default:clearTimeout(l),clearTimeout(o),s(new Error("invalid_response"))}}},this.handlers.add(i),r.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])})).finally((()=>{i&&this.removeMessageHandler(i)}))}}function jn(){return window}function Un(){return void 0!==jn().WorkerGlobalScope&&"function"==typeof jn().importScripts}const Fn="firebaseLocalStorageDb",Bn="firebaseLocalStorage",$n="fbase_key";class Hn{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 Wn(){const e=indexedDB.open(Fn,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(Bn,{keyPath:$n})}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(Fn);return new Hn(e).toPromise()}(),t(await Wn()))}))}))}async function qn(e,t,n){const r=Vn(e,!0).put({[$n]:t,value:n});return new Hn(r).toPromise()}function zn(e,t){const n=Vn(e,!0).delete(t);return new Hn(n).toPromise()}class Gn{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 Wn()),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 Un()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ln._getInstance(Un()?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 Mn(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 Wn();return await qn(e,Tn,"1"),await zn(e,Tn),!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=>qn(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 Hn(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=>zn(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 Hn(t).toPromise()}));if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;for(const{fbase_key:r,value:o}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(o)&&(this.notifyListeners(r,o),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()}}Gn.type="LOCAL";const Kn=Gn;$t("rcb"),new Ke(3e4,6e4);const Yn="recaptcha";async function Jn(e,t,n){var r;const o=await n.verify();try{let i;if($e("string"==typeof o,e,"argument-error"),$e(n.type===Yn,e,"argument-error"),i="string"==typeof t?{phoneNumber:t}:t,"session"in i){const t=i.session;if("phoneNumber"in i){$e("enroll"===t.type,e,"internal-error");const n=await function(e,t){return et(e,"POST","/v2/accounts/mfaEnrollment:start",Xe(e,t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:i.phoneNumber,recaptchaToken:o}});return n.phoneSessionInfo.sessionInfo}{$e("signin"===t.type,e,"internal-error");const n=(null===(r=i.multiFactorHint)||void 0===r?void 0:r.uid)||i.multiFactorUid;$e(n,e,"missing-multi-factor-info");const a=await function(e,t){return et(e,"POST","/v2/accounts/mfaSignIn:start",Xe(e,t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:o}});return a.phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return et(e,"POST","/v1/accounts:sendVerificationCode",Xe(e,t))}(e,{phoneNumber:i.phoneNumber,recaptchaToken:o});return t}}finally{n._reset()}}class Qn{constructor(e){this.providerId=Qn.PROVIDER_ID,this.auth=Ut(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 Zn(e,t){return t?yt(t):($e(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}Qn.PROVIDER_ID="phone",Qn.PHONE_SIGN_IN_METHOD="phone";class Xn extends Gt{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Xt(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Xt(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Xt(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 Xn(e),e.bypassAuthState)}function tr(e){const{auth:t,user:n}=e;return $e(n,t,"internal-error"),yn(n,new Xn(e),e.bypassAuthState)}async function nr(e){const{auth:t,user:n}=e;return $e(n,t,"internal-error"),gn(n,new Xn(e),e.bypassAuthState)}class rr{constructor(e,t,n,r,o=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=o,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:o,error:i,type:a}=e;if(i)return void this.reject(i);const s={auth:this.auth,requestUri:t,sessionId:n,tenantId:o||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:Me(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 or=new Ke(2e3,1e4);async function ir(e,t,n){const r=Ut(e);Fe(e,t,an);const o=Zn(r,n);return new ar(r,"signInViaPopup",t,o).executeNotNull()}class ar extends rr{constructor(e,t,n,r,o){super(e,t,r,o),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 $e(e,this.auth,"internal-error"),e}async onExecution(){Ve(1===this.filter.length,"Popup operations only handle one event");const e=Nn();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(je(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(je(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(je(this.auth,"popup-closed-by-user"))}),8e3):this.pollId=window.setTimeout(e,or.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=dr(t),r=ur(e);if(!await r._isAvailable())return!1;const o="true"===await r._get(n);return await r._remove(n),o}(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 dr(e){return kt("pendingRedirect",e.config.apiKey,e.name)}async function hr(e,t,n=!1){const r=Ut(e),o=Zn(r,t),i=new cr(r,o,n),a=await i.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(je(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){}Me(e,"unauthorized-domain")}function wr(e){const t=We(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const o=new URL(e);return""===o.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&o.hostname===r}if(!gr.test(n))return!1;if(vr.test(e))return r===e;const o=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(r)}const br=new Ke(3e4,6e4);function kr(){const e=jn().___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 _r=null;function Er(e){return _r=_r||function(e){return new Promise(((t,n)=>{var r,o,i;function a(){kr(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{kr(),n(je(e,"network-request-failed"))},timeout:br.get()})}if(null===(o=null===(r=jn().gapi)||void 0===r?void 0:r.iframes)||void 0===o?void 0:o.Iframe)t(gapi.iframes.getContext());else{if(!(null===(i=jn().gapi)||void 0===i?void 0:i.load)){const t=$t("iframefcb");return jn()[t]=()=>{gapi.load?a():n(je(e,"network-request-failed"))},Bt(`https://apis.google.com/js/api.js?onload=${t}`).catch((e=>n(e)))}a()}})).catch((e=>{throw _r=null,e}))}(e),_r}const Ir=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;$e(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},o=Pr.get(e.config.apiHost);o&&(r.eid=o);const i=e._getFrameworks();return i.length&&(r.fw=i.join(",")),`${n}?${_(r).slice(1)}`}const Tr={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class xr{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function Dr(e,t,n,r=500,o=600){const i=Math.max((window.screen.availHeight-o)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let s="";const c=Object.assign(Object.assign({},Tr),{width:r.toString(),height:o.toString(),top:i,left:a}),l=v().toLowerCase();n&&(s=Pt(l)?"_blank":n),It(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 Rt(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 xr(null);const d=window.open(t||"",s,u);$e(d,e,"popup-blocked");try{d.focus()}catch(e){}return new xr(d)}const Rr="__/auth/handler",Ar="emulator/auth/handler",Or=encodeURIComponent("fac");async function Lr(e,t,n,r,o,i){$e(e.config.authDomain,e,"auth-domain-config-required"),$e(e.config.apiKey,e,"invalid-api-key");const a={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:me,eventId:o};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(i||{}))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?`#${Or}=${encodeURIComponent(c)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/${Rr}`;return Ye(e,Ar)}(e)}?${_(s).slice(1)}${l}`}const Nr="webStorageSupport";const Mr=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=On,this._completeRedirectFn=hr,this._overrideRedirectResult=lr}async _openPopup(e,t,n,r){var o;Ve(null===(o=this.eventManagers[e._key()])||void 0===o?void 0:o.manager,"_initialize() not called before _openPopup()");return Dr(e,await Lr(e,t,n,We(),r),Nn())}async _openRedirect(e,t,n,r){await this._originValidation(e);return function(e){jn().location.href=e}(await Lr(e,t,n,We(),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 Er(e),n=jn().gapi;return $e(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 o=je(e,"network-request-failed"),i=jn().setTimeout((()=>{r(o)}),Ir.get());function a(){jn().clearTimeout(i),n(t)}t.ping(a).then(a,(()=>{r(o)}))}))))}(e),n=new pr(e);return t.register("authEvent",(t=>{$e(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(Nr,{type:Nr},(n=>{var r;const o=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r[Nr];void 0!==o&&t(!!o),Me(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 Ot()||St()||Rt()}};var jr="@firebase/auth",Ur="1.3.0";class Fr{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(){$e(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 $r=null;function Hr(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=he(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=he(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(b(n.getOptions(),null!=t?t:{}))return e;Me(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:Mr,persistence:[Kn,Rn,On]}),r=f("authTokenSyncURL");if(r){const e=(o=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;$r!==r&&($r=r,await fetch(o,{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 o;const i=h("auth");return i&&Wt(n,`http://${i}`),n}var Vr;Vr="Browser",de(new T("auth",((e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=n.options;$e(i&&!i.includes(":"),"invalid-api-key",{appName:n.name});const s={apiKey:i,authDomain:a,clientPlatform:Vr,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Lt(Vr)},c=new jt(n,r,o,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()}))),de(new T("auth-internal",(e=>(e=>new Fr(e))(Ut(e.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),ge(jr,Ur,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(Vr)),ge(jr,Ur,"esm2017");var Wr=n(2805),qr=n(694),zr=n(9586);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 Kr(){Kr=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:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.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,o){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),s=new S(o||[]);return r(a,"_invoke",{value:k(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 d={};function h(){}function p(){}function f(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(P([])));g&&g!==t&&n.call(g,i)&&(m=g);var y=f.prototype=h.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 o(r,i,a,s){var c=u(e[r],e,i);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==Gr(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function k(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return C()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===d)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===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function _(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,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=u(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,d;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=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 o.next=o}}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,o,i){void 0===i&&(i=Promise);var a=new b(l(t,n,r,o),i);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,i,(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(I),!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 o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):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),d},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),I(n),d}},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 o=r.arg;I(n)}return o}}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),d}},e}function Yr(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function Jr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Yr(i,r,o,a,s,"next",e)}function s(e){Yr(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Qr(e,t,n,o,i){var a=6e4,s=window.__pt.settings.loginErrors,c=this,l=new r,u=window.__pt.fn,d=u.search(),h=window.__pt.settings.site,p=0,f=1,m=window.__pt.settings.site,v=window.__pt.cultureData||{},g=window.__pt.ln,y=ve(m.login.firebaseSettings);c.loginProviders=window.__pt.settings.site.login.providers,c.settings=window.__pt.settings.site.login.main||{},c.modalActive=!1,c.loadingSession=!1,c.loadingUserProfile=!1,c.dropdownListActive=!1,c.stepRegister=1,c.currenLink="",c.isResetpassword=!1,c.isProvider=!1,c.pageError={},c.userData={email:"",password:"",pwdconfirm:"",lastname:"",name:"",recatcha:""},c.newsletter={emailUser:"",recatcha:"",showError:!1,submitCount:0},c.emailInvalid=!1,c.sessionData={isLogin:!1},c.photoStyle={},c.currentErrorMsg=null,c.showBanner=!0,c.currentErrorMsgPerfil=null,c.avatarConf={color:"",avatar:""},c.eyeUser=!0,c.userDataWriten={name:"",phone:"",recaptchaToken:""},c.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:""},c.dropdown_phones=!1,c.dropdown_lang=!1,c.dropdown_langMobile=!1,c.dropdown_nav=!1,c.dropdown_tablet=!1,c.iscodept=!1,c.codeData={},c.isResendCurrenUser=!1,c.settingsForm={redirect:"",language:"",currency:"",url:""};var w=new Wr.Z(m.domainAPIUrl),b=u.search(),k=new qr.Z(b,m).getUserKeyFavorites();function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;c.pageError.has=!0,c.pageError.type=t,c.loading=!1,c.loadingSession=!1}function E(){return(E=Jr(Kr().mark((function e(t,n){return Kr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(m.endPoints.contactCallUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)});case 2:e.sent,c.hideModalCall("modal-call",n),c.showModalHeader("modal-confirmation",null);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(){document.body.style.overflow="hidden"}function S(){document.body.style.overflow="auto"}function P(e){var t=angular.element(".bottom__container"),n=angular.element(".bottom__tab").eq(0),r=n.position().left+n.outerWidth(),o=angular.element(".bottom__mask--left"),i=angular.element(".bottom__mask--right");"left"===e&&r<0||r>70?o.hide():o.show();var a,s=(a=angular.element(".bottom__tab").last()).position().left;"right"===e&&s+a.outerWidth()>t.width()?i.hide():i.show(),angular.element(".bottom__tab").eq(0).position().left,(a=angular.element(".bottom__tab").last()).position().left+a.outerWidth()>t.width()&&i.show()}function T(e,t,n){return x.apply(this,arguments)}function x(){return x=Jr(Kr().mark((function e(n,r,o){var i,a;return Kr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.loadingSession=!0,i={headers:{"X-XSRF-TOKEN":D()}},a={uid:n,notSession:r,name:c.userData.name,lastname:c.userData.lastname,token:o||n,remember:!0},t.post(m.siteUrl+"/hotel/api/login",a,i).then(function(){var e=Jr(Kr().mark((function e(t){var n;return Kr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c.loadingSession=!1,200!=t.data.status){e.next=12;break}if(!r){e.next=6;break}c.stepRegister=7,e.next=10;break;case 6:return n={UserId:k,FirebaseId:a.uid,country:m.country.toUpperCase()},e.next=9,w.copyByUser(n).then((function(e){})).catch((function(e){console.error("Error fetching copyByUser:",e)}));case 9:d.redirectTo&&""!==d.redirectTo?window.location.href=m.siteUrl+d.redirectTo:window.location.href=m.siteUrl+"/"+v.cultureCode+"/";case 10:e.next=14;break;case 12:c.currentErrorMsg=t.data.response,c.stepRegister=1;case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_);case 4:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}function D(){var e=document.querySelector("[name='_token']");return e?e.value:""}function R(e){if(0===e.length)return!1;return/\S+@\S+\.\S+/.test(e)}c.showModal=function(e){c.stepRegister=1,$("#".concat(e)).modal("show"),"modal_langcurr"!=e&&(l.metricLoginAction("login",{action:"open modal"}),l.metricLoginAction("login",{action:"link header"})),l.metricHeaderSelectContent({title:"idioma-moneda"})},c.showModalHeader=function(e){$("#".concat(e)).modal("show"),c.cleaInputs()},c.hideModalCoupon=function(e){c.showBanner=!1},c.hideModalCall=function(e,t){$("#".concat(e)).modal("hide"),c.cleaInputs(t)},c.cleaInputs=function(e){c.userDataWriten={name:"",phone:"",recaptchaToken:""},e&&(e.$setPristine(),e.$setUntouched()),grecaptcha.enterprise.reset()},c.hideModal=function(e){$("#".concat(e)).modal("hide"),l.metricLoginAction("login",{action:"close modal"})},c.clickOutside=function(e,t){e.target.id===t&&c.hideModal(t)},c.clickOutsideCall=function(e,t,n){e.target.id===t&&c.hideModalCall(t,n)},c.submitForm=function(e){if(!e.$invalid)switch(c.stepRegister){case 1:e.$setPristine(),e.$setUntouched(),c.verifyEmail();break;case 2:c.loginWithEmailAndPassword(e);break;case 3:c.createUserWithEmailAndPassword(e);break;case 4:c.recoveryPassword()}},c.forgotPasswordForm=function(e){c.currentErrorMsg="",e.$setPristine(),e.$setUntouched(),c.recoveryPassword(),c.stepRegister=4},c.verifyEmail=Jr(Kr().mark((function t(){var n;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.loadingSession=!0,(n=Hr(y)).languageCode=m.language,t.prev=3,t.next=6,Sn(n,c.userData.email,"///0000");case 6:t.sent,e.$apply((function(){c.loadingSession=!1,c.stepRegister=2})),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),e.$apply((function(){c.loadingSession=!1,"auth/user-not-found"===t.t0.code||"EMAIL_NOT_FOUND"===t.t0.code?c.stepRegister=3:c.stepRegister=2}));case 13:case"end":return t.stop()}}),t,null,[[3,10]])}))),c.createUserWithEmailAndPassword=Jr(Kr().mark((function t(){var n,r;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.loadingSession=!0,(n=Hr(y)).languageCode=m.language,t.prev=3,t.next=6,In(n,c.userData.email,c.userData.password);case 6:r=t.sent,e.$apply(Jr(Kr().mark((function t(){var n,o;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.user,c.isResendCurrenUser=!1,t.prev=2,t.next=5,T(n.uid,!0,c.userData.recatcha);case 5:return o={url:m.siteUrl+"/"+v.cultureCode+"/login",handleCodeInApp:!0},t.prev=6,t.next=9,Pn(n,o);case 9:l.metricLoginAction("login",{action:"create account email"}),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(6),e.$apply((function(){c.loadingSession=!1,c.currentErrorMsg=s[t.t0.code]||g.errorVerification,l.metricsErrorsLogin(t.t0.code||c.currentErrorMsg)}));case 15:t.next=20;break;case 17:t.prev=17,t.t1=t.catch(2),e.$apply((function(){c.loadingSession=!1,c.currentErrorMsg=s[t.t1.code]||g.errorConfigSesion,l.metricsErrorsLogin(t.t1.code||c.currentErrorMsg)}));case 20:c.loadingSession=!1;case 21:case"end":return t.stop()}}),t,null,[[2,17],[6,12]])})))),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),e.$apply((function(){c.loadingSession=!1,c.currentErrorMsg=s[t.t0.code]||g.errorLogin,l.metricsErrorsLogin(t.t0.code||c.currentErrorMsg),c.stepRegister=3}));case 13:case"end":return t.stop()}}),t,null,[[3,10]])}))),c.goToStepOne=function(){c.stepRegister=1,c.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(){c.userData.recatcha=""}))}),a),c.userData.recatcha=t}))}})}))})),c.loginWithEmailAndPassword=Jr(Kr().mark((function t(){var n,r;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.loadingSession=!0,(n=Hr(y)).languageCode=m.language,t.prev=3,t.next=6,Sn(n,c.userData.email,c.userData.password);case 6:r=t.sent,e.$apply(Jr(Kr().mark((function t(){var o,i;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o=r.user).emailVerified){t.next=7;break}T(o.uid,!1),l.metricLoginAction("login",{action:"login email"}),c.loadingSession=!1,t.next=21;break;case 7:return c.isResendCurrenUser=!0,l.metricsErrorsLogin("Not emailVerified"),i=n.currentUser,t.prev=10,t.next=13,Pn(i);case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(10),e.$apply((function(){c.loadingSession=!1,c.currentErrorMsg=s[t.t0.code]||g.errorVerification,l.metricsErrorsLogin(t.t0.code||c.currentErrorMsg),c.stepRegister=2}));case 18:c.logout(!0),c.stepRegister=7,c.loadingSession=!1;case 21:case"end":return t.stop()}}),t,null,[[10,15]])})))),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),e.$apply((function(){c.loadingSession=!1,c.currentErrorMsg=s[t.t0.code]||g.errorLogin,l.metricsErrorsLogin(t.t0.code||c.currentErrorMsg),c.stepRegister=2}));case 13:case"end":return t.stop()}}),t,null,[[3,10]])}))),c.loginWithProvider=function(){var t=Jr(Kr().mark((function t(n){var r,o,i;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:c.loadingSession=!0,(r=Hr(y)).languageCode=m.language,t.t0=n,t.next="Google"===t.t0?6:"Facebook"===t.t0?8:10;break;case 6:return o=new ln,t.abrupt("break",13);case 8:return o=new cn,t.abrupt("break",13);case 10:return console.error("Proveedor no admitido"),c.loadingSession=!1,t.abrupt("return");case 13:return t.prev=13,t.next=16,ir(r,o);case 16:i=t.sent,e.$apply((function(){T(i.user.uid,!1),l.metricLoginAction("login",{action:"login ".concat(n)}),c.loadingSession=!1})),t.next=23;break;case 20:t.prev=20,t.t1=t.catch(13),e.$apply((function(){c.currentErrorMsg=s[t.t1.code]||g.errorLogin,l.metricsErrorsLogin(t.t1.code||g.errorLogin),c.stepRegister=1,c.loadingSession=!1}));case 23:case"end":return t.stop()}}),t,null,[[13,20]])})));return function(e){return t.apply(this,arguments)}}(),c.deleteAccount=function(){var t=Hr();t.languageCode=m.language;var n=t.currentUser;n?async function(e){return C(e).delete()}(n).then((function(){e.$apply((function(){l.metricLoginAction("login",{action:"delete account"}),c.logout()}))})).catch((function(t){e.$apply((function(){c.currentErrorMsg=g.errorDeletingAccount+(t.code||g.errorLogin),l.metricsErrorsLogin(t.code||g.errorDeletingAccount)}))})):e.$apply((function(){c.currentErrorMsg=g.noUserLoggedIn}))},c.recoveryPassword=Jr(Kr().mark((function t(){var n,r;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.loadingSession=!0,(n=Hr(y)).languageCode=m.language,r={url:m.siteUrl+"/"+v.cultureCode+"/login",handleCodeInApp:!0},t.prev=4,t.next=7,En(n,c.userData.email,r);case 7:e.$apply((function(){c.loadingSession=!1,l.metricLoginAction("login",{action:"forgot password"})})),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(4),e.$apply((function(){l.metricsErrorsLogin(t.t0.code||g.errorSendingPasswordResetEmail),c.currentErrorMsg=s[t.t0.code]||g.errorLogin,c.loadingSession=!1}));case 13:case"end":return t.stop()}}),t,null,[[4,10]])}))),c.logout=Jr(Kr().mark((function t(){var n,r,o=arguments;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>0&&void 0!==o[0]&&o[0],(r=Hr(y)).languageCode=m.language,t.prev=3,t.next=6,Cn(r);case 6:e.$apply((function(){c.sessionData={isLogin:!1},l.metricLoginAction("login",{action:"sign out"}),n||document.getElementById("logout-form").submit()})),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),e.$apply((function(){c.currentErrorMsg=g.errorSigningOut+(t.t0.code||g.errorLogin),l.metricsErrorsLogin(t.t0.code||g.errorSigningOut)}));case 12:case"end":return t.stop()}}),t,null,[[3,9]])}))),c.reseendVerification=Jr(Kr().mark((function t(){var n,r;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.loadingSession=!0,(n=Hr(y)).languageCode=m.language,r=n.currentUser,t.prev=4,t.next=7,Pn(r);case 7:e.$apply((function(){c.loadingSession=!1})),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(4),e.$apply((function(){c.loadingSession=!1,c.currentErrorMsg=g.errorResendingVerificationEmail+(t.t0.code||g.errorLogin),l.metricsErrorsLogin(t.t0.code||g.errorResendingVerificationEmail)}));case 13:case"end":return t.stop()}}),t,null,[[4,10]])}))),c.continueHome=function(){c.logout(),window.location.href="/"},c.isActive=function(e){return o.path()===e},c.setSessionDataObject=function(e){var t=e.userProfile.name||"";c.sessionData={token:e.token,displayName:t.split(" ")[0]||e.userProfile.contactEmail,uid:e.firebaseId,photoURL:e.image,isLogin:!0},c.userProfile.name=e.userProfile.name||null,c.userProfile.uid=e.firebaseId||null,c.userProfile.contactEmail=e.userProfile.contactEmail||null,c.userProfile.phone=e.userProfile.phone||null,c.userProfile.codePhone=e.userProfile.codePhone||null,c.userProfile.birthdate=e.userProfile.birthdate||null,c.userProfile.nationality=e.userProfile.nationality||null,c.userProfile.placeOfResidence=e.userProfile.placeOfResidence||null,c.userProfile.gender=e.userProfile.gender||null,c.userProfile.createdAt=e.userProfile.createdAt||null,c.userProfile.updatedAt=e.userProfile.updatedAt||null,c.userProfile.deletedAt=e.userProfile.deletedAt||null,c.userProfile.usersId=e.userProfile.usersId||0,c.userProfile.reservations=e.reservation||[],c.userProfile.id=e.id||0,c.avatarConf.avatar=c.userProfile.name?c.userProfile.name.substr(0,1):c.userProfile.contactEmail.substr(0,1),c.avatarConf.color=function(){var e=zr.V.get("user_color");if(!e){var t=["#55c1ee","#5473b7","#5492cc","#fbac00","#fe6900","#ea0074","#573d95"];e=t[Math.floor(Math.random()*t.length)],zr.V.set("user_color",e)}return e}(),c.setStyleAvatar(c.sessionData.photoURL,c.avatarConf),zr.V.set("user",c.sessionData)},c.setStyleAvatar=function(e,t){c.photoStyle={"background-position":"center center","background-size":"cover","background-repeat":"no-repeat","background-color":"rgb("+t.color+")"},e&&(c.photoStyle["background-image"]="url("+e+")")},c.onClosedBanner=function(e){var t=angular.element(document.querySelector("#".concat(e)));t&&(t.css("display","none"),u.getCookie("bannerClosed","true",3))},c.isBannerClosed=function(){return"true"===u.getCookie("bannerClosed")},c.hasError=function(e,t){var n=e[t];return e.$submitted&&n.$invalid},c.isPasswordValid=function(e){return(null==e?void 0:e.length)>=8&&c.containsUppercase(e)&&c.containsNumber(e)},c.containsUppercase=function(e){return/[A-Z]/.test(e)},c.containsNumber=function(e){return/[0-9]/.test(e)},c.submitFormtWrite=function(e){c.userDataWriten.recaptchaToken=grecaptcha.enterprise.getResponse(f).length>0?grecaptcha.enterprise.getResponse(f):null,e.$invalid=!c.userDataWriten.recaptchaToken,!e.$invalid&&c.userDataWriten.phone&&c.userDataWriten.name&&function(e,t){E.apply(this,arguments)}(c.userDataWriten,e)},c.checkLoginParams=function(){var e=d.loginOpen,t=d.loginEmail,r=d.loginTimeout||c.settings.timeOpen;c.settings.autoOpen&&e&&n((function(){c.showModal("modal-login"),$("#navbarNav").addClass("show")}),1e3*r),t&&(c.userData.email=t)},c.sendContentHeader=function(e){l.metricHeaderSelectContent({title:e})},c.openDropdown=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c[e]=!c[e],c[e]&&"dropdown_nav"===e?I():S(),c.dropdown_user,"dropdown_nav"!=e&&window.innerWidth<=991&&(c.dropdown_nav=!1),h.mobile&&c[e]&&t||c.setDatePopupLogin()},c.openDropdownClose=function(e){c[e]=!1},c.setDatePopupLogin=function(){var e=zr.V.get("popup_auto_open");if(!(u.getDate(e)>u.getDate())){var t=u.getDate();t.setDate(t.getDate()+1),zr.V.set("popup_auto_open",t)}},c.onSubmitSettingsForm=function(e){var t=c.settingsForm.url.length,n=c.settingsForm.redirect.length;if(t||n){var r=location.search,o=t?"".concat(c.settingsForm.url).concat(r):"".concat(c.settingsForm.redirect).concat(r),i=document.createElement("form");if(i.setAttribute("method","GET"),i.setAttribute("action",o),l.metricHeaderSelectContentLanguageModal({title:"idioma_moneda"}),n&&!t)new URLSearchParams(location.search).forEach((function(e,t){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",t),n.setAttribute("value",e),i.appendChild(n)}));if(n&&t){var a=document.createElement("input");a.setAttribute("type","hidden"),a.setAttribute("name","redirect"),a.setAttribute("value","".concat(c.settingsForm.redirect).concat(r)),i.appendChild(a)}$("#loader-page").removeClass("d-none"),document.body.appendChild(i),i.submit()}$("#modal_langcurr").modal("hide")},c.onChangeSettings=function(e,t){c.settingsForm[e]=t;var n=c.settingsForm.currency.split("/"),r=n[n.length-1],o=c.settingsForm.language.split("/"),i=o[o.length-1];l.metricHeaderSelectModalOption({title:e,currency:r,language:i});var a={language:"redirect",currency:"url"};a[e]&&(c.settingsForm[a[e]]=t)},c.sendEmailNewsletter=Jr(Kr().mark((function e(){var n,r;return Kr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{c.newsletter.submitCount+=1,n=grecaptcha.enterprise.getResponse(p).length>0,R(c.newsletter.emailUser)?(c.newsletter.showError=!1,n&&(c.newsletter.submitCount=0,r={apiKey:"ayyo9d",userKey:i.get("userKey"),email:c.newsletter.emailUser,domain:location.host,timezone:u.getDate().getTimezoneOffset(),resolution:"".concat(window.screen.width,"x").concat(window.screen.height),url:location.href,referrer:document.referrer||"",widget_ready:!0},l.newsLetter(c.newsletter.emailUser),t.post("https://tiquetesbaratos.user.com/api/v2/user-chatping/",r).then(function(){var e=Jr(Kr().mark((function e(t){return Kr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.newsletter.showError=!1,c.newsletter.emailUser="",grecaptcha.enterprise.reset(),c.newsletter.submitCount=0;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()))):c.newsletter.showError=!0}catch(e){console.log(e)}case 1:case"end":return e.stop()}}),e)}))),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?P("right"):n<t&&P("left"),t=n}))}))})),function(){var n,r=d.coupon,o=u.getCookie("codept"),i=r||o;if(u.setCookie("codept",i,"1"),c.iscodept=!!i,c.iscodept&&(n=i,t.get("/v1/api/GetCoupon?DiscountCode=".concat(n)).then((function(e){"null"!=e.data?c.codeData=e.data:c.codeData={}})).catch((function(e){console.error("Error al obtener los datos del cupón:",e),c.codeData={}}))),window.__pt.settings.site.login&&window.__pt.settings.site.login.main.active&&(function(){var e=u.getCookie("session_token");if(e&&e.length>0)return!0;return!1}()&&window.__pt.user?(c.setSessionDataObject(window.__pt.user),window.location.pathname==v.cultureCode+"/login"&&(window.location.href="/"+v.cultureCode)):"/login/perfil"==window.location.pathname&&(window.location.href=v.cultureCode+"/login")),"tiquetesbaratos"==h.siteName&&window.grecaptcha&&"login"!=window.__pt.settings.page&&(grecaptcha.enterprise.ready((function(){var t=document.getElementById("g-recaptcha-newsletter");t&&(t.querySelector("iframe")||(p=grecaptcha.enterprise.render("g-recaptcha-newsletter",{sitekey:"6Lfl5-8eAAAAAECHbOBAyrnsbQah1X5kthYKYyvq",callback:function(t){e.$apply((function(){setTimeout((function(){e.$apply((function(){c.newsletter.recatcha=""}))}),a),c.newsletter.recatcha=t}))}})))})),grecaptcha.enterprise.ready((function(){document.querySelector("#g-recaptcha iframe")||(f=grecaptcha.enterprise.render("g-recaptcha",{sitekey:"6Lfl5-8eAAAAAECHbOBAyrnsbQah1X5kthYKYyvq"}))}))),"es-mx"===v.cultureCode&&!c.loadingSession){var s=zr.V.get("popup_auto_open");if(u.getDate()>u.getDate(s)){c.dropdown_user=!0;var l=setTimeout((function(){c.dropdown_user&&$("#btn_start_session").click(),clearTimeout(l)}),1e4)}}}()}window.app.controller("LoginController",Qr),Qr.$inject=["$scope","$http","$timeout","$location","localStorageService"]})()})();
//# sourceMappingURL=detail-controllers.min.js.map