@crossmint/client-sdk-react-ui 2.2.16 → 2.2.17
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/{chunk-LPIXOKMO.cjs → chunk-2KDH7GE5.cjs} +1 -1
- package/dist/{chunk-VEDBVWMJ.cjs → chunk-2ZAABWPQ.cjs} +1 -1
- package/dist/{chunk-HR7ZH2AZ.js → chunk-4CGJFAO3.js} +1 -1
- package/dist/{chunk-AMTGG5Q3.js → chunk-4SRO2VKL.js} +1 -1
- package/dist/{chunk-42MGD6ZJ.cjs → chunk-7KEF6MHS.cjs} +1 -1
- package/dist/chunk-AH7OCN5L.js +1 -0
- package/dist/{chunk-VEAVGSER.cjs → chunk-B7QO52HD.cjs} +1 -1
- package/dist/{chunk-DYFVN5OW.cjs → chunk-C6ZO7BXK.cjs} +1 -1
- package/dist/{chunk-DYPWFGFT.cjs → chunk-D4QQGOEM.cjs} +1 -1
- package/dist/chunk-E4UXI22W.js +1 -0
- package/dist/{chunk-6LZR4UCI.js → chunk-EBED4RHK.js} +1 -1
- package/dist/chunk-FMFVGDE3.cjs +1 -0
- package/dist/{chunk-JIOIRUD6.js → chunk-FZXK37CE.js} +1 -1
- package/dist/{chunk-WKBTOP6Q.js → chunk-GKMMHRKR.js} +1 -1
- package/dist/chunk-HB67GXDK.cjs +1 -0
- package/dist/chunk-HHUNNFCE.cjs +11 -0
- package/dist/chunk-IVQHWTP6.js +1 -0
- package/dist/{chunk-I4LDWOOF.cjs → chunk-JIXAKN6V.cjs} +1 -1
- package/dist/{chunk-7IC2CZBY.cjs → chunk-KFD32WSV.cjs} +1 -1
- package/dist/{chunk-XPDCUTVF.cjs → chunk-KNBAFC33.cjs} +1 -1
- package/dist/chunk-KT4LGFPN.cjs +1 -0
- package/dist/{chunk-UFUB4WQG.js → chunk-LN6POI6I.js} +1 -1
- package/dist/{chunk-SLCP2KIQ.js → chunk-M7WHTRMF.js} +1 -1
- package/dist/{chunk-BP2LAT65.js → chunk-MAZ7YKN6.js} +1 -1
- package/dist/{chunk-2NR7DZ7X.cjs → chunk-MIC4KLMZ.cjs} +1 -1
- package/dist/chunk-NIPNEXAS.js +11 -0
- package/dist/{chunk-JO2GAJO5.js → chunk-NT6RMETE.js} +1 -1
- package/dist/{chunk-6VUY3QHE.cjs → chunk-NYUYENB2.cjs} +1 -1
- package/dist/{chunk-HTQ47E5R.js → chunk-OBSRH626.js} +1 -1
- package/dist/chunk-PLLOJELT.cjs +1 -0
- package/dist/chunk-RGVTYWKX.cjs +1 -0
- package/dist/chunk-RO7NM3Y3.js +1 -0
- package/dist/chunk-RPQ6BWD3.cjs +1 -0
- package/dist/{chunk-4UGPQ2ET.js → chunk-RVN2RWLI.js} +1 -1
- package/dist/{chunk-A3A6TWBW.cjs → chunk-SGIMVEZT.cjs} +1 -1
- package/dist/{chunk-FHJXINGE.cjs → chunk-TRWUMGN2.cjs} +1 -1
- package/dist/chunk-TWAQZ2L6.js +1 -0
- package/dist/{chunk-KKD2XNX7.cjs → chunk-UO2OAC2G.cjs} +1 -1
- package/dist/chunk-VVC4E4IR.js +1 -0
- package/dist/chunk-WK7PY5WL.js +1 -0
- package/dist/{chunk-S4YDESJI.js → chunk-WOHPRKHZ.js} +1 -1
- package/dist/{chunk-62NEFNQV.js → chunk-Z7IC644K.js} +1 -1
- package/dist/components/CrossmintNFTCollectionView.cjs +1 -1
- package/dist/components/CrossmintNFTCollectionView.js +1 -1
- package/dist/components/CrossmintNFTDetail.cjs +1 -1
- package/dist/components/CrossmintNFTDetail.js +1 -1
- package/dist/components/auth/AuthForm.cjs +1 -1
- package/dist/components/auth/AuthForm.js +1 -1
- package/dist/components/auth/AuthFormBackButton.cjs +1 -1
- package/dist/components/auth/AuthFormBackButton.js +1 -1
- package/dist/components/auth/AuthFormDialog.cjs +1 -1
- package/dist/components/auth/AuthFormDialog.js +1 -1
- package/dist/components/auth/EmbeddedAuthForm.cjs +1 -1
- package/dist/components/auth/EmbeddedAuthForm.js +1 -1
- package/dist/components/auth/PasskeyPrompt.cjs +1 -1
- package/dist/components/auth/PasskeyPrompt.js +1 -1
- package/dist/components/auth/methods/email/EmailAuthFlow.cjs +1 -1
- package/dist/components/auth/methods/email/EmailAuthFlow.js +1 -1
- package/dist/components/auth/methods/email/EmailOTPInput.cjs +1 -1
- package/dist/components/auth/methods/email/EmailOTPInput.js +1 -1
- package/dist/components/auth/methods/email/EmailSignIn.cjs +1 -1
- package/dist/components/auth/methods/email/EmailSignIn.js +1 -1
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +1 -1
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +1 -1
- package/dist/components/auth/methods/google/ContinueWithGoogle.cjs +1 -1
- package/dist/components/auth/methods/google/ContinueWithGoogle.js +1 -1
- package/dist/components/auth/methods/google/GoogleSignIn.cjs +1 -1
- package/dist/components/auth/methods/google/GoogleSignIn.js +1 -1
- package/dist/components/auth/methods/twitter/TwitterSignIn.cjs +1 -1
- package/dist/components/auth/methods/twitter/TwitterSignIn.js +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.js +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.js +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.js +1 -1
- package/dist/components/common/Divider.cjs +1 -1
- package/dist/components/common/Divider.js +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +1 -1
- package/dist/components/embed/v3/index.cjs +1 -1
- package/dist/components/embed/v3/index.js +1 -1
- package/dist/components/hosted/CrossmintPayButton_DEPRECATED.cjs +1 -1
- package/dist/components/hosted/CrossmintPayButton_DEPRECATED.js +1 -1
- package/dist/components/hosted/index.cjs +1 -1
- package/dist/components/hosted/index.js +1 -1
- package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.cjs +1 -1
- package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.js +1 -1
- package/dist/components/hosted/v3/index.cjs +1 -1
- package/dist/components/hosted/v3/index.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/consts/version.cjs +1 -1
- package/dist/consts/version.js +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAuth.cjs +1 -1
- package/dist/hooks/useAuth.d.cts +3 -1
- package/dist/hooks/useAuth.d.ts +3 -1
- package/dist/hooks/useAuth.js +1 -1
- package/dist/hooks/useCrossmintAuth.cjs +1 -1
- package/dist/hooks/useCrossmintAuth.d.cts +4 -2
- package/dist/hooks/useCrossmintAuth.d.ts +4 -2
- package/dist/hooks/useCrossmintAuth.js +1 -1
- package/dist/hooks/useCrossmintCheckout.cjs +1 -1
- package/dist/hooks/useCrossmintCheckout.js +1 -1
- package/dist/hooks/useOAuthWindowListener.cjs +1 -1
- package/dist/hooks/useOAuthWindowListener.d.cts +3 -2
- package/dist/hooks/useOAuthWindowListener.d.ts +3 -2
- package/dist/hooks/useOAuthWindowListener.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/providers/CrossmintAuthProvider.cjs +1 -1
- package/dist/providers/CrossmintAuthProvider.js +1 -1
- package/dist/providers/CrossmintAuthProviderInternal.cjs +1 -1
- package/dist/providers/CrossmintAuthProviderInternal.d.cts +4 -2
- package/dist/providers/CrossmintAuthProviderInternal.d.ts +4 -2
- package/dist/providers/CrossmintAuthProviderInternal.js +1 -1
- package/dist/providers/CrossmintWalletProvider.cjs +1 -1
- package/dist/providers/CrossmintWalletProvider.js +1 -1
- package/dist/providers/auth/AuthFormProvider.cjs +1 -1
- package/dist/providers/auth/AuthFormProvider.d.cts +1 -6
- package/dist/providers/auth/AuthFormProvider.d.ts +1 -6
- package/dist/providers/auth/AuthFormProvider.js +1 -1
- package/dist/providers/auth/OAuthFlowProvider.cjs +1 -0
- package/dist/providers/auth/OAuthFlowProvider.d.cts +15 -0
- package/dist/providers/auth/OAuthFlowProvider.d.ts +15 -0
- package/dist/providers/auth/OAuthFlowProvider.js +1 -0
- package/dist/providers/dynamic/DynamicWalletProvider.cjs +1 -1
- package/dist/providers/dynamic/DynamicWalletProvider.js +1 -1
- package/dist/providers/index.cjs +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/utils/createCrossmintApiClient.cjs +1 -1
- package/dist/utils/createCrossmintApiClient.js +1 -1
- package/package.json +7 -7
- package/dist/chunk-2F5Q7URE.js +0 -1
- package/dist/chunk-Y2QJCDN2.js +0 -11
- package/dist/chunk-YFJ5I6XR.cjs +0 -11
package/dist/chunk-Y2QJCDN2.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{a as Ht}from"./chunk-JSNUJJQJ.js";import{b as kt}from"./chunk-4KDASQO6.js";import{a as Ft}from"./chunk-LD3MRJ3F.js";import{a as Tt}from"./chunk-EMXNIC4M.js";import{a as Mt,b as Ut,c as q}from"./chunk-VHNBXIOC.js";import{a as D}from"./chunk-TNCETEEL.js";import{a as Wt,e as Nt,h as Ot,i as It}from"./chunk-UDQUVZUQ.js";import{a as _t}from"./chunk-XB3VAPRK.js";import{a as Rt}from"./chunk-ZFHUZZF2.js";import{a as W}from"./chunk-NBJIJZGO.js";import{a as Gt}from"./chunk-JPJKOERH.js";import{a as Vt}from"./chunk-VWL76U5G.js";import{a as Kt}from"./chunk-VLDE23JX.js";import{a as Lt}from"./chunk-C3JRTLQP.js";import{a as Dt}from"./chunk-E4TBJMOO.js";import{a as ut}from"./chunk-WW6GUXHG.js";import{a as Bt}from"./chunk-SFDQPSSP.js";import{a as mt}from"./chunk-UAFW3OWA.js";import{a as z,b as $,c as X,d as w}from"./chunk-PXDN3KFO.js";import{VisuallyHidden as po}from"@radix-ui/react-visually-hidden";import{createContext as Lo,useCallback as Ro,useContext as Bo,useEffect as Do,useState as ct}from"react";import{CrossmintAuthenticationError as _o}from"@crossmint/common-sdk-auth";import{useContext as Uo}from"react";import{createContext as Eo,useEffect as Jt,useMemo as Qt,useRef as Fo,useState as j,useCallback as tt}from"react";import{CrossmintAuth as ko,getCookie as Wo}from"@crossmint/client-sdk-auth";import{validateApiKeyAndGetCrossmintBaseUrl as No}from"@crossmint/common-sdk-base";import{SESSION_PREFIX as Oo}from"@crossmint/common-sdk-auth";import{useCrossmint as Io}from"@crossmint/client-sdk-react-base";import{useEffect as vt,useMemo as zt}from"react";import{useDynamicContext as Co}from"@dynamic-labs/sdk-react-core";import{isEthereumWallet as wo}from"@dynamic-labs/ethereum";import{isSolanaWallet as So}from"@dynamic-labs/solana";import{EthereumWalletConnectors as $t}from"@dynamic-labs/ethereum";import{SolanaWalletConnectors as qt}from"@dynamic-labs/solana";import Po from"bs58";import{jsx as jt}from"react/jsx-runtime";function Ao({children:e,enabled:o,onSdkLoaded:r,onWalletConnected:t,jwt:n}){let{primaryWallet:i,sdkHasLoaded:l,removeWallet:s,handleUnlinkWallet:c}=Co(),m=!o||l;return vt(()=>{m&&(r==null||r(m))},[m,r]),vt(()=>{n==null&&m&&i!=null&&(s(i.id),c(i.id))},[n,m,i,s,c]),vt(()=>{function x(){return w(this,null,function*(){try{if(wo(i)){let u=yield i.getWalletClient(),a={type:"external-wallet",address:u.account.address,viemAccount:$(z({},u.account),{signMessage:d=>w(this,null,function*(){return yield u.signMessage({message:d.message})})})};t(a)}else if(So(i)){let u=yield i.getSigner(),a={type:"external-wallet",address:i.address,onSignTransaction:d=>w(this,null,function*(){return yield u.signTransaction(d)})};t(a)}else throw new Error("Unsupported wallet type")}catch(u){throw console.error("Failed to get admin signer",u),new Error("Failed to get admin signer")}})}i!=null&&n!=null&&x()},[i,n,t]),e}function Xt({children:e,enabled:o=!0,apiKeyEnvironment:r,loginMethods:t=["web3"],appearance:n,onSdkLoaded:i,onWalletConnected:l}){var u,a;let{crossmintAuth:s,jwt:c}=R(),m=zt(()=>{var d,f;return`.powered-by-dynamic { display: none !important; }
|
|
2
|
-
.wallet-list__scroll-container { padding: 0px !important; }
|
|
3
|
-
.wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; }
|
|
4
|
-
.dynamic-footer { display: none !important; }
|
|
5
|
-
h1 { color: ${(d=n==null?void 0:n.colors)==null?void 0:d.textPrimary} !important; }
|
|
6
|
-
* { color: ${(f=n==null?void 0:n.colors)==null?void 0:f.textSecondary} !important; }`},[(u=n==null?void 0:n.colors)==null?void 0:u.textPrimary,(a=n==null?void 0:n.colors)==null?void 0:a.textSecondary]),x=zt(()=>{if(o)return t.includes("web3:evm-only")?[$t]:t.includes("web3:solana-only")?[qt]:[$t,qt]},[o,t]);return jt(Ft,{apiKeyEnvironment:r,settings:{walletConnectors:x,cssOverrides:m,events:{onAuthFailure(d,f){console.error("[DynamicWalletProvider] onAuthFailure",d,f)}},handlers:{handleConnectedWallet:d=>w(this,null,function*(){var g;if(!s)return console.error("[DynamicWalletProvider] crossmintAuth is not available"),!1;let f=d.address;if(f==null)return console.error("[DynamicWalletProvider] handleConnectedWallet: address is missing"),!1;try{let b=(yield kt(d))==="solana"?"solana":"evm",v=yield s.signInWithSmartWallet(f,b);if((v==null?void 0:v.challenge)==null)throw new Error("No challenge received from signInWithSmartWallet");let p=yield(g=d.connector)==null?void 0:g.proveOwnership(f,v.challenge);if(p==null)throw new Error("Failed to get signature from wallet");let F=p;if(b==="solana"){let S=Buffer.from(p,"base64");F=Po.encode(S)}let C=yield s.authenticateSmartWallet(f,b,F);if((C==null?void 0:C.oneTimeSecret)==null)throw new Error("No oneTimeSecret received from authenticateSmartWallet");return yield s.handleRefreshAuthMaterial(C.oneTimeSecret),!0}catch(y){return console.error("[DynamicWalletProvider] Error handling wallet connection:",y),!1}})}},children:jt(Ao,{enabled:o,onSdkLoaded:i,onWalletConnected:l,jwt:c,children:e})},`${r}-${t.join(",")}`)}import{Fragment as Mo,jsx as ot,jsxs as Yt}from"react/jsx-runtime";var To={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},experimental_externalWalletSigner:void 0},pt=Eo(To);function Br({children:e,appearance:o,termsOfServiceText:r,prefetchOAuthUrls:t=!0,authModalTitle:n,onLoginSuccess:i,loginMethods:l=["email","google"],refreshRoute:s,logoutRoute:c}){let{crossmint:m}=Io("CrossmintAuthProvider must be used within CrossmintProvider"),[x,u]=j(void 0),[a,d]=j(void 0),f=No(m.apiKey),[g,y]=j(!1),[b,v]=j(!1),[p,F]=j(void 0),[C,S]=j(!0),k=l.some(P=>P.startsWith("web3")),[N,U]=j(void 0),B=Fo(null),L=Qt(()=>(B.current||(B.current=ko.from(m,{callbacks:{onLogout:()=>{u(void 0),d(void 0)},onTokenRefresh:P=>{u(P.user),d(P.jwt)}},refreshRoute:s,logoutRoute:c})),B.current),[]),H=tt(()=>{i==null||i()},[i]);Jt(()=>{if(a==null){let P=Wo(Oo);d(P)}v(!0)},[a]),Jt(()=>{a!=null&&g&&(y(!1),H())},[a,g,H]);let M=tt(P=>{if(a!=null){console.log("User already logged in");return}P!=null&&typeof P=="string"&&F(P),y(!0)},[a]),G=tt(()=>{L.logout()},[L]),V=tt(()=>!b||k&&!C?"initializing":a!=null?"logged-in":g?"in-progress":"logged-out",[b,k,C,a,g]),Z=tt(()=>w(this,null,function*(){if(a==null){console.log("User not logged in");return}let P=yield L.getUser();return u(P),P}),[a,L]),lt=Qt(()=>({crossmintAuth:L,login:M,logout:G,jwt:a,user:x,experimental_externalWalletSigner:N,status:V(),getUser:Z}),[L,M,G,a,x,V,Z,N]);return ot(Rt,{children:ot(pt.Provider,{value:lt,children:ot(Zt,{setDialogOpen:(P,st)=>{y(P),st&&H()},preFetchOAuthUrls:V()==="logged-out"&&t,initialState:{appearance:o,loginMethods:l,termsOfServiceText:r,authModalTitle:n,baseUrl:f,defaultEmail:p},children:k?Yt(Xt,{apiKeyEnvironment:m.apiKey.includes("production")?"production":"staging",loginMethods:l,appearance:o,onSdkLoaded:S,onWalletConnected:U,children:[e,ot(at,{open:g})]}):Yt(Mo,{children:[e,ot(at,{open:g})]})})})})}function R(){let e=Uo(pt);if(!e)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return e}import{jsx as Ho}from"react/jsx-runtime";var to={google:"",twitter:""},oo=Lo(void 0),h=()=>{let e=Bo(oo);if(!e)throw new Error("useAuthForm must be used within an AuthFormProvider");return e},Zt=({setDialogOpen:e,preFetchOAuthUrls:o,initialState:r,children:t})=>{let{crossmintAuth:n}=R(),[i,l]=ct("initial"),[s,c]=ct(null),[m,x]=ct(to),[u,a]=ct(!0),{loginMethods:d,baseUrl:f,appearance:g,termsOfServiceText:y,authModalTitle:b,defaultEmail:v}=r,p=Ro(()=>w(void 0,null,function*(){a(!0);try{let k=d.filter(U=>U in to).map(U=>w(void 0,null,function*(){let B=yield n==null?void 0:n.getOAuthUrl(U);return{[U]:B}})),N=Object.assign({},...yield Promise.all(k));x(N)}catch(S){c(S instanceof _o?S.message:"Unable to load oauth providers. Please try again later.")}finally{a(!1)}}),[d,n]);Do(()=>{o&&p()},[p,o]);let C={step:i,error:s,baseUrl:f,appearance:g,termsOfServiceText:y,authModalTitle:b,loginMethods:d,defaultEmail:v,oauthUrlMap:m,isLoadingOauthUrlMap:u,setDialogOpen:(S,k)=>{e==null||e(S,k),S||setTimeout(()=>l("initial"),250)},setError:c,setStep:l};return Ho(oo.Provider,{value:C,children:t})};import dr from"color";import{useState as Yo}from"react";import{useState as Ct}from"react";import{jsx as ro}from"react/jsx-runtime";var J=i=>{var l=i,{className:e,iconColor:o,ringColor:r,onClick:t}=l,n=X(l,["className","iconColor","ringColor","onClick"]);let{setError:s}=h();return ro("button",$(z({className:W("absolute left-4 top-4 min-[480px]:!left-6 min-[480px]:!top-6 rounded-full opacity-70 ring-offset-background text-cm-text-primary transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-cm-accent focus:ring-offset-2 disabled:pointer-events-none",e),onClick:c=>{s(null),t==null||t(c)}},n),{children:ro(Bt,{className:"w-6 h-6",style:{color:o}})}))};import{jsx as O,jsxs as rt}from"react/jsx-runtime";var Go=6;function eo({otpEmailData:e,setOtpEmailData:o}){var y,b,v,p,F,C,S,k,N,U,B,L,H,M,G,V,Z,lt,P,st;let{crossmintAuth:r}=R(),{appearance:t,setDialogOpen:n,setStep:i,setError:l}=h(),[s,c]=Ct(""),[m,x]=Ct(!1),[u,a]=Ct(!1),d=()=>w(this,null,function*(){var K,yt;a(!0);try{let bt=yield r==null?void 0:r.confirmEmailOtp((K=e==null?void 0:e.email)!=null?K:"",(yt=e==null?void 0:e.emailId)!=null?yt:"",s);yield r==null?void 0:r.handleRefreshAuthMaterial(bt),n(!1,!0),i("initial")}catch(bt){console.error("Error confirming email OTP",bt),l("Invalid code. Please try again."),x(!0)}finally{a(!1)}}),f=()=>w(this,null,function*(){var K;try{yield r==null?void 0:r.sendEmailOtp((K=e==null?void 0:e.email)!=null?K:"")}catch(yt){l("Failed to resend code. Please try again.")}});return rt("div",{children:[O(J,{onClick:()=>{i("initial"),o(null)},iconColor:(y=t==null?void 0:t.colors)==null?void 0:y.textPrimary,ringColor:(b=t==null?void 0:t.colors)==null?void 0:b.accent}),rt("div",{className:"flex flex-col items-center justify-start w-full",children:[O("div",{className:"relative left-3",children:O(Lt,{customAccentColor:(v=t==null?void 0:t.colors)==null?void 0:v.accent,customButtonBackgroundColor:(p=t==null?void 0:t.colors)==null?void 0:p.buttonBackground,customBackgroundColor:(F=t==null?void 0:t.colors)==null?void 0:F.background})}),O("p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(C=t==null?void 0:t.colors)==null?void 0:C.textPrimary},children:"Check your email"}),rt("p",{className:"text-center text-cm-text-secondary px-4",style:{color:(S=t==null?void 0:t.colors)==null?void 0:S.textSecondary},children:["A temporary login code has been sent to"," ",e!=null&&e.email?e.email:"your email address"]}),O("div",{className:"py-8",children:O(Mt,{maxLength:Go,value:s,onChange:K=>{c(K),x(!1),l(null)},onComplete:d,disabled:u,customStyles:{accent:(N=(k=t==null?void 0:t.colors)==null?void 0:k.accent)!=null?N:"#04AA6D",danger:(B=(U=t==null?void 0:t.colors)==null?void 0:U.danger)!=null?B:"#f44336",border:(H=(L=t==null?void 0:t.colors)==null?void 0:L.border)!=null?H:"#E5E7EB",textPrimary:(G=(M=t==null?void 0:t.colors)==null?void 0:M.textPrimary)!=null?G:"#909ca3",buttonBackground:(Z=(V=t==null?void 0:t.colors)==null?void 0:V.buttonBackground)!=null?Z:"#eff6ff",inputBackground:(P=(lt=t==null?void 0:t.colors)==null?void 0:lt.inputBackground)!=null?P:"#FFFFFF",borderRadius:t==null?void 0:t.borderRadius},children:rt(Ut,{children:[O(q,{index:0,hasError:m}),O(q,{index:1,hasError:m}),O(q,{index:2,hasError:m}),O(q,{index:3,hasError:m}),O(q,{index:4,hasError:m}),O(q,{index:5,hasError:m})]})})}),O("div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:rt("span",{style:{color:(st=t==null?void 0:t.colors)==null?void 0:st.textSecondary},children:["Can't find the email? Check spam folder.",`
|
|
7
|
-
`,"Some emails may take several minutes to arrive."]})}),O(Tt,{initialSeconds:60,appearance:t,countdownText:K=>`Re-send code in ${K}s`,countdownCompleteText:"Re-send code",handleOnClick:f})]})]})}import{useState as St}from"react";import Jo from"color";import{isEmailValid as ft}from"@crossmint/common-sdk-auth";import{ChildWindow as Ko,PopupWindow as Vo}from"@crossmint/client-sdk-window";import{useEffect as zo,useRef as $o,useState as qo}from"react";import{z as dt}from"zod";var Q=e=>{let{crossmintAuth:o}=R(),{oauthUrlMap:r,setError:t}=h(),[n,i]=qo(!1),l=$o(null);return zo(()=>(l.current==null&&(l.current=new Ko(window.opener||window.parent,"*",{incomingEvents:jo})),()=>{l.current!=null&&l.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:c=>w(void 0,null,function*(){if(l.current==null)throw new Error("Child window not initialized");i(!0),t(null);let m=new URL(r[e]);if(c!=null){let f=Array.from(m.searchParams.entries());m.search="",c&&m.searchParams.append("provider_login_hint",c),f.forEach(([g,y])=>{m.searchParams.append(g,y)})}let x=yield Vo.init(m.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),u=f=>w(void 0,null,function*(){var g;yield o==null?void 0:o.handleRefreshAuthMaterial(f.oneTimeSecret),(g=l.current)==null||g.off("authMaterialFromPopupCallback"),x.window.close(),i(!1)}),a=f=>{var g;t(f.error),(g=l.current)==null||g.off("errorFromPopupCallback"),x.window.close(),i(!1)};l.current.on("authMaterialFromPopupCallback",u),l.current.on("errorFromPopupCallback",a);let d=setInterval(()=>{var f,g;(f=x.window)!=null&&f.closed&&(clearInterval(d),i(!1),(g=l.current)==null||g.off("authMaterialFromPopupCallback"))},2500)}),isLoading:n}},jo={authMaterialFromPopupCallback:dt.object({oneTimeSecret:dt.string()}),errorFromPopupCallback:dt.object({error:dt.string()})};import{jsx as wt,jsxs as Xo}from"react/jsx-runtime";function no({emailInput:e,appearance:o}){var n,i,l,s;let{createPopupAndSetupListeners:r,isLoading:t}=Q("google");return Xo("button",{type:"button",className:W("flex items-center gap-2 justify-center h-[32px] px-2.5 border border-cm-border rounded-xl bg-cm-background-primary","hover:bg-cm-hover focus:bg-cm-hover outline-none",t?"cursor-not-allowed hover:bg-cm-muted-primary":""),onClick:t?void 0:()=>r(e.trim().toLowerCase()),style:{backgroundColor:(n=o==null?void 0:o.colors)==null?void 0:n.buttonBackground,borderRadius:o==null?void 0:o.borderRadius},children:[wt(ut,{className:"max-h-[18px] max-w-[18px] h-[18px] w-[18px]"}),t?wt(D,{style:{color:(i=o==null?void 0:o.colors)==null?void 0:i.textSecondary,fill:(l=o==null?void 0:o.colors)==null?void 0:l.textPrimary,width:"18px",height:"18px"}}):wt("span",{className:"text-cm-accent",style:{color:(s=o==null?void 0:o.colors)==null?void 0:s.accent},children:"Continue"})]})}import{Fragment as Qo,jsx as _,jsxs as Pt}from"react/jsx-runtime";function io({setOtpEmailData:e}){var g,y,b,v,p,F,C,S,k,N,U,B,L,H;let{crossmintAuth:o}=R(),{appearance:r,defaultEmail:t,setStep:n,setError:i,loginMethods:l}=h(),[s,c]=St(t!=null?t:""),[m,x]=St(""),[u,a]=St(!1),d=s.toLowerCase().includes("@gmail.com")&&!s.toLowerCase().includes("+")&&ft(s)&&!u&&l.includes("google");function f(M){return w(this,null,function*(){M.preventDefault(),a(!0);try{let G=s.trim().toLowerCase(),V=yield o==null?void 0:o.sendEmailOtp(G);e({email:G,emailId:V.emailId}),n("otp")}catch(G){a(!1),i("Failed to send email. Please try again or contact support.")}})}return _(Qo,{children:_("div",{className:"flex flex-col items-start justify-start w-full rounded-lg",children:Pt("div",{className:"w-full",children:[_("label",{className:"text-cm-text-primary block mb-[5px]",style:{color:(g=r==null?void 0:r.colors)==null?void 0:g.textPrimary},children:"Email"}),Pt("form",{role:"form",className:"relative",onSubmit:M=>{if(d){M.preventDefault();return}ft(s)?f(M):M.preventDefault()},noValidate:!0,children:[_("label",{htmlFor:"emailInput",className:"sr-only",children:"Email"}),_("input",{className:W("flex-grow text-cm-text-primary text-left pl-[16px] h-[58px] w-full border border-cm-border rounded-xl bg-cm-background-primary placeholder:text-md","transition-none duration-200 ease-in-out","focus:outline-none focus-ring-custom","placeholder:[color:var(--placeholder-color)]",m?"border-red-500":"",d?"pr-[132px]":"pr-[80px]"),style:{color:(y=r==null?void 0:r.colors)==null?void 0:y.textPrimary,borderRadius:r==null?void 0:r.borderRadius,borderColor:m?(b=r==null?void 0:r.colors)==null?void 0:b.danger:(v=r==null?void 0:r.colors)==null?void 0:v.border,backgroundColor:(p=r==null?void 0:r.colors)==null?void 0:p.inputBackground,"--placeholder-color":(C=(F=r==null?void 0:r.colors)==null?void 0:F.textSecondary)!=null?C:"#67797F","--focus-ring-color":new Jo((k=(S=r==null?void 0:r.colors)==null?void 0:S.accent)!=null?k:"#04AA6D").alpha(.18).toString()},type:"email",placeholder:"your@email.com",value:s,onChange:M=>{c(M.target.value),x(""),i(null)},readOnly:u,"aria-describedby":"emailError"}),Pt("div",{className:"absolute inset-y-0 right-0 flex items-center pr-4",children:[m&&_(mt,{customColor:(N=r==null?void 0:r.colors)==null?void 0:N.danger}),u&&_(D,{style:{color:(U=r==null?void 0:r.colors)==null?void 0:U.textSecondary,fill:(B=r==null?void 0:r.colors)==null?void 0:B.textPrimary}}),d?_(no,{emailInput:s,appearance:r}):!m&&!u?_("button",{type:"submit",className:W("font-medium text-cm-accent text-nowrap bg-cm-background-primary",ft(s)?"cursor-pointer":"!cursor-not-allowed opacity-60"),style:{color:(L=r==null?void 0:r.colors)==null?void 0:L.accent,backgroundColor:(H=r==null?void 0:r.colors)==null?void 0:H.inputBackground},disabled:!ft(s)||u,children:"Submit"}):null]})]}),m&&_("p",{className:"text-xs text-red-500 mb-2 pt-2",children:m})]})})})}import{jsx as lo}from"react/jsx-runtime";function so(){let{step:e}=h(),[o,r]=Yo(null);return e==="otp"?lo(eo,{otpEmailData:o,setOtpEmailData:r}):e==="initial"?lo(io,{setOtpEmailData:r}):null}import{jsx as At,jsxs as Zo}from"react/jsx-runtime";function mo({appearance:e,text:o}){var t,n,i;let{step:r}=h();return r!=="initial"?null:Zo("div",{className:"flex items-center justify-center w-full pt-2 pb-3",children:[At("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(t=e==null?void 0:e.colors)==null?void 0:t.border}}),o!=null?At("p",{className:"flex-none px-2 text-sm text-cm-text-primary",style:{color:(n=e==null?void 0:e.colors)==null?void 0:n.textSecondary},children:o}):null,At("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.border}})]})}import{Fragment as tr,jsx as gt,jsxs as uo}from"react/jsx-runtime";function ao(o){var e=X(o,[]);var c,m,x,u;let{step:r,appearance:t,isLoadingOauthUrlMap:n}=h(),{createPopupAndSetupListeners:i,isLoading:l}=Q("google"),s=n||l;return r!=="initial"?null:uo("button",$(z({className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",s?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(c=t==null?void 0:t.colors)==null?void 0:c.buttonBackground},onClick:s?void 0:()=>i()},e),{children:[uo(tr,{children:[gt(ut,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),s?gt(D,{style:{color:(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary,fill:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary}}):gt("span",{className:"font-medium",style:{margin:"0px 32px",color:(u=t==null?void 0:t.colors)==null?void 0:u.textPrimary},children:"Sign in with Google"})]}),gt("span",{className:"sr-only",children:"Sign in with Google"})]}))}import{useEffect as Et,useMemo as or,useState as rr}from"react";import{useSignIn as er,QRCode as nr}from"@farcaster/auth-kit";import{Fragment as lr,jsx as I,jsxs as et}from"react/jsx-runtime";function co(){var n,i;let{step:e,appearance:o,setStep:r,setError:t}=h();return e==="initial"?I("div",{children:et("button",{className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(n=o==null?void 0:o.colors)==null?void 0:n.buttonBackground},onClick:()=>{r("qrCode"),t(null)},children:[I(Dt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),I("span",{className:"font-medium",style:{margin:"0px 32px",color:(i=o==null?void 0:o.colors)==null?void 0:i.textPrimary},children:"Sign in with Farcaster"}),I("span",{className:"sr-only",children:"Sign in with Farcaster"})]})}):e==="qrCode"?I(ir,{}):null}function ir(){var f,g,y,b,v,p,F,C,S;let{crossmintAuth:e}=R(),{appearance:o,setStep:r,setDialogOpen:t,setError:n}=h(),[i,l]=rr(null),s=or(()=>({onSuccess:k=>{l(k)}}),[]),{signIn:c,url:m,connect:x,signOut:u,isConnected:a}=er(s),d=k=>w(this,null,function*(){n(null);try{let N=yield e==null?void 0:e.signInWithFarcaster(k);yield e==null?void 0:e.handleRefreshAuthMaterial(N),t(!1),r("initial")}catch(N){console.error("Error during Farcaster sign-in:",N),n("Failed to sign in with Farcaster")}});return Et(()=>{i!=null&&d(i)},[i]),Et(()=>{a&&c()},[a]),Et(()=>{x()},[]),et("div",{children:[I(J,{onClick:()=>{u(),r("initial")},iconColor:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary,ringColor:(g=o==null?void 0:o.colors)==null?void 0:g.accent}),et("div",{className:"flex flex-col items-center gap-4",children:[et("div",{className:"text-center",children:[I("h3",{className:"text-lg font-semibold text-cm-text-primary mb-2",style:{color:(y=o==null?void 0:o.colors)==null?void 0:y.textPrimary},children:"Sign in with Farcaster"}),I("p",{className:"text-base font-normal text-cm-text-secondary",style:{color:(b=o==null?void 0:o.colors)==null?void 0:b.textSecondary},children:"Scan with your phone's camera to continue."})]}),I("div",{className:"bg-white aspect-square rounded-lg p-4",style:{backgroundColor:(v=o==null?void 0:o.colors)==null?void 0:v.inputBackground,borderRadius:o==null?void 0:o.borderRadius},children:m!=null?I(nr,{uri:m,size:280}):I("div",{className:"min-h-[246px] flex items-center justify-center",children:I(D,{style:{color:(p=o==null?void 0:o.colors)==null?void 0:p.textSecondary,fill:(F=o==null?void 0:o.colors)==null?void 0:F.textPrimary}})})}),m?et(lr,{children:[I("p",{className:"text-base text-center font-normal text-cm-text-secondary",style:{color:(C=o==null?void 0:o.colors)==null?void 0:C.textSecondary},children:"Alternatively, click on this link to open Warpcast."}),I("a",{href:m,rel:"noopener noreferrer",target:"_blank",className:"text-base font-normal text-cm-link",style:{color:(S=o==null?void 0:o.colors)==null?void 0:S.textLink},children:"Open Warpcast"})]}):null]})]})}import{Fragment as sr,jsx as ht,jsxs as fo}from"react/jsx-runtime";function go(o){var e=X(o,[]);var c,m,x,u;let{step:r,appearance:t,isLoadingOauthUrlMap:n}=h(),{createPopupAndSetupListeners:i,isLoading:l}=Q("twitter"),s=n||l;return r!=="initial"?null:fo("button",$(z({className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",s?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(c=t==null?void 0:t.colors)==null?void 0:c.buttonBackground},onClick:s?void 0:()=>i()},e),{children:[fo(sr,{children:[ht(Gt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),s?ht(D,{style:{color:(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary,fill:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary}}):ht("span",{className:"font-medium",style:{margin:"0px 32px",color:(u=t==null?void 0:t.colors)==null?void 0:u.textPrimary},children:"Sign in with X"})]}),ht("span",{className:"sr-only",children:"Sign in with X"})]}))}import{jsx as xt,jsxs as mr}from"react/jsx-runtime";function ho(){var n,i,l,s,c;let{step:e,appearance:o,setStep:r,setError:t}=h();return e!=="initial"?null:mr("button",{className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:o==null?void 0:o.borderRadius,borderColor:(n=o==null?void 0:o.colors)==null?void 0:n.border,backgroundColor:(i=o==null?void 0:o.colors)==null?void 0:i.buttonBackground},onClick:()=>{r("web3"),t(null)},children:[xt(Vt,{className:"h-[21px] w-[21px] absolute left-[20px]",style:{color:(l=o==null?void 0:o.colors)==null?void 0:l.textPrimary}}),xt("span",{className:"font-medium",style:{margin:"0px 32px",color:(s=o==null?void 0:o.colors)==null?void 0:s.textPrimary},children:"Continue with a wallet"}),xt(Kt,{className:"h-[21px] w-[21px] absolute right-[20px]",style:{color:(c=o==null?void 0:o.colors)==null?void 0:c.textSecondary}}),xt("span",{className:"sr-only",children:"Continue with a wallet"})]})}import{DynamicEmbeddedWidget as ur}from"@dynamic-labs/sdk-react-core";import{Fragment as ar,jsx as nt,jsxs as cr}from"react/jsx-runtime";function xo(){var t,n;let{appearance:e,step:o,setStep:r}=h();return o==="web3"?cr(ar,{children:[nt(J,{onClick:()=>r("initial"),iconColor:(t=e==null?void 0:e.colors)==null?void 0:t.textPrimary,ringColor:(n=e==null?void 0:e.colors)==null?void 0:n.accent}),nt("div",{className:"flex flex-col items-center",children:nt("div",{className:"flex flex-col gap-[10px] w-full",children:nt("div",{className:"widget-container",children:nt(ur,{background:"none"})})})})]}):null}import{jsx as yo}from"react/jsx-runtime";function bo(){let{step:e}=h();return e.startsWith("web3")?yo(xo,{}):e==="initial"?yo(ho,{}):null}import{jsx as T,jsxs as it}from"react/jsx-runtime";function vo({className:e}){var c,m,x,u,a,d,f,g,y,b,v,p,F;let{step:o,appearance:r,loginMethods:t,baseUrl:n,error:i,termsOfServiceText:l,authModalTitle:s}=h();return it("div",{className:W("relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",e),children:[i!=null?it("div",{className:"flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",style:{backgroundColor:new dr((m=(c=r==null?void 0:r.colors)==null?void 0:c.danger)!=null?m:"#f44336").alpha(.12).toString()},children:[T("div",{className:"min-w-[20px]",children:T(mt,{customColor:(u=(x=r==null?void 0:r.colors)==null?void 0:x.danger)!=null?u:"#f44336"})}),T("p",{className:"ml-2 text-sm",style:{color:(d=(a=r==null?void 0:r.colors)==null?void 0:a.danger)!=null?d:"#f44336"},children:i})]}):null,o==="initial"?it("div",{children:[T("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=r==null?void 0:r.colors)==null?void 0:f.textPrimary},children:s!=null?s:"Sign in to Crossmint"}),T("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(g=r==null?void 0:r.colors)==null?void 0:g.textSecondary},children:"Access using one of the options below."})]}):null,t.includes("google")?T(ao,{}):null,t.includes("farcaster")?T(Ht,{baseUrl:n,children:T(co,{})}):null,t.includes("twitter")?T(go,{}):null,t.some(C=>C.startsWith("web3"))?T(bo,{}):null,t.includes("email")?it("div",{children:[t.length>1?T(mo,{appearance:r,text:"OR"}):null,T(so,{})]}):null,o==="initial"&&l!=null?it("div",{className:"text-sm text-center text-cm-text-secondary mt-2",style:{color:(y=r==null?void 0:r.colors)==null?void 0:y.textSecondary},children:[T("style",{children:`
|
|
8
|
-
p a {
|
|
9
|
-
color: ${(v=(b=r==null?void 0:r.colors)==null?void 0:b.textLink)!=null?v:"#1A74E9"};
|
|
10
|
-
}
|
|
11
|
-
`}),l]}):null,o==="initial"||o==="otp"?T(_t,{className:"mt-1.5 md:mt-4 justify-center",color:(F=(p=r==null?void 0:r.colors)==null?void 0:p.textSecondary)!=null?F:"#67797F"}):null]})}import{useEffect as fr}from"react";import{jsx as Y,jsxs as gr}from"react/jsx-runtime";function at({open:e}){var t,n,i;let{appearance:o,setDialogOpen:r}=h();return fr(()=>{document.body.style.overflow=e?"hidden":""},[e]),Y(Wt,{modal:!1,open:e,onOpenChange:r,children:gr(Nt,{onInteractOutside:l=>l.preventDefault(),onOpenAutoFocus:l=>l.preventDefault(),closeButtonColor:(t=o==null?void 0:o.colors)==null?void 0:t.textPrimary,closeButtonRingColor:(n=o==null?void 0:o.colors)==null?void 0:n.accent,className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(i=o==null?void 0:o.colors)==null?void 0:i.background},children:[Y(po,{asChild:!0,children:Y(Ot,{children:"Crossmint Auth"})}),Y(po,{asChild:!0,children:Y(It,{children:"Sign in via Crossmint"})}),Y(vo,{className:"max-w-[448px]"})]})})}export{at as a,Xt as b,pt as c,Br as d,R as e,h as f,Zt as g,J as h,Go as i,eo as j,Q as k,no as l,io as m,so as n,mo as o,ao as p,co as q,go as r,ho as s,xo as t,bo as u,vo as v};
|
package/dist/chunk-YFJ5I6XR.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkBR77Q3PKcjs = require('./chunk-BR77Q3PK.cjs');var _chunkPZ3KXKJDcjs = require('./chunk-PZ3KXKJD.cjs');var _chunkAHD64NAJcjs = require('./chunk-AHD64NAJ.cjs');var _chunkHLGNSXEQcjs = require('./chunk-HLGNSXEQ.cjs');var _chunkHG5ML6KXcjs = require('./chunk-HG5ML6KX.cjs');var _chunkZ2FGFHRQcjs = require('./chunk-Z2FGFHRQ.cjs');var _chunkWMBBIP2Ccjs = require('./chunk-WMBBIP2C.cjs');var _chunkDCACW4K6cjs = require('./chunk-DCACW4K6.cjs');var _chunkX4BUSZRJcjs = require('./chunk-X4BUSZRJ.cjs');var _chunkWABJHG6Bcjs = require('./chunk-WABJHG6B.cjs');var _chunkZBQCXWMDcjs = require('./chunk-ZBQCXWMD.cjs');var _chunkTXOVDTYKcjs = require('./chunk-TXOVDTYK.cjs');var _chunkYXF74MVIcjs = require('./chunk-YXF74MVI.cjs');var _chunkI4GMMHQRcjs = require('./chunk-I4GMMHQR.cjs');var _chunkSRQAQHYKcjs = require('./chunk-SRQAQHYK.cjs');var _chunkE65EGG73cjs = require('./chunk-E65EGG73.cjs');var _chunkTM7WDKYRcjs = require('./chunk-TM7WDKYR.cjs');var _chunkNRN4WNQLcjs = require('./chunk-NRN4WNQL.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _react = require('react');var _commonsdkauth = require('@crossmint/common-sdk-auth');var _clientsdkauth = require('@crossmint/client-sdk-auth');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _sdkreactcore = require('@dynamic-labs/sdk-react-core');var _ethereum = require('@dynamic-labs/ethereum');var _solana = require('@dynamic-labs/solana');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _jsxruntime = require('react/jsx-runtime');function Po({children:e,enabled:o,onSdkLoaded:r,onWalletConnected:t,jwt:n}){let{primaryWallet:i,sdkHasLoaded:l,removeWallet:s,handleUnlinkWallet:c}=_sdkreactcore.useDynamicContext.call(void 0, ),m=!o||l;return _react.useEffect.call(void 0, ()=>{m&&(r==null||r(m))},[m,r]),_react.useEffect.call(void 0, ()=>{n==null&&m&&i!=null&&(s(i.id),c(i.id))},[n,m,i,s,c]),_react.useEffect.call(void 0, ()=>{function x(){return _chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{if(_ethereum.isEthereumWallet.call(void 0, i)){let u=yield i.getWalletClient(),a={type:"external-wallet",address:u.account.address,viemAccount:_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},u.account),{signMessage:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){return yield u.signMessage({message:d.message})})})};t(a)}else if(_solana.isSolanaWallet.call(void 0, i)){let u=yield i.getSigner(),a={type:"external-wallet",address:i.address,onSignTransaction:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){return yield u.signTransaction(d)})};t(a)}else throw new Error("Unsupported wallet type")}catch(u){throw console.error("Failed to get admin signer",u),new Error("Failed to get admin signer")}})}i!=null&&n!=null&&x()},[i,n,t]),e}function jt({children:e,enabled:o=!0,apiKeyEnvironment:r,loginMethods:t=["web3"],appearance:n,onSdkLoaded:i,onWalletConnected:l}){var u,a;let{crossmintAuth:s,jwt:c}=L(),m=_react.useMemo.call(void 0, ()=>{var d,f;return`.powered-by-dynamic { display: none !important; }
|
|
2
|
-
.wallet-list__scroll-container { padding: 0px !important; }
|
|
3
|
-
.wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; }
|
|
4
|
-
.dynamic-footer { display: none !important; }
|
|
5
|
-
h1 { color: ${(d=n==null?void 0:n.colors)==null?void 0:d.textPrimary} !important; }
|
|
6
|
-
* { color: ${(f=n==null?void 0:n.colors)==null?void 0:f.textSecondary} !important; }`},[(u=n==null?void 0:n.colors)==null?void 0:u.textPrimary,(a=n==null?void 0:n.colors)==null?void 0:a.textSecondary]),x=_react.useMemo.call(void 0, ()=>{if(o)return t.includes("web3:evm-only")?[_ethereum.EthereumWalletConnectors]:t.includes("web3:solana-only")?[_solana.SolanaWalletConnectors]:[_ethereum.EthereumWalletConnectors,_solana.SolanaWalletConnectors]},[o,t]);return _jsxruntime.jsx.call(void 0, _chunkAHD64NAJcjs.a,{apiKeyEnvironment:r,settings:{walletConnectors:x,cssOverrides:m,events:{onAuthFailure(d,f){console.error("[DynamicWalletProvider] onAuthFailure",d,f)}},handlers:{handleConnectedWallet:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var g;if(!s)return console.error("[DynamicWalletProvider] crossmintAuth is not available"),!1;let f=d.address;if(f==null)return console.error("[DynamicWalletProvider] handleConnectedWallet: address is missing"),!1;try{let b=(yield _chunkPZ3KXKJDcjs.b.call(void 0, d))==="solana"?"solana":"evm",v=yield s.signInWithSmartWallet(f,b);if((v==null?void 0:v.challenge)==null)throw new Error("No challenge received from signInWithSmartWallet");let p=yield(g=d.connector)==null?void 0:g.proveOwnership(f,v.challenge);if(p==null)throw new Error("Failed to get signature from wallet");let E=p;if(b==="solana"){let S=Buffer.from(p,"base64");E=_bs582.default.encode(S)}let C=yield s.authenticateSmartWallet(f,b,E);if((C==null?void 0:C.oneTimeSecret)==null)throw new Error("No oneTimeSecret received from authenticateSmartWallet");return yield s.handleRefreshAuthMaterial(C.oneTimeSecret),!0}catch(y){return console.error("[DynamicWalletProvider] Error handling wallet connection:",y),!1}})}},children:_jsxruntime.jsx.call(void 0, Po,{enabled:o,onSdkLoaded:i,onWalletConnected:l,jwt:c,children:e})},`${r}-${t.join(",")}`)}var Io={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},experimental_externalWalletSigner:void 0},vt= exports.c =_react.createContext.call(void 0, Io);function Rr({children:e,appearance:o,termsOfServiceText:r,prefetchOAuthUrls:t=!0,authModalTitle:n,onLoginSuccess:i,loginMethods:l=["email","google"],refreshRoute:s,logoutRoute:c}){let{crossmint:m}=_clientsdkreactbase.useCrossmint.call(void 0, "CrossmintAuthProvider must be used within CrossmintProvider"),[x,u]=_react.useState.call(void 0, void 0),[a,d]=_react.useState.call(void 0, void 0),f=_commonsdkbase.validateApiKeyAndGetCrossmintBaseUrl.call(void 0, m.apiKey),[g,y]=_react.useState.call(void 0, !1),[b,v]=_react.useState.call(void 0, !1),[p,E]=_react.useState.call(void 0, void 0),[C,S]=_react.useState.call(void 0, !0),F=l.some(P=>P.startsWith("web3")),[W,M]=_react.useState.call(void 0, void 0),R=_react.useRef.call(void 0, null),U=_react.useMemo.call(void 0, ()=>(R.current||(R.current=_clientsdkauth.CrossmintAuth.from(m,{callbacks:{onLogout:()=>{u(void 0),d(void 0)},onTokenRefresh:P=>{u(P.user),d(P.jwt)}},refreshRoute:s,logoutRoute:c})),R.current),[]),_=_react.useCallback.call(void 0, ()=>{i==null||i()},[i]);_react.useEffect.call(void 0, ()=>{if(a==null){let P=_clientsdkauth.getCookie.call(void 0, _commonsdkauth.SESSION_PREFIX);d(P)}v(!0)},[a]),_react.useEffect.call(void 0, ()=>{a!=null&&g&&(y(!1),_())},[a,g,_]);let T=_react.useCallback.call(void 0, P=>{if(a!=null){console.log("User already logged in");return}P!=null&&typeof P=="string"&&E(P),y(!0)},[a]),H=_react.useCallback.call(void 0, ()=>{U.logout()},[U]),K=_react.useCallback.call(void 0, ()=>!b||F&&!C?"initializing":a!=null?"logged-in":g?"in-progress":"logged-out",[b,F,C,a,g]),Y=_react.useCallback.call(void 0, ()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){if(a==null){console.log("User not logged in");return}let P=yield U.getUser();return u(P),P}),[a,U]),it=_react.useMemo.call(void 0, ()=>({crossmintAuth:U,login:T,logout:H,jwt:a,user:x,experimental_externalWalletSigner:W,status:K(),getUser:Y}),[U,T,H,a,x,K,Y,W]);return _jsxruntime.jsx.call(void 0, _chunkX4BUSZRJcjs.a,{children:_jsxruntime.jsx.call(void 0, vt.Provider,{value:it,children:_jsxruntime.jsx.call(void 0, Yt,{setDialogOpen:(P,lt)=>{y(P),lt&&_()},preFetchOAuthUrls:K()==="logged-out"&&t,initialState:{appearance:o,loginMethods:l,termsOfServiceText:r,authModalTitle:n,baseUrl:f,defaultEmail:p},children:F?_jsxruntime.jsxs.call(void 0, jt,{apiKeyEnvironment:m.apiKey.includes("production")?"production":"staging",loginMethods:l,appearance:o,onSdkLoaded:S,onWalletConnected:M,children:[e,_jsxruntime.jsx.call(void 0, ut,{open:g})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e,_jsxruntime.jsx.call(void 0, ut,{open:g})]})})})})}function L(){let e=_react.useContext.call(void 0, vt);if(!e)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return e}var Zt={google:"",twitter:""},to=_react.createContext.call(void 0, void 0),h= exports.f =()=>{let e=_react.useContext.call(void 0, to);if(!e)throw new Error("useAuthForm must be used within an AuthFormProvider");return e},Yt= exports.g =({setDialogOpen:e,preFetchOAuthUrls:o,initialState:r,children:t})=>{let{crossmintAuth:n}=L(),[i,l]=_react.useState.call(void 0, "initial"),[s,c]=_react.useState.call(void 0, null),[m,x]=_react.useState.call(void 0, Zt),[u,a]=_react.useState.call(void 0, !0),{loginMethods:d,baseUrl:f,appearance:g,termsOfServiceText:y,authModalTitle:b,defaultEmail:v}=r,p=_react.useCallback.call(void 0, ()=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){a(!0);try{let F=d.filter(M=>M in Zt).map(M=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){let R=yield n==null?void 0:n.getOAuthUrl(M);return{[M]:R}})),W=Object.assign({},...yield Promise.all(F));x(W)}catch(S){c(S instanceof _commonsdkauth.CrossmintAuthenticationError?S.message:"Unable to load oauth providers. Please try again later.")}finally{a(!1)}}),[d,n]);_react.useEffect.call(void 0, ()=>{o&&p()},[p,o]);let C={step:i,error:s,baseUrl:f,appearance:g,termsOfServiceText:y,authModalTitle:b,loginMethods:d,defaultEmail:v,oauthUrlMap:m,isLoadingOauthUrlMap:u,setDialogOpen:(S,F)=>{e==null||e(S,F),S||setTimeout(()=>l("initial"),250)},setError:c,setStep:l};return _jsxruntime.jsx.call(void 0, to.Provider,{value:C,children:t})};var _color = require('color'); var _color2 = _interopRequireDefault(_color);var X=i=>{var l=i,{className:e,iconColor:o,ringColor:r,onClick:t}=l,n=_chunk2WSEHVNPcjs.c.call(void 0, l,["className","iconColor","ringColor","onClick"]);let{setError:s}=h();return _jsxruntime.jsx.call(void 0, "button",_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {className:_chunkWABJHG6Bcjs.a.call(void 0, "absolute left-4 top-4 min-[480px]:!left-6 min-[480px]:!top-6 rounded-full opacity-70 ring-offset-background text-cm-text-primary transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-cm-accent focus:ring-offset-2 disabled:pointer-events-none",e),onClick:c=>{s(null),t==null||t(c)}},n),{children:_jsxruntime.jsx.call(void 0, _chunkTM7WDKYRcjs.a,{className:"w-6 h-6",style:{color:o}})}))};var Ho=6;function ro({otpEmailData:e,setOtpEmailData:o}){var y,b,v,p,E,C,S,F,W,M,R,U,_,T,H,K,Y,it,P,lt;let{crossmintAuth:r}=L(),{appearance:t,setDialogOpen:n,setStep:i,setError:l}=h(),[s,c]=_react.useState.call(void 0, ""),[m,x]=_react.useState.call(void 0, !1),[u,a]=_react.useState.call(void 0, !1),d=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var G,xt;a(!0);try{let yt=yield r==null?void 0:r.confirmEmailOtp((G=e==null?void 0:e.email)!=null?G:"",(xt=e==null?void 0:e.emailId)!=null?xt:"",s);yield r==null?void 0:r.handleRefreshAuthMaterial(yt),n(!1,!0),i("initial")}catch(yt){console.error("Error confirming email OTP",yt),l("Invalid code. Please try again."),x(!0)}finally{a(!1)}}),f=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var G;try{yield r==null?void 0:r.sendEmailOtp((G=e==null?void 0:e.email)!=null?G:"")}catch(xt){l("Failed to resend code. Please try again.")}});return _jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, X,{onClick:()=>{i("initial"),o(null)},iconColor:(y=t==null?void 0:t.colors)==null?void 0:y.textPrimary,ringColor:(b=t==null?void 0:t.colors)==null?void 0:b.accent}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col items-center justify-start w-full",children:[_jsxruntime.jsx.call(void 0, "div",{className:"relative left-3",children:_jsxruntime.jsx.call(void 0, _chunkI4GMMHQRcjs.a,{customAccentColor:(v=t==null?void 0:t.colors)==null?void 0:v.accent,customButtonBackgroundColor:(p=t==null?void 0:t.colors)==null?void 0:p.buttonBackground,customBackgroundColor:(E=t==null?void 0:t.colors)==null?void 0:E.background})}),_jsxruntime.jsx.call(void 0, "p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(C=t==null?void 0:t.colors)==null?void 0:C.textPrimary},children:"Check your email"}),_jsxruntime.jsxs.call(void 0, "p",{className:"text-center text-cm-text-secondary px-4",style:{color:(S=t==null?void 0:t.colors)==null?void 0:S.textSecondary},children:["A temporary login code has been sent to"," ",e!=null&&e.email?e.email:"your email address"]}),_jsxruntime.jsx.call(void 0, "div",{className:"py-8",children:_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.a,{maxLength:Ho,value:s,onChange:G=>{c(G),x(!1),l(null)},onComplete:d,disabled:u,customStyles:{accent:(W=(F=t==null?void 0:t.colors)==null?void 0:F.accent)!=null?W:"#04AA6D",danger:(R=(M=t==null?void 0:t.colors)==null?void 0:M.danger)!=null?R:"#f44336",border:(_=(U=t==null?void 0:t.colors)==null?void 0:U.border)!=null?_:"#E5E7EB",textPrimary:(H=(T=t==null?void 0:t.colors)==null?void 0:T.textPrimary)!=null?H:"#909ca3",buttonBackground:(Y=(K=t==null?void 0:t.colors)==null?void 0:K.buttonBackground)!=null?Y:"#eff6ff",inputBackground:(P=(it=t==null?void 0:t.colors)==null?void 0:it.inputBackground)!=null?P:"#FFFFFF",borderRadius:t==null?void 0:t.borderRadius},children:_jsxruntime.jsxs.call(void 0, _chunkHG5ML6KXcjs.b,{children:[_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:0,hasError:m}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:1,hasError:m}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:2,hasError:m}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:3,hasError:m}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:4,hasError:m}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:5,hasError:m})]})})}),_jsxruntime.jsx.call(void 0, "div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:_jsxruntime.jsxs.call(void 0, "span",{style:{color:(lt=t==null?void 0:t.colors)==null?void 0:lt.textSecondary},children:["Can't find the email? Check spam folder.",`
|
|
7
|
-
`,"Some emails may take several minutes to arrive."]})}),_jsxruntime.jsx.call(void 0, _chunkHLGNSXEQcjs.a,{initialSeconds:60,appearance:t,countdownText:G=>`Re-send code in ${G}s`,countdownCompleteText:"Re-send code",handleOnClick:f})]})]})}var _clientsdkwindow = require('@crossmint/client-sdk-window');var _zod = require('zod');var J=e=>{let{crossmintAuth:o}=L(),{oauthUrlMap:r,setError:t}=h(),[n,i]=_react.useState.call(void 0, !1),l=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>(l.current==null&&(l.current=new (0, _clientsdkwindow.ChildWindow)(window.opener||window.parent,"*",{incomingEvents:qo})),()=>{l.current!=null&&l.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:c=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){if(l.current==null)throw new Error("Child window not initialized");i(!0),t(null);let m=new URL(r[e]);if(c!=null){let f=Array.from(m.searchParams.entries());m.search="",c&&m.searchParams.append("provider_login_hint",c),f.forEach(([g,y])=>{m.searchParams.append(g,y)})}let x=yield _clientsdkwindow.PopupWindow.init(m.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),u=f=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){var g;yield o==null?void 0:o.handleRefreshAuthMaterial(f.oneTimeSecret),(g=l.current)==null||g.off("authMaterialFromPopupCallback"),x.window.close(),i(!1)}),a=f=>{var g;t(f.error),(g=l.current)==null||g.off("errorFromPopupCallback"),x.window.close(),i(!1)};l.current.on("authMaterialFromPopupCallback",u),l.current.on("errorFromPopupCallback",a);let d=setInterval(()=>{var f,g;(f=x.window)!=null&&f.closed&&(clearInterval(d),i(!1),(g=l.current)==null||g.off("authMaterialFromPopupCallback"))},2500)}),isLoading:n}},qo={authMaterialFromPopupCallback:_zod.z.object({oneTimeSecret:_zod.z.string()}),errorFromPopupCallback:_zod.z.object({error:_zod.z.string()})};function eo({emailInput:e,appearance:o}){var n,i,l,s;let{createPopupAndSetupListeners:r,isLoading:t}=J("google");return _jsxruntime.jsxs.call(void 0, "button",{type:"button",className:_chunkWABJHG6Bcjs.a.call(void 0, "flex items-center gap-2 justify-center h-[32px] px-2.5 border border-cm-border rounded-xl bg-cm-background-primary","hover:bg-cm-hover focus:bg-cm-hover outline-none",t?"cursor-not-allowed hover:bg-cm-muted-primary":""),onClick:t?void 0:()=>r(e.trim().toLowerCase()),style:{backgroundColor:(n=o==null?void 0:o.colors)==null?void 0:n.buttonBackground,borderRadius:o==null?void 0:o.borderRadius},children:[_jsxruntime.jsx.call(void 0, _chunkE65EGG73cjs.a,{className:"max-h-[18px] max-w-[18px] h-[18px] w-[18px]"}),t?_jsxruntime.jsx.call(void 0, _chunkZ2FGFHRQcjs.a,{style:{color:(i=o==null?void 0:o.colors)==null?void 0:i.textSecondary,fill:(l=o==null?void 0:o.colors)==null?void 0:l.textPrimary,width:"18px",height:"18px"}}):_jsxruntime.jsx.call(void 0, "span",{className:"text-cm-accent",style:{color:(s=o==null?void 0:o.colors)==null?void 0:s.accent},children:"Continue"})]})}function no({setOtpEmailData:e}){var g,y,b,v,p,E,C,S,F,W,M,R,U,_;let{crossmintAuth:o}=L(),{appearance:r,defaultEmail:t,setStep:n,setError:i,loginMethods:l}=h(),[s,c]=_react.useState.call(void 0, t!=null?t:""),[m,x]=_react.useState.call(void 0, ""),[u,a]=_react.useState.call(void 0, !1),d=s.toLowerCase().includes("@gmail.com")&&!s.toLowerCase().includes("+")&&_commonsdkauth.isEmailValid.call(void 0, s)&&!u&&l.includes("google");function f(T){return _chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){T.preventDefault(),a(!0);try{let H=s.trim().toLowerCase(),K=yield o==null?void 0:o.sendEmailOtp(H);e({email:H,emailId:K.emailId}),n("otp")}catch(H){a(!1),i("Failed to send email. Please try again or contact support.")}})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col items-start justify-start w-full rounded-lg",children:_jsxruntime.jsxs.call(void 0, "div",{className:"w-full",children:[_jsxruntime.jsx.call(void 0, "label",{className:"text-cm-text-primary block mb-[5px]",style:{color:(g=r==null?void 0:r.colors)==null?void 0:g.textPrimary},children:"Email"}),_jsxruntime.jsxs.call(void 0, "form",{role:"form",className:"relative",onSubmit:T=>{if(d){T.preventDefault();return}_commonsdkauth.isEmailValid.call(void 0, s)?f(T):T.preventDefault()},noValidate:!0,children:[_jsxruntime.jsx.call(void 0, "label",{htmlFor:"emailInput",className:"sr-only",children:"Email"}),_jsxruntime.jsx.call(void 0, "input",{className:_chunkWABJHG6Bcjs.a.call(void 0, "flex-grow text-cm-text-primary text-left pl-[16px] h-[58px] w-full border border-cm-border rounded-xl bg-cm-background-primary placeholder:text-md","transition-none duration-200 ease-in-out","focus:outline-none focus-ring-custom","placeholder:[color:var(--placeholder-color)]",m?"border-red-500":"",d?"pr-[132px]":"pr-[80px]"),style:{color:(y=r==null?void 0:r.colors)==null?void 0:y.textPrimary,borderRadius:r==null?void 0:r.borderRadius,borderColor:m?(b=r==null?void 0:r.colors)==null?void 0:b.danger:(v=r==null?void 0:r.colors)==null?void 0:v.border,backgroundColor:(p=r==null?void 0:r.colors)==null?void 0:p.inputBackground,"--placeholder-color":(C=(E=r==null?void 0:r.colors)==null?void 0:E.textSecondary)!=null?C:"#67797F","--focus-ring-color":new (0, _color2.default)((F=(S=r==null?void 0:r.colors)==null?void 0:S.accent)!=null?F:"#04AA6D").alpha(.18).toString()},type:"email",placeholder:"your@email.com",value:s,onChange:T=>{c(T.target.value),x(""),i(null)},readOnly:u,"aria-describedby":"emailError"}),_jsxruntime.jsxs.call(void 0, "div",{className:"absolute inset-y-0 right-0 flex items-center pr-4",children:[m&&_jsxruntime.jsx.call(void 0, _chunkNRN4WNQLcjs.a,{customColor:(W=r==null?void 0:r.colors)==null?void 0:W.danger}),u&&_jsxruntime.jsx.call(void 0, _chunkZ2FGFHRQcjs.a,{style:{color:(M=r==null?void 0:r.colors)==null?void 0:M.textSecondary,fill:(R=r==null?void 0:r.colors)==null?void 0:R.textPrimary}}),d?_jsxruntime.jsx.call(void 0, eo,{emailInput:s,appearance:r}):!m&&!u?_jsxruntime.jsx.call(void 0, "button",{type:"submit",className:_chunkWABJHG6Bcjs.a.call(void 0, "font-medium text-cm-accent text-nowrap bg-cm-background-primary",_commonsdkauth.isEmailValid.call(void 0, s)?"cursor-pointer":"!cursor-not-allowed opacity-60"),style:{color:(U=r==null?void 0:r.colors)==null?void 0:U.accent,backgroundColor:(_=r==null?void 0:r.colors)==null?void 0:_.inputBackground},disabled:!_commonsdkauth.isEmailValid.call(void 0, s)||u,children:"Submit"}):null]})]}),m&&_jsxruntime.jsx.call(void 0, "p",{className:"text-xs text-red-500 mb-2 pt-2",children:m})]})})})}function lo(){let{step:e}=h(),[o,r]=_react.useState.call(void 0, null);return e==="otp"?_jsxruntime.jsx.call(void 0, ro,{otpEmailData:o,setOtpEmailData:r}):e==="initial"?_jsxruntime.jsx.call(void 0, no,{setOtpEmailData:r}):null}function so({appearance:e,text:o}){var t,n,i;let{step:r}=h();return r!=="initial"?null:_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-center w-full pt-2 pb-3",children:[_jsxruntime.jsx.call(void 0, "span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(t=e==null?void 0:e.colors)==null?void 0:t.border}}),o!=null?_jsxruntime.jsx.call(void 0, "p",{className:"flex-none px-2 text-sm text-cm-text-primary",style:{color:(n=e==null?void 0:e.colors)==null?void 0:n.textSecondary},children:o}):null,_jsxruntime.jsx.call(void 0, "span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.border}})]})}function uo(o){var e=_chunk2WSEHVNPcjs.c.call(void 0, o,[]);var c,m,x,u;let{step:r,appearance:t,isLoadingOauthUrlMap:n}=h(),{createPopupAndSetupListeners:i,isLoading:l}=J("google"),s=n||l;return r!=="initial"?null:_jsxruntime.jsxs.call(void 0, "button",_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {className:_chunkWABJHG6Bcjs.a.call(void 0, "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",s?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(c=t==null?void 0:t.colors)==null?void 0:c.buttonBackground},onClick:s?void 0:()=>i()},e),{children:[_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkE65EGG73cjs.a,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),s?_jsxruntime.jsx.call(void 0, _chunkZ2FGFHRQcjs.a,{style:{color:(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary,fill:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary}}):_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",style:{margin:"0px 32px",color:(u=t==null?void 0:t.colors)==null?void 0:u.textPrimary},children:"Sign in with Google"})]}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Sign in with Google"})]}))}var _authkit = require('@farcaster/auth-kit');function ao(){var n,i;let{step:e,appearance:o,setStep:r,setError:t}=h();return e==="initial"?_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsxs.call(void 0, "button",{className:_chunkWABJHG6Bcjs.a.call(void 0, "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(n=o==null?void 0:o.colors)==null?void 0:n.buttonBackground},onClick:()=>{r("qrCode"),t(null)},children:[_jsxruntime.jsx.call(void 0, _chunkSRQAQHYKcjs.a,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",style:{margin:"0px 32px",color:(i=o==null?void 0:o.colors)==null?void 0:i.textPrimary},children:"Sign in with Farcaster"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Sign in with Farcaster"})]})}):e==="qrCode"?_jsxruntime.jsx.call(void 0, nr,{}):null}function nr(){var f,g,y,b,v,p,E,C,S;let{crossmintAuth:e}=L(),{appearance:o,setStep:r,setDialogOpen:t,setError:n}=h(),[i,l]=_react.useState.call(void 0, null),s=_react.useMemo.call(void 0, ()=>({onSuccess:F=>{l(F)}}),[]),{signIn:c,url:m,connect:x,signOut:u,isConnected:a}=_authkit.useSignIn.call(void 0, s),d=F=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){n(null);try{let W=yield e==null?void 0:e.signInWithFarcaster(F);yield e==null?void 0:e.handleRefreshAuthMaterial(W),t(!1),r("initial")}catch(W){console.error("Error during Farcaster sign-in:",W),n("Failed to sign in with Farcaster")}});return _react.useEffect.call(void 0, ()=>{i!=null&&d(i)},[i]),_react.useEffect.call(void 0, ()=>{a&&c()},[a]),_react.useEffect.call(void 0, ()=>{x()},[]),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, X,{onClick:()=>{u(),r("initial")},iconColor:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary,ringColor:(g=o==null?void 0:o.colors)==null?void 0:g.accent}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col items-center gap-4",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"text-center",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-lg font-semibold text-cm-text-primary mb-2",style:{color:(y=o==null?void 0:o.colors)==null?void 0:y.textPrimary},children:"Sign in with Farcaster"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-base font-normal text-cm-text-secondary",style:{color:(b=o==null?void 0:o.colors)==null?void 0:b.textSecondary},children:"Scan with your phone's camera to continue."})]}),_jsxruntime.jsx.call(void 0, "div",{className:"bg-white aspect-square rounded-lg p-4",style:{backgroundColor:(v=o==null?void 0:o.colors)==null?void 0:v.inputBackground,borderRadius:o==null?void 0:o.borderRadius},children:m!=null?_jsxruntime.jsx.call(void 0, _authkit.QRCode,{uri:m,size:280}):_jsxruntime.jsx.call(void 0, "div",{className:"min-h-[246px] flex items-center justify-center",children:_jsxruntime.jsx.call(void 0, _chunkZ2FGFHRQcjs.a,{style:{color:(p=o==null?void 0:o.colors)==null?void 0:p.textSecondary,fill:(E=o==null?void 0:o.colors)==null?void 0:E.textPrimary}})})}),m?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-base text-center font-normal text-cm-text-secondary",style:{color:(C=o==null?void 0:o.colors)==null?void 0:C.textSecondary},children:"Alternatively, click on this link to open Warpcast."}),_jsxruntime.jsx.call(void 0, "a",{href:m,rel:"noopener noreferrer",target:"_blank",className:"text-base font-normal text-cm-link",style:{color:(S=o==null?void 0:o.colors)==null?void 0:S.textLink},children:"Open Warpcast"})]}):null]})]})}function fo(o){var e=_chunk2WSEHVNPcjs.c.call(void 0, o,[]);var c,m,x,u;let{step:r,appearance:t,isLoadingOauthUrlMap:n}=h(),{createPopupAndSetupListeners:i,isLoading:l}=J("twitter"),s=n||l;return r!=="initial"?null:_jsxruntime.jsxs.call(void 0, "button",_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {className:_chunkWABJHG6Bcjs.a.call(void 0, "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",s?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(c=t==null?void 0:t.colors)==null?void 0:c.buttonBackground},onClick:s?void 0:()=>i()},e),{children:[_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkZBQCXWMDcjs.a,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),s?_jsxruntime.jsx.call(void 0, _chunkZ2FGFHRQcjs.a,{style:{color:(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary,fill:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary}}):_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",style:{margin:"0px 32px",color:(u=t==null?void 0:t.colors)==null?void 0:u.textPrimary},children:"Sign in with X"})]}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Sign in with X"})]}))}function go(){var n,i,l,s,c;let{step:e,appearance:o,setStep:r,setError:t}=h();return e!=="initial"?null:_jsxruntime.jsxs.call(void 0, "button",{className:_chunkWABJHG6Bcjs.a.call(void 0, "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:o==null?void 0:o.borderRadius,borderColor:(n=o==null?void 0:o.colors)==null?void 0:n.border,backgroundColor:(i=o==null?void 0:o.colors)==null?void 0:i.buttonBackground},onClick:()=>{r("web3"),t(null)},children:[_jsxruntime.jsx.call(void 0, _chunkTXOVDTYKcjs.a,{className:"h-[21px] w-[21px] absolute left-[20px]",style:{color:(l=o==null?void 0:o.colors)==null?void 0:l.textPrimary}}),_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",style:{margin:"0px 32px",color:(s=o==null?void 0:o.colors)==null?void 0:s.textPrimary},children:"Continue with a wallet"}),_jsxruntime.jsx.call(void 0, _chunkYXF74MVIcjs.a,{className:"h-[21px] w-[21px] absolute right-[20px]",style:{color:(c=o==null?void 0:o.colors)==null?void 0:c.textSecondary}}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Continue with a wallet"})]})}function ho(){var t,n;let{appearance:e,step:o,setStep:r}=h();return o==="web3"?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, X,{onClick:()=>r("initial"),iconColor:(t=e==null?void 0:e.colors)==null?void 0:t.textPrimary,ringColor:(n=e==null?void 0:e.colors)==null?void 0:n.accent}),_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col items-center",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col gap-[10px] w-full",children:_jsxruntime.jsx.call(void 0, "div",{className:"widget-container",children:_jsxruntime.jsx.call(void 0, _sdkreactcore.DynamicEmbeddedWidget,{background:"none"})})})})]}):null}function yo(){let{step:e}=h();return e.startsWith("web3")?_jsxruntime.jsx.call(void 0, ho,{}):e==="initial"?_jsxruntime.jsx.call(void 0, go,{}):null}function bo({className:e}){var c,m,x,u,a,d,f,g,y,b,v,p,E;let{step:o,appearance:r,loginMethods:t,baseUrl:n,error:i,termsOfServiceText:l,authModalTitle:s}=h();return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkWABJHG6Bcjs.a.call(void 0, "relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",e),children:[i!=null?_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",style:{backgroundColor:new (0, _color2.default)((m=(c=r==null?void 0:r.colors)==null?void 0:c.danger)!=null?m:"#f44336").alpha(.12).toString()},children:[_jsxruntime.jsx.call(void 0, "div",{className:"min-w-[20px]",children:_jsxruntime.jsx.call(void 0, _chunkNRN4WNQLcjs.a,{customColor:(u=(x=r==null?void 0:r.colors)==null?void 0:x.danger)!=null?u:"#f44336"})}),_jsxruntime.jsx.call(void 0, "p",{className:"ml-2 text-sm",style:{color:(d=(a=r==null?void 0:r.colors)==null?void 0:a.danger)!=null?d:"#f44336"},children:i})]}):null,o==="initial"?_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=r==null?void 0:r.colors)==null?void 0:f.textPrimary},children:s!=null?s:"Sign in to Crossmint"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(g=r==null?void 0:r.colors)==null?void 0:g.textSecondary},children:"Access using one of the options below."})]}):null,t.includes("google")?_jsxruntime.jsx.call(void 0, uo,{}):null,t.includes("farcaster")?_jsxruntime.jsx.call(void 0, _chunkBR77Q3PKcjs.a,{baseUrl:n,children:_jsxruntime.jsx.call(void 0, ao,{})}):null,t.includes("twitter")?_jsxruntime.jsx.call(void 0, fo,{}):null,t.some(C=>C.startsWith("web3"))?_jsxruntime.jsx.call(void 0, yo,{}):null,t.includes("email")?_jsxruntime.jsxs.call(void 0, "div",{children:[t.length>1?_jsxruntime.jsx.call(void 0, so,{appearance:r,text:"OR"}):null,_jsxruntime.jsx.call(void 0, lo,{})]}):null,o==="initial"&&l!=null?_jsxruntime.jsxs.call(void 0, "div",{className:"text-sm text-center text-cm-text-secondary mt-2",style:{color:(y=r==null?void 0:r.colors)==null?void 0:y.textSecondary},children:[_jsxruntime.jsx.call(void 0, "style",{children:`
|
|
8
|
-
p a {
|
|
9
|
-
color: ${(v=(b=r==null?void 0:r.colors)==null?void 0:b.textLink)!=null?v:"#1A74E9"};
|
|
10
|
-
}
|
|
11
|
-
`}),l]}):null,o==="initial"||o==="otp"?_jsxruntime.jsx.call(void 0, _chunkDCACW4K6cjs.a,{className:"mt-1.5 md:mt-4 justify-center",color:(E=(p=r==null?void 0:r.colors)==null?void 0:p.textSecondary)!=null?E:"#67797F"}):null]})}function ut({open:e}){var t,n,i;let{appearance:o,setDialogOpen:r}=h();return _react.useEffect.call(void 0, ()=>{document.body.style.overflow=e?"hidden":""},[e]),_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.a,{modal:!1,open:e,onOpenChange:r,children:_jsxruntime.jsxs.call(void 0, _chunkWMBBIP2Ccjs.e,{onInteractOutside:l=>l.preventDefault(),onOpenAutoFocus:l=>l.preventDefault(),closeButtonColor:(t=o==null?void 0:o.colors)==null?void 0:t.textPrimary,closeButtonRingColor:(n=o==null?void 0:o.colors)==null?void 0:n.accent,className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(i=o==null?void 0:o.colors)==null?void 0:i.background},children:[_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.h,{children:"Crossmint Auth"})}),_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.i,{children:"Sign in via Crossmint"})}),_jsxruntime.jsx.call(void 0, bo,{className:"max-w-[448px]"})]})})}exports.a = ut; exports.b = jt; exports.c = vt; exports.d = Rr; exports.e = L; exports.f = h; exports.g = Yt; exports.h = X; exports.i = Ho; exports.j = ro; exports.k = J; exports.l = eo; exports.m = no; exports.n = lo; exports.o = so; exports.p = uo; exports.q = ao; exports.r = fo; exports.s = go; exports.t = ho; exports.u = yo; exports.v = bo;
|