1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2912],{63659:function(e,t,r){r.d(t,{H:function(){return i},N:function(){return n}});let i=/^(([^<>()[\]\\.,;:\s@"]+(.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,n=/^[a-zA-Z0-9.!#$%&â*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/i},92591:function(e,t,r){r.d(t,{II:function(){return a},__:function(){return l},xv:function(){return s},z$:function(){return d}});var i=r(41686),n=r(57738),o=r(7523);let a=i.ZP.input.withConfig({displayName:"Styles__Input",componentId:"sc-c428ba73-0"})(["",";appearance:none;position:absolute;"],(0,n.R4)("0x","0x")),l=i.ZP.label.withConfig({displayName:"Styles__Label",componentId:"sc-c428ba73-1"})(["",";",";margin-bottom:",";"],n.ss,n.cx,e=>{let{noMargin:t}=e;return t?"0":(0,n.bG)("4x")}),d=i.ZP.div.withConfig({displayName:"Styles__Indicator",componentId:"sc-c428ba73-2"})(["position:relative;border:",";",";min-width:",";border-radius:",";background-color:",";&::after{content:'';display:none;}",":checked + &::after{display:block;",";"," ",";border-width:0 1.5px 1.5px 0;","}"],e=>{let{checked:t,theme:r,error:i}=e;return t?i?"2px solid ".concat(r.color.action.medium):"1px solid ".concat(r.color.action.medium):t?void 0:i?"2px solid ".concat(r.color.bias.error.medium):"1px solid ".concat(r.color.text.medium)},(0,n.R4)("5x","5x"),(0,n.bG)("5x"),(0,n.bG)("1x"),e=>{let{checked:t}=e;return t?(0,n.Lq)("action","medium"):(0,n.Lq)("surface","white","xLight")},a,(0,n.JX)("3px","7px"),(0,n.L9)("50%","20%"),e=>{let{theme:{market:t}}=e;return(0,o.tS)(t)?(0,i.iv)(["border:solid white;"]):(0,i.iv)(["border:solid ",";"],(0,n.Lq)("surface","primary","dark"))},(0,n.rn)("fast","forwards")),s=i.ZP.div.withConfig({displayName:"Styles__Text",componentId:"sc-c428ba73-3"})(["margin-left:",";"," color:",";width:100%;"],(0,n.bG)("4x"),n.lA,(0,n.Lq)("text","xDark"))},87005:function(e,t,r){var i=r(85893);r(67294);var n=r(18549),o=r(92591);t.Z=e=>{let{value:t,checked:r,label:a,onChange:l,name:d="",register:s,error:c,noMargin:u=!1}=e;return(0,i.jsxs)(o.__,{noMargin:u,children:[(0,i.jsx)(o.II,{...(null==s?void 0:s.name)?s:{onChange:l,name:d,value:t},type:"checkbox",checked:r,error:c}),(0,i.jsx)(o.z$,{error:c,checked:r}),a&&(0,i.jsx)(o.xv,{id:"checkbox-text",children:(0,i.jsx)(n.Z,{text:a})})]})}},22732:function(e,t,r){r.d(t,{II:function(){return o},OP:function(){return d},__:function(){return a},dk:function(){return c},xv:function(){return s},z$:function(){return l}});var i=r(41686),n=r(57738);let o=i.ZP.input.withConfig({displayName:"Styles__Input",componentId:"sc-e012f992-0"})(["",";appearance:none;"],(0,n.R4)("0x","0x")),a=i.ZP.label.withConfig({displayName:"Styles__Label",componentId:"sc-e012f992-1"})(["",";",";",";gap:",";position:relative;margin-bottom:",";"],n.g3,e=>{let{alignStart:t}=e;return t&&n.ss},n.cx,e=>{let{textSpacing:t}=e;return t?"":(0,n.bG)("6x")},(0,n.bG)("4x")),l=i.ZP.div.withConfig({displayName:"Styles__Indicator",componentId:"sc-e012f992-2"})(["border:",";position:absolute;border-radius:",";",";background-color:",";&::after{content:'';display:none;}",":checked + &::after{display:block;border-radius:",";",";",";"," transform:translate(-50%,-50%);}"],e=>{let{state:t,checked:r,theme:i}=e;return"selected"===t&&r?"none":"default"!==t||r?void 0:"1px solid ".concat(i.color.text.medium)},(0,n.bG)("5x"),(0,n.R4)("5x","5x"),e=>{let{checked:t}=e;return t?(0,n.Lq)("action","medium"):(0,n.Lq)("surface","white","xLight")},o,(0,n.bG)("5x"),(0,n.Cz)("surface","white","xLight"),(0,n.R4)("2x","2x"),(0,n.JX)("50%")),d=i.ZP.div.withConfig({displayName:"Styles__TextWrapper",componentId:"sc-e012f992-3"})([""," ",""],n.fU,n.i3),s=i.ZP.div.withConfig({displayName:"Styles__Text",componentId:"sc-e012f992-4"})([""," color:",";",""],n.lA,(0,n.Lq)("text","xDark"),e=>{let{textSpacing:t}=e;return t?(0,n.XA)("0x","0x","0x","".concat(t)):""}),c=i.ZP.div.withConfig({displayName:"Styles__Description",componentId:"sc-e012f992-5"})([""," color:"," "," ",""],n.lW,(0,n.Lq)("text","xDark"),(0,n.XA)("0x","0x","0x","5x"),e=>{let{textSpacing:t}=e;return t?(0,n.XA)("0x","0x","0x","".concat(t)):""})},64031:function(e,t,r){var i=r(85893);r(67294);var n=r(22732),o=r(18549);t.ZP=e=>{let{value:t,onChange:r,name:a,label:l,checked:d,state:s="default",register:c,dataQa:u,textSpacing:
1x,description:m,ariaLabel:p}=e;return(0,i.jsxs)(n.__,{textSpacing:x,children:[(0,i.jsx)(n.II,{...(null==c?void 0:c.name)?c:{onChange:r,name:a},type:"radio",value:t,checked:d,"data-qa":u,"aria-label":l||p}),(0,i.jsx)(n.z$,{state:s,checked:d}),m?(0,i.jsxs)(n.OP,{children:[(0,i.jsx)(n.xv,{className:"radio--text",textSpacing:x,children:l}),m&&Array.from(new DOMParser().parseFromString(m,"text/html").body.childNodes).some(e=>1===e.nodeType)?(0,i.jsx)(n.dk,{className:"radio--description",textSpacing:x,children:(0,i.jsx)(o.Z,{text:m})}):(0,i.jsx)(n.dk,{textSpacing:x,children:m})]}):(0,i.jsx)(n.xv,{textSpacing:x,children:l})]})}},83402:function(e,t,r){r.d(t,{P:function(){return v},Z:function(){return y}});var i=r(85893),n=r(67294),o=r(38404),a=r(41686),l=r(57738);let d=a.ZP.div.withConfig({displayName:"Styles__Wrapper",componentId:"sc-c2297b24-0"})(["margin-bottom:",";"],(0,l.bG)("4x")),s=a.ZP.div.withConfig({displayName:"Styles__SelectContainer",componentId:"sc-c2297b24-1"})(["",";"],l.fU),c=a.ZP.div.withConfig({displayName:"Styles__Selectwrapper",componentId:"sc-c2297b24-2"})(["position:relative;cursor:",";width:100%;"],e=>{let{disabled:t}=e;return t?"not-allowed":"pointer"}),u=a.ZP.select.withConfig({displayName:"Styles__StyledSelect",componentId:"sc-c2297b24-3"})(["border:",";cursor:",";appearance:none;border-radius:",";",";",";",";outline:none;",";background-color:",";&:hover{border:",";}"],e=>{let{isOpen:t,theme:r,error:i}=e;return t&&!i?"2px solid ".concat(r.color.text.xDark,";"):i?"1px solid ".concat(r.color.bias.error.medium,";"):"1px solid ".concat(r.color.surface.neutral.medium,";")},e=>{let{disabled:t}=e;return t?"not-allowed":"pointer"},(0,l.bG)("2x"),l.UR,(0,l.L9)("56px","100%"),(0,l.Yo)("6x","4x","1x","4x"),(0,l.$_)("text","xDark"),e=>{let{disabled:t,error:r}=e;return t?(0,l.Lq)("surface","neutral","xLight"):r?(0,l.Lq)("bias","error","xLight"):void(0,l.Lq)("surface","white","xLight")},e=>{let{disabled:t,theme:r,error:i}=e;return t?"1px solid ".concat(r.color.surface.neutral.medium,";"):i?"1px solid ".concat(r.color.bias.error.medium,";"):"1px solid ".concat(r.color.text.xDark,";")}),x=(0,a.ZP)(o.ZP).withConfig({displayName:"Styles__StyledIcon",componentId:"sc-c2297b24-4"})(["",";"],(0,l.JX)("35%","unset","16px","unset")),m=a.ZP.span.withConfig({displayName:"Styles__SelectedValue",componentId:"sc-c2297b24-5"})(["",";",";transform:",";color:",";",";"],e=>{let{hasValue:t}=e;return t?(0,l.JX)("70%","5px"):(0,l.JX)("20px","16px")},l.UR,e=>{let{hasValue:t}=e;return t?"translateY(-50%) scale(0.9)":"none"},e=>{let{hasValue:t}=e;return t?(0,l.Lq)("text","xDark"):"transparent"},l.Bp),p=a.ZP.div.withConfig({displayName:"Styles__ErrorText",componentId:"sc-c2297b24-6"})(["",";",";margin-top:",";"],(0,l.$_)("bias","error","medium"),(0,l.Se)(l.lW),(0,l.bG)("2x")),h=a.ZP.div.withConfig({displayName:"Styles__StyledLabel",componentId:"sc-c2297b24-7"})(["",";",";",";",";",";"],e=>{let{hasValue:t}=e;return t?(0,l.JX)("6px","16px"):(0,l.JX)("15px","16px")},e=>{let{hasValue:t}=e;return t?l.lW:l.UR},(0,l.rf)("rapid","swift"),l.Bp,(0,l.$_)("text","dark")),f=a.ZP.div.withConfig({displayName:"Styles__DropdownStyle",componentId:"sc-c2297b24-8"})(["",";width:100%;max-height:300px;",";",";z-index:10;",";border:1px solid ",";border-radius:",";overflow:scroll;",""],(0,l.JX)("60px","0px"),l.i3,l.fU,(0,l.Cz)("surface","white","xLight"),(0,l.Lq)("surface","neutral","medium"),(0,l.bG)("2x"),e=>{let{isVisible:t}=e;return!0!==t&&(0,a.iv)(["visibility:hidden;"])}),b=a.ZP.div.withConfig({displayName:"Styles__DropdownItem",componentId:"sc-c2297b24-9"})([""," ",";",";",";",";",";&:hover,:focus,:focus:hover{",";outline:none;}"],l.lA,l.g3,(0,l.U_)("1x","0x"),(0,l.Du)("2x","4x"),(0,l.$_)("text","xDark"),l.cx,(0,l.Cz)("surface","neutral","light"));a.ZP.span.withConfig({displayName:"Styles__LabelAsterisk",componentId:"sc-c2297b24-10"})(["color:#eb6a6e;line-height:normal;"]);let v=e=>{let{options:t,label:r,disabled:o,error:a,errorTxt:l,name:v,register:y,value:g="",onChange:w}=e,[_,S]=(0,n.useState)(g),[Z,C]=(0,n.useState)(!1),j=(e,t)=>{!o&&(S(e.text||e.value),w&&w(v,e.value,t,e))};return(0,i.jsxs)(d,{children:[(0,i.jsx)(s,{onClick:()=>{o||C(e=>!e)},children:(0,i.jsxs)(c,{disabled:o,children:[(0,i.jsx)(u,{disabled:o,isOpen:Z,error:a}),(0,i.jsx)(x,{family:"caret",size:"sm",type:Z?"up":"down"}),(0,i.jsx)(h,{hasValue:_,children:r}),_&&(0,i.jsx)(m,{hasValue:_,children:_}),(0,i.jsx)(f,{role:"listbox",isVisible:Z,children:null==t?void 0:t.map((e,t)=>(0,n.createElement)(b,{...y,onClick:()=>j(e,t),active:(null==e?void 0:e.value)===_,key:t},e.text||e.value))})]})}),a&&(0,i.jsx)(p,{children:l}),y&&(0,i.jsx)("input",{type:"hidden",name:v,value:_,...y})]})};var y=v},54221:function(e,t,r){r.d(t,{K:function(){return x},Z:function(){return m}});var i=r(85893),n=r(67294),o=r(41686),a=r(57738);let l=o.ZP.div.withConfig({displayName:"Styles__Wrapper",componentId:"sc-80cbdbf3-0"})(["margin-bottom:",";"],(0,a.bG)("4x")),d=o.ZP.div.withConfig({displayName:"Styles__InputContainer",componentId:"sc-80cbdbf3-1"})(["position:relative;",""],a.fU),s=o.ZP.textarea.withConfig({displayName:"Styles__Input",componentId:"sc-80cbdbf3-2"})(["border:",";cursor:",";border-radius:",";",";",";",";",";outline:none;box-sizing:border-box;",";background-color:",";",";&:hover{border:",";}:focus-within{border:",";}"],e=>{let{focused:t,theme:r,value:i,error:n}=e;return t&&!i?"2px solid ".concat(r.color.text.xDark,";"):n?"1px solid ".concat(r.color.bias.error.medium,";"):"1px solid ".concat(r.color.surface.neutral.medium,";")},e=>{let{disabled:t}=e;return t?"not-allowed":"pointer"},(0,a.bG)("2x"),a.UR,(0,a.L9)("110px","335px"),e=>{let{fullWidth:t}=e;return t&&"width: 100%;"},(0,a.Yo)("6x","4x","1x","4x"),(0,a.$_)("text","xDark"),e=>{let{disabled:t,error:r}=e;return t?(0,a.Lq)("surface","neutral","xLight"):r?(0,a.Lq)("bias","error","xLight"):void(0,a.Lq)("surface","white","xLight")},e=>{let{focused:t}=e;return t&&(0,o.iv)(["& + label{transform:translateY(-20px);}"])},e=>{let{disabled:t,theme:r,error:i}=e;return t?"1px solid ".concat(r.color.surface.neutral.medium,";"):i?"1px solid ".concat(r.color.bias.error.medium,";"):"1px solid ".concat(r.color.text.xDark,";")},e=>{let{theme:t,error:r}=e;return r?"2px solid ".concat(t.color.bias.error.medium,";"):"2px solid ".concat(t.color.text.xDark)}),c=o.ZP.label.withConfig({displayName:"Styles__StyledLabel",componentId:"sc-80cbdbf3-3"})(["",";",";",";",";",";"],e=>{let{hasValue:t}=e;return t?(0,a.JX)("30px","16px"):(0,a.JX)("12px","16px")},e=>{let{hasValue:t}=e;return t?a.lW:a.UR},(0,a.rf)("fast","swift"),a.Bp,(0,a.$_)("text","dark")),u=o.ZP.div.withConfig({displayName:"Styles__ErrorText",componentId:"sc-80cbdbf3-4"})(["",";",";margin-top:",";"],(0,a.$_)("bias","error","medium"),(0,a.Se)(a.lW),(0,a.bG)("2x")),x=e=>{let{value:t,label:r,onChange:o,disabled:a,error:x,errorTxt:m,register:p,name:h,fullWidth:f}
1=e,[b,v]=(0,n.useState)(!1);return(0,i.jsxs)(l,{children:[(0,i.jsxs)(d,{children:[(0,i.jsx)(s,{...(null==p?void 0:p.name)?p:{onChange:o,name:h},focused:b||t,value:t,onFocus:()=>v(!0),onBlur:()=>v(!1),disabled:a,fullWidth:f,error:x}),(0,i.jsx)(c,{hasValue:b||t,children:r})]}),x&&(0,i.jsx)(u,{children:m})]})};var m=x},58151:function(e,t,r){r.d(t,{Z:function(){return p}});var i=r(85893),n=r(20745),o=r(51715),a=r(38404),l=r(41686),d=r(57738);let s=l.ZP.div.withConfig({displayName:"Styles__NotificationWrapper",componentId:"sc-8ec1f76b-0"})([""," width:100%;max-width:325px;z-index:10;@media ","{"," bottom:",";width:100%;max-width:none;}"],(0,d.Az)("94px","24px"),e=>{let{theme:{device:t}}=e;return t.tabletSmall},(0,d.Az)("auto","0px"),e=>{let{bottomOffset:t}=e;return t?"".concat(t):(0,d.bG)("0x")}),c=l.ZP.div.withConfig({displayName:"Styles__AnimatedComponent",componentId:"sc-8ec1f76b-1"})(["",";border-radius:",";",";",";"," ",";@media ","{","}background-color:",";"],(0,d.eZ)("fast","swift","-20px","0px","slow","forwards"),(0,d.bG)("2x"),(0,d.Wn)("medium"),(0,d.Du)("4x","5x"),d.fU,(0,d.$_)("surface","white","xLight"),e=>{let{theme:{device:t}}=e;return t.tabletSmall},(0,d.e6)("4x"),e=>{let{type:t}=e;return"neutral"===t?(0,d.Lq)("surface","primary","dark"):"negative"===t?(0,d.Lq)("bias","error","xDark"):"positive"===t?(0,d.Lq)("bias","success","xDark"):(0,d.Lq)("surface","primary","dark")}),u=l.ZP.div.withConfig({displayName:"Styles__ToastContent",componentId:"sc-8ec1f76b-2"})(["flex:1;width:100%;padding-left:",";"],(0,d.bG)("3x")),x=l.ZP.div.withConfig({displayName:"Styles__Text",componentId:"sc-8ec1f76b-3"})(["",""],d.lA),m=e=>{let{text:t,type:r="neutral"}=e;return(0,i.jsxs)(c,{type:r,children:[(0,i.jsx)(a.ZP,{size:"md",family:"negative"!==r?"checkmark":"fail",type:"invertedNoBG"}),(0,i.jsx)(u,{children:(0,i.jsx)(x,{children:t})})]})};var p=e=>{var t,r,a;let{text:l,type:d,bottomOffset:c}=e,u=null===(t=document)||void 0===t?void 0:t.createElement("div");null===(a=document)||void 0===a||null===(r=a.body)||void 0===r||r.appendChild(u),(0,n.createRoot)(u).render((0,i.jsx)(o.ZP,{children:(0,i.jsx)(s,{bottomOffset:c,children:(0,i.jsx)(m,{text:l,type:d})})}))}},2912:function(e,t,r){r.r(t),r.d(t,{WrappedDynamicForm:function(){return W},default:function(){return A}});var i=r(85893),n=r(67294),o=r(41686),a=r(57738);let l=o.ZP.div.withConfig({displayName:"Styles__Container",componentId:"sc-f7238d18-0"})([""," "," margin:"," auto;",";@media ","{"," margin:"," auto;padding:0 ",";","}"],a.nC,a.fU,(0,a.bG)("20x"),(0,a.SG)("5x"),e=>{let{theme:t}=e;return t.device.tabletSmall},a.i3,(0,a.bG)("10x"),(0,a.bG)("5x"),a.g3),d=o.ZP.div.withConfig({displayName:"Styles__TextWrapper",componentId:"sc-f7238d18-1"})(["width:50%;"," "," "," "," @media ","{width:100%;padding:"," ",";","}"],a.fU,a.i3,(0,a.SG)("5x"),(0,a.$_)("text","xDark"),e=>{let{theme:t}=e;return t.device.tabletSmall},(0,a.bG)("10x"),(0,a.bG)("0x"),(0,a.SG)("2x")),s=o.ZP.form.withConfig({displayName:"Styles__FormWrapper",componentId:"sc-f7238d18-2"})(["width:50%;"," "," "," "," border:1px solid ",";#checkbox-text{width:auto;> div{width:auto;}}input{width:100%;@media ","{width:480px;}}@media ","{width:100%;","}"],(0,a.Cz)("surface","white","xLight"),(0,a.Wn)("medium"),(0,a.o3)("8x"),(0,a.E0)("2x"),(0,a.Lq)("surface","neutral","medium"),e=>{let{theme:{device:t}}=e;return t.notPhone},e=>{let{theme:t}=e;return t.device.tabletSmall},(0,a.o3)("5x")),c=o.ZP.div.withConfig({displayName:"Styles__RichTextWrapper",componentId:"sc-f7238d18-3"})(["> div{word-wrap:break-word;a{display:inline;}}"]),u=o.ZP.h3.withConfig({displayName:"Styles__Title",componentId:"sc-f7238d18-4"})(["@media ","{","}"],e=>{let{theme:t}=e;return t.device.tabletSmall},a.kE),x=o.ZP.div.withConfig({displayName:"Styles__FormRow",componentId:"sc-f7238d18-5"})([""," ",";align-items:stretch;width:100%;span{width:100%;}input,select,textarea{width:100%;}textarea{height:140px;}label{div{width:20px;}}div{width:100%;}"],a.fU,(0,a.SG)("4x")),m=o.ZP.div.withConfig({displayName:"Styles__FormRowItem",componentId:"sc-f7238d18-6"})(["flex:1 1 0;width:100%;div{width:100%;}"]),p=o.ZP.div.withConfig({displayName:"Styles__ButtonWrapper",componentId:"sc-f7238d18-7"})(["max-width:320px;margin-top:",";@media ","{margin-top:",";max-width:100%;}"],(0,a.bG)("5x"),e=>{let{theme:t}=e;return t.device.tabletSmall},(0,a.bG)("4x"));var h=r(47533),f=r(87536),b=r(16310),v=r(25212),y=r(50290),g=r(64031),w=r(54221),_=r(83402),S=r(87005),Z=r(18549),C=r(63659),j=r(11163),k=r(58151),P=r(98964),I=r(86664);let N=o.ZP.div.withConfig({displayName:"Styles__Wrapper",componentId:"sc-7179c0ae-0"})(["margin-bottom:",";"],(0,a.bG)("4x")),L=o.ZP.div.withConfig({displayName:"Styles__CardElementWrapper",componentId:"sc-7179c0ae-1"})(["border:1px solid ",";border-radius:",";padding:",";background-color:",";transition:border-color 150ms ease-in-out;&:focus-within{border:2px solid ",";}.StripeElement{padding:",";font-size:16px;color:",";}"],(0,a.Lq)("surface","neutral","medium"),(0,a.bG)("2x"),(0,a.bG)("4x"),(0,a.Lq)("surface","white","xLight"),(0,a.Lq)("text","xDark"),(0,a.bG)("2x"),(0,a.Lq)("text","xDark")),T=o.ZP.div.withConfig({displayName:"Styles__ErrorText",componentId:"sc-7179c0ae-2"})(["",";",";margin-top:",";"],(0,a.$_)("bias","error","medium"),(0,a.Se)(a.lW),(0,a.bG)("2x"));var G=e=>{let{error:t,field:r,setCardElement:n}=e,o=(0,I.useElements)();return(0,i.jsxs)(N,{children:[(0,i.jsx)(L,{children:(0,i.jsx)(I.CardElement,{options:{style:{base
1:{fontSize:"16px",color:"#32325d","::placeholder":{color:"#a0aec0"}},invalid:{color:"#fa755a"}},hidePostalCode:!0},onChange:e=>{e.complete?(n(null==o?void 0:o.getElement(I.CardElement)),r.onChange(!0)):r.onChange(null)}})}),t&&(0,i.jsx)(T,{children:t})]})},q=r(2859);let z=e=>{let t={};return e.forEach(e=>{var r;let i;("select"!==e.fieldType&&"radio"!==e.fieldType||(null===(r=e.options)||void 0===r?void 0:r.length))&&(i=(0,P.EQ)(e.fieldType).with("date","text","textarea",()=>b.Z_()).with("email",()=>b.Z_().matches(C.H,"Please enter a valid email")).with("number",()=>b.Rx().positive().integer().typeError("Please enter a valid ".concat(e.label.toLowerCase()))).with("checkbox",()=>b.O7()).with("radio",()=>b.Z_()).with("select",()=>b.Z_().oneOf(e.options||[],"Please select an option")).with("payment",()=>b.nK().test("Please enter payment details",e=>null!==e)).exhaustive(),e.required&&(i="checkbox"===e.fieldType?i.equals([!0],"".concat(e.label," must be checked")):i.required("".concat(e.label," is required"))),t[e.name]=i)}),b.Ry().shape(t)},D=(e,t)=>{let r=[];for(let o=0;o<e.length;o++){var n;e[o].alignHorizontal&&(null===(n=e[o+1])||void 0===n?void 0:n.alignHorizontal)?(r.push((0,i.jsxs)(x,{children:[(0,i.jsx)(m,{children:t(e[o])}),(0,i.jsx)(m,{children:t(e[o+1])})]},o)),o++):r.push((0,i.jsx)(x,{children:t(e[o])},o))}return r},E=e=>{let{title:t,description:r,contentAreaButton:o,fields:a}
1=e,[x,m]=(0,n.useState)(!1),[b,C]=(0,n.useState)(void 0),N=(0,j.useRouter)(),L=(0,I.useStripe)(),T=z(a),{register:q,handleSubmit:E,watch:W,setValue:A,formState:{errors:R,isValid:$},control:U}=(0,f.cI)({resolver:(0,h.X)(T),mode:"all"}),X=(e,t)=>{A(e,t,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},J=(0,n.useCallback)(e=>{let t=W(e.name);return(0,P.EQ)(e.fieldType).with("text","email",()=>{var r;return(0,i.jsx)(y.Z,{inputType:"text",name:e.name,label:e.label,register:q(e.name),value:t,error:R[e.name],errorTxt:e.errorText||(null===(r=R[e.name])||void 0===r?void 0:r.message)||""})}).with("textarea",()=>{var r;return(0,i.jsx)(w.Z,{name:e.name,label:e.label,register:q(e.name),value:t,error:R[e.name],errorTxt:e.errorText||(null===(r=R[e.name])||void 0===r?void 0:r.message)||""})}).with("date",()=>{var r;return(0,i.jsx)(y.Z,{inputType:"date",name:e.name,label:e.label,register:q(e.name),value:t,error:R[e.name],errorTxt:e.errorText||(null===(r=R[e.name])||void 0===r?void 0:r.message)||""})}).with("number",()=>{var r;return(0,i.jsx)(y.Z,{inputType:"number",name:e.name,label:e.label,register:q(e.name),value:t,error:R[e.name],errorTxt:e.errorText||(null===(r=R[e.name])||void 0===r?void 0:r.message)||""})}).with("radio",()=>{var r,n;return(0,i.jsx)(i.Fragment,{children:(null==e?void 0:e.options)&&(null==e?void 0:null===(r=e.options)||void 0===r?void 0:r.length)&&(null==e?void 0:null===(n=e.options)||void 0===n?void 0:n.map(r=>(0,i.jsx)(g.ZP,{name:e.name,checked:t===r,label:r,register:q(e.name),value:r},r)))})}).with("checkbox",()=>(0,i.jsx)(S.Z,{name:e.name,label:e.label,register:q(e.name),value:t,checked:t,error:R[e.name]})).with("select",()=>{var r,n,o;return(null==e?void 0:e.options)&&(null==e?void 0:null===(r=e.options)||void 0===r?void 0:r.length)&&(0,i.jsx)(_.Z,{name:e.name,options:null==e?void 0:null===(n=e.options)||void 0===n?void 0:n.map(e=>({value:e})),register:q(e.name),error:R[e.name],value:t,errorTxt:e.errorText||(null===(o=R[e.name])||void 0===o?void 0:o.message)||"",onChange:X,label:e.initialSelectValue})}).with("payment",()=>(0,i.jsx)(f.Qr,{name:e.name,control:U,defaultValue:null,render:e=>{var t;let{field:r,fieldState:n}=e;return(0,i.jsx)(G,{field:r,error:null===(t=n.error)||void 0===t?void 0:t.message,setCardElement:C})}})).exhaustive()},[W,q,R,X]),O=(0,n.useCallback)(async e=>{m(!0);try{if(b){let t=await fetch("/api/create-payment-intent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),{clientSecret:r}=await t.json();if(!L){console.error("Stripe.js has not loaded");return}if(!b){console.error("Card Element not found");return}let{error:i}=await L.confirmCardPayment(r,{payment_method:{card:b,billing_details:{name:"".concat(e.firstName," ").concat(e.lastName),email:e.email}}});if(i){console.error("Payment failed:",i.message);return}}}catch(e){console.error("Error submitting payment:",e.message),(0,k.Z)({text:"There was an error while processinng the payment",type:"negative"});return}try{let t=await fetch("/api/forms/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let e=await t.json();throw Error(e.error||"An unexpected error occurred.")}let r=await t.json();r.redirect?N.push(r.redirect):(0,k.Z)({text:"Form submitted successfully",type:"positive"})}catch(e){console.error("Error:",e.message),(0,k.Z)({text:"There was an error while submitting the form",type:"negative"})}finally{m(!1)}},[N,b]),F=(0,n.useMemo)(()=>D(a,J),[a,J]);return(0,i.jsxs)(l,{children:[(0,i.jsxs)(d,{children:[(0,i.jsx)(u,{children:t}),(0,i.jsx)(c,{children:(0,i.jsx)(Z.Z,{text:r})}),o&&(null==o?void 0:o.text)&&(null==o?void 0:o.onClick)&&(0,i.jsx)(p,{children:(0,i.jsx)(v.Z,{type:"secondary",...o})})]}),(0,i.jsxs)(s,{onSubmit:E(O),children:[F,(0,i.jsx)(v.Z,{text:"Submit",type:"primary",disabled:!$||x,state:x?"loading":"default"})]})]})},W=e=>{let t=(0,n.useMemo)(()=>{let e="pk_live_p5MjPHa6TUd8rYu1wXduONWt00IzKdgwzG";return e?(0,q.J)(e):null},[]);return null===t?null:(0,i.jsx)(I.Elements,{stripe:t,children:(0,i.jsx)(E,{...e})})};var A=W}}]);
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.