1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[871],{20871:function(e,l,n){"use strict";n.r(l),n.d(l,{default:function(){return I}});var t,i=n(97458),s=n(11658),a=n(52141),o=n(13654),r=n(11938),d=n(78913),c=n(46327),u=n(99372),x=n(2806),m=n(52983),p=n(62122),h=n(4965),f=n(27550),b=n(84506),y=n.n(b);function g(e){let{text:l,name:n,value:t,required:s}=e;return(0,i.jsxs)("div",{className:y().checkbox,children:[(0,i.jsx)("input",{type:"checkbox",name:n,id:"".concat(n).concat(t),value:t,required:s}),(0,i.jsx)("span",{className:y().checkboxBox}),(0,i.jsx)("label",{htmlFor:"".concat(n).concat(t),children:l})]})}var v=n(63557);function j(e){let{placeholder:l,type:n="text",name:t,required:s}=e;return(0,i.jsx)(v.Z,{children:(0,i.jsx)("input",{className:y().input,placeholder:l,type:n,name:t,required:s})})}var k=n(26148),_=n(73356),N=n(87043),E=n.n(N);function D(e){let{children:l,className:n,hideError:t,id:s,options:a,validators:o=[],value:r}=e,[d,...c]=m.Children.toArray(l);if(!m.isValidElement(d))throw Error("Field child is not a valid element.");let{name:u,required:x}=d.props;if(!u)throw Error("Missing 'name' prop on Field child.");let{dropdownContainer:h,...f}=a||{},[b]=function(e){let l=(0,m.useRef)(null),n=(0,m.useRef)();return(0,m.useEffect)(()=>(l.current&&(n.current=E()(l.current,{...e||{}}),window.intlTelInputGlobals=E()),()=>{var e;null==n||null===(e=n.current)||void 0===e||e.destroy()}),[]),[l,n]}({...f,dropdownContainer:"string"==typeof h?document.querySelector(h)||void 0:h}),y=(0,m.useMemo)(()=>{let e=[];return x&&e.push(_.Z),e.push(e=>{if(e&&"string"==typeof e&&(null==b?void 0:b.current)){let e=window.intlTelInputGlobals.getInstance(b.current);if(e&&!1===e.isValidNumberPrecise())return{key:"telephone",value:"Invalid phone number"}}}),e},[b,x]);return(0,i.jsx)(p.gN,{name:u,validate:(0,k.Z)(...y,...o),value:r,children:e=>{var l;let{input:a,meta:o}=e,r=o.error&&o.touched;return(0,i.jsxs)("label",{className:n,"data-error":r,id:s,children:[m.cloneElement(d,{...d.props,...a,ref:b}),c,!t&&r&&(0,i.jsx)("span",{"data-error":r,children:(null===(l=o.error)||void 0===l?void 0:l.value)||o.error})]})}})}function F(e){let{placeholder:l,name:n,required:t}=e;return(0,i.jsx)(D,{options:{initialCountry:"gb",formatAsYouType:!1,formatOnDisplay:!1},className:y().tel,children:(0,i.jsx)("input",{className:y().input,placeholder:l,type:"tel",name:n,required:t})})}function L(e){let{extendedApiFlowWidget:l,placeholder:n,name:t}=e,{isExtendedApiFlow:s}=(0,h.Z)(l);return(0,i.jsx)(v.Z,{children:(0,i.jsx)("textarea",{className:"".concat(y().textarea," ").concat(s?y().extendedTextarea:"").trim(),placeholder:n,name:t})})}var C=n(7253),w=n.n(C);function q(e){let{extendedApiFlowWidget:l,field:n}=e,t=(0,d.Z)(),{isExtendedApiFlow:s}=(0,h.Z)(l);return n.type?"email"===n.type?(0,i.jsx)("div",{className:"".concat(w().flexiField," ").concat(s?w().extendedFlexiField:"").trim(),children:(0,i.jsx)(j,{placeholder:n.placeholder||"",name:n.name,type:"email",required:!!n.required})}):"tel"===n.type?(0,i.jsx)("div",{className:"".concat(w().flexiField," ").concat(s?w().extendedFlexiField:"").trim(),children:(0,i.jsx)(F,{placeholder:n.placeholder||"",name:n.name,required:!!n.required})}):"checkbox"===n.type?(0,i.jsx)("div",{className:"".concat(w().flexiField," ").concat(s?w().extendedFlexiField:"").trim(),children:(0,i.jsx)(g,{text:n.label||"",name:n.name,value:n.value||"",required:!!n.required})}):"textareaEnquiry"===n.type&&t.isEnquiry?(0,i.jsx)("div",{className:w().flexiField,children:(0,i.jsx)(L,{extendedApiFlowWidget:s,placeholder:n.placeholder||"",name:n.name})}):"textareaBook"!==n.type||t.isEnquiry?null:(0,i.jsxs)("div",{className:w().flexiField,children:[n.label&&(0,i.jsx)("label",{className:"".concat(s?w().flexiExtendedLabel:"").trim(),children:n.label}),(0,i.jsx)(L,{extendedApiFlowWidget:s,placeholder:n.placeholder||"",name:n.name})]}):(0,i.jsx)("div",{className:"".concat(w().flexiField," ").concat(s?w().extendedFlexiField:"").trim(),children:(0,i.jsx)(j,{placeholder:n.placeholder||"",name:n.name,required:!!n.required})})}function T(){return(T=Object.assign?Object.assign.bind():function(e){for(var l=1;l<arguments.length;l++){var n=arguments[l];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}var M=function(e){return m.createElement("svg",T({xmlns:"http://www.w3.org/2000/svg",width:26.87,height:26.87},e),t||(t=m.createElement("g",{"data-name":"Nav icon"},m.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:2,d:"M1.414 25.456 25.456 1.414","data-name":"Line 71
15"}),m.createElement("g",{"data-name":"Nav icon"},m.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:2,d:"m1.414 1.414 24.042 24.042","data-name":"Line 715"})))))};function I(e){var l,n,t,b,y,g,v;let{dmnQuery:j,extendedApiFlowWidget:k}=e,_=(0,c.Z)("GOTO_SELECTION"),N=(0,m.useCallback)(()=>_.mutate(),[_]),E=(0,m.useCallback)(()=>{window.dmnExtendedApiScreen=1,_.mutate()},[_]),D=(0,m.useCallback)(()=>{window.dmnExtendedApiScreen=2,_.mutate()},[_]),F=(0,d.Z)(),L=(0,m.useMemo)(()=>{let e=(0,s.Z)(j.data.marketingPreferences),l=e.filter(e=>"marketingPreferences[]"===e.name),n=e.find(e=>"bookingPolicy"===e.name),t=e.filter(e=>"marketingPreferences[]"!==e.name&&"bookingPolicy"!==e.name),i=[...l.filter(e=>{var l;return!(null===(l=e.label)||void 0===l?void 0:l.includes("Marstonâs Inns"))}),...l.filter(e=>{var l;return null===(l=e.label)||void 0===l?void 0:l.includes("Marstonâs Inns")})];return[...t,...i,n].filter(Boolean)},[j.data.marketingPreferences]),C=(0,m.useMemo)(()=>{var e,l;return F.bookingType&&F.selectionValues?(null===(e=(0,o.Z)(F.bookingType,F.selectionValues.date))||void 0===e?void 0:e.bookingPolicy)||(null===(l=(0,r.Z)(F.bookingType,F.selectionValues.date))||void 0===l?void 0:l.bookingPolicy)||"Please note all tables are held for 15 minutes only":""},[F.bookingType,F.selectionValues]),{duration:T,startTime:I}=F.selectionValues||{},Z=(0,a.Z)(I,T),{isExtendedApiFlow:P}=(0,h.Z)(k);return(0,i.jsxs)(u.fC,{children:[(0,i.jsxs)("div",{className:w().details,children:[(0,i.jsxs)("div",{className:w().section,children:[(0,i.jsx)("h4",{className:w().bookingTitle,children:"Your ".concat(F.isEnquiry?"enquiry":"booking"," request")}),P?(0,i.jsxs)("div",{className:"".concat(w().bookingDetails," ").concat(P?w().bookingExtendedDetails:w().bookingDetails).trim(),children:[(0,i.jsxs)("div",{className:"".concat(P?w().bookingDetailsExtendedInfo:w().bookingDetailsInfo),children:[(0,i.jsxs)("div",{className:w().bookingDetailsLeftColumn,children:[(0,i.jsx)("p",{children:(0,x.Z)(new Date((null===(l=F.selectionValues)||void 0===l?void 0:l.date)||""),"d MMMM yyyy")}),(0,i.jsxs)("p",{children:[null===(n=F.selectionValues)||void 0===n?void 0:n.guests," ",(null===(t=F.selectionValues)||void 0===t?void 0:t.guests)==="1"?"Guest":"Guests"]})]}),(0,i.jsx)("button",{className:w().bookingDetailsButton,onClick:E,type:"button",children:"Edit"})]}),(0,i.jsxs)("div",{className:"".concat(P?w().bookingDetailsExtendedInfo:w().bookingDetailsInfo),children:[(0,i.jsxs)("div",{className:w().bookingDetailsLeftColumn,children:[(0,i.jsx)("p",{children:null===(b=F.bookingType)||void 0===b?void 0:b.title}),(0,i.jsxs)("p",{children:[I,Z&&" - ".concat(Z)]})]}),(0,i.jsx)("button",{className:w().bookingDetailsButton,onClick:D,type:"button",children:"Edit"})]})]}):(0,i.jsxs)("div",{className:w().bookingDetails,children:[(0,i.jsxs)("div",{className:w().bookingDetailsInfo,children:[(0,i.jsx)("p",{children:null===(y=F.bookingType)||void 0===y?void 0:y.title}),(0,i.jsxs)("p",{children:[null===(g=F.selectionValues)||void 0===g?void 0:g.guests," Guests"]})]}),(0,i.jsxs)("div",{className:w().bookingDetailsInfo,children:[(0,i.jsx)("p",{children:(0,x.Z)(new Date((null===(v=F.selectionValues)||void 0===v?void 0:v.date)||""),"d MMMM yyyy")}),(0,i.jsxs)("p",{children:[I,Z&&" - ".concat(Z)]})]}),(0,i.jsx)("div",{className:w().bookingDetailsButtonCont,children:(0,i.jsx)("button",{className:w().bookingDetailsButton,onClick:N,children:"Edit Details"})})]})]}),!P&&(0,i.jsx)("hr",{className:w().seperator}),(0,i.jsx)("div",{className:w().section,children:(0,i.jsxs)("div",{className:"".concat(P?w().extendedForm:w().form),children:[P&&(0,i.jsx)(i.Fragment,{children:(null==F?void 0:F.isEnquiry)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{className:w().formTitle,children:"Enter your enquiry details"}),(0,i.jsx)("p",{className:w().formCopy,children:"Add your details below and tap Make Enquiry to send us a message."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{className:w().formTitle,children:"Enter your booking details"}),(0,i.jsx)("p",{className:w().formCopy,children:"Add your details below and tap confirm to secure your table."})]})}),!P&&(0,i.jsxs)("h3",{className:w().formTitle,children:["Your ",(0,i.jsx)("br",{}),"Details"]}
1),L.map((e,l)=>e?(0,i.jsx)(q,{extendedApiFlowWidget:P,field:e},JSON.stringify([e,l])):null)]})}),(0,i.jsx)(p.lP,{subscription:{valid:!0,values:!0},render:e=>{let{valid:l,values:n}=e,t=!P||L.every(e=>{if(!(null==e?void 0:e.required))return!0;let l=null==n?void 0:n[e.name];return"checkbox"===e.type?!!l:"string"==typeof l?l.trim().length>0:!!l});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"text-s ".concat(w().flexiLegal," ").concat(P?w().flexiExtendedLegalLabel:w().flexiLegalLabel," ").concat(w().flexiField),children:"We will not pass details onto other Third Parties for further marketing, and you can unsubscribe at any time."}),(0,i.jsxs)("span",{className:"text-s ".concat(w().flexiLegal," ").concat(P?w().flexiExtendedLegalLabel:w().flexiLegalLabel," ").concat(w().flexiField),children:["Please read our"," ",(0,i.jsx)("a",{href:"/privacy-policy",target:"_blank",children:(0,i.jsx)("button",{type:"button",children:"Privacy Policy"})})]}),(0,i.jsx)(f.Z,{extendedApiFlowWidget:P,text:"".concat(F.isEnquiry?"Make Enquiry":"Confirm Booking"),disabled:!l||!t})]})}})]}),(0,i.jsxs)(u.VY,{className:"dmn-popup-content",children:[(0,i.jsxs)("div",{className:"dmn-popup-top",children:[(0,i.jsx)(u.x8,{asChild:!0,children:(0,i.jsx)("button",{className:"reset","aria-label":"Close",children:(0,i.jsx)(M,{})})}),(0,i.jsx)(u.Dx,{className:"font-secondary text-l",children:"Booking Terms and Conditions"})]}),(0,i.jsx)(u.dk,{asChild:!0,children:(0,i.jsx)("div",{className:"dmn-popup-description",dangerouslySetInnerHTML:{__html:C}})})]})]})}},7253:function(e){e.exports={details:"styles_details__sLVK2",seperator:"styles_seperator__zCb8D",section:"styles_section__uWdGr",bookingTitle:"styles_bookingTitle__ykQ90",bookingDetails:"styles_bookingDetails__ti5F0",bookingExtendedDetails:"styles_bookingExtendedDetails__sLuI8",bookingDetailsInfo:"styles_bookingDetailsInfo__G7UbW",bookingDetailsLeftColumn:"styles_bookingDetailsLeftColumn__ea9_q",bookingDetailsExtendedInfo:"styles_bookingDetailsExtendedInfo__DpFVH",bookingDetailsButton:"styles_bookingDetailsButton__JxWpY",bookingDetailsButtonCont:"styles_bookingDetailsButtonCont__24RpT",extendedForm:"styles_extendedForm__cM3lA",form:"styles_form__XmXkf",formTitle:"styles_formTitle__JsCwK",formSection:"styles_formSection__Wp8Oh",flexiField:"styles_flexiField__pDps9",extendedFlexiField:"styles_extendedFlexiField___MQhT",flexiExtendedLegalLabel:"styles_flexiExtendedLegalLabel__M42HC",flexiLegalLabel:"styles_flexiLegalLabel__F72dj",flexiExtendedLabel:"styles_flexiExtendedLabel__SuYwW",flexiLegal:"styles_flexiLegal__B9WKk",formCopy:"styles_formCopy___0HcU"}}}]);
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.