PageSourceSearch

https://www.yotel.com/themes/custom/yotel/build/694.bundle.js?tm6jaf

js yotel.com collected 2026-10-02 03:03:55 UTC 13,675 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkyotel=self.webpackChunkyotel||[]).push([[694],{7914:(t,e,o)=>{o.d(e,{Z:()=>y});var n=o(6113),i=o(7114),a=o(4735),r=o(2432),c=o(7294),l=o(7505);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function p(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==s(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var n=o.call(t,"string");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===s(i)?i:String(i)),n)}var i}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(r,t);var e,o,n,i,a=(n=r,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(n);if(i){var o=d(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=a.call(this,t)).state={filter:""},e}return e=r,(o=[{key:"onLocationClick",value:function(t){this.props.setLocation(t),this.props.setCalendarData([],[]),this.props.goToNext()}},{key:"onCloseClick",value:function(t){this.props.hideOverlay(),$(document.body).removeClass("overlay-displayed"),$(document.body).css("top","auto")}},{key:"handleFilter",value:function(t){this.setState({filter:t.target.value})}},{key:"render",value:function(){var t=this,e=window.drupalSettings.locations.filter((function(e){return e.name.toLowerCase().includes(t.state.filter.toLowerCase())&&"1"!==e.hide_from_listings}));return c.createElement("div",{className:"yot-location-search__step yot-location-search__location-selector"},c.createElement("div",{className:"yot-location-search__step__header"},c.createElement("div",{className:"yotel-form"},c.createElement("div",{className:"input-field col s6"},c.createElement("input",{placeholder:(0,l.Z)("Find your Yotel"),onChange:this.handleFilter.bind(this),id:"filter",type:"text"}),c.createElement("button",{type:"button",className:"yotel-btn--no-style yotel-link",onClick:this.onCloseClick.bind(this)},(0,l.Z)("Close"))))),c.createElement("ul",{className:"yot-location-search__location-selector__list"},e.map((function(e){return c.createElement("li",{key:e.drupalId,className:location&&e.drupalId==location.drupalId?"is-active":"",onClick:t.onLocationClick.bind(t,e)},c.createElement("i",{className:"yot-brand-icon yot-brand-icon--".concat(e.brand)}),c.createElement("div",null,c.createElement("p",{className:"semi-bold"},e.name),c.createElement("p",null,e.country),c.createElement("p",{className:"semi-bold"},e.status)))}))))}}])&&p(e.prototype,o),Object.defineProperty(e,"prototype",{writable:!1}),r}(c.Component);const y=(0,n.$j)((function(t,e){return{location:t.search.location}}),(function(t){return{setLocation:function(e){t((0,i.l6)(e))},goToNext:function(){t((0,a.SZ)("date-picker"))},hideOverlay:function(){t((0,r.Jz)({isOverlayDisplayed:!1}))},setCalendarData:function(e,o){t((0,i.k2)(e,o))}}}))(f)},7737:(t,e,o)=>{o.d(e,{Z:()=>f});var n=o(6113),i=o(7114),a=o(2432),r=o(7294),c=o(7505);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==l(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var n=o.call(t,"string");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===l(i)?i:String(i)),n)}var i}
1function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}o(5559);var d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(d,t);var e,o,n,i,a=(n=d,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=u(n);if(i){var o=u(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function d(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),(e=a.call(this,t)).state={locationFilter:"",activeLocationIndex:-1},e.popup=r.createRef(),e.segment=r.createRef(),e.input=r.createRef(),e.keyboardTogglePending=!1,e}return e=d,o=[{key:"componentDidUpdate",value:function(t,e){this.props.displayPopup&&!t.displayPopup&&(this.input.current.focus(),this.syncActiveIndexWithSelection()),!this.props.displayPopup&&t.displayPopup&&-1!==this.state.activeLocationIndex&&this.setState({activeLocationIndex:-1}),this.props.displayPopup&&this.props.location!==t.location&&this.state.locationFilter===e.locationFilter&&this.syncActiveIndexWithSelection(),this.props.displayPopup&&this.state.activeLocationIndex!==e.activeLocationIndex&&this.scrollActiveOptionIntoView()}},{key:"onSegmentClick",value:function(t){t.preventDefault(),this.keyboardTogglePending?this.keyboardTogglePending=!1:(this.props.updateLocationPopupDisplay(!this.props.displayPopup),this.props.displayPopup&&this.input.current.focus())}},{key:"onLocationClick",value:function(t){this.props.setLocation(t),this.props.updateLocationPopupDisplay(!this.props.displayPopup),this.props.openDatePickerPopup()}},{key:"onLocationKeyDown",value:function(t,e){32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),this.props.setLocation(e),this.setState({displayPopup:!1}))}},{key:"onKeyPressed",value:function(t){var e=document.activeElement===this.input.current;32!==t.keyCode&&13!==t.keyCode||e||(t.preventDefault(),t.stopPropagation(),this.keyboardTogglePending=!0,this.props.updateLocationPopupDisplay(!this.props.displayPopup)),"Escape"===t.key&&this.props.displayPopup&&(t.preventDefault(),t.stopPropagation(),this.props.updateLocationPopupDisplay(!1))}},{key:"handleInputChange",value:function(t){var e=t.target.value,o=this.getFilteredLocations(e);this.setState({locationFilter:e,activeLocationIndex:this.getDefaultActiveIndex(o)})}},{key:"resetLocation",value:function(){this.props.setLocation(null)}},{key:"getFilteredLocations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=null!==t?t:this.state.locationFilter;return window.drupalSettings.locations.filter((function(t){return t.name.toLowerCase().includes(e.toLowerCase())&&"1"!==t.hide_from_listings}))}},{key:"getDefaultActiveIndex",value:function(t){var e=this.props.location;if(!t.length)return-1;if(e){var o=t.findIndex((function(t){return t.drupalId===e.drupalId}));if(-1!==o)return o}return 0}},{key:"syncActiveIndexWithSelection",value:function(){var t=this.getFilteredLocations(),e=this.getDefaultActiveIndex(t);e!==this.state.activeLocationIndex&&this.setState({activeLocationIndex:e})}},{key:"handleInputKeyDown",value:function(t){var e=this.getFilteredLocations(),o=e.length>0;switch(t.key){case"ArrowDown":if(!this.props.displayPopup||!o)return;t.preventDefault(),this.setState((function(t){return o?{activeLocationIndex:t.activeLocationIndex>=e.length-1||t.activeLocationIndex<0?0:t.activeLocationIndex+1}:null}));break;case"ArrowUp":if(!this.props.displayPopup||!o)return;t.preventDefault(),this.setState((function(t){return o?{activeLocationIndex:t.activeLocationIndex<=0||t.activeLocationIndex>e.length-1?e.length-1:t.activeLocationIndex-1}:null}));break;case"Enter":this.props.displayPopup&&o&&this.state.activeLocationIndex>=0&&e[this.state.activeLocationIndex]&&(t.preventDefault(),this.onLocationClick(e[this.state.activeLocationIndex]));break;case"Escape":this.props.displayPopup&&(t.preventDefault(),this.props.updateLocationPopupDisplay(!1))}}},{key:"scrollActiveOptionIntoView",value:function(){if(this.popup.current){var t=this.getFilteredLocations(),e=this.state.activeLocationIndex;if(!(e<0||e>=t.length)){var o="location_option_".concat(t[e].drupalId),n=this.popup.current.querySelector("#".concat(o));n&&requestAnimationFrame((function(){n.scrollIntoView&&n.scrollIntoView({block:"nearest"})}))}}}},{key:"render",value:function(){var t=this,e=this.props.location,o=this.getFilteredLocations(),n=this.state.activeLocationIndex>=0&&this.state.activeLocationIndex<o.length?this.state.activeLocationIndex:-1,i=this.props.displayPopup&&-1!==n?"location_option_".concat(o[n].drupalId):void 0,a="";return this.state.locationFilter.length>0&&(a=o.length>0?"".concat(o.length," ").concat(1===o.length?"result found":"results found"):"No results found"),r.createElement("div",{className:"yot-location-search__location-selector yot-location-search__segment ".concat(this.props.displayPopup?"is-active":""),onKeyDown:this.onKeyPressed.bind(this),onClick:this.onSegmentClick.bind(this),role:"button",tabIndex:"0",ref:this.segment},r.createElement("div",{className:"yot-location-search__segment__click-target 1"}),r.createElement("div",null,r.createElement("p",{className:"x-small purple"},(0,c.Z)("Location")),e&&!this.props.displayPopup&&r.createElement("p",{className:"x-small"},e.name),!e&&!this.props.displayPopup&&r.createElement("p",{className:"x-small"},(0,c.Z)("Find your YOTEL")),e&&r.createElement("button",{className:"yotel-btn--no-style yot-location-search__date-picker__close-overlay",type:"button","aria-label":(0,c.Z)("Clear selected location."),onClick:this.resetLocation.bind(this),onKeyDown:function(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}},r.createElement("i",{className:"icon-close"})),r.createElement("input",{type:"text",name:"location",className:"small ".concat(this.props.displayPopup?"is-active":""),value:this.state.locationFilter,onChange:this.handleInputChange.bind(this),ref:this.input,"aria-label":"Location",role:"combobox","aria-autocomplete":"list","aria-expanded":this.props.displayPopup,"aria-controls":"location_selector_listbox","aria-activedescendant":i,onKeyDown:this.handleInputKeyDown.bind(this)}),r.createElement("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true"},a)),this.props.displayPopup&&r.createElement("div",{className:"yot-location-search__segment__popup",id:"location_popup",ref:this.popup},o.length>0?r.createElement("ul",{className:"yot-location-search__location-selector__list",id:"location_selector_listbox",role:"listbox"},o.map((function(o,i){var a="location_option_".concat(o.drupalId),c=i===n,l=e&&o.drupalId===e.drupalId;return r.createElement("li",{key:o.drupalId,id:a,className:c||l?"is-active":"",role:"option","aria-selected":l,onClick:t.onLocationClick.bind(t,o),onKeyDown:function(e){t.onLocationKeyDown(e,o)},tabIndex:"0"},r.createElement("i",{className:"yot-brand-icon yot-brand-icon--".concat(o.brand)}),r.createElement("div",null,r.createElement("p",{className:"semi-bold"},o.name),r.createElement("p",{className:"small"},o.country),o.status&&r.createElement("p",{className:"status semi-bold small"},o.status)))}))):r.createElement("div",{className:"no-results",role:"status"},(0,c.Z)("No results found"))))}}],o&&s(e.prototype,o),Object.defineProperty(e,"prototype",{writable:!1}),d}(r.Component);const f=(0,n.$j)((function(t,e){return{location:t.search.location,displayPopup:t.ux.displayLocationSearchPopup}}),(function(t){return{setLocation:function(e){!e||e.platform&&e.id?t((0,i.l6)(e)):window.location=e.url,t((0,i.k2)([],[]))},updateLocationPopupDisplay:function(e){t((0,a.v7)({displayLocationSearchPopup:e}))},openDatePickerPopup:function(){t((0,a.v7)({displayDatepickerPopup:!0}))}}}))(d)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.