PageSourceSearch

https://www.alpha.co.za/_next/static/chunks/pages/commercial/request-callback-6766537ae6ab5b85.js

js alpha.co.za collected 2026-10-09 04:20:58 UTC 11,029 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9984],{7458:function(e,r,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/commercial/request-callback",function(){return a(48501)}])},41359:function(e,r,a){"use strict";a.d(r,{Z:function(){return s}});var l=a(85893),n=a(67294),o=a(28634),t=a.n(o);function s(e){var r=e.type,a=void 0===r?"text":r,o=e.label,s=e.name,i=e.value,c=e.onChange,d=e.error,u=e.required,m=void 0!==u&&u,_=e.disabled,p=void 0!==_&&_,h=e.placeholder,b=void 0===h?"":h,f=e.options,g=void 0===f?[]:f,x=e.fullWidth,v=void 0!==x&&x,y=e.autoGrow,N=void 0!==y&&y,C="field-".concat(s),j=(0,n.useRef)(null);return(0,n.useEffect)((function(){if(N&&j.current&&"text"===a){var e=j.current;e.style.height="auto";var r=parseInt(window.getComputedStyle(e).lineHeight)||24,l=parseInt(window.getComputedStyle(e).paddingTop)+parseInt(window.getComputedStyle(e).paddingBottom)||16,n=parseInt(window.getComputedStyle(e).borderTopWidth)+parseInt(window.getComputedStyle(e).borderBottomWidth)||2,o=r+l+n,t=4*r+l+n,s=e.scrollHeight,i=Math.max(o,Math.min(t,s));e.style.height="".concat(i,"px"),e.style.overflow=s>t?"auto":"hidden"}}),[i,N,a]),(0,l.jsxs)("div",{className:"".concat(t().field," ").concat(v?t().form_full_width:""),children:[o&&(0,l.jsxs)("label",{htmlFor:C,className:t().label,children:[o,m&&"checkbox"!==a&&(0,l.jsx)("span",{className:t().required,children:"*"})]}),"select"===a?(0,l.jsxs)("select",{id:C,name:s,value:i,onChange:c,disabled:p,className:"".concat(t().input," ").concat(d?t().error:""),required:m,children:[(0,l.jsx)("option",{value:"",children:b||"Select ".concat(o)}),g.map((function(e){return(0,l.jsx)("option",{value:e.value,children:e.label},e.value)}))]}):"textarea"===a?(0,l.jsx)("textarea",{id:C,name:s,value:i,onChange:c,disabled:p,placeholder:b,className:"".concat(t().input," ").concat(t().textarea," ").concat(d?t().error:""),required:m,rows:3}):"checkbox"===a?(0,l.jsxs)("div",{className:t().checkbox_wrapper,children:[(0,l.jsx)("input",{id:C,name:s,type:"checkbox",checked:i,onChange:c,disabled:p,className:"".concat(t().checkbox," ").concat(d?t().error:""),required:m}),(0,l.jsxs)("label",{htmlFor:C,className:t().checkbox_label,children:[b,m&&(0,l.jsx)("span",{className:t().required,style:{color:"#d32f2f"},children:"*"})]})]}):N&&"text"===a?(0,l.jsx)("textarea",{ref:j,id:C,name:s,value:i,onChange:c,disabled:p,placeholder:b,className:"".concat(t().input," ").concat(d?t().error:""),required:m,rows:1,style:{resize:"none",overflow:"hidden",minHeight:"40px",lineHeight:"1.5",wordWrap:"break-word",paddingTop:"12px"}}):(0,l.jsx)("input",{ref:N?j:null,id:C,name:s,type:a,value:i,onChange:c,disabled:p,placeholder:b,className:"".concat(t().input," ").concat(d?t().error:""),required:m}),d&&(0,l.jsx)("div",{className:t().error_message,children:d})]})}},56638:function(e,r,a){"use strict";a.d(r,{Z:function(){return t}});var l=a(85893),n=(a(67294),a(28634)),o=a.n(n);function t(e){var r=e.isVisible,a=e.onClose,n=e.title,t=e.message;if(!r)return null;return(0,l.jsx)("div",{className:o().modal_backdrop,onClick:function(e){e.target===e.currentTarget&&a()},children:(0,l.jsxs)("div",{className:o().modal_content,children:[(0,l.jsxs)("div",{className:o().modal_header,children:[(0,l.jsx)("img",{src:"https://cdn.alpha.co.za/alpha-logo/Alpha-Logo-Stacked-Colour_Colour-Stacked.png",alt:"Alpha Logo",className:o().modal_logo,style:{margin:"auto"}}),(0,l.jsx)("h2",{className:o().modal_title,children:n})]}),(0,l.jsx)("div",{className:o().modal_body,children:(0,l.jsx)("p",{className:o().modal_message,children:t})}),(0,l.jsx)("div",{className:o().modal_footer,children:(0,l.jsx)("button",{className:o().modal_close_button,onClick:a,children:"Close"})})]})})}},48501:function(e,r,a){"use strict";a.r(r),a.d(r,{default:function(){return y}});var l=a(85893),n=a(67294),o=a(9008),t=a.n(o),s=a(47568),i=a(14924),c=a(26042),d=a(69396),u=a(97582),m=a(11163),_=a(41359),p=a(43371),h=a(56638),b=a(55443),f=a(90109),g=a(28634),x=a.n(g);function v(){(0,m.useRouter)();var e=(0,n.useState)(!1),r=e[0],a=e[1],o=(0,n.useState)(!1),t=o[0],g=o[1],v=(0,n.useState)({fullName:"",policyNumber:"",preferredContactNumber:"",email:"",reasonForCall:""}
1),y=v[0],N=v[1],C=(0,n.useState)({}),j=C[0],w=C[1];(0,n.useEffect)((function(){var e=window.location.hash;if(e&&e.length>1){var r=e.substring(1);try{r=decodeURIComponent(r)}catch(a){r=r.replace(/%20/g," ")}N((function(e){return(0,d.Z)((0,c.Z)({},e),{policyNumber:r})}))}}),[]);var k=function(e){var r=e.target,a=r.name,l=r.value;N((function(e){return(0,d.Z)((0,c.Z)({},e),(0,i.Z)({},a,l))})),j[a]&&w((function(e){return(0,d.Z)((0,c.Z)({},e),(0,i.Z)({},a,""))}))},q=function(){var e=(0,s.Z)((function(e){var r,l,n,o;return(0,u.__generator)(this,(function(t){switch(t.label){case 0:if(e.preventDefault(),!function(){var e,r,a={};return y.fullName.trim()||(a.fullName="Full name is required"),y.policyNumber.trim()||(a.policyNumber="Policy number is required"),y.preferredContactNumber.trim()?(e=y.preferredContactNumber)&&/^[\d\s\-\+\(\)]{10,15}$/.test(e.replace(/\s/g,""))||(a.preferredContactNumber="Please enter a valid phone number"):a.preferredContactNumber="Cellphone number is required",y.email.trim()?(r=y.email)&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)||(a.email="Please enter a valid email address"):a.email="Email address is required",w(a),0===Object.keys(a).length}())return[2];a(!0),t.label=1;case 1:return t.trys.push([1,5,6,7]),[4,(0,f.ET)((0,f.hJ)(b.EF,"commercial-request-callback"),(0,d.Z)((0,c.Z)({},y),{source:window.innerWidth<768?"mobile":"web",submittedAt:(0,f.Bt)(),type:"request-callback",category:"commercial"}))];case 2:return r=t.sent(),console.log("Document written with ID: ",r.id),[4,fetch("/api/commercial/request-callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,d.Z)((0,c.Z)({},y),{source:window.innerWidth<768?"mobile":"web",documentId:r.id}))})];case 3:return[4,(l=t.sent()).json()];case 4:if(n=t.sent(),!l.ok)throw new Error(n.error||"Failed to submit request");return g(!0),"undefined"!==typeof gtag&&gtag("event","form_submit",{event_category:"Commercial Lines",event_label:"Request Callback",value:1}),[3,7];case 5:return o=t.sent(),console.error("Error submitting form:",o),"undefined"!==typeof gtag&&gtag("event","form_error",{event_category:"Commercial Lines",event_label:"Request Callback Error",value:0}),[3,7];case 6:return a(!1),[7];case 7:return[2]}}
1))}));return function(r){return e.apply(this,arguments)}}();return(0,l.jsxs)("div",{className:x().form_container,children:[(0,l.jsxs)("div",{className:x().form_header,children:[(0,l.jsx)("h2",{className:x().form_title,children:"Request a Call Back"}),(0,l.jsx)("p",{className:x().form_description,children:"A Senior Account Executive will contact you to assist with your commercial insurance enquiry."})]}),(0,l.jsxs)("form",{onSubmit:q,className:x().form,children:[(0,l.jsxs)("div",{className:x().form_grid,children:[(0,l.jsx)(_.Z,{type:"text",label:"Full Name",name:"fullName",value:y.fullName,onChange:k,error:j.fullName,required:!0,disabled:r,placeholder:"Enter your full name"}),(0,l.jsx)(_.Z,{type:"text",label:"Policy Number",name:"policyNumber",value:y.policyNumber,onChange:k,error:j.policyNumber,required:!0,disabled:!0,placeholder:"Enter your policy number",autoGrow:!0}),(0,l.jsx)(_.Z,{type:"tel",label:"Cellphone Number",name:"preferredContactNumber",value:y.preferredContactNumber,onChange:k,error:j.preferredContactNumber,required:!0,disabled:r,placeholder:"Enter your cellphone number"}),(0,l.jsx)(_.Z,{type:"email",label:"Email Address",name:"email",value:y.email,onChange:k,error:j.email,required:!0,disabled:r,placeholder:"Enter your email address"}),(0,l.jsx)(_.Z,{type:"textarea",label:"",name:"reasonForCall",value:y.reasonForCall,onChange:k,error:j.reasonForCall,disabled:r,placeholder:"Please briefly describe your enquiry (e.g. I have concerns about changing insurer)",fullWidth:!0})]}),(0,l.jsx)("div",{className:x().form_actions,children:(0,l.jsx)(p.Z,{type:"button",variant:"trans",label:r?"Submitting...":"Submit Request",onClick:q})})]}),(0,l.jsx)(h.Z,{isVisible:t,onClose:function(){g(!1),N({fullName:"",policyNumber:"",preferredContactNumber:"",email:"",reasonForCall:""})},title:"Thank You for Your Submission!",message:"We have received your request for a call back. Our Commercial Lines Client Care Team will contact you soon to assist with your enquiry."})]})}function y(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(t(),{children:[(0,l.jsx)("title",{children:"Request a Call Back - Alpha Commercial Lines | Alpha"}),(0,l.jsx)("meta",{name:"description",content:"Request a call back from our Commercial Lines Client Care Team. We'll contact you to assist with your business insurance enquiry."}),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,l.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,l.jsx)("div",{className:"section",children:(0,l.jsx)("div",{className:"section-content",style:{paddingTop:"1rem"},children:(0,l.jsx)("main",{children:(0,l.jsx)(v,{})})})})]})}},28634:function(e){e.exports={form_container:"personal-lines_form_container__qrfuT",form_header:"personal-lines_form_header__1e99H",form_title:"personal-lines_form_title__f6a9_",form_description:"personal-lines_form_description__krAsr",form:"personal-lines_form__JMvWl",form_grid:"personal-lines_form_grid__FUQKd",form_full_width:"personal-lines_form_full_width__KgjtL",form_actions:"personal-lines_form_actions__vtzx1",field:"personal-lines_field__QPFfL",label:"personal-lines_label__xSMoI",required:"personal-lines_required____2ku",input:"personal-lines_input__ObmHM",error:"personal-lines_error__uSR1N",textarea:"personal-lines_textarea__k_URt",checkbox_wrapper:"personal-lines_checkbox_wrapper__MkeyJ",checkbox:"personal-lines_checkbox__d4fPB",checkbox_label:"personal-lines_checkbox_label__hP8Ln",error_message:"personal-lines_error_message__hsceL",page_container:"personal-lines_page_container__7PJnu",page_header:"personal-lines_page_header__dd_5G",page_title:"personal-lines_page_title__AOATi",page_subtitle:"personal-lines_page_subtitle__kD_7W",breadcrumb_container:"personal-lines_breadcrumb_container__yzaPf",breadcrumb:"personal-lines_breadcrumb__3OaO3",separator:"personal-lines_separator__gLTRT",loading:"personal-lines_loading__XWwze",success_message:"personal-lines_success_message__9rWfn",modal_backdrop:"personal-lines_modal_backdrop__b6o66",modalFadeIn:"personal-lines_modalFadeIn__5Gg3o",modal_content:"personal-lines_modal_content__j1yb7",modalSlideIn:"personal-lines_modalSlideIn__J3jVE",modal_header:"personal-lines_modal_header__sFm8o",modal_logo:"personal-lines_modal_logo__WBCX0",modal_title:"personal-lines_modal_title__KNrls",modal_body:"personal-lines_modal_body__VNOsT",modal_message:"personal-lines_modal_message__PDgak",modal_footer:"personal-lines_modal_footer__OOEev",modal_close_button:"personal-lines_modal_close_button__zi2Oy"}}},function(e){e.O(0,[9774,2888,179],(function(){return r=7458,e(e.s=r);var r}));var r=e.O();_N_E=r}]);

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.