1(window.webpackJsonp=window.webpackJsonp||[]).push([[21,11],{166:function(e,t,n){"use strict";function a(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}n.r(t);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elements=t,this.bindings()}var t,n,o;return t=e,o=[{key:"isAvailable",value:function(){return!(void 0===window.gaKey||null===window.gaKey)}},{key:"isGoogleTagManagerAvailable",value:function(){return void 0!==window.dataLayer}},{key:"send",value:function(t,n,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e.isGoogleTagManagerAvailable())window.dataLayer.push({event:"ga.event",category:t.toLowerCase(),action:n.toLowerCase(),label:a.toLowerCase(),value:o,nonInteraction:r});else if(e.isAvailable())for(var i=0;i<window.gaKey.length;i++)window.ga("".concat(i,".send"),"event",t.toLowerCase(),n.toLowerCase(),a.toLowerCase(),o,{nonInteraction:r})}}],(n=[{key:"bindings",value:function(){for(var e=this,t=function(t){e.elements[t].addEventListener("click",function(n){return e.event(n,e.elements[t])})},n=0;n<this.elements.length;n++)t(n)}},{key:"event",value:function(t,n){var a=n.getAttribute("data-ga-action")||"click",o=n.getAttribute("data-ga-category"),r=n.getAttribute("data-ga-label")||n.innerText.trim(),i=parseInt(n.getAttribute("data-ga-value"),10)||0,c="true"===n.getAttribute("data-ga-non-interaction");e.send(o,a,r,i,c),"booking"===n.getAttribute("data-target")&&this.sendLiveresEvent()}},{key:"sendLiveresEvent",value:function(){if(e.isGoogleTagManagerAvailable())window.dataLayer.push({event:"ga.pageview",page:"/Liveres/Start",title:"Booking Start"});else if(e.isAvailable())for(var t=0;t<window.gaKey.length;t++)ga("".concat(t,".send"),{hitType:"pageview",page:"/Liveres/Start",title:"Booking Start"})}}])&&a(t.prototype,n),o&&a(t,o),e}();t.default=o},168:function(e,t,n){"use strict";function a(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}n.d(t,"a",function(){return o});var o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null!=t&&(this.elements=t,this.handlers=document.querySelectorAll(".js-modal-handler"),this.findHandles(this.handlers))}var t,n,o;return t=e,(n=[{key:"findHandles",value:function(e){var t=this;if(e.length>0)for(var n=function(n){e[n].addEventListener("click",function(a){return t.detectInteraction(a,e[n])})},a=0;a<e.length;a++)n(a)}},{key:"detectInteraction",value:function(e,t){e.preventDefault();var n=t.dataset.action,a=t.dataset.target,o=t.dataset.liveres,r=document.querySelector('.js-modal[data-identifier="'.concat(a,'"]')),i=document.querySelector(".js-liveres-booking"),c=document.querySelector("#booking-modal");if(r)if("open"===n){if(this.open(r),"booking"===a){var s=document.querySelector(".js-nav-toggle");s&&!s.classList.contains("is-active")&&(s.setAttribute("aria-expanded",String(!0)),s.classList.toggle("is-active"),""!==o&&void 0!==o&&(i.src=o,c.classList.add("is-liveres-booking"),i.style.display="block"))}}else"close"===n&&this.close(r)}},{key:"open",value:function(e){e.classList.add("is-active")}},{key:"close",value:function(e){e.classList.remove("is-active"),document.querySelector(".js-liveres-booking").style.display="none",document.querySelector("#booking-modal").classList.toggle("is-liveres-booking")}}])&&a(t.prototype,n),o&&a(t,o),e}()},169:function(e,t,n){"use strict";function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=e.key;"Enter"!==a&&" "!==a||(e.preventDefault(),t(n))}n.d(t,"a",function(){return a})},204:function(e,t,n){"use strict";n.r(t);var a=n(150),o=n(156),r=n.n(o),i=n(166),c=n(151),s=n.n(c),l=n(168);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})(e)}function h(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return function(){var t,n=p(e);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()){var a=p(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return function(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,t)}}
1function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(i,a["a"]);var t,n,o,r=d(i);function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).setState({showImage:!1,isVisible:!1}),e}return t=i,(n=[{key:"componentDidMount",value:function(){this.createObserver()}},{key:"createObserver",value:function(){var e=this;window.IntersectionObserver?(this.io=new IntersectionObserver(function(t){e.setState({isVisible:t[0].isIntersecting})},{}),this.io.observe(this.container)):this.setState({showImage:!0})}},{key:"checkShowImage",value:function(){var e=this.state,t=e.showImage,n=e.isVisible;!1===t&&n&&(this.setState({showImage:!0}),this.io.disconnect())}},{key:"renderDistance",value:function(e){if(e.distance)return Object(a.b)("p",{className:"t-align--center"},parseFloat(e.distance).toFixed(2)," miles away")}},{key:"renderImage",value:function(e){var t=this.state.showImage,n=!!window.MSInputMethodContext&&!!document.documentMode,o="";return t&&(o=e.image),n?Object(a.b)("div",{className:"c-locations-card__image-bg",style:"background-image: url('".concat(o,"')")}):Object(a.b)("img",{className:"o-img o-img--cover is-loaded",src:o,alt:e.alt})}},{key:"handleBookClick",value:function(e){(new l.a).detectInteraction(e,this.cardButton)}},{key:"renderBookButton",value:function(){var e=this,t=this.props.location;return t.hide_book_now?Object(a.b)("a",{className:"c-btn c-btn--grid"},Object(a.b)("span",null,"Coming Soon")):Object(a.b)("a",{className:"c-btn c-btn--grid",ref:function(t){e.cardButton=t},href:"/reservations?location=".concat(t.name)},Object(a.b)("span",null,"Book Now"))}},{key:"render",value:function(){var e=this,t=this.props.location;return this.checkShowImage(),Object(a.b)("div",{className:"c-locations-card",ref:function(t){e.container=t}},Object(a.b)("div",{className:"c-locations-card__holder"},Object(a.b)("a",{href:t.link,target:t.link_open_tab?"_blank":"_self",className:"c-locations-card__image"},this.renderImage(t)),Object(a.b)("div",{className:"c-locations-card__card"},this.renderDistance(t),Object(a.b)("h4",{className:"t-heading t-heading--epsilon"},Object(a.b)("a",{href:t.link,target:t.link_open_tab?"_blank":"_self"},t.title)),Object(a.b)("p",{className:"t-paragraph t-paragraph--epsilon"},t.address)),Object(a.b)("div",{className:"c-locations-card__ctas"},Object(a.b)("div",{className:"c-locations-card__seperator"}),this.renderBookButton(),Object(a.b)("a",{className:"c-locations-card__text-cta",href:t.link,target:t.link_open_tab?"_blank":"_self"},Object(a.b)("span",{className:"t-copy t-copy--alpha t-underline t-underline--paprika t-underline--full"},t.cta)))))}}])&&h(t.prototype,n),o&&h(t,o),i}();b.propTypes={location:s.a.shape.isRequired};var v=b,g=n(169);function y(e){return(y="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)}function m(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e){return function(){var t,n=_(e);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()){var a=_(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,t)}}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(i,a["a"]);var t,n,o,r=k(i);function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).setState({inputError:!1}),e}return t=i,(n=[{key:"componentWillReceiveProps",value:function(e){this.props.searchInput;""===e.searchInput?this.setState({inputError:!0}):this.setState({inputError:!1})}},{key:"getOptions",value:function(){var e=["Bistrot Pierre","Pierreâs"],t=this.props.allLocations,n=[];n.push(Object(a.b)("option",{value:"default",disabled:!0},"Please Select...")),n.push(Object(a.b)("option",{value:"all"},"Show All"));for(var o=function(o){var r=e[o],i=[],c=t.filter(function(e){return e.brand===r});if(c.length>0){for(var s=0;s<c.length;s++){var l=c[s];i.push(Object(a.b)("option",{value:l.name},l.title))}n.push(Object(a.b)("optgroup",{label:r},i))}},r=0;r<e.length;r++)o(r);return n}},{key:"handleClick",value:function(){var e=this.state.inputError,t=this.props,n=t.resetSelect,a=t.handleSearch,o=t.searchInput;if(!e){var r="https://api.ideal-postcodes.co.uk/v1/postcodes/".concat(o,"?api_key=ak_kykgdio51H0XvK7KMES
1h6fZq4g6MN");fetch(r,{method:"GET",headers:{Accept:"application/json"}}).then(function(e){return e.json()}).then(function(e){2e3===e.code&&e.total>0?(n(),a({lat:e.result[0].latitude,lng:e.result[0].longitude})):4040===e.code&&alert(e.message)}).catch(function(e){console.error("Error:",e)})}}},{key:"handleSelectChange",value:function(e){var t=this.props.handleSelectChange;t(e)}},{key:"handleInputKeyPress",value:function(e){"Enter"===e.key&&setTimeout(this.handleClick.bind(this),200)}},{key:"renderSearchLocation",value:function(){var e=this,t=this.handleClick.bind(this),n=this.state.inputError,o=this.props,r=o.handleInputChange,i=o.searchInput;return Object(a.b)("div",{className:"c-locations-search__section"},Object(a.b)("h3",{class:"c-locations-search__section-title t-heading t-heading--epsilon"},"Search for a Location"),Object(a.b)("div",{className:"c-locations-search__search-holder"},Object(a.b)("input",{ref:function(t){e.autocompleteInput=t},onChange:r,onKeyPress:this.handleInputKeyPress.bind(this),value:i,className:"".concat(n?"c-locations-search__input--error ":"","c-locations-search__input"),placeholder:"Postcode, location..."}),Object(a.b)("button",{className:"c-locations-search__button c-btn",type:"button",onClick:t,onKeyPress:function(n){return Object(g.a)(n,t.bind(e))}},Object(a.b)("span",{className:"t-heading t-heading--zeta"},"Search"))))}},{key:"renderSelectInput",value:function(){var e=this.getOptions(),t=this.props.activeVenue;return Object(a.b)("div",{className:"c-locations-search__search-holder c-locations-search__search-holder--select o-form__search-holder"},Object(a.b)("select",{className:"c-locations-search__input c-locations-search__input--select",value:t,onChange:this.handleSelectChange.bind(this)},e))}},{key:"renderSelectLocation",value:function(){return Object(a.b)("div",{className:"c-locations-search__section"},Object(a.b)("h3",{className:"c-locations-search__section-title t-heading t-heading--epsilon"},"Search Restaurants"),this.renderSelectInput())}},{key:"render",value:function(){return Object(a.b)("div",{className:"c-locations-search"},this.renderSelectLocation(),Object(a.b)("div",{className:"c-locations-search__middle"},Object(a.b)("span",{className:"t-heading t-heading--epsilon"},"OR")),this.renderSearchLocation())}}])&&m(t.prototype,n),o&&m(t,o),i}();O.propTypes={allLocations:s.a.shape.isRequired,activeVenue:s.a.string.isRequired,searchInput:s.a.string.isRequired,handleSelectChange:s.a.func.isRequired,handleInputChange:s.a.func.isRequired,handleSearch:s.a.func.isRequired,resetSelect:s.a.func.isRequired};var S=O;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})(e)}function C(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){return function(){var t,n=R(e);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()){var a=R(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return function(e,t){if(t&&("object"===j(t)||"function"==typeof t))return t;return N(e)}(this,t)}}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)}(c,a["a"]);var t,n,o,r=I(c);function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=r.call(this,e)).setDefaultState(),t.handleSelectChange=t.handleSelectChange.bind(N(t)),t.handleInputChange=t.handleInputChange.bind(N(t)),t.resetSelect=t.resetSelect.bind(N(t)),t.handleSearch=t.handleSearch.bind(N(t)),t}return t=c,(n=[{key:"setDefaultState",value:function(){var e=this.props.allLocations;this.setState({locations:e,activeVenue:"default",geoLocations:!1,searchInput:""})}},{key:"getCards",value:function(){var e=this.state.locations,t=this.state,n=t.activeVenue,o=t.geoLocations;!1!==o&&(e=o);var r=[];if(e){if("default"!==n&&"all"!==n){var i=e.find(function(e){return e.title===n});return Object(a.b)(v,{location:i})}for(var c=0;c<e.length;c++){var s=e[c];r.push(Object(a.b)(v,{location:s}))}}return 0===r.length?this.renderNoMatches():r}},{key:"handleSearch",value:function(e){this.setState({loading:!0});var t=e.lat,n=e.lng,a=this;fetch("/wp-json/locations/get_locations_from_coords?lat=".concat(t,"&lng=").concat(n)).then(function(e){return e.json()}).then(function(e){a.handleResponseJson(e)}).catch(function(e){return a.handleErrorFetch(e)});var o="region (locations search)",r="input (".concat(this.state.searchInput,")");if(r&&i.default.isAvailable())for(var c=0;c<window.gaKey.length;c++)ga("".concat(c,".send"),"event",o.toLowerCase(),"change",r.toLowerCase())}},{key:"handleResponseJson",value:function(e){try{if(!0!==e.meta.success)throw new Error(e.meta.message);this.handleSuccessResponse(e)}catch(e){this.handleErrorFetch(e)}}},{key:"handleErrorFetch",value:function(e){this.setState({loading:!1}),console.log("Location Fetch Error Occured: ",e)}},{key:"handleInputChange",value:function(e){var t=this;setTimeout(function(){t.setState({searchInput:e.target.value})},0)}},{key:"handleSuccessResponse",value:function(e){this.setState({loading:!1,geoLocations:e.data}),this.scrollCardsToView()}},{key:"handleSelectChange",value:function(e){"all"===e.target.value?this.setState({activeVenue:e.target.value,geoLocations:!1,searchInput:""}):window.open("/locations/".concat(e.target.value.toLowerCase()),"_self");var t="region (locations search)",n="select (".concat(e.target.value,")");if(n&&i.default.isAvailable())for(var a=0;a<window.gaKey.length;a++)ga("".concat(a,".send"),"event",t.toLowerCase(),"change",n.toLowerCase())}},{key:"scrollCardsToView",value:function(){var e=100;window.innerWidth>1200&&(e=75),window.scrollTo({top:this.cardHolder.getBoundingClientRect().top+window.pageYOffset-e,behavior:"smooth"})}},{key:"resetSelect",value:function(){this.setState({activeVenue:"default"})}},{key:"renderNoMatches",value:function(){return Object(a.b)("p",null,"No venues match the search criteria")}},{key:"renderCards",value:function(){var e=this,t=this.getCards();return Object(a.b)("div",{className:"o-row o-row--default"},Object(a.b)("div",{className:"o-container"},Object(a.b)("div",{className:"",ref:function(t){e.cardHolder=t}},Object(a.b)("div",{className:"c-locations-card__grid"},t))))}},{key:"renderLoading",value:function(){var e=this.state.loading;return Object(a.b)("div",{className:"c-locations-search__loading".concat(e?" is-active":""," t-heading t-heading--zeta")},"Loading...")}},{key:"render",value:function(){var e=this.state,t=e.activeVenue,n=e.searchInput,o=this.props.allLocations;return Object(a.b)("div",{className:"c-locations-search__holder"},this.renderLoading(),Object(a.b)("div",{className:"c-locations-search__title"},Object(a.b)("h2",{className:"c-locations-search__heading t-heading t-heading--delta t-underline t-underline--quaternary t-underline--full"},"Find Us")),Object(a.b)(S,{allLocations:o,handleSelectChange:this.handleSelectChange,handleInputChange:this.handleInputChange,handleSearch:this.handleSearch,resetSelect:this.resetSelect,activeVenue:t,searchInput:n}),this.renderCards())}}])&&C(t.prototype,n),o&&C(t,o),c}();E.propTypes={allLocations:s.a.shape.isRequired};var P=E;function T(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}r.a.polyfill();var q=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.checkDefaultData(),this.renderElement()}var t,n,o;return t=e,(n=[{key:"checkDefaultData",value:function(){this.element.dataset.locations?this.allLocations=JSON.parse(this.element.dataset.locations):this.allLocations=!1}},{key:"renderElement",value:function(){Object(a.c)(Object(a.b)(P,{allLocations:this.allLocations}),this.element)}}])&&T(t.prototype,n),o&&T(t,o),e}();t.default=q}}]);
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.