1"use strict";(self.webpackChunklanding_page=self.webpackChunklanding_page||[]).push([[7238],{1987:()=>{},7238:(e,t,a)=>{a.r(t),a.d(t,{default:()=>v});var o=a(9379),n=a(446),i=a.n(n),s=a(5043),l=a(4117),r=a(7100),d=a(8601),c=a(2457),u=a(3976),h=a(5989),p=a(5346),g=a(270),m=(a(1987),a(579));const v=e=>{let{showPopup:t=!0,setShowPop:a,setextraPrice:n,setShowFakeConfetti:v}=e;const[f,b]=(0,s.useState)(""),[k,x]=(0,s.useState)(),_=h.A.get("hotelName")||0,{hotelData:y,dateRange:D}=(0,d.d4)(e=>e.hotelInfo),Y=(0,g.N)(null===y||void 0===y?void 0:y.country),N=async()=>{if(0===(null===f||void 0===f?void 0:f.length)||!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(f))return c.A.info("Please enter valid email!"),void(0,p.fireGtmEvent)("subscribe_popup_wrong_input");if(""===k||!(0,r.g0)(String(k)))return(0,p.fireGtmEvent)("subscribe_popup_wrong_phone"),void c.A.error(S("enter_valid_phone_number"));const e=(0,r.parsePhoneNumber)(String(k)),t={bookingId:205,hotelId:h.A.get("hotelId"),dialCode:"+"+e.countryCallingCode,mobile:e.nationalNumber,reason:"Subscribe ".concat(_," - ")+f,email:f,checkInDate:i()(null===D||void 0===D?void 0:D.startDate).format("YYYY-MM-DD"),checkOutDate:i()(null===D||void 0===D?void 0:D.endDate).format("YYYY-MM-DD")};(0,r.g0)(k)&&localStorage.setItem("phone",JSON.stringify(k)),localStorage.setItem("email",JSON.stringify(f));let s=JSON.parse(localStorage.getItem("userHistory"))||{},l={id:null===y||void 0===y?void 0:y.id,checkInDate:i()(null===D||void 0===D?void 0:D.startDate).format("YYYY-MM-DD"),checkOutDate:i()(null===D||void 0===D?void 0:D.endDate).format("YYYY-MM-DD"),currenDate:i()().format("YYYY-MM-DD HH:mm"),event:"offer_applied"},d=s[null===y||void 0===y?void 0:y.id]||[];s=(0,o.A)((0,o.A)({},s),{},{[null===y||void 0===y?void 0:y.id]:[...d,l]}),localStorage.setItem("userHistory",JSON.stringify(s));200===(await(0,u.Wk)(t)).status&&(n(1),b(""),h.A.set("loyalty",!0),h.A.set("subscribed",!0),v(!0)),(0,p.fireGtmEvent)("subscribed_popup"),a(!1)},{t:S}=(0,l.Bd)();return t&&(0,m.jsx)("div",{className:"checkoutPageModal",children:(0,m.jsxs)("div",{className:"checkoutPageContainer",style:{padding:"0"},children:[(0,m.jsx)("div",{className:"checkoutPageContainerHeader",style:{background:"#CBD9FF",borderRadius:"8px 8px 0 0"},children:(0,m.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/a7ea48e7-dd16-4de9-a20f-6e78dfc2c3a7.png?tr=w-300,h-300",alt:"can we ask why?"})}),(0,m.jsxs)("div",{className:"checkoutPageContainerBody",style:{padding:"10px"},children:[(0,m.jsx)("p",{style:{width:"100%",textAlign:"center",fontSize:"0.8rem"},children:S("subscribe_now_to")}),(0,m.jsxs)("p",{style:{color:"#065af3",fontSize:"1.1rem",textAlign:"center",width:"100%"},children:[S("get_extra")," ",(0,m.jsxs)("b",{style:{color:"#065af3"},children:["15% ",S("off"),"!"]})]}),(0,m.jsxs)("div",{className:"inputRow",children:[(0,m.jsx)("input",{value:f,onChange:e=>b(e.target.value),name:"requests",placeholder:S("enter_email")}),(0,m.jsx)("div",{className:"offer_phone",children:(0,m.jsx)(r.Ay,{defaultCountry:Y,placeholder:S("enter_contact_number"),value:k,className:"offerInput",name:"phone",onChange:e=>{x(e)}})}),(0,m.jsx)("button",{onClick:N,className:"acceptBtn",children:S("subscribe")})]}),(0,m.jsx)("div",{className:"checkoutPageContainerFooter",style:{flexDirection:"column-reverse"},children:(0,m.jsx)("button",{onClick:()=>{(null===f||void 0===f?void 0:f.length)>0&&N(),a(!1),b(""),(0,p.fireGtmEvent)("subscribe_popup_closed")},className:"ignoreBtn",children:S("no_thanks")})})]})]})})}}}]); 2//# sourceMappingURL=7238.41586747.chunk.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.