1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5244],{25244:function(e,r,t){"use strict";t.d(r,{Z:function(){return k}});var a=t(52322),s=t(41929),i=t(68883),n=t(88883),l=t(15832),o=t(63792),d=t(34980),g=t(7040),m=t(62350),c=t(74826),p=t(6277),u=t(96577),h=t.n(u),y=t(5632),x=t(55351),_=t(2784),N=t(63955),j=t(21746),b=t(64751),z=t(89708),W=t(21619),f=t(30195),C=t(80971),A=t(69870);f.z.object({"First Name":f.z.string(),"Last Name":f.z.string(),License:f.z.string(),"Street Address 1":f.z.string(),"Street Address 2":f.z.string().optional(),Country:f.z.string(),State:f.z.string(),City:f.z.string(),Zip:f.z.string(),Telephone:f.z.string(),"Email Address":f.z.string().email(),"Serial Number":f.z.string(),"Purchase Date":f.z.string(),"Purchased From":f.z.string(),termsAndConditions:f.z.preprocess(e=>"boolean"==typeof e?e?"true":"false":e,f.z.enum(["true","false"])),Claim:f.z.string().optional(),ClaimWarranty__c:f.z.enum(["warranty","claim"])});let S=(0,A.F)(f.z.object({firstName:f.z.string({errorMap:()=>({message:(0,C.m)("First Name")})}).min(1),lastName:f.z.string({errorMap:()=>({message:(0,C.m)("Last Name")})}).min(1),licenseNo:f.z.string({errorMap:()=>({message:(0,C.m)("License")})}).min(1),streetAddress1:f.z.string({errorMap:()=>({message:(0,C.m)("Street Address 1")})}).min(1),streetAddress2:f.z.string().optional(),country:f.z.string({errorMap:()=>({message:(0,C.m)("Country")})}).min(1),state:f.z.string(),city:f.z.string({errorMap:()=>({message:(0,C.m)("City")})}).min(1),zip:f.z.string(),phoneNo:f.z.string({errorMap:()=>({message:(0,C.m)("Telephone")})}).min(1),emailAddress:f.z.string().email(),serialNo:f.z.string({errorMap:()=>({message:(0,C.m)("Serial Number")})}).min(1),purchaseDate:f.z.string({errorMap:()=>({message:(0,C.m)("Purchase Date")})}).min(1),purchaseFrom:f.z.string({errorMap:()=>({message:(0,C.m)("Purchased From")})}).min(1),termsAndConditions:f.z.literal(!0,{errorMap:()=>({message:o.ag._({id:"page.starlightWarranty.termsRequired"})})}),claim:f.z.string().optional(),locale:f.z.string().min(1),captcha:f.z.string(),starlightWarrantyFormType:f.z.enum(["warranty","claim"])})).superRefine((e,r)=>{"claim"!==e.starlightWarrantyFormType||e.claim&&0!==e.claim.trim().length||r.addIssue({code:f.z.ZodIssueCode.custom,message:(0,C.m)("Claim"),path:["claim"]}),"us"!==e.country.toLowerCase()||e.state&&0!==e.state.trim().length||r.addIssue({code:f.z.ZodIssueCode.custom,message:(0,C.m)("State"),path:["state"]}),new Date(e.purchaseDate)>=new Date&&r.addIssue({code:f.z.ZodIssueCode.custom,path:["purchaseDate"],message:o.ag._({id:"form.futureDateValidation"})}),"en-us"!==e.locale.toLowerCase()||e.zip&&0!==e.zip.trim().length||r.addIssue({path:["zip"],code:f.z.ZodIssueCode.custom,message:(0,C.m)("Zip")})});var F=t(54359),w=t.n(F),q=t(30829),v=t.n(q);let M=()=>{let e=(0,j.qp)(i.vQ),r=(0,y.useRouter)(),t=(0,s.CS)(r.locale),[u,f]=(0,_.useState)(""),[C,A]=(0,_.useState)(null),[F,q]=(0,_.useState)([]),[M,k]=(0,_.useState)("warranty"),{title:D,termsAndConditionsUrl:P,copy:Z,image:T,seo:L,toAddress:I}=e,{register:E,handleSubmit:B,watch:R,setValue:O,formState:{errors:U}}=(0,N.cI)({defaultValues:{firstName:"",lastName:"",licenseNo:"",streetAddress1:"",streetAddress2:"",country:"",state:"",city:"",zip:"",phoneNo:"",emailAddress:"",serialNo:"",purchaseDate:"",purchaseFrom:"",termsAndConditions:!1,captcha:"",locale:t,starlightWarrantyFormType:"warranty"},resolver:(0,n.F)(S)});R(()=>q([]));let{data:V=[],isLoading:H}=(0,g.a)({queryKey:["countries"],queryFn:()=>new d.Z(t).getCountries()}),Q=(0,a.jsx)(z.U,{responseCallback:e=>{f(e),O("captcha",e),A(null)},expireCallback:()=>f(""),errorCallback:()=>f(""),renderCallback:()=>{f(""),A(null)},error:C}),J=(0,m.D)({mutationFn:e=>fetch("/api/starlight-form",{method:"POST",body:JSON.stringify(e)}).then(e=>{if(!e.ok)throw Error("Error submitting form");return e.json()}),onSuccess:()=>{window.scrollTo({top:0,behavior:"smooth"})},onSettled(){f(""),window?.grecaptcha?.reset()}}),K=async e=>{if((0,z.l)()&&!u){A({message:"reCAPTCHA verification is required",name:"CAPTCHA_REQUIRED"});return}J.mutate(e)},$=e=>{k(e),O("starlightWarrantyFormType",e)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.O,{title:D}
1),(0,a.jsx)(x.PB,{title:L?.title,description:L?.description}),(0,a.jsxs)("div",{className:(0,p.Z)(w().formPage,"container grid"),children:[(0,a.jsxs)("div",{className:(0,p.Z)("col xs4 l2-5"),children:[(0,a.jsx)("h2",{className:(0,p.Z)("text-heading-h2-desktop text-heading-h2-mobile",w().formPage__title),children:D}),!J.isSuccess&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-body-small-desktop text-body-small-mobile",children:(0,a.jsx)(l.cC,{id:"page.starlightWarranty.selectAccountType"})}),(0,a.jsxs)("div",{className:v().starlightWarranty__radioButtons,children:[(0,a.jsx)(W.mc,{type:"radio",id:"register_type",name:"starlight_warranty_type",className:"radio__input",checked:"warranty"===M,onChange:()=>{$("warranty")},label:o.ag._({id:"page.starlightWarranty.register"})}),(0,a.jsx)(W.mc,{type:"radio",id:"claim_type",name:"starlight_warranty_type",className:"radio__input",checked:"claim"===M,onChange:()=>{$("claim")},label:o.ag._({id:"page.starlightWarranty.claim"})})]})]}),!J.isSuccess&&(0,a.jsxs)("form",{onSubmit:B(K),noValidate:!0,children:[(0,a.jsx)("input",{type:"hidden",id:"locale",...E("locale"),style:{display:"none"}}),(0,a.jsx)("input",{type:"hidden",style:{display:"none"},...E("captcha"),value:u}),(0,a.jsx)("input",{type:"hidden",...E("starlightWarrantyFormType"),style:{display:"none"}}),(0,a.jsxs)("fieldset",{disabled:J.isLoading,children:[(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)(W.Wi,{type:"text",id:"firstName",error:U.firstName,required:!0,label:o.ag._({id:"page.starlightWarranty.firstName"}),register:()=>E("firstName")}),(0,a.jsx)(W.Wi,{type:"text",id:"lastName",error:U.lastName,required:!0,label:o.ag._({id:"page.starlightWarranty.lastName"}),register:()=>E("lastName")}),(0,a.jsx)(W.Wi,{type:"text",id:"registerLicenseNo",required:!0,error:U.licenseNo,label:o.ag._({id:"page.starlightWarranty.licenseNo"}),register:()=>E("licenseNo")}),(0,a.jsx)(W.Wi,{type:"text",id:"streetAddress1",error:U.streetAddress1,required:!0,label:o.ag._({id:"page.starlightWarranty.streetAddress1"}),register:()=>E("streetAddress1")}),(0,a.jsx)(W.Wi,{type:"text",id:"streetAddress2",error:U.streetAddress2,label:o.ag._({id:"page.starlightWarranty.streetAddress2"}),register:()=>E("streetAddress2")}),(0,a.jsx)(W.A5,{id:"country",options:"en-US"===t?s.l1:s.eR,error:U.country,loading:H,required:!0,label:o.ag._({id:"page.starlightWarranty.country"}),register:()=>E("country")}),(0,a.jsx)(W.A5,{id:"state",options:(()=>{let e=V?.find(e=>e.code===R("country")&&"US"===e.code);return e?.zones??[]})(),error:U.state,loading:H,required:!0,label:o.ag._({id:"page.starlightWarranty.state"}),register:()=>E("state")}),(0,a.jsx)(W.Wi,{type:"text",id:"city",error:U.city,required:!0,label:o.ag._({id:"page.starlightWarranty.city"}),register:()=>E("city")}),(0,a.jsx)(W.Wi,{type:"text",id:"zipCode",error:U.zip,required:!0,label:o.ag._({id:"page.starlightWarranty.zip"}),register:()=>E("zip")}),(0,a.jsx)(W.Wi,{type:"text",id:"phoneNo",error:U.phoneNo,required:!0,label:o.ag._({id:"page.starlightWarranty.phoneNo"}),register:()=>E("phoneNo")}),(0,a.jsx)(W.Wi,{type:"text",id:"emailAddress",error:U.emailAddress,required:!0,label:o.ag._({id:"page.starlightWarranty.emailAddress"}),register:()=>E("emailAddress")}),(0,a.jsx)(W.Wi,{type:"text",id:"serialNo",error:U.serialNo,required:!0,label:o.ag._({id:"page.starlightWarranty.serialNo"}),register:()=>E("serialNo")}),(0,a.jsx)("p",{className:v().starlightWarranty__serialNumberMessage,children:(0,a.jsx)(l.cC,{id:"page.starlightWarranty.serialNumberMessage"})}),(0,a.jsx)(W.Wi,{type:"date",id:"purchaseDate",error:U.purchaseDate,required:!0,min:"1900-01-01",max:new Date().toISOString().split("T")[0],label:o.ag._({id:"page.starlightWarranty.purchaseDate"}),register:()=>E("purchaseDate")}),(0,a.jsx)(W.Wi,{type:"text",id:"purchaseFrom",error:U.purchaseFrom,required:!0,label:o.ag._({id:"page.starlightWarranty.purchasedFrom"}),register:()=>E("purchaseFrom")}),"claim"===M&&(0,a.jsx)(W.wg,{id:"claim",error:U.claim,label:o.ag._({id:"page.starlightWarranty.claimCopy"}),maxLength:2e3,required:!0,loading:!1,register:()=>E("claim")}),(0,a.jsx)("div",{className:v().starlightWarranty__copy,children:Z}),(0,a.jsx)(W.h3,{id:"termsAndConditionsButton",label:(0,a.jsx)(l.cC,{components:{0:(0,a.jsx)("a",{target:"_blank",href:P,rel:"noreferrer","aria-label":o.ag._({id:"signupForm.termsAndConditionsButton"})})},id:"page.starlightWarranty.terms"}),required:!0,error:U.termsAndConditions,loading:!1,register:()=>E("termsAndConditions")})]}),Q,(0,a.jsx)("div",{className:w().formPage__footer,children:J.isSuccess?null:(0,a.jsx)(c.z,{disabled:J.isLoading||!I,type:"submit",children:"Submit"})})]}),J.isError&&!J.isSuccess?(0,a.jsx)("div",{className:(0,p.Z)(w().formPage__response,w().formPage__error),children:(0,a.jsx)("p",{className:"text-body-1-mobile text-body-1-desktop",children:(0,a.jsx)(l.cC,{id:"page.starlightWarranty.errorMessage"})})}):null]}),F.length>0&&!J.isSuccess&&(0,a.jsx)("div",{children:F.map((e,r)=>(0,a.jsx)("p",{className:(0,p.Z)(w().formPage__error,"text-body-2-desktop text-body-2-mobile"),children:e},`Error-${r}`))}),J.isSuccess?(0,a.jsx)("div",{className:(0,p.Z)(w().formPage__response),children:(0,a.jsx)("p",{className:"text-body-1-mobile text-body-1-desktop",children:(0,a.jsx)(l.cC,{id:"page.starlightWarranty.successMessage"})})}):null]}),T?.url&&(0,a.jsx)("div",{className:(0,p.Z)(w().formPage__image,"col l7-11 xs1-4"),children:(0,a.jsx)(h(),{src:T.url,alt:T.title,title:T.title,fill:!0,sizes:"(max-width: 1024px) 100vw, 522px"})})]})]})};function k({handle:e}){return(0,a.jsx)(i.hL,{handle:e,children:(0,a.jsx)(M,{})})}t(17011),t(37375),t(5920),t(36218),t(36224),t(2033),t(74690),t(74985),t(59105),t(3556)},30829:function(e){e.exports={starlightWarranty__copy:"StarlightWarrantyForm_starlightWarranty__copy__rlCzM",starlightWarranty__serialNumberMessage:"StarlightWarrantyForm_starlightWarranty__serialNumberMessage__4OUil",starlightWarranty__radioButtons:"StarlightWarrantyForm_starlightWarranty__radioButtons__fZp9y"}}}]); 2//# sourceMappingURL=5244-845711ee7cb3554e.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.