1import{y as c,J as h,w as t,aP as x,d$ as R}from"./vendor-Ch-OQvtK.js";import{w as j,E as V,S as l}from"./App-C_b51hZm.js";import{P as y,U as p,B as C}from"./index-Caw8Brw0.js";import{P as S,V as M}from"./Validator2fa-I-SAsren.js";/* empty css */import{B as f}from"./BookingStore-5KOrkRrk.js";import{P as O}from"./PopupTpp-BWSw_yHe.js";import"./utilsPaylink-BQxOyhI9.js";import"./logo-tropipay-compact-DkRGDjrY.js";import"./USDCMenuIcon-Dz1ZuFyL.js";import"./DepositAccountStore-lHKHVMbY.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"v0.1263"};var u=new a.Error().stack;u&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[u]="80bc1723-031e-4dea-8a58-d0dda18a159a",a._sentryDebugIdIdentifier="sentry-dbid-80bc1723-031e-4dea-8a58-d0dda18a159a")}catch{}})();const F=()=>{const[a,u]=c.useState(null),[n,E]=c.useState({pin:"",rePin:""}),[e,T]=c.useState(null);c.useEffect(()=>{const o=S.listen(I);return P(),()=>{o()}},[]);const P=()=>{E({pin:"",rePin:""})},_=o=>{S.Create(o)},A=o=>{S.Delete()},I=c.useCallback(o=>{const d={PIN_CREATE_OK:N=>{y.init(),e&&e(),p()},PIN_DELETE_OK:N=>{y.init(),e&&e(),p()}};d[o.type]&&d[o.type](o),o.type.endsWith("_KO")&&(d[o.type]||u(o))},[e]);return{errorData:a,pinCreate:_,pinDelete:A,values:n,setValues:E,clearValues:P,setOkFn:T}},r={MENU:0,ENTER_PIN:1,REENTER_PIN:2,VALIDATE_2FA_PIN:3,SET_PIN_COMPLETE:4,DESACTIVATE_PIN:5,DESACTIVATE_PIN_COMPLETE:6},v=a=>{const{t:u}=a,n=c.useRef(null);n.current=F();const[E,e]=c.useState(r.MENU),T=()=>{p().activePin?e(r.DESACTIVATE_PIN):(n.current.clearValues(),e(r.ENTER_PIN))},P=()=>{var s;return t.jsx(l,{allTexts:"securitySection.SecurityExpressSignature",icon:"",buttonAProps:{color:"secondary"},buttonAAction:()=>e(a.navigate("/security")),children:t.jsxs("div",{className:"d-flex justify-content-between align-items-center w-100",children:[t.jsx("h6",{children:u("Security.expressSignature.pinSignature")}),t.jsx(R,{checked:!!((s=p())!=null&&s.activePin),onClick:T,color:"primary",name:"optpayout",disabled:!p(),"data-test-id":"switch_activate_pin"})]})})},_=()=>t.jsx(l,{allTexts:"securitySection.SecurityExpressSignature.ENTER_PIN",icon:"",buttonAProps:{color:"secondary"},buttonAAction:()=>e(r.MENU),classChildren:"text-center mb-5",children:t.jsx(x,{className:"ReactCodeInput password-input",id:"securityCode",type:"number",pattern:"^\\d+$",fields:4,...C,value:n.current.values.pin,onChange:s=>{n.current.setValues({...n.current.values,pin:s}),s.length===4&&e(r.REENTER_PIN)},"data-test-id":"securityCode",inputMode:"numeric"})}),A=()=>{const s=(i=n.current.values.rePin)=>i.length!==4?!0:n.current.values.pin===i;return t.jsx(l,{allTexts:"securitySection.SecurityExpressSignature.VALIDATE_PIN",icon:"",buttonAProps:{color:"secondary"},buttonAAction:()=>{e(r.MENU)},classChildren:"text-center mb-5",children:t.jsxs(t.Fragment,{children:[t.jsx(x,{className:"ReactCodeInput password-input",id:"securityCode",type:"number",pattern:"^\\d+$",fields:4,value:n.current.values.rePin,isValid:s(),...C,onChange:i=>{n.current.setValues({...n.current.values,rePin:i}),i.length===4&&s(i)&&e(r.VALIDATE_2FA_PIN)},"data-test-id":"securityCode",inputMode:"numeric"}),!s()&&t.jsx("p",{className:"box210 error fs14 text-left mt-3",children:u("2fa.incorrectPin")})]})})},I=({Pin:s})=>{const i=()=>{const b={sendCode:{store:f,fn:f.SendSecurityCode,ok:"SEND_SECURITY_CODE_TRANSFER_OK",ko:"SEND_SECURITY_CODE_TRANSFER_KO",okFn:g=>{e(r.VALIDATE_2FA_PIN)}},validateCode:{store:S,fn:S.Create,ok:"PIN_CREATE_OK",ko:"PIN_CREATE_KO",okFn:g=>{e(r.SET_PIN_COMPLETE)}},cancel:()=>{e(r.MENU)}},D={pin:s.values.pin};return{toSend:b,data:D}};return t.jsx(l,{allTexts:"securitySection.SecurityExpressSignature.VALIDATE_2FA_PIN",icon:"",children:t.jsx(M,{classNameTitle:"hide",toSend:i().toSend,data:i().data})})},o=()=>t.jsx(l,{allTexts:"securitySection.SecurityExpressSignature.SET_PIN_COMPLETE",buttonAProps:{color:"secondary"},classIcon:"mt-5 pt-5 pb-2",buttonAAction:()=>e(r.MENU)}),d=({step:s,Pin:i})=>t.jsx(O,{open:s===r.DESACTIVATE_PIN,closeFunction:()=>e(r.MENU),full:!1,children:t.jsx(l,{allTexts:"securitySection.SecurityExpressSignature.DESACTIVATE_PIN",buttonBProps:{color:"secondary"},buttonsDisposition:"horizontal",classIcon:"pt-1 pb-1",icon:"error",classTitle:"mt-1",buttonAAction:()=>{i.setOkFn(()=>e(r.DESACTIVATE_PIN_COMPLETE)),i.pinDelete()},buttonBAction:()=>e(r.MENU)})}),N=()=>t.jsx(l,{allTexts:"securitySection.SecurityExpressSignature.DESACTIVATE_PIN_COMPLETE",buttonAProps:{color:"secondary"},buttonAAction:()=>e(r.MENU),classIcon:"mt-5 pt-5 pb-2"}),m=c.useCallback(s=>({0:t.jsx(P,{}),1:t.jsx(_,{}),2:t.jsx(A,{}),3:t.jsx(I,{Pin:n.current}),4:t.jsx(o,{}),5:t.jsx(d,{step:s,Pin:n.current}),6:t.jsx(N,{})})[s],[E]);return t.jsxs(t.Fragment,{children:[m(E),t.jsx(V,{errorData:n.current.errorData})]})},W=h()(j(v));export{W as default}; 2//#
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.