PageSourceSearch

https://book.25hours-hotels.com/_next/static/chunks/825-fbef30f0c19383ff.js

js 25hours-hotels.com collected 2026-10-02 04:50:57 UTC 12,580 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[825],{29825:function(e,t,i){i.d(t,{P:function(){return StripeCheckoutFormContainer}});var n=i(60589),o=i(50959),r=i(51455),a=i(30490),l=i(74465),s=i(24143),c=i(95139),m=i(25320),d=i(11263),u=i(77614),h=i(22768),p=i(97640),g=i(75847),y=i(88265),k=i(67920),Z=i(39709),v=i(41226);let checkoutValuesStorageKey=e=>"checkout.payment.".concat(e),saveCheckoutFormValuesToSessionStorage=(e,t)=>{sessionStorage.setItem(checkoutValuesStorageKey(e),JSON.stringify(t))},fetchCheckoutFormValuesFromSessionStorage=(e,t)=>{let i=sessionStorage.getItem(checkoutValuesStorageKey(e));if(i)return t(JSON.parse(i))};var b=i(31973),f=i(89384),T=i(49214),S=i(38736),I=i(88048),P=i(20762),C=i(28955),E=i(55600),L=i(360),B=i(6905),F=i(71907),G=i(93611),O=i(12997),N=i(89063),_=i(86357),x=i(27058);let AlternativeCurrencyPaymentWarning=e=>{let{total:t}=e,{t:i}=(0,h.$G)("bookingSummary"),o=(0,x.tV)(),r=(0,x.ip)({amount:t,preventConversion:!0});return o?(0,n.BX)(n.HY,{children:[(0,n.tZ)(G.LZ,{s:"s"}),(0,n.tZ)(N.B4,{color:"textSecondary",children:i("alternativeCurrencyWarning.payment",{total:r})})]}):null};var A=i(59407),w=i(57354);let CardPaymentFormFields=e=>{var t;let{t:i}=(0,h.$G)(),{forms:r}=(0,O.Fg)(),a=(0,v.A)();return(0,n.BX)(o.Fragment,{children:[(0,n.tZ)(N.X6,{as:"h6",style:"heading6",css:(0,g.iv)({...r.heading,"@media all and (max-width: 730px)":null===(t=r.heading)||void 0===t?void 0:t.mobile}),children:i("payment:card.sectionTitle")}),e.paymentTime===T.J.PayLater&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(G.LZ,{s:"xs"}),(0,n.tZ)(N.B4,{css:r.description,children:i(a?"bookingMembership:form.payment.description":"payment:card.sectionPayLaterDescription")})]}),(0,n.tZ)(G.LZ,{s:"m"}),(0,n.tZ)(y.PaymentElement,{options:{terms:{card:"never"},layout:"tabs",wallets:{applePay:"never",googlePay:"never"},paymentMethodOrder:["card"],fields:{billingDetails:{email:"never",name:"never",phone:"never",address:{state:"auto",city:"never",country:"never",line1:"never",line2:"auto",postalCode:"never"}}}}})]})};var M=i(84914),R=i(27314),U=i(96887),X=i(41494),PaymentButton_component=e=>{var t;let{isLoading:i,paymentTime:o,totalTakenNow:r}=e,{t:a}=(0,h.$G)("payment"),{t:l}=(0,h.$G)("bookingMembership"),{forms:s}=(0,O.Fg)(),c=(0,v.A)(),m=(0,x.ip)({amount:r}),{formState:{isSubmitting:d}}=(0,U.Gc)();return(0,n.tZ)(X.zx,{type:"submit",isLoading:i||d,isDisabled:i||d,css:null==s?void 0:null===(t=s.checkoutForm)||void 0===t?void 0:t.paymentButton,children:c?l("form.paymentButton"):a(o===T.J.PayNow?"paymentButton.payNowLabel":"paymentButton.payLaterLabel",{total:m})})},PaymentErrorMessage_component=e=>{let{message:t}=e;return t?(0,n.BX)(N.Iy,{children:[(0,n.tZ)(G.LZ,{s:"s"}),(0,n.tZ)(X.Bc,{message:t})]}):null},Y=i(19945),D=i(23062),V=i(69170);let createStripeCheckoutFormInitialValues=()=>({isMainGuestPaying:["isMainGuestPaying"],title:"",guestFirstName:"",guestLastName:"",bookerFirstName:"",bookerLastName:"",address:"",city:"",country:"",state:"",postcode:"",guestEmail:"",bookerEmail:"",bookerEmailConfirmation:"",phone:"",isCharityAdded:[],charityDonationAmount:"1",isTermsAccepted:[],hasAgreedToPrivacyPolicy:[],marketingOptIn:[],membershipMarketingOptIn:[]});var StripeCheckoutForm_component=e=>{var t,i,r,a,l,s,m,p,x,U;
1let X=(0,y.useElements)(),H=(0,y.useStripe)(),$=(0,u.w8)(e.hotelSlug),q=(0,c.v4)({bookingId:e.bookingId,hotelSlug:e.hotelSlug}),J=(0,h.bU)(),{forms:W,componentProperties:K,keylines:z}=(0,O.Fg)(),{query:j}=(0,k.useRouter)(),{bookingId:Q,hotelSlug:ee}=e,et=(0,v.A)(),ei=(0,C.uR)("booker-split")&&!et,en=(0,P.Es)(),emitFormSubmissionEvent=()=>{$&&q&&en.emit("paymentFormSubmittedSuccessfully",{hotel:$,booking:q,paymentType:"Credit Card"})},{t:eo}=(0,h.$G)("payment"),{t:er}=(0,h.$G)("common"),{t:ea}=(0,h.$G)("errors"),{t:el}=(0,h.$G)("bookingMembership"),{highlightedCountryCodes:es,collectPrivacyPolicyConsentAtCheckout:ec}=(0,d.AI)(),em=(0,f.V)(),ed=(0,A.LH)(eo,er,ec,ei),eu=(0,Z.$g)(null!=es?es:[]),eh=(0,Z.bp)(),[ep,eg]=(0,o.useState)(),handleFormSubmit=async t=>{if(emitFormSubmissionEvent(),!H)throw Error("Stripe not injected. This component should be rendered inside <StripeProviderWithElements />");if(!X)throw Error("Missing Stripe elements");let i=await X.submit();if(!i.error){saveCheckoutFormValuesToSessionStorage(Q,t);try{var n,o;await e.updateBookingPaymentDetails({...t,charity:(0,Y.Yo)({isCharityAdded:t.isCharityAdded,charityDonationAmount:t.charityDonationAmount}),marketingOptIn:t.marketingOptIn.length>0,membershipMarketingOptIn:t.membershipMarketingOptIn.length>0,countryCode:t.country,isMainGuestPaying:t.isMainGuestPaying.length>0,guestTitle:t.title,bookerTitle:""});let i=new URL((0,b.KR)({bookingId:Q,hotelSlug:ee,step:"pending",locale:J.baseName}),document.location.origin);i.searchParams.set("forceTheme",null!==(o=null==$?void 0:null===(n=$.theme)||void 0===n?void 0:n.key)&&void 0!==o?o:""),j.version&&i.searchParams.set("version",j.version);let r=await (0,B.E)({paymentToken:e.paymentToken,stripe:H,billingDetails:t,returnUrl:i.href,elements:X});if(null==r?void 0:r.error){eg(r.error.message);return}await e.onAfterPaymentSuccess(t.bookerEmail)}catch(e){eg(ea("processingCardGeneric")),(0,E.Tb)(e)}}},ey=fetchCheckoutFormValuesFromSessionStorage(Q,e=>(0,_.x)(ed,e)),ek=null!=ey?ey:createStripeCheckoutFormInitialValues();return(0,n.BX)(F.l0,{onSubmit:handleFormSubmit,defaultValues:ek,validationSchema:ed,hookFormOptions:{mode:"onTouched"},name:"payment",children:[ei&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(V.KG,{clearBookerFieldsIfGuestNotPaying:!0}),(0,n.tZ)(G.LZ,{s:"s"}),(0,n.tZ)(V.by,{label:eo("billingInformation.form.labels.mainGuestIsPaying")}),(0,n.tZ)(G.LZ,{s:"xl"})]}),(0,n.tZ)(N.X6,{as:"h6",style:"heading6",css:{...W.heading,...null===(t=W.checkoutForm)||void 0===t?void 0:t.billingInformationHeading,"@media all and (max-width: 730px)":null===(i=W.heading)||void 0===i?void 0:i.mobile},children:ei?eo("billingInformation.sectionTitle_bookerSplit"):et?el("form.title"):eo("billingInformation.sectionTitle")}),(0,n.tZ)(G.LZ,{s:"s"}),(0,n.tZ)(N.B4,{css:{whiteSpace:"pre-line",opacity:.72,...null===(r=W.checkoutForm)||void 0===r?void 0:r.billingInformationDescription},children:ei?eo("billingInformation.description_bookerSplit"):et?el("form.description"):eo("billingInformation.description")}),(0,n.tZ)(G.LZ,{s:"m"}),et&&(0,n.tZ)(S.xu,{css:{padding:"18px 16px",border:null==z?void 0:z.border,backgroundColor:null!==(x=null==K?void 0:null===(a=K.addOnCard)||void 0===a?void 0:a.backgroundColor)&&void 0!==x?x:"white",marginBottom:"35px",borderWidth:"1px"},children:(0,n.tZ)(N.B4,{children:el("form.alert")})}),(0,n.BX)(F.NI,{children:[!ei&&(0,n.tZ)(F.GB,{flex:1,display:em?"block":"none",children:(0,n.tZ)(V.ty,{})}),(0,n.tZ)(F.GB,{flex:2,children:(0,n.tZ)(V.pm,{id:"bookerFirstName"})}),(0,n.tZ)(F.GB,{flex:2,children:(0,n.tZ)(V.Jh,{id:"bookerLastName"})})]}),et&&(0,n.BX)(F.NI,{children:[(0,n.tZ)(F.GB,{children:(0,n.tZ)(V.fA,{id:"bookerEmail",description:ei?eo("billingInformation.form.descriptions.confirmationCopy"):void 0})}),(0,n.tZ)(F.GB,{children:(0,n.tZ)(V.Sy,{})})]}),(0,n.tZ)(I.Ng,{children:(0,n.tZ)(G.LZ,{s:"xs"})}),(0,n.tZ)(V.kU,{}),(0,n.tZ)(I.Ng,{children:(0,n.tZ)(G.LZ,{s:"xs"})}),(0,n.BX)(F.NI,{children:[(0,n.tZ)(F.GB,{children:(0,n.tZ)(V.Uy,{})}),(0,n.tZ)(F.GB,{children:(0,n.tZ)(V.P7,{options:eu})})]}),(0,n.tZ)(I.Ng,{children:(0,n.tZ)(G.LZ,{s:"xs"})}),(0,n.BX)(S.kC,{flexWrap:["wrap","nowrap"],columnGap:20,children:[(0,n.tZ)(V.Af,{options:eh}),(0,n.tZ)(V.ac,{})]}),et&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(I.Ng,{children:(0,n.tZ)(G.LZ,{s:"xs"})}
1),(0,n.tZ)(S.xu,{width:[1,"calc(50% - 10px)"],children:(0,n.tZ)(V.A,{})})]}),(0,n.tZ)(G.LZ,{s:"m"}),!et&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(N.X6,{as:"h6",style:"heading6",css:(0,g.iv)({...W.heading,"@media all and (max-width: 730px)":null===(l=W.heading)||void 0===l?void 0:l.mobile}),children:eo("contactInformation.sectionTitle")}),(0,n.tZ)(G.LZ,{s:"s"}),(0,n.tZ)(V.fA,{id:"bookerEmail",description:ei?eo("billingInformation.form.descriptions.confirmationCopy"):void 0}),(0,n.tZ)(I.Ng,{children:(0,n.tZ)(G.LZ,{s:"xs"})}),(0,n.tZ)(V.A,{}),(0,n.tZ)(G.LZ,{s:"m"})]}),(0,n.tZ)(CardPaymentFormFields,{paymentTime:e.paymentTime}),(0,n.tZ)(G.LZ,{s:"m"}),(0,n.tZ)(w.Z,{bookingId:e.bookingId,hotelSlug:e.hotelSlug}),(0,n.tZ)(G.LZ,{s:"m"}),(0,n.tZ)(R.Z,{termsAndConditionsUrl:e.termsAndConditionsUrl,collectPrivacyPolicyConsentAtCheckout:ec,hotelReferenceId:e.hotelSlug}),(0,n.tZ)(G.LZ,{s:"xl"}),et&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(N.B4,{opacity:.72,css:null===(s=W.checkoutForm)||void 0===s?void 0:s.paymentDisclaimer,children:(0,n.tZ)(L.U,{source:el("form.payment.bookingTerms",{bookingTermsUrl:e.termsAndConditionsUrl})})}),(0,n.tZ)(G.LZ,{s:"l"})]}),(0,n.tZ)("div",{className:"fs-unmask",children:e.costConfirmed?(0,n.tZ)("div",{"aria-live":"polite",children:(0,n.tZ)(PaymentButton_component,{paymentTime:e.paymentTime,totalTakenNow:e.totalTakenNow,isLoading:e.isLoading})}):(0,n.tZ)(D._,{})}),e.paymentTime===T.J.PayLater&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(G.LZ,{s:"s"}),(0,n.tZ)(N.B4,{opacity:.72,css:null===(m=W.checkoutForm)||void 0===m?void 0:m.paymentDisclaimer,children:eo("paymentOnHotelCheckout")})]}),et&&(0,n.BX)(n.HY,{children:[(0,n.tZ)(G.LZ,{s:"l"}),(0,n.tZ)(N.B4,{opacity:.72,css:null===(p=W.checkoutForm)||void 0===p?void 0:p.paymentDisclaimer,children:el("form.payment.disclaimer")})]}),(0,n.tZ)(AlternativeCurrencyPaymentWarning,{total:e.overallTotal}),(0,n.tZ)(M.Z,{}),(0,n.tZ)(PaymentErrorMessage_component,{message:null!==(U=e.errorMessage)&&void 0!==U?U:ep})]})};let StripeCheckoutFormContainer=e=>{let{bookingId:t,hotelSlug:i}=e,{t:g}=(0,h.$G)("errors"),{marketingConsentMode:y}=(0,d.AI)(),k=(0,u.w8)(i),{mutateAsync:Z}=(0,l.lq)(y),{config:{additionalInfoFields:v},setPaymentFields:b}=(0,a.yg)(t),{data:f}=(0,s.c)({bookingId:t,hotelReferenceId:i}),T=(0,o.useCallback)(async e=>{b({acceptsMarketing:e.marketingOptIn}),await Z({hotelReferenceId:i,metadata:{charity:e.charity,email:e.bookerEmail,marketingOptIn:e.marketingOptIn,membershipMarketingOptIn:e.membershipMarketingOptIn,title:e.guestTitle,bookingId:t,comment:null==v?void 0:v.specialRequests,specialAssistance:null==v?void 0:v.accessRequirements,flexyTime:{checkIn:null==v?void 0:v.checkInTime,checkOut:null==v?void 0:v.checkOutTime},guestProfiles:[...["GUEST_PROFILE_TYPE_GUEST","GUEST_PROFILE_TYPE_BILLING"].map(t=>({address:e.address?[e.address]:void 0,city:e.city,postCode:e.postcode,state:e.state,countryCode:e.countryCode,comment:null==v?void 0:v.specialRequests,cot:(null==v?void 0:v.childCot)?"COT":"COT_BED_NOT_SET",dog:null==v?void 0:v.dog,email:"GUEST_PROFILE_TYPE_GUEST"!==t||e.isMainGuestPaying?e.bookerEmail:e.guestEmail,firstName:"GUEST_PROFILE_TYPE_GUEST"!==t||e.isMainGuestPaying?e.bookerFirstName:e.guestFirstName,lastName:"GUEST_PROFILE_TYPE_GUEST"!==t||e.isMainGuestPaying?e.bookerLastName:e.guestLastName,flexyTime:{checkIn:null==v?void 0:v.checkInTime,checkOut:null==v?void 0:v.checkOutTime},guestProfileType:t,marketingOptIn:e.marketingOptIn,membershipMarketingOptIn:e.membershipMarketingOptIn,phone:e.phone,specialAssistance:null==v?void 0:v.accessRequirements,title:e.isMainGuestPaying?e.guestTitle:"GUEST_PROFILE_TYPE_GUEST"===t?e.guestTitle:e.bookerTitle,transactionalEmails:!0}))]}})},[t,i,null==v?void 0:v.specialRequests,null==v?void 0:v.accessRequirements,null==v?void 0:v.checkInTime,null==v?void 0:v.checkOutTime,null==v?void 0:v.childCot,null==v?void 0:v.dog,Z]),S=(0,c.v4)({bookingId:t,hotelSlug:i}),I=(0,m.UV)({bookingId:t,hotelReferenceId:i}),P=(0,c.bf)({bookingId:t,hotelSlug:i}),C=(0,a.yg)(t),[E,L]=(0,l.Jy)(t),[B]=(0,a.sz)();if(!S||!C||!v||!k||!I)return null;let F=B(S.id),G=F?(0,r.DR)(F).resultsURL():"/availability";return(0,n.tZ)("div",{children:(0,n.tZ)(p.i,{bookingId:t,hotelSlug:i,children:(0,n.tZ)(StripeCheckoutForm_component,{hotelSlug:k.referenceId,bookingId:t,isLoading:"submitting"===E,errorMessage:"PAYMENT_ERROR"===I.status?g("bookingPaymentErrorState",{email:k.contact.emails.info,searchUrl:G}):void 0,paymentTime:S.paymentTime,paymentToken:{secret:f.paymentIntent.clientSecret,method:S.payment.method},totalTakenNow:S.firstTotalChargeBreakdown.deposit,overallTotal:S.firstTotalChargeBreakdown.grandTotal,costConfirmed:S.costConfirmed,termsAndConditionsUrl:k.urls.terms,updateBookingPaymentDetails:T,onAfterPaymentSuccess:async()=>{L("submitting"),P()}})})})}},86357:function(e,t,i){i.d(t,{x:function(){return safeParseOptional}});function safeParseOptional(e,t){let i=e.safeParse(t);return i.success?i.data:void 0}}}]);
2//# sourceMappingURL=825-fbef30f0c19383ff.js.map

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.