/*! For license information please see customelements.mjs.LICENSE.txt */ !function(e){var t={};function s(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(i,r,function(t){return e[t]}.bind(null,r));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=0)}([function(e,t,s){"use strict";s.r(t);var i="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,r=function(e,t){for(var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t!==s;){var i=t.nextSibling;e.removeChild(t),t=i}},n="{{lit-".concat(String(Math.random()).slice(2),"}}"),a="\x3c!--".concat(n,"--\x3e"),o=new RegExp("".concat(n,"|").concat(a));class l{constructor(e,t){this.parts=[],this.element=t;for(var s=[],i=[],r=document.createTreeWalker(t.content,133,null,!1),a=0,l=-1,h=0,{strings:p,values:{length:_}}=e;h<_;){var g=r.nextNode();if(null!==g){if(l++,1===g.nodeType){if(g.hasAttributes()){for(var v=g.attributes,{length:m}=v,y=0,f=0;f0;){var b=p[h],S=u.exec(b)[2],w=S.toLowerCase()+"$lit$",x=g.getAttribute(w);g.removeAttribute(w);var A=x.split(o);this.parts.push({type:"attribute",index:l,name:S,strings:A}),h+=A.length-1}}"TEMPLATE"===g.tagName&&(i.push(g),r.currentNode=g.content)}else if(3===g.nodeType){var C=g.data;if(C.indexOf(n)>=0){for(var P=g.parentNode,N=C.split(o),T=N.length-1,E=0;E{var s=e.length-t.length;return s>=0&&e.slice(s)===t},h=e=>-1!==e.index,d=()=>document.createComment(""),u=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function p(e,t){for(var{element:{content:s},parts:i}=e,r=document.createTreeWalker(s,133,null,!1),n=g(i),a=i[n],o=-1,l=0,c=[],h=null;r.nextNode();){o++;var d=r.currentNode;for(d.previousSibling===h&&(h=null),t.has(d)&&(c.push(d),null===h&&(h=d)),null!==h&&l++;void 0!==a&&a.index===o;)a.index=null!==h?-1:a.index-l,a=i[n=g(i,n)]}c.forEach(e=>e.parentNode.removeChild(e))}var _=e=>{for(var t=11===e.nodeType?0:1,s=document.createTreeWalker(e,133,null,!1);s.nextNode();)t++;return t},g=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,s=t+1;s"function"==typeof e&&v.has(e),y={},f={};class b{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){var t=0;for(var s of this.__parts)void 0!==s&&s.setValue(e[t]),t++;for(var i of this.__parts)void 0!==i&&i.commit()}_clone(){for(var e,t=i?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),s=[],r=this.template.parts,n=document.createTreeWalker(t,133,null,!1),a=0,o=0,l=n.nextNode();ae}),w=" ".concat(n," ");class x{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){for(var e=this.strings.length-1,t="",s=!1,i=0;i-1||s)&&-1===r.indexOf("--\x3e",o+1);var l=u.exec(r);t+=null===l?r+(s?w:a):r.substr(0,l.index)+l[1]+l[2]+"$lit$"+l[3]+n}return t+=this.strings[e]}getTemplateElement(){var e=document.createElement("template"),t=this.getHTML();return void 0!==S&&(t=S.createHTML(t)),e.innerHTML=t,e}}var A=e=>null===e||!("object"==typeof e||"function"==typeof e),C=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class P{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:this.startNode;r(this.startNode.parentNode,e.nextSibling,this.endNode)}}class E{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;m(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=y,e(this)}if(this.__pendingValue!==y){var t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=y}}}class O extends P{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new R(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class R extends N{}var M=!1;(()=>{try{var e={get capture(){return M=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class q{constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;m(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=y,e(this)}if(this.__pendingValue!==y){var t=this.__pendingValue,s=this.value,i=null==t||null!=s&&(t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive),r=null!=t&&(null==s||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=V(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=y}}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}var V=e=>e&&(M?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);function k(e){var t=D.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},D.set(e.type,t));var s=t.stringsArray.get(e.strings);if(void 0!==s)return s;var i=e.strings.join(n);return void 0===(s=t.keyString.get(i))&&(s=new l(e,e.getTemplateElement()),t.keyString.set(i,s)),t.stringsArray.set(e.strings,s),s}var D=new Map,L=new WeakMap;var U=new class{handleAttributeExpressions(e,t,s,i){var r=t[0];return"."===r?new O(e,t.slice(1),s).parts:"@"===r?[new q(e,t.slice(1),i.eventContext)]:"?"===r?[new E(e,t.slice(1),s)]:new P(e,t,s).parts}handleTextExpression(e){return new T(e)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");var j=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i"".concat(e,"--").concat(t),H=!0;void 0===window.ShadyCSS?H=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),H=!1);var B=e=>t=>{var s=I(t.type,e),i=D.get(s);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},D.set(s,i));var r=i.stringsArray.get(t.strings);if(void 0!==r)return r;var a=t.strings.join(n);if(void 0===(r=i.keyString.get(a))){var o=t.getTemplateElement();H&&window.ShadyCSS.prepareTemplateDom(o,e),r=new l(t,o),i.keyString.set(a,r)}return i.stringsArray.set(t.strings,r),r},z=["html","svg"],G=new Set,F=(e,t,s)=>{G.add(e);var i=s?s.element:document.createElement("template"),r=t.querySelectorAll("style"),{length:n}=r;if(0!==n){for(var a=document.createElement("style"),o=0;o{z.forEach(t=>{var s=D.get(I(t,e));void 0!==s&&s.keyString.forEach(e=>{var{element:{content:t}}=e,s=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{s.add(e)}),p(e,s)})})})(e);var c=i.content;s?function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{element:{content:i},parts:r}=e;if(null!=s)for(var n=document.createTreeWalker(i,133,null,!1),a=g(r),o=0,l=-1;n.nextNode();){l++;var c=n.currentNode;for(c===s&&(o=_(t),s.parentNode.insertBefore(t,s));-1!==a&&r[a].index===l;){if(o>0){for(;-1!==a;)r[a].index+=o,a=g(r,a);return}a=g(r,a)}}else i.appendChild(t)}(s,a,c.firstChild):c.insertBefore(a,c.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);var h=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==h)t.insertBefore(h.cloneNode(!0),t.firstChild);else if(s){c.insertBefore(a,c.firstChild);var d=new Set;d.add(a),p(s,d)}}else window.ShadyCSS.prepareTemplateStyles(i,e)};function $(e,t,s,i,r,n,a){try{var o=e[n](a),l=o.value}catch(e){return void s(e)}o.done?t(l):Promise.resolve(l).then(i,r)}window.JSCompiler_renameProperty=(e,t)=>e;var J={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},W=(e,t)=>t!==e&&(t==t||e==e),Y={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:W};class K extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();var e=[];return this._classProperties.forEach((t,s)=>{var i=this._attributeNameForProperty(s,t);void 0!==i&&(this._attributeToPropertyMap.set(i,s),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Y;if(this._ensureClassProperties(),this._classProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){var s="symbol"==typeof e?Symbol():"__".concat(e),i=this.getPropertyDescriptor(e,s,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){return{get(){return this[t]},set(i){var r=this[e];this[t]=i,this.requestUpdateInternal(e,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||Y}static finalize(){var e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var t=this.properties,s=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(var i of s)this.createProperty(i,t[i])}}static _attributeNameForProperty(e,t){var s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:W)(e,t)}static _propertyValueFromAttribute(e,t){var s=t.type,i=t.converter||J,r="function"==typeof i?i:i.fromAttribute;return r?r(e,s):e}static _propertyValueToAttribute(e,t){if(void 0!==t.reflect){var s=t.type,i=t.converter;return(i&&i.toAttribute||J.toAttribute)(e,s)}}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){var s=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,s)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,s){t!==s&&this._attributeToProperty(e,s)}_propertyToAttribute(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,i=this.constructor,r=i._attributeNameForProperty(e,s);if(void 0!==r){var n=i._propertyValueToAttribute(t,s);if(void 0===n)return;this._updateState=8|this._updateState,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(!(8&this._updateState)){var s=this.constructor,i=s._attributeToPropertyMap.get(e);if(void 0!==i){var r=s.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=s._propertyValueFromAttribute(t,r),this._updateState=-17&this._updateState}}}requestUpdateInternal(e,t,s){var i=!0;if(void 0!==e){var r=this.constructor;s=s||r.getPropertyOptions(e),r._valueHasChanged(this[e],t,s.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==s.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,s))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}_enqueueUpdate(){var e,t=this;return(e=function*(){t._updateState=4|t._updateState;try{yield t._updatePromise}catch(e){}var e=t.performUpdate();return null!=e&&(yield e),!t._hasRequestedUpdate},function(){var t=this,s=arguments;return new Promise((function(i,r){var n=e.apply(t,s);function a(e){$(n,i,r,a,o,"next",e)}function o(e){$(n,i,r,a,o,"throw",e)}a(void 0)}))})()}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(this._hasRequestedUpdate){this._instanceProperties&&this._applyInstanceProperties();var e=!1,t=this._changedProperties;try{(e=this.shouldUpdate(t))?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}K.finalized=!0;var Q=Element.prototype;Q.msMatchesSelector||Q.webkitMatchesSelector;var X=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Z=Symbol();class ee{constructor(e,t){if(t!==Z)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(X?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");var te,se,ie,re,ne,ae,oe,le,ce,he,de,ue,pe,_e,ge,ve,me,ye,fe,be,Se,we,xe,Ae,Ce,Pe,Ne={};class Te extends K{static getStyles(){return this.styles}static _getUniqueStyles(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var e=this.getStyles();if(Array.isArray(e)){var t=(e,s)=>e.reduceRight((e,s)=>Array.isArray(s)?t(s,e):(e.add(s),e),s),s=t(e,new Set),i=[];s.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!X){var t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new ee(String(t),Z)}return e})}}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){var e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?X?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){var t=this.render();super.update(e),t!==Ne&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{var t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return Ne}}function Ee(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Te.finalized=!0,Te.render=(e,t,s)=>{if(!s||"object"!=typeof s||!s.scopeName)throw new Error("The `scopeName` option is required.");var i=s.scopeName,n=L.has(t),a=H&&11===t.nodeType&&!!t.host,o=a&&!G.has(i),l=o?document.createDocumentFragment():t;if(((e,t,s)=>{var i=L.get(t);void 0===i&&(r(t,t.firstChild),L.set(t,i=new T(Object.assign({templateFactory:k},s))),i.appendInto(t)),i.setValue(e),i.commit()})(e,l,Object.assign({templateFactory:B(i)},s)),o){var c=L.get(l);L.delete(l);var h=c.value instanceof b?c.value.template:void 0;F(i,l,h),r(t,t.firstChild),t.appendChild(l),L.set(t,c)}!n&&a&&window.ShadyCSS.styleElement(t.host)},Te.shadowRootOptions={mode:"open"};class Oe extends Te{static get properties(){return{id:{type:String},settings:{type:Object},occupancy:{type:Object,reflect:!0},occupancyCopy:{type:Object},passengers:{type:Number,reflect:!0},totalAdults:{type:Number},totalChildren:{type:Number},rooms:{type:Number,reflect:!0},childrenAges:{type:Array}}}constructor(){super(),this.settings={rooms:{min:1,max:4,rooms_max_diff:3,def:0},adults:{min:2,max:9,def:1},children:{min:0,max:9,babies_max:9,def:0},ages:{min:2,max:13,less:!0,def:0},errors:{babies:"La combinación de viajeros no está permitida. Para hacer la reserva póngase en contacto con nosotros.",rooms:"La combinación de viajeros no está permitida. Para hacer la reserva póngase en contacto con nosotros.",ages:"Debes indicar la edad de los niños",max_passenger:"La combinación de viajeros no está permitida",max_room_occupants:"La combinación de viajeros no está permitida. Para hacer la reserva póngase en contacto con nosotros",children_per_adult:"La combinación de pasajeros no está permitida. No puede haber más del doble de niños que de adultos en una misma reserva.",babies_per_adult:"No es posible realizar una reserva con más de un bebé por cada adulto.",invalid_occupancy:"La combinación de viajeros no está permitida.Para hacer la reserva póngase en contacto con nosotros."},labels:{rooms_text:"Habitaciones",room_text:"Habitación",adults_text:"Adultos",children_text:"Niños",person_text:"Persona",people_text:"Personas",children_age_text:"Edad",ages_text:"años",childs_age_text:"Niño",child_age_label:"Edad niño",children_age_label:"Edad niños",close_layer_text:"Cerrar",done_layer_text:"Hecho",delete_room_text:"Eliminar",add_room_text:"Añadir habitación",no_chidren_text:"¿Viajas con niños? Contáctanos y te ayudaremos."},cookie:"transport_flight",max_passengers:9,max_room_occupants:0,children_per_adult:2,babies_per_adult:1,invalid_occupancies:{},newSearcher:!0},this.occupancy=[{adults:2,children:0,ages:[]}],this.occupancyCopy=[],this.passengers=2,this.totalAdults=2,this.totalChildren=0,this.rooms=0,this.childrenAges=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.totalAdults=this._countAdults(),this.totalChildren=this._countChildren(),this.passengers=this._countPassengers(),this.rooms=this.settings.rooms.def}updated(e){e.has("rooms")&&(this._checkRooms(),this._focusRooms()),e.has("occupancy")&&(this._validateAges(),this._focusAges()),this.totalAdults=this._countAdults(),this.totalChildren=this._countChildren(),this.passengers=this._countPassengers()}_toggleMenu(){var e=this;e.querySelector(".searchDropdown").classList.add("transitioning"),setTimeout((function(){e.querySelector(".searchDropdown").classList.remove("transitioning"),e.querySelector(".searchDropdown").classList.toggle("hidden"),e.querySelector(".searchDropdown").classList.contains("hidden")?e.querySelector(".searchToggle__btn").setAttribute("aria-expanded","false"):(e._evalDirectionDrop(),e.querySelector(".searchToggle__btn").setAttribute("aria-expanded","true")),document.body.classList.toggle("sm-no-scroll")}),10)}_saveChangesAndToggle(e){e.stopPropagation(),e.preventDefault(),this._validateAges()&&(this.occupancyCopy=JSON.parse(JSON.stringify(this.occupancy)),this._countRooms(),this._toggleMenu())}_evalDirectionDrop(){var e=this.querySelector(".searchDropdown"),t=this.querySelector(".searchToggle__btn"),s=document.querySelector("header"),i=0;s&&(i=s.offsetHeight);var r=window.innerHeight,n=window.pageYOffset,a=0;a=n<=i?i-n:0,e.classList.remove("searchDropup");var o=e.getBoundingClientRect().top+window.pageYOffset;this.rooms<=1&&(o+e.offsetHeight>r+n&&e.offsetHeight0&&this.querySelector(".searchGroup.changed").classList.remove("changed"),i.classList.add("changed"),this._validateAgesRoom(s)}_childrenDecrement(e){e.stopPropagation();var t=e.target,s=this._getRoomIndex(t);this.occupancy[s].children--,this.occupancy[s].ages.pop(),this.occupancy=[...this.occupancy]}_toggleErrorClass(e,t){t?e.classList.add("has_error"):e.classList.remove("has_error")}_ageUpdate(e){var t=e.target,s=parseInt(t.value),i=this._getRoomIndex(t),r=t.parentNode.querySelectorAll(".searchAddAge__select"),n=Array.prototype.indexOf.call(r,t);this.occupancy[i].ages[n]=s,this.occupancy=[...this.occupancy]}_addRoom(e){if(e.stopPropagation(),this.rooms0&&(this.rooms=this.occupancy.length)}_checkChildrenPerAdult(e){var t=this.occupancy[e].adults*this.settings.children_per_adult;if(0!==this.settings.children_per_adult&&t<=this.occupancy[e].children){this.occupancy[e].children;this.occupancy[e].children=t,this.occupancy[e].ages.length=t,this.occupancy=[...this.occupancy]}}_loopAges(){this.childrenAges=[];for(var e=this.settings.ages.min;e<=this.settings.ages.max;e++)this.childrenAges.push(e)}_countPassengers(){return this._countAdults()+this._countChildren()}_countAdults(){return this.occupancy.reduce((e,t)=>e+parseInt(t.adults),0)}_countChildren(){return this.occupancy.reduce((e,t)=>e+parseInt(t.children),0)}_getRoomIndex(e){var t=e;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});var s=t.closest(".searchGroup"),i=s.parentNode;return Array.prototype.indexOf.call(i.children,s)}_focusAges(){if(this.querySelectorAll(".searchGroup.changed").length>0&&this.querySelectorAll(".searchGroup.changed")[0].querySelectorAll(".searchAddAge__items").length>0){var e=this.querySelectorAll(".searchGroup.changed")[0].querySelectorAll(".searchAddAge__items")[0].querySelectorAll(".searchAddAge__select").length-1;this.querySelectorAll(".searchGroup.changed")[0].querySelectorAll(".searchAddAge__items")[0].querySelectorAll(".searchAddAge__select")[e].focus()}}_focusRooms(){this.querySelectorAll(".searchGroup").length>0&&this.querySelectorAll(".searchGroup")[this.rooms-1].querySelector(".searchCounter__btn--plus").focus()}_conditionDisableLessAdults(e){return this.occupancy[e].adults<=this.settings.adults.min}_conditionDisableMoreAdults(e){var t=!1;return(0!==this.settings.max_passengers&&this.passengers>=this.settings.max_passengers||this.totalAdults>=this.settings.adults.max||0!==this.settings.max_room_occupants&&this.occupancy[e].adults+this.occupancy[e].children>=this.settings.max_room_occupants)&&(t=!0),t}_conditionDisableLessChildren(e){return this.occupancy[e].children<=this.settings.children.min}_conditionDisableMoreChildren(e){var t=!1;return(0!==this.settings.max_passengers&&this.passengers>=this.settings.max_passengers||this.totalChildren>=this.settings.children.max||0!==this.settings.max_room_occupants&&this.occupancy[e].adults+this.occupancy[e].children>=this.settings.max_room_occupants||0!==this.settings.children_per_adult&&this.occupancy[e].adults*this.settings.children_per_adult<=this.occupancy[e].children)&&(t=!0),t}_conditionEnableAddRoom(){var e=!1;return this.rooms>0&&(0!==this.settings.max_passengers&&this.passengers>=this.settings.max_passengers?e=!1:this.rooms