1"use strict";(self.webpackChunkico_react=self.webpackChunkico_react||[]).push([[2595],{22595:(e,o,t)=>{t.r(o),t.d(o,{MfaAuthVerifyFlowScreen:()=>n,default:()=>n});var r=t(90034),i=t(57722),s=t(49931),a=t(78485);t(88404),t(2035),t(30549),t(82425),t(82595);const n={component:()=>{var e,o;let{user:t}=(0,s.u)(),{data:n}=(0,s.a)(),[l,c]=(0,i.useState)(null===t||void 0===t?void 0:t.mfaMethods[0]),[d,u]=(0,i.useState)(!1),[f,v]=(0,i.useState)(),[h,y]=(0,i.useState)();if((0,i.useEffect)(()=>{c(null===t||void 0===t?void 0:t.mfaMethods[0])},[null===t||void 0===t?void 0:t.mfaMethods]),null===n||void 0===n||!n.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:m,onSuccess:k,generateOptions:p,verifyTotpCode:w,verifyPasskey:S,verifySmsCode:g,sendSmsCode:M}=n.mfaVerify,C=async e=>{if("passkey"!==e)try{c(e),"sms"===e&&(c(e),await M()),"totp"===e&&c(e)}catch(e){console.error(e)}else try{c(e);let o=await p();if(!o)throw Error("something went wrong");v(o),await S(o),u(!0),y(void 0),k()}catch(e){y((0,a.t)(e))}},E=async e=>{y(void 0);try{if(!e||!l)return;if("passkey"===l){if(!f)throw Error("Missing passkey challenge");await S(f)}else"sms"===l?await g(e):"totp"===l&&await w(e);y(void 0),u(!0),k()}catch(e){throw(0,a.t)(e).error}},b=()=>{var e;h||!d?m(null!==(e=null===h||void 0===h?void 0:h.error)&&void 0!==e?e:Error("Canceled MFA verification.")):k()},A=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{!A.current&&l&&(A.current=!0,C(l).finally(()=>{A.current=!1}))},[open]),t?"passkey"===l?(0,r.jsx)(a.V,{account:t.linkedAccounts.filter(e=>"passkey"===e.type&&e.enrolledInMfa).sort((e,o)=>o.firstVerifiedAt.valueOf()-e.firstVerifiedAt.valueOf())[0],submitSuccess:d,hasBlockingError:null!==(e=null===h||void 0===h?void 0:h.isBlocking)&&void 0!==e&&e,error:null===h||void 0===h?void 0:h.error,onClose:b,onBack:()=>{c(void 0),y(void 0)},handleSubmit:()=>E(f).catch(y)}):"sms"===l||"totp"===l?(0,r.jsx)(a.a,{selectedMethod:l,submitSuccess:d,hasBlockingError:null!==(o=null===h||void 0===h?void 0:h.isBlocking)&&void 0!==o&&o,handleSubmitCode:E,onClose:b,onBack:t.mfaMethods.length>1?()=>c(void 0):void 0}):(0,r.jsx)(a.b,{user:t,onSelect:C,handleClose:b}):null}}}}]); 2//# sourceMappingURL=2595.b1d95160.chunk.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.