@clerk/ui 1.0.0-snapshot.v20251218183643 → 1.0.0-snapshot.v20260105214115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/207_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/217_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/360_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/444_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/573_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/970_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/ClerkUi.js +2 -2
- package/dist/apiKeys_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/blankcaptcha_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/{checkout_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → checkout_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/checkout_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/components/Checkout/CheckoutPage.js +1 -1
- package/dist/components/Checkout/CheckoutPage.js.map +1 -1
- package/dist/components/Checkout/parts.js +1 -1
- package/dist/components/Checkout/parts.js.map +1 -1
- package/dist/components/OrganizationList/UserMembershipList.js +1 -1
- package/dist/components/OrganizationList/UserMembershipList.js.map +1 -1
- package/dist/components/OrganizationSwitcher/OrganizationSwitcherPopover.js +1 -1
- package/dist/components/OrganizationSwitcher/OrganizationSwitcherPopover.js.map +1 -1
- package/dist/components/OrganizationSwitcher/OrganizationSwitcherTrigger.js +1 -1
- package/dist/components/OrganizationSwitcher/OrganizationSwitcherTrigger.js.map +1 -1
- package/dist/components/OrganizationSwitcher/UserMembershipList.js +1 -1
- package/dist/components/OrganizationSwitcher/UserMembershipList.js.map +1 -1
- package/dist/components/SignIn/index.js +1 -1
- package/dist/components/SignIn/index.js.map +1 -1
- package/dist/components/SignUp/index.js +1 -1
- package/dist/components/SignUp/index.js.map +1 -1
- package/dist/components/UserProfile/Web3Form.js +32 -45
- package/dist/components/UserProfile/Web3Form.js.map +1 -1
- package/dist/components/UserProfile/Web3Section.js +6 -3
- package/dist/components/UserProfile/Web3Section.js.map +1 -1
- package/dist/copy-api-key-modal_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/createorganization_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/enableOrganizationsPrompt_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/framework_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/impersonationfab_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/index.js +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/keylessPrompt_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/oauthConsent_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/onetap_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/op-api-keys-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/op-billing-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/op-plans-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/organizationlist_ui_bd1c40_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/organizationlist_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/organizationprofile_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/organizationswitcher_ui_bd1c40_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/organizationswitcher_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/payment-attempt-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/planDetails_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/prefetchorganizationlist_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/pricingTable_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/revoke-api-key-modal_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/sessionTasks_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/{signin_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → signin_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/signin_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/{signup_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → signup_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/signup_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/statement-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/subscriptionDetails_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/taskChooseOrganization_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/taskResetPassword_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/{ui-common_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → ui-common_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +7 -7
- package/dist/ui-common_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/ui.browser.js +1 -1
- package/dist/ui.legacy.browser.js +1 -0
- package/dist/up-api-keys-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/up-billing-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/up-plans-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/useravatar_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/userbutton_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/{userprofile_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → userprofile_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +2 -2
- package/dist/userprofile_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/userverification_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/utils/errorHandler.js +1 -7
- package/dist/utils/errorHandler.js.map +1 -1
- package/dist/{vendors_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → vendors_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/vendors_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/waitlist_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/dist/{web3-solana-wallet-buttons_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → web3-solana-wallet-buttons_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +3 -3
- package/dist/web3-solana-wallet-buttons_ui_dd6371_1.0.0-snapshot.v20260105214115.js +1 -0
- package/package.json +8 -5
- package/dist/organizationlist_ui_b31bc8_1.0.0-snapshot.v20251218183643.js +0 -1
- package/dist/organizationswitcher_ui_b31bc8_1.0.0-snapshot.v20251218183643.js +0 -1
- /package/dist/{207_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 207_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{217_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 217_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{360_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 360_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{444_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 444_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{573_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 573_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{970_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 970_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{apiKeys_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → apiKeys_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{blankcaptcha_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → blankcaptcha_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → copy-api-key-modal_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{createorganization_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → createorganization_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → enableOrganizationsPrompt_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{framework_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → framework_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{impersonationfab_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → impersonationfab_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{keylessPrompt_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → keylessPrompt_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{oauthConsent_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → oauthConsent_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{onetap_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → onetap_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-api-keys-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → op-api-keys-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-billing-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → op-billing-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-plans-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → op-plans-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{organizationprofile_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → organizationprofile_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{payment-attempt-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → payment-attempt-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{planDetails_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → planDetails_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → prefetchorganizationlist_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{pricingTable_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → pricingTable_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → revoke-api-key-modal_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{sessionTasks_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → sessionTasks_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{statement-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → statement-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{subscriptionDetails_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → subscriptionDetails_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → taskChooseOrganization_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{taskResetPassword_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → taskResetPassword_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-api-keys-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → up-api-keys-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-billing-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → up-billing-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-plans-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → up-plans-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{useravatar_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → useravatar_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{userbutton_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → userbutton_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{userverification_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → userverification_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{waitlist_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → waitlist_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["10"],{9090:function(e,t,r){r.d(t,{n:()=>o});var n=r(4518),i=r(5170),a=r(2861);let o=e=>{let{onBackLinkClick:t}=e;return(0,n.Y)(i.J,{cardTitle:(0,a.G)("signIn.alternativeMethods.getHelp.title"),cardSubtitle:(0,a.G)("signIn.alternativeMethods.getHelp.content"),onBackLinkClick:t})}},5717:function(e,t,r){let n,i;r.r(t),r.d(t,{SignIn:()=>tv,SignInModal:()=>tY});var a,o=r(4518),s=r(1210),l=r(5074),c=r(5873),d=r(4),u=r(5350),h=r(5577),p=r(4607),f=r(7896),g=r(7607),m=r(4096),I=r(7831),_=r(2265),w=r(4132),S=r(656),v=r(2861),b=r(8272),Y=r(8920),k=r(29),C=r(6088),A=r(3269),F=r(6153),y=r(9236),U=r(4964);let P=(0,l.lazy)(()=>Promise.all([r.e("545"),r.e("666"),r.e("188")]).then(r.bind(r,6464)).then(e=>({default:e.Web3SolanaWalletButtons}))),E=(0,S.RL)((0,S.SY)((0,A.dm)(()=>{let e=(0,s.ho)(),t=(0,A.f0)(),r=(0,U.r)(),n=(0,d.r)();return(0,o.Y)(p.n.Part,{part:"chooseWallet",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.web3Solana.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.web3Solana.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:t.error}),(0,o.FD)(b.so,{direction:"col",gap:4,children:[(0,o.Y)(l.Suspense,{fallback:(0,o.Y)(b.so,{direction:"row",align:"center",justify:"center",sx:e=>({height:"100%",minHeight:e.sizes.$32}),children:(0,o.Y)(b.y$,{size:"lg",colorScheme:"primary",elementDescriptor:Y.$z.spinner})}),children:(0,o.Y)(P,{web3AuthCallback:({walletName:i})=>e.authenticateWithWeb3({customNavigate:r.navigate,redirectUrl:n.afterSignInUrl||"/",secondFactorUrl:"factor-two",signUpContinueUrl:n.isCombinedFlow?"create/continue":n.signUpContinueUrl,strategy:"web3_solana_signature",walletName:i}).catch(e=>(0,y.f)(e,t.setError))})}),(0,o.Y)(k.E,{boxElementDescriptor:Y.$z.backRow,linkElementDescriptor:Y.$z.backLink,onClick:()=>{r.navigate("../")}})]})]}),(0,o.Y)(C.Z.Footer,{})]})})})));var D=r(4692);let L=()=>Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,4753)),M=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpVerifyPhone}))),T=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpVerifyEmail}))),G=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpStart}))),R=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpSSOCallback}))),B=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpContinue})));var z=r(2950),O=r(2454),$=r(4468),N=r(3990),Z=r(8640),x=r(6324),K=r(7697),W=r(78),V=r(620),q=r(9426);let H=(0,A.dm)(()=>{let e=(0,x.n)(),t=(0,A.f0)(),{navigate:r}=(0,U.r)(),n=(0,q.p)(),{userSettings:{passwordSettings:i}}=(0,K.O)(),{t:a,locale:s}=(0,W._)(),c="needs_new_password"===e.status&&"reset_password_email_code"!==e.firstFactorVerification.strategy&&"reset_password_phone_code"!==e.firstFactorVerification.strategy;l.useEffect(()=>{c&&t.setError(a((0,v.G)("signIn.resetPassword.requiredMessage")))},[]);let d=(0,Z.tJ)("password","",{type:"password",label:(0,v.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,N.C5)(e,{t:a,locale:s,passwordSettings:i})}),u=(0,Z.tJ)("confirmPassword","",{type:"password",label:(0,v.G)("formFieldLabel__confirmPassword"),isRequired:!0}),h=(0,Z.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,v.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:p,isPasswordMatch:f}=(0,V.Z)({passwordField:d,confirmPasswordField:u}),g=async()=>{if(f){d.clearFeedback(),u.clearFeedback();try{let{status:t,createdSessionId:i}=await e.resetPassword({password:d.value,signOutOfOtherSessions:h.checked});switch(t){case"complete":if(i){let e=new URLSearchParams;return e.set("createdSessionId",i),r(`../reset-password-success?${e.toString()}`)}return console.error((0,z.s)(t,n));case"needs_second_factor":return r("../factor-two");default:return console.error((0,z.s)(t,n))}}catch(e){return(0,$.H4)(e,[d,u],t.setError)}}};return(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.Y)(F.Y.Root,{showLogo:!0,children:(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.resetPassword.title")})}),(0,o.Y)(C.Z.Alert,{children:t.error}),(0,o.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:(0,o.FD)(O.l.Root,{onSubmit:g,onBlur:()=>{d.value&&p(u.value)},gap:8,children:[(0,o.FD)(b.fv,{gap:6,children:[(0,o.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:e.identifier||"",style:{display:"none"}}),(0,o.Y)(O.l.ControlRow,{elementId:d.id,children:(0,o.Y)(O.l.PasswordInput,{...d.props,isRequired:!0,autoFocus:!0})}),(0,o.Y)(O.l.ControlRow,{elementId:u.id,children:(0,o.Y)(O.l.PasswordInput,{...u.props,onChange:e=>(e.target.value&&p(e.target.value),u.props.onChange(e))})}),!c&&(0,o.Y)(O.l.ControlRow,{elementId:h.id,children:(0,o.Y)(O.l.Checkbox,{...h.props})})]}),(0,o.FD)(b.fv,{gap:3,children:[(0,o.Y)(O.l.SubmitButton,{isDisabled:!f,localizationKey:(0,v.G)("signIn.resetPassword.formButtonPrimary")}),(0,o.Y)(C.Z.Action,{elementId:"alternativeMethods",children:(0,o.Y)(C.Z.ActionLink,{elementDescriptor:Y.$z.backLink,localizationKey:(0,v.G)("backButton"),onClick:()=>r("../")})})]})]})})]}),(0,o.Y)(C.Z.Footer,{})]})});var j=r(9107),J=r(6488);let X=(0,A.dm)(()=>{let e=(0,A.f0)();return(0,j.h)(),(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.Y)(F.Y.Root,{showLogo:!0,children:(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.resetPassword.title")})}),(0,o.Y)(C.Z.Alert,{children:e.error}),(0,o.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:[(0,o.Y)(b.EY,{localizationKey:(0,v.G)("signIn.resetPassword.successMessage")}),(0,o.Y)(J.s,{direction:"row",center:!0,children:(0,o.Y)(b.y$,{size:"xl",colorScheme:"primary",elementDescriptor:Y.$z.spinner})})]})]}),(0,o.Y)(C.Z.Footer,{})]})});var Q=r(2531),ee=r(750),et=r(9345),er=r(9599),en=r(9366),ei=r(6932),ea=r(1052),eo=r(2540);let es=(0,S.SY)((0,A.dm)(()=>{let e=(0,A.f0)(),{userProfileUrl:t}=(0,K.O)().displayConfig,{afterSignInUrl:r,path:n,signInUrl:i,taskUrl:a}=(0,d.r)(),{navigateAfterSignOut:s}=(0,er.g)(),{handleSignOutAllClicked:l,handleSessionClicked:c,signedInSessions:u,handleAddAccountClicked:h}=(0,eo.u)({taskUrl:a,navigateAfterSignOut:s,afterSwitchSessionUrl:r,userProfileUrl:t,signInUrl:n??i,user:void 0});return(0,o.Y)(p.n.Part,{part:"accountSwitcher",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{sx:e=>({padding:`${e.space.$8} ${e.space.$none} ${e.space.$none}`}),children:[(0,o.FD)(F.Y.Root,{children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.accountSwitcher.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.accountSwitcher.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:e.error}),(0,o.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100}),children:(0,o.FD)(Q.En,{role:"menu",children:[u.map(e=>(0,o.Y)(ee.P,{onClick:c(e),sx:e=>({height:e.sizes.$16,justifyContent:"flex-start",borderRadius:0}),icon:en.A,children:(0,o.Y)(et.c,{user:e.user,sx:{width:"100%"}})},e.id)),(0,o.Y)(Q.rc,{elementDescriptor:Y.$z.accountSwitcherActionButton,elementId:Y.$z.accountSwitcherActionButton.setId("addAccount"),iconBoxElementDescriptor:Y.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:Y.$z.accountSwitcherActionButtonIconBox.setId("addAccount"),iconElementDescriptor:Y.$z.accountSwitcherActionButtonIcon,iconElementId:Y.$z.accountSwitcherActionButtonIcon.setId("addAccount"),icon:ei.A,label:(0,v.G)("signIn.accountSwitcher.action__addAccount"),onClick:h,iconSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),iconBoxSx:e=>({minHeight:e.sizes.$9,minWidth:e.sizes.$6,alignItems:"center"}),spinnerSize:"md"})]})})]}),(0,o.Y)(C.Z.Footer,{sx:e=>({">:first-of-type":{padding:`${e.space.$1}`,width:"100%"}}),children:(0,o.Y)(C.Z.Action,{sx:{width:"100%",">:first-of-type":{width:"100%",borderBottomWidth:0}},children:(0,o.Y)(ea.ww,{handleSignOutAllClicked:l,elementDescriptor:Y.$z.accountSwitcherActionButton,elementId:Y.$z.accountSwitcherActionButton.setId("signOutAll"),iconBoxElementDescriptor:Y.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:Y.$z.accountSwitcherActionButtonIconBox.setId("signOutAll"),iconElementDescriptor:Y.$z.accountSwitcherActionButtonIcon,iconElementId:Y.$z.accountSwitcherActionButtonIcon.setId("signOutAll"),label:(0,v.G)("signIn.accountSwitcher.action__signOutAll"),actionSx:e=>({padding:`${e.space.$2} ${e.space.$2}`})})})})]})})}));var el=r(6980),ec=r(8738),ed=r(8289),eu=r(9835),eh=r(9090);let ep=e=>{let[t,r]=l.useState(!1),n=l.useCallback(()=>r(e=>!e),[r]);return t?(0,o.Y)(eh.n,{onBackLinkClick:n}):(0,o.Y)(ef,{onBackLinkClick:e.onBackLinkClick,onFactorSelected:e.onFactorSelected,onHavingTroubleClick:n})},ef=e=>{let{onHavingTroubleClick:t,onFactorSelected:r,onBackLinkClick:n}=e,i=(0,A.f0)(),{supportedSecondFactors:a}=(0,x.n)();return(0,o.Y)(p.n.Part,{part:"alternativeMethods",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.alternativeMethods.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.alternativeMethods.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:i.error}),(0,o.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:3,children:[(0,o.Y)(b.fv,{gap:2,children:a&&a.sort(ed.Wy).map((e,t)=>(0,o.Y)(ec.X,{textLocalizationKey:function(e){switch(e.strategy){case"phone_code":return(0,v.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"totp":return(0,v.G)("signIn.alternativeMethods.blockButton__totp");case"backup_code":return(0,v.G)("signIn.alternativeMethods.blockButton__backupCode");case"email_code":return(0,v.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"email_link":return(0,v.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,eu.u)(e.safeIdentifier)||""});default:throw Error("Invalid sign in strategy")}}(e),elementDescriptor:Y.$z.alternativeMethodsBlockButton,textElementDescriptor:Y.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:Y.$z.alternativeMethodsBlockButtonArrow,isDisabled:i.isLoading,onClick:()=>r(e)},t))}),(0,o.Y)(C.Z.Action,{elementId:"alternativeMethods",children:n&&(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("backButton"),onClick:e.onBackLinkClick})})]})]}),(0,o.Y)(C.Z.Footer,{children:(0,o.FD)(C.Z.Action,{elementId:"havingTrouble",children:[(0,o.Y)(C.Z.ActionText,{localizationKey:(0,v.G)("signIn.alternativeMethods.actionText")}),(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.alternativeMethods.actionLink"),onClick:t})]})})]})})};var eg=r(3610),em=r(7912),eI=r(5763);let e_=e=>(0,eI.Kw)(e.firstFactorVerification?.strategy)&&e.firstFactorVerification?.status==="verified",ew=e=>{let t=(0,K.O)(),r=(0,x.n)(),n=(0,A.f0)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:c}=(0,s.ho)(),{navigate:u}=(0,U.r)(),h=(0,q.p)(),p=(0,s.ho)(),f=(0,l.useMemo)(()=>{let e=Object.values(t.userSettings.attributes).some(e=>e.used_for_second_factor);return"new"===r.clientTrustState&&!e},[r.clientTrustState,t.userSettings.attributes]);l.useEffect(()=>{e.factorAlreadyPrepared||g?.()},[]);let g=e.prepare?()=>e.prepare?.().then(()=>e.onFactorPrepare()).catch(e=>{if((0,eg._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,$.H4)(e,[],n.setError)}):void 0;return(0,o.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e_(r)?(0,v.G)("signIn.forgotPassword.subtitle"):e.cardSubtitle,cardNotice:e.showClientTrustNotice||f?(0,v.G)("signIn.newDeviceVerificationNotice"):void 0,resendButton:e.resendButton,inputLabel:e.inputLabel,onCodeEntryFinishedAction:(t,n,o)=>{r.attemptSecondFactor({strategy:e.factor.strategy,code:t}).then(async e=>{if(await n(),"complete"!==e.status)return console.error((0,z.s)(e.status,h));if(e_(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),u(`../reset-password-success?${t.toString()}`)}return c({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}})}).catch(e=>(0,eg._d)(e)?p.__internal_navigateWithError("..",e.errors[0]):o(e))},onResendCodeClicked:g,safeIdentifier:"safeIdentifier"in e.factor?e.factor.safeIdentifier:void 0,profileImageUrl:r.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,children:e_(r)&&(0,o.Y)(b.EY,{localizationKey:(0,v.G)("signIn.resetPasswordMfa.detailsLabel"),colorScheme:"secondary"})})},eS=e=>{let t=(0,x.n)();return(0,o.Y)(p.n.Part,{part:"emailCode2Fa",children:(0,o.Y)(ew,{...e,cardTitle:(0,v.G)("signIn.emailCodeMfa.title"),cardSubtitle:(0,v.G)("signIn.emailCodeMfa.subtitle"),inputLabel:(0,v.G)("signIn.emailCodeMfa.formTitle"),resendButton:(0,v.G)("signIn.emailCodeMfa.resendButton"),prepare:()=>{let{emailAddressId:r,strategy:n}=e.factor;return t.prepareSecondFactor({emailAddressId:r,strategy:n})}})})};var ev=r(2027),eb=r(4979),eY=r(8051),ek=r(2992);let eC=e=>{let{t}=(0,W._)(),r=(0,A.f0)(),n=(0,x.n)(),i=(0,d.r)(),{signInUrl:a}=i,{afterSignInUrl:c}=(0,d.r)(),{setActive:u}=(0,s.ho)(),{startEmailLinkFlow:h,cancelEmailLinkFlow:f}=(0,ek.u)(n),[g,m]=l.useState(!1),I=(0,s.ho)();l.useEffect(()=>{_()},[]);let _=()=>{h({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,eY.lA)({ctx:i,baseUrl:a,intent:"sign-in"})}).then(e=>w(e)).catch(e=>{if((0,eg._d)(e))return I.__internal_navigateWithError("..",e.errors[0]);(0,$.H4)(e,[],r.setError)})},w=async e=>{let n=e.secondFactorVerification;"expired"===n.status?r.setError(t((0,v.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?m(!0):await u({session:e.createdSessionId,redirectUrl:c})};return g?(0,o.Y)(eb.$,{title:(0,v.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,v.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,o.Y)(p.n.Part,{part:"emailLink",children:(0,o.Y)(ev._,{cardTitle:(0,v.G)("signIn.emailLinkMfa.title"),cardSubtitle:(0,v.G)("signIn.emailLinkMfa.subtitle"),cardNotice:e.showClientTrustNotice||"new"===n.clientTrustState?(0,v.G)("signIn.newDeviceVerificationNotice"):void 0,formSubtitle:(0,v.G)("signIn.emailLinkMfa.formSubtitle"),resendButton:(0,v.G)("signIn.emailLinkMfa.resendButton"),onResendCodeClicked:()=>{f(),_()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})},eA=e=>{let t=(0,x.n)();return(0,o.Y)(p.n.Part,{part:"phoneCode2Fa",children:(0,o.Y)(ew,{...e,cardTitle:(0,v.G)("signIn.phoneCodeMfa.title"),cardSubtitle:(0,v.G)("signIn.phoneCodeMfa.subtitle"),inputLabel:(0,v.G)("signIn.phoneCodeMfa.formTitle"),resendButton:(0,v.G)("signIn.phoneCodeMfa.resendButton"),prepare:()=>{let{phoneNumberId:r,strategy:n}=e.factor;return t.prepareSecondFactor({phoneNumberId:r,strategy:n})}})})};var eF=r(2690);let ey=(0,S.RL)((0,S.SY)((0,A.dm)(function(){let e=(0,x.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:a,toggleAllStrategies:s}=(0,eF.j)(e.supportedSecondFactors);if(!t)return(0,o.Y)(el.B,{});if(a)return(0,o.Y)(ep,{onBackLinkClick:s,onFactorSelected:i});switch(t?.strategy){case"phone_code":return(0,o.Y)(eA,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_code":return(0,o.Y)(eS,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_link":return(0,o.Y)(eC,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});default:return(0,o.Y)(el.B,{})}})));var eU=r(5170),eP=r(3474),eE=r(6505),eD=r(8144),eL=r(4421),eM=r(1051),eT=r(2181),eG=r(743),eR=r(6889),eB=r(2166),ez=r(44),eO=r(3226);let e$=l.memo(e=>{let t=(0,s.ho)(),{navigate:r}=(0,U.r)(),n=(0,A.f0)(),{displayConfig:i}=(0,K.O)(),a=(0,d.r)(),l=(0,x.n)(),c=(0,eY.uP)(a,i.signInUrl),u=a.afterSignInUrl||"/",h="popup"===a.oauthFlow||"auto"===a.oauthFlow&&(0,ez.C)(),{onAlternativePhoneCodeProviderClick:p,...f}=e,g=e=>(0,eg.$R)(e)&&e.errors.find(e=>e.code===eB.c.SESSION_EXISTS)?t.setActive({session:t.client.lastActiveSessionId,navigate:async({session:e})=>{await a.navigateOnSetActive({session:e,redirectUrl:a.afterSignInUrl})}}):(0,$.H4)(e,[],n.setError);return(0,o.Y)(eO.V,{...f,showLastAuthenticationStrategy:!0,idleAfterDelay:!h,oauthCallback:e=>{if(h){let t=window.open("about:blank","","width=600,height=800"),r=setInterval(()=>{(!t||t.closed)&&(clearInterval(r),n.setIdle())},500);return l.authenticateWithPopup({strategy:e,redirectUrl:c,redirectUrlComplete:u,popup:t,oidcPrompt:a.oidcPrompt}).catch(e=>g(e))}return l.authenticateWithRedirect({strategy:e,redirectUrl:c,redirectUrlComplete:u,oidcPrompt:a.oidcPrompt}).catch(e=>g(e))},web3Callback:e=>"web3_solana_signature"===e?r(`choose-wallet?strategy=${e}`):t.authenticateWithWeb3({customNavigate:r,redirectUrl:u,signUpContinueUrl:a.isCombinedFlow?"create/continue":a.signUpContinueUrl,strategy:e,secondFactorUrl:"factor-two"}).catch(e=>(0,y.f)(e,n.setError)),alternativePhoneCodeCallback:e=>{p?.(e)}})});function eN(){let e=(0,x.n)();return e.supportedFirstFactors?.find(({strategy:e})=>(0,eI.Kw)(e))}let eZ=e=>((e,t)=>{let[r,n]=l.useState(!1),i=l.useCallback(()=>n(e=>!e),[n]);return r?(0,o.Y)(eh.n,{onBackLinkClick:i}):(0,o.Y)(e,{...t,onHavingTroubleClick:i})})(ex,{...e}),ex=e=>{let{onBackLinkClick:t,onHavingTroubleClick:r,onFactorSelected:n,mode:i="default"}=e,a=(0,A.f0)(),s=eN(),{supportedFirstFactors:l}=(0,x.n)(),{firstPartyFactors:c,hasAnyStrategy:d}=(0,eP.y)({filterOutFactor:e?.currentFactor,supportedFirstFactors:l}),u=function(e){switch(e){case"forgot":return"forgotPasswordMethods";case"pwned":return"passwordPwnedMethods";case"passwordCompromised":return"passwordCompromisedMethods";default:return"alternativeMethods"}}(i),h=function(e){switch(e){case"forgot":return(0,v.G)("signIn.forgotPasswordAlternativeMethods.title");case"pwned":return(0,v.G)("signIn.passwordPwned.title");case"passwordCompromised":return(0,v.G)("signIn.passwordCompromised.title");default:return(0,v.G)("signIn.alternativeMethods.title")}}(i),f=function(e){switch(e){case"forgot":case"pwned":return!0;default:return!1}}(i);return(0,o.Y)(p.n.Part,{part:u,children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:h}),!f&&"passwordCompromised"!==i&&(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.alternativeMethods.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:a.error}),(0,o.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:6,children:[f&&s&&(0,o.Y)(b.$n,{localizationKey:eK(s),elementDescriptor:Y.$z.alternativeMethodsBlockButton,isDisabled:a.isLoading,onClick:()=>{a.setError(void 0),n(s)}}),f&&d&&(0,o.Y)(eE.c,{dividerText:(0,v.G)("signIn.forgotPasswordAlternativeMethods.label__alternativeMethods")}),(0,o.FD)(b.fv,{gap:4,children:[d&&(0,o.FD)(b.so,{elementDescriptor:Y.$z.alternativeMethods,direction:"col",gap:2,children:[(0,o.Y)(e$,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:!1}),c&&c.map((e,t)=>{var r;return(0,o.Y)(ec.X,{leftIcon:(r=e,({email_link:eD.A,email_code:eL.A,phone_code:eM.A,reset_password_email_code:eT.A,reset_password_phone_code:eT.A,password:eG.A,passkey:eR.A})[r.strategy]),textLocalizationKey:eK(e),elementDescriptor:Y.$z.alternativeMethodsBlockButton,textElementDescriptor:Y.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:Y.$z.alternativeMethodsBlockButtonArrow,textVariant:"buttonLarge",isDisabled:a.isLoading,onClick:()=>{a.setError(void 0),n(e)}},t)})]}),t&&(0,o.Y)(k.E,{boxElementDescriptor:Y.$z.backRow,linkElementDescriptor:Y.$z.backLink,onClick:t})]})]})]}),(0,o.Y)(C.Z.Footer,{children:(0,o.FD)(C.Z.Action,{elementId:"havingTrouble",children:[(0,o.Y)(C.Z.ActionText,{localizationKey:(0,v.G)("signIn.alternativeMethods.actionText")}),(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.alternativeMethods.actionLink"),onClick:r})]})})]})})};function eK(e){switch(e.strategy){case"email_link":return(0,v.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"email_code":return(0,v.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"phone_code":return(0,v.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"password":return(0,v.G)("signIn.alternativeMethods.blockButton__password");case"passkey":return(0,v.G)("signIn.alternativeMethods.blockButton__passkey");case"reset_password_email_code":case"reset_password_phone_code":return(0,v.G)("signIn.forgotPasswordAlternativeMethods.blockButton__resetPassword");default:throw Error(`Invalid sign in strategy: "${e.strategy}"`)}}var eW=r(5653);function eV(e){let t=(0,A.f0)(),{setActive:r,__internal_navigateWithError:n}=(0,s.ho)(),i=(0,q.p)(),{afterSignInUrl:a,navigateOnSetActive:o}=(0,d.r)(),{authenticateWithPasskey:c}=(0,x.n)();return(0,l.useEffect)(()=>()=>{eW.sv.abort()},[]),(0,l.useCallback)(async(...s)=>{try{let t=await c(...s);switch(t.status){case"complete":return r({session:t.createdSessionId,navigate:async({session:e})=>{await o({session:e,redirectUrl:a})}});case"needs_second_factor":return e();default:return console.error((0,z.s)(t.status,i))}}catch(r){let{flow:e}=s[0]||{};if((0,eg.Cm)(r)&&("passkey_operation_aborted"===r.code||"autofill"===e&&"passkey_retrieval_cancelled"===r.code))return;if((0,eg._d)(r))return n("..",r.errors[0]);(0,$.H4)(r,[],t.setError)}},[])}function eq(e){return!!e?.length&&e.filter(e=>"enterprise_sso"===e.strategy&&"enterpriseConnectionId"in e&&"enterpriseConnectionName"in e).length>1}var eH=r(1652);let ej=e=>{let t=(0,x.n)(),r=(0,A.f0)(),{navigate:n}=(0,U.r)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:l}=(0,s.ho)(),c=(0,q.p)(),u=(0,s.ho)(),h=e.factor.channel,p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared;return(0,o.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,o,s)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await o(),e.status){case"complete":return l({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,z.s)(e.status,c))}}).catch(e=>(0,eg._d)(e)?u.__internal_navigateWithError("..",e.errors[0]):s(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor({...e.factor,channel:h}).then(()=>e.onFactorPrepare()).catch(e=>(0,$.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,alternativeMethodsLabel:(0,v.G)("footerActionLink__alternativePhoneCodeProvider"),onShowAlternativeMethodsClicked:()=>{r.setError(void 0),e.onChangePhoneCodeChannel({...e.factor,channel:void 0})},showAlternativeMethods:!0,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eJ=e=>(0,o.Y)(p.n.Part,{part:"phoneCode",children:(0,o.Y)(ej,{...e,cardTitle:(0,v.G)("signIn.alternativePhoneCodeProvider.title",{provider:(0,eH.y)(e.factor.channel)?.name||""}),cardSubtitle:(0,v.G)("signIn.alternativePhoneCodeProvider.subtitle"),inputLabel:(0,v.G)("signIn.alternativePhoneCodeProvider.formTitle"),resendButton:(0,v.G)("signIn.alternativePhoneCodeProvider.resendButton")})}),eX=e=>{let t=(0,x.n)(),r=(0,A.f0)(),{navigate:n}=(0,U.r)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:c}=(0,s.ho)(),u=(0,q.p)(),h=(0,s.ho)(),p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared,g=(0,l.useMemo)(()=>{let t=e.factor,r=t.strategy;return"emailAddressId"in t&&(r+=`_${t.emailAddressId}`),"phoneNumberId"in t&&(r+=`_${t.phoneNumberId}`),"channel"in t&&t.channel&&(r+=`_${t.channel}`),{name:"signIn.prepareFirstFactor",factorKey:r}},[e.factor.strategy,"emailAddressId"in e.factor?e.factor.emailAddressId:void 0,"phoneNumberId"in e.factor?e.factor.phoneNumberId:void 0,"channel"in e.factor?e.factor.channel:void 0]);return(0,f.s)(p?void 0:()=>t?.prepareFirstFactor(e.factor),g,{staleTime:100,onSuccess:()=>e.onFactorPrepare(),onError:e=>(0,$.H4)(e,[],r.setError)}),(0,o.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,o,s)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await o(),e.status){case"complete":return c({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,z.s)(e.status,u))}}).catch(e=>(0,eg._d)(e)?h.__internal_navigateWithError("..",e.errors[0]):s(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor(e.factor).then(()=>e.onFactorPrepare()).catch(e=>(0,$.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eQ=e=>(0,o.Y)(p.n.Part,{part:"emailCode",children:(0,o.Y)(eX,{...e,cardTitle:(0,v.G)("signIn.emailCode.title"),cardSubtitle:(0,v.G)("signIn.emailCode.subtitle"),inputLabel:(0,v.G)("signIn.emailCode.formTitle"),resendButton:(0,v.G)("signIn.emailCode.resendButton")})}),e0=e=>{let{t}=(0,W._)(),r=(0,A.f0)(),n=(0,x.n)(),i=(0,d.r)(),{signInUrl:a}=i,{navigate:c}=(0,U.r)(),{afterSignInUrl:u}=(0,d.r)(),{setActive:h}=(0,s.ho)(),{startEmailLinkFlow:f,cancelEmailLinkFlow:g}=(0,ek.u)(n),[m,I]=l.useState(!1),_=(0,s.ho)();l.useEffect(()=>{w()},[]);let w=()=>{f({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,eY.lA)({ctx:i,baseUrl:a,intent:"sign-in"})}).then(e=>S(e)).catch(e=>{if((0,eg._d)(e))return _.__internal_navigateWithError("..",e.errors[0]);(0,$.H4)(e,[],r.setError)})},S=async e=>{let n=e.firstFactorVerification;"expired"===n.status?r.setError(t((0,v.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?I(!0):await b(e)},b=async e=>"complete"===e.status?h({session:e.createdSessionId,redirectUrl:u}):"needs_second_factor"===e.status?c("../factor-two"):void 0;return m?(0,o.Y)(eb.$,{title:(0,v.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,v.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,o.Y)(p.n.Part,{part:"emailLink",children:(0,o.Y)(ev._,{cardTitle:(0,v.G)("signIn.emailLink.title"),cardSubtitle:(0,v.G)("signIn.emailLink.subtitle"),formTitle:(0,v.G)("signIn.emailLink.formTitle"),formSubtitle:(0,v.G)("signIn.emailLink.formSubtitle"),resendButton:(0,v.G)("signIn.emailLink.resendButton"),onResendCodeClicked:()=>{g(),w()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})};var e1=r(7420);let e6=(0,A.dm)((n=(a=()=>{let e=(0,d.r)(),{displayConfig:t}=(0,K.O)(),r=(0,s.ho)().client.signIn;if(!eq(r.supportedFirstFactors))return null;let n=r.supportedFirstFactors.map(e=>({id:e.enterpriseConnectionId,name:e.enterpriseConnectionName}));return(0,o.Y)(p.n.Part,{part:"enterpriseConnections",children:(0,o.Y)(e1.l,{title:(0,v.G)("signIn.enterpriseConnections.title"),subtitle:(0,v.G)("signIn.enterpriseConnections.subtitle"),onClick:n=>{let i=(0,eY.uP)(e,t.signInUrl),a=e.afterSignInUrl||"/";return r.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:i,redirectUrlComplete:a,oidcPrompt:e.oidcPrompt,continueSignIn:!0,enterpriseConnectionId:n})},enterpriseConnections:n})})}).displayName||a.name||"Component",a.displayName=n,(i=e=>{let t=(0,x.n)(),r=(0,d.r)();return(0,S.RE)(a,()=>!eq(t.supportedFirstFactors),({clerk:e})=>r.signInUrl||e.buildSignInUrl(),"There are no enterprise connections available to sign-in. Clerk is redirecting to the `signInUrl` instead.")(e)}).displayName=`withEnterpriseConnectionsGuard(${n})`,i)),e4=e=>(0,o.Y)(p.n.Part,{part:"resetPassword",children:(0,o.Y)(eX,{...e,showAlternativeMethods:!1,cardTitle:(0,v.G)("signIn.forgotPassword.title"),inputLabel:(0,v.G)("signIn.forgotPassword.formTitle"),resendButton:(0,v.G)("signIn.forgotPassword.resendButton")})});var e2=r(196);let e5=e=>{let{onShowAlternativeMethodsClick:t}=e,r=(0,A.f0)(),n=(0,x.n)(),{navigate:i}=(0,U.r)(),[a,s]=l.useState(!1),c=l.useCallback(()=>s(e=>!e),[s]),d=eV(()=>i("../factor-two"));return a?(0,o.Y)(eh.n,{onBackLinkClick:c}):(0,o.Y)(p.n.Part,{part:"password",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(b.In,{elementDescriptor:Y.$z.passkeyIcon,icon:eR.A,sx:e=>({color:e.colors.$neutralAlpha500,marginInline:"auto",paddingBottom:e.sizes.$1,width:e.sizes.$12,height:e.sizes.$12})}),(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.passkey.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.passkey.subtitle")}),(0,o.Y)(e2.$,{identifier:n.identifier,avatarUrl:n.userData.imageUrl,onClick:()=>i("../")})]}),(0,o.Y)(C.Z.Alert,{children:r.error}),(0,o.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:4,children:[(0,o.Y)(O.l.Root,{onSubmit:e=>(e.preventDefault(),d()),gap:8,children:(0,o.Y)(O.l.SubmitButton,{hasArrow:!0})}),(0,o.Y)(C.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)(t?"footerActionLink__useAnotherMethod":"signIn.alternativeMethods.actionLink"),onClick:t||c})})]})]}),(0,o.Y)(C.Z.Footer,{})]})})},e9=e=>{let{onShowAlternativeMethodsClick:t,onPasswordError:r}=e,n=l.useRef(null),i=(0,A.f0)(),{setActive:a}=(0,s.ho)(),c=(0,x.n)(),{afterSignInUrl:u,navigateOnSetActive:h}=(0,d.r)(),f=(0,q.p)(),g=(e=>{let{onForgotPasswordMethodClick:t,onShowAlternativeMethodsClick:r}=e,n=eN(),i=(0,Z.tJ)("password","",{type:"password",label:(0,v.G)("formFieldLabel__password"),placeholder:(0,v.G)("formFieldInputPlaceholder__password")});return{...i,props:{...i.props,actionLabel:n||r?(0,v.G)("formFieldAction__forgotPassword"):"",onActionClicked:t||r||(()=>null)}}})(e),{navigate:m}=(0,U.r)(),[I,_]=l.useState(!1),w=l.useCallback(()=>_(e=>!e),[_]),S=(0,s.ho)();return I?(0,o.Y)(eh.n,{onBackLinkClick:w}):(0,o.Y)(p.n.Part,{part:"password",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.password.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.password.subtitle")}),(0,o.Y)(e2.$,{identifier:c.identifier,avatarUrl:c.userData.imageUrl,onClick:()=>{m("../")}})]}),(0,o.Y)(C.Z.Alert,{children:i.error}),(0,o.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:4,children:[(0,o.FD)(O.l.Root,{onSubmit:e=>{e.preventDefault(),c.attemptFirstFactor({strategy:"password",password:g.value}).then(e=>{switch(e.status){case"complete":return a({session:e.createdSessionId,navigate:({session:e})=>h({session:e,redirectUrl:u})});case"needs_second_factor":return m("../factor-two");case"needs_client_trust":return m("../client-trust");default:return console.error((0,z.s)(e.status,f))}}).catch(e=>{if((0,eg._d)(e))return S.__internal_navigateWithError("..",e.errors[0]);if(r){if((0,eg.Au)(e)){i.setError({...e.errors[0],code:"form_password_pwned__sign_in"}),r("pwned");return}if((0,eg.qY)(e)){i.setError({...e.errors[0],code:"form_password_compromised__sign_in"}),r("compromised");return}}(0,$.H4)(e,[g],i.setError),setTimeout(()=>n.current?.focus(),0)})},gap:8,children:[(0,o.Y)("input",{readOnly:!0,id:"identifier-field",name:"identifier",value:c.identifier||"",style:{display:"none"}}),(0,o.Y)(O.l.ControlRow,{elementId:g.id,children:(0,o.Y)(O.l.PasswordInput,{...g.props,ref:n,autoFocus:!0})}),(0,o.Y)(O.l.SubmitButton,{hasArrow:!0})]}),(0,o.Y)(C.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)(t?"signIn.password.actionLink":"signIn.alternativeMethods.actionLink"),onClick:t||w})})]})]}),(0,o.Y)(C.Z.Footer,{})]})})},e8=e=>(0,o.Y)(p.n.Part,{part:"phoneCode",children:(0,o.Y)(eX,{...e,cardTitle:(0,v.G)("signIn.phoneCode.title"),cardSubtitle:(0,v.G)("signIn.phoneCode.subtitle"),inputLabel:(0,v.G)("signIn.phoneCode.formTitle"),resendButton:(0,v.G)("signIn.phoneCode.resendButton")})}),e3=e=>{if(!e)return"";let t=e.strategy;return"emailAddressId"in e&&(t+=e.emailAddressId),"phoneNumberId"in e&&(t+=e.phoneNumberId),"channel"in e&&(t+=e.channel),t},e7=(0,S.RL)((0,S.SY)((0,A.dm)(function(){let{__internal_setActiveInProgress:e}=(0,s.ho)(),t=(0,x.n)(),{preferredSignInStrategy:r}=(0,K.O)().displayConfig,n=t.supportedFirstFactors,i=(0,U.r)(),a=(0,A.f0)(),{supportedFirstFactors:c,firstFactorVerification:d}=(0,x.n)(),u=l.useRef(""),[{currentFactor:h},p]=l.useState(()=>{let e=(0,eI.xf)(n,t.identifier,r);return e?.strategy==="phone_code"&&d.channel&&"sms"!==d.channel&&(e.channel=d.channel),{currentFactor:e,prevCurrentFactor:void 0}}),{hasAnyStrategy:f}=(0,eP.y)({filterOutFactor:h,supportedFirstFactors:c}),[g,m]=l.useState(()=>!h||!(0,eI.Cm)(h)),I=eN(),[_,w]=l.useState(!1),[S,b]=l.useState(null);if(l.useEffect(()=>{e||("needs_identifier"===t.status||null===t.status)&&i.navigate("../")},[e]),!h)return t.status?(0,o.Y)(eU.J,{cardTitle:(0,v.G)("signIn.noAvailableMethods.title"),cardSubtitle:(0,v.G)("signIn.noAvailableMethods.subtitle"),message:(0,v.G)("signIn.noAvailableMethods.message")}):(0,o.Y)(el.B,{});let Y=f?()=>m(e=>!e):void 0,k=()=>w(e=>!e),C=()=>{u.current=e3(h)},F=e=>{p(t=>({currentFactor:e,prevCurrentFactor:t.currentFactor}))};if(eq(t.supportedFirstFactors))return(0,o.Y)(e6,{});if(g||_){let e=(0,eI.Cm)(h),t=g?Y:k;return(0,o.Y)(eZ,{mode:_?"pwned"===S?"pwned":"compromised"===S?"passwordCompromised":"forgot":"default",onBackLinkClick:e?()=>{a.setError(void 0),b(null),t?.()}:void 0,onFactorSelected:e=>{F(e),t?.()},currentFactor:h})}if(!h)return(0,o.Y)(el.B,{});switch(h?.strategy){case"passkey":return(0,o.Y)(e5,{onFactorPrepare:C,onShowAlternativeMethodsClick:Y});case"password":return(0,o.Y)(e9,{onForgotPasswordMethodClick:I?k:Y,onShowAlternativeMethodsClick:Y,onPasswordError:e=>{b(e),k()}});case"email_code":return(0,o.Y)(eQ,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"phone_code":if(h.channel&&"sms"!==h.channel)return(0,o.Y)(eJ,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onChangePhoneCodeChannel:F});return(0,o.Y)(e8,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"email_link":return(0,o.Y)(e0,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"reset_password_phone_code":return(0,o.Y)(e4,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),k()},cardSubtitle:(0,v.G)("signIn.forgotPassword.subtitle_phone")});case"reset_password_email_code":return(0,o.Y)(e4,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),k()},cardSubtitle:(0,v.G)("signIn.forgotPassword.subtitle_email")});default:return(0,o.Y)(el.B,{})}}))),te=e=>{let{onShowAlternativeMethodsClicked:t}=e,r=(0,x.n)(),{afterSignInUrl:n,navigateOnSetActive:i}=(0,d.r)(),{setActive:a}=(0,s.ho)(),{navigate:l}=(0,U.r)(),c=(0,q.p)(),u=(0,A.f0)(),h=(0,Z.tJ)("code","",{type:"text",label:(0,v.G)("formFieldLabel__backupCode"),isRequired:!0}),p=(0,s.ho)(),f=e=>(0,eI.Kw)(e.firstFactorVerification?.strategy)&&e.firstFactorVerification?.status==="verified";return(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.backupCodeMfa.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:f(r)?(0,v.G)("signIn.forgotPassword.subtitle"):(0,v.G)("signIn.backupCodeMfa.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:u.error}),(0,o.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:(0,o.FD)(O.l.Root,{onSubmit:e=>(e.preventDefault(),r.attemptSecondFactor({strategy:"backup_code",code:h.value}).then(e=>{if("complete"!==e.status)return console.error((0,z.s)(e.status,c));if(f(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),l(`../reset-password-success?${t.toString()}`)}return a({session:e.createdSessionId,navigate:async({session:e})=>{await i({session:e,redirectUrl:n})}})}).catch(e=>{if((0,eg._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,$.H4)(e,[h],u.setError)})),children:[(0,o.Y)(O.l.ControlRow,{elementId:h.id,children:(0,o.Y)(O.l.PlainInput,{...h.props,autoFocus:!0,onActionClicked:t})}),(0,o.FD)(b.fv,{gap:3,children:[(0,o.Y)(O.l.SubmitButton,{hasArrow:!0}),(0,o.Y)(C.Z.Action,{elementId:"alternativeMethods",children:t&&(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})]})})]}),(0,o.Y)(C.Z.Footer,{})]})},tt=e=>(0,o.Y)(p.n.Part,{part:"totp2Fa",children:(0,o.Y)(ew,{...e,cardTitle:(0,v.G)("signIn.totpMfa.title"),cardSubtitle:(0,v.G)("signIn.totpMfa.subtitle"),inputLabel:(0,v.G)("signIn.totpMfa.formTitle")})}),tr=(0,S.RL)((0,S.SY)((0,A.dm)(function(){let e=(0,x.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:a,toggleAllStrategies:s}=(0,eF.j)(e.supportedSecondFactors);if(!t)return(0,o.Y)(el.B,{});if(a)return(0,o.Y)(ep,{onBackLinkClick:s,onFactorSelected:i});switch(t?.strategy){case"phone_code":return(0,o.Y)(eA,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"totp":return(0,o.Y)(tt,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"backup_code":return(0,o.Y)(te,{onShowAlternativeMethodsClicked:s});case"email_code":return(0,o.Y)(eS,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_link":return(0,o.Y)(eC,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});default:return(0,o.Y)(el.B,{})}})));var tn=r(6126);let ti=(0,S.RL)((0,S.SY)(tn.F));var ta=r(4670),to=r(2620),ts=r(6760),tl=r(958),tc=r(1959),td=r(6142),tu=r(4901),th=r(2229),tp=r(2216);let tf=e=>{let{handleSubmit:t,phoneNumberFormState:r,onUseAnotherMethod:n,phoneCodeProvider:i}=e,{providerToDisplayData:a,strategyToDisplayData:s}=(0,tp.k)(),l=i.name,c=i.channel,d=(0,A.f0)();return(0,o.Y)(C.Z.Root,{children:(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,showDivider:!0,children:[(0,o.Y)(b.fv,{center:!0,children:(0,o.Y)(b._V,{src:a[c]?.iconUrl,alt:`${s[c].name} logo`,sx:e=>({width:e.sizes.$7,height:e.sizes.$7,maxWidth:"100%",marginBottom:e.sizes.$6})})}),(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.start.alternativePhoneCodeProvider.title",{provider:l})}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.start.alternativePhoneCodeProvider.subtitle",{provider:l})})]}),(0,o.Y)(C.Z.Alert,{children:d.error}),(0,o.Y)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:6,children:(0,o.FD)(O.l.Root,{onSubmit:t,gap:8,children:[(0,o.Y)(b.fv,{gap:6,children:(0,o.Y)(O.l.ControlRow,{elementId:"phoneNumber",children:(0,o.Y)(O.l.PhoneInput,{...r.props,label:(0,v.G)("signIn.start.alternativePhoneCodeProvider.label",{provider:l}),isRequired:!0,isOptional:!1,actionLabel:void 0,onActionClicked:void 0})})}),(0,o.FD)(b.fv,{center:!0,children:[(0,o.Y)(td.j,{}),(0,o.Y)(b.fv,{gap:6,sx:{width:"100%"},children:(0,o.Y)(O.l.SubmitButton,{hasArrow:!0,localizationKey:(0,v.G)("formButtonPrimary")})})]}),(0,o.Y)(b.fv,{center:!0,children:(0,o.Y)(b.$n,{variant:"link",colorScheme:"neutral",onClick:n,localizationKey:(0,v.G)("signIn.start.alternativePhoneCodeProvider.actionLink")})})]})})]})})},tg=e=>!!e.supportedFirstFactors?.length&&e.supportedFirstFactors.every(e=>"enterprise_sso"===e.strategy),tm=({field:e})=>{let[t,r]=(0,l.useState)(!1),n=(0,l.useRef)(null),i=!!(t||e?.value);return((0,l.useLayoutEffect)(()=>{let e=setInterval(()=>{if(n?.current){let t="onAutoFillStart"===window.getComputedStyle(n.current,":autofill").animationName||!!n.current?.matches("*:-webkit-autofill");t&&(r(t),clearInterval(e))}},500);return()=>{clearInterval(e)}},[]),(0,l.useEffect)(()=>{e?.value&&""!==e.value&&r(!1)},[e?.value]),e)?(0,o.Y)(O.l.ControlRow,{elementId:e.id,sx:i?void 0:{position:"absolute",opacity:0,height:0,pointerEvents:"none",marginTop:"-1rem"},children:(0,o.Y)(O.l.PasswordInput,{...e.props,ref:n,tabIndex:i?void 0:-1})}):null},tI=(0,S.RL)((0,S.SY)((0,A.dm)(function(){let e=(0,A.f0)(),t=(0,s.ho)(),n=(0,tu.m)(),{displayConfig:i,userSettings:a,authConfig:c}=(0,K.O)(),u=(0,x.n)(),{navigate:h}=(0,U.r)(),f=(0,d.r)(),{afterSignInUrl:g,signUpUrl:m,waitlistUrl:I,isCombinedFlow:_,navigateOnSetActive:w}=f,S=(0,q.p)(),k=(0,th.F)(),y=(0,l.useMemo)(()=>(0,tc.E9)(a.enabledFirstFactorIdentifiers),[a.enabledFirstFactorIdentifiers]),P=a.alternativePhoneCodeChannels,{isWebAuthnAutofillSupported:E}=(()=>{let[e,t]=(0,l.useState)(!1),{navigate:r}=(0,U.r)(),n=eV(()=>r("factor-two")),{userSettings:i}=(0,K.O)(),{passkeySettings:a,attributes:o}=i;return(0,l.useEffect)(()=>{async function e(){let e=await (0,to.nn)();t(e),e&&await n({flow:"autofill"})}a.allow_autofill&&o.passkey?.enabled&&e()},[]),{isWebAuthnAutofillSupported:e}})(),D=eV(()=>h("factor-two")),L=(0,to.Bz)(),M=!!f.initialValues?.phoneNumber&&!(f.initialValues.emailAddress||f.initialValues.username)&&y.includes("phone_number"),[T,G]=(0,l.useState)(M?"phone_number":y[0]||""),[R,B]=(0,l.useState)(!1),N=(0,ta.n)("__clerk_ticket")||"",W=(0,ta.n)("__clerk_status")||"",V=a.enabledFirstFactorIdentifiers,H=a.web3FirstFactors,j=a.authenticatableSocialStrategies,J=a.instanceIsPasswordBased,{currentIdentifier:X,nextIdentifier:Q}=(0,tc.ZN)(y,T),ee=(0,Z.tJ)("password","",{type:"password",label:(0,v.G)("formFieldLabel__password"),placeholder:(0,v.G)("formFieldInputPlaceholder__password")}),[et,er]=(0,l.useState)(null),en=a.alternativePhoneCodeChannels.length>0,ei=f.initialValues||{},ea=(0,l.useMemo)(()=>({email_address:ei.emailAddress,email_address_username:ei.emailAddress||ei.username,username:ei.username,phone_number:ei.phoneNumber}),[f.initialValues]),eo=!!j.length||!!H.length||!!P.length,[es,ec]=(0,l.useState)(!(0,tl.X)()&&!eo),ed=(0,Z.tJ)("identifier",ea[T]||"",{...X,isRequired:!0,transformer:e=>e.trim()}),eu=(0,Z.tJ)("identifier",ea.phone_number||"",{...X,isRequired:!0}),eh="phone_number"===T?eu:ed;(0,l.useLayoutEffect)(()=>{if(eh.value.startsWith("+")&&y.includes("phone_number")&&"phone_number"!==T&&!R){var e;e=eh.value,ed.setValue(ea[T]||""),eu.setValue(e),G("phone_number"),ec(!0),B(!0)}},[eh.value,y]),(0,l.useEffect)(()=>{if(N){if("sign_up"===W){let e=new URLSearchParams;N&&e.set("__clerk_ticket",N),h(_?"create":m,{searchParams:e});return}n.setLoading(),e.setLoading(),u.create({strategy:"ticket",ticket:N}).then(e=>{switch(e.status){case"needs_first_factor":if(!tg(e)||eq(e.supportedFirstFactors))return h("factor-one");return ef();case"needs_second_factor":return h("factor-two");case"needs_client_trust":return h("client-trust");case"complete":return(0,ta.r)("__clerk_ticket"),t.setActive({session:e.createdSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});default:return void console.error((0,z.s)(e.status,S))}}).catch(e=>eg(e)).finally(()=>{tg(u)||(n.setIdle(),e.setIdle())})}},[]),(0,l.useEffect)(()=>{!async function(){let t=u?.firstFactorVerification?.error;if(t){switch(t.code){case eB.c.NOT_ALLOWED_TO_SIGN_UP:case eB.c.OAUTH_ACCESS_DENIED:case eB.c.NOT_ALLOWED_ACCESS:case eB.c.SAML_USER_ATTRIBUTE_MISSING:case eB.c.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:case eB.c.USER_LOCKED:case eB.c.EXTERNAL_ACCOUNT_NOT_FOUND:case eB.c.SIGN_UP_MODE_RESTRICTED:case eB.c.SIGN_UP_MODE_RESTRICTED_WAITLIST:case eB.c.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:case eB.c.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eB.c.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:case eB.c.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eB.c.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:case eB.c.CAPTCHA_INVALID:case eB.c.FRAUD_DEVICE_BLOCKED:case eB.c.FRAUD_ACTION_BLOCKED:case eB.c.SIGNUP_RATE_LIMIT_EXCEEDED:case eB.c.USER_BANNED:e.setError(t);break;default:e.setError("Unable to complete action at this time. If the problem persists please contact support.")}await u.create({})}}()},[]);let ep=async(...e)=>{let r=et?.channel||(0,eI.oj)(e,c.preferredChannels,"identifier");if(r){let t=()=>{};e.push({id:"strategy",value:"phone_code",clearFeedback:t,setValue:t,onChange:t,setError:t}),e.push({id:"channel",value:r,clearFeedback:t,setValue:t,onChange:t,setError:t})}try{var n;let r,i,o=await (i=u.create(((!(r=(n=e).some(e=>"password"===e.name&&!!e.value))||a.enterpriseSSO.enabled)&&(n=n.filter(e=>"password"!==e.name)),{...(0,Z.mK)(n),...r&&!a.enterpriseSSO.enabled&&{strategy:"password"}})),i.then(t=>{if(!a.enterpriseSSO.enabled)return t;let r=e.find(e=>"password"===e.name)?.value;return!r||t.supportedFirstFactors?.some(e=>"enterprise_sso"===e.strategy)?t:t.attemptFirstFactor({strategy:"password",password:r})}));switch(o.status){case"needs_identifier":o.supportedFirstFactors?.some(e=>"enterprise_sso"===e.strategy)&&await ef();break;case"needs_first_factor":if(!tg(o)||eq(o.supportedFirstFactors))return h("factor-one");return ef();case"needs_second_factor":return h("factor-two");case"needs_client_trust":return h("client-trust");case"complete":return t.setActive({session:o.createdSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});default:return void console.error((0,z.s)(o.status,S))}}catch(e){return eg(e)}},ef=async()=>{let e=(0,eY.uP)(f,i.signInUrl),t=f.afterSignInUrl||"/";return u.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:e,redirectUrlComplete:t,oidcPrompt:f.oidcPrompt,continueSignIn:!0})},eg=async n=>{if(!n.errors)return;let o=n.errors.find(e=>e.code===eB.c.INVALID_STRATEGY_FOR_USER||e.code===eB.c.FORM_PASSWORD_INCORRECT||e.code===eB.c.FORM_PASSWORD_PWNED),s=n.errors.find(e=>e.code===eB.c.SESSION_EXISTS),l=n.errors.find(e=>"identifier_already_signed_in"===e.code),d=n.errors.find(e=>e.code===eB.c.INVITATION_ACCOUNT_NOT_EXISTS||e.code===eB.c.FORM_IDENTIFIER_NOT_FOUND);if(o)await ep(eh);else if(s)await t.setActive({session:t.client.lastActiveSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});else if(l){let e=l.meta.sessionId;await t.setActive({session:e,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}})}else if(_&&d){let n=(0,eI.UY)(eh);if(a.signUp.mode===eB.f.WAITLIST)return h(t.buildWaitlistUrl("emailAddress"===n?{initialValues:{[n]:eh.value}}:{}));t.client.signUp[n]=eh.value;let o=(0,eY.uP)(f,i.signUpUrl),s=f.afterSignUpUrl||"/";return function({identifierAttribute:e,identifierValue:t,signUpMode:n,navigate:i,organizationTicket:a,afterSignUpUrl:o,clerk:s,handleError:l,redirectUrl:c,redirectUrlComplete:d,passwordEnabled:u,navigateOnSetActive:h,alternativePhoneCodeChannel:p}){var f,g;if(n===eB.f.WAITLIST)return i(s.buildWaitlistUrl("emailAddress"===e?{initialValues:{[e]:t}}:{}));s.client.signUp[e]=t;let m=new URLSearchParams;return(a&&m.set("__clerk_ticket",a),u||(f=s.client.signUp,g=e,f.optionalFields.filter(e=>!(e.startsWith("oauth_")||e.startsWith("web3_"))&&"enterprise_sso"!==e&&"password"!==e&&("phoneNumber"!==g||"phone_number"!==e)).length>0)||"emailAddress"!==e&&"phoneNumber"!==e)?i("create",{searchParams:m}):s.client.signUp.create({[e]:t,...p?{strategy:"phone_code",channel:p}:{}}).then(async e=>(await Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,8722)).then(e=>e.completeSignUpFlow))({signUp:e,verifyEmailPath:"create/verify-email-address",verifyPhonePath:"create/verify-phone-number",handleComplete:()=>s.setActive({session:e.createdSessionId,navigate:async({session:e})=>{await h({session:e,redirectUrl:o})}}),navigate:i,redirectUrl:c,redirectUrlComplete:d})).catch(e=>l(e))}({afterSignUpUrl:f.afterSignUpUrl||"/",clerk:t,handleError:t=>(0,$.H4)(t,[eh,ee],e.setError),identifierAttribute:n,identifierValue:eh.value,navigate:h,organizationTicket:N,signUpMode:a.signUp.mode,redirectUrl:o,redirectUrlComplete:s,navigateOnSetActive:w,passwordEnabled:a.attributes.password?.required??!1,alternativePhoneCodeChannel:et?.channel||(0,eI.iy)(c.preferredChannels,n,eh.value)})}else(0,$.H4)(n,[eh,ee],e.setError)},em=async e=>(e.preventDefault(),ep(eh,ee)),e_=(0,l.useMemo)(()=>({tel:O.l.PhoneInput,password:O.l.PasswordInput,text:O.l.PlainInput,email:O.l.PlainInput})[eh.type],[eh.type]);if(n.isLoading||"sign_up"===W)return(0,o.Y)(el.B,{});let{action:ew,validLastAuthenticationStrategies:eS,...ev}=eh.props,eb=t.client?.lastAuthenticationStrategy,ek=!!eb&&k>1&&eS?.has(eb);return(0,o.Y)(p.n.Part,{part:"start",children:et?(0,o.Y)(tf,{handleSubmit:em,phoneNumberFormState:eu,onUseAnotherMethod:()=>{er(null)},phoneCodeProvider:et}):(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:_?(0,v.G)("signIn.start.titleCombined"):(0,v.G)("signIn.start.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:_?(0,v.G)("signIn.start.subtitleCombined"):(0,v.G)("signIn.start.subtitle"),sx:{"&:empty":{display:"none"}}})]}),(0,o.Y)(C.Z.Alert,{children:e.error}),(0,o.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:6,children:[(0,o.FD)(ts.U,{children:[eo&&(0,o.Y)(e$,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:en,onAlternativePhoneCodeProviderClick:e=>{er((0,eH.y)(e)||null)}}),V.length?(0,o.FD)(O.l.Root,{onSubmit:em,gap:8,children:[(0,o.FD)(b.fv,{gap:6,children:[(0,o.Y)(O.l.ControlRow,{elementId:eh.id,children:(0,o.Y)(e_,{actionLabel:Q?.action,onActionClicked:()=>{G(e=>y[(y.indexOf(e)+1)%y.length]),ec(!0),B(!1)},...ev,autoFocus:es,autoComplete:E?"webauthn":void 0,isLastAuthenticationStrategy:ek})}),(0,o.Y)(tm,{field:J?ee:void 0})]}),(0,o.FD)(b.fv,{center:!0,children:[(0,o.Y)(td.j,{}),(0,o.Y)(O.l.SubmitButton,{hasArrow:!0})]})]}):null]}),!V.length&&(0,o.Y)(td.j,{}),a.attributes.passkey?.enabled&&a.passkeySettings.show_sign_in_button&&L&&(0,o.Y)(C.Z.Action,{elementId:"usePasskey",children:(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.start.actionLink__use_passkey"),onClick:()=>D({flow:"discoverable"})})})]})]}),(0,o.FD)(C.Z.Footer,{children:[a.signUp.mode===eB.f.PUBLIC&&!_&&(0,o.FD)(C.Z.Action,{elementId:"signIn",children:[(0,o.Y)(C.Z.ActionText,{localizationKey:(0,v.G)("signIn.start.actionText")}),(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.start.actionLink"),to:t.buildUrlWithAuth(m)})]}),a.signUp.mode===eB.f.WAITLIST&&(0,o.FD)(C.Z.Action,{elementId:"signIn",children:[(0,o.Y)(C.Z.ActionText,{localizationKey:(0,v.G)("signIn.start.actionText__join_waitlist")}),(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.start.actionLink__join_waitlist"),to:t.buildUrlWithAuth(I)})]})]})]})})})));function t_(){let e=(0,s.ho)();return l.useEffect(()=>{e.redirectToSignIn()},[]),null}function tw(){let e=(0,d.r)(),t=(0,u.X)();return(0,o.Y)(p.n.Root,{flow:"signIn",children:(0,o.FD)(I.d,{children:[(0,o.Y)(_.q,{path:"factor-one",children:(0,o.Y)(e7,{})}),(0,o.Y)(_.q,{path:"factor-two",children:(0,o.Y)(tr,{})}),(0,o.Y)(_.q,{path:"client-trust",children:(0,o.Y)(ey,{})}),(0,o.Y)(_.q,{path:"reset-password",children:(0,o.Y)(H,{})}),(0,o.Y)(_.q,{path:"reset-password-success",children:(0,o.Y)(X,{})}),(0,o.Y)(_.q,{path:"sso-callback",children:(0,o.Y)(ti,{signUpUrl:e.signUpUrl,signInUrl:e.signInUrl,signInForceRedirectUrl:e.afterSignInUrl,signUpForceRedirectUrl:e.afterSignUpUrl,continueSignUpUrl:e.signUpContinueUrl,transferable:e.transferable,firstFactorUrl:"../factor-one",secondFactorUrl:"../factor-two",resetPasswordUrl:"../reset-password"})}),(0,o.Y)(_.q,{path:"choose",children:(0,o.Y)(es,{})}),(0,o.Y)(_.q,{path:"choose-wallet",children:(0,o.Y)(E,{})}),(0,o.Y)(_.q,{path:"verify",children:(0,o.Y)(c.Y,{redirectUrlComplete:e.afterSignInUrl,redirectUrl:"../factor-two"})}),e.isCombinedFlow&&(0,o.FD)(_.q,{path:"create",children:[(0,o.Y)(_.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,o.Y)(T,{})}),(0,o.Y)(_.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,o.Y)(M,{})}),(0,o.Y)(_.q,{path:"sso-callback",children:(0,o.Y)(R,{signUpUrl:t.signUpUrl,signInUrl:t.signInUrl,signUpForceRedirectUrl:t.afterSignUpUrl,signInForceRedirectUrl:t.afterSignInUrl,secondFactorUrl:t.secondFactorUrl,continueSignUpUrl:"../continue",verifyEmailAddressUrl:"../verify-email-address",verifyPhoneNumberUrl:"../verify-phone-number"})}),(0,o.Y)(_.q,{path:"verify",children:(0,o.Y)(c.M,{redirectUrlComplete:t.afterSignUpUrl,verifyEmailPath:"../verify-email-address",verifyPhonePath:"../verify-phone-number",continuePath:"../continue"})}),(0,o.FD)(_.q,{path:"continue",children:[(0,o.Y)(_.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,o.Y)(T,{})}),(0,o.Y)(_.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,o.Y)(M,{})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(B,{})})]}),(0,o.Y)(_.q,{path:"tasks",children:(0,o.Y)(m.JJ,{redirectUrlComplete:e.afterSignUpUrl})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(G,{})})]}),(0,o.Y)(_.q,{path:"tasks",children:(0,o.Y)(m.JJ,{redirectUrlComplete:e.afterSignInUrl})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(tI,{})}),(0,o.Y)(_.q,{children:(0,o.Y)(t_,{})})]})})}function tS(){let e=(0,d.r)(),t={componentName:"SignUp",emailLinkRedirectUrl:e.emailLinkRedirectUrl,ssoCallbackUrl:e.ssoCallbackUrl,forceRedirectUrl:e.signUpForceRedirectUrl,fallbackRedirectUrl:e.signUpFallbackRedirectUrl,signInUrl:e.signInUrl,unsafeMetadata:e.unsafeMetadata,...(0,D.C)({routing:e?.routing,path:e?.path})};return((e=!1)=>(0,f.s)(e?L:void 0,"preloadComponent",{staleTime:1/0}))(e.isCombinedFlow),(0,g.Z)(),(0,o.Y)(u.g.Provider,{value:t,children:(0,o.Y)(tw,{})})}tw.displayName="SignIn";let tv=(0,h.Z)(tS),tb=(0,h.Z)(tS),tY=e=>{let t={signUpUrl:`/${w.I}/sign-up`,waitlistUrl:`/${w.I}/waitlist`,...e};return(0,o.Y)(_.q,{path:"sign-in",children:(0,o.Y)(d.Q.Provider,{value:{componentName:"SignIn",...t,routing:"virtual",mode:"modal"},children:(0,o.Y)("div",{children:(0,o.Y)(tb,{...t,routing:"virtual"})})})})}},2690:function(e,t,r){r.d(t,{j:()=>o});var n=r(5074),i=r(5763);let a=e=>{if(!e)return"";let t=e.strategy;return"phoneNumberId"in e&&(t+=e.phoneNumberId),t};function o(e){let t=n.useRef(""),[r,o]=n.useState(()=>(0,i.R5)(e)),[s,l]=n.useState(!r),c=t.current===a(r);return{currentFactor:r,factorAlreadyPrepared:c,handleFactorPrepare:()=>{t.current=a(r)},selectFactor:e=>{o(e),l(!1)},showAllStrategies:s,toggleAllStrategies:()=>l(e=>!e)}}},5763:function(e,t,r){r.d(t,{Cm:()=>u,Kw:()=>f,R5:()=>h,UY:()=>g,iy:()=>I,oj:()=>m,xf:()=>c}),r(1044);var n=r(2620),i=r(7651),a=r(1959),o=r(8289);let s=e=>t=>"safeIdentifier"in t&&t.safeIdentifier===e;function l(e){if((0,n.Bz)()){let t=e.find(({strategy:e})=>"passkey"===e);if(t)return t}return null}function c(e,t,r){return e&&0!==e.length?r===a._o.Password?function(e,t){let r=l(e);if(r)return r;let n=e.sort(o.Kn)[0];return"password"===n.strategy?n:e.find(s(t))||n||null}(e,t):function(e,t){let r=l(e);if(r)return r;let n=e.sort(o.Ih),i=n.find(s(t));if(i)return i;let a=n[0];return"email_link"===a.strategy?a:e.find(s(t))||a||null}(e,t):null}let d=["passkey","email_code","password","phone_code","email_link"];function u(e){return!!e&&d.includes(e.strategy)}function h(e){if(!e||0===e.length)return null;let t=e.find(e=>"totp"===e.strategy);if(t)return t;let r=e.find(e=>"phone_code"===e.strategy);return r||e[0]}let p=["reset_password_phone_code","reset_password_email_code"],f=e=>!!e&&p.includes(e);function g(e){let t;return"tel"===e.type?"phoneNumber":(t=e.value,/^\S+@\S+\.\S+$/.test(t))?"emailAddress":"username"}let m=(e,t,r)=>{if(!t)return null;let n=e.find(e=>"strategy"===e.id)?.value;if(n&&"phone_code"!==n)return null;let a=e.find(e=>e.id===r)?.value;if(!a||!a?.startsWith("+"))return null;let o=(0,i.TV)(a,t);return"sms"===o?null:o},I=(e,t,r)=>{if(!e||!t||"phoneNumber"!==t||!r||!r?.startsWith("+"))return null;let n=(0,i.TV)(r,e);return"sms"===n?null:n}},4:function(e,t,r){r.d(t,{Q:()=>g,r:()=>m});var n=r(2166),i=r(8380),a=r(5580),o=r(4173),s=r(1210),l=r(5993),c=r(5074),d=r(8051),u=r(7697),h=r(2366),p=r(4964),f=r(2117);let g=(0,c.createContext)(null),m=()=>{let e=(0,c.useContext)(g),{navigate:t,basePath:r,startPath:m}=(0,p.r)(),{displayConfig:I,userSettings:_}=(0,u.O)(),{queryParams:w,queryString:S}=(0,p.r)(),v=_.signUp.mode,b=(0,h.II)(),Y=(0,s.ho)();if(null===e||"SignIn"!==e.componentName)throw Error("Clerk: useSignInContext called outside of the mounted SignIn component.");let k="restricted"!==v&&!!(!b.signUpUrl&&b.signInUrl&&!(0,l.s)(b.signInUrl))&&!1!==e.withSignUp||e.withSignUp||!1,{componentName:C,mode:A,...F}=e,y=(0,c.useMemo)(()=>(0,f.tf)(S,n.u),[]),U=new i.n(b,{...F,signInFallbackRedirectUrl:F.signInFallbackRedirectUrl||F.fallbackRedirectUrl,signInForceRedirectUrl:F.signInForceRedirectUrl||F.forceRedirectUrl},w,A);delete F.fallbackRedirectUrl,delete F.forceRedirectUrl;let P=Y.buildUrlWithAuth(U.getAfterSignInUrl()),E=Y.buildUrlWithAuth(U.getAfterSignUpUrl()),D="path"===F.routing&&F.path||b.signInUrl||I.signInUrl,L=k?"path"===F.routing&&F.path||b.signUpUrl||I.signUpUrl:F.signUpUrl||b.signUpUrl||I.signUpUrl,M=F.waitlistUrl||b.waitlistUrl||I.waitlistUrl,T=U.getPreservedSearchParams();D=(0,o.kZ)({base:D,hashSearchParams:[w,T]},{stringify:!0}),L=(0,o.kZ)({base:L,hashSearchParams:[w,T]},{stringify:!0}),M=(0,o.kZ)({base:M,hashSearchParams:[w,T]},{stringify:!0});let G=U.toSearchParams().toString(),R=(0,d.aQ)({routing:F.routing,baseUrl:L,authQueryString:G,path:F.path,endpoint:k?"/create"+d.Vu:d.Vu}),B=(0,d.aQ)({routing:F.routing,baseUrl:L,authQueryString:G,path:F.path,endpoint:k?"/create"+d.aB:d.aB});k&&(L=(0,o.kZ)({base:D,hashPath:"/create",hashSearchParams:[w,T]},{stringify:!0}));let z=(0,o.kZ)({base:L,hashPath:"/continue"},{stringify:!0}),O=async({session:e,redirectUrl:n})=>{let i=e.currentTask;if(!i)return t(n);let o=(0,a.ru)(i);return t(`/${r+m+(k?"/create"+o:o)}`)},$=Y.session?.currentTask?Y.__internal_getOption("taskUrls")?.[Y.session?.currentTask.key]??(0,d.aQ)({routing:F.routing,baseUrl:D,authQueryString:G,path:F.path,endpoint:k?"/create"+(0,a.ru)(Y.session?.currentTask):(0,a.ru)(Y.session?.currentTask)}):null;return{...F,transferable:F.transferable??!0,oauthFlow:F.oauthFlow||"auto",componentName:C,signUpUrl:L,signInUrl:D,waitlistUrl:M,afterSignInUrl:P,afterSignUpUrl:E,emailLinkRedirectUrl:R,ssoCallbackUrl:B,navigateAfterSignIn:()=>t(P),signUpContinueUrl:z,queryParams:w,initialValues:{...F.initialValues,...y},authQueryString:G,isCombinedFlow:k,navigateOnSetActive:O,taskUrl:$}}},9599:function(e,t,r){r.d(t,{g:()=>a});var n=r(1210),i=r(4964);let a=()=>{let{navigate:e}=(0,i.r)(),t=(0,n.ho)();return{navigateAfterSignOut:()=>e(t.buildAfterSignOutUrl()),navigateAfterMultiSessionSingleSignOutUrl:()=>e(t.buildAfterMultiSessionSingleSignOutUrl()),afterSignOutUrl:t.buildAfterSignOutUrl(),afterMultiSessionSingleSignOutUrl:t.buildAfterMultiSessionSingleSignOutUrl()}}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["10"],{9090:function(e,t,r){r.d(t,{n:()=>o});var n=r(4518),i=r(5170),a=r(2861);let o=e=>{let{onBackLinkClick:t}=e;return(0,n.Y)(i.J,{cardTitle:(0,a.G)("signIn.alternativeMethods.getHelp.title"),cardSubtitle:(0,a.G)("signIn.alternativeMethods.getHelp.content"),onBackLinkClick:t})}},5717:function(e,t,r){let n,i;r.r(t),r.d(t,{SignIn:()=>tv,SignInModal:()=>tY});var a,o=r(4518),s=r(1210),l=r(5074),c=r(5873),d=r(4),u=r(5350),h=r(5577),p=r(4607),f=r(7896),g=r(7607),m=r(4096),I=r(7831),_=r(2265),w=r(4132),S=r(656),v=r(2861),b=r(8272),Y=r(8920),k=r(29),C=r(6088),A=r(3269),F=r(6153),y=r(9236),U=r(4964);let P=(0,l.lazy)(()=>Promise.all([r.e("545"),r.e("666"),r.e("188")]).then(r.bind(r,6464)).then(e=>({default:e.Web3SolanaWalletButtons}))),E=(0,S.RL)((0,S.SY)((0,A.dm)(()=>{let e=(0,s.ho)(),t=(0,A.f0)(),r=(0,U.r)(),n=(0,d.r)();return(0,o.Y)(p.n.Part,{part:"chooseWallet",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.web3Solana.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.web3Solana.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:t.error}),(0,o.FD)(b.so,{direction:"col",gap:4,children:[(0,o.Y)(l.Suspense,{fallback:(0,o.Y)(b.so,{direction:"row",align:"center",justify:"center",sx:e=>({height:"100%",minHeight:e.sizes.$32}),children:(0,o.Y)(b.y$,{size:"lg",colorScheme:"primary",elementDescriptor:Y.$z.spinner})}),children:(0,o.Y)(P,{web3AuthCallback:({walletName:i})=>e.authenticateWithWeb3({customNavigate:r.navigate,redirectUrl:n.afterSignInUrl||"/",secondFactorUrl:"factor-two",signUpContinueUrl:n.isCombinedFlow?"create/continue":n.signUpContinueUrl,strategy:"web3_solana_signature",walletName:i}).catch(e=>(0,y.f)(e,t.setError))})}),(0,o.Y)(k.E,{boxElementDescriptor:Y.$z.backRow,linkElementDescriptor:Y.$z.backLink,onClick:()=>{r.navigate("../")}})]})]}),(0,o.Y)(C.Z.Footer,{})]})})})));var D=r(4692);let L=()=>Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,4753)),M=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpVerifyPhone}))),T=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpVerifyEmail}))),G=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpStart}))),R=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpSSOCallback}))),B=(0,l.lazy)(()=>L().then(e=>({default:e.SignUpContinue})));var z=r(2950),O=r(2454),$=r(4468),N=r(3990),Z=r(8640),x=r(6324),K=r(7697),W=r(78),V=r(620),q=r(9426);let H=(0,A.dm)(()=>{let e=(0,x.n)(),t=(0,A.f0)(),{navigate:r}=(0,U.r)(),n=(0,q.p)(),{userSettings:{passwordSettings:i}}=(0,K.O)(),{t:a,locale:s}=(0,W._)(),c="needs_new_password"===e.status&&"reset_password_email_code"!==e.firstFactorVerification.strategy&&"reset_password_phone_code"!==e.firstFactorVerification.strategy;l.useEffect(()=>{c&&t.setError(a((0,v.G)("signIn.resetPassword.requiredMessage")))},[]);let d=(0,Z.tJ)("password","",{type:"password",label:(0,v.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,N.C5)(e,{t:a,locale:s,passwordSettings:i})}),u=(0,Z.tJ)("confirmPassword","",{type:"password",label:(0,v.G)("formFieldLabel__confirmPassword"),isRequired:!0}),h=(0,Z.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,v.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:p,isPasswordMatch:f}=(0,V.Z)({passwordField:d,confirmPasswordField:u}),g=async()=>{if(f){d.clearFeedback(),u.clearFeedback();try{let{status:t,createdSessionId:i}=await e.resetPassword({password:d.value,signOutOfOtherSessions:h.checked});switch(t){case"complete":if(i){let e=new URLSearchParams;return e.set("createdSessionId",i),r(`../reset-password-success?${e.toString()}`)}return console.error((0,z.s)(t,n));case"needs_second_factor":return r("../factor-two");default:return console.error((0,z.s)(t,n))}}catch(e){return(0,$.H4)(e,[d,u],t.setError)}}};return(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.Y)(F.Y.Root,{showLogo:!0,children:(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.resetPassword.title")})}),(0,o.Y)(C.Z.Alert,{children:t.error}),(0,o.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:(0,o.FD)(O.l.Root,{onSubmit:g,onBlur:()=>{d.value&&p(u.value)},gap:8,children:[(0,o.FD)(b.fv,{gap:6,children:[(0,o.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:e.identifier||"",style:{display:"none"}}),(0,o.Y)(O.l.ControlRow,{elementId:d.id,children:(0,o.Y)(O.l.PasswordInput,{...d.props,isRequired:!0,autoFocus:!0})}),(0,o.Y)(O.l.ControlRow,{elementId:u.id,children:(0,o.Y)(O.l.PasswordInput,{...u.props,onChange:e=>(e.target.value&&p(e.target.value),u.props.onChange(e))})}),!c&&(0,o.Y)(O.l.ControlRow,{elementId:h.id,children:(0,o.Y)(O.l.Checkbox,{...h.props})})]}),(0,o.FD)(b.fv,{gap:3,children:[(0,o.Y)(O.l.SubmitButton,{isDisabled:!f,localizationKey:(0,v.G)("signIn.resetPassword.formButtonPrimary")}),(0,o.Y)(C.Z.Action,{elementId:"alternativeMethods",children:(0,o.Y)(C.Z.ActionLink,{elementDescriptor:Y.$z.backLink,localizationKey:(0,v.G)("backButton"),onClick:()=>r("../")})})]})]})})]}),(0,o.Y)(C.Z.Footer,{})]})});var j=r(9107),J=r(6488);let X=(0,A.dm)(()=>{let e=(0,A.f0)();return(0,j.h)(),(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.Y)(F.Y.Root,{showLogo:!0,children:(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.resetPassword.title")})}),(0,o.Y)(C.Z.Alert,{children:e.error}),(0,o.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:[(0,o.Y)(b.EY,{localizationKey:(0,v.G)("signIn.resetPassword.successMessage")}),(0,o.Y)(J.s,{direction:"row",center:!0,children:(0,o.Y)(b.y$,{size:"xl",colorScheme:"primary",elementDescriptor:Y.$z.spinner})})]})]}),(0,o.Y)(C.Z.Footer,{})]})});var Q=r(2531),ee=r(750),et=r(9345),er=r(9599),en=r(9366),ei=r(6932),ea=r(1052),eo=r(2540);let es=(0,S.SY)((0,A.dm)(()=>{let e=(0,A.f0)(),{userProfileUrl:t}=(0,K.O)().displayConfig,{afterSignInUrl:r,path:n,signInUrl:i,taskUrl:a}=(0,d.r)(),{navigateAfterSignOut:s}=(0,er.g)(),{handleSignOutAllClicked:l,handleSessionClicked:c,signedInSessions:u,handleAddAccountClicked:h}=(0,eo.u)({taskUrl:a,navigateAfterSignOut:s,afterSwitchSessionUrl:r,userProfileUrl:t,signInUrl:n??i,user:void 0});return(0,o.Y)(p.n.Part,{part:"accountSwitcher",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{sx:e=>({padding:`${e.space.$8} ${e.space.$none} ${e.space.$none}`}),children:[(0,o.FD)(F.Y.Root,{children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.accountSwitcher.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.accountSwitcher.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:e.error}),(0,o.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100}),children:(0,o.FD)(Q.En,{role:"menu",children:[u.map(e=>(0,o.Y)(ee.P,{onClick:c(e),sx:e=>({height:e.sizes.$16,justifyContent:"flex-start",borderRadius:0}),icon:en.A,children:(0,o.Y)(et.c,{user:e.user,sx:{width:"100%"}})},e.id)),(0,o.Y)(Q.rc,{elementDescriptor:Y.$z.accountSwitcherActionButton,elementId:Y.$z.accountSwitcherActionButton.setId("addAccount"),iconBoxElementDescriptor:Y.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:Y.$z.accountSwitcherActionButtonIconBox.setId("addAccount"),iconElementDescriptor:Y.$z.accountSwitcherActionButtonIcon,iconElementId:Y.$z.accountSwitcherActionButtonIcon.setId("addAccount"),icon:ei.A,label:(0,v.G)("signIn.accountSwitcher.action__addAccount"),onClick:h,iconSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),iconBoxSx:e=>({minHeight:e.sizes.$9,minWidth:e.sizes.$6,alignItems:"center"}),spinnerSize:"md"})]})})]}),(0,o.Y)(C.Z.Footer,{sx:e=>({">:first-of-type":{padding:`${e.space.$1}`,width:"100%"}}),children:(0,o.Y)(C.Z.Action,{sx:{width:"100%",">:first-of-type":{width:"100%",borderBottomWidth:0}},children:(0,o.Y)(ea.ww,{handleSignOutAllClicked:l,elementDescriptor:Y.$z.accountSwitcherActionButton,elementId:Y.$z.accountSwitcherActionButton.setId("signOutAll"),iconBoxElementDescriptor:Y.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:Y.$z.accountSwitcherActionButtonIconBox.setId("signOutAll"),iconElementDescriptor:Y.$z.accountSwitcherActionButtonIcon,iconElementId:Y.$z.accountSwitcherActionButtonIcon.setId("signOutAll"),label:(0,v.G)("signIn.accountSwitcher.action__signOutAll"),actionSx:e=>({padding:`${e.space.$2} ${e.space.$2}`})})})})]})})}));var el=r(6980),ec=r(8738),ed=r(8289),eu=r(9835),eh=r(9090);let ep=e=>{let[t,r]=l.useState(!1),n=l.useCallback(()=>r(e=>!e),[r]);return t?(0,o.Y)(eh.n,{onBackLinkClick:n}):(0,o.Y)(ef,{onBackLinkClick:e.onBackLinkClick,onFactorSelected:e.onFactorSelected,onHavingTroubleClick:n})},ef=e=>{let{onHavingTroubleClick:t,onFactorSelected:r,onBackLinkClick:n}=e,i=(0,A.f0)(),{supportedSecondFactors:a}=(0,x.n)();return(0,o.Y)(p.n.Part,{part:"alternativeMethods",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.alternativeMethods.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.alternativeMethods.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:i.error}),(0,o.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:3,children:[(0,o.Y)(b.fv,{gap:2,children:a&&a.sort(ed.Wy).map((e,t)=>(0,o.Y)(ec.X,{textLocalizationKey:function(e){switch(e.strategy){case"phone_code":return(0,v.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"totp":return(0,v.G)("signIn.alternativeMethods.blockButton__totp");case"backup_code":return(0,v.G)("signIn.alternativeMethods.blockButton__backupCode");case"email_code":return(0,v.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"email_link":return(0,v.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,eu.u)(e.safeIdentifier)||""});default:throw Error("Invalid sign in strategy")}}(e),elementDescriptor:Y.$z.alternativeMethodsBlockButton,textElementDescriptor:Y.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:Y.$z.alternativeMethodsBlockButtonArrow,isDisabled:i.isLoading,onClick:()=>r(e)},t))}),(0,o.Y)(C.Z.Action,{elementId:"alternativeMethods",children:n&&(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("backButton"),onClick:e.onBackLinkClick})})]})]}),(0,o.Y)(C.Z.Footer,{children:(0,o.FD)(C.Z.Action,{elementId:"havingTrouble",children:[(0,o.Y)(C.Z.ActionText,{localizationKey:(0,v.G)("signIn.alternativeMethods.actionText")}),(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.alternativeMethods.actionLink"),onClick:t})]})})]})})};var eg=r(3610),em=r(7912),eI=r(5763);let e_=e=>(0,eI.Kw)(e.firstFactorVerification?.strategy)&&e.firstFactorVerification?.status==="verified",ew=e=>{let t=(0,K.O)(),r=(0,x.n)(),n=(0,A.f0)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:c}=(0,s.ho)(),{navigate:u}=(0,U.r)(),h=(0,q.p)(),p=(0,s.ho)(),f=(0,l.useMemo)(()=>{let e=Object.values(t.userSettings.attributes).some(e=>e.used_for_second_factor);return"new"===r.clientTrustState&&!e},[r.clientTrustState,t.userSettings.attributes]);l.useEffect(()=>{e.factorAlreadyPrepared||g?.()},[]);let g=e.prepare?()=>e.prepare?.().then(()=>e.onFactorPrepare()).catch(e=>{if((0,eg._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,$.H4)(e,[],n.setError)}):void 0;return(0,o.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e_(r)?(0,v.G)("signIn.forgotPassword.subtitle"):e.cardSubtitle,cardNotice:e.showClientTrustNotice||f?(0,v.G)("signIn.newDeviceVerificationNotice"):void 0,resendButton:e.resendButton,inputLabel:e.inputLabel,onCodeEntryFinishedAction:(t,n,o)=>{r.attemptSecondFactor({strategy:e.factor.strategy,code:t}).then(async e=>{if(await n(),"complete"!==e.status)return console.error((0,z.s)(e.status,h));if(e_(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),u(`../reset-password-success?${t.toString()}`)}return c({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}})}).catch(e=>(0,eg._d)(e)?p.__internal_navigateWithError("..",e.errors[0]):o(e))},onResendCodeClicked:g,safeIdentifier:"safeIdentifier"in e.factor?e.factor.safeIdentifier:void 0,profileImageUrl:r.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,children:e_(r)&&(0,o.Y)(b.EY,{localizationKey:(0,v.G)("signIn.resetPasswordMfa.detailsLabel"),colorScheme:"secondary"})})},eS=e=>{let t=(0,x.n)();return(0,o.Y)(p.n.Part,{part:"emailCode2Fa",children:(0,o.Y)(ew,{...e,cardTitle:(0,v.G)("signIn.emailCodeMfa.title"),cardSubtitle:(0,v.G)("signIn.emailCodeMfa.subtitle"),inputLabel:(0,v.G)("signIn.emailCodeMfa.formTitle"),resendButton:(0,v.G)("signIn.emailCodeMfa.resendButton"),prepare:()=>{let{emailAddressId:r,strategy:n}=e.factor;return t.prepareSecondFactor({emailAddressId:r,strategy:n})}})})};var ev=r(2027),eb=r(4979),eY=r(8051),ek=r(2992);let eC=e=>{let{t}=(0,W._)(),r=(0,A.f0)(),n=(0,x.n)(),i=(0,d.r)(),{signInUrl:a}=i,{afterSignInUrl:c}=(0,d.r)(),{setActive:u}=(0,s.ho)(),{startEmailLinkFlow:h,cancelEmailLinkFlow:f}=(0,ek.u)(n),[g,m]=l.useState(!1),I=(0,s.ho)();l.useEffect(()=>{_()},[]);let _=()=>{h({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,eY.lA)({ctx:i,baseUrl:a,intent:"sign-in"})}).then(e=>w(e)).catch(e=>{if((0,eg._d)(e))return I.__internal_navigateWithError("..",e.errors[0]);(0,$.H4)(e,[],r.setError)})},w=async e=>{let n=e.secondFactorVerification;"expired"===n.status?r.setError(t((0,v.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?m(!0):await u({session:e.createdSessionId,redirectUrl:c})};return g?(0,o.Y)(eb.$,{title:(0,v.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,v.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,o.Y)(p.n.Part,{part:"emailLink",children:(0,o.Y)(ev._,{cardTitle:(0,v.G)("signIn.emailLinkMfa.title"),cardSubtitle:(0,v.G)("signIn.emailLinkMfa.subtitle"),cardNotice:e.showClientTrustNotice||"new"===n.clientTrustState?(0,v.G)("signIn.newDeviceVerificationNotice"):void 0,formSubtitle:(0,v.G)("signIn.emailLinkMfa.formSubtitle"),resendButton:(0,v.G)("signIn.emailLinkMfa.resendButton"),onResendCodeClicked:()=>{f(),_()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})},eA=e=>{let t=(0,x.n)();return(0,o.Y)(p.n.Part,{part:"phoneCode2Fa",children:(0,o.Y)(ew,{...e,cardTitle:(0,v.G)("signIn.phoneCodeMfa.title"),cardSubtitle:(0,v.G)("signIn.phoneCodeMfa.subtitle"),inputLabel:(0,v.G)("signIn.phoneCodeMfa.formTitle"),resendButton:(0,v.G)("signIn.phoneCodeMfa.resendButton"),prepare:()=>{let{phoneNumberId:r,strategy:n}=e.factor;return t.prepareSecondFactor({phoneNumberId:r,strategy:n})}})})};var eF=r(2690);let ey=(0,S.RL)((0,S.SY)((0,A.dm)(function(){let e=(0,x.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:a,toggleAllStrategies:s}=(0,eF.j)(e.supportedSecondFactors);if(!t)return(0,o.Y)(el.B,{});if(a)return(0,o.Y)(ep,{onBackLinkClick:s,onFactorSelected:i});switch(t?.strategy){case"phone_code":return(0,o.Y)(eA,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_code":return(0,o.Y)(eS,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_link":return(0,o.Y)(eC,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});default:return(0,o.Y)(el.B,{})}})));var eU=r(5170),eP=r(3474),eE=r(6505),eD=r(8144),eL=r(4421),eM=r(1051),eT=r(2181),eG=r(743),eR=r(6889),eB=r(2166),ez=r(44),eO=r(3226);let e$=l.memo(e=>{let t=(0,s.ho)(),{navigate:r}=(0,U.r)(),n=(0,A.f0)(),{displayConfig:i}=(0,K.O)(),a=(0,d.r)(),l=(0,x.n)(),c=(0,eY.uP)(a,i.signInUrl),u=a.afterSignInUrl||"/",h="popup"===a.oauthFlow||"auto"===a.oauthFlow&&(0,ez.C)(),{onAlternativePhoneCodeProviderClick:p,...f}=e,g=e=>(0,eg.$R)(e)&&e.errors.find(e=>e.code===eB.c.SESSION_EXISTS)?t.setActive({session:t.client.lastActiveSessionId,navigate:async({session:e})=>{await a.navigateOnSetActive({session:e,redirectUrl:a.afterSignInUrl})}}):(0,$.H4)(e,[],n.setError);return(0,o.Y)(eO.V,{...f,showLastAuthenticationStrategy:!0,idleAfterDelay:!h,oauthCallback:e=>{if(h){let t=window.open("about:blank","","width=600,height=800"),r=setInterval(()=>{(!t||t.closed)&&(clearInterval(r),n.setIdle())},500);return l.authenticateWithPopup({strategy:e,redirectUrl:c,redirectUrlComplete:u,popup:t,oidcPrompt:a.oidcPrompt}).catch(e=>g(e))}return l.authenticateWithRedirect({strategy:e,redirectUrl:c,redirectUrlComplete:u,oidcPrompt:a.oidcPrompt}).catch(e=>g(e))},web3Callback:e=>"web3_solana_signature"===e?r(`choose-wallet?strategy=${e}`):t.authenticateWithWeb3({customNavigate:r,redirectUrl:u,signUpContinueUrl:a.isCombinedFlow?"create/continue":a.signUpContinueUrl,strategy:e,secondFactorUrl:"factor-two"}).catch(e=>(0,y.f)(e,n.setError)),alternativePhoneCodeCallback:e=>{p?.(e)}})});function eN(){let e=(0,x.n)();return e.supportedFirstFactors?.find(({strategy:e})=>(0,eI.Kw)(e))}let eZ=e=>((e,t)=>{let[r,n]=l.useState(!1),i=l.useCallback(()=>n(e=>!e),[n]);return r?(0,o.Y)(eh.n,{onBackLinkClick:i}):(0,o.Y)(e,{...t,onHavingTroubleClick:i})})(ex,{...e}),ex=e=>{let{onBackLinkClick:t,onHavingTroubleClick:r,onFactorSelected:n,mode:i="default"}=e,a=(0,A.f0)(),s=eN(),{supportedFirstFactors:l}=(0,x.n)(),{firstPartyFactors:c,hasAnyStrategy:d}=(0,eP.y)({filterOutFactor:e?.currentFactor,supportedFirstFactors:l}),u=function(e){switch(e){case"forgot":return"forgotPasswordMethods";case"pwned":return"passwordPwnedMethods";case"passwordCompromised":return"passwordCompromisedMethods";default:return"alternativeMethods"}}(i),h=function(e){switch(e){case"forgot":return(0,v.G)("signIn.forgotPasswordAlternativeMethods.title");case"pwned":return(0,v.G)("signIn.passwordPwned.title");case"passwordCompromised":return(0,v.G)("signIn.passwordCompromised.title");default:return(0,v.G)("signIn.alternativeMethods.title")}}(i),f=function(e){switch(e){case"forgot":case"pwned":return!0;default:return!1}}(i);return(0,o.Y)(p.n.Part,{part:u,children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:h}),!f&&"passwordCompromised"!==i&&(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.alternativeMethods.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:a.error}),(0,o.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:6,children:[f&&s&&(0,o.Y)(b.$n,{localizationKey:eK(s),elementDescriptor:Y.$z.alternativeMethodsBlockButton,isDisabled:a.isLoading,onClick:()=>{a.setError(void 0),n(s)}}),f&&d&&(0,o.Y)(eE.c,{dividerText:(0,v.G)("signIn.forgotPasswordAlternativeMethods.label__alternativeMethods")}),(0,o.FD)(b.fv,{gap:4,children:[d&&(0,o.FD)(b.so,{elementDescriptor:Y.$z.alternativeMethods,direction:"col",gap:2,children:[(0,o.Y)(e$,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:!1}),c&&c.map((e,t)=>{var r;return(0,o.Y)(ec.X,{leftIcon:(r=e,({email_link:eD.A,email_code:eL.A,phone_code:eM.A,reset_password_email_code:eT.A,reset_password_phone_code:eT.A,password:eG.A,passkey:eR.A})[r.strategy]),textLocalizationKey:eK(e),elementDescriptor:Y.$z.alternativeMethodsBlockButton,textElementDescriptor:Y.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:Y.$z.alternativeMethodsBlockButtonArrow,textVariant:"buttonLarge",isDisabled:a.isLoading,onClick:()=>{a.setError(void 0),n(e)}},t)})]}),t&&(0,o.Y)(k.E,{boxElementDescriptor:Y.$z.backRow,linkElementDescriptor:Y.$z.backLink,onClick:t})]})]})]}),(0,o.Y)(C.Z.Footer,{children:(0,o.FD)(C.Z.Action,{elementId:"havingTrouble",children:[(0,o.Y)(C.Z.ActionText,{localizationKey:(0,v.G)("signIn.alternativeMethods.actionText")}),(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.alternativeMethods.actionLink"),onClick:r})]})})]})})};function eK(e){switch(e.strategy){case"email_link":return(0,v.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"email_code":return(0,v.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"phone_code":return(0,v.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"password":return(0,v.G)("signIn.alternativeMethods.blockButton__password");case"passkey":return(0,v.G)("signIn.alternativeMethods.blockButton__passkey");case"reset_password_email_code":case"reset_password_phone_code":return(0,v.G)("signIn.forgotPasswordAlternativeMethods.blockButton__resetPassword");default:throw Error(`Invalid sign in strategy: "${e.strategy}"`)}}var eW=r(5653);function eV(e){let t=(0,A.f0)(),{setActive:r,__internal_navigateWithError:n}=(0,s.ho)(),i=(0,q.p)(),{afterSignInUrl:a,navigateOnSetActive:o}=(0,d.r)(),{authenticateWithPasskey:c}=(0,x.n)();return(0,l.useEffect)(()=>()=>{eW.sv.abort()},[]),(0,l.useCallback)(async(...s)=>{try{let t=await c(...s);switch(t.status){case"complete":return r({session:t.createdSessionId,navigate:async({session:e})=>{await o({session:e,redirectUrl:a})}});case"needs_second_factor":return e();default:return console.error((0,z.s)(t.status,i))}}catch(r){let{flow:e}=s[0]||{};if((0,eg.Cm)(r)&&("passkey_operation_aborted"===r.code||"autofill"===e&&"passkey_retrieval_cancelled"===r.code))return;if((0,eg._d)(r))return n("..",r.errors[0]);(0,$.H4)(r,[],t.setError)}},[])}function eq(e){return!!e?.length&&e.filter(e=>"enterprise_sso"===e.strategy&&"enterpriseConnectionId"in e&&"enterpriseConnectionName"in e).length>1}var eH=r(1652);let ej=e=>{let t=(0,x.n)(),r=(0,A.f0)(),{navigate:n}=(0,U.r)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:l}=(0,s.ho)(),c=(0,q.p)(),u=(0,s.ho)(),h=e.factor.channel,p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared;return(0,o.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,o,s)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await o(),e.status){case"complete":return l({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,z.s)(e.status,c))}}).catch(e=>(0,eg._d)(e)?u.__internal_navigateWithError("..",e.errors[0]):s(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor({...e.factor,channel:h}).then(()=>e.onFactorPrepare()).catch(e=>(0,$.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,alternativeMethodsLabel:(0,v.G)("footerActionLink__alternativePhoneCodeProvider"),onShowAlternativeMethodsClicked:()=>{r.setError(void 0),e.onChangePhoneCodeChannel({...e.factor,channel:void 0})},showAlternativeMethods:!0,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eJ=e=>(0,o.Y)(p.n.Part,{part:"phoneCode",children:(0,o.Y)(ej,{...e,cardTitle:(0,v.G)("signIn.alternativePhoneCodeProvider.title",{provider:(0,eH.y)(e.factor.channel)?.name||""}),cardSubtitle:(0,v.G)("signIn.alternativePhoneCodeProvider.subtitle"),inputLabel:(0,v.G)("signIn.alternativePhoneCodeProvider.formTitle"),resendButton:(0,v.G)("signIn.alternativePhoneCodeProvider.resendButton")})}),eX=e=>{let t=(0,x.n)(),r=(0,A.f0)(),{navigate:n}=(0,U.r)(),{afterSignInUrl:i,navigateOnSetActive:a}=(0,d.r)(),{setActive:c}=(0,s.ho)(),u=(0,q.p)(),h=(0,s.ho)(),p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared,g=(0,l.useMemo)(()=>{let t=e.factor,r=t.strategy;return"emailAddressId"in t&&(r+=`_${t.emailAddressId}`),"phoneNumberId"in t&&(r+=`_${t.phoneNumberId}`),"channel"in t&&t.channel&&(r+=`_${t.channel}`),{name:"signIn.prepareFirstFactor",factorKey:r}},[e.factor.strategy,"emailAddressId"in e.factor?e.factor.emailAddressId:void 0,"phoneNumberId"in e.factor?e.factor.phoneNumberId:void 0,"channel"in e.factor?e.factor.channel:void 0]);return(0,f.s)(p?void 0:()=>t?.prepareFirstFactor(e.factor),g,{staleTime:100,onSuccess:()=>e.onFactorPrepare(),onError:e=>(0,$.H4)(e,[],r.setError)}),(0,o.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,o,s)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await o(),e.status){case"complete":return c({session:e.createdSessionId,navigate:async({session:e})=>{await a({session:e,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,z.s)(e.status,u))}}).catch(e=>(0,eg._d)(e)?h.__internal_navigateWithError("..",e.errors[0]):s(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor(e.factor).then(()=>e.onFactorPrepare()).catch(e=>(0,$.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eQ=e=>(0,o.Y)(p.n.Part,{part:"emailCode",children:(0,o.Y)(eX,{...e,cardTitle:(0,v.G)("signIn.emailCode.title"),cardSubtitle:(0,v.G)("signIn.emailCode.subtitle"),inputLabel:(0,v.G)("signIn.emailCode.formTitle"),resendButton:(0,v.G)("signIn.emailCode.resendButton")})}),e0=e=>{let{t}=(0,W._)(),r=(0,A.f0)(),n=(0,x.n)(),i=(0,d.r)(),{signInUrl:a}=i,{navigate:c}=(0,U.r)(),{afterSignInUrl:u}=(0,d.r)(),{setActive:h}=(0,s.ho)(),{startEmailLinkFlow:f,cancelEmailLinkFlow:g}=(0,ek.u)(n),[m,I]=l.useState(!1),_=(0,s.ho)();l.useEffect(()=>{w()},[]);let w=()=>{f({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,eY.lA)({ctx:i,baseUrl:a,intent:"sign-in"})}).then(e=>S(e)).catch(e=>{if((0,eg._d)(e))return _.__internal_navigateWithError("..",e.errors[0]);(0,$.H4)(e,[],r.setError)})},S=async e=>{let n=e.firstFactorVerification;"expired"===n.status?r.setError(t((0,v.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?I(!0):await b(e)},b=async e=>"complete"===e.status?h({session:e.createdSessionId,redirectUrl:u}):"needs_second_factor"===e.status?c("../factor-two"):void 0;return m?(0,o.Y)(eb.$,{title:(0,v.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,v.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,o.Y)(p.n.Part,{part:"emailLink",children:(0,o.Y)(ev._,{cardTitle:(0,v.G)("signIn.emailLink.title"),cardSubtitle:(0,v.G)("signIn.emailLink.subtitle"),formTitle:(0,v.G)("signIn.emailLink.formTitle"),formSubtitle:(0,v.G)("signIn.emailLink.formSubtitle"),resendButton:(0,v.G)("signIn.emailLink.resendButton"),onResendCodeClicked:()=>{g(),w()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})};var e1=r(7420);let e6=(0,A.dm)((n=(a=()=>{let e=(0,d.r)(),{displayConfig:t}=(0,K.O)(),r=(0,s.ho)().client.signIn;if(!eq(r.supportedFirstFactors))return null;let n=r.supportedFirstFactors.map(e=>({id:e.enterpriseConnectionId,name:e.enterpriseConnectionName}));return(0,o.Y)(p.n.Part,{part:"enterpriseConnections",children:(0,o.Y)(e1.l,{title:(0,v.G)("signIn.enterpriseConnections.title"),subtitle:(0,v.G)("signIn.enterpriseConnections.subtitle"),onClick:n=>{let i=(0,eY.uP)(e,t.signInUrl),a=e.afterSignInUrl||"/";return r.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:i,redirectUrlComplete:a,oidcPrompt:e.oidcPrompt,continueSignIn:!0,enterpriseConnectionId:n})},enterpriseConnections:n})})}).displayName||a.name||"Component",a.displayName=n,(i=e=>{let t=(0,x.n)(),r=(0,d.r)();return(0,S.RE)(a,()=>!eq(t.supportedFirstFactors),({clerk:e})=>r.signInUrl||e.buildSignInUrl(),"There are no enterprise connections available to sign-in. Clerk is redirecting to the `signInUrl` instead.")(e)}).displayName=`withEnterpriseConnectionsGuard(${n})`,i)),e4=e=>(0,o.Y)(p.n.Part,{part:"resetPassword",children:(0,o.Y)(eX,{...e,showAlternativeMethods:!1,cardTitle:(0,v.G)("signIn.forgotPassword.title"),inputLabel:(0,v.G)("signIn.forgotPassword.formTitle"),resendButton:(0,v.G)("signIn.forgotPassword.resendButton")})});var e2=r(196);let e5=e=>{let{onShowAlternativeMethodsClick:t}=e,r=(0,A.f0)(),n=(0,x.n)(),{navigate:i}=(0,U.r)(),[a,s]=l.useState(!1),c=l.useCallback(()=>s(e=>!e),[s]),d=eV(()=>i("../factor-two"));return a?(0,o.Y)(eh.n,{onBackLinkClick:c}):(0,o.Y)(p.n.Part,{part:"password",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(b.In,{elementDescriptor:Y.$z.passkeyIcon,icon:eR.A,sx:e=>({color:e.colors.$neutralAlpha500,marginInline:"auto",paddingBottom:e.sizes.$1,width:e.sizes.$12,height:e.sizes.$12})}),(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.passkey.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.passkey.subtitle")}),(0,o.Y)(e2.$,{identifier:n.identifier,avatarUrl:n.userData.imageUrl,onClick:()=>i("../")})]}),(0,o.Y)(C.Z.Alert,{children:r.error}),(0,o.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:4,children:[(0,o.Y)(O.l.Root,{onSubmit:e=>(e.preventDefault(),d()),gap:8,children:(0,o.Y)(O.l.SubmitButton,{hasArrow:!0})}),(0,o.Y)(C.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)(t?"footerActionLink__useAnotherMethod":"signIn.alternativeMethods.actionLink"),onClick:t||c})})]})]}),(0,o.Y)(C.Z.Footer,{})]})})},e9=e=>{let{onShowAlternativeMethodsClick:t,onPasswordError:r}=e,n=l.useRef(null),i=(0,A.f0)(),{setActive:a}=(0,s.ho)(),c=(0,x.n)(),{afterSignInUrl:u,navigateOnSetActive:h}=(0,d.r)(),f=(0,q.p)(),g=(e=>{let{onForgotPasswordMethodClick:t,onShowAlternativeMethodsClick:r}=e,n=eN(),i=(0,Z.tJ)("password","",{type:"password",label:(0,v.G)("formFieldLabel__password"),placeholder:(0,v.G)("formFieldInputPlaceholder__password")});return{...i,props:{...i.props,actionLabel:n||r?(0,v.G)("formFieldAction__forgotPassword"):"",onActionClicked:t||r||(()=>null)}}})(e),{navigate:m}=(0,U.r)(),[I,_]=l.useState(!1),w=l.useCallback(()=>_(e=>!e),[_]),S=(0,s.ho)();return I?(0,o.Y)(eh.n,{onBackLinkClick:w}):(0,o.Y)(p.n.Part,{part:"password",children:(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.password.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.password.subtitle")}),(0,o.Y)(e2.$,{identifier:c.identifier,avatarUrl:c.userData.imageUrl,onClick:()=>{m("../")}})]}),(0,o.Y)(C.Z.Alert,{children:i.error}),(0,o.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:4,children:[(0,o.FD)(O.l.Root,{onSubmit:e=>{e.preventDefault(),c.attemptFirstFactor({strategy:"password",password:g.value}).then(e=>{switch(e.status){case"complete":return a({session:e.createdSessionId,navigate:({session:e})=>h({session:e,redirectUrl:u})});case"needs_second_factor":return m("../factor-two");case"needs_client_trust":return m("../client-trust");default:return console.error((0,z.s)(e.status,f))}}).catch(e=>{if((0,eg._d)(e))return S.__internal_navigateWithError("..",e.errors[0]);if(r){if((0,eg.Au)(e)){i.setError({...e.errors[0],code:"form_password_pwned__sign_in"}),r("pwned");return}if((0,eg.qY)(e)){i.setError({...e.errors[0],code:"form_password_compromised__sign_in"}),r("compromised");return}}(0,$.H4)(e,[g],i.setError),setTimeout(()=>n.current?.focus(),0)})},gap:8,children:[(0,o.Y)("input",{readOnly:!0,id:"identifier-field",name:"identifier",value:c.identifier||"",style:{display:"none"}}),(0,o.Y)(O.l.ControlRow,{elementId:g.id,children:(0,o.Y)(O.l.PasswordInput,{...g.props,ref:n,autoFocus:!0})}),(0,o.Y)(O.l.SubmitButton,{hasArrow:!0})]}),(0,o.Y)(C.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)(t?"signIn.password.actionLink":"signIn.alternativeMethods.actionLink"),onClick:t||w})})]})]}),(0,o.Y)(C.Z.Footer,{})]})})},e8=e=>(0,o.Y)(p.n.Part,{part:"phoneCode",children:(0,o.Y)(eX,{...e,cardTitle:(0,v.G)("signIn.phoneCode.title"),cardSubtitle:(0,v.G)("signIn.phoneCode.subtitle"),inputLabel:(0,v.G)("signIn.phoneCode.formTitle"),resendButton:(0,v.G)("signIn.phoneCode.resendButton")})}),e3=e=>{if(!e)return"";let t=e.strategy;return"emailAddressId"in e&&(t+=e.emailAddressId),"phoneNumberId"in e&&(t+=e.phoneNumberId),"channel"in e&&(t+=e.channel),t},e7=(0,S.RL)((0,S.SY)((0,A.dm)(function(){let{__internal_setActiveInProgress:e}=(0,s.ho)(),t=(0,x.n)(),{preferredSignInStrategy:r}=(0,K.O)().displayConfig,n=t.supportedFirstFactors,i=(0,U.r)(),a=(0,A.f0)(),{supportedFirstFactors:c,firstFactorVerification:d}=(0,x.n)(),u=l.useRef(""),[{currentFactor:h},p]=l.useState(()=>{let e=(0,eI.xf)(n,t.identifier,r);return e?.strategy==="phone_code"&&d.channel&&"sms"!==d.channel&&(e.channel=d.channel),{currentFactor:e,prevCurrentFactor:void 0}}),{hasAnyStrategy:f}=(0,eP.y)({filterOutFactor:h,supportedFirstFactors:c}),[g,m]=l.useState(()=>!h||!(0,eI.Cm)(h)),I=eN(),[_,w]=l.useState(!1),[S,b]=l.useState(null);if(l.useEffect(()=>{e||("needs_identifier"===t.status||null===t.status)&&i.navigate("../")},[e]),!h)return t.status?(0,o.Y)(eU.J,{cardTitle:(0,v.G)("signIn.noAvailableMethods.title"),cardSubtitle:(0,v.G)("signIn.noAvailableMethods.subtitle"),message:(0,v.G)("signIn.noAvailableMethods.message")}):(0,o.Y)(el.B,{});let Y=f?()=>m(e=>!e):void 0,k=()=>w(e=>!e),C=()=>{u.current=e3(h)},F=e=>{p(t=>({currentFactor:e,prevCurrentFactor:t.currentFactor}))};if(eq(t.supportedFirstFactors))return(0,o.Y)(e6,{});if(g||_){let e=(0,eI.Cm)(h),t=g?Y:k;return(0,o.Y)(eZ,{mode:_?"pwned"===S?"pwned":"compromised"===S?"passwordCompromised":"forgot":"default",onBackLinkClick:e?()=>{a.setError(void 0),b(null),t?.()}:void 0,onFactorSelected:e=>{F(e),t?.()},currentFactor:h})}if(!h)return(0,o.Y)(el.B,{});switch(h?.strategy){case"passkey":return(0,o.Y)(e5,{onFactorPrepare:C,onShowAlternativeMethodsClick:Y});case"password":return(0,o.Y)(e9,{onForgotPasswordMethodClick:I?k:Y,onShowAlternativeMethodsClick:Y,onPasswordError:e=>{b(e),k()}});case"email_code":return(0,o.Y)(eQ,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"phone_code":if(h.channel&&"sms"!==h.channel)return(0,o.Y)(eJ,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onChangePhoneCodeChannel:F});return(0,o.Y)(e8,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"email_link":return(0,o.Y)(e0,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"reset_password_phone_code":return(0,o.Y)(e4,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),k()},cardSubtitle:(0,v.G)("signIn.forgotPassword.subtitle_phone")});case"reset_password_email_code":return(0,o.Y)(e4,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),k()},cardSubtitle:(0,v.G)("signIn.forgotPassword.subtitle_email")});default:return(0,o.Y)(el.B,{})}}))),te=e=>{let{onShowAlternativeMethodsClicked:t}=e,r=(0,x.n)(),{afterSignInUrl:n,navigateOnSetActive:i}=(0,d.r)(),{setActive:a}=(0,s.ho)(),{navigate:l}=(0,U.r)(),c=(0,q.p)(),u=(0,A.f0)(),h=(0,Z.tJ)("code","",{type:"text",label:(0,v.G)("formFieldLabel__backupCode"),isRequired:!0}),p=(0,s.ho)(),f=e=>(0,eI.Kw)(e.firstFactorVerification?.strategy)&&e.firstFactorVerification?.status==="verified";return(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.backupCodeMfa.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:f(r)?(0,v.G)("signIn.forgotPassword.subtitle"):(0,v.G)("signIn.backupCodeMfa.subtitle")})]}),(0,o.Y)(C.Z.Alert,{children:u.error}),(0,o.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:(0,o.FD)(O.l.Root,{onSubmit:e=>(e.preventDefault(),r.attemptSecondFactor({strategy:"backup_code",code:h.value}).then(e=>{if("complete"!==e.status)return console.error((0,z.s)(e.status,c));if(f(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),l(`../reset-password-success?${t.toString()}`)}return a({session:e.createdSessionId,navigate:async({session:e})=>{await i({session:e,redirectUrl:n})}})}).catch(e=>{if((0,eg._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,$.H4)(e,[h],u.setError)})),children:[(0,o.Y)(O.l.ControlRow,{elementId:h.id,children:(0,o.Y)(O.l.PlainInput,{...h.props,autoFocus:!0,onActionClicked:t})}),(0,o.FD)(b.fv,{gap:3,children:[(0,o.Y)(O.l.SubmitButton,{hasArrow:!0}),(0,o.Y)(C.Z.Action,{elementId:"alternativeMethods",children:t&&(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})]})})]}),(0,o.Y)(C.Z.Footer,{})]})},tt=e=>(0,o.Y)(p.n.Part,{part:"totp2Fa",children:(0,o.Y)(ew,{...e,cardTitle:(0,v.G)("signIn.totpMfa.title"),cardSubtitle:(0,v.G)("signIn.totpMfa.subtitle"),inputLabel:(0,v.G)("signIn.totpMfa.formTitle")})}),tr=(0,S.RL)((0,S.SY)((0,A.dm)(function(){let e=(0,x.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:a,toggleAllStrategies:s}=(0,eF.j)(e.supportedSecondFactors);if(!t)return(0,o.Y)(el.B,{});if(a)return(0,o.Y)(ep,{onBackLinkClick:s,onFactorSelected:i});switch(t?.strategy){case"phone_code":return(0,o.Y)(eA,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"totp":return(0,o.Y)(tt,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"backup_code":return(0,o.Y)(te,{onShowAlternativeMethodsClicked:s});case"email_code":return(0,o.Y)(eS,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});case"email_link":return(0,o.Y)(eC,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:s});default:return(0,o.Y)(el.B,{})}})));var tn=r(6126);let ti=(0,S.RL)((0,S.SY)(tn.F));var ta=r(4670),to=r(2620),ts=r(6760),tl=r(958),tc=r(1959),td=r(6142),tu=r(4901),th=r(2229),tp=r(2216);let tf=e=>{let{handleSubmit:t,phoneNumberFormState:r,onUseAnotherMethod:n,phoneCodeProvider:i}=e,{providerToDisplayData:a,strategyToDisplayData:s}=(0,tp.k)(),l=i.name,c=i.channel,d=(0,A.f0)();return(0,o.Y)(C.Z.Root,{children:(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,showDivider:!0,children:[(0,o.Y)(b.fv,{center:!0,children:(0,o.Y)(b._V,{src:a[c]?.iconUrl,alt:`${s[c].name} logo`,sx:e=>({width:e.sizes.$7,height:e.sizes.$7,maxWidth:"100%",marginBottom:e.sizes.$6})})}),(0,o.Y)(F.Y.Title,{localizationKey:(0,v.G)("signIn.start.alternativePhoneCodeProvider.title",{provider:l})}),(0,o.Y)(F.Y.Subtitle,{localizationKey:(0,v.G)("signIn.start.alternativePhoneCodeProvider.subtitle",{provider:l})})]}),(0,o.Y)(C.Z.Alert,{children:d.error}),(0,o.Y)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:6,children:(0,o.FD)(O.l.Root,{onSubmit:t,gap:8,children:[(0,o.Y)(b.fv,{gap:6,children:(0,o.Y)(O.l.ControlRow,{elementId:"phoneNumber",children:(0,o.Y)(O.l.PhoneInput,{...r.props,label:(0,v.G)("signIn.start.alternativePhoneCodeProvider.label",{provider:l}),isRequired:!0,isOptional:!1,actionLabel:void 0,onActionClicked:void 0})})}),(0,o.FD)(b.fv,{center:!0,children:[(0,o.Y)(td.j,{}),(0,o.Y)(b.fv,{gap:6,sx:{width:"100%"},children:(0,o.Y)(O.l.SubmitButton,{hasArrow:!0,localizationKey:(0,v.G)("formButtonPrimary")})})]}),(0,o.Y)(b.fv,{center:!0,children:(0,o.Y)(b.$n,{variant:"link",colorScheme:"neutral",onClick:n,localizationKey:(0,v.G)("signIn.start.alternativePhoneCodeProvider.actionLink")})})]})})]})})},tg=e=>!!e.supportedFirstFactors?.length&&e.supportedFirstFactors.every(e=>"enterprise_sso"===e.strategy),tm=({field:e})=>{let[t,r]=(0,l.useState)(!1),n=(0,l.useRef)(null),i=!!(t||e?.value);return((0,l.useLayoutEffect)(()=>{let e=setInterval(()=>{if(n?.current){let t="onAutoFillStart"===window.getComputedStyle(n.current,":autofill").animationName||!!n.current?.matches("*:-webkit-autofill");t&&(r(t),clearInterval(e))}},500);return()=>{clearInterval(e)}},[]),(0,l.useEffect)(()=>{e?.value&&""!==e.value&&r(!1)},[e?.value]),e)?(0,o.Y)(O.l.ControlRow,{elementId:e.id,sx:i?void 0:{position:"absolute",opacity:0,height:0,pointerEvents:"none",marginTop:"-1rem"},children:(0,o.Y)(O.l.PasswordInput,{...e.props,ref:n,tabIndex:i?void 0:-1})}):null},tI=(0,S.RL)((0,S.SY)((0,A.dm)(function(){let e=(0,A.f0)(),t=(0,s.ho)(),n=(0,tu.m)(),{displayConfig:i,userSettings:a,authConfig:c}=(0,K.O)(),u=(0,x.n)(),{navigate:h}=(0,U.r)(),f=(0,d.r)(),{afterSignInUrl:g,signUpUrl:m,waitlistUrl:I,isCombinedFlow:_,navigateOnSetActive:w}=f,S=(0,q.p)(),k=(0,th.F)(),y=(0,l.useMemo)(()=>(0,tc.E9)(a.enabledFirstFactorIdentifiers),[a.enabledFirstFactorIdentifiers]),P=a.alternativePhoneCodeChannels,{isWebAuthnAutofillSupported:E}=(()=>{let[e,t]=(0,l.useState)(!1),{navigate:r}=(0,U.r)(),n=eV(()=>r("factor-two")),{userSettings:i}=(0,K.O)(),{passkeySettings:a,attributes:o}=i;return(0,l.useEffect)(()=>{async function e(){let e=await (0,to.nn)();t(e),e&&await n({flow:"autofill"})}a.allow_autofill&&o.passkey?.enabled&&e()},[]),{isWebAuthnAutofillSupported:e}})(),D=eV(()=>h("factor-two")),L=(0,to.Bz)(),M=!!f.initialValues?.phoneNumber&&!(f.initialValues.emailAddress||f.initialValues.username)&&y.includes("phone_number"),[T,G]=(0,l.useState)(M?"phone_number":y[0]||""),[R,B]=(0,l.useState)(!1),N=(0,ta.n)("__clerk_ticket")||"",W=(0,ta.n)("__clerk_status")||"",V=a.enabledFirstFactorIdentifiers,H=a.web3FirstFactors,j=a.authenticatableSocialStrategies,J=a.instanceIsPasswordBased,{currentIdentifier:X,nextIdentifier:Q}=(0,tc.ZN)(y,T),ee=(0,Z.tJ)("password","",{type:"password",label:(0,v.G)("formFieldLabel__password"),placeholder:(0,v.G)("formFieldInputPlaceholder__password")}),[et,er]=(0,l.useState)(null),en=a.alternativePhoneCodeChannels.length>0,ei=f.initialValues||{},ea=(0,l.useMemo)(()=>({email_address:ei.emailAddress,email_address_username:ei.emailAddress||ei.username,username:ei.username,phone_number:ei.phoneNumber}),[f.initialValues]),eo=!!j.length||!!H.length||!!P.length,[es,ec]=(0,l.useState)(!(0,tl.X)()&&!eo),ed=(0,Z.tJ)("identifier",ea[T]||"",{...X,isRequired:!0,transformer:e=>e.trim()}),eu=(0,Z.tJ)("identifier",ea.phone_number||"",{...X,isRequired:!0}),eh="phone_number"===T?eu:ed;(0,l.useLayoutEffect)(()=>{if(eh.value.startsWith("+")&&y.includes("phone_number")&&"phone_number"!==T&&!R){var e;e=eh.value,ed.setValue(ea[T]||""),eu.setValue(e),G("phone_number"),ec(!0),B(!0)}},[eh.value,y]),(0,l.useEffect)(()=>{if(N){if("sign_up"===W){let e=new URLSearchParams;N&&e.set("__clerk_ticket",N),h(_?"create":m,{searchParams:e});return}n.setLoading(),e.setLoading(),u.create({strategy:"ticket",ticket:N}).then(e=>{switch(e.status){case"needs_first_factor":if(!tg(e)||eq(e.supportedFirstFactors))return h("factor-one");return ef();case"needs_second_factor":return h("factor-two");case"needs_client_trust":return h("client-trust");case"complete":return(0,ta.r)("__clerk_ticket"),t.setActive({session:e.createdSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});default:return void console.error((0,z.s)(e.status,S))}}).catch(e=>eg(e)).finally(()=>{tg(u)||(n.setIdle(),e.setIdle())})}},[]),(0,l.useEffect)(()=>{!async function(){let t=u?.firstFactorVerification?.error;if(t){switch(t.code){case eB.c.NOT_ALLOWED_TO_SIGN_UP:case eB.c.OAUTH_ACCESS_DENIED:case eB.c.NOT_ALLOWED_ACCESS:case eB.c.SAML_USER_ATTRIBUTE_MISSING:case eB.c.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:case eB.c.USER_LOCKED:case eB.c.EXTERNAL_ACCOUNT_NOT_FOUND:case eB.c.SIGN_UP_MODE_RESTRICTED:case eB.c.SIGN_UP_MODE_RESTRICTED_WAITLIST:case eB.c.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:case eB.c.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eB.c.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:case eB.c.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eB.c.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:case eB.c.CAPTCHA_INVALID:case eB.c.FRAUD_DEVICE_BLOCKED:case eB.c.FRAUD_ACTION_BLOCKED:case eB.c.SIGNUP_RATE_LIMIT_EXCEEDED:case eB.c.USER_BANNED:e.setError(t);break;default:e.setError("Unable to complete action at this time. If the problem persists please contact support.")}await u.create({})}}()},[]);let ep=async(...e)=>{let r=et?.channel||(0,eI.oj)(e,c.preferredChannels,"identifier");if(r){let t=()=>{};e.push({id:"strategy",value:"phone_code",clearFeedback:t,setValue:t,onChange:t,setError:t}),e.push({id:"channel",value:r,clearFeedback:t,setValue:t,onChange:t,setError:t})}try{var n;let r,i,o=await (i=u.create(((!(r=(n=e).some(e=>"password"===e.name&&!!e.value))||a.enterpriseSSO.enabled)&&(n=n.filter(e=>"password"!==e.name)),{...(0,Z.mK)(n),...r&&!a.enterpriseSSO.enabled&&{strategy:"password"}})),i.then(t=>{if(!a.enterpriseSSO.enabled)return t;let r=e.find(e=>"password"===e.name)?.value;return!r||t.supportedFirstFactors?.some(e=>"enterprise_sso"===e.strategy)?t:t.attemptFirstFactor({strategy:"password",password:r})}));switch(o.status){case"needs_identifier":o.supportedFirstFactors?.some(e=>"enterprise_sso"===e.strategy)&&await ef();break;case"needs_first_factor":if(!tg(o)||eq(o.supportedFirstFactors))return h("factor-one");return ef();case"needs_second_factor":return h("factor-two");case"needs_client_trust":return h("client-trust");case"complete":return t.setActive({session:o.createdSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});default:return void console.error((0,z.s)(o.status,S))}}catch(e){return eg(e)}},ef=async()=>{let e=(0,eY.uP)(f,i.signInUrl),t=f.afterSignInUrl||"/";return u.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:e,redirectUrlComplete:t,oidcPrompt:f.oidcPrompt,continueSignIn:!0})},eg=async n=>{if(!n.errors)return;let o=n.errors.find(e=>e.code===eB.c.INVALID_STRATEGY_FOR_USER||e.code===eB.c.FORM_PASSWORD_INCORRECT||e.code===eB.c.FORM_PASSWORD_PWNED),s=n.errors.find(e=>e.code===eB.c.SESSION_EXISTS),l=n.errors.find(e=>"identifier_already_signed_in"===e.code),d=n.errors.find(e=>e.code===eB.c.INVITATION_ACCOUNT_NOT_EXISTS||e.code===eB.c.FORM_IDENTIFIER_NOT_FOUND);if(o)await ep(eh);else if(s)await t.setActive({session:t.client.lastActiveSessionId,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}});else if(l){let e=l.meta.sessionId;await t.setActive({session:e,navigate:async({session:e})=>{await w({session:e,redirectUrl:g})}})}else if(_&&d){let n=(0,eI.UY)(eh);if(a.signUp.mode===eB.f.WAITLIST)return h(t.buildWaitlistUrl("emailAddress"===n?{initialValues:{[n]:eh.value}}:{}));t.client.signUp[n]=eh.value;let o=(0,eY.uP)(f,i.signUpUrl),s=f.afterSignUpUrl||"/";return function({identifierAttribute:e,identifierValue:t,signUpMode:n,navigate:i,organizationTicket:a,afterSignUpUrl:o,clerk:s,handleError:l,redirectUrl:c,redirectUrlComplete:d,passwordEnabled:u,navigateOnSetActive:h,alternativePhoneCodeChannel:p}){var f,g;if(n===eB.f.WAITLIST)return i(s.buildWaitlistUrl("emailAddress"===e?{initialValues:{[e]:t}}:{}));s.client.signUp[e]=t;let m=new URLSearchParams;return(a&&m.set("__clerk_ticket",a),u||(f=s.client.signUp,g=e,f.optionalFields.filter(e=>!(e.startsWith("oauth_")||e.startsWith("web3_"))&&"enterprise_sso"!==e&&"password"!==e&&("phoneNumber"!==g||"phone_number"!==e)).length>0)||"emailAddress"!==e&&"phoneNumber"!==e)?i("create",{searchParams:m}):s.client.signUp.create({[e]:t,...p?{strategy:"phone_code",channel:p}:{}}).then(async e=>(await Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,8722)).then(e=>e.completeSignUpFlow))({signUp:e,verifyEmailPath:"create/verify-email-address",verifyPhonePath:"create/verify-phone-number",handleComplete:()=>s.setActive({session:e.createdSessionId,navigate:async({session:e})=>{await h({session:e,redirectUrl:o})}}),navigate:i,redirectUrl:c,redirectUrlComplete:d})).catch(e=>l(e))}({afterSignUpUrl:f.afterSignUpUrl||"/",clerk:t,handleError:t=>(0,$.H4)(t,[eh,ee],e.setError),identifierAttribute:n,identifierValue:eh.value,navigate:h,organizationTicket:N,signUpMode:a.signUp.mode,redirectUrl:o,redirectUrlComplete:s,navigateOnSetActive:w,passwordEnabled:a.attributes.password?.required??!1,alternativePhoneCodeChannel:et?.channel||(0,eI.iy)(c.preferredChannels,n,eh.value)})}else(0,$.H4)(n,[eh,ee],e.setError)},em=async e=>(e.preventDefault(),ep(eh,ee)),e_=(0,l.useMemo)(()=>({tel:O.l.PhoneInput,password:O.l.PasswordInput,text:O.l.PlainInput,email:O.l.PlainInput})[eh.type],[eh.type]);if(n.isLoading||"sign_up"===W)return(0,o.Y)(el.B,{});let{action:ew,validLastAuthenticationStrategies:eS,...ev}=eh.props,eb=t.client?.lastAuthenticationStrategy,ek=!!eb&&k>1&&eS?.has(eb);return(0,o.Y)(p.n.Part,{part:"start",children:et?(0,o.Y)(tf,{handleSubmit:em,phoneNumberFormState:eu,onUseAnotherMethod:()=>{er(null)},phoneCodeProvider:et}):(0,o.FD)(C.Z.Root,{children:[(0,o.FD)(C.Z.Content,{children:[(0,o.FD)(F.Y.Root,{showLogo:!0,children:[(0,o.Y)(F.Y.Title,{localizationKey:_?(0,v.G)("signIn.start.titleCombined"):(0,v.G)("signIn.start.title")}),(0,o.Y)(F.Y.Subtitle,{localizationKey:_?(0,v.G)("signIn.start.subtitleCombined"):(0,v.G)("signIn.start.subtitle"),sx:{"&:empty":{display:"none"}}})]}),(0,o.Y)(C.Z.Alert,{children:e.error}),(0,o.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:6,children:[(0,o.FD)(ts.U,{children:[eo&&(0,o.Y)(e$,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:en,onAlternativePhoneCodeProviderClick:e=>{er((0,eH.y)(e)||null)}}),V.length?(0,o.FD)(O.l.Root,{onSubmit:em,gap:8,children:[(0,o.FD)(b.fv,{gap:6,children:[(0,o.Y)(O.l.ControlRow,{elementId:eh.id,children:(0,o.Y)(e_,{actionLabel:Q?.action,onActionClicked:()=>{G(e=>y[(y.indexOf(e)+1)%y.length]),ec(!0),B(!1)},...ev,autoFocus:es,autoComplete:E?"webauthn":void 0,isLastAuthenticationStrategy:ek})}),(0,o.Y)(tm,{field:J?ee:void 0})]}),(0,o.FD)(b.fv,{center:!0,children:[(0,o.Y)(td.j,{}),(0,o.Y)(O.l.SubmitButton,{hasArrow:!0})]})]}):null]}),!V.length&&(0,o.Y)(td.j,{}),a.attributes.passkey?.enabled&&a.passkeySettings.show_sign_in_button&&L&&(0,o.Y)(C.Z.Action,{elementId:"usePasskey",children:(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.start.actionLink__use_passkey"),onClick:()=>D({flow:"discoverable"})})})]})]}),(0,o.FD)(C.Z.Footer,{children:[a.signUp.mode===eB.f.PUBLIC&&!_&&(0,o.FD)(C.Z.Action,{elementId:"signIn",children:[(0,o.Y)(C.Z.ActionText,{localizationKey:(0,v.G)("signIn.start.actionText")}),(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.start.actionLink"),to:t.buildUrlWithAuth(m)})]}),a.signUp.mode===eB.f.WAITLIST&&(0,o.FD)(C.Z.Action,{elementId:"signIn",children:[(0,o.Y)(C.Z.ActionText,{localizationKey:(0,v.G)("signIn.start.actionText__join_waitlist")}),(0,o.Y)(C.Z.ActionLink,{localizationKey:(0,v.G)("signIn.start.actionLink__join_waitlist"),to:t.buildUrlWithAuth(I)})]})]})]})})})));function t_(){let e=(0,s.ho)();return l.useEffect(()=>{e.redirectToSignIn()},[e]),null}function tw(){let e=(0,d.r)(),t=(0,u.X)();return(0,o.Y)(p.n.Root,{flow:"signIn",children:(0,o.FD)(I.d,{children:[(0,o.Y)(_.q,{path:"factor-one",children:(0,o.Y)(e7,{})}),(0,o.Y)(_.q,{path:"factor-two",children:(0,o.Y)(tr,{})}),(0,o.Y)(_.q,{path:"client-trust",children:(0,o.Y)(ey,{})}),(0,o.Y)(_.q,{path:"reset-password",children:(0,o.Y)(H,{})}),(0,o.Y)(_.q,{path:"reset-password-success",children:(0,o.Y)(X,{})}),(0,o.Y)(_.q,{path:"sso-callback",children:(0,o.Y)(ti,{signUpUrl:e.signUpUrl,signInUrl:e.signInUrl,signInForceRedirectUrl:e.afterSignInUrl,signUpForceRedirectUrl:e.afterSignUpUrl,continueSignUpUrl:e.signUpContinueUrl,transferable:e.transferable,firstFactorUrl:"../factor-one",secondFactorUrl:"../factor-two",resetPasswordUrl:"../reset-password"})}),(0,o.Y)(_.q,{path:"choose",children:(0,o.Y)(es,{})}),(0,o.Y)(_.q,{path:"choose-wallet",children:(0,o.Y)(E,{})}),(0,o.Y)(_.q,{path:"verify",children:(0,o.Y)(c.Y,{redirectUrlComplete:e.afterSignInUrl,redirectUrl:"../factor-two"})}),e.isCombinedFlow&&(0,o.FD)(_.q,{path:"create",children:[(0,o.Y)(_.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,o.Y)(T,{})}),(0,o.Y)(_.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,o.Y)(M,{})}),(0,o.Y)(_.q,{path:"sso-callback",children:(0,o.Y)(R,{signUpUrl:t.signUpUrl,signInUrl:t.signInUrl,signUpForceRedirectUrl:t.afterSignUpUrl,signInForceRedirectUrl:t.afterSignInUrl,secondFactorUrl:t.secondFactorUrl,continueSignUpUrl:"../continue",verifyEmailAddressUrl:"../verify-email-address",verifyPhoneNumberUrl:"../verify-phone-number"})}),(0,o.Y)(_.q,{path:"verify",children:(0,o.Y)(c.M,{redirectUrlComplete:t.afterSignUpUrl,verifyEmailPath:"../verify-email-address",verifyPhonePath:"../verify-phone-number",continuePath:"../continue"})}),(0,o.FD)(_.q,{path:"continue",children:[(0,o.Y)(_.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,o.Y)(T,{})}),(0,o.Y)(_.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,o.Y)(M,{})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(B,{})})]}),(0,o.Y)(_.q,{path:"tasks",children:(0,o.Y)(m.JJ,{redirectUrlComplete:e.afterSignUpUrl})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(G,{})})]}),(0,o.Y)(_.q,{path:"tasks",children:(0,o.Y)(m.JJ,{redirectUrlComplete:e.afterSignInUrl})}),(0,o.Y)(_.q,{index:!0,children:(0,o.Y)(tI,{})}),(0,o.Y)(_.q,{children:(0,o.Y)(t_,{})})]})})}function tS(){let e=(0,d.r)(),t={componentName:"SignUp",emailLinkRedirectUrl:e.emailLinkRedirectUrl,ssoCallbackUrl:e.ssoCallbackUrl,forceRedirectUrl:e.signUpForceRedirectUrl,fallbackRedirectUrl:e.signUpFallbackRedirectUrl,signInUrl:e.signInUrl,unsafeMetadata:e.unsafeMetadata,...(0,D.C)({routing:e?.routing,path:e?.path})};return((e=!1)=>(0,f.s)(e?L:void 0,"preloadComponent",{staleTime:1/0}))(e.isCombinedFlow),(0,g.Z)(),(0,o.Y)(u.g.Provider,{value:t,children:(0,o.Y)(tw,{})})}tw.displayName="SignIn";let tv=(0,h.Z)(tS),tb=(0,h.Z)(tS),tY=e=>{let t={signUpUrl:`/${w.I}/sign-up`,waitlistUrl:`/${w.I}/waitlist`,...e};return(0,o.Y)(_.q,{path:"sign-in",children:(0,o.Y)(d.Q.Provider,{value:{componentName:"SignIn",...t,routing:"virtual",mode:"modal"},children:(0,o.Y)("div",{children:(0,o.Y)(tb,{...t,routing:"virtual"})})})})}},2690:function(e,t,r){r.d(t,{j:()=>o});var n=r(5074),i=r(5763);let a=e=>{if(!e)return"";let t=e.strategy;return"phoneNumberId"in e&&(t+=e.phoneNumberId),t};function o(e){let t=n.useRef(""),[r,o]=n.useState(()=>(0,i.R5)(e)),[s,l]=n.useState(!r),c=t.current===a(r);return{currentFactor:r,factorAlreadyPrepared:c,handleFactorPrepare:()=>{t.current=a(r)},selectFactor:e=>{o(e),l(!1)},showAllStrategies:s,toggleAllStrategies:()=>l(e=>!e)}}},5763:function(e,t,r){r.d(t,{Cm:()=>u,Kw:()=>f,R5:()=>h,UY:()=>g,iy:()=>I,oj:()=>m,xf:()=>c}),r(1044);var n=r(2620),i=r(7651),a=r(1959),o=r(8289);let s=e=>t=>"safeIdentifier"in t&&t.safeIdentifier===e;function l(e){if((0,n.Bz)()){let t=e.find(({strategy:e})=>"passkey"===e);if(t)return t}return null}function c(e,t,r){return e&&0!==e.length?r===a._o.Password?function(e,t){let r=l(e);if(r)return r;let n=e.sort(o.Kn)[0];return"password"===n.strategy?n:e.find(s(t))||n||null}(e,t):function(e,t){let r=l(e);if(r)return r;let n=e.sort(o.Ih),i=n.find(s(t));if(i)return i;let a=n[0];return"email_link"===a.strategy?a:e.find(s(t))||a||null}(e,t):null}let d=["passkey","email_code","password","phone_code","email_link"];function u(e){return!!e&&d.includes(e.strategy)}function h(e){if(!e||0===e.length)return null;let t=e.find(e=>"totp"===e.strategy);if(t)return t;let r=e.find(e=>"phone_code"===e.strategy);return r||e[0]}let p=["reset_password_phone_code","reset_password_email_code"],f=e=>!!e&&p.includes(e);function g(e){let t;return"tel"===e.type?"phoneNumber":(t=e.value,/^\S+@\S+\.\S+$/.test(t))?"emailAddress":"username"}let m=(e,t,r)=>{if(!t)return null;let n=e.find(e=>"strategy"===e.id)?.value;if(n&&"phone_code"!==n)return null;let a=e.find(e=>e.id===r)?.value;if(!a||!a?.startsWith("+"))return null;let o=(0,i.TV)(a,t);return"sms"===o?null:o},I=(e,t,r)=>{if(!e||!t||"phoneNumber"!==t||!r||!r?.startsWith("+"))return null;let n=(0,i.TV)(r,e);return"sms"===n?null:n}},4:function(e,t,r){r.d(t,{Q:()=>g,r:()=>m});var n=r(2166),i=r(8380),a=r(5580),o=r(4173),s=r(1210),l=r(5993),c=r(5074),d=r(8051),u=r(7697),h=r(2366),p=r(4964),f=r(2117);let g=(0,c.createContext)(null),m=()=>{let e=(0,c.useContext)(g),{navigate:t,basePath:r,startPath:m}=(0,p.r)(),{displayConfig:I,userSettings:_}=(0,u.O)(),{queryParams:w,queryString:S}=(0,p.r)(),v=_.signUp.mode,b=(0,h.II)(),Y=(0,s.ho)();if(null===e||"SignIn"!==e.componentName)throw Error("Clerk: useSignInContext called outside of the mounted SignIn component.");let k="restricted"!==v&&!!(!b.signUpUrl&&b.signInUrl&&!(0,l.s)(b.signInUrl))&&!1!==e.withSignUp||e.withSignUp||!1,{componentName:C,mode:A,...F}=e,y=(0,c.useMemo)(()=>(0,f.tf)(S,n.u),[]),U=new i.n(b,{...F,signInFallbackRedirectUrl:F.signInFallbackRedirectUrl||F.fallbackRedirectUrl,signInForceRedirectUrl:F.signInForceRedirectUrl||F.forceRedirectUrl},w,A);delete F.fallbackRedirectUrl,delete F.forceRedirectUrl;let P=Y.buildUrlWithAuth(U.getAfterSignInUrl()),E=Y.buildUrlWithAuth(U.getAfterSignUpUrl()),D="path"===F.routing&&F.path||b.signInUrl||I.signInUrl,L=k?"path"===F.routing&&F.path||b.signUpUrl||I.signUpUrl:F.signUpUrl||b.signUpUrl||I.signUpUrl,M=F.waitlistUrl||b.waitlistUrl||I.waitlistUrl,T=U.getPreservedSearchParams();D=(0,o.kZ)({base:D,hashSearchParams:[w,T]},{stringify:!0}),L=(0,o.kZ)({base:L,hashSearchParams:[w,T]},{stringify:!0}),M=(0,o.kZ)({base:M,hashSearchParams:[w,T]},{stringify:!0});let G=U.toSearchParams().toString(),R=(0,d.aQ)({routing:F.routing,baseUrl:L,authQueryString:G,path:F.path,endpoint:k?"/create"+d.Vu:d.Vu}),B=(0,d.aQ)({routing:F.routing,baseUrl:L,authQueryString:G,path:F.path,endpoint:k?"/create"+d.aB:d.aB});k&&(L=(0,o.kZ)({base:D,hashPath:"/create",hashSearchParams:[w,T]},{stringify:!0}));let z=(0,o.kZ)({base:L,hashPath:"/continue"},{stringify:!0}),O=async({session:e,redirectUrl:n})=>{let i=e.currentTask;if(!i)return t(n);let o=(0,a.ru)(i);return t(`/${r+m+(k?"/create"+o:o)}`)},$=Y.session?.currentTask?Y.__internal_getOption("taskUrls")?.[Y.session?.currentTask.key]??(0,d.aQ)({routing:F.routing,baseUrl:D,authQueryString:G,path:F.path,endpoint:k?"/create"+(0,a.ru)(Y.session?.currentTask):(0,a.ru)(Y.session?.currentTask)}):null;return{...F,transferable:F.transferable??!0,oauthFlow:F.oauthFlow||"auto",componentName:C,signUpUrl:L,signInUrl:D,waitlistUrl:M,afterSignInUrl:P,afterSignUpUrl:E,emailLinkRedirectUrl:R,ssoCallbackUrl:B,navigateAfterSignIn:()=>t(P),signUpContinueUrl:z,queryParams:w,initialValues:{...F.initialValues,...y},authQueryString:G,isCombinedFlow:k,navigateOnSetActive:O,taskUrl:$}}},9599:function(e,t,r){r.d(t,{g:()=>a});var n=r(1210),i=r(4964);let a=()=>{let{navigate:e}=(0,i.r)(),t=(0,n.ho)();return{navigateAfterSignOut:()=>e(t.buildAfterSignOutUrl()),navigateAfterMultiSessionSingleSignOutUrl:()=>e(t.buildAfterMultiSessionSingleSignOutUrl()),afterSignOutUrl:t.buildAfterSignOutUrl(),afterMultiSessionSingleSignOutUrl:t.buildAfterMultiSessionSingleSignOutUrl()}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["10"],{19090:function(e,t,r){r.d(t,{n:()=>a});var n=r(14518),i=r(45170),o=r(22861);let a=e=>{let{onBackLinkClick:t}=e;return(0,n.Y)(i.J,{cardTitle:(0,o.G)("signIn.alternativeMethods.getHelp.title"),cardSubtitle:(0,o.G)("signIn.alternativeMethods.getHelp.content"),onBackLinkClick:t})}},35717:function(e,t,r){let n,i;r.r(t),r.d(t,{SignIn:()=>tb,SignInModal:()=>tk});var o,a=r(14518),l=r(21210),s=r(35074),c=r(55873),d=r(80004),u=r(75350),h=r(85577),p=r(44607),f=r(67896),g=r(17607),m=r(54096),v=r(80212),I=r(42265),_=r(54132);r(50036);var w=r(9075),S=r(22861),b=r(18272),Y=r(58920),k=r(29),C=r(23707),A=r(63269),F=r(76153),y=r(49236),U=r(4964);let P=(0,s.lazy)(()=>Promise.all([r.e("545"),r.e("666"),r.e("188")]).then(r.bind(r,66464)).then(e=>({default:e.Web3SolanaWalletButtons}))),E=(0,w.RL)((0,w.SY)((0,A.dm)(()=>{let e=(0,l.ho)(),t=(0,A.f0)(),r=(0,U.r)(),n=(0,d.r)();return(0,a.Y)(p.n.Part,{part:"chooseWallet",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.web3Solana.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.web3Solana.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:t.error}),(0,a.FD)(b.so,{direction:"col",gap:4,children:[(0,a.Y)(s.Suspense,{fallback:(0,a.Y)(b.so,{direction:"row",align:"center",justify:"center",sx:e=>({height:"100%",minHeight:e.sizes.$32}),children:(0,a.Y)(b.y$,{size:"lg",colorScheme:"primary",elementDescriptor:Y.$z.spinner})}),children:(0,a.Y)(P,{web3AuthCallback:i=>{let{walletName:o}=i;return e.authenticateWithWeb3({customNavigate:r.navigate,redirectUrl:n.afterSignInUrl||"/",secondFactorUrl:"factor-two",signUpContinueUrl:n.isCombinedFlow?"create/continue":n.signUpContinueUrl,strategy:"web3_solana_signature",walletName:o}).catch(e=>(0,y.f)(e,t.setError))}})}),(0,a.Y)(k.E,{boxElementDescriptor:Y.$z.backRow,linkElementDescriptor:Y.$z.backLink,onClick:()=>{r.navigate("../")}})]})]}),(0,a.Y)(C.Z.Footer,{})]})})})));var D=r(42311);let L=()=>Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,84753)),M=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpVerifyPhone}))),T=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpVerifyEmail}))),G=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpStart}))),R=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpSSOCallback}))),B=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpContinue})));r(88711),r(60486),r(25089),r(61244),r(77895);var z=r(31475),O=r(52454),N=r(4468),Z=r(23990),$=r(8640),x=r(56324),K=r(97697),W=r(10078),V=r(23468),q=r(19426);let H=(0,A.dm)(()=>{let e=(0,x.n)(),t=(0,A.f0)(),{navigate:r}=(0,U.r)(),n=(0,q.p)(),{userSettings:{passwordSettings:i}}=(0,K.O)(),{t:o,locale:l}=(0,W._)(),c="needs_new_password"===e.status&&"reset_password_email_code"!==e.firstFactorVerification.strategy&&"reset_password_phone_code"!==e.firstFactorVerification.strategy;s.useEffect(()=>{c&&t.setError(o((0,S.G)("signIn.resetPassword.requiredMessage")))},[]);let d=(0,$.tJ)("password","",{type:"password",label:(0,S.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,Z.C5)(e,{t:o,locale:l,passwordSettings:i})}),u=(0,$.tJ)("confirmPassword","",{type:"password",label:(0,S.G)("formFieldLabel__confirmPassword"),isRequired:!0}),h=(0,$.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,S.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:p,isPasswordMatch:f}=(0,V.Z)({passwordField:d,confirmPasswordField:u}),g=async()=>{if(f){d.clearFeedback(),u.clearFeedback();try{let{status:t,createdSessionId:i}=await e.resetPassword({password:d.value,signOutOfOtherSessions:h.checked});switch(t){case"complete":if(i){let e=new URLSearchParams;return e.set("createdSessionId",i),r("../reset-password-success?".concat(e.toString()))}return console.error((0,z.wv)(t,n));case"needs_second_factor":return r("../factor-two");default:return console.error((0,z.wv)(t,n))}}catch(e){return(0,N.H4)(e,[d,u],t.setError)}}};return(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.Y)(F.Y.Root,{showLogo:!0,children:(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.resetPassword.title")})}),(0,a.Y)(C.Z.Alert,{children:t.error}),(0,a.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:(0,a.FD)(O.l.Root,{onSubmit:g,onBlur:()=>{d.value&&p(u.value)},gap:8,children:[(0,a.FD)(b.fv,{gap:6,children:[(0,a.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:e.identifier||"",style:{display:"none"}}),(0,a.Y)(O.l.ControlRow,{elementId:d.id,children:(0,a.Y)(O.l.PasswordInput,{...d.props,isRequired:!0,autoFocus:!0})}),(0,a.Y)(O.l.ControlRow,{elementId:u.id,children:(0,a.Y)(O.l.PasswordInput,{...u.props,onChange:e=>(e.target.value&&p(e.target.value),u.props.onChange(e))})}),!c&&(0,a.Y)(O.l.ControlRow,{elementId:h.id,children:(0,a.Y)(O.l.Checkbox,{...h.props})})]}),(0,a.FD)(b.fv,{gap:3,children:[(0,a.Y)(O.l.SubmitButton,{isDisabled:!f,localizationKey:(0,S.G)("signIn.resetPassword.formButtonPrimary")}),(0,a.Y)(C.Z.Action,{elementId:"alternativeMethods",children:(0,a.Y)(C.Z.ActionLink,{elementDescriptor:Y.$z.backLink,localizationKey:(0,S.G)("backButton"),onClick:()=>r("../")})})]})]})})]}),(0,a.Y)(C.Z.Footer,{})]})});var j=r(9107),J=r(56488);let X=(0,A.dm)(()=>{let e=(0,A.f0)();return(0,j.h)(),(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.Y)(F.Y.Root,{showLogo:!0,children:(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.resetPassword.title")})}),(0,a.Y)(C.Z.Alert,{children:e.error}),(0,a.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:[(0,a.Y)(b.EY,{localizationKey:(0,S.G)("signIn.resetPassword.successMessage")}),(0,a.Y)(J.s,{direction:"row",center:!0,children:(0,a.Y)(b.y$,{size:"xl",colorScheme:"primary",elementDescriptor:Y.$z.spinner})})]})]}),(0,a.Y)(C.Z.Footer,{})]})});r(19161),r(22239);var Q=r(62531),ee=r(80750),et=r(29345),er=r(49599),en=r(29366),ei=r(26932),eo=r(61052),ea=r(2540);let el=(0,w.SY)((0,A.dm)(()=>{let e=(0,A.f0)(),{userProfileUrl:t}=(0,K.O)().displayConfig,{afterSignInUrl:r,path:n,signInUrl:i,taskUrl:o}=(0,d.r)(),{navigateAfterSignOut:l}=(0,er.g)(),{handleSignOutAllClicked:s,handleSessionClicked:c,signedInSessions:u,handleAddAccountClicked:h}=(0,ea.u)({taskUrl:o,navigateAfterSignOut:l,afterSwitchSessionUrl:r,userProfileUrl:t,signInUrl:null!=n?n:i,user:void 0});return(0,a.Y)(p.n.Part,{part:"accountSwitcher",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{sx:e=>({padding:"".concat(e.space.$8," ").concat(e.space.$none," ").concat(e.space.$none)}),children:[(0,a.FD)(F.Y.Root,{children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.accountSwitcher.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.accountSwitcher.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:e.error}),(0,a.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100}),children:(0,a.FD)(Q.En,{role:"menu",children:[u.map(e=>(0,a.Y)(ee.P,{onClick:c(e),sx:e=>({height:e.sizes.$16,justifyContent:"flex-start",borderRadius:0}),icon:en.A,children:(0,a.Y)(et.c,{user:e.user,sx:{width:"100%"}})},e.id)),(0,a.Y)(Q.rc,{elementDescriptor:Y.$z.accountSwitcherActionButton,elementId:Y.$z.accountSwitcherActionButton.setId("addAccount"),iconBoxElementDescriptor:Y.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:Y.$z.accountSwitcherActionButtonIconBox.setId("addAccount"),iconElementDescriptor:Y.$z.accountSwitcherActionButtonIcon,iconElementId:Y.$z.accountSwitcherActionButtonIcon.setId("addAccount"),icon:ei.A,label:(0,S.G)("signIn.accountSwitcher.action__addAccount"),onClick:h,iconSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),iconBoxSx:e=>({minHeight:e.sizes.$9,minWidth:e.sizes.$6,alignItems:"center"}),spinnerSize:"md"})]})})]}),(0,a.Y)(C.Z.Footer,{sx:e=>({">:first-of-type":{padding:"".concat(e.space.$1),width:"100%"}}),children:(0,a.Y)(C.Z.Action,{sx:{width:"100%",">:first-of-type":{width:"100%",borderBottomWidth:0}},children:(0,a.Y)(eo.ww,{handleSignOutAllClicked:s,elementDescriptor:Y.$z.accountSwitcherActionButton,elementId:Y.$z.accountSwitcherActionButton.setId("signOutAll"),iconBoxElementDescriptor:Y.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:Y.$z.accountSwitcherActionButtonIconBox.setId("signOutAll"),iconElementDescriptor:Y.$z.accountSwitcherActionButtonIcon,iconElementId:Y.$z.accountSwitcherActionButtonIcon.setId("signOutAll"),label:(0,S.G)("signIn.accountSwitcher.action__signOutAll"),actionSx:e=>({padding:"".concat(e.space.$2," ").concat(e.space.$2)})})})})]})})}));var es=r(56980);r(98114);var ec=r(38738),ed=r(68289),eu=r(99835),eh=r(19090);let ep=e=>{let[t,r]=s.useState(!1),n=s.useCallback(()=>r(e=>!e),[r]);return t?(0,a.Y)(eh.n,{onBackLinkClick:n}):(0,a.Y)(ef,{onBackLinkClick:e.onBackLinkClick,onFactorSelected:e.onFactorSelected,onHavingTroubleClick:n})},ef=e=>{let{onHavingTroubleClick:t,onFactorSelected:r,onBackLinkClick:n}=e,i=(0,A.f0)(),{supportedSecondFactors:o}=(0,x.n)();return(0,a.Y)(p.n.Part,{part:"alternativeMethods",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.alternativeMethods.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.alternativeMethods.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:i.error}),(0,a.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:3,children:[(0,a.Y)(b.fv,{gap:2,children:o&&o.sort(ed.Wy).map((e,t)=>(0,a.Y)(ec.X,{textLocalizationKey:function(e){switch(e.strategy){case"phone_code":return(0,S.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"totp":return(0,S.G)("signIn.alternativeMethods.blockButton__totp");case"backup_code":return(0,S.G)("signIn.alternativeMethods.blockButton__backupCode");case"email_code":return(0,S.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"email_link":return(0,S.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,eu.u)(e.safeIdentifier)||""});default:throw Error("Invalid sign in strategy")}}(e),elementDescriptor:Y.$z.alternativeMethodsBlockButton,textElementDescriptor:Y.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:Y.$z.alternativeMethodsBlockButtonArrow,isDisabled:i.isLoading,onClick:()=>r(e)},t))}),(0,a.Y)(C.Z.Action,{elementId:"alternativeMethods",children:n&&(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("backButton"),onClick:e.onBackLinkClick})})]})]}),(0,a.Y)(C.Z.Footer,{children:(0,a.FD)(C.Z.Action,{elementId:"havingTrouble",children:[(0,a.Y)(C.Z.ActionText,{localizationKey:(0,S.G)("signIn.alternativeMethods.actionText")}),(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.alternativeMethods.actionLink"),onClick:t})]})})]})})};r(89305);var eg=r(73610),em=r(27912),ev=r(55763);let eI=e=>{var t,r;return(0,ev.Kw)(null==(t=e.firstFactorVerification)?void 0:t.strategy)&&(null==(r=e.firstFactorVerification)?void 0:r.status)==="verified"},e_=e=>{let t=(0,K.O)(),r=(0,x.n)(),n=(0,A.f0)(),{afterSignInUrl:i,navigateOnSetActive:o}=(0,d.r)(),{setActive:c}=(0,l.ho)(),{navigate:u}=(0,U.r)(),h=(0,q.p)(),p=(0,l.ho)(),f=(0,s.useMemo)(()=>{let e=Object.values(t.userSettings.attributes).some(e=>e.used_for_second_factor);return"new"===r.clientTrustState&&!e},[r.clientTrustState,t.userSettings.attributes]);s.useEffect(()=>{e.factorAlreadyPrepared||null==g||g()},[]);let g=e.prepare?()=>{var t;return null==(t=e.prepare)?void 0:t.call(e).then(()=>e.onFactorPrepare()).catch(e=>{if((0,eg._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,N.H4)(e,[],n.setError)})}:void 0;return(0,a.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:eI(r)?(0,S.G)("signIn.forgotPassword.subtitle"):e.cardSubtitle,cardNotice:e.showClientTrustNotice||f?(0,S.G)("signIn.newDeviceVerificationNotice"):void 0,resendButton:e.resendButton,inputLabel:e.inputLabel,onCodeEntryFinishedAction:(t,n,a)=>{r.attemptSecondFactor({strategy:e.factor.strategy,code:t}).then(async e=>{if(await n(),"complete"!==e.status)return console.error((0,z.wv)(e.status,h));if(eI(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),u("../reset-password-success?".concat(t.toString()))}return c({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await o({session:t,redirectUrl:i})}})}).catch(e=>(0,eg._d)(e)?p.__internal_navigateWithError("..",e.errors[0]):a(e))},onResendCodeClicked:g,safeIdentifier:"safeIdentifier"in e.factor?e.factor.safeIdentifier:void 0,profileImageUrl:r.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,children:eI(r)&&(0,a.Y)(b.EY,{localizationKey:(0,S.G)("signIn.resetPasswordMfa.detailsLabel"),colorScheme:"secondary"})})},ew=e=>{let t=(0,x.n)();return(0,a.Y)(p.n.Part,{part:"emailCode2Fa",children:(0,a.Y)(e_,{...e,cardTitle:(0,S.G)("signIn.emailCodeMfa.title"),cardSubtitle:(0,S.G)("signIn.emailCodeMfa.subtitle"),inputLabel:(0,S.G)("signIn.emailCodeMfa.formTitle"),resendButton:(0,S.G)("signIn.emailCodeMfa.resendButton"),prepare:()=>{let{emailAddressId:r,strategy:n}=e.factor;return t.prepareSecondFactor({emailAddressId:r,strategy:n})}})})};var eS=r(72027),eb=r(14979),eY=r(78051),ek=r(12992);let eC=e=>{let{t}=(0,W._)(),r=(0,A.f0)(),n=(0,x.n)(),i=(0,d.r)(),{signInUrl:o}=i,{afterSignInUrl:c}=(0,d.r)(),{setActive:u}=(0,l.ho)(),{startEmailLinkFlow:h,cancelEmailLinkFlow:f}=(0,ek.u)(n),[g,m]=s.useState(!1),v=(0,l.ho)();s.useEffect(()=>{I()},[]);let I=()=>{h({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,eY.lA)({ctx:i,baseUrl:o,intent:"sign-in"})}).then(e=>_(e)).catch(e=>{if((0,eg._d)(e))return v.__internal_navigateWithError("..",e.errors[0]);(0,N.H4)(e,[],r.setError)})},_=async e=>{let n=e.secondFactorVerification;"expired"===n.status?r.setError(t((0,S.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?m(!0):await u({session:e.createdSessionId,redirectUrl:c})};return g?(0,a.Y)(eb.$,{title:(0,S.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,S.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,a.Y)(p.n.Part,{part:"emailLink",children:(0,a.Y)(eS._,{cardTitle:(0,S.G)("signIn.emailLinkMfa.title"),cardSubtitle:(0,S.G)("signIn.emailLinkMfa.subtitle"),cardNotice:e.showClientTrustNotice||"new"===n.clientTrustState?(0,S.G)("signIn.newDeviceVerificationNotice"):void 0,formSubtitle:(0,S.G)("signIn.emailLinkMfa.formSubtitle"),resendButton:(0,S.G)("signIn.emailLinkMfa.resendButton"),onResendCodeClicked:()=>{f(),I()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})},eA=e=>{let t=(0,x.n)();return(0,a.Y)(p.n.Part,{part:"phoneCode2Fa",children:(0,a.Y)(e_,{...e,cardTitle:(0,S.G)("signIn.phoneCodeMfa.title"),cardSubtitle:(0,S.G)("signIn.phoneCodeMfa.subtitle"),inputLabel:(0,S.G)("signIn.phoneCodeMfa.formTitle"),resendButton:(0,S.G)("signIn.phoneCodeMfa.resendButton"),prepare:()=>{let{phoneNumberId:r,strategy:n}=e.factor;return t.prepareSecondFactor({phoneNumberId:r,strategy:n})}})})};var eF=r(22690);let ey=(0,w.RL)((0,w.SY)((0,A.dm)(function(){let e=(0,x.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:o,toggleAllStrategies:l}=(0,eF.j)(e.supportedSecondFactors);if(!t)return(0,a.Y)(es.B,{});if(o)return(0,a.Y)(ep,{onBackLinkClick:l,onFactorSelected:i});switch(null==t?void 0:t.strategy){case"phone_code":return(0,a.Y)(eA,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"email_code":return(0,a.Y)(ew,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"email_link":return(0,a.Y)(eC,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});default:return(0,a.Y)(es.B,{})}})));var eU=r(45170),eP=r(83474),eE=r(66505),eD=r(85763),eL=r(74421),eM=r(11051),eT=r(92181),eG=r(30743),eR=r(16889);r(85074);var eB=r(22166),ez=r(60044),eO=r(33226);let eN=s.memo(e=>{let t=(0,l.ho)(),{navigate:r}=(0,U.r)(),n=(0,A.f0)(),{displayConfig:i}=(0,K.O)(),o=(0,d.r)(),s=(0,x.n)(),c=(0,eY.uP)(o,i.signInUrl),u=o.afterSignInUrl||"/",h="popup"===o.oauthFlow||"auto"===o.oauthFlow&&(0,ez.C)(),{onAlternativePhoneCodeProviderClick:p,...f}=e,g=e=>(0,eg.$R)(e)&&e.errors.find(e=>e.code===eB.c.SESSION_EXISTS)?t.setActive({session:t.client.lastActiveSessionId,navigate:async e=>{let{session:t}=e;await o.navigateOnSetActive({session:t,redirectUrl:o.afterSignInUrl})}}):(0,N.H4)(e,[],n.setError);return(0,a.Y)(eO.V,{...f,showLastAuthenticationStrategy:!0,idleAfterDelay:!h,oauthCallback:e=>{if(h){let t=window.open("about:blank","","width=600,height=800"),r=setInterval(()=>{(!t||t.closed)&&(clearInterval(r),n.setIdle())},500);return s.authenticateWithPopup({strategy:e,redirectUrl:c,redirectUrlComplete:u,popup:t,oidcPrompt:o.oidcPrompt}).catch(e=>g(e))}return s.authenticateWithRedirect({strategy:e,redirectUrl:c,redirectUrlComplete:u,oidcPrompt:o.oidcPrompt}).catch(e=>g(e))},web3Callback:e=>"web3_solana_signature"===e?r("choose-wallet?strategy=".concat(e)):t.authenticateWithWeb3({customNavigate:r,redirectUrl:u,signUpContinueUrl:o.isCombinedFlow?"create/continue":o.signUpContinueUrl,strategy:e,secondFactorUrl:"factor-two"}).catch(e=>(0,y.f)(e,n.setError)),alternativePhoneCodeCallback:e=>{null==p||p(e)}})});function eZ(){var e;return null==(e=(0,x.n)().supportedFirstFactors)?void 0:e.find(e=>{let{strategy:t}=e;return(0,ev.Kw)(t)})}let e$=e=>((e,t)=>{let[r,n]=s.useState(!1),i=s.useCallback(()=>n(e=>!e),[n]);return r?(0,a.Y)(eh.n,{onBackLinkClick:i}):(0,a.Y)(e,{...t,onHavingTroubleClick:i})})(ex,{...e}),ex=e=>{let{onBackLinkClick:t,onHavingTroubleClick:r,onFactorSelected:n,mode:i="default"}=e,o=(0,A.f0)(),l=eZ(),{supportedFirstFactors:s}=(0,x.n)(),{firstPartyFactors:c,hasAnyStrategy:d}=(0,eP.y)({filterOutFactor:null==e?void 0:e.currentFactor,supportedFirstFactors:s}),u=function(e){switch(e){case"forgot":return"forgotPasswordMethods";case"pwned":return"passwordPwnedMethods";case"passwordCompromised":return"passwordCompromisedMethods";default:return"alternativeMethods"}}(i),h=function(e){switch(e){case"forgot":return(0,S.G)("signIn.forgotPasswordAlternativeMethods.title");case"pwned":return(0,S.G)("signIn.passwordPwned.title");case"passwordCompromised":return(0,S.G)("signIn.passwordCompromised.title");default:return(0,S.G)("signIn.alternativeMethods.title")}}(i),f=function(e){switch(e){case"forgot":case"pwned":return!0;default:return!1}}(i);return(0,a.Y)(p.n.Part,{part:u,children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:h}),!f&&"passwordCompromised"!==i&&(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.alternativeMethods.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:o.error}),(0,a.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:6,children:[f&&l&&(0,a.Y)(b.$n,{localizationKey:eK(l),elementDescriptor:Y.$z.alternativeMethodsBlockButton,isDisabled:o.isLoading,onClick:()=>{o.setError(void 0),n(l)}}),f&&d&&(0,a.Y)(eE.c,{dividerText:(0,S.G)("signIn.forgotPasswordAlternativeMethods.label__alternativeMethods")}),(0,a.FD)(b.fv,{gap:4,children:[d&&(0,a.FD)(b.so,{elementDescriptor:Y.$z.alternativeMethods,direction:"col",gap:2,children:[(0,a.Y)(eN,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:!1}),c&&c.map((e,t)=>{var r;return(0,a.Y)(ec.X,{leftIcon:(r=e,({email_link:eD.A,email_code:eL.A,phone_code:eM.A,reset_password_email_code:eT.A,reset_password_phone_code:eT.A,password:eG.A,passkey:eR.A})[r.strategy]),textLocalizationKey:eK(e),elementDescriptor:Y.$z.alternativeMethodsBlockButton,textElementDescriptor:Y.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:Y.$z.alternativeMethodsBlockButtonArrow,textVariant:"buttonLarge",isDisabled:o.isLoading,onClick:()=>{o.setError(void 0),n(e)}},t)})]}),t&&(0,a.Y)(k.E,{boxElementDescriptor:Y.$z.backRow,linkElementDescriptor:Y.$z.backLink,onClick:t})]})]})]}),(0,a.Y)(C.Z.Footer,{children:(0,a.FD)(C.Z.Action,{elementId:"havingTrouble",children:[(0,a.Y)(C.Z.ActionText,{localizationKey:(0,S.G)("signIn.alternativeMethods.actionText")}),(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.alternativeMethods.actionLink"),onClick:r})]})})]})})};function eK(e){switch(e.strategy){case"email_link":return(0,S.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"email_code":return(0,S.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"phone_code":return(0,S.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"password":return(0,S.G)("signIn.alternativeMethods.blockButton__password");case"passkey":return(0,S.G)("signIn.alternativeMethods.blockButton__passkey");case"reset_password_email_code":case"reset_password_phone_code":return(0,S.G)("signIn.forgotPasswordAlternativeMethods.blockButton__resetPassword");default:throw Error('Invalid sign in strategy: "'.concat(e.strategy,'"'))}}r(95055);var eW=r(35653);function eV(e){let t=(0,A.f0)(),{setActive:r,__internal_navigateWithError:n}=(0,l.ho)(),i=(0,q.p)(),{afterSignInUrl:o,navigateOnSetActive:a}=(0,d.r)(),{authenticateWithPasskey:c}=(0,x.n)();return(0,s.useEffect)(()=>()=>{eW.sv.abort()},[]),(0,s.useCallback)(async function(){for(var l=arguments.length,s=Array(l),d=0;d<l;d++)s[d]=arguments[d];try{let t=await c(...s);switch(t.status){case"complete":return r({session:t.createdSessionId,navigate:async e=>{let{session:t}=e;await a({session:t,redirectUrl:o})}});case"needs_second_factor":return e();default:return console.error((0,z.wv)(t.status,i))}}catch(r){let{flow:e}=s[0]||{};if((0,eg.Cm)(r)&&("passkey_operation_aborted"===r.code||"autofill"===e&&"passkey_retrieval_cancelled"===r.code))return;if((0,eg._d)(r))return n("..",r.errors[0]);(0,N.H4)(r,[],t.setError)}},[])}function eq(e){return!!(null==e?void 0:e.length)&&e.filter(e=>"enterprise_sso"===e.strategy&&"enterpriseConnectionId"in e&&"enterpriseConnectionName"in e).length>1}var eH=r(81652);let ej=e=>{let t=(0,x.n)(),r=(0,A.f0)(),{navigate:n}=(0,U.r)(),{afterSignInUrl:i,navigateOnSetActive:o}=(0,d.r)(),{setActive:s}=(0,l.ho)(),c=(0,q.p)(),u=(0,l.ho)(),h=e.factor.channel,p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared;return(0,a.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,a,l)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await a(),e.status){case"complete":return s({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await o({session:t,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,z.wv)(e.status,c))}}).catch(e=>(0,eg._d)(e)?u.__internal_navigateWithError("..",e.errors[0]):l(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor({...e.factor,channel:h}).then(()=>e.onFactorPrepare()).catch(e=>(0,N.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,alternativeMethodsLabel:(0,S.G)("footerActionLink__alternativePhoneCodeProvider"),onShowAlternativeMethodsClicked:()=>{r.setError(void 0),e.onChangePhoneCodeChannel({...e.factor,channel:void 0})},showAlternativeMethods:!0,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eJ=e=>{var t;return(0,a.Y)(p.n.Part,{part:"phoneCode",children:(0,a.Y)(ej,{...e,cardTitle:(0,S.G)("signIn.alternativePhoneCodeProvider.title",{provider:(null==(t=(0,eH.y)(e.factor.channel))?void 0:t.name)||""}),cardSubtitle:(0,S.G)("signIn.alternativePhoneCodeProvider.subtitle"),inputLabel:(0,S.G)("signIn.alternativePhoneCodeProvider.formTitle"),resendButton:(0,S.G)("signIn.alternativePhoneCodeProvider.resendButton")})})},eX=e=>{let t=(0,x.n)(),r=(0,A.f0)(),{navigate:n}=(0,U.r)(),{afterSignInUrl:i,navigateOnSetActive:o}=(0,d.r)(),{setActive:c}=(0,l.ho)(),u=(0,q.p)(),h=(0,l.ho)(),p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared,g=(0,s.useMemo)(()=>{let t=e.factor,r=t.strategy;return"emailAddressId"in t&&(r+="_".concat(t.emailAddressId)),"phoneNumberId"in t&&(r+="_".concat(t.phoneNumberId)),"channel"in t&&t.channel&&(r+="_".concat(t.channel)),{name:"signIn.prepareFirstFactor",factorKey:r}},[e.factor.strategy,"emailAddressId"in e.factor?e.factor.emailAddressId:void 0,"phoneNumberId"in e.factor?e.factor.phoneNumberId:void 0,"channel"in e.factor?e.factor.channel:void 0]);return(0,f.s)(p?void 0:()=>null==t?void 0:t.prepareFirstFactor(e.factor),g,{staleTime:100,onSuccess:()=>e.onFactorPrepare(),onError:e=>(0,N.H4)(e,[],r.setError)}),(0,a.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,a,l)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await a(),e.status){case"complete":return c({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await o({session:t,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,z.wv)(e.status,u))}}).catch(e=>(0,eg._d)(e)?h.__internal_navigateWithError("..",e.errors[0]):l(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor(e.factor).then(()=>e.onFactorPrepare()).catch(e=>(0,N.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eQ=e=>(0,a.Y)(p.n.Part,{part:"emailCode",children:(0,a.Y)(eX,{...e,cardTitle:(0,S.G)("signIn.emailCode.title"),cardSubtitle:(0,S.G)("signIn.emailCode.subtitle"),inputLabel:(0,S.G)("signIn.emailCode.formTitle"),resendButton:(0,S.G)("signIn.emailCode.resendButton")})}),e0=e=>{let{t}=(0,W._)(),r=(0,A.f0)(),n=(0,x.n)(),i=(0,d.r)(),{signInUrl:o}=i,{navigate:c}=(0,U.r)(),{afterSignInUrl:u}=(0,d.r)(),{setActive:h}=(0,l.ho)(),{startEmailLinkFlow:f,cancelEmailLinkFlow:g}=(0,ek.u)(n),[m,v]=s.useState(!1),I=(0,l.ho)();s.useEffect(()=>{_()},[]);let _=()=>{f({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,eY.lA)({ctx:i,baseUrl:o,intent:"sign-in"})}).then(e=>w(e)).catch(e=>{if((0,eg._d)(e))return I.__internal_navigateWithError("..",e.errors[0]);(0,N.H4)(e,[],r.setError)})},w=async e=>{let n=e.firstFactorVerification;"expired"===n.status?r.setError(t((0,S.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?v(!0):await b(e)},b=async e=>"complete"===e.status?h({session:e.createdSessionId,redirectUrl:u}):"needs_second_factor"===e.status?c("../factor-two"):void 0;return m?(0,a.Y)(eb.$,{title:(0,S.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,S.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,a.Y)(p.n.Part,{part:"emailLink",children:(0,a.Y)(eS._,{cardTitle:(0,S.G)("signIn.emailLink.title"),cardSubtitle:(0,S.G)("signIn.emailLink.subtitle"),formTitle:(0,S.G)("signIn.emailLink.formTitle"),formSubtitle:(0,S.G)("signIn.emailLink.formSubtitle"),resendButton:(0,S.G)("signIn.emailLink.resendButton"),onResendCodeClicked:()=>{g(),_()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})};var e1=r(77420);let e6=(0,A.dm)((n=(o=()=>{let e=(0,d.r)(),{displayConfig:t}=(0,K.O)(),r=(0,l.ho)().client.signIn;if(!eq(r.supportedFirstFactors))return null;let n=r.supportedFirstFactors.map(e=>({id:e.enterpriseConnectionId,name:e.enterpriseConnectionName}));return(0,a.Y)(p.n.Part,{part:"enterpriseConnections",children:(0,a.Y)(e1.l,{title:(0,S.G)("signIn.enterpriseConnections.title"),subtitle:(0,S.G)("signIn.enterpriseConnections.subtitle"),onClick:n=>{let i=(0,eY.uP)(e,t.signInUrl),o=e.afterSignInUrl||"/";return r.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:i,redirectUrlComplete:o,oidcPrompt:e.oidcPrompt,continueSignIn:!0,enterpriseConnectionId:n})},enterpriseConnections:n})})}).displayName||o.name||"Component",o.displayName=n,(i=e=>{let t=(0,x.n)(),r=(0,d.r)();return(0,w.RE)(o,()=>!eq(t.supportedFirstFactors),e=>{let{clerk:t}=e;return r.signInUrl||t.buildSignInUrl()},"There are no enterprise connections available to sign-in. Clerk is redirecting to the `signInUrl` instead.")(e)}).displayName="withEnterpriseConnectionsGuard(".concat(n,")"),i)),e2=e=>(0,a.Y)(p.n.Part,{part:"resetPassword",children:(0,a.Y)(eX,{...e,showAlternativeMethods:!1,cardTitle:(0,S.G)("signIn.forgotPassword.title"),inputLabel:(0,S.G)("signIn.forgotPassword.formTitle"),resendButton:(0,S.G)("signIn.forgotPassword.resendButton")})});var e4=r(196);let e5=e=>{let{onShowAlternativeMethodsClick:t}=e,r=(0,A.f0)(),n=(0,x.n)(),{navigate:i}=(0,U.r)(),[o,l]=s.useState(!1),c=s.useCallback(()=>l(e=>!e),[l]),d=eV(()=>i("../factor-two"));return o?(0,a.Y)(eh.n,{onBackLinkClick:c}):(0,a.Y)(p.n.Part,{part:"password",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(b.In,{elementDescriptor:Y.$z.passkeyIcon,icon:eR.A,sx:e=>({color:e.colors.$neutralAlpha500,marginInline:"auto",paddingBottom:e.sizes.$1,width:e.sizes.$12,height:e.sizes.$12})}),(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.passkey.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.passkey.subtitle")}),(0,a.Y)(e4.$,{identifier:n.identifier,avatarUrl:n.userData.imageUrl,onClick:()=>i("../")})]}),(0,a.Y)(C.Z.Alert,{children:r.error}),(0,a.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:4,children:[(0,a.Y)(O.l.Root,{onSubmit:e=>(e.preventDefault(),d()),gap:8,children:(0,a.Y)(O.l.SubmitButton,{hasArrow:!0})}),(0,a.Y)(C.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)(t?"footerActionLink__useAnotherMethod":"signIn.alternativeMethods.actionLink"),onClick:t||c})})]})]}),(0,a.Y)(C.Z.Footer,{})]})})},e8=e=>{let{onShowAlternativeMethodsClick:t,onPasswordError:r}=e,n=s.useRef(null),i=(0,A.f0)(),{setActive:o}=(0,l.ho)(),c=(0,x.n)(),{afterSignInUrl:u,navigateOnSetActive:h}=(0,d.r)(),f=(0,q.p)(),g=(e=>{let{onForgotPasswordMethodClick:t,onShowAlternativeMethodsClick:r}=e,n=eZ(),i=(0,$.tJ)("password","",{type:"password",label:(0,S.G)("formFieldLabel__password"),placeholder:(0,S.G)("formFieldInputPlaceholder__password")});return{...i,props:{...i.props,actionLabel:n||r?(0,S.G)("formFieldAction__forgotPassword"):"",onActionClicked:t||r||(()=>null)}}})(e),{navigate:m}=(0,U.r)(),[v,I]=s.useState(!1),_=s.useCallback(()=>I(e=>!e),[I]),w=(0,l.ho)();return v?(0,a.Y)(eh.n,{onBackLinkClick:_}):(0,a.Y)(p.n.Part,{part:"password",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.password.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.password.subtitle")}),(0,a.Y)(e4.$,{identifier:c.identifier,avatarUrl:c.userData.imageUrl,onClick:()=>{m("../")}})]}),(0,a.Y)(C.Z.Alert,{children:i.error}),(0,a.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:4,children:[(0,a.FD)(O.l.Root,{onSubmit:e=>{e.preventDefault(),c.attemptFirstFactor({strategy:"password",password:g.value}).then(e=>{switch(e.status){case"complete":return o({session:e.createdSessionId,navigate:e=>{let{session:t}=e;return h({session:t,redirectUrl:u})}});case"needs_second_factor":return m("../factor-two");case"needs_client_trust":return m("../client-trust");default:return console.error((0,z.wv)(e.status,f))}}).catch(e=>{if((0,eg._d)(e))return w.__internal_navigateWithError("..",e.errors[0]);if(r){if((0,eg.Au)(e)){i.setError({...e.errors[0],code:"form_password_pwned__sign_in"}),r("pwned");return}if((0,eg.qY)(e)){i.setError({...e.errors[0],code:"form_password_compromised__sign_in"}),r("compromised");return}}(0,N.H4)(e,[g],i.setError),setTimeout(()=>{var e;return null==(e=n.current)?void 0:e.focus()},0)})},gap:8,children:[(0,a.Y)("input",{readOnly:!0,id:"identifier-field",name:"identifier",value:c.identifier||"",style:{display:"none"}}),(0,a.Y)(O.l.ControlRow,{elementId:g.id,children:(0,a.Y)(O.l.PasswordInput,{...g.props,ref:n,autoFocus:!0})}),(0,a.Y)(O.l.SubmitButton,{hasArrow:!0})]}),(0,a.Y)(C.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)(t?"signIn.password.actionLink":"signIn.alternativeMethods.actionLink"),onClick:t||_})})]})]}),(0,a.Y)(C.Z.Footer,{})]})})},e9=e=>(0,a.Y)(p.n.Part,{part:"phoneCode",children:(0,a.Y)(eX,{...e,cardTitle:(0,S.G)("signIn.phoneCode.title"),cardSubtitle:(0,S.G)("signIn.phoneCode.subtitle"),inputLabel:(0,S.G)("signIn.phoneCode.formTitle"),resendButton:(0,S.G)("signIn.phoneCode.resendButton")})}),e3=e=>{if(!e)return"";let t=e.strategy;return"emailAddressId"in e&&(t+=e.emailAddressId),"phoneNumberId"in e&&(t+=e.phoneNumberId),"channel"in e&&(t+=e.channel),t},e7=(0,w.RL)((0,w.SY)((0,A.dm)(function(){let{__internal_setActiveInProgress:e}=(0,l.ho)(),t=(0,x.n)(),{preferredSignInStrategy:r}=(0,K.O)().displayConfig,n=t.supportedFirstFactors,i=(0,U.r)(),o=(0,A.f0)(),{supportedFirstFactors:c,firstFactorVerification:d}=(0,x.n)(),u=s.useRef(""),[{currentFactor:h},p]=s.useState(()=>{let e=(0,ev.xf)(n,t.identifier,r);return(null==e?void 0:e.strategy)==="phone_code"&&d.channel&&"sms"!==d.channel&&(e.channel=d.channel),{currentFactor:e,prevCurrentFactor:void 0}}),{hasAnyStrategy:f}=(0,eP.y)({filterOutFactor:h,supportedFirstFactors:c}),[g,m]=s.useState(()=>!h||!(0,ev.Cm)(h)),v=eZ(),[I,_]=s.useState(!1),[w,b]=s.useState(null);if(s.useEffect(()=>{e||("needs_identifier"===t.status||null===t.status)&&i.navigate("../")},[e]),!h)return t.status?(0,a.Y)(eU.J,{cardTitle:(0,S.G)("signIn.noAvailableMethods.title"),cardSubtitle:(0,S.G)("signIn.noAvailableMethods.subtitle"),message:(0,S.G)("signIn.noAvailableMethods.message")}):(0,a.Y)(es.B,{});let Y=f?()=>m(e=>!e):void 0,k=()=>_(e=>!e),C=()=>{u.current=e3(h)},F=e=>{p(t=>({currentFactor:e,prevCurrentFactor:t.currentFactor}))};if(eq(t.supportedFirstFactors))return(0,a.Y)(e6,{});if(g||I){let e=(0,ev.Cm)(h),t=g?Y:k;return(0,a.Y)(e$,{mode:I?"pwned"===w?"pwned":"compromised"===w?"passwordCompromised":"forgot":"default",onBackLinkClick:e?()=>{o.setError(void 0),b(null),null==t||t()}:void 0,onFactorSelected:e=>{F(e),null==t||t()},currentFactor:h})}if(!h)return(0,a.Y)(es.B,{});switch(null==h?void 0:h.strategy){case"passkey":return(0,a.Y)(e5,{onFactorPrepare:C,onShowAlternativeMethodsClick:Y});case"password":return(0,a.Y)(e8,{onForgotPasswordMethodClick:v?k:Y,onShowAlternativeMethodsClick:Y,onPasswordError:e=>{b(e),k()}});case"email_code":return(0,a.Y)(eQ,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"phone_code":if(h.channel&&"sms"!==h.channel)return(0,a.Y)(eJ,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onChangePhoneCodeChannel:F});return(0,a.Y)(e9,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"email_link":return(0,a.Y)(e0,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"reset_password_phone_code":return(0,a.Y)(e2,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),k()},cardSubtitle:(0,S.G)("signIn.forgotPassword.subtitle_phone")});case"reset_password_email_code":return(0,a.Y)(e2,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),k()},cardSubtitle:(0,S.G)("signIn.forgotPassword.subtitle_email")});default:return(0,a.Y)(es.B,{})}}))),te=e=>{let{onShowAlternativeMethodsClicked:t}=e,r=(0,x.n)(),{afterSignInUrl:n,navigateOnSetActive:i}=(0,d.r)(),{setActive:o}=(0,l.ho)(),{navigate:s}=(0,U.r)(),c=(0,q.p)(),u=(0,A.f0)(),h=(0,$.tJ)("code","",{type:"text",label:(0,S.G)("formFieldLabel__backupCode"),isRequired:!0}),p=(0,l.ho)(),f=e=>{var t,r;return(0,ev.Kw)(null==(t=e.firstFactorVerification)?void 0:t.strategy)&&(null==(r=e.firstFactorVerification)?void 0:r.status)==="verified"};return(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.backupCodeMfa.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:f(r)?(0,S.G)("signIn.forgotPassword.subtitle"):(0,S.G)("signIn.backupCodeMfa.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:u.error}),(0,a.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:(0,a.FD)(O.l.Root,{onSubmit:e=>(e.preventDefault(),r.attemptSecondFactor({strategy:"backup_code",code:h.value}).then(e=>{if("complete"!==e.status)return console.error((0,z.wv)(e.status,c));if(f(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),s("../reset-password-success?".concat(t.toString()))}return o({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await i({session:t,redirectUrl:n})}})}).catch(e=>{if((0,eg._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,N.H4)(e,[h],u.setError)})),children:[(0,a.Y)(O.l.ControlRow,{elementId:h.id,children:(0,a.Y)(O.l.PlainInput,{...h.props,autoFocus:!0,onActionClicked:t})}),(0,a.FD)(b.fv,{gap:3,children:[(0,a.Y)(O.l.SubmitButton,{hasArrow:!0}),(0,a.Y)(C.Z.Action,{elementId:"alternativeMethods",children:t&&(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})]})})]}),(0,a.Y)(C.Z.Footer,{})]})},tt=e=>(0,a.Y)(p.n.Part,{part:"totp2Fa",children:(0,a.Y)(e_,{...e,cardTitle:(0,S.G)("signIn.totpMfa.title"),cardSubtitle:(0,S.G)("signIn.totpMfa.subtitle"),inputLabel:(0,S.G)("signIn.totpMfa.formTitle")})}),tr=(0,w.RL)((0,w.SY)((0,A.dm)(function(){let e=(0,x.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:o,toggleAllStrategies:l}=(0,eF.j)(e.supportedSecondFactors);if(!t)return(0,a.Y)(es.B,{});if(o)return(0,a.Y)(ep,{onBackLinkClick:l,onFactorSelected:i});switch(null==t?void 0:t.strategy){case"phone_code":return(0,a.Y)(eA,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"totp":return(0,a.Y)(tt,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"backup_code":return(0,a.Y)(te,{onShowAlternativeMethodsClicked:l});case"email_code":return(0,a.Y)(ew,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"email_link":return(0,a.Y)(eC,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});default:return(0,a.Y)(es.B,{})}})));var tn=r(16126);let ti=(0,w.RL)((0,w.SY)(tn.F));r(30945),r(1589),r(10676),r(52678);var to=r(25848),ta=r(62620),tl=r(26760),ts=r(30958),tc=r(1959),td=r(6142),tu=r(84901),th=r(42229),tp=r(19835);let tf=e=>{var t;let{handleSubmit:r,phoneNumberFormState:n,onUseAnotherMethod:i,phoneCodeProvider:o}=e,{providerToDisplayData:l,strategyToDisplayData:s}=(0,tp.k)(),c=o.name,d=o.channel,u=(0,A.f0)();return(0,a.Y)(C.Z.Root,{children:(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,showDivider:!0,children:[(0,a.Y)(b.fv,{center:!0,children:(0,a.Y)(b._V,{src:null==(t=l[d])?void 0:t.iconUrl,alt:"".concat(s[d].name," logo"),sx:e=>({width:e.sizes.$7,height:e.sizes.$7,maxWidth:"100%",marginBottom:e.sizes.$6})})}),(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.start.alternativePhoneCodeProvider.title",{provider:c})}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.start.alternativePhoneCodeProvider.subtitle",{provider:c})})]}),(0,a.Y)(C.Z.Alert,{children:u.error}),(0,a.Y)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:6,children:(0,a.FD)(O.l.Root,{onSubmit:r,gap:8,children:[(0,a.Y)(b.fv,{gap:6,children:(0,a.Y)(O.l.ControlRow,{elementId:"phoneNumber",children:(0,a.Y)(O.l.PhoneInput,{...n.props,label:(0,S.G)("signIn.start.alternativePhoneCodeProvider.label",{provider:c}),isRequired:!0,isOptional:!1,actionLabel:void 0,onActionClicked:void 0})})}),(0,a.FD)(b.fv,{center:!0,children:[(0,a.Y)(td.j,{}),(0,a.Y)(b.fv,{gap:6,sx:{width:"100%"},children:(0,a.Y)(O.l.SubmitButton,{hasArrow:!0,localizationKey:(0,S.G)("formButtonPrimary")})})]}),(0,a.Y)(b.fv,{center:!0,children:(0,a.Y)(b.$n,{variant:"link",colorScheme:"neutral",onClick:i,localizationKey:(0,S.G)("signIn.start.alternativePhoneCodeProvider.actionLink")})})]})})]})})},tg=e=>{var t;return!!(null==(t=e.supportedFirstFactors)?void 0:t.length)&&e.supportedFirstFactors.every(e=>"enterprise_sso"===e.strategy)},tm=e=>{let{field:t}=e,[r,n]=(0,s.useState)(!1),i=(0,s.useRef)(null),o=!!(r||(null==t?void 0:t.value));return((0,s.useLayoutEffect)(()=>{let e=setInterval(()=>{if(null==i?void 0:i.current){var t;let r="onAutoFillStart"===window.getComputedStyle(i.current,":autofill").animationName||!!(null==(t=i.current)?void 0:t.matches("*:-webkit-autofill"));r&&(n(r),clearInterval(e))}},500);return()=>{clearInterval(e)}},[]),(0,s.useEffect)(()=>{(null==t?void 0:t.value)&&""!==t.value&&n(!1)},[null==t?void 0:t.value]),t)?(0,a.Y)(O.l.ControlRow,{elementId:t.id,sx:o?void 0:{position:"absolute",opacity:0,height:0,pointerEvents:"none",marginTop:"-1rem"},children:(0,a.Y)(O.l.PasswordInput,{...t.props,ref:i,tabIndex:o?void 0:-1})}):null},tv=(0,w.RL)((0,w.SY)((0,A.dm)(function(){var e,t,n;let i=(0,A.f0)(),o=(0,l.ho)(),c=(0,tu.m)(),{displayConfig:u,userSettings:h,authConfig:f}=(0,K.O)(),g=(0,x.n)(),{navigate:m}=(0,U.r)(),v=(0,d.r)(),{afterSignInUrl:I,signUpUrl:_,waitlistUrl:w,isCombinedFlow:k,navigateOnSetActive:y}=v,P=(0,q.p)(),E=(0,th.F)(),D=(0,s.useMemo)(()=>(0,tc.E9)(h.enabledFirstFactorIdentifiers),[h.enabledFirstFactorIdentifiers]),L=h.alternativePhoneCodeChannels,{isWebAuthnAutofillSupported:M}=(()=>{let[e,t]=(0,s.useState)(!1),{navigate:r}=(0,U.r)(),n=eV(()=>r("factor-two")),{userSettings:i}=(0,K.O)(),{passkeySettings:o,attributes:a}=i;return(0,s.useEffect)(()=>{var e;async function r(){let e=await (0,ta.nn)();t(e),e&&await n({flow:"autofill"})}o.allow_autofill&&(null==(e=a.passkey)?void 0:e.enabled)&&r()},[]),{isWebAuthnAutofillSupported:e}})(),T=eV(()=>m("factor-two")),G=(0,ta.Bz)(),R=!!(null==(e=v.initialValues)?void 0:e.phoneNumber)&&!(v.initialValues.emailAddress||v.initialValues.username)&&D.includes("phone_number"),[B,Z]=(0,s.useState)(R?"phone_number":D[0]||""),[W,V]=(0,s.useState)(!1),H=(0,to.hI)("__clerk_ticket")||"",j=(0,to.hI)("__clerk_status")||"",J=h.enabledFirstFactorIdentifiers,X=h.web3FirstFactors,Q=h.authenticatableSocialStrategies,ee=h.instanceIsPasswordBased,{currentIdentifier:et,nextIdentifier:er}=(0,tc.ZN)(D,B),en=(0,$.tJ)("password","",{type:"password",label:(0,S.G)("formFieldLabel__password"),placeholder:(0,S.G)("formFieldInputPlaceholder__password")}),[ei,eo]=(0,s.useState)(null),ea=h.alternativePhoneCodeChannels.length>0,el=v.initialValues||{},ec=(0,s.useMemo)(()=>({email_address:el.emailAddress,email_address_username:el.emailAddress||el.username,username:el.username,phone_number:el.phoneNumber}),[v.initialValues]),ed=!!Q.length||!!X.length||!!L.length,[eu,eh]=(0,s.useState)(!(0,ts.X)()&&!ed),ep=(0,$.tJ)("identifier",ec[B]||"",{...et,isRequired:!0,transformer:e=>e.trim()}),ef=(0,$.tJ)("identifier",ec.phone_number||"",{...et,isRequired:!0}),eg="phone_number"===B?ef:ep;(0,s.useLayoutEffect)(()=>{if(eg.value.startsWith("+")&&D.includes("phone_number")&&"phone_number"!==B&&!W){var e;e=eg.value,ep.setValue(ec[B]||""),ef.setValue(e),Z("phone_number"),eh(!0),V(!0)}},[eg.value,D]),(0,s.useEffect)(()=>{if(H){if("sign_up"===j){let e=new URLSearchParams;H&&e.set("__clerk_ticket",H),m(k?"create":_,{searchParams:e});return}c.setLoading(),i.setLoading(),g.create({strategy:"ticket",ticket:H}).then(e=>{switch(e.status){case"needs_first_factor":if(!tg(e)||eq(e.supportedFirstFactors))return m("factor-one");return eI();case"needs_second_factor":return m("factor-two");case"needs_client_trust":return m("client-trust");case"complete":return(0,to.rw)("__clerk_ticket"),o.setActive({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await y({session:t,redirectUrl:I})}});default:return void console.error((0,z.wv)(e.status,P))}}).catch(e=>e_(e)).finally(()=>{tg(g)||(c.setIdle(),i.setIdle())})}},[]),(0,s.useEffect)(()=>{!async function(){var e;let t=null==g||null==(e=g.firstFactorVerification)?void 0:e.error;if(t){switch(t.code){case eB.c.NOT_ALLOWED_TO_SIGN_UP:case eB.c.OAUTH_ACCESS_DENIED:case eB.c.NOT_ALLOWED_ACCESS:case eB.c.SAML_USER_ATTRIBUTE_MISSING:case eB.c.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:case eB.c.USER_LOCKED:case eB.c.EXTERNAL_ACCOUNT_NOT_FOUND:case eB.c.SIGN_UP_MODE_RESTRICTED:case eB.c.SIGN_UP_MODE_RESTRICTED_WAITLIST:case eB.c.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:case eB.c.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eB.c.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:case eB.c.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eB.c.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:case eB.c.CAPTCHA_INVALID:case eB.c.FRAUD_DEVICE_BLOCKED:case eB.c.FRAUD_ACTION_BLOCKED:case eB.c.SIGNUP_RATE_LIMIT_EXCEEDED:case eB.c.USER_BANNED:i.setError(t);break;default:i.setError("Unable to complete action at this time. If the problem persists please contact support.")}await g.create({})}}()},[]);let em=async function(){for(var e,t,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];let a=(null==ei?void 0:ei.channel)||(0,ev.oj)(n,f.preferredChannels,"identifier");if(a){let e=()=>{};n.push({id:"strategy",value:"phone_code",clearFeedback:e,setValue:e,onChange:e,setError:e}),n.push({id:"channel",value:a,clearFeedback:e,setValue:e,onChange:e,setError:e})}try{let r,i,a=await (i=g.create(((!(r=(e=n).some(e=>"password"===e.name&&!!e.value))||h.enterpriseSSO.enabled)&&(e=e.filter(e=>"password"!==e.name)),{...(0,$.mK)(e),...r&&!h.enterpriseSSO.enabled&&{strategy:"password"}})),i.then(e=>{var t,r;if(!h.enterpriseSSO.enabled)return e;let i=null==(t=n.find(e=>"password"===e.name))?void 0:t.value;return!i||(null==(r=e.supportedFirstFactors)?void 0:r.some(e=>"enterprise_sso"===e.strategy))?e:e.attemptFirstFactor({strategy:"password",password:i})}));switch(a.status){case"needs_identifier":(null==(t=a.supportedFirstFactors)?void 0:t.some(e=>"enterprise_sso"===e.strategy))&&await eI();break;case"needs_first_factor":if(!tg(a)||eq(a.supportedFirstFactors))return m("factor-one");return eI();case"needs_second_factor":return m("factor-two");case"needs_client_trust":return m("client-trust");case"complete":return o.setActive({session:a.createdSessionId,navigate:async e=>{let{session:t}=e;await y({session:t,redirectUrl:I})}});default:return void console.error((0,z.wv)(a.status,P))}}catch(e){return e_(e)}},eI=async()=>{let e=(0,eY.uP)(v,u.signInUrl),t=v.afterSignInUrl||"/";return g.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:e,redirectUrlComplete:t,oidcPrompt:v.oidcPrompt,continueSignIn:!0})},e_=async e=>{if(!e.errors)return;let t=e.errors.find(e=>e.code===eB.c.INVALID_STRATEGY_FOR_USER||e.code===eB.c.FORM_PASSWORD_INCORRECT||e.code===eB.c.FORM_PASSWORD_PWNED),n=e.errors.find(e=>e.code===eB.c.SESSION_EXISTS),a=e.errors.find(e=>"identifier_already_signed_in"===e.code),l=e.errors.find(e=>e.code===eB.c.INVITATION_ACCOUNT_NOT_EXISTS||e.code===eB.c.FORM_IDENTIFIER_NOT_FOUND);if(t)await em(eg);else if(n)await o.setActive({session:o.client.lastActiveSessionId,navigate:async e=>{let{session:t}=e;await y({session:t,redirectUrl:I})}});else if(a){let e=a.meta.sessionId;await o.setActive({session:e,navigate:async e=>{let{session:t}=e;await y({session:t,redirectUrl:I})}})}else if(k&&l){var s,c;let e=(0,ev.UY)(eg);if(h.signUp.mode===eB.f.WAITLIST)return m(o.buildWaitlistUrl("emailAddress"===e?{initialValues:{[e]:eg.value}}:{}));o.client.signUp[e]=eg.value;let t=(0,eY.uP)(v,u.signUpUrl),n=v.afterSignUpUrl||"/";return function(e){var t,n;let{identifierAttribute:i,identifierValue:o,signUpMode:a,navigate:l,organizationTicket:s,afterSignUpUrl:c,clerk:d,handleError:u,redirectUrl:h,redirectUrlComplete:p,passwordEnabled:f,navigateOnSetActive:g,alternativePhoneCodeChannel:m}=e;if(a===eB.f.WAITLIST)return l(d.buildWaitlistUrl("emailAddress"===i?{initialValues:{[i]:o}}:{}));d.client.signUp[i]=o;let v=new URLSearchParams;return(s&&v.set("__clerk_ticket",s),f||(t=d.client.signUp,n=i,t.optionalFields.filter(e=>!(e.startsWith("oauth_")||e.startsWith("web3_"))&&"enterprise_sso"!==e&&"password"!==e&&("phoneNumber"!==n||"phone_number"!==e)).length>0)||"emailAddress"!==i&&"phoneNumber"!==i)?l("create",{searchParams:v}):d.client.signUp.create({[i]:o,...m?{strategy:"phone_code",channel:m}:{}}).then(async e=>(await Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,88722)).then(e=>e.completeSignUpFlow))({signUp:e,verifyEmailPath:"create/verify-email-address",verifyPhonePath:"create/verify-phone-number",handleComplete:()=>d.setActive({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await g({session:t,redirectUrl:c})}}),navigate:l,redirectUrl:h,redirectUrlComplete:p})).catch(e=>u(e))}({afterSignUpUrl:v.afterSignUpUrl||"/",clerk:o,handleError:e=>(0,N.H4)(e,[eg,en],i.setError),identifierAttribute:e,identifierValue:eg.value,navigate:m,organizationTicket:H,signUpMode:h.signUp.mode,redirectUrl:t,redirectUrlComplete:n,navigateOnSetActive:y,passwordEnabled:null!=(c=null==(s=h.attributes.password)?void 0:s.required)&&c,alternativePhoneCodeChannel:(null==ei?void 0:ei.channel)||(0,ev.iy)(f.preferredChannels,e,eg.value)})}else(0,N.H4)(e,[eg,en],i.setError)},ew=async e=>(e.preventDefault(),em(eg,en)),eS=(0,s.useMemo)(()=>({tel:O.l.PhoneInput,password:O.l.PasswordInput,text:O.l.PlainInput,email:O.l.PlainInput})[eg.type],[eg.type]);if(c.isLoading||"sign_up"===j)return(0,a.Y)(es.B,{});let{action:eb,validLastAuthenticationStrategies:ek,...eC}=eg.props,eA=null==(t=o.client)?void 0:t.lastAuthenticationStrategy,eF=!!eA&&E>1&&(null==ek?void 0:ek.has(eA));return(0,a.Y)(p.n.Part,{part:"start",children:ei?(0,a.Y)(tf,{handleSubmit:ew,phoneNumberFormState:ef,onUseAnotherMethod:()=>{eo(null)},phoneCodeProvider:ei}):(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:k?(0,S.G)("signIn.start.titleCombined"):(0,S.G)("signIn.start.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:k?(0,S.G)("signIn.start.subtitleCombined"):(0,S.G)("signIn.start.subtitle"),sx:{"&:empty":{display:"none"}}})]}),(0,a.Y)(C.Z.Alert,{children:i.error}),(0,a.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:6,children:[(0,a.FD)(tl.U,{children:[ed&&(0,a.Y)(eN,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:ea,onAlternativePhoneCodeProviderClick:e=>{eo((0,eH.y)(e)||null)}}),J.length?(0,a.FD)(O.l.Root,{onSubmit:ew,gap:8,children:[(0,a.FD)(b.fv,{gap:6,children:[(0,a.Y)(O.l.ControlRow,{elementId:eg.id,children:(0,a.Y)(eS,{actionLabel:null==er?void 0:er.action,onActionClicked:()=>{Z(e=>D[(D.indexOf(e)+1)%D.length]),eh(!0),V(!1)},...eC,autoFocus:eu,autoComplete:M?"webauthn":void 0,isLastAuthenticationStrategy:eF})}),(0,a.Y)(tm,{field:ee?en:void 0})]}),(0,a.FD)(b.fv,{center:!0,children:[(0,a.Y)(td.j,{}),(0,a.Y)(O.l.SubmitButton,{hasArrow:!0})]})]}):null]}),!J.length&&(0,a.Y)(td.j,{}),(null==(n=h.attributes.passkey)?void 0:n.enabled)&&h.passkeySettings.show_sign_in_button&&G&&(0,a.Y)(C.Z.Action,{elementId:"usePasskey",children:(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.start.actionLink__use_passkey"),onClick:()=>T({flow:"discoverable"})})})]})]}),(0,a.FD)(C.Z.Footer,{children:[h.signUp.mode===eB.f.PUBLIC&&!k&&(0,a.FD)(C.Z.Action,{elementId:"signIn",children:[(0,a.Y)(C.Z.ActionText,{localizationKey:(0,S.G)("signIn.start.actionText")}),(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.start.actionLink"),to:o.buildUrlWithAuth(_)})]}),h.signUp.mode===eB.f.WAITLIST&&(0,a.FD)(C.Z.Action,{elementId:"signIn",children:[(0,a.Y)(C.Z.ActionText,{localizationKey:(0,S.G)("signIn.start.actionText__join_waitlist")}),(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.start.actionLink__join_waitlist"),to:o.buildUrlWithAuth(w)})]})]})]})})})));function tI(){let e=(0,l.ho)();return s.useEffect(()=>{e.redirectToSignIn()},[e]),null}function t_(){let e=(0,d.r)(),t=(0,u.X)();return(0,a.Y)(p.n.Root,{flow:"signIn",children:(0,a.FD)(v.d,{children:[(0,a.Y)(I.q,{path:"factor-one",children:(0,a.Y)(e7,{})}),(0,a.Y)(I.q,{path:"factor-two",children:(0,a.Y)(tr,{})}),(0,a.Y)(I.q,{path:"client-trust",children:(0,a.Y)(ey,{})}),(0,a.Y)(I.q,{path:"reset-password",children:(0,a.Y)(H,{})}),(0,a.Y)(I.q,{path:"reset-password-success",children:(0,a.Y)(X,{})}),(0,a.Y)(I.q,{path:"sso-callback",children:(0,a.Y)(ti,{signUpUrl:e.signUpUrl,signInUrl:e.signInUrl,signInForceRedirectUrl:e.afterSignInUrl,signUpForceRedirectUrl:e.afterSignUpUrl,continueSignUpUrl:e.signUpContinueUrl,transferable:e.transferable,firstFactorUrl:"../factor-one",secondFactorUrl:"../factor-two",resetPasswordUrl:"../reset-password"})}),(0,a.Y)(I.q,{path:"choose",children:(0,a.Y)(el,{})}),(0,a.Y)(I.q,{path:"choose-wallet",children:(0,a.Y)(E,{})}),(0,a.Y)(I.q,{path:"verify",children:(0,a.Y)(c.Y,{redirectUrlComplete:e.afterSignInUrl,redirectUrl:"../factor-two"})}),e.isCombinedFlow&&(0,a.FD)(I.q,{path:"create",children:[(0,a.Y)(I.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,a.Y)(T,{})}),(0,a.Y)(I.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,a.Y)(M,{})}),(0,a.Y)(I.q,{path:"sso-callback",children:(0,a.Y)(R,{signUpUrl:t.signUpUrl,signInUrl:t.signInUrl,signUpForceRedirectUrl:t.afterSignUpUrl,signInForceRedirectUrl:t.afterSignInUrl,secondFactorUrl:t.secondFactorUrl,continueSignUpUrl:"../continue",verifyEmailAddressUrl:"../verify-email-address",verifyPhoneNumberUrl:"../verify-phone-number"})}),(0,a.Y)(I.q,{path:"verify",children:(0,a.Y)(c.M,{redirectUrlComplete:t.afterSignUpUrl,verifyEmailPath:"../verify-email-address",verifyPhonePath:"../verify-phone-number",continuePath:"../continue"})}),(0,a.FD)(I.q,{path:"continue",children:[(0,a.Y)(I.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,a.Y)(T,{})}),(0,a.Y)(I.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,a.Y)(M,{})}),(0,a.Y)(I.q,{index:!0,children:(0,a.Y)(B,{})})]}),(0,a.Y)(I.q,{path:"tasks",children:(0,a.Y)(m.JJ,{redirectUrlComplete:e.afterSignUpUrl})}),(0,a.Y)(I.q,{index:!0,children:(0,a.Y)(G,{})})]}),(0,a.Y)(I.q,{path:"tasks",children:(0,a.Y)(m.JJ,{redirectUrlComplete:e.afterSignInUrl})}),(0,a.Y)(I.q,{index:!0,children:(0,a.Y)(tv,{})}),(0,a.Y)(I.q,{children:(0,a.Y)(tI,{})})]})})}let tw=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,f.s)(e?L:void 0,"preloadComponent",{staleTime:1/0})};function tS(){let e=(0,d.r)(),t={componentName:"SignUp",emailLinkRedirectUrl:e.emailLinkRedirectUrl,ssoCallbackUrl:e.ssoCallbackUrl,forceRedirectUrl:e.signUpForceRedirectUrl,fallbackRedirectUrl:e.signUpFallbackRedirectUrl,signInUrl:e.signInUrl,unsafeMetadata:e.unsafeMetadata,...(0,D.C)({routing:null==e?void 0:e.routing,path:null==e?void 0:e.path})};return tw(e.isCombinedFlow),(0,g.Z)(),(0,a.Y)(u.g.Provider,{value:t,children:(0,a.Y)(t_,{})})}t_.displayName="SignIn";let tb=(0,h.Z)(tS),tY=(0,h.Z)(tS),tk=e=>{let t={signUpUrl:"/".concat(_.I,"/sign-up"),waitlistUrl:"/".concat(_.I,"/waitlist"),...e};return(0,a.Y)(I.q,{path:"sign-in",children:(0,a.Y)(d.Q.Provider,{value:{componentName:"SignIn",...t,routing:"virtual",mode:"modal"},children:(0,a.Y)("div",{children:(0,a.Y)(tY,{...t,routing:"virtual"})})})})}},22690:function(e,t,r){r.d(t,{j:()=>a}),r(88711);var n=r(35074),i=r(55763);let o=e=>{if(!e)return"";let t=e.strategy;return"phoneNumberId"in e&&(t+=e.phoneNumberId),t};function a(e){let t=n.useRef(""),[r,a]=n.useState(()=>(0,i.R5)(e)),[l,s]=n.useState(!r),c=t.current===o(r);return{currentFactor:r,factorAlreadyPrepared:c,handleFactorPrepare:()=>{t.current=o(r)},selectFactor:e=>{a(e),s(!1)},showAllStrategies:l,toggleAllStrategies:()=>s(e=>!e)}}},55763:function(e,t,r){r.d(t,{Cm:()=>u,Kw:()=>f,R5:()=>h,UY:()=>g,iy:()=>v,oj:()=>m,xf:()=>c}),r(19161),r(85074),r(30945),r(22501),r(21044);var n=r(62620),i=r(87651),o=r(1959),a=r(68289);let l=e=>t=>"safeIdentifier"in t&&t.safeIdentifier===e;function s(e){if((0,n.Bz)()){let t=e.find(e=>{let{strategy:t}=e;return"passkey"===t});if(t)return t}return null}function c(e,t,r){return e&&0!==e.length?r===o._o.Password?function(e,t){let r=s(e);if(r)return r;let n=e.sort(a.Kn)[0];return"password"===n.strategy?n:e.find(l(t))||n||null}(e,t):function(e,t){let r=s(e);if(r)return r;let n=e.sort(a.Ih),i=n.find(l(t));if(i)return i;let o=n[0];return"email_link"===o.strategy?o:e.find(l(t))||o||null}(e,t):null}let d=["passkey","email_code","password","phone_code","email_link"];function u(e){return!!e&&d.includes(e.strategy)}function h(e){if(!e||0===e.length)return null;let t=e.find(e=>"totp"===e.strategy);if(t)return t;let r=e.find(e=>"phone_code"===e.strategy);return r||e[0]}let p=["reset_password_phone_code","reset_password_email_code"],f=e=>!!e&&p.includes(e);function g(e){let t;return"tel"===e.type?"phoneNumber":(t=e.value,/^\S+@\S+\.\S+$/.test(t))?"emailAddress":"username"}let m=(e,t,r)=>{var n,o;if(!t)return null;let a=null==(n=e.find(e=>"strategy"===e.id))?void 0:n.value;if(a&&"phone_code"!==a)return null;let l=null==(o=e.find(e=>e.id===r))?void 0:o.value;if(!l||!(null==l?void 0:l.startsWith("+")))return null;let s=(0,i.TV)(l,t);return"sms"===s?null:s},v=(e,t,r)=>{if(!e||!t||"phoneNumber"!==t||!r||!(null==r?void 0:r.startsWith("+")))return null;let n=(0,i.TV)(r,e);return"sms"===n?null:n}},80004:function(e,t,r){r.d(t,{Q:()=>g,r:()=>m}),r(98114);var n=r(22166),i=r(48380),o=r(5580),a=r(14173),l=r(21210),s=r(62543),c=r(35074),d=r(78051),u=r(97697),h=r(62366),p=r(4964),f=r(42117);let g=(0,c.createContext)(null),m=()=>{var e,t,r,m,v,I,_;let w=(0,c.useContext)(g),{navigate:S,basePath:b,startPath:Y}=(0,p.r)(),{displayConfig:k,userSettings:C}=(0,u.O)(),{queryParams:A,queryString:F}=(0,p.r)(),y=C.signUp.mode,U=(0,h.II)(),P=(0,l.ho)();if(null===w||"SignIn"!==w.componentName)throw Error("Clerk: useSignInContext called outside of the mounted SignIn component.");let E="restricted"!==y&&!!(!U.signUpUrl&&U.signInUrl&&!(0,s.vh)(U.signInUrl))&&!1!==w.withSignUp||w.withSignUp||!1,{componentName:D,mode:L,...M}=w,T=(0,c.useMemo)(()=>(0,f.tf)(F,n.u),[]),G=new i.n(U,{...M,signInFallbackRedirectUrl:M.signInFallbackRedirectUrl||M.fallbackRedirectUrl,signInForceRedirectUrl:M.signInForceRedirectUrl||M.forceRedirectUrl},A,L);delete M.fallbackRedirectUrl,delete M.forceRedirectUrl;let R=P.buildUrlWithAuth(G.getAfterSignInUrl()),B=P.buildUrlWithAuth(G.getAfterSignUpUrl()),z="path"===M.routing&&M.path||U.signInUrl||k.signInUrl,O=E?"path"===M.routing&&M.path||U.signUpUrl||k.signUpUrl:M.signUpUrl||U.signUpUrl||k.signUpUrl,N=M.waitlistUrl||U.waitlistUrl||k.waitlistUrl,Z=G.getPreservedSearchParams();z=(0,a.kZ)({base:z,hashSearchParams:[A,Z]},{stringify:!0}),O=(0,a.kZ)({base:O,hashSearchParams:[A,Z]},{stringify:!0}),N=(0,a.kZ)({base:N,hashSearchParams:[A,Z]},{stringify:!0});let $=G.toSearchParams().toString(),x=(0,d.aQ)({routing:M.routing,baseUrl:O,authQueryString:$,path:M.path,endpoint:E?"/create"+d.Vu:d.Vu}),K=(0,d.aQ)({routing:M.routing,baseUrl:O,authQueryString:$,path:M.path,endpoint:E?"/create"+d.aB:d.aB});E&&(O=(0,a.kZ)({base:z,hashPath:"/create",hashSearchParams:[A,Z]},{stringify:!0}));let W=(0,a.kZ)({base:O,hashPath:"/continue"},{stringify:!0}),V=async e=>{let{session:t,redirectUrl:r}=e,n=t.currentTask;if(!n)return S(r);let i=(0,o.ru)(n);return S("/".concat(b+Y+(E?"/create"+i:i)))},q=(null==(e=P.session)?void 0:e.currentTask)?null!=(I=null==(r=P.__internal_getOption("taskUrls"))?void 0:r[null==(t=P.session)?void 0:t.currentTask.key])?I:(0,d.aQ)({routing:M.routing,baseUrl:z,authQueryString:$,path:M.path,endpoint:E?"/create"+(0,o.ru)(null==(m=P.session)?void 0:m.currentTask):(0,o.ru)(null==(v=P.session)?void 0:v.currentTask)}):null;return{...M,transferable:null==(_=M.transferable)||_,oauthFlow:M.oauthFlow||"auto",componentName:D,signUpUrl:O,signInUrl:z,waitlistUrl:N,afterSignInUrl:R,afterSignUpUrl:B,emailLinkRedirectUrl:x,ssoCallbackUrl:K,navigateAfterSignIn:()=>S(R),signUpContinueUrl:W,queryParams:A,initialValues:{...M.initialValues,...T},authQueryString:$,isCombinedFlow:E,navigateOnSetActive:V,taskUrl:q}}},49599:function(e,t,r){r.d(t,{g:()=>o});var n=r(21210),i=r(4964);let o=()=>{let{navigate:e}=(0,i.r)(),t=(0,n.ho)();return{navigateAfterSignOut:()=>e(t.buildAfterSignOutUrl()),navigateAfterMultiSessionSingleSignOutUrl:()=>e(t.buildAfterMultiSessionSingleSignOutUrl()),afterSignOutUrl:t.buildAfterSignOutUrl(),afterMultiSessionSingleSignOutUrl:t.buildAfterMultiSessionSingleSignOutUrl()}}}}]);
|