@clerk/ui 1.0.0-snapshot.v20251224145055 → 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/ClerkUi.js +2 -2
- 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/foundations/defaultFoundations.d.ts +153 -153
- package/dist/index.js +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/lazyModules/components.d.ts +20 -20
- 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/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/{signin_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → signin_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/{signin_ui_d60088_1.0.0-snapshot.v20251224145055.js → signin_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/{signup_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → signup_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/{signup_ui_d60088_1.0.0-snapshot.v20251224145055.js → signup_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/{ui-common_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → ui-common_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/{ui-common_ui_d60088_1.0.0-snapshot.v20251224145055.js → ui-common_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +1 -1
- package/dist/ui.browser.js +1 -1
- package/dist/ui.legacy.browser.js +1 -1
- package/package.json +3 -3
- package/dist/organizationlist_ui_d60088_1.0.0-snapshot.v20251224145055.js +0 -1
- package/dist/organizationlist_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js +0 -1
- package/dist/organizationswitcher_ui_d60088_1.0.0-snapshot.v20251224145055.js +0 -1
- package/dist/organizationswitcher_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js +0 -1
- /package/dist/{207_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → 207_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{207_ui_d60088_1.0.0-snapshot.v20251224145055.js → 207_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{217_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → 217_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{217_ui_d60088_1.0.0-snapshot.v20251224145055.js → 217_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{360_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → 360_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{360_ui_d60088_1.0.0-snapshot.v20251224145055.js → 360_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{444_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → 444_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{444_ui_d60088_1.0.0-snapshot.v20251224145055.js → 444_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{573_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → 573_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{573_ui_d60088_1.0.0-snapshot.v20251224145055.js → 573_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{970_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → 970_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{970_ui_d60088_1.0.0-snapshot.v20251224145055.js → 970_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{apiKeys_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → apiKeys_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{apiKeys_ui_d60088_1.0.0-snapshot.v20251224145055.js → apiKeys_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{blankcaptcha_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → blankcaptcha_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{blankcaptcha_ui_d60088_1.0.0-snapshot.v20251224145055.js → blankcaptcha_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{checkout_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → checkout_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{checkout_ui_d60088_1.0.0-snapshot.v20251224145055.js → checkout_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → copy-api-key-modal_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_d60088_1.0.0-snapshot.v20251224145055.js → copy-api-key-modal_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{createorganization_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → createorganization_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{createorganization_ui_d60088_1.0.0-snapshot.v20251224145055.js → createorganization_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → enableOrganizationsPrompt_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_d60088_1.0.0-snapshot.v20251224145055.js → enableOrganizationsPrompt_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{framework_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → framework_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{framework_ui_d60088_1.0.0-snapshot.v20251224145055.js → framework_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{impersonationfab_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → impersonationfab_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{impersonationfab_ui_d60088_1.0.0-snapshot.v20251224145055.js → impersonationfab_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{keylessPrompt_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → keylessPrompt_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{keylessPrompt_ui_d60088_1.0.0-snapshot.v20251224145055.js → keylessPrompt_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{oauthConsent_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → oauthConsent_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{oauthConsent_ui_d60088_1.0.0-snapshot.v20251224145055.js → oauthConsent_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{onetap_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → onetap_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{onetap_ui_d60088_1.0.0-snapshot.v20251224145055.js → onetap_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-api-keys-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → op-api-keys-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-api-keys-page_ui_d60088_1.0.0-snapshot.v20251224145055.js → op-api-keys-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-billing-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → op-billing-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-billing-page_ui_d60088_1.0.0-snapshot.v20251224145055.js → op-billing-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-plans-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → op-plans-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{op-plans-page_ui_d60088_1.0.0-snapshot.v20251224145055.js → op-plans-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{organizationprofile_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → organizationprofile_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{organizationprofile_ui_d60088_1.0.0-snapshot.v20251224145055.js → organizationprofile_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{payment-attempt-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → payment-attempt-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{payment-attempt-page_ui_d60088_1.0.0-snapshot.v20251224145055.js → payment-attempt-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{planDetails_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → planDetails_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{planDetails_ui_d60088_1.0.0-snapshot.v20251224145055.js → planDetails_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → prefetchorganizationlist_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_d60088_1.0.0-snapshot.v20251224145055.js → prefetchorganizationlist_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{pricingTable_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → pricingTable_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{pricingTable_ui_d60088_1.0.0-snapshot.v20251224145055.js → pricingTable_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → revoke-api-key-modal_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_d60088_1.0.0-snapshot.v20251224145055.js → revoke-api-key-modal_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{sessionTasks_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → sessionTasks_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{sessionTasks_ui_d60088_1.0.0-snapshot.v20251224145055.js → sessionTasks_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{statement-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → statement-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{statement-page_ui_d60088_1.0.0-snapshot.v20251224145055.js → statement-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{subscriptionDetails_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → subscriptionDetails_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{subscriptionDetails_ui_d60088_1.0.0-snapshot.v20251224145055.js → subscriptionDetails_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → taskChooseOrganization_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_d60088_1.0.0-snapshot.v20251224145055.js → taskChooseOrganization_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{taskResetPassword_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → taskResetPassword_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{taskResetPassword_ui_d60088_1.0.0-snapshot.v20251224145055.js → taskResetPassword_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-api-keys-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → up-api-keys-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-api-keys-page_ui_d60088_1.0.0-snapshot.v20251224145055.js → up-api-keys-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-billing-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → up-billing-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-billing-page_ui_d60088_1.0.0-snapshot.v20251224145055.js → up-billing-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-plans-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → up-plans-page_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{up-plans-page_ui_d60088_1.0.0-snapshot.v20251224145055.js → up-plans-page_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{useravatar_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → useravatar_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{useravatar_ui_d60088_1.0.0-snapshot.v20251224145055.js → useravatar_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{userbutton_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → userbutton_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{userbutton_ui_d60088_1.0.0-snapshot.v20251224145055.js → userbutton_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{userprofile_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → userprofile_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{userprofile_ui_d60088_1.0.0-snapshot.v20251224145055.js → userprofile_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{userverification_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → userverification_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{userverification_ui_d60088_1.0.0-snapshot.v20251224145055.js → userverification_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{vendors_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → vendors_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{vendors_ui_d60088_1.0.0-snapshot.v20251224145055.js → vendors_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{waitlist_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → waitlist_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{waitlist_ui_d60088_1.0.0-snapshot.v20251224145055.js → waitlist_ui_dd6371_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js → web3-solana-wallet-buttons_ui_bd1c40_1.0.0-snapshot.v20260105214115.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_d60088_1.0.0-snapshot.v20251224145055.js → web3-solana-wallet-buttons_ui_dd6371_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()}}}}]);
|