1import{a as H}from"/build/_shared/chunk-ELXM45ZL.js";import{d as A,e as W}from"/build/_shared/chunk-6XX3ATVP.js";import{E as n,T as B,a as _}from"/build/_shared/chunk-TQS5E2SK.js";import{v as S}from"/build/_shared/chunk-RBFCHJWR.js";import{a as re}from"/build/_shared/chunk-JUM7J4TY.js";import{a as O}from"/build/_shared/chunk-RW7BUM27.js";import{e as y}from"/build/_shared/chunk-ADMCF34Z.js";var s=y(re());var e=y(O());var me=({title:j,infoModalText:z,iconSrc:G,setNetDepositFocussedField:U,isSectionInvalid:q,isTandCChecked:D,onSectionErrorChange:f,onLimitsChange:J,onTncChange:h,onBlur:m,currencySymbol:l})=>{var V,g,k,C,T,w;let{skinId:K}=S("root"),d=[16,17,2,3].includes(Number(K))?5:10,[a,P]=(0,s.useState)(0),[Q,b]=(0,s.useState)(!1),[t,r]=(0,s.useState)({dailyDepositLimitValue:"",weeklyDepositLimitValue:"",monthlyDepositLimitValue:"",setNetDepositLimitsLater:!1}),[X,Y]=(0,s.useState)(!1),N=(0,s.useRef)(!0),x=!!t.dailyDepositLimitValue.trim()||!!t.weeklyDepositLimitValue.trim()||!!t.monthlyDepositLimitValue.trim(),v=(q||X)&&!t.setNetDepositLimitsLater,p=(0,s.useRef)(),u=(0,s.useRef)(),c=(0,s.useRef)(),[Z,ee]=(0,s.useState)((g=(V=p.current)==null?void 0:V.nextSibling)==null?void 0:g.innerText),[te,ie]=(0,s.useState)((C=(k=u.current)==null?void 0:k.nextSibling)==null?void 0:C.innerText),[se,oe]=(0,s.useState)((w=(T=c.current)==null?void 0:T.nextSibling)==null?void 0:w.innerText),le=Z||te||se;(0,s.useEffect)(()=>{let i=!t.setNetDepositLimitsLater&&!x&&D;f(i)},[t,f,D]),(0,s.useEffect)(()=>{J(t)},[t.monthlyDepositLimitValue,t.weeklyDepositLimitValue,t.dailyDepositLimitValue]),(0,s.useEffect)(()=>{if(N.current){N.current=!1;return}h&&h(t.setNetDepositLimitsLater)},[t.setNetDepositLimitsLater]);let ae=(i,o)=>{i!==a&&(!v||!x)&&(U(o),P(i))},ne=()=>b(!0),L=(i,o)=>{var E,M,$,I,R,F;ee(((M=(E=p.current)==null?void 0:E.nextSibling)==null?void 0:M.innerText)||""),ie(((I=($=u.current)==null?void 0:$.nextSibling)==null?void 0:I.innerText)||""),oe(((F=(R=c.current)==null?void 0:R.nextSibling)==null?void 0:F.innerText)||""),Y(!i),!i&&o&&(A({net_deposit_status:t.setNetDepositLimitsLater}),W({event:"cro_error",error_message:o||"Invalid net deposit limit value.",form_location:"Registration",net_deposit_status:t.setNetDepositLimitsLater}))};return(0,e.jsxs)("div",{className:`${(le||v)&&!t.setNetDepositLimitsLater?"!border-error !bg-netDepositLimitsBackgroundErrorColour":""} mt-1 p-4 border-2 border-modalHeaderTitleColor rounded-2xl`,children:[(0,e.jsxs)("div",{className:"p-1 pb-4 flex items-center text-netDepositLimitsTitleColour font-bold",children:[j,(0,e.jsx)(_,{svgSource:G,onClick:ne,className:"ml-2 cursor-pointer"})]}),(0,e.jsx)("div",{className:"p-2 pt-4 rounded border-2 border-modalHeaderTitleColor bg-backgroundColor flex items-center text-netDepositLimitsTitleColour",children:(0,e.jsx)(n,{name:"setNetDepositLimitsLater",type:"checkbox",label:"Set my deposit limits later",defaultValue:t.setNetDepositLimitsLater,inputOnChange:i=>{r(o=>({...o,setNetDepositLimitsLater:i}))}},"setNetDepositLimitsLater")}),(0,e.jsxs)("div",{className:`${t.setNetDepositLimitsLater?"hidden":""}`,children:[(0,e.jsx)("div",{className:"netDepositTabsList",children:(0,e.jsx)("nav",{className:"flex justify-between items-center my-4",children:(0,e.jsx)("ul",{className:"flex justify-between w-full list-none m-auto p-0",children:["Daily","Weekly","Monthly"].map((i,o)=>(0,e.jsx)("li",{className:` 2 text-base cursor-pointer 3 transition-colors duration-200 4 ease-in-out 5 flex 6 flex-col flex-1 items-center 7 py-3 8 ${a===o?"font-bold border-netDepositLimitsTabBorderColour border-b-4 pb-4":"border-b-2 !border-grey"}`,onClick:()=>ae(o,i),role:"button",children:(0,e.jsx)("div",{className:"flex flex-col flex-1 items-center justify-center",children:(0,e.jsx)("span",{children:i})})},i))})})}),(0,e.jsx)("div",{className:`${a!==0?"hidden":""} dailyDepositLimits`,children:(0,e.jsx)(n,{name:"dailyDepositLimitValue",className:"pl-4",type:"text",placeholder:`Daily (Min ${l}${d}
8)`,symbol:l,defaultValue:t.dailyDepositLimitValue,allowedCharsExpression:"^\\d*$",onValueChange:i=>{r(o=>({...o,dailyDepositLimitValue:i}))},onBlur:m,onAfterValidation:L,containerRef:p},"dailyDepositLimitValue")}),(0,e.jsx)("div",{className:`${a!==1?"hidden":""} weeklyDepositLimits`,children:(0,e.jsx)(n,{name:"weeklyDepositLimitValue",className:"pl-4",type:"text",placeholder:`Weekly (Min ${l}${d})`,symbol:l,defaultValue:t.weeklyDepositLimitValue,allowedCharsExpression:"^\\d*$",onValueChange:i=>{r(o=>({...o,weeklyDepositLimitValue:i}))},onBlur:m,onAfterValidation:L,containerRef:u},"weeklyDepositLimitValue")}),(0,e.jsx)("div",{className:`${a!==2?"hidden":""} MonthlyDepositLimits`,children:(0,e.jsx)(n,{name:"monthlyDepositLimitValue",className:"pl-4",type:"text",placeholder:`Monthly (Min ${l}${d})`,symbol:l,defaultValue:t.monthlyDepositLimitValue,allowedCharsExpression:"^\\d*$",onValueChange:i=>{r(o=>({...o,monthlyDepositLimitValue:i}))},onBlur:m,onAfterValidation:L,containerRef:c},"monthlyDepositLimitValue")})]}),(0,e.jsx)(B,{title:"Net Deposit Limits",isModalOpen:Q,setIsModalOpen:b,closeSvgSource:"/images/close-icon.svg",modalBodyClassName:"",shouldCloseOnOverlayClick:!1,childrenClassName:"",children:(0,e.jsx)("div",{className:"px-4 py-2 rich-text","safely-set-inner-html":H(z)})})]})},ye=me;export{ye as a};
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.