1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6495,8357],{46358:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/HomePageBlocks/Subscription",function(){return s(86187)}])},14762:function(e,t,s){"use strict";var n=s(85893),r=s(67294),o=s(43495),a=s(8193);let i=e=>{let{isOpen:t,type:s,title:i,subText:l,onConfirm:c,onClose:u,autoClose:d,confirmLabel:m="Confirm",cancelLabel:f="Cancel",showConfirmButton:x=!0,showCancelButton:h=!0,showCloseIcon:p=!0}=e,w=(0,r.useRef)(),[y,g]=(0,r.useState)(!0);(0,r.useEffect)(()=>{let e;return t&&d&&(e=setTimeout(u,1e3*d)),()=>clearTimeout(e)},[t,d,u]),(0,r.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&u()};return t?document.addEventListener("mousedown",e):document.removeEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t,u]),(0,r.useEffect)(()=>{t&&g(!0)},[t]);let v=async()=>{await c(),g(!1)};return t?(0,n.jsxs)("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] px-4 py-6 sm:px-0 ",children:[(0,n.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity"}),(0,n.jsxs)(o.E.div,{ref:w,className:"bg-white p-6 rounded-xl font-primary shadow-2xl relative z-10 w-full max-w-md ",initial:{opacity:0,y:-50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.5,ease:"easeInOut"},children:[(0,n.jsx)(o.E.div,{className:"absolute inset-x-0 -top-8 flex justify-center",initial:{y:-20,opacity:0},animate:{y:0,opacity:1},transition:{duration:.7,ease:"easeInOut"},children:(0,n.jsx)("div",{className:"bg-white w-20 h-20 rounded-full flex items-center justify-center",children:(()=>{switch(s){case"success":return(0,n.jsx)(a.KP3,{className:"text-green-600 h-10 w-10"});case"error":return(0,n.jsx)(a.SV5,{className:"text-red-600 h-10 w-10"});case"warning":return(0,n.jsx)(a.SR5,{className:"text-yellow-600 h-10 w-10"});case"info":return(0,n.jsx)(a.ocf,{className:"text-blue-600 h-10 w-10"});default:return null}})()})}),p&&(0,n.jsx)("button",{onClick:u,className:"absolute top-3 right-3 text-gray-500 hover:text-gray-700",children:(0,n.jsx)(a.SV5,{className:"h-6 w-6"})}),(0,n.jsxs)("div",{className:"text-center mt-10",children:[(0,n.jsx)("h2",{className:"text-xl md:text-2xl font-semibold",children:i}),(0,n.jsx)("p",{className:"text-gray-600 mt-2",children:l})]}),y&&(h||x)&&(0,n.jsxs)("div",{className:"flex justify-center space-x-4 mt-6",children:[h&&(0,n.jsx)("button",{className:"bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded-full transition-all duration-200 ease-in-out",onClick:u,children:f}),x&&(0,n.jsx)("button",{className:"bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-full transition-all duration-200 ease-in-out",onClick:v,children:m})]}),d&&(0,n.jsx)("div",{className:"mt-6 h-1 w-full bg-gray-100 rounded overflow-hidden relative",children:(0,n.jsx)(o.E.div,{className:"h-full bg-primary absolute left-0 top-0",initial:{width:"0%"},animate:{width:"100%"},transition:{ease:"linear",duration:d}})})]})]}):null};t.Z=i},15268:function(e,t,s){"use strict";var n=s(87066),r=s(43812);let o=r.BUILDER_URL,a=e=>{let{job_id:t,endpoint:s,payload:a,responseData:i,errorMsg:l}=e,c=JSON.stringify(a),u=JSON.stringify(l),d={responseData:JSON.stringify({job_id:t,endpoint:s,payLoad:c,responseData:i,error:u})};(0,r.isDevelopment)()||n.Z.post("".concat(o,"/error-log"),d).then(e=>{200===e.status&&console.log("Success response",e.data)}).catch(e=>{})};t.Z=a},86187:function(e,t,s){"use strict";s.r(t);var n=s(85893),r=s(67294),o=s(82940),a=s(37351),i=s(6490),l=s(89583),c=s(14762);s(43812);var u=s(68015),d=s(15268);let m=e=>{let{widgetId:t}=e,[s,m]=(0,r.useState)({}),[f,x]=(0,r.useState)(!0);(0,r.useContext)(a.ThemeContext);let{redisWidgetOrderData:h}=(0,r.useContext)(i.m),p=(0,o.b)(),[w,y]=(0,r.useState)(""),{jboId:g}=(0,u.useJobId)(),[v,b]=(0,r.useState)(!1),[j,C]=(0,r.useState)({}),N=()=>{b(!1)};(0,r.useEffect)(()=>{if(h&&t){let e=h.find(e=>e.widget_order_id===t);e?m(e.subscription?e.subscription[0]:null):m(null)}},[t,h]);let E=async e=>{if(e.preventDefault,!w.match(/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/)){C({type:"error",title:"Error",subText:"Please enter a valid email address.",onConfirm:N,onClose:N,showConfirmButton:!1,showCancelButton:!1,autoClose:3}),b(!0);return}try{await p.post("user/newsletter_subscription",{email:w}).then(e=>{y(""),C({type:"success",title:"Success",subText:e.data.message,onConfirm:N,onClose:N,showConfirmButton:!1,showCancelButton:!1,autoClose:3}),b(!0)})}catch(n){var t;C({type:"error",title:"Error",subText:"Something went wrong",onConfirm:N,onClose:N,showConfirmButton:!1,showCancelButton:!1,autoClose:3}),b(!0);let s=(null==n?void 0:null===(t=n.response)||void 0===t?void 0:t.data)?n.response.data:"";(0,d.Z)({job_id:g,endpoint:"user/newsletter_subscription",payload:{email:w},responseData:s,errorMsg:n})}};return s?(0,n.jsxs)("div",{className:"mb-2 lg:mb-4 bg-alternative p-4 md:p-8 shadow-md flex flex-col lg:flex-row items-center",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-4 flex-shrink-0 ".concat("right"===s.text_side&&"md:order-2 ml-3"),children:[(0,n.jsx)("div",{className:"p-2 bg-primary rounded-full",children:(0,n.jsx)(l.Z3q,{size:20,className:"text-white"})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-white font-semibold",children:s.header_text}),(0,n.jsx)("p",{className:"text-white",children:s.sub_text})]})]}),(0,n.jsxs)("div",{className:"flex-grow flex md:flex-wrap md:gap-4 flex-col md:flex-row items-center space-y-4 md:space-y-0 md:space-x-4 mt-4 md:mt-4 md:ml-8",children:[(0,n.jsx)("input",{type:"email",value:w,onChange:e=>y(e.target.value),placeholder:"Your E-mail Address",pattern:"[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$",className:"flex-grow p-2 rounded-lg border border-gray-300 focus:border-primary focus:ring-2 focus:ring-primary outline-none"}),(0,n.jsxs)("button",{className:"py-2 px-6 rounded-lg bg-primary hover:bg-primary transition duration-300 font-semibold text-white flex items-center space-x-2",onClick:E,children:[(0,n.jsx)("span",{children:"SUBSCRIBE"}),(0,n.jsx)("svg",{xmlns:"https://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})]}),(0,n.jsx)(c.Z,{isOpen:v,type:j.type,title:j.title,subText:j.subText,onConfirm:j.onConfirm,onClose:j.onClose,showConfirmButton:j.showConfirmButton,showCancelButton:j.showCancelButton,autoClose:j.autoClose})]}):null};t.default=m},88357:function(e,t,s){"use strict";s.d(t,{w_:function(){return l}});var n=s(67294),r={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o=n.createContext&&n.createContext(r),a=function(){return(a=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var r in t=arguments[s])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)0>t.indexOf(n[r])&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(s[n[r]]=e[n[r]]);return s};function l(e){return function(t){return n.createElement(c,a({attr:a({},e.attr)},t),function e(t){return t&&t.map(function(t,s){return n.createElement(t.tag,a({key:s},t.attr),e(t.child))})}(e.child))}}function c(e){var t=function(t){var s,r=e.attr,o=e.size,l=e.title,c=i(e,["attr","size","title"]),u=o||t.size||"1em";return t.className&&(s=t.className),e.className&&(s=(s?s+" ":"")+e.className),n.createElement("svg",a({stroke:"currentColor",fill:"
1currentColor",strokeWidth:"0"},t.attr,r,c,{className:s,style:a(a({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),l&&n.createElement("title",null,l),e.children)};return void 0!==o?n.createElement(o.Consumer,null,function(e){return t(e)}):t(r)}}},function(e){e.O(0,[4617,5445,7066,3495,17,2940,9774,2888,179],function(){return e(e.s=46358)}),_N_E=e.O()}]);
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.