@clerk/ui 1.0.0-canary.v20251219031410 → 1.0.0-canary.v20251219180306
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/207_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/217_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/360_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/444_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/573_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/970_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/ClerkUi.js +2 -2
- package/dist/apiKeys_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/blankcaptcha_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/checkout_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/{checkout_ui_4ca268_1.0.0-canary.v20251219031410.js → checkout_ui_e3da0c_1.0.0-canary.v20251219180306.js} +1 -1
- package/dist/components/Checkout/CheckoutPage.js +1 -1
- package/dist/components/Checkout/CheckoutPage.js.map +1 -1
- package/dist/components/Checkout/parts.js +1 -1
- package/dist/components/Checkout/parts.js.map +1 -1
- package/dist/copy-api-key-modal_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/createorganization_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/enableOrganizationsPrompt_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/framework_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/impersonationfab_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/index.js +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/keylessPrompt_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/oauthConsent_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/onetap_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/op-api-keys-page_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/op-billing-page_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/op-plans-page_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/organizationlist_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/organizationprofile_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/organizationswitcher_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/payment-attempt-page_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/planDetails_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/prefetchorganizationlist_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/pricingTable_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/revoke-api-key-modal_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/sessionTasks_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/signin_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/signup_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/statement-page_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/subscriptionDetails_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/taskChooseOrganization_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/taskResetPassword_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/ui-common_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/{ui-common_ui_4ca268_1.0.0-canary.v20251219031410.js → ui-common_ui_e3da0c_1.0.0-canary.v20251219180306.js} +9 -9
- package/dist/ui.browser.js +3 -3
- package/dist/ui.legacy.browser.js +1 -0
- package/dist/up-api-keys-page_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/up-billing-page_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/up-plans-page_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/useravatar_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/userbutton_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/userprofile_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/userverification_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/vendors_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/waitlist_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/dist/web3-solana-wallet-buttons_ui_d56036_1.0.0-canary.v20251219180306.js +1 -0
- package/package.json +6 -3
- /package/dist/{207_ui_4ca268_1.0.0-canary.v20251219031410.js → 207_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{217_ui_4ca268_1.0.0-canary.v20251219031410.js → 217_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{360_ui_4ca268_1.0.0-canary.v20251219031410.js → 360_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{444_ui_4ca268_1.0.0-canary.v20251219031410.js → 444_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{573_ui_4ca268_1.0.0-canary.v20251219031410.js → 573_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{970_ui_4ca268_1.0.0-canary.v20251219031410.js → 970_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{apiKeys_ui_4ca268_1.0.0-canary.v20251219031410.js → apiKeys_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{blankcaptcha_ui_4ca268_1.0.0-canary.v20251219031410.js → blankcaptcha_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_4ca268_1.0.0-canary.v20251219031410.js → copy-api-key-modal_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{createorganization_ui_4ca268_1.0.0-canary.v20251219031410.js → createorganization_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_4ca268_1.0.0-canary.v20251219031410.js → enableOrganizationsPrompt_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{framework_ui_4ca268_1.0.0-canary.v20251219031410.js → framework_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{impersonationfab_ui_4ca268_1.0.0-canary.v20251219031410.js → impersonationfab_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{keylessPrompt_ui_4ca268_1.0.0-canary.v20251219031410.js → keylessPrompt_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{oauthConsent_ui_4ca268_1.0.0-canary.v20251219031410.js → oauthConsent_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{onetap_ui_4ca268_1.0.0-canary.v20251219031410.js → onetap_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{op-api-keys-page_ui_4ca268_1.0.0-canary.v20251219031410.js → op-api-keys-page_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{op-billing-page_ui_4ca268_1.0.0-canary.v20251219031410.js → op-billing-page_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{op-plans-page_ui_4ca268_1.0.0-canary.v20251219031410.js → op-plans-page_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{organizationlist_ui_4ca268_1.0.0-canary.v20251219031410.js → organizationlist_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{organizationprofile_ui_4ca268_1.0.0-canary.v20251219031410.js → organizationprofile_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{organizationswitcher_ui_4ca268_1.0.0-canary.v20251219031410.js → organizationswitcher_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{payment-attempt-page_ui_4ca268_1.0.0-canary.v20251219031410.js → payment-attempt-page_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{planDetails_ui_4ca268_1.0.0-canary.v20251219031410.js → planDetails_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_4ca268_1.0.0-canary.v20251219031410.js → prefetchorganizationlist_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{pricingTable_ui_4ca268_1.0.0-canary.v20251219031410.js → pricingTable_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_4ca268_1.0.0-canary.v20251219031410.js → revoke-api-key-modal_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{sessionTasks_ui_4ca268_1.0.0-canary.v20251219031410.js → sessionTasks_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{signin_ui_4ca268_1.0.0-canary.v20251219031410.js → signin_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{signup_ui_4ca268_1.0.0-canary.v20251219031410.js → signup_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{statement-page_ui_4ca268_1.0.0-canary.v20251219031410.js → statement-page_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{subscriptionDetails_ui_4ca268_1.0.0-canary.v20251219031410.js → subscriptionDetails_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_4ca268_1.0.0-canary.v20251219031410.js → taskChooseOrganization_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{taskResetPassword_ui_4ca268_1.0.0-canary.v20251219031410.js → taskResetPassword_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{up-api-keys-page_ui_4ca268_1.0.0-canary.v20251219031410.js → up-api-keys-page_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{up-billing-page_ui_4ca268_1.0.0-canary.v20251219031410.js → up-billing-page_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{up-plans-page_ui_4ca268_1.0.0-canary.v20251219031410.js → up-plans-page_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{useravatar_ui_4ca268_1.0.0-canary.v20251219031410.js → useravatar_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{userbutton_ui_4ca268_1.0.0-canary.v20251219031410.js → userbutton_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{userprofile_ui_4ca268_1.0.0-canary.v20251219031410.js → userprofile_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{userverification_ui_4ca268_1.0.0-canary.v20251219031410.js → userverification_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{vendors_ui_4ca268_1.0.0-canary.v20251219031410.js → vendors_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{waitlist_ui_4ca268_1.0.0-canary.v20251219031410.js → waitlist_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
- /package/dist/{web3-solana-wallet-buttons_ui_4ca268_1.0.0-canary.v20251219031410.js → web3-solana-wallet-buttons_ui_e3da0c_1.0.0-canary.v20251219180306.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["718"],{34484:function(e,r,t){t.r(r),t.d(r,{UserProfile:()=>r9,UserProfileModal:()=>r7});var i=t(14518),l=t(35074),n=t(21227),o=t(43264),a=t(85240),s=t(44607),c=t(22861),d=t(63269),u=t(9764),h=t(65396),f=t(80212),m=t(42265);t(19161),t(95055);let p=e=>{let{pages:r,apiKeysProps:t}=(0,a.B)(),l=r.routes.filter(e=>e.id!==n.j2.API_KEYS||!(null==t?void 0:t.hide));return(0,i.FD)(u.XM,{contentRef:e.contentRef,children:[(0,i.Y)(u.jq,{title:(0,c.G)("userProfile.navbar.title"),description:(0,c.G)("userProfile.navbar.description"),routes:l,contentRef:e.contentRef}),e.children]})};t(50036),t(22239);var v=t(50540),g=t(97697),Y=t(21210),P=t(23707),b=t(76153),y=t(18272),S=t(58920);t(88711),t(30945),t(22501);var _=t(51421),D=t(44003),R=t(48080),G=t(4468),w=t(62660),C=t(93453),F=t(92513),I=t(19835),k=t(4964);t(58910);var x=t(6735);let A=e=>{let{strategy:r}=e,t=(0,d.f0)(),{user:l}=(0,Y.Jd)(),{navigate:n}=(0,k.r)(),{strategyToDisplayData:o}=(0,I.k)(),{additionalOAuthScopes:s,componentName:u,mode:h}=(0,a.B)(),f="modal"===h,m=(0,Y.Wp)(()=>{let e=r.replace("oauth_",""),t=f?(0,_.j)({url:window.location.href,componentName:u,socialProvider:e}):window.location.href,i=s?s[e]:[];return null==l?void 0:l.createExternalAccount({strategy:r,redirectUrl:t,additionalScopes:i})}),p=o[r].iconUrl?(0,i.Y)(y._V,{isLoading:t.loadingMetadata===r,isDisabled:t.isLoading,elementDescriptor:S.$z.providerIcon,elementId:S.$z.providerIcon.setId(o[r].id),src:o[r].iconUrl,alt:"Connect ".concat(o[r].name," account"),sx:e=>({width:e.sizes.$4})}):(0,i.Y)(w.T,{id:o[r].id,value:o[r].name,isLoading:t.loadingMetadata===r,isDisabled:t.isLoading});return(0,i.Y)(D.rd.ActionMenuItem,{id:o[r].id,onClick:()=>{if(l)return t.setLoading(r),m().then(e=>{var i;e&&(null==(i=e.verification)?void 0:i.externalVerificationRedirectURL)&&((0,x.y)(2e3).then(()=>t.setIdle(r)),n(e.verification.externalVerificationRedirectURL.href))}).catch(e=>{(0,G.H4)(e,[],t.setError),t.setIdle(r)})},isDisabled:t.isLoading,variant:"ghost",isLoading:t.loadingMetadata===r,focusRing:!1,closeAfterClick:!1,localizationKey:(0,c.G)("userProfile.connectedAccountPage.socialButtonsBlockButton",{provider:o[r].name}),sx:e=>({justifyContent:"start",gap:e.space.$2}),leftIcon:p},r)},z=e=>{let{onClick:r}=e,{user:t}=(0,Y.Jd)(),{strategies:l}=(0,I.k)(),n=l.filter(e=>e.startsWith("oauth")),o=null==t?void 0:t.verifiedExternalAccounts.map(e=>"oauth_".concat(e.provider)),a=n.filter(e=>!o.includes(e));return 0===a.length?null:(0,i.Y)(D.rd.ActionMenu,{triggerLocalizationKey:(0,c.G)("userProfile.start.connectedAccountsSection.primaryButton"),id:"connectedAccounts",onClick:r,children:a.map(e=>(0,i.Y)(A,{strategy:e},e))})};t(85074);var T=t(88046);let $=e=>{var r;let{onSuccess:t,onReset:n}=e,{user:o}=(0,Y.Jd)(),{emailId:a}=e,s=null==o?void 0:o.emailAddresses.find(e=>e.id===a),d=l.useRef(null==s?void 0:s.emailAddress),u=(null==s||null==(r=s.verification)?void 0:r.status)==="verified"?(0,c.G)("userProfile.emailAddressPage.removeResource.messageLine2"):void 0;return d.current?(0,i.Y)(T.P,{title:(0,c.G)("userProfile.emailAddressPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.emailAddressPage.removeResource.messageLine1",{identifier:d.current}),messageLine2:u,successMessage:(0,c.G)("userProfile.emailAddressPage.removeResource.successMessage",{emailAddress:d.current}),deleteResource:()=>Promise.resolve(null==s?void 0:s.destroy()),onSuccess:t,onReset:n}):null},E=e=>{var r;let{phoneId:t,onSuccess:n,onReset:o}=e,{user:a}=(0,Y.Jd)(),s=null==a?void 0:a.phoneNumbers.find(e=>e.id===t),d=l.useRef(null==s?void 0:s.phoneNumber),u=(null==s||null==(r=s.verification)?void 0:r.status)==="verified"?(0,c.G)("userProfile.phoneNumberPage.removeResource.messageLine2"):void 0;return d.current?(0,i.Y)(T.P,{title:(0,c.G)("userProfile.phoneNumberPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.phoneNumberPage.removeResource.messageLine1",{identifier:d.current}),messageLine2:u,successMessage:(0,c.G)("userProfile.phoneNumberPage.removeResource.successMessage",{phoneNumber:d.current}),deleteResource:()=>Promise.resolve(null==s?void 0:s.destroy()),onSuccess:n,onReset:o}):null},L=e=>{var r,t;let{accountId:n,onSuccess:o,onReset:a}=e,{user:s}=(0,Y.Jd)(),d=null==s?void 0:s.externalAccounts.find(e=>e.id===n),u=l.useRef(null==d?void 0:d.provider),{providerToDisplayData:h}=(0,I.k)();return u.current?(0,i.Y)(T.P,{title:(0,c.G)("userProfile.connectedAccountPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.connectedAccountPage.removeResource.messageLine1",{identifier:(null==(r=h[u.current])?void 0:r.name)||""}),messageLine2:(0,c.G)("userProfile.connectedAccountPage.removeResource.messageLine2"),successMessage:(0,c.G)("userProfile.connectedAccountPage.removeResource.successMessage",{connectedAccount:(null==(t=h[u.current])?void 0:t.name)||""}),deleteResource:()=>Promise.resolve(null==d?void 0:d.destroy()),onSuccess:o,onReset:a}):null},O=e=>{var r;let{user:t}=(0,Y.Jd)(),{walletId:n,onSuccess:o,onReset:a}=e,s=null==t?void 0:t.web3Wallets.find(e=>e.id===n),d=l.useRef(null==s?void 0:s.web3Wallet),u=(null==s||null==(r=s.verification)?void 0:r.status)==="verified"?(0,c.G)("userProfile.web3WalletPage.removeResource.messageLine2"):void 0;return d.current?(0,i.Y)(T.P,{title:(0,c.G)("userProfile.web3WalletPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.web3WalletPage.removeResource.messageLine1",{identifier:d.current}),messageLine2:u,successMessage:(0,c.G)("userProfile.web3WalletPage.removeResource.successMessage",{web3Wallet:d.current}),deleteResource:()=>Promise.resolve(null==s?void 0:s.destroy()),onSuccess:o,onReset:a}):null},K=e=>{let{user:r}=(0,Y.Jd)(),{phoneId:t,onSuccess:n,onReset:o}=e,a=null==r?void 0:r.phoneNumbers.find(e=>e.id===t),s=l.useRef(null==a?void 0:a.phoneNumber);return s.current?(0,i.Y)(T.P,{title:(0,c.G)("userProfile.mfaPhoneCodePage.removeResource.title"),messageLine1:(0,c.G)("userProfile.mfaPhoneCodePage.removeResource.messageLine1",{identifier:s.current}),messageLine2:(0,c.G)("userProfile.mfaPhoneCodePage.removeResource.messageLine2"),successMessage:(0,c.G)("userProfile.mfaPhoneCodePage.removeResource.successMessage",{mfaPhoneCode:s.current}),deleteResource:()=>Promise.resolve(null==a?void 0:a.setReservedForSecondFactor({reserved:!1})),onSuccess:n,onReset:o}):null},B=e=>{let{onSuccess:r,onReset:t}=e,{user:l}=(0,Y.Jd)();return l?(0,i.Y)(T.P,{title:(0,c.G)("userProfile.mfaTOTPPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.mfaTOTPPage.removeResource.messageLine1"),messageLine2:(0,c.G)("userProfile.mfaTOTPPage.removeResource.messageLine2"),successMessage:(0,c.G)("userProfile.mfaTOTPPage.removeResource.successMessage"),deleteResource:l.disableTOTP,onSuccess:r,onReset:t}):null},W=e=>{let{onSuccess:r,onReset:t,passkey:l}=e;return(0,i.Y)(T.P,{title:(0,c.G)("userProfile.passkeyScreen.removeResource.title"),messageLine1:(0,c.G)("userProfile.passkeyScreen.removeResource.messageLine1",{name:l.name||""}),deleteResource:l.delete,onSuccess:r,onReset:t})},M=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(L,{onSuccess:r,onReset:r,...e})},N=["external_account_missing_refresh_token","oauth_fetch_user_error","oauth_token_exchange_error","external_account_email_address_verification_required"],J=(0,d.dm)(e=>{var r;let{shouldAllowCreation:t=!0}=e,{user:n}=(0,Y.Jd)(),o=(0,d.f0)(),a=!!(null==n||null==(r=n.externalAccounts)?void 0:r.length),[s,u]=(0,l.useState)(null);if(!n||!t&&!a)return null;let h=[...n.verifiedExternalAccounts,...n.unverifiedExternalAccounts.filter(e=>{var r;return null==(r=e.verification)?void 0:r.error})];return(0,i.FD)(D.rd.Root,{title:(0,c.G)("userProfile.start.connectedAccountsSection.title"),centered:!1,id:"connectedAccounts",children:[(0,i.Y)(P.Z.Alert,{children:o.error}),(0,i.FD)(C.r.Root,{value:s,onChange:u,children:[(0,i.Y)(D.rd.ItemList,{id:"connectedAccounts",children:h.map(e=>(0,i.Y)(q,{account:e},e.id))}),t&&(0,i.Y)(z,{onClick:()=>u(null)})]})]})}),q=e=>{var r,t,n,o,s,u;let{account:h}=e,{additionalOAuthScopes:f,componentName:m,mode:p}=(0,a.B)(),{navigate:v}=(0,k.r)(),{user:g}=(0,Y.Jd)(),P=(0,d.f0)(),b=h.id,R="modal"===p,F=R?(0,_.j)({url:window.location.href,componentName:m}):window.location.href,x=(0,Y.Wp)(()=>null==g?void 0:g.createExternalAccount({strategy:h.verification.strategy,redirectUrl:F,additionalScopes:$}));if(!g)return null;let{providerToDisplayData:A}=(0,I.k)(),z=h.username||h.emailAddress,T=null==(t=h.verification)||null==(r=t.error)?void 0:r.longMessage,$=function(e,r){if(!r)return[];let t=r[e.provider]||[],i=e.approvedScopes.split(" ");return 0===t.filter(e=>!i.includes(e)).length?[]:t}(h,f),E=$.length>0&&""!=h.approvedScopes,L=N.includes((null==(o=h.verification)||null==(n=o.error)?void 0:n.code)||"")||E,O=L?(0,c.G)("userProfile.start.connectedAccountsSection.subtitle__disconnected"):T,K=async()=>{let e=R?(0,_.j)({url:window.location.href,componentName:m}):window.location.href;try{let t;if(t=E?await h.reauthorize({additionalScopes:$,redirectUrl:e}):await x()){var r;await v((null==(r=t.verification.externalVerificationRedirectURL)?void 0:r.href)||"")}}catch(e){(0,G.H4)(e,[],P.setError)}};return(0,i.FD)(l.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"connectedAccounts",children:[(0,i.FD)(y.so,{sx:e=>({overflow:"hidden",gap:e.space.$2}),children:[(0,i.Y)(()=>A[h.provider].iconUrl?(0,i.Y)(y._V,{elementDescriptor:[S.$z.providerIcon],elementId:S.$z.socialButtonsProviderIcon.setId(h.provider),alt:A[h.provider].name,src:A[h.provider].iconUrl,sx:e=>({width:e.sizes.$4,flexShrink:0})}):(0,i.Y)(w.T,{id:h.provider,value:A[h.provider].name}),{}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:1,center:!0,children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),children:"".concat(A[h.provider].name)}),(0,i.Y)(y.EY,{truncate:!0,as:"span",colorScheme:"secondary",children:z?"• ".concat(z):""})]})})]}),(0,i.Y)(U,{account:h})]}),L&&(0,i.FD)(y.az,{sx:e=>({padding:"".concat(e.sizes.$none," ").concat(e.sizes.$none," ").concat(e.sizes.$1x5," ").concat(e.sizes.$8x5)}),children:[(0,i.Y)(y.EY,{colorScheme:"secondary",sx:e=>({paddingRight:e.sizes.$1x5,display:"inline-block"}),localizationKey:O}),(0,i.Y)(y.$n,{sx:{display:"inline-block"},onClick:K,variant:"link",localizationKey:(0,c.G)("userProfile.start.connectedAccountsSection.actionLabel__connectionFailed")})]}),(null==(u=h.verification)||null==(s=u.error)?void 0:s.code)&&!L&&(0,i.Y)(y.EY,{colorScheme:"danger",sx:e=>({padding:"".concat(e.sizes.$none," ").concat(e.sizes.$1x5," ").concat(e.sizes.$1x5," ").concat(e.sizes.$8x5)}),children:T}),(0,i.Y)(C.r.Open,{value:"remove-".concat(b),children:(0,i.Y)(C.r.Card,{variant:"destructive",children:(0,i.Y)(M,{accountId:h.id})})})]},h.id)},U=e=>{let{account:r}=e,{open:t}=(0,F.D5)(),l=r.id,n=[{label:(0,c.G)("userProfile.start.connectedAccountsSection.destructiveActionTitle"),isDestructive:!0,onClick:()=>t("remove-".concat(l))}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:n})};t(41730),t(10676);let j=e=>e.defaultSecondFactor?-1:1;function H(e){let r=[];return Object.entries(e).forEach(e=>{let[,t]=e;t.used_for_second_factor&&r.push(...t.second_factors)}),r}function V(e,r){let t=H(e);return r.totpEnabled&&(t=t.filter(e=>"totp"!==e)),(r.backupCodeEnabled||!r.twoFactorEnabled)&&(t=t.filter(e=>"backup_code"!==e)),t}function Z(e,r){if(!e)return[];let t=e.filter(e=>e.id===r),i=e.filter(e=>e.id!==r),l=i.filter(e=>{var r;return(null==(r=e.verification)?void 0:r.status)==="verified"}),n=i.filter(e=>{var r,t;return!!(null==(r=e.verification)?void 0:r.status)&&(null==(t=e.verification)?void 0:t.status)!=="verified"}),o=i.filter(e=>!e.verification.status);return l.sort((e,r)=>e.id.localeCompare(r.id)),n.sort((e,r)=>{var t,i;return(null==(t=e.verification)?void 0:t.expireAt)&&(null==(i=r.verification)?void 0:i.expireAt)?e.verification.expireAt.getTime()-r.verification.expireAt.getTime():0}),[...t,...l,...n,...o]}var X=t(32336);let Q=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)($,{onSuccess:r,onReset:r,...e})},ee=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(X.v,{onSuccess:r,onReset:r,...e})},er=e=>{let{shouldAllowCreation:r=!0}=e,{user:t}=(0,Y.Jd)();return(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.emailAddressesSection.title"),centered:!1,id:"emailAddresses",children:(0,i.Y)(C.r.Root,{children:(0,i.FD)(D.rd.ItemList,{id:"emailAddresses",children:[Z(null==t?void 0:t.emailAddresses,null==t?void 0:t.primaryEmailAddressId).map(e=>{let r=e.id;return(0,i.FD)(l.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"emailAddresses",children:[(0,i.FD)(y.so,{sx:e=>({overflow:"hidden",gap:e.space.$1}),children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),truncate:!0,children:e.emailAddress}),(null==t?void 0:t.primaryEmailAddressId)===r&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__unverified")})]}),(0,i.Y)(et,{email:e})]}),(0,i.Y)(C.r.Open,{value:"remove-".concat(r),children:(0,i.Y)(C.r.Card,{variant:"destructive",children:(0,i.Y)(Q,{emailId:r})})}),(0,i.Y)(C.r.Open,{value:"verify-".concat(r),children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(ee,{emailId:r})})})]},e.emailAddress)}),r&&(0,i.FD)(i.FK,{children:[(0,i.Y)(C.r.Trigger,{value:"add",children:(0,i.Y)(D.rd.ArrowButton,{id:"emailAddresses",localizationKey:(0,c.G)("userProfile.start.emailAddressesSection.primaryButton")})}),(0,i.Y)(C.r.Open,{value:"add",children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(ee,{})})})]})]})})})},et=e=>{let{email:r}=e,t=(0,d.f0)(),{user:l}=(0,Y.Jd)(),{open:n}=(0,F.D5)(),o=r.id,a=(null==l?void 0:l.primaryEmailAddressId)===o,s="verified"===r.verification.status,u=(0,Y.Wp)(()=>null==l?void 0:l.update({primaryEmailAddressId:o})),h=[a&&!s?{label:(0,c.G)("userProfile.start.emailAddressesSection.detailsAction__primary"),onClick:()=>n("verify-".concat(o))}:null,!a&&s?{label:(0,c.G)("userProfile.start.emailAddressesSection.detailsAction__nonPrimary"),onClick:()=>{u().catch(e=>(0,G.H4)(e,[],t.setError))}}:null,!a&&!s?{label:(0,c.G)("userProfile.start.emailAddressesSection.detailsAction__unverified"),onClick:()=>n("verify-".concat(o))}:null,{label:(0,c.G)("userProfile.start.emailAddressesSection.destructiveAction"),isDestructive:!0,onClick:()=>n("remove-".concat(o))}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:h})},ei=()=>{let{user:e}=(0,Y.Jd)(),r=null==e?void 0:e.enterpriseAccounts.filter(e=>{let{enterpriseConnection:r}=e;return null==r?void 0:r.active});return(null==r?void 0:r.length)?(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.enterpriseAccountsSection.title"),id:"enterpriseAccounts",centered:!1,children:(0,i.Y)(D.rd.ItemList,{id:"enterpriseAccounts",children:r.map(e=>(0,i.Y)(el,{account:e},e.id))})}):null},el=e=>{var r,t,l;let{account:n}=e,o=n.emailAddress,a=null==n||null==(r=n.enterpriseConnection)?void 0:r.name,s=null==(l=n.verification)||null==(t=l.error)?void 0:t.longMessage;return(0,i.FD)(D.rd.Item,{id:"enterpriseAccounts",sx:e=>({gap:e.space.$2,justifyContent:"start"}),children:[(0,i.Y)(en,{account:n}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:1,center:!0,children:[(0,i.Y)(y.EY,{truncate:!0,colorScheme:"body",children:a}),(0,i.Y)(y.EY,{truncate:!0,as:"span",colorScheme:"secondary",children:o?"• ".concat(o):""}),s&&(0,i.Y)(y.Ex,{colorScheme:"danger",localizationKey:(0,c.G)("badge__requiresAction")})]})})]},n.id)},en=e=>{var r;let{account:t}=e,{provider:l,enterpriseConnection:n}=t,o=l.replace(/(oauth_|saml_)/,"").trim(),a=null!=(r=null==n?void 0:n.name)?r:o,s={elementDescriptor:[S.$z.providerIcon],alt:a,sx:e=>({width:e.sizes.$4}),elementId:S.$z.enterpriseButtonsProviderIcon.setId(t.provider)};return(null==n?void 0:n.logoPublicUrl)?(0,i.Y)(y._V,{...s,src:n.logoPublicUrl}):(0,i.Y)(w.T,{id:o,value:a,"aria-label":"".concat(a,"'s icon"),elementDescriptor:[S.$z.providerIcon,S.$z.providerInitialIcon],elementId:S.$z.providerInitialIcon.setId(o)})};var eo=t(87651),ea=t(52454),es=t(11475),ec=t(23549),ed=t(8640),eu=t(46245),eh=t(1282);let ef=(0,d.dm)(e=>{let{phoneId:r,onSuccess:t,onReset:n}=e,{user:o}=(0,Y.Jd)(),a=l.useRef(null==o?void 0:o.phoneNumbers.find(e=>e.id===r)),s=(0,eu.X)({defaultStep:+!!a.current});return(0,i.FD)(eu.s,{...s.props,children:[(0,i.Y)(em,{resourceRef:a,title:(0,c.G)("userProfile.phoneNumberPage.title"),onSuccess:s.nextStep,onReset:n}),(0,i.Y)(ep,{resourceRef:a,title:(0,c.G)("userProfile.phoneNumberPage.verifyTitle"),onSuccess:t,onReset:n})]})}),em=e=>{var r;let{title:t,onSuccess:l,onReset:n,onUseExistingNumberClick:o,resourceRef:a}=e,s=(0,d.f0)(),{user:u}=(0,Y.Jd)(),h=(0,Y.Wp)((e,r)=>e.createPhoneNumber(r)),f=(0,ed.tJ)("phoneNumber","",{type:"tel",label:(0,c.G)("formFieldLabel__phoneNumber"),isRequired:!0}),m=f.value.length>1&&(null==u?void 0:u.username)!==f.value,p=!!(null==u||null==(r=u.phoneNumbers)?void 0:r.length)&&o,v=async e=>{if(e.preventDefault(),u)return h(u,{phoneNumber:f.value}).then(e=>{a.current=e,l()}).catch(e=>(0,G.H4)(e,[f],s.setError))};return(0,i.Y)(ec.M,{headerTitle:t,gap:1,children:(0,i.FD)(ea.l.Root,{gap:4,onSubmit:v,children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.phoneNumberPage.infoText"),colorScheme:"secondary"}),(0,i.Y)(ea.l.ControlRow,{elementId:f.id,children:(0,i.Y)(ea.l.PhoneInput,{...f.props,autoFocus:!0})}),(0,i.FD)(y.so,{justify:p?"between":"end",children:[p&&(0,i.Y)(y.$n,{variant:"ghost",localizationKey:(0,c.G)("userProfile.mfaPhoneCodePage.backButton"),onClick:o}),(0,i.Y)(es.G,{submitLabel:(0,c.G)("userProfile.formButtonPrimary__add"),isDisabled:!m,onReset:n})]})]})})},ep=e=>{var r,t,l;let{title:n,onSuccess:o,resourceRef:a,onReset:s}=e;return(0,i.Y)(ec.M,{headerTitle:n,headerSubtitle:(0,c.G)("userProfile.phoneNumberPage.verifySubtitle",{identifier:(null==(r=a.current)?void 0:r.phoneNumber)||""}),children:(0,i.Y)(eh.j,{nextStep:o,identification:a.current,identifier:null==(t=a.current)?void 0:t.phoneNumber,prepareVerification:null==(l=a.current)?void 0:l.prepareVerification,onReset:s})})},ev=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(E,{onSuccess:r,onReset:r,...e})},eg=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(ef,{onSuccess:r,onReset:r,...e})},eY=e=>{var r;let{shouldAllowCreation:t=!0}=e,{user:n}=(0,Y.Jd)(),o=!!(null==n||null==(r=n.phoneNumbers)?void 0:r.length);return t||o?(0,i.Y)(D.rd.Root,{centered:!1,title:(0,c.G)("userProfile.start.phoneNumbersSection.title"),id:"phoneNumbers",children:(0,i.Y)(C.r.Root,{children:(0,i.FD)(D.rd.ItemList,{id:"phoneNumbers",children:[Z(null==n?void 0:n.phoneNumbers,null==n?void 0:n.primaryPhoneNumberId).map(e=>{let r=e.id;return(0,i.FD)(l.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"phoneNumbers",children:[(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:2,center:!0,children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),children:(0,eo.Om)(e.phoneNumber)}),(null==n?void 0:n.primaryPhoneNumberId)===r&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__unverified")})]})}),(0,i.Y)(eP,{phone:e})]}),(0,i.Y)(C.r.Open,{value:"remove-".concat(r),children:(0,i.Y)(C.r.Card,{variant:"destructive",children:(0,i.Y)(ev,{phoneId:r})})}),(0,i.Y)(C.r.Open,{value:"verify-".concat(r),children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(eg,{phoneId:r})})})]},r)}),t&&(0,i.FD)(i.FK,{children:[(0,i.Y)(C.r.Trigger,{value:"add",children:(0,i.Y)(D.rd.ArrowButton,{id:"phoneNumbers",localizationKey:(0,c.G)("userProfile.start.phoneNumbersSection.primaryButton")})}),(0,i.Y)(C.r.Open,{value:"add",children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(eg,{})})})]})]})})}):null},eP=e=>{let{phone:r}=e,t=(0,d.f0)(),{open:l}=(0,F.D5)(),{user:n}=(0,Y.Jd)(),o=r.id,a=(0,Y.Wp)(e=>e.update({primaryPhoneNumberId:r.id}));if(!n)return null;let s=n.primaryPhoneNumberId===r.id,u="verified"===r.verification.status,h=[s&&!u?{label:(0,c.G)("userProfile.start.phoneNumbersSection.detailsAction__primary"),onClick:()=>l("verify-".concat(o))}:null,!s&&u?{label:(0,c.G)("userProfile.start.phoneNumbersSection.detailsAction__nonPrimary"),onClick:()=>a(n).catch(e=>(0,G.H4)(e,[],t.setError))}:null,!s&&!u?{label:(0,c.G)("userProfile.start.phoneNumbersSection.detailsAction__unverified"),onClick:()=>l("verify-".concat(o))}:null,{label:(0,c.G)("userProfile.start.phoneNumbersSection.destructiveAction"),isDestructive:!0,onClick:()=>l("remove-".concat(o))}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:h})};var eb=t(37591),ey=t(94557),eS=t(10078);let e_=(0,d.dm)(e=>{var r;let{onSuccess:t,onReset:l}=e,{user:n}=(0,Y.Jd)(),o=(0,Y.Wp)(e=>null==n?void 0:n.update({username:e})),{userSettings:a}=(0,g.O)(),s=(0,d.f0)(),{t:u,locale:h}=(0,eS._)(),{usernameSettings:f}=a,m=(0,ed.tJ)("username",(null==n?void 0:n.username)||"",{type:"text",label:(0,c.G)("formFieldLabel__username"),placeholder:(0,c.G)("formFieldInputPlaceholder__username"),buildErrorMessage:e=>(0,ey.Z)(e,{t:u,locale:h,usernameSettings:f})});if(!n)return null;let p=null==(r=a.attributes.username)?void 0:r.required,v=(!p||m.value.length>0)&&n.username!==m.value,P=async()=>{try{await o(m.value),t()}catch(e){(0,G.H4)(e,[m],s.setError)}};return(0,i.Y)(ec.M,{headerTitle:n.username?(0,c.G)("userProfile.usernamePage.title__update"):(0,c.G)("userProfile.usernamePage.title__set"),children:(0,i.FD)(ea.l.Root,{onSubmit:P,children:[(0,i.Y)(ea.l.ControlRow,{elementId:m.id,children:(0,i.Y)(ea.l.PlainInput,{...m.props,autoFocus:!0,isRequired:p})}),(0,i.Y)(es.G,{isDisabled:!v,onReset:l})]})})}),eD=()=>{let{close:e}=(0,F.D5)();return(0,i.Y)(e_,{onSuccess:e,onReset:e})},eR=()=>{let{user:e}=(0,Y.Jd)();return e?(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.usernameSection.title"),id:"username",sx:{alignItems:"center",[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(C.r.Root,{children:[(0,i.Y)(C.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"username",sx:{paddingLeft:e.username?void 0:"0"},children:[e.username&&(0,i.Y)(y.EY,{truncate:!0,sx:e=>({color:e.colors.$colorForeground}),children:e.username}),(0,i.Y)(C.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"username",localizationKey:e.username?(0,c.G)("userProfile.start.usernameSection.primaryButton__updateUsername"):(0,c.G)("userProfile.start.usernameSection.primaryButton__setUsername")})})]})}),(0,i.Y)(C.r.Open,{value:"edit",children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(eD,{})})})]})}):null};var eG=t(29345);t(89305);var ew=t(62421),eC=t(80396),eF=t(63817),eI=t(99538);let ek=e=>{let{user:r,...t}=e;return(0,i.Y)(eF.k,{...t,title:(0,c.G)("userProfile.profilePage.imageFormTitle"),avatarPreview:(0,i.Y)(eI.H,{size:e=>e.sizes.$12,...r})})},ex=(0,d.dm)(e=>{let{onSuccess:r,onReset:t}=e,l=(0,d.f0)(),{user:n}=(0,Y.Jd)();if(!n)return null;let{first_name:o,last_name:a}=(0,g.O)().userSettings.attributes,s=null==o?void 0:o.enabled,u=null==a?void 0:a.enabled,h=n.firstName||"",f=n.lastName||"",m=(0,ed.tJ)("firstName",n.firstName||"",{type:"text",label:(0,c.G)("formFieldLabel__firstName"),placeholder:(0,c.G)("formFieldInputPlaceholder__firstName"),isRequired:null==a?void 0:a.required}),p=(0,ed.tJ)("lastName",n.lastName||"",{type:"text",label:(0,c.G)("formFieldLabel__lastName"),placeholder:(0,c.G)("formFieldInputPlaceholder__lastName"),isRequired:null==a?void 0:a.required}),v=s&&m.value!==h||u&&p.value!==f,P=s&&o.required||u&&a.required,b=P&&!!p.value&&!!m.value&&v,y=n.enterpriseAccounts.some(e=>e.active),S=async e=>(e.preventDefault(),(v?n.update({firstName:m.value,lastName:p.value}):Promise.resolve()).then(r).catch(e=>{(0,G.H4)(e,[m,p],l.setError)}));return(0,i.FD)(ec.M,{headerTitle:(0,c.G)("userProfile.profilePage.title"),children:[y&&(0,i.Y)(ew.k,{message:(0,c.G)("userProfile.profilePage.readonly")}),(0,i.FD)(ea.l.Root,{onSubmit:S,sx:e=>({gap:e.space.$6}),children:[(0,i.Y)(ek,{user:n,onAvatarChange:e=>n.setProfileImage({file:e}).then(()=>{l.setIdle(),null==r||r()}).catch(e=>(0,G.H4)(e,[],l.setError)),onAvatarRemove:(0,eC.p)(n.imageUrl)?null:()=>{n.setProfileImage({file:null}).then(()=>{l.setIdle(),null==r||r()}).catch(e=>(0,G.H4)(e,[],l.setError))}}),(s||u)&&(0,i.FD)(ea.l.ControlRow,{elementId:"name",children:[s&&(0,i.Y)(ea.l.PlainInput,{...m.props,isDisabled:y,autoFocus:!0}),u&&(0,i.Y)(ea.l.PlainInput,{...p.props,isDisabled:y,autoFocus:!s})]}),(0,i.Y)(es.G,{isDisabled:P?!b:!v,onReset:t})]})]})}),eA=()=>{let{close:e}=(0,F.D5)();return(0,i.Y)(ex,{onSuccess:e,onReset:e})},ez=()=>{let{user:e}=(0,Y.Jd)();if(!e)return null;let{username:r,primaryEmailAddress:t,primaryPhoneNumber:l,primaryWeb3Wallet:n,...o}=e;return(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.profileSection.title"),id:"profile",sx:{[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(C.r.Root,{children:[(0,i.Y)(C.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"profile",children:[(0,i.Y)(eG.c,{user:o,size:"lg",mainIdentifierVariant:"subtitle",sx:e=>({color:e.colors.$colorForeground})}),(0,i.Y)(C.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"profile",localizationKey:(0,c.G)("userProfile.start.profileSection.primaryButton")})})]})}),(0,i.Y)(C.r.Open,{value:"edit",children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(eA,{})})})]})})};t(98114);var eT=t(66463),e$=t(25243),eE=t(73610);let eL=(0,l.lazy)(()=>Promise.all([t.e("545"),t.e("666"),t.e("188")]).then(t.bind(t,66464)).then(e=>({default:e.Web3SolanaWalletButtons}))),eO=e=>{let{onConnect:r}=e,t=(0,d.f0)(),{close:n}=(0,F.D5)(),o=async e=>{let{walletName:i}=e;t.setLoading(i);try{await r({strategy:"web3_solana_signature",walletName:i}),t.setIdle(),n()}catch(e){if(t.setIdle(),e instanceof Error)(0,G.H4)(e,[],t.setError);else{let r=new eE.cR("An error occurred while generating the Solana signature.",{code:"web3_solana_signature_generation_failed",cause:e instanceof Error?e:void 0});(0,G.H4)(r,[],t.setError)}}};return(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.start.web3WalletsSection.web3SelectSolanaWalletScreen.title"),headerSubtitle:(0,c.G)("userProfile.start.web3WalletsSection.web3SelectSolanaWalletScreen.subtitle"),children:(0,i.FD)(ea.l.Root,{children:[(0,i.Y)(l.Suspense,{fallback:(0,i.Y)(y.so,{direction:"row",align:"center",justify:"center",sx:e=>({height:"100%",minHeight:e.sizes.$32}),children:(0,i.Y)(y.y$,{size:"lg",colorScheme:"primary",elementDescriptor:S.$z.spinner})}),children:(0,i.Y)(eL,{web3AuthCallback:o})}),(0,i.Y)(es.c,{children:(0,i.Y)(y.$n,{type:"button",variant:"ghost",onClick:()=>{n()},localizationKey:(0,c.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})})]})})};var eK=t(49236);let eB=()=>{var e,r;let t=(0,d.f0)(),{open:l}=(0,F.D5)(),{user:n}=(0,Y.Jd)(),{strategies:o,strategyToDisplayData:a}=(0,I.k)(),s=(0,e$.R)(),u=o.filter(e=>e.startsWith("web3")),h=null!=(r=null==n||null==(e=n.verifiedWeb3Wallets)?void 0:e.map(e=>e.verification.strategy))?r:[],f=u.filter(e=>!h.includes(e)&&a[e]);if(0===f.length)return null;let m=(0,Y.Wp)(e=>null==n?void 0:n.createWeb3Wallet({web3Wallet:e})),p=async e=>{let{strategy:r,walletName:i}=e,o=(0,eT.U)(s);if("web3_solana_signature"===r&&!i)return void l("web3Wallets");let a=r.replace("web3_","").replace("_signature","");t.setError(void 0);try{t.setLoading(r);let e=await o.getWeb3Identifier({provider:a,walletName:i});if(!n)throw Error("user is not defined");let l=await m(e),s=null==(l=await (null==l?void 0:l.prepareVerification({strategy:r})))?void 0:l.verification.message,c=await o.generateWeb3Signature({identifier:e,nonce:s,provider:a,walletName:i});await (null==l?void 0:l.attemptVerification({signature:c})),t.setIdle()}catch(e){t.setIdle(),(0,eK.f)(e,t.setError)}};return(0,i.FD)(i.FK,{children:[(0,i.Y)(C.r.Closed,{value:"web3Wallets",children:(0,i.Y)(D.rd.ActionMenu,{id:"web3Wallets",triggerLocalizationKey:(0,c.G)("userProfile.start.web3WalletsSection.primaryButton"),children:f.map(e=>(0,i.Y)(D.rd.ActionMenuItem,{id:a[e].id,onClick:()=>{p({strategy:e})},isLoading:t.loadingMetadata===e,isDisabled:t.isLoading,localizationKey:(0,c.G)("userProfile.web3WalletPage.web3WalletButtonsBlockButton",{provider:a[e].name}),sx:e=>({justifyContent:"start",gap:e.space.$2}),leftIcon:(0,i.Y)(y._V,{elementDescriptor:S.$z.providerIcon,elementId:S.$z.providerIcon.setId(a[e].id),isLoading:t.loadingMetadata===e,isDisabled:t.isLoading,src:a[e].iconUrl,alt:"Connect ".concat(a[e].name),sx:e=>({width:e.sizes.$5})})},e))})}),(0,i.Y)(C.r.Open,{value:"web3Wallets",children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(eO,{onConnect:p})})})]})},eW=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(O,{onSuccess:r,onReset:r,...e})},eM=(0,d.dm)(e=>{var r;let{shouldAllowCreation:t=!0}=e,{user:n}=(0,Y.Jd)(),o=(0,d.f0)(),{strategyToDisplayData:a}=(0,I.k)(),s=!!(null==n||null==(r=n.web3Wallets)?void 0:r.length),[u,h]=(0,l.useState)(null);return t||s?(0,i.FD)(D.rd.Root,{title:(0,c.G)("userProfile.start.web3WalletsSection.title"),centered:!1,id:"web3Wallets",children:[(0,i.Y)(P.Z.Alert,{children:o.error}),(0,i.FD)(C.r.Root,{value:u,onChange:h,children:[(0,i.Y)(D.rd.ItemList,{id:"web3Wallets",children:Z(null==n?void 0:n.web3Wallets,null==n?void 0:n.primaryWeb3WalletId).map(e=>{var r;let t=e.verification.strategy,o=e.id;return a[t]&&(0,i.FD)(l.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"web3Wallets",align:"start",children:[(0,i.FD)(y.so,{sx:e=>({alignItems:"center",gap:e.space.$2,width:"100%"}),children:[a[t].iconUrl&&(0,i.Y)(y._V,{src:a[t].iconUrl,alt:a[t].name,sx:e=>({width:e.sizes.$4})}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:2,justify:"start",children:[(0,i.FD)(y.EY,{children:[a[t].name," (",(r=e.web3Wallet).length<=10?r:r.slice(0,6)+"..."+r.slice(-4),")"]}),(null==n?void 0:n.primaryWeb3WalletId)===o&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__unverified")})]})})]}),(0,i.Y)(eN,{walletId:o,isVerified:"verified"===e.verification.status})]},o),(0,i.Y)(C.r.Open,{value:"remove-".concat(o),children:(0,i.Y)(C.r.Card,{variant:"destructive",children:(0,i.Y)(eW,{walletId:e.id})})})]},e.id)})}),t&&(0,i.Y)(eB,{})]})]}):null}),eN=e=>{let{walletId:r,isVerified:t}=e,l=(0,d.f0)(),{open:n}=(0,F.D5)(),{user:o}=(0,Y.Jd)(),a=(null==o?void 0:o.primaryWeb3WalletId)===r,s=(0,Y.Wp)(()=>null==o?void 0:o.update({primaryWeb3WalletId:r})),u=[!a&&t?{label:(0,c.G)("userProfile.start.web3WalletsSection.detailsAction__nonPrimary"),onClick:()=>{s().catch(e=>(0,G.H4)(e,[],l.setError))}}:null,{label:(0,c.G)("userProfile.start.web3WalletsSection.destructiveAction"),isDestructive:!0,onClick:()=>n("remove-".concat(r))}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:u})},eJ=(0,d.dm)(()=>{var e,r,t,l;let{attributes:n,social:o,enterpriseSSO:s}=(0,g.O)().userSettings,u=(0,d.f0)(),{user:h}=(0,Y.Jd)(),{shouldAllowIdentificationCreation:f}=(0,a.B)(),m=null==(e=n.username)?void 0:e.enabled,p=null==(r=n.email_address)?void 0:r.enabled,v=null==(t=n.phone_number)?void 0:t.enabled,_=o&&Object.values(o).filter(e=>e.enabled).length>0,D=h&&s.enabled,R=null==(l=n.web3_wallet)?void 0:l.enabled;return(0,i.Y)(y.fv,{elementDescriptor:S.$z.page,sx:e=>({gap:e.space.$8,color:e.colors.$colorForeground}),children:(0,i.FD)(y.fv,{elementDescriptor:S.$z.profilePage,elementId:S.$z.profilePage.setId("account"),children:[(0,i.Y)(b.Y.Root,{children:(0,i.Y)(b.Y.Title,{localizationKey:(0,c.G)("userProfile.start.headerTitle__account"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,i.Y)(P.Z.Alert,{children:u.error}),(0,i.Y)(ez,{}),m&&(0,i.Y)(eR,{}),p&&(0,i.Y)(er,{shouldAllowCreation:f}),v&&(0,i.Y)(eY,{shouldAllowCreation:f}),_&&(0,i.Y)(J,{shouldAllowCreation:f}),D&&(0,i.Y)(ei,{}),R&&(0,i.Y)(eM,{shouldAllowCreation:f})]})})});t(1589);var eq=t(12611),eU=t(97806),ej=t(67896),eH=t(84901),eV=t(50892),eZ=t(36529);let eX=()=>{let e,{user:r}=(0,Y.Jd)(),{session:t}=(0,Y.wV)(),{data:l,isLoading:n}=(0,ej.s)(null==r?void 0:r.getSessions,"user-sessions");return(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.activeDevicesSection.title"),centered:!1,id:"activeDevices",children:(0,i.Y)(D.rd.ItemList,{id:"activeDevices",disableAnimation:!0,children:n?(0,i.Y)(eq.K,{}):null==l?void 0:l.sort((e=t.id,r=>r.id===e?-1:1)).map(e=>eQ(e.status)?(0,i.Y)(e0,{session:e},e.id):null)})})},eQ=e=>["active","pending"].includes(e),e0=e=>{var r;let{session:t}=e,l=(null==(r=(0,Y.wV)().session)?void 0:r.id)===t.id,n=(0,eH.m)(),o=(0,Y.Wp)(t.revoke.bind(t)),a=async()=>{if(!l&&t)return n.setLoading(),o().catch(e=>(0,G.H4)(e,[],n.setError)).finally(()=>n.setIdle())};return(0,i.Y)(D.rd.Item,{id:"activeDevices",elementDescriptor:S.$z.activeDeviceListItem,elementId:l?S.$z.activeDeviceListItem.setId("current"):void 0,sx:{alignItems:"flex-start",opacity:n.isLoading?.5:1},isDisabled:n.isLoading,children:(0,i.FD)(i.FK,{children:[(0,i.Y)(e1,{session:t}),!l&&(0,i.Y)(e2,{revoke:a})]})})},e1=e=>{let{session:r}=(0,Y.wV)(),t=(null==r?void 0:r.id)===e.session.id,l=!!(null==r?void 0:r.actor),n=!!e.session.actor,{city:o,country:a,browserName:s,browserVersion:d,deviceType:u,ipAddress:h,isMobile:f}=e.session.latestActivity,m="".concat(s||""," ").concat(d||"").trim()||"Web browser",p=[o||"",a||""].filter(Boolean).join(", ").trim()||null,{t:v}=(0,eS._)();return(0,i.FD)(y.so,{elementDescriptor:S.$z.activeDevice,elementId:t?S.$z.activeDevice.setId("current"):void 0,sx:e=>({width:"100%",overflow:"hidden",gap:e.space.$4,[eb.g.sm]:{gap:e.space.$2}}),children:[(0,i.Y)(y.so,{sx:e=>({[eb.g.sm]:{padding:"0"},borderRadius:e.radii.$md}),children:(0,i.Y)(y.In,{elementDescriptor:S.$z.activeDeviceIcon,elementId:S.$z.activeDeviceIcon.setId(f?"mobile":"desktop"),icon:f?eV.A:eZ.A,sx:e=>({"--cl-chassis-bottom":"#444444","--cl-chassis-back":"#343434","--cl-chassis-screen":"#575757","--cl-screen":"#000000",width:e.space.$8,height:e.space.$8})})}),(0,i.FD)(y.fv,{align:"start",gap:1,children:[(0,i.FD)(y.so,{center:!0,gap:2,children:[(0,i.Y)(y.EY,{children:u||(f?"Mobile device":"Desktop device")}),t&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__thisDevice"),colorScheme:l?"danger":"primary"}),l&&!n&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__userDevice")}),!t&&n&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__otherImpersonatorDevice"),colorScheme:"danger"})]}),(0,i.Y)(y.EY,{colorScheme:"secondary",children:m}),(0,i.FD)(y.EY,{colorScheme:"secondary",children:[h," (",p,")"]}),(0,i.Y)(y.EY,{colorScheme:"secondary",children:v((0,eU.T)(e.session.lastActiveAt))})]})]})},e2=e=>{let{revoke:r}=e,t=[{label:(0,c.G)("userProfile.start.activeDevicesSection.destructiveAction"),isDestructive:!0,onClick:r}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:t})};var e5=t(49599),e4=t(38691);let e3=(0,d.dm)(e=>{let{onReset:r}=e,t=(0,d.f0)(),{afterSignOutUrl:l,afterMultiSessionSingleSignOutUrl:n}=(0,e5.g)(),{user:o}=(0,Y.Jd)(),{t:a}=(0,eS._)(),{otherSessions:s}=(0,e4.z)({user:o}),{setActive:u}=(0,Y.ho)(),h=(0,Y.Wp)(()=>null==o?void 0:o.delete()),f=(0,ed.tJ)("deleteConfirmation","",{type:"text",label:(0,c.G)("userProfile.deletePage.actionDescription"),isRequired:!0,placeholder:(0,c.G)("formFieldInputPlaceholder__confirmDeletionUserAccount")}),m=f.value===(a((0,c.G)("formFieldInputPlaceholder__confirmDeletionUserAccount"))||"Delete account"),p=async()=>{if(m)try{await h();let e=0===s.length?l:n;return await u({session:null,redirectUrl:e})}catch(e){(0,G.H4)(e,[],t.setError)}};return(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.deletePage.title"),sx:e=>({gap:e.space.$0x5}),children:(0,i.FD)(ea.l.Root,{onSubmit:p,children:[(0,i.FD)(y.fv,{gap:1,children:[(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,c.G)("userProfile.deletePage.messageLine1")}),(0,i.Y)(y.EY,{colorScheme:"danger",localizationKey:(0,c.G)("userProfile.deletePage.messageLine2")})]}),(0,i.Y)(ea.l.ControlRow,{elementId:f.id,children:(0,i.Y)(ea.l.PlainInput,{...f.props,ignorePasswordManager:!0})}),(0,i.Y)(es.G,{submitLabel:(0,c.G)("userProfile.deletePage.confirm"),colorScheme:"danger",isDisabled:!m,onReset:r})]})})}),e6=()=>{let{close:e}=(0,F.D5)();return(0,i.Y)(e3,{onSuccess:e,onReset:e})},e9=()=>(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.dangerSection.title"),id:"danger",sx:{alignItems:"center",[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(C.r.Root,{children:[(0,i.Y)(C.r.Closed,{value:"delete",children:(0,i.Y)(D.rd.Item,{id:"danger",sx:e=>({paddingLeft:e.space.$1}),children:(0,i.Y)(C.r.Trigger,{value:"delete",children:(0,i.Y)(D.rd.Button,{id:"danger",variant:"ghost",colorScheme:"danger",localizationKey:(0,c.G)("userProfile.start.dangerSection.deleteAccountButton")})})})}),(0,i.Y)(C.r.Open,{value:"delete",children:(0,i.Y)(C.r.Card,{variant:"destructive",children:(0,i.Y)(e6,{})})})]})});var e8=t(11323),e7=t(15079),re=t(16103),rr=t(2534);t(64178),t(60962),t(60486),t(25089),t(61244),t(77895);var rt=t(8095),ri=t(99126),rl=t(27782),rn=t(48691),ro=t(75976),ra=t(92405),rs=t(42852);let rc=e=>{let{code:r}=e;return(0,i.Y)(y.so,{center:!0,sx:e=>({padding:"".concat(e.space.$1," ").concat(e.space.$4)}),children:(0,i.Y)(y.EY,{children:r})})},rd=e=>{let{subtitle:r,backupCodes:t}=e,{applicationName:l}=(0,g.O)().displayConfig,{user:n}=(0,Y.Jd)(),{print:o,printableProps:a}=(0,ri.h)(),{onCopy:s,hasCopied:d}=(0,rl.i)((null==t?void 0:t.join(","))||"");if(!n)return null;let u=(0,rt.Cm)(n);return t?(0,i.FD)(i.FK,{children:[(0,i.FD)(y.fv,{gap:1,children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.backupCodePage.title__codelist"),variant:"subtitle"}),(0,i.Y)(y.EY,{localizationKey:r,variant:"caption",colorScheme:"secondary"})]}),(0,i.FD)(y.az,{sx:e=>({borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg}),children:[(0,i.Y)(y.xA,{gap:2,sx:e=>({gridTemplateColumns:"repeat(2, minmax(".concat(e.sizes.$12,", 1fr))"),padding:"".concat(e.space.$4," ").concat(e.space.$6)}),children:t.map((e,r)=>(0,i.Y)(rc,{code:e},r))}),(0,i.FD)(y.xA,{sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,gridTemplateColumns:"repeat(3, minmax(0, 1fr))",">:not([hidden])~:not([hidden])":{borderRightWidth:"0px",borderLeftWidth:"1px",borderStyle:"solid",borderColor:e.colors.$borderAlpha100},">:first-child":{borderBottomLeftRadius:e.radii.$lg},">:last-child":{borderBottomRightRadius:e.radii.$lg}}),children:[(0,i.Y)(y.$n,{variant:"ghost",sx:e=>({width:"100%",padding:"".concat(e.space.$2," 0"),borderRadius:0}),onClick:()=>{var e,r,i;let n,o=document.createElement("a"),a=new Blob([(e=t,r=l,i=u,n=null==e?void 0:e.join("\n"),"These are your backup codes for ".concat(r," account ").concat(i,".\nStore them securely and keep them secret. Each code can only be used once.\n\n").concat(n))],{type:"text/plain"});o.href=URL.createObjectURL(a),o.download="".concat(l,"_backup_codes.txt"),document.body.appendChild(o),o.click()},children:(0,i.Y)(y.In,{icon:rn.A})}),(0,i.Y)(y.$n,{variant:"ghost",sx:e=>({width:"100%",padding:"".concat(e.space.$2," 0"),borderRadius:0}),onClick:o,children:(0,i.Y)(y.In,{icon:ro.A})}),(0,i.Y)(y.$n,{variant:"ghost",onClick:s,sx:e=>({width:"100%",padding:"".concat(e.space.$2," 0"),borderRadius:0}),children:(0,i.Y)(y.In,{icon:d?ra.A:rs.A})})]})]}),(0,i.FD)(ri.L,{...a,children:[(0,i.FD)(y.DZ,{children:["Your backup codes for ",l," account ",u,":"]}),(0,i.Y)(y.fv,{gap:2,children:t.map((e,r)=>(0,i.Y)(rc,{code:e},r))})]})]}):null},ru=(0,d.dm)(e=>{let{onSuccess:r,onReset:t}=e,{user:n}=(0,Y.Jd)(),o=(0,d.f0)(),a=(0,Y.Wp)(()=>null==n?void 0:n.createBackupCode()),[s,u]=l.useState(void 0);return(l.useEffect(()=>{!s&&n&&a().then(e=>u(e)).catch(e=>{if((0,eE.I3)(e))return t();(0,G.H4)(e,[],o.setError)})},[]),o.error)?(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.backupCodePage.title")}):(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.backupCodePage.title"),children:s?(0,i.FD)(i.FK,{children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.backupCodePage.successMessage")}),(0,i.Y)(rd,{subtitle:(0,c.G)("userProfile.backupCodePage.subtitle__codelist"),backupCodes:s.codes}),(0,i.Y)(es.c,{children:(0,i.Y)(y.$n,{autoFocus:!0,onClick:r,localizationKey:(0,c.G)("userProfile.formButtonPrimary__finish"),elementDescriptor:S.$z.formButtonPrimary})})]}):(0,i.Y)(eq.K,{})})}),rh=(0,d.dm)(e=>{let{onSuccess:r,onReset:t}=e,l=(0,eu.X)();return(0,i.FD)(eu.s,{...l.props,children:[(0,i.Y)(rf,{onContinue:l.nextStep}),(0,i.Y)(ru,{onSuccess:r,onReset:t})]})}),rf=e=>{let{onContinue:r}=e,{close:t}=(0,F.D5)();return(0,i.FD)(ec.M,{headerTitle:(0,c.G)("userProfile.backupCodePage.title"),children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.backupCodePage.infoText1")}),(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.backupCodePage.infoText2")}),(0,i.FD)(es.c,{sx:{marginTop:0},children:[(0,i.Y)(y.$n,{textVariant:"buttonSmall",onClick:r,localizationKey:(0,c.G)("userProfile.formButtonPrimary__finish"),elementDescriptor:S.$z.formButtonPrimary}),(0,i.Y)(y.$n,{variant:"ghost",onClick:t,localizationKey:(0,c.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})]})]})};var rm=t(50155),rp=t(26370),rv=t(9679);let rg=(0,d.dm)(e=>{var r,t,n,o;let{onReset:a,onSuccess:s}=e,d=l.useRef(),u=(0,eu.X)({defaultStep:2}),h=null==(r=(0,g.O)().userSettings.attributes.backup_code)?void 0:r.enabled;return(0,i.FD)(eu.s,{...u.props,children:[(0,i.Y)(em,{title:(0,c.G)("userProfile.phoneNumberPage.title"),resourceRef:d,onSuccess:u.nextStep,onUseExistingNumberClick:()=>u.goToStep(2),onReset:a}),(0,i.Y)(rP,{title:(0,c.G)("userProfile.mfaPhoneCodePage.title"),resourceRef:d,onSuccess:()=>h?u.goToStep(3):s(),onReset:()=>u.goToStep(2)}),(0,i.Y)(rb,{onSuccess:h?u.nextStep:s,onReset:a,onAddPhoneClick:()=>u.goToStep(0),onUnverifiedPhoneClick:e=>{d.current=e,u.goToStep(1)},title:(0,c.G)("userProfile.mfaPhoneCodePage.title"),resourceRef:d}),h&&(0,i.Y)(rp.B,{title:(0,c.G)("userProfile.mfaPhoneCodePage.successTitle"),text:(null==(t=d.current)?void 0:t.backupCodes)&&(null==(n=d.current)?void 0:n.backupCodes.length)>0?[(0,c.G)("userProfile.mfaPhoneCodePage.successMessage1"),(0,c.G)("userProfile.mfaPhoneCodePage.successMessage2")]:[(0,c.G)("userProfile.mfaPhoneCodePage.successMessage1")],onFinish:a,contents:(0,i.Y)(rd,{backupCodes:null==(o=d.current)?void 0:o.backupCodes})})]})}),rY=e=>{let{phone:r,onSuccess:t,onUnverifiedPhoneClick:l,resourceRef:n}=e,o=(0,d.f0)(),a=(0,Y.Wp)(()=>r.setReservedForSecondFactor({reserved:!0})),{country:s}=(0,eo.Mz)(r.phoneNumber),c=(0,eo.Om)(r.phoneNumber),u=async()=>{if("verified"!==r.verification.status)return l(r);o.setLoading(r.id);try{await a(),n.current=r,t()}catch(e){(0,G.H4)(e,[],o.setError)}finally{o.setIdle()}};return(0,i.FD)(y.$n,{variant:"outline",colorScheme:"neutral",sx:{justifyContent:"start"},onClick:u,isLoading:o.loadingMetadata===r.id,isDisabled:o.isLoading,children:[s.iso.toUpperCase()," ",c]},r.id)},rP=e=>{var r,t,l;let{title:n,onSuccess:o,resourceRef:a,onReset:s}=e,u=(0,d.f0)(),h=a.current,f=(0,Y.Wp)(()=>null==h?void 0:h.setReservedForSecondFactor({reserved:!0})),m=async()=>{u.setLoading(null==h?void 0:h.id);try{await f(),a.current=h,o()}catch(e){(0,G.H4)(e,[],u.setError)}finally{u.setIdle()}};return(0,i.Y)(ec.M,{headerTitle:n,headerSubtitle:(0,c.G)("userProfile.phoneNumberPage.verifySubtitle",{identifier:(null==(r=a.current)?void 0:r.phoneNumber)||""}),children:(0,i.Y)(eh.j,{nextStep:()=>{m()},identification:a.current,identifier:null==(t=a.current)?void 0:t.phoneNumber,prepareVerification:null==(l=a.current)?void 0:l.prepareVerification,onReset:s})})},rb=e=>{let{onSuccess:r,onReset:t,title:l,onAddPhoneClick:n,onUnverifiedPhoneClick:o,resourceRef:a}=e,{user:s}=(0,Y.Jd)();if(!s)return null;let d=s.phoneNumbers.filter(e=>!e.reservedForSecondFactor);return(0,i.FD)(ec.M,{headerTitle:l,gap:1,children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)(d.length?"userProfile.mfaPhoneCodePage.subtitle__availablePhoneNumbers":"userProfile.mfaPhoneCodePage.subtitle__unavailablePhoneNumbers"),colorScheme:"secondary"}),d.length>0&&(0,i.Y)(y.fv,{gap:2,children:d.map(e=>(0,i.Y)(rY,{onSuccess:r,phone:e,onUnverifiedPhoneClick:o,resourceRef:a},e.id))}),(0,i.FD)(es.c,{sx:{flexDirection:"row",justifyContent:"space-between"},children:[(0,i.Y)(rm.K,{variant:"ghost","aria-label":"Add phone number",icon:(0,i.Y)(y.In,{icon:rv.A,sx:e=>({marginRight:e.space.$2})}),localizationKey:(0,c.G)("userProfile.mfaPhoneCodePage.primaryButton__addPhoneNumber"),onClick:n}),(0,i.Y)(y.$n,{variant:"ghost",localizationKey:(0,c.G)("userProfile.formButtonReset"),onClick:t})]})]})};var ry=t(95559),rS=t(2094);let r_=(0,d.dm)(e=>{let{title:r,onSuccess:t,onReset:n}=e,{user:o}=(0,Y.Jd)(),a=(0,d.f0)(),s=(0,Y.Wp)(()=>null==o?void 0:o.createTOTP()),{close:u}=(0,F.D5)(),[h,f]=l.useState(void 0),[m,p]=l.useState("qr");return(l.useEffect(()=>{o&&s().then(e=>f(e)).catch(e=>(0,eE.Cm)(e)&&"reverification_cancelled"===e.code?u():(0,G.H4)(e,[],a.setError))},[]),a.error)?(0,i.Y)(ec.M,{headerTitle:r}):(0,i.FD)(ec.M,{headerTitle:r,headerSubtitle:"qr"==m?(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.infoText__ableToScan"):(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.infoText__unableToScan"),children:[!h&&(0,i.Y)(eq.K,{}),h&&(0,i.FD)(i.FK,{children:[(0,i.FD)(y.fv,{gap:4,children:["qr"==m&&(0,i.Y)(rS.r,{justify:"center",url:h.uri||""}),"uri"==m&&(0,i.FD)(i.FK,{children:[(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.inputLabel__unableToScan1")}),(0,i.Y)(ry.r,{value:h.secret}),(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.inputLabel__unableToScan2")}),(0,i.Y)(ry.r,{value:h.uri})]})]}),(0,i.FD)(y.so,{justify:"between",align:"center",sx:{width:"100%"},children:["qr"==m&&(0,i.Y)(y.$n,{variant:"link",textVariant:"buttonLarge",onClick:()=>p("uri"),localizationKey:(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.buttonUnableToScan__nonPrimary")}),"uri"==m&&(0,i.Y)(y.$n,{variant:"link",textVariant:"buttonLarge",onClick:()=>p("qr"),localizationKey:(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.buttonAbleToScan__nonPrimary")}),(0,i.FD)(es.c,{children:[(0,i.Y)(y.$n,{onClick:t,localizationKey:(0,c.G)("userProfile.formButtonPrimary__continue"),elementDescriptor:S.$z.formButtonPrimary}),(0,i.Y)(y.$n,{variant:"ghost",onClick:n,localizationKey:(0,c.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})]})]})]})]})});var rD=t(63356);let rR=(0,d.dm)(e=>{let{onSuccess:r,onReset:t,resourceRef:l}=e,{user:n}=(0,Y.Jd)(),o=(0,rD.xM)({onCodeEntryFinished:(e,r,t)=>{null==n||n.verifyTOTP({code:e}).then(e=>r(e)).catch(t)},onResolve:e=>{l.current=e,r()}});return(0,i.FD)(ec.M,{headerTitle:(0,c.G)("userProfile.mfaTOTPPage.title"),children:[(0,i.Y)(y.fv,{children:(0,i.Y)(ea.l.OTPInput,{...o,label:(0,c.G)("userProfile.mfaTOTPPage.verifyTitle"),description:(0,c.G)("userProfile.mfaTOTPPage.verifySubtitle")})}),(0,i.Y)(es.c,{sx:{marginTop:0},children:(0,i.Y)(y.$n,{onClick:t,variant:"ghost",isDisabled:o.isLoading,localizationKey:(0,c.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})})]})}),rG=(0,d.dm)(e=>{var r;let{onReset:t}=e,n=(0,eu.X)(),o=l.useRef();return(0,i.FD)(eu.s,{...n.props,children:[(0,i.Y)(r_,{title:(0,c.G)("userProfile.mfaTOTPPage.title"),onSuccess:n.nextStep,onReset:t}),(0,i.Y)(rR,{onSuccess:n.nextStep,onReset:t,resourceRef:o}),(0,i.Y)(rp.B,{title:(0,c.G)("userProfile.mfaTOTPPage.title"),text:(0,c.G)("userProfile.mfaTOTPPage.successMessage"),onFinish:t,contents:(0,i.Y)(rd,{subtitle:(0,c.G)("userProfile.backupCodePage.successSubtitle"),backupCodes:null==(r=o.current)?void 0:r.backupCodes})})]})}),rw=(0,d.dm)(e=>{let{onSuccess:r,onReset:t,selectedStrategy:n}=e,o=(0,d.f0)(),{userSettings:{attributes:a}}=(0,g.O)(),{user:s}=(0,Y.Jd)();if(!s)return null;let u=(0,c.G)("userProfile.mfaPage.title"),h=l.useMemo(()=>V(a,s),[]);return(l.useEffect(()=>{0===h.length&&o.setError("There are no second factors available to add")},[]),o.error)?(0,i.Y)(ec.M,{headerTitle:u}):0!==h.length||n?(0,i.Y)(rC,{onSuccess:r,onReset:t,method:n||h[0]}):null}),rC=e=>{let{method:r,onSuccess:t,onReset:l}=e;switch(r){case"phone_code":return(0,i.Y)(rg,{onSuccess:t,onReset:l});case"totp":return(0,i.Y)(rG,{onSuccess:t,onReset:l});case"backup_code":return(0,i.Y)(rh,{onSuccess:t,onReset:l});default:return null}},rF=()=>{let{close:e}=(0,F.D5)();return(0,i.Y)(B,{onSuccess:e,onReset:e})},rI=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(K,{onSuccess:r,onReset:r,...e})},rk=()=>{let{close:e}=(0,F.D5)();return(0,i.Y)(ru,{onSuccess:e,onReset:e})},rx=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(rw,{onSuccess:r,onReset:r,selectedStrategy:e.selectedStrategy})},rA=()=>{let{userSettings:{attributes:e}}=(0,g.O)(),{user:r}=(0,Y.Jd)(),[t,n]=(0,l.useState)(null);if(!r)return null;let o=H(e),a=V(e,r),s=o.includes("totp")&&r.totpEnabled,d=o.includes("backup_code")&&r.backupCodeEnabled,u=r.phoneNumbers.filter(e=>"verified"===e.verification.status).filter(e=>e.reservedForSecondFactor).sort(j);return(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.mfaSection.title"),centered:!1,id:"mfa",children:(0,i.Y)(C.r.Root,{value:t,onChange:n,children:(0,i.FD)(D.rd.ItemList,{id:"mfa",children:[s&&(0,i.FD)(i.FK,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:e7.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.start.mfaSection.totp.headerTitle")}),(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__default")})]}),(0,i.Y)(r$,{})]}),(0,i.Y)(C.r.Open,{value:"remove-totp",children:(0,i.Y)(C.r.Card,{variant:"destructive",children:(0,i.Y)(rF,{})})})]}),o.includes("phone_code")&&u.map(e=>{let r=!s&&e.defaultSecondFactor,t=e.id;return(0,i.FD)(l.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:re.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.FD)(y.EY,{children:["SMS Code ",(0,i.Y)(e8.R,{value:e.phoneNumber})]}),r&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__default")})]}),(0,i.Y)(rz,{phone:e,showTOTP:s})]}),(0,i.Y)(C.r.Open,{value:"remove-".concat(t),children:(0,i.Y)(C.r.Card,{variant:"destructive",children:(0,i.Y)(rI,{phoneId:t})})})]},t)}),d&&(0,i.FD)(i.FK,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:rr.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.start.mfaSection.backupCodes.headerTitle")})]}),(0,i.Y)(rT,{})]}),(0,i.Y)(C.r.Open,{value:"regenerate",children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(rk,{})})})]}),(0,i.Y)(rE,{secondFactorsAvailableToAdd:a,onClick:()=>n(null)})]})})})},rz=e=>{let{phone:r,showTOTP:t}=e,{open:l}=(0,F.D5)(),n=(0,d.f0)(),o=r.id,a=[!t&&!r.defaultSecondFactor?{label:(0,c.G)("userProfile.start.mfaSection.phoneCode.actionLabel__setDefault"),onClick:()=>r.makeDefaultSecondFactor().catch(e=>(0,G.H4)(e,[],n.setError))}:null,{label:(0,c.G)("userProfile.start.mfaSection.phoneCode.destructiveActionLabel"),isDestructive:!0,onClick:()=>l("remove-".concat(o))}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:a})},rT=()=>{let{open:e}=(0,F.D5)(),r=[{label:(0,c.G)("userProfile.start.mfaSection.backupCodes.actionLabel__regenerate"),onClick:()=>e("regenerate")}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:r})},r$=()=>{let{open:e}=(0,F.D5)(),r=[{label:(0,c.G)("userProfile.start.mfaSection.totp.destructiveActionTitle"),isDestructive:!0,onClick:()=>e("remove-totp")}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:r})},rE=e=>{let{open:r}=(0,F.D5)(),{secondFactorsAvailableToAdd:t,onClick:n}=e,[o,a]=(0,l.useState)(),s=l.useMemo(()=>t.map(e=>"phone_code"===e?{icon:re.A,text:"SMS code",key:"phone_code"}:"totp"===e?{icon:e7.A,text:"Authenticator application",key:"totp"}:"backup_code"===e?{icon:rr.A,text:"Backup code",key:"backup_code"}:null).filter(e=>null!==e),[t]);return(0,i.FD)(i.FK,{children:[t.length>0&&(0,i.Y)(C.r.Closed,{value:"multi-factor",children:(0,i.Y)(D.rd.ActionMenu,{id:"mfa",triggerLocalizationKey:(0,c.G)("userProfile.start.mfaSection.primaryButton"),onClick:n,children:s.map(e=>e&&(0,i.Y)(D.rd.ActionMenuItem,{id:e.key,localizationKey:e.text,leftIcon:e.icon,onClick:()=>{a(e.key),r("multi-factor")}},e.key))})}),(0,i.Y)(C.r.Open,{value:"multi-factor",children:(0,i.Y)(C.r.Card,{children:o&&(0,i.Y)(rx,{selectedStrategy:o})})})]})},rL=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(W,{onSuccess:r,onReset:r,...e})},rO=e=>{let{close:r}=(0,F.D5)();return(0,i.Y)(rK,{onSuccess:r,onReset:r,passkey:e.passkey})},rK=(0,d.dm)(e=>{let{onSuccess:r,onReset:t,passkey:l}=e,n=(0,d.f0)(),o=(0,ed.tJ)("passkeyName",l.name||"",{type:"text",label:(0,c.G)("formFieldLabel__passkeyName"),isRequired:!0}),a=o.value.length>1&&l.name!==o.value,s=async e=>(e.preventDefault(),l.update({name:o.value}).then(r).catch(e=>(0,G.H4)(e,[o],n.setError)));return(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.passkeyScreen.title__rename"),headerSubtitle:(0,c.G)("userProfile.passkeyScreen.subtitle__rename"),children:(0,i.FD)(ea.l.Root,{onSubmit:s,children:[(0,i.Y)(ea.l.ControlRow,{elementId:o.id,children:(0,i.Y)(ea.l.PlainInput,{...o.props,autoComplete:"off"})}),(0,i.Y)(es.G,{submitLabel:(0,c.G)("userProfile.formButtonPrimary__save"),isDisabled:!a,onReset:t})]})})}),rB=()=>{let{user:e}=(0,Y.Jd)(),[r,t]=(0,l.useState)(null);return e?(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.passkeysSection.title"),centered:!1,id:"passkeys",children:(0,i.Y)(C.r.Root,{value:r,onChange:t,children:(0,i.FD)(D.rd.ItemList,{id:"passkeys",children:[e.passkeys.map(e=>{let r=e.id;return(0,i.FD)(l.Fragment,{children:[(0,i.Y)(rW,{...e},r),(0,i.Y)(C.r.Open,{value:"remove-".concat(r),children:(0,i.Y)(C.r.Card,{variant:"destructive",children:(0,i.Y)(rL,{passkey:e})})}),(0,i.Y)(C.r.Open,{value:"rename-".concat(r),children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(rO,{passkey:e})})})]},r)}),(0,i.Y)(rJ,{onClick:()=>t(null)})]})})}):null},rW=e=>(0,i.FD)(D.rd.Item,{id:"passkeys",hoverable:!0,sx:{alignItems:"flex-start"},children:[(0,i.Y)(rM,{...e}),(0,i.Y)(rN,{passkey:e})]}),rM=e=>{let{name:r,createdAt:t,lastUsedAt:l}=e,{t:n}=(0,eS._)();return(0,i.Y)(y.so,{sx:e=>({width:"100%",overflow:"hidden",gap:e.space.$4,[eb.g.sm]:{gap:e.space.$2}}),children:(0,i.FD)(y.fv,{align:"start",gap:1,children:[(0,i.Y)(y.EY,{children:r}),(0,i.FD)(y.EY,{colorScheme:"secondary",children:["Created: ",n((0,eU.T)(t))]}),l&&(0,i.FD)(y.EY,{colorScheme:"secondary",children:["Last used: ",n((0,eU.T)(l))]})]})})},rN=e=>{let{passkey:r}=e,{open:t}=(0,F.D5)(),l=r.id,n=[{label:(0,c.G)("userProfile.start.passkeysSection.menuAction__rename"),onClick:()=>t("rename-".concat(l))},{label:(0,c.G)("userProfile.start.passkeysSection.menuAction__destructive"),isDestructive:!0,onClick:()=>t("remove-".concat(l))}];return(0,i.Y)(R.o,{actions:n})},rJ=e=>{let{onClick:r}=e,t=(0,d.f0)(),{isSatellite:l}=(0,Y.ho)(),{user:n}=(0,Y.Jd)(),o=(0,Y.Wp)(()=>null==n?void 0:n.createPasskey()),a=async()=>{if(null==r||r(),n)try{await o()}catch(e){(0,G.H4)(e,[],t.setError)}};return l?null:(0,i.Y)(D.rd.ArrowButton,{id:"passkeys",localizationKey:(0,c.G)("userProfile.start.passkeysSection.primaryButton"),onClick:a})};var rq=t(23990),rU=t(23468);let rj=(0,d.dm)(e=>{let{t:r,locale:t}=(0,eS._)(),{onSuccess:n,onReset:o}=e,{user:a}=(0,Y.Jd)(),s=(0,Y.Wp)((e,r)=>e.updatePassword(...r));if(!a)return null;let{userSettings:{passwordSettings:u},authConfig:{reverification:h}}=(0,g.O)(),{session:f}=(0,Y.wV)(),m=a.passwordEnabled?(0,c.G)("userProfile.passwordPage.title__update"):(0,c.G)("userProfile.passwordPage.title__set"),p=(0,d.f0)(),v=a.enterpriseAccounts.some(e=>e.active),P=a.passwordEnabled&&!h,b=(0,l.useRef)({title:(0,c.G)("userProfile.passwordPage.title__set")}),y=(0,ed.tJ)("currentPassword","",{type:"password",label:(0,c.G)("formFieldLabel__currentPassword"),isRequired:!0}),S=(0,ed.tJ)("newPassword","",{type:"password",label:(0,c.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,rq.C5)(e,{t:r,locale:t,passwordSettings:u})}),_=(0,ed.tJ)("confirmPassword","",{type:"password",label:(0,c.G)("formFieldLabel__confirmPassword"),isRequired:!0}),D=(0,ed.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,c.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:R,isPasswordMatch:w}=(0,rU.Z)({passwordField:S,confirmPasswordField:_}),C=(P?y.value&&w:w)&&S.value&&_.value,F=async()=>{if(C)try{var e,r;let t;b.current={title:a.passwordEnabled?(0,c.G)("userProfile.passwordPage.title__update"):(0,c.G)("userProfile.passwordPage.title__set"),text:(e=a.passwordEnabled,r=!!D.checked,t=[],e?t.push((0,c.G)("userProfile.passwordPage.successMessage__update")):t.push((0,c.G)("userProfile.passwordPage.successMessage__set")),r&&t.push((0,c.G)("userProfile.passwordPage.successMessage__signOutOfOtherSessions")),t)};let i={newPassword:S.value,signOutOfOtherSessions:D.checked,currentPassword:P?y.value:void 0};await s(a,[i]),n()}catch(e){(0,G.H4)(e,[y,S,_],p.setError)}};return(0,i.FD)(ec.M,{headerTitle:m,children:[v&&(0,i.Y)(ew.k,{message:(0,c.G)("userProfile.passwordPage.readonly")}),(0,i.FD)(ea.l.Root,{onSubmit:F,onBlur:()=>{S.value&&R(_.value)},children:[(0,i.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:(null==f?void 0:f.publicUserData.identifier)||"",style:{display:"none"}}),P&&(0,i.Y)(ea.l.ControlRow,{elementId:y.id,children:(0,i.Y)(ea.l.PasswordInput,{...y.props,minLength:6,isRequired:!0,autoFocus:!0,isDisabled:v})}),(0,i.Y)(ea.l.ControlRow,{elementId:S.id,children:(0,i.Y)(ea.l.PasswordInput,{...S.props,minLength:6,isRequired:!0,autoFocus:!a.passwordEnabled,isDisabled:v})}),(0,i.Y)(ea.l.ControlRow,{elementId:_.id,children:(0,i.Y)(ea.l.PasswordInput,{..._.props,onChange:e=>(e.target.value&&R(e.target.value),_.props.onChange(e)),isRequired:!0,isDisabled:v})}),(0,i.Y)(ea.l.ControlRow,{elementId:D.id,children:(0,i.Y)(ea.l.Checkbox,{...D.props,description:(0,c.G)("userProfile.passwordPage.checkboxInfoText__signOutOfOtherSessions"),isDisabled:v})}),v?(0,i.Y)(es.c,{children:(0,i.Y)(ea.l.ResetButton,{localizationKey:(0,c.G)("userProfile.formButtonReset"),block:!1,onClick:o})}):(0,i.Y)(es.G,{isDisabled:!C,onReset:o})]})]})}),rH=()=>{let{close:e}=(0,F.D5)();return(0,i.Y)(rj,{onSuccess:e,onReset:e})},rV=()=>{let{user:e}=(0,Y.Jd)();if(!e)return null;let{passwordEnabled:r}=e;return(0,i.Y)(D.rd.Root,{centered:!1,title:(0,c.G)("userProfile.start.passwordSection.title"),id:"password",children:(0,i.FD)(C.r.Root,{children:[(0,i.Y)(C.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"password",sx:e=>({paddingLeft:r?void 0:"0",paddingTop:e.space.$0x25,paddingBottom:e.space.$0x25}),children:[r&&(0,i.Y)(y.EY,{variant:"h2",children:"••••••••••"}),(0,i.Y)(C.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"password",localizationKey:r?(0,c.G)("userProfile.start.passwordSection.primaryButton__updatePassword"):(0,c.G)("userProfile.start.passwordSection.primaryButton__setPassword")})})]})}),(0,i.Y)(C.r.Open,{value:"edit",children:(0,i.Y)(C.r.Card,{children:(0,i.Y)(rH,{})})})]})})},rZ=(0,d.dm)(()=>{var e;let{attributes:r,instanceIsPasswordBased:t}=(0,g.O)().userSettings,l=(0,d.f0)(),{user:n}=(0,Y.Jd)(),{shouldAllowIdentificationCreation:o}=(0,a.B)(),s=(null==(e=r.passkey)?void 0:e.enabled)&&o,u=H(r).length>0,h=null==n?void 0:n.deleteSelfEnabled;return(0,i.Y)(y.fv,{elementDescriptor:S.$z.page,sx:e=>({gap:e.space.$8}),children:(0,i.FD)(y.fv,{elementDescriptor:S.$z.profilePage,elementId:S.$z.profilePage.setId("security"),children:[(0,i.Y)(b.Y.Root,{children:(0,i.Y)(b.Y.Title,{localizationKey:(0,c.G)("userProfile.start.headerTitle__security"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,i.Y)(P.Z.Alert,{children:l.error}),t&&(0,i.Y)(rV,{}),s&&(0,i.Y)(rB,{}),u&&(0,i.Y)(rA,{}),(0,i.Y)(eX,{}),h&&(0,i.Y)(e9,{})]})})}),rX=(0,l.lazy)(()=>Promise.all([t.e("666"),t.e("207"),t.e("259")]).then(t.bind(t,61608)).then(e=>({default:e.BillingPage}))),rQ=(0,l.lazy)(()=>Promise.all([t.e("666"),t.e("326"),t.e("817")]).then(t.bind(t,68201)).then(e=>({default:e.APIKeysPage}))),r0=(0,l.lazy)(()=>Promise.all([t.e("666"),t.e("970"),t.e("110")]).then(t.bind(t,37437)).then(e=>({default:e.PlansPage}))),r1=(0,l.lazy)(()=>Promise.all([t.e("545"),t.e("666"),t.e("627")]).then(t.bind(t,91666)).then(e=>({default:e.StatementPage}))),r2=(0,l.lazy)(()=>Promise.all([t.e("545"),t.e("666"),t.e("122")]).then(t.bind(t,64856)).then(e=>({default:e.PaymentAttemptPage}))),r5=()=>{var e;let{pages:r,shouldShowBilling:t,apiKeysProps:o}=(0,a.B)(),{apiKeysSettings:s,commerceSettings:c}=(0,g.O)(),d=r.routes[0].id===n.j2.ACCOUNT,u=r.routes[0].id===n.j2.SECURITY,h=r.routes[0].id===n.j2.BILLING,p=r.routes[0].id===n.j2.API_KEYS,Y=null==(e=r.contents)?void 0:e.map((e,r)=>{let t=!d&&!u&&0===r;return(0,i.Y)(m.q,{index:t,path:t?void 0:e.url,children:(0,i.Y)(v.H,{mount:e.mount,unmount:e.unmount})},"custom-page-".concat(e.url))});return(0,i.FD)(f.d,{children:[Y,(0,i.FD)(m.q,{children:[(0,i.Y)(m.q,{path:d?void 0:"account",children:(0,i.Y)(f.d,{children:(0,i.Y)(m.q,{index:!0,children:(0,i.Y)(eJ,{})})})}),(0,i.Y)(m.q,{path:u?void 0:"security",children:(0,i.Y)(f.d,{children:(0,i.Y)(m.q,{index:!0,children:(0,i.Y)(rZ,{})})})}),c.billing.user.enabled&&t?(0,i.Y)(m.q,{path:h?void 0:"billing",children:(0,i.FD)(f.d,{children:[(0,i.Y)(m.q,{index:!0,children:(0,i.Y)(l.Suspense,{fallback:"",children:(0,i.Y)(rX,{})})}),c.billing.user.hasPaidPlans?(0,i.Y)(m.q,{path:"plans",children:(0,i.Y)(l.Suspense,{fallback:"",children:(0,i.Y)(r0,{})})}):null,(0,i.Y)(m.q,{path:"statement/:statementId",children:(0,i.Y)(l.Suspense,{fallback:"",children:(0,i.Y)(r1,{})})}),(0,i.Y)(m.q,{path:"payment-attempt/:paymentAttemptId",children:(0,i.Y)(l.Suspense,{fallback:"",children:(0,i.Y)(r2,{})})})]})}):null,s.user_api_keys_enabled&&!(null==o?void 0:o.hide)&&(0,i.Y)(m.q,{path:p?void 0:"api-keys",children:(0,i.Y)(f.d,{children:(0,i.Y)(m.q,{index:!0,children:(0,i.Y)(l.Suspense,{fallback:"",children:(0,i.Y)(rQ,{})})})})})]})]})};var r4=t(10393);let r3=()=>(0,i.Y)(s.n.Root,{flow:"userProfile",children:(0,i.Y)(s.n.Part,{children:(0,i.FD)(f.d,{children:[(0,i.Y)(m.q,{path:"verify",children:(0,i.Y)(r4.G,{})}),(0,i.Y)(m.q,{children:(0,i.Y)(r6,{})})]})})}),r6=(0,o.G)(()=>{let e=l.useRef(null);return(0,i.Y)(h.a.Root,{children:(0,i.FD)(p,{contentRef:e,children:[(0,i.Y)(u.oT,{navbarTitleLocalizationKey:(0,c.G)("userProfile.navbar.title")}),(0,i.Y)(h.a.Content,{contentRef:e,scrollBoxId:n.AG,children:(0,i.Y)(r5,{})})]})})}),r9=(0,d.dm)(r3),r8=(0,d.dm)(r3),r7=e=>{let r={...e,routing:"virtual",componentName:"UserProfile",mode:"modal"};return(0,i.Y)(m.q,{path:"user",children:(0,i.Y)(a.M.Provider,{value:r,children:(0,i.Y)("div",{children:(0,i.Y)(r8,{...r})})})})}},49599:function(e,r,t){t.d(r,{g:()=>n});var i=t(21210),l=t(4964);let n=()=>{let{navigate:e}=(0,l.r)(),r=(0,i.ho)();return{navigateAfterSignOut:()=>e(r.buildAfterSignOutUrl()),navigateAfterMultiSessionSingleSignOutUrl:()=>e(r.buildAfterMultiSessionSingleSignOutUrl()),afterSignOutUrl:r.buildAfterSignOutUrl(),afterMultiSessionSingleSignOutUrl:r.buildAfterMultiSessionSingleSignOutUrl()}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["636"],{19090:function(e,t,r){r.d(t,{n:()=>a});var i=r(14518),o=r(45170),n=r(22861);let a=e=>{let{onBackLinkClick:t}=e;return(0,i.Y)(o.J,{cardTitle:(0,n.G)("signIn.alternativeMethods.getHelp.title"),cardSubtitle:(0,n.G)("signIn.alternativeMethods.getHelp.content"),onBackLinkClick:t})}},22690:function(e,t,r){r.d(t,{j:()=>a}),r(88711);var i=r(35074),o=r(55763);let n=e=>{if(!e)return"";let t=e.strategy;return"phoneNumberId"in e&&(t+=e.phoneNumberId),t};function a(e){let t=i.useRef(""),[r,a]=i.useState(()=>(0,o.R5)(e)),[l,c]=i.useState(!r),s=t.current===n(r);return{currentFactor:r,factorAlreadyPrepared:s,handleFactorPrepare:()=>{t.current=n(r)},selectFactor:e=>{a(e),c(!1)},showAllStrategies:l,toggleAllStrategies:()=>c(e=>!e)}}},55763:function(e,t,r){r.d(t,{Cm:()=>u,Kw:()=>p,R5:()=>h,UY:()=>v,iy:()=>m,oj:()=>k,xf:()=>s}),r(19161),r(85074),r(30945),r(22501),r(21044);var i=r(62620),o=r(87651),n=r(1959),a=r(68289);let l=e=>t=>"safeIdentifier"in t&&t.safeIdentifier===e;function c(e){if((0,i.Bz)()){let t=e.find(e=>{let{strategy:t}=e;return"passkey"===t});if(t)return t}return null}function s(e,t,r){return e&&0!==e.length?r===n._o.Password?function(e,t){let r=c(e);if(r)return r;let i=e.sort(a.Kn)[0];return"password"===i.strategy?i:e.find(l(t))||i||null}(e,t):function(e,t){let r=c(e);if(r)return r;let i=e.sort(a.Ih),o=i.find(l(t));if(o)return o;let n=i[0];return"email_link"===n.strategy?n:e.find(l(t))||n||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 f=["reset_password_phone_code","reset_password_email_code"],p=e=>!!e&&f.includes(e);function v(e){let t;return"tel"===e.type?"phoneNumber":(t=e.value,/^\S+@\S+\.\S+$/.test(t))?"emailAddress":"username"}let k=(e,t,r)=>{var i,n;if(!t)return null;let a=null==(i=e.find(e=>"strategy"===e.id))?void 0:i.value;if(a&&"phone_code"!==a)return null;let l=null==(n=e.find(e=>e.id===r))?void 0:n.value;if(!l||!(null==l?void 0:l.startsWith("+")))return null;let c=(0,o.TV)(l,t);return"sms"===c?null:c},m=(e,t,r)=>{if(!e||!t||"phoneNumber"!==t||!r||!(null==r?void 0:r.startsWith("+")))return null;let i=(0,o.TV)(r,e);return"sms"===i?null:i}},49066:function(e,t,r){r.r(t),r.d(t,{UserVerification:()=>eh,UserVerificationModal:()=>ef});var i=r(14518),o=r(35074),n=r(85577),a=r(9078),l=r(44607),c=r(80212),s=r(42265);r(19161),r(95055),r(30945),r(88711);var d=r(63269),u=r(45170),h=r(56980),f=r(97697),p=r(22861),v=r(4964),k=r(55763);r(22239),r(98114);var m=r(38738),Y=r(29),y=r(23707),b=r(76153),g=r(99835),C=r(18272),w=r(58920),F=r(74421),M=r(11051),A=r(30743),_=r(16889),S=r(89830),B=r(62620),G=r(68289);function D(e){let{filterOutFactor:t,supportedFirstFactors:r}=e,i=r?r.filter(e=>!(0,k.Kw)(e.strategy)):[],n=i&&i.length>0,a=(0,o.useMemo)(()=>r?r.filter(e=>!e.strategy.startsWith("oauth_")).filter(e=>(0,k.Cm)(e)).filter(e=>!e||!t||("email_code"===e.strategy&&"email_code"===t.strategy?e.emailAddressId!==t.emailAddressId:"phone_code"===e.strategy&&"phone_code"===t.strategy?e.phoneNumberId!==t.phoneNumberId:e.strategy!==t.strategy)).filter(e=>"passkey"!==e.strategy||(0,B.Bz)()).sort(G.aR):[],[r,t]);return{hasAnyStrategy:n,hasFirstParty:a&&a.length>0,firstPartyFactors:a}}var L=r(21210),I=r(67896);let z=()=>{let{session:e}=(0,L.wV)(),t=(()=>{let{level:e}=(0,a.k)();return(0,o.useMemo)(()=>({level:e||"second_factor"}),[e])})();return{...(0,I.s)(e?e.startVerification:void 0,t,{throttleTime:300})}};function T(e){let t=t=>{let{isLoading:r,data:o}=z();return r||!o?(0,i.Y)(h.B,{}):(0,i.Y)(e,{...t})},r=e.displayName||e.name||"Component";return e.displayName=r,t.displayName=r,t}let Z=e=>{let{onBackLinkClick:t}=e;return(0,i.Y)(u.J,{cardTitle:(0,p.G)("reverification.alternativeMethods.getHelp.title"),cardSubtitle:(0,p.G)("reverification.alternativeMethods.getHelp.content"),onBackLinkClick:t})},P=e=>((e,t)=>{let[r,n]=o.useState(!1),a=o.useCallback(()=>n(e=>!e),[n]);return r?(0,i.Y)(Z,{onBackLinkClick:a}):(0,i.Y)(e,{...t,onHavingTroubleClick:a})})(V,{...e}),V=e=>{let{onBackLinkClick:t,onHavingTroubleClick:r,onFactorSelected:o}=e,n=(0,d.f0)(),{data:a}=z(),{firstPartyFactors:c,hasAnyStrategy:s}=D({filterOutFactor:null==e?void 0:e.currentFactor,supportedFirstFactors:null==a?void 0:a.supportedFirstFactors});return(0,i.Y)(l.n.Part,{part:"alternativeMethods",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.alternativeMethods.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.alternativeMethods.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:n.error}),(0,i.Y)(C.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,i.FD)(C.fv,{gap:4,children:[s&&(0,i.Y)(C.so,{elementDescriptor:w.$z.alternativeMethods,direction:"col",gap:2,children:c.map((e,t)=>{var r;return(0,i.Y)(m.X,{leftIcon:(r=e,({email_code:F.A,phone_code:M.A,password:A.A,passkey:_.A,enterprise_sso:S.A})[r.strategy]),textLocalizationKey:function(e){switch(e.strategy){case"email_code":return(0,p.G)("reverification.alternativeMethods.blockButton__emailCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"phone_code":return(0,p.G)("reverification.alternativeMethods.blockButton__phoneCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"password":return(0,p.G)("reverification.alternativeMethods.blockButton__password");case"passkey":return(0,p.G)("reverification.alternativeMethods.blockButton__passkey");default:throw Error('Invalid sign in strategy: "'.concat(e.strategy,'"'))}}(e),elementDescriptor:w.$z.alternativeMethodsBlockButton,textElementDescriptor:w.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:w.$z.alternativeMethodsBlockButtonArrow,textVariant:"buttonLarge",isDisabled:n.isLoading,onClick:()=>{n.setError(void 0),o(e)}},t)})}),t&&(0,i.Y)(Y.E,{boxElementDescriptor:w.$z.backRow,linkElementDescriptor:w.$z.backLink,onClick:t})]})})]}),(0,i.Y)(y.Z.Footer,{children:(0,i.FD)(y.Z.Action,{elementId:"havingTrouble",children:[(0,i.Y)(y.Z.ActionText,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionText")}),(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionLink"),onClick:r})]})})]})})};var R=r(52454),E=r(4468),K=r(8640),x=r(19090),N=r(31475),$=r(19426);let U=()=>{let{afterVerification:e}=(0,a.k)(),t=(0,$.p)(),{setActive:r}=(0,L.ho)(),{setCache:i}=z(),{navigate:n}=(0,v.r)();return{handleVerificationResponse:(0,o.useCallback)(async o=>{switch(i({data:o,isLoading:!1,isValidating:!1,error:null,cachedAt:Date.now()}),o.status){case"complete":return await r({session:o.session.id}),null==e?void 0:e();case"needs_second_factor":return n("./factor-two");default:return console.error((0,N.wv)(o.status,t))}},[n,r,t])}};function H(e){let{onShowAlternativeMethodsClick:t}=e,{session:r}=(0,L.wV)(),{handleVerificationResponse:n}=U(),a=(0,d.f0)(),[c,s]=o.useState(!1),u=o.useCallback(()=>s(e=>!e),[s]),h=(0,K.tJ)("password","",{type:"password",label:(0,p.G)("formFieldLabel__password"),placeholder:(0,p.G)("formFieldInputPlaceholder__password")}),f=async e=>(e.preventDefault(),null==r?void 0:r.attemptFirstFactorVerification({strategy:"password",password:h.value}).then(n).catch(e=>(0,E.H4)(e,[h],a.setError)));return c?(0,i.Y)(x.n,{onBackLinkClick:u}):(0,i.Y)(l.n.Part,{part:"password",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.password.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.password.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.FD)(C.fv,{elementDescriptor:w.$z.main,gap:4,children:[(0,i.FD)(R.l.Root,{onSubmit:f,gap:8,children:[(0,i.Y)(R.l.ControlRow,{elementId:h.id,children:(0,i.Y)(R.l.PasswordInput,{...h.props,autoFocus:!0})}),(0,i.Y)(R.l.SubmitButton,{hasArrow:!0})]}),(0,i.Y)(y.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)(t?"reverification.password.actionLink":"reverification.alternativeMethods.actionLink"),onClick:t||u})})]})]}),(0,i.Y)(y.Z.Footer,{})]})})}function j(e,t){return"primary"in e&&e.primary&&!("primary"in t&&t.primary)?-1:"primary"in t&&t.primary&&!("primary"in e&&e.primary)?1:0}var J=r(27912);let W=e=>{var t;let{session:r}=(0,L.wV)(),n=(0,d.f0)(),{handleVerificationResponse:a}=U();o.useEffect(()=>{e.factorAlreadyPrepared||l()},[]);let l=()=>{r.prepareFirstFactorVerification(e.factor).then(()=>e.onFactorPrepare()).catch(e=>(0,E.H4)(e,[],n.setError))};return(0,i.Y)(J.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(t,i,o)=>{r.attemptFirstFactorVerification({strategy:e.factor.strategy,code:t}).then(async e=>(await i(),a(e))).catch(o)},onResendCodeClicked:l,safeIdentifier:e.factor.safeIdentifier,profileImageUrl:null==r||null==(t=r.user)?void 0:t.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods,onBackLinkClicked:e.onBackLinkClicked})},q=e=>(0,i.Y)(l.n.Part,{part:"emailCode",children:(0,i.Y)(W,{...e,cardTitle:(0,p.G)("reverification.emailCode.title"),cardSubtitle:(0,p.G)("reverification.emailCode.subtitle"),inputLabel:(0,p.G)("reverification.emailCode.formTitle"),resendButton:(0,p.G)("reverification.emailCode.resendButton")})}),O=e=>{let{onShowAlternativeMethodsClicked:t}=e,{session:r}=(0,L.wV)(),{__internal_isWebAuthnSupported:o}=(0,L.ho)(),{handleVerificationResponse:n}=U(),a=(0,d.f0)();return(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.passkey.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.passkey.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.Y)(C.fv,{elementDescriptor:w.$z.main,gap:8,children:(0,i.Y)(R.l.Root,{children:(0,i.FD)(C.fv,{gap:3,children:[(0,i.Y)(C.$n,{type:"button",onClick:e=>{e.preventDefault(),null==r||r.verifyWithPasskey().then(e=>n(e)).catch(e=>(0,E.H4)(e,[],a.setError))},localizationKey:(0,p.G)("reverification.passkey.blockButton__passkey"),hasArrow:!0}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:t&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})})})]}),(0,i.Y)(y.Z.Footer,{})]})},X=e=>(0,i.Y)(l.n.Part,{part:"phoneCode",children:(0,i.Y)(W,{...e,cardTitle:(0,p.G)("reverification.phoneCode.title"),cardSubtitle:(0,p.G)("reverification.phoneCode.subtitle"),inputLabel:(0,p.G)("reverification.phoneCode.formTitle"),resendButton:(0,p.G)("reverification.phoneCode.resendButton"),showAlternativeMethods:e.showAlternativeMethods})}),Q=e=>{if(!e)return"";let t=e.strategy;return"emailAddressId"in e&&(t+=e.emailAddressId),"phoneNumberId"in e&&(t+=e.phoneNumberId),t},ee=["password","email_code","phone_code","passkey"],et=T((0,d.dm)(function(){let{data:e}=z(),t=(0,d.f0)(),{navigate:r}=(0,v.r)(),n=o.useRef(""),a=(0,o.useMemo)(()=>{var t,r;return(null==(r=e.supportedFirstFactors)||null==(t=r.filter(e=>ee.includes(e.strategy)))?void 0:t.sort(j))||null},[e.supportedFirstFactors]),{preferredSignInStrategy:l}=(0,f.O)().displayConfig,[{currentFactor:c},s]=o.useState(()=>({currentFactor:(0,k.xf)(a,null,l),prevCurrentFactor:void 0})),{hasAnyStrategy:m,hasFirstParty:Y}=D({filterOutFactor:c,supportedFirstFactors:a}),[y,b]=o.useState(()=>!c||!(0,k.Cm)(c)),g=m?()=>{t.setError(void 0),b(e=>!e)}:void 0,C=()=>{n.current=Q(c)};if((0,o.useEffect)(()=>{"needs_second_factor"===e.status&&r("factor-two")},[]),!c)return(0,i.Y)(u.J,{cardTitle:(0,p.G)("reverification.noAvailableMethods.title"),cardSubtitle:(0,p.G)("reverification.noAvailableMethods.subtitle"),message:(0,p.G)("reverification.noAvailableMethods.message"),shouldNavigateBack:!1});if(y){let e=(0,k.Cm)(c);return(0,i.Y)(P,{onBackLinkClick:e?()=>{t.setError(void 0),null==g||g()}:void 0,onFactorSelected:e=>{s(t=>({currentFactor:e,prevCurrentFactor:t.currentFactor})),null==g||g()},currentFactor:c})}switch(null==c?void 0:c.strategy){case"password":return(0,i.Y)(H,{onShowAlternativeMethodsClick:g});case"email_code":return(0,i.Y)(q,{factorAlreadyPrepared:n.current===Q(c),onFactorPrepare:C,onShowAlternativeMethodsClicked:g,factor:c,showAlternativeMethods:Y});case"phone_code":return(0,i.Y)(X,{factorAlreadyPrepared:n.current===Q(c),onFactorPrepare:C,onShowAlternativeMethodsClicked:g,factor:c,showAlternativeMethods:Y});case"passkey":return(0,i.Y)(O,{onShowAlternativeMethodsClicked:g});default:return(0,i.Y)(h.B,{})}}));var er=r(22690);let ei=e=>{var t;let r=(0,d.f0)(),{session:n}=(0,L.wV)(),{handleVerificationResponse:a}=U();o.useEffect(()=>{e.factorAlreadyPrepared||null==l||l()},[]);let l=e.prepare?()=>{var t;return null==(t=e.prepare)?void 0:t.call(e).then(()=>e.onFactorPrepare()).catch(e=>(0,E.H4)(e,[],r.setError))}:void 0;return(0,i.Y)(J.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,resendButton:e.resendButton,inputLabel:e.inputLabel,onCodeEntryFinishedAction:(t,r,i)=>{n.attemptSecondFactorVerification({strategy:e.factor.strategy,code:t}).then(async e=>(await r(),a(e))).catch(i)},onResendCodeClicked:l,safeIdentifier:"safeIdentifier"in e.factor?e.factor.safeIdentifier:void 0,profileImageUrl:null==n||null==(t=n.user)?void 0:t.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods})};function eo(e){return(0,i.Y)(l.n.Part,{part:"totp2Fa",children:(0,i.Y)(ei,{...e,cardTitle:(0,p.G)("reverification.totpMfa.title"),cardSubtitle:(0,p.G)("reverification.totpMfa.subtitle"),inputLabel:(0,p.G)("reverification.totpMfa.formTitle"),showAlternativeMethods:e.showAlternativeMethods})})}let en=e=>{let[t,r]=o.useState(!1),n=o.useCallback(()=>r(e=>!e),[r]);return t?(0,i.Y)(Z,{onBackLinkClick:n}):(0,i.Y)(ea,{supportedSecondFactors:e.supportedSecondFactors,onBackLinkClick:e.onBackLinkClick,onFactorSelected:e.onFactorSelected,onHavingTroubleClick:n})},ea=e=>{let{supportedSecondFactors:t,onHavingTroubleClick:r,onFactorSelected:o,onBackLinkClick:n}=e,a=(0,d.f0)();return(0,i.Y)(l.n.Part,{part:"alternativeMethods",children:(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.alternativeMethods.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.alternativeMethods.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:a.error}),(0,i.FD)(C.fv,{elementDescriptor:w.$z.main,gap:3,children:[(0,i.Y)(C.fv,{gap:2,children:null==t?void 0:t.sort(G.Wy).map((e,t)=>(0,i.Y)(m.X,{textLocalizationKey:function(e){switch(e.strategy){case"phone_code":return(0,p.G)("reverification.alternativeMethods.blockButton__phoneCode",{identifier:(0,g.u)(e.safeIdentifier)||""});case"totp":return(0,p.G)("reverification.alternativeMethods.blockButton__totp");case"backup_code":return(0,p.G)("reverification.alternativeMethods.blockButton__backupCode");default:throw Error('Invalid verification strategy: "'.concat(e.strategy,'"'))}}(e),elementDescriptor:w.$z.alternativeMethodsBlockButton,textElementDescriptor:w.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:w.$z.alternativeMethodsBlockButtonArrow,isDisabled:a.isLoading,onClick:()=>o(e)},t))}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:n&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("backButton"),onClick:e.onBackLinkClick})})]})]}),(0,i.Y)(y.Z.Footer,{children:(0,i.FD)(y.Z.Action,{elementId:"havingTrouble",children:[(0,i.Y)(y.Z.ActionText,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionText")}),(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("reverification.alternativeMethods.actionLink"),onClick:r})]})})]})})},el=e=>{let{onShowAlternativeMethodsClicked:t}=e,{session:r}=(0,L.wV)(),{handleVerificationResponse:o}=U(),n=(0,d.f0)(),a=(0,K.tJ)("code","",{type:"text",label:(0,p.G)("formFieldLabel__backupCode"),isRequired:!0});return(0,i.FD)(y.Z.Root,{children:[(0,i.FD)(y.Z.Content,{children:[(0,i.FD)(b.Y.Root,{showLogo:!0,children:[(0,i.Y)(b.Y.Title,{localizationKey:(0,p.G)("reverification.backupCodeMfa.title")}),(0,i.Y)(b.Y.Subtitle,{localizationKey:(0,p.G)("reverification.backupCodeMfa.subtitle")})]}),(0,i.Y)(y.Z.Alert,{children:n.error}),(0,i.Y)(C.fv,{elementDescriptor:w.$z.main,gap:8,children:(0,i.FD)(R.l.Root,{onSubmit:e=>(e.preventDefault(),r.attemptSecondFactorVerification({strategy:"backup_code",code:a.value}).then(o).catch(e=>(0,E.H4)(e,[a],n.setError))),children:[(0,i.Y)(R.l.ControlRow,{elementId:a.id,children:(0,i.Y)(R.l.PlainInput,{...a.props,autoFocus:!0,onActionClicked:t})}),(0,i.FD)(C.fv,{gap:3,children:[(0,i.Y)(R.l.SubmitButton,{hasArrow:!0}),(0,i.Y)(y.Z.Action,{elementId:"alternativeMethods",children:t&&(0,i.Y)(y.Z.ActionLink,{localizationKey:(0,p.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})]})})]}),(0,i.Y)(y.Z.Footer,{})]})},ec=e=>{let{session:t}=(0,L.wV)();return(0,i.Y)(l.n.Part,{part:"phoneCode2Fa",children:(0,i.Y)(ei,{...e,cardTitle:(0,p.G)("reverification.phoneCodeMfa.title"),cardSubtitle:(0,p.G)("reverification.phoneCodeMfa.subtitle"),inputLabel:(0,p.G)("reverification.phoneCodeMfa.formTitle"),resendButton:(0,p.G)("reverification.phoneCodeMfa.resendButton"),prepare:()=>{let{phoneNumberId:r,strategy:i}=e.factor;return t.prepareSecondFactorVerification({phoneNumberId:r,strategy:i})}})})},es=["phone_code","totp","backup_code"],ed=T((0,d.dm)(function(){let{navigate:e}=(0,v.r)(),{data:t}=z(),r=(0,o.useMemo)(()=>{var e,r;return(null==(r=t.supportedSecondFactors)||null==(e=r.filter(e=>es.includes(e.strategy)))?void 0:e.sort(j))||null},[t.supportedSecondFactors]),{currentFactor:n,factorAlreadyPrepared:a,handleFactorPrepare:l,selectFactor:c,showAllStrategies:s,toggleAllStrategies:d}=(0,er.j)(r),u=(0,o.useMemo)(()=>null==r?void 0:r.filter(e=>!e||!n||("phone_code"===e.strategy&&"phone_code"===n.strategy?e.phoneNumberId!==n.phoneNumberId:e.strategy!==n.strategy)),[r,n]),f=(0,o.useMemo)(()=>u&&u.length>0||!1,[u]);if((0,o.useEffect)(()=>{"needs_first_factor"===t.status&&e("../")},[]),!n)return(0,i.Y)(h.B,{});if(s&&f)return(0,i.Y)(en,{supportedSecondFactors:u||null,onBackLinkClick:d,onFactorSelected:c});switch(null==n?void 0:n.strategy){case"phone_code":return(0,i.Y)(ec,{factorAlreadyPrepared:a,onFactorPrepare:l,factor:n,onShowAlternativeMethodsClicked:d,showAlternativeMethods:f});case"totp":return(0,i.Y)(eo,{factorAlreadyPrepared:a,onFactorPrepare:l,factor:n,onShowAlternativeMethodsClicked:d,showAlternativeMethods:f});case"backup_code":return(0,i.Y)(el,{onShowAlternativeMethodsClicked:d});default:return(0,i.Y)(h.B,{})}}));function eu(){let{invalidate:e}=z();return(0,o.useEffect)(()=>()=>{e()},[]),(0,i.Y)(l.n.Root,{flow:"userVerification",children:(0,i.FD)(c.d,{children:[(0,i.Y)(s.q,{path:"factor-two",children:(0,i.Y)(ed,{})}),(0,i.Y)(s.q,{index:!0,children:(0,i.Y)(et,{})})]})})}eu.displayName="UserVerification";let eh=(0,n.Z)(eu),ef=e=>(0,i.Y)(s.q,{path:"user-verification",children:(0,i.Y)(a._.Provider,{value:{componentName:"UserVerification",...e,routing:"virtual"},children:(0,i.Y)("div",{children:(0,i.Y)(eh,{...e,routing:"virtual"})})})})},9078:function(e,t,r){r.d(t,{_:()=>o,k:()=>n}),r(98114);var i=r(35074);let o=(0,i.createContext)(null),n=()=>{let e=(0,i.useContext)(o);if(!e||"UserVerification"!==e.componentName)throw Error("Clerk: useUserVerificationContext called outside of the mounted UserVerification component.");let{componentName:t,...r}=e;return{...r,componentName:t}}}}]);
|