@crossmint/client-sdk-react-ui 1.19.7 → 1.19.9
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-QPBY6GHR.js → chunk-5BXXLAWX.js} +1 -1
- package/dist/{chunk-PAFTETXB.cjs → chunk-6PEDYC4S.cjs} +1 -1
- package/dist/chunk-AHO6ZTD2.cjs +1 -0
- package/dist/{chunk-ZVZ7KLDM.cjs → chunk-CIGMIRYX.cjs} +1 -1
- package/dist/{chunk-P6KZZFMN.js → chunk-CKR7ABFW.js} +1 -1
- package/dist/chunk-D62R34F3.js +2 -0
- package/dist/chunk-DGY7DTSC.cjs +1 -0
- package/dist/{chunk-HGPXIJB2.cjs → chunk-GY76BK5I.cjs} +1 -1
- package/dist/{chunk-WKSSGLTC.cjs → chunk-H54CRMEQ.cjs} +1 -1
- package/dist/{chunk-MOMGK6GU.js → chunk-HBSCE5TU.js} +1 -1
- package/dist/chunk-HIVWKWQ2.cjs +2 -0
- package/dist/{chunk-26QXTVTD.js → chunk-J54ERKZL.js} +4 -4
- package/dist/{chunk-GUOPBGI6.js → chunk-JP6T2HVY.js} +1 -1
- package/dist/chunk-JSOMGEEA.js +1 -0
- package/dist/chunk-JWA56FBI.js +1 -0
- package/dist/{chunk-DNXADGE4.js → chunk-KGZOWR44.js} +1 -1
- package/dist/{chunk-Q44TPO65.js → chunk-M4AWQSCA.js} +1 -1
- package/dist/{chunk-XOTUO4GO.cjs → chunk-NCWJDSRP.cjs} +1 -1
- package/dist/{chunk-MJALIOKN.js → chunk-NHUYPXEI.js} +1 -1
- package/dist/chunk-P7UQAP6A.js +1 -0
- package/dist/{chunk-UAM6TFAI.cjs → chunk-QKR6RK7Z.cjs} +1 -1
- package/dist/{chunk-MAASDVPK.js → chunk-QMQP2KTH.js} +1 -1
- package/dist/{chunk-JZQOBQNU.cjs → chunk-S5T3GYI3.cjs} +4 -4
- package/dist/{chunk-HZQXNBDC.cjs → chunk-SGT4OXVI.cjs} +1 -1
- package/dist/{chunk-2CV3B7AI.cjs → chunk-TG2MSP6L.cjs} +1 -1
- package/dist/{chunk-EPDUGAIT.js → chunk-UFHM5ZWE.js} +1 -1
- package/dist/{chunk-QI5LRA6N.cjs → chunk-WVFDLJP5.cjs} +1 -1
- package/dist/{chunk-ETGKGBBJ.cjs → chunk-XPHJ7AFY.cjs} +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/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/components/signers/EmailConfirmation.cjs +1 -0
- package/dist/components/signers/EmailConfirmation.d.cts +12 -0
- package/dist/components/signers/EmailConfirmation.d.ts +12 -0
- package/dist/components/signers/EmailConfirmation.js +1 -0
- package/dist/components/signers/EmailOTPInput.cjs +1 -1
- package/dist/components/signers/EmailOTPInput.d.cts +2 -3
- package/dist/components/signers/EmailOTPInput.d.ts +2 -3
- package/dist/components/signers/EmailOTPInput.js +1 -1
- package/dist/components/signers/EmailSignersDialog.cjs +1 -1
- package/dist/components/signers/EmailSignersDialog.d.cts +1 -3
- package/dist/components/signers/EmailSignersDialog.d.ts +1 -3
- package/dist/components/signers/EmailSignersDialog.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.js +1 -1
- package/dist/hooks/useCrossmintAuth.cjs +1 -1
- 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.js +1 -1
- package/dist/hooks/useWallet.cjs +1 -1
- package/dist/hooks/useWallet.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/CrossmintWalletProvider.cjs +1 -1
- package/dist/providers/CrossmintWalletProvider.js +1 -1
- package/dist/providers/auth/AuthFormProvider.cjs +1 -1
- package/dist/providers/auth/AuthFormProvider.js +1 -1
- package/dist/providers/auth/web3/DynamicWeb3WalletConnect.cjs +1 -1
- package/dist/providers/auth/web3/DynamicWeb3WalletConnect.js +1 -1
- package/dist/providers/index.cjs +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/providers/signers/CrossmintSignerProvider.cjs +1 -1
- package/dist/providers/signers/CrossmintSignerProvider.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-7YHGBWRD.js +0 -1
- package/dist/chunk-DHPMTHPR.js +0 -1
- package/dist/chunk-EAYBW3VK.cjs +0 -2
- package/dist/chunk-LOA5MXSU.js +0 -2
- package/dist/chunk-QUO652MG.cjs +0 -1
- package/dist/chunk-RB7BW66E.js +0 -1
- package/dist/chunk-RML5QI3S.cjs +0 -1
- package/dist/components/signers/EmailInput.cjs +0 -1
- package/dist/components/signers/EmailInput.d.cts +0 -12
- package/dist/components/signers/EmailInput.d.ts +0 -12
- package/dist/components/signers/EmailInput.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-CKR7ABFW.js";import{b as o}from"./chunk-ROJ6HFVK.js";import{createContext as h,useContext as l,useEffect as g,useState as s}from"react";import{jsx as k}from"react/jsx-runtime";var d=h(void 0);function b({children:e}){let[r,c]=s(void 0),[u,C]=s(void 0),{crossmint:m}=o(),a=i(m,{usageOrigin:"client"});return g(()=>{let n=t=>{if(t.origin!==new URL(a.baseUrl).origin||t.data.event!=="order:updated")return;let{order:f,orderClientSecret:p}=t.data.data;c(f),C(p)};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[r]),k(d.Provider,{value:{order:r,orderClientSecret:u},children:e})}function S(){let e=l(d);if(!e)throw new Error("useCrossmintCheckout must be used within a CrossmintCheckoutProvider");return e}export{b as a,S as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkH54CRMEQcjs = require('./chunk-H54CRMEQ.cjs');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');function n(r){_clientsdkbase.assertValidValidateNFTDetailProps.call(void 0, r);let o=_clientsdkbase.getNFTDetailSrc.call(void 0, r,_chunkH54CRMEQcjs.a);return _jsxruntime.jsx.call(void 0, "iframe",{src:o,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-details"})}exports.a = n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDGY7DTSCcjs = require('./chunk-DGY7DTSC.cjs');var _chunkHIVWKWQ2cjs = require('./chunk-HIVWKWQ2.cjs');var _chunkWMBBIP2Ccjs = require('./chunk-WMBBIP2C.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _jsxruntime = require('react/jsx-runtime');function E({email:t,open:D,setOpen:n,step:s,onSubmitOTP:b,onResendOTPCode:c,onSubmitEmail:v,appearance:o}){var m,r,d;return _jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.a,{modal:!1,open:D,onOpenChange:n,children:_jsxruntime.jsxs.call(void 0, _chunkWMBBIP2Ccjs.e,{onInteractOutside:l=>l.preventDefault(),onOpenAutoFocus:l=>l.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(m=o==null?void 0:o.colors)==null?void 0:m.background},children:[_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.h,{children:"Confirm it's you"})}),_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.i,{children:"Create a recovery key"})}),_jsxruntime.jsxs.call(void 0, "div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none max-w-[448px]",children:[s==="initial"?_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-4",children:[_jsxruntime.jsx.call(void 0, "h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(r=o==null?void 0:o.colors)==null?void 0:r.textPrimary},children:"Confirm it's you"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(d=o==null?void 0:o.colors)==null?void 0:d.textSecondary},children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code."})]}):null,s==="otp"?_jsxruntime.jsx.call(void 0, _chunkHIVWKWQ2cjs.a,{email:t,onSubmitOTP:b,onResendCode:()=>c(t),appearance:o}):_jsxruntime.jsx.call(void 0, _chunkDGY7DTSCcjs.a,{email:t,onConfirm:v,onCancel:()=>n(!1),appearance:o})]})]})})}exports.a = E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNCWJDSRPcjs = require('./chunk-NCWJDSRP.cjs');var _chunkGPQZG7HCcjs = require('./chunk-GPQZG7HC.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var d=_react.createContext.call(void 0, void 0);function O({children:e}){let[r,c]=_react.useState.call(void 0, void 0),[u,C]=_react.useState.call(void 0, void 0),{crossmint:m}=_chunkGPQZG7HCcjs.b.call(void 0, ),a=_chunkNCWJDSRPcjs.a.call(void 0, m,{usageOrigin:"client"});return _react.useEffect.call(void 0, ()=>{let n=t=>{if(t.origin!==new URL(a.baseUrl).origin||t.data.event!=="order:updated")return;let{order:f,orderClientSecret:p}=t.data.data;c(f),C(p)};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[r]),_jsxruntime.jsx.call(void 0, d.Provider,{value:{order:r,orderClientSecret:u},children:e})}function b(){let e=_react.useContext.call(void 0, d);if(!e)throw new Error("useCrossmintCheckout must be used within a CrossmintCheckoutProvider");return e}exports.a = O; exports.b = b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-JWA56FBI.js";import{CrossmintApiClient as e}from"@crossmint/common-sdk-base";function m(t,i){return new e(t,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-ui",version:n},apiKeyExpectations:i}})}export{m as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as R}from"./chunk-EMXNIC4M.js";import{a as G,b as L,c as s}from"./chunk-VHNBXIOC.js";import{a as U}from"./chunk-C3JRTLQP.js";import{d as A}from"./chunk-PXDN3KFO.js";import{useState as r}from"react";import{jsx as t,jsxs as d}from"react/jsx-runtime";function W({email:D,onSubmitOTP:H,onResendCode:n,appearance:o}){var y,P,v,c,h,k,E,b,O,T,C,I,e,B,S,N,F,w;let[x,$]=r(""),[l,m]=r(!1),[j,f]=r(!1),[g,u]=r(null),q=()=>A(this,null,function*(){f(!0);try{yield H(x),m(!1),u(null)}catch(i){console.error("Error confirming recovery key OTP",i),u("Invalid code. Please try again."),m(!0)}finally{f(!1)}});return d("div",{className:"flex flex-col items-center justify-start w-full",children:[t("div",{className:"relative left-3",children:t(U,{customAccentColor:(y=o==null?void 0:o.colors)==null?void 0:y.accent,customButtonBackgroundColor:(P=o==null?void 0:o.colors)==null?void 0:P.buttonBackground,customBackgroundColor:(v=o==null?void 0:o.colors)==null?void 0:v.background})}),t("p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(c=o==null?void 0:o.colors)==null?void 0:c.textPrimary},children:"Check your email"}),d("p",{className:"text-center text-cm-text-secondary px-4",style:{color:(h=o==null?void 0:o.colors)==null?void 0:h.textSecondary},children:["A temporary login code has been sent to ",D]}),t("div",{className:"py-8",children:t(G,{maxLength:6,value:x,onChange:i=>{$(i),m(!1),u(null)},onComplete:q,disabled:j,customStyles:{accent:(E=(k=o==null?void 0:o.colors)==null?void 0:k.accent)!=null?E:"#04AA6D",danger:(O=(b=o==null?void 0:o.colors)==null?void 0:b.danger)!=null?O:"#f44336",border:(C=(T=o==null?void 0:o.colors)==null?void 0:T.border)!=null?C:"#E5E7EB",textPrimary:(e=(I=o==null?void 0:o.colors)==null?void 0:I.textPrimary)!=null?e:"#909ca3",buttonBackground:(S=(B=o==null?void 0:o.colors)==null?void 0:B.buttonBackground)!=null?S:"#eff6ff",inputBackground:(F=(N=o==null?void 0:o.colors)==null?void 0:N.inputBackground)!=null?F:"#FFFFFF",borderRadius:o==null?void 0:o.borderRadius},children:d(L,{children:[t(s,{index:0,hasError:l}),t(s,{index:1,hasError:l}),t(s,{index:2,hasError:l}),t(s,{index:3,hasError:l}),t(s,{index:4,hasError:l}),t(s,{index:5,hasError:l})]})})}),g&&t("div",{className:"text-sm text-red-500 mb-4",children:g}),t("div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:d("span",{style:{color:(w=o==null?void 0:o.colors)==null?void 0:w.textSecondary},children:["Can't find the email? Check spam folder.",`
|
|
2
|
+
`,"Some emails may take several minutes to arrive."]})}),n&&t(R,{initialSeconds:60,appearance:o,countdownText:i=>`Re-send code in ${i}s`,countdownCompleteText:"Re-send code",handleOnClick:n})]})}export{W as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ2FGFHRQcjs = require('./chunk-Z2FGFHRQ.cjs');var _chunkWABJHG6Bcjs = require('./chunk-WABJHG6B.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function L({email:s,onConfirm:h,onCancel:y,appearance:t}){var m,c,u;let[i,l]=_react.useState.call(void 0, !1),[r,g]=_react.useState.call(void 0, ""),C=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){l(!0);try{yield h(s)}catch(w){console.error("Error sending authorization code:",w),g("Failed to send code. Please try again.")}finally{l(!1)}}),b=((m=t==null?void 0:t.colors)==null?void 0:m.accent)||"#4CAF50",n=((c=t==null?void 0:t.colors)==null?void 0:c.textPrimary)||"#000000",d=((u=t==null?void 0:t.colors)==null?void 0:u.border)||"#E0E0E0";return _jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col w-full max-w-md mx-auto rounded-xl",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"mb-2",style:{color:n},children:"Send authorization code to"}),_jsxruntime.jsx.call(void 0, "div",{className:"w-full mb-8 p-4 rounded-xl border",style:{borderColor:d},children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center",children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex-shrink-0 mr-3",children:_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-mail-icon lucide-mail",children:[_jsxruntime.jsx.call(void 0, "path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}),_jsxruntime.jsx.call(void 0, "rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"})]})}),_jsxruntime.jsx.call(void 0, "span",{style:{color:n},children:s})]})}),r&&_jsxruntime.jsx.call(void 0, "div",{className:"text-red-500 mb-4 text-sm",children:r}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-3",children:[_jsxruntime.jsx.call(void 0, "button",{onClick:y,className:"flex-1 py-4 px-6 border rounded-full text-center font-medium",style:{borderColor:d},children:"Cancel"}),_jsxruntime.jsx.call(void 0, "button",{onClick:C,disabled:i,className:_chunkWABJHG6Bcjs.a.call(void 0, "flex-1 py-4 px-6 rounded-full text-white text-center font-medium",i?"opacity-70":""),style:{backgroundColor:b},children:i?_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center items-center",children:_jsxruntime.jsx.call(void 0, _chunkZ2FGFHRQcjs.a,{style:{color:"white"}})}):"Send code"})]})]})}exports.a = L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkH54CRMEQcjs = require('./chunk-H54CRMEQ.cjs');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');function m(o){_clientsdkbase.assertValidNFTCollectionViewProps.call(void 0, o);let i=_clientsdkbase.getNFTCollectionViewSrc.call(void 0, o,_chunkH54CRMEQcjs.a);return _jsxruntime.jsx.call(void 0, "iframe",{src:i,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-collection-view"})}exports.a = m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="1.19.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="1.19.9";var c=s;exports.a = c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-JWA56FBI.js";import{assertValidNFTCollectionViewProps as r,getNFTCollectionViewSrc as t}from"@crossmint/client-sdk-base";import{jsx as n}from"react/jsx-runtime";function w(o){r(o);let i=t(o,e);return n("iframe",{src:i,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-collection-view"})}export{w as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHLGNSXEQcjs = require('./chunk-HLGNSXEQ.cjs');var _chunkHG5ML6KXcjs = require('./chunk-HG5ML6KX.cjs');var _chunkI4GMMHQRcjs = require('./chunk-I4GMMHQR.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function V({email:D,onSubmitOTP:H,onResendCode:n,appearance:o}){var y,P,v,c,h,k,E,b,O,T,C,I,e,B,S,N,F,w;let[x,$]=_react.useState.call(void 0, ""),[l,m]=_react.useState.call(void 0, !1),[j,f]=_react.useState.call(void 0, !1),[g,u]=_react.useState.call(void 0, null),q=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){f(!0);try{yield H(x),m(!1),u(null)}catch(i){console.error("Error confirming recovery key OTP",i),u("Invalid code. Please try again."),m(!0)}finally{f(!1)}});return _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:(y=o==null?void 0:o.colors)==null?void 0:y.accent,customButtonBackgroundColor:(P=o==null?void 0:o.colors)==null?void 0:P.buttonBackground,customBackgroundColor:(v=o==null?void 0:o.colors)==null?void 0:v.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=o==null?void 0:o.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:(h=o==null?void 0:o.colors)==null?void 0:h.textSecondary},children:["A temporary login code has been sent to ",D]}),_jsxruntime.jsx.call(void 0, "div",{className:"py-8",children:_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.a,{maxLength:6,value:x,onChange:i=>{$(i),m(!1),u(null)},onComplete:q,disabled:j,customStyles:{accent:(E=(k=o==null?void 0:o.colors)==null?void 0:k.accent)!=null?E:"#04AA6D",danger:(O=(b=o==null?void 0:o.colors)==null?void 0:b.danger)!=null?O:"#f44336",border:(C=(T=o==null?void 0:o.colors)==null?void 0:T.border)!=null?C:"#E5E7EB",textPrimary:(e=(I=o==null?void 0:o.colors)==null?void 0:I.textPrimary)!=null?e:"#909ca3",buttonBackground:(S=(B=o==null?void 0:o.colors)==null?void 0:B.buttonBackground)!=null?S:"#eff6ff",inputBackground:(F=(N=o==null?void 0:o.colors)==null?void 0:N.inputBackground)!=null?F:"#FFFFFF",borderRadius:o==null?void 0:o.borderRadius},children:_jsxruntime.jsxs.call(void 0, _chunkHG5ML6KXcjs.b,{children:[_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:0,hasError:l}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:1,hasError:l}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:2,hasError:l}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:3,hasError:l}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:4,hasError:l}),_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:5,hasError:l})]})})}),g&&_jsxruntime.jsx.call(void 0, "div",{className:"text-sm text-red-500 mb-4",children:g}),_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:(w=o==null?void 0:o.colors)==null?void 0:w.textSecondary},children:["Can't find the email? Check spam folder.",`
|
|
2
|
+
`,"Some emails may take several minutes to arrive."]})}),n&&_jsxruntime.jsx.call(void 0, _chunkHLGNSXEQcjs.a,{initialSeconds:60,appearance:o,countdownText:i=>`Re-send code in ${i}s`,countdownCompleteText:"Re-send code",handleOnClick:n})]})}exports.a = V;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
`,"Some emails may take several minutes to arrive."]})}),L(Kt,{initialSeconds:60,appearance:t,countdownText:R=>`Re-send code in ${R}s`,countdownCompleteText:"Re-send code",handleOnClick:h})]})]})}import{useState as kt}from"react";import no from"color";import{isEmailValid as wt}from"@crossmint/common-sdk-auth";import{ChildWindow as Qe,PopupWindow as Ye}from"@crossmint/client-sdk-window";import{useEffect as Ze,useRef as to,useState as eo}from"react";import{z as ht}from"zod";var tt=r=>{let{crossmintAuth:e}=K(),{oauthUrlMap:o,setError:t}=v(),[s,i]=eo(!1),n=to(null);return Ze(()=>(n.current==null&&(n.current=new Qe(window.opener||window.parent,"*",{incomingEvents:oo})),()=>{n.current!=null&&n.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:u=>C(void 0,null,function*(){if(n.current==null)throw new Error("Child window not initialized");i(!0),t(null);let c=new URL(o[r]);if(u!=null){let h=Array.from(c.searchParams.entries());c.search="",u&&c.searchParams.append("provider_login_hint",u),h.forEach(([d,x])=>{c.searchParams.append(d,x)})}let m=yield Ye.init(c.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),p=h=>C(void 0,null,function*(){var d;yield e==null?void 0:e.handleRefreshAuthMaterial(h.oneTimeSecret),(d=n.current)==null||d.off("authMaterialFromPopupCallback"),m.window.close(),i(!1)}),a=h=>{var d;t(h.error),(d=n.current)==null||d.off("errorFromPopupCallback"),m.window.close(),i(!1)};n.current.on("authMaterialFromPopupCallback",p),n.current.on("errorFromPopupCallback",a);let w=setInterval(()=>{var h;m.window.closed&&(clearInterval(w),i(!1),(h=n.current)==null||h.off("authMaterialFromPopupCallback"))},2500)}),isLoading:s}},oo={authMaterialFromPopupCallback:ht.object({oneTimeSecret:ht.string()}),errorFromPopupCallback:ht.object({error:ht.string()})};import{jsx as Wt,jsxs as ro}from"react/jsx-runtime";function pe({emailInput:r,appearance:e}){var s,i,n,l;let{createPopupAndSetupListeners:o,isLoading:t}=tt("google");return ro("button",{type:"button",className:T("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:()=>o(r.trim().toLowerCase()),style:{backgroundColor:(s=e==null?void 0:e.colors)==null?void 0:s.buttonBackground,borderRadius:e==null?void 0:e.borderRadius},children:[Wt(pt,{className:"max-h-[18px] max-w-[18px] h-[18px] w-[18px]"}),t?Wt(G,{style:{color:(i=e==null?void 0:e.colors)==null?void 0:i.textSecondary,fill:(n=e==null?void 0:e.colors)==null?void 0:n.textPrimary,width:"18px",height:"18px"}}):Wt("span",{className:"text-cm-accent",style:{color:(l=e==null?void 0:e.colors)==null?void 0:l.accent},children:"Continue"})]})}import{Fragment as so,jsx as j,jsxs as Et}from"react/jsx-runtime";function ye({setOtpEmailData:r}){var h,d,x,y,P,A,k,S,f,b,g,W,N,H;let{crossmintAuth:e}=K(),{appearance:o,defaultEmail:t,setStep:s,setError:i}=v(),[n,l]=kt(t!=null?t:""),[u,c]=kt(""),[m,p]=kt(!1),a=n.toLowerCase().includes("@gmail.com")&&!n.toLowerCase().includes("+")&&wt(n)&&!m;function w(I){return C(this,null,function*(){I.preventDefault(),p(!0);try{let D=n.trim().toLowerCase(),V=yield e==null?void 0:e.sendEmailOtp(D);r({email:D,emailId:V.emailId}),s("otp")}catch(D){p(!1),i("Failed to send email. Please try again or contact support.")}})}return j(so,{children:j("div",{className:"flex flex-col items-start justify-start w-full rounded-lg",children:Et("div",{className:"w-full",children:[j("label",{className:"text-cm-text-primary block mb-[5px]",style:{color:(h=o==null?void 0:o.colors)==null?void 0:h.textPrimary},children:"Email"}),Et("form",{role:"form",className:"relative",onSubmit:I=>{if(a){I.preventDefault();return}wt(n)?w(I):I.preventDefault()},noValidate:!0,children:[j("label",{htmlFor:"emailInput",className:"sr-only",children:"Email"}),j("input",{className:T("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)]",u?"border-red-500":"",a?"pr-[132px]":"pr-[80px]"),style:{color:(d=o==null?void 0:o.colors)==null?void 0:d.textPrimary,borderRadius:o==null?void 0:o.borderRadius,borderColor:u?(x=o==null?void 0:o.colors)==null?void 0:x.danger:(y=o==null?void 0:o.colors)==null?void 0:y.border,backgroundColor:(P=o==null?void 0:o.colors)==null?void 0:P.inputBackground,"--placeholder-color":(k=(A=o==null?void 0:o.colors)==null?void 0:A.textSecondary)!=null?k:"#67797F","--focus-ring-color":new no((f=(S=o==null?void 0:o.colors)==null?void 0:S.accent)!=null?f:"#04AA6D").alpha(.18).toString()},type:"email",placeholder:"your@email.com",value:n,onChange:I=>{l(I.target.value),c(""),i(null)},readOnly:m,"aria-describedby":"emailError"}),Et("div",{className:"absolute inset-y-0 right-0 flex items-center pr-4",children:[u&&j(ft,{customColor:(b=o==null?void 0:o.colors)==null?void 0:b.danger}),m&&j(G,{style:{color:(g=o==null?void 0:o.colors)==null?void 0:g.textSecondary,fill:(W=o==null?void 0:o.colors)==null?void 0:W.textPrimary}}),a?j(pe,{emailInput:n,appearance:o}):!u&&!m?j("button",{type:"submit",className:T("font-medium text-cm-accent text-nowrap bg-cm-background-primary",wt(n)?"cursor-pointer":"!cursor-not-allowed opacity-60"),style:{color:(N=o==null?void 0:o.colors)==null?void 0:N.accent,backgroundColor:(H=o==null?void 0:o.colors)==null?void 0:H.inputBackground},disabled:!wt(n)||m,children:"Submit"}):null]})]}),u&&j("p",{className:"text-xs text-red-500 mb-2 pt-2",children:u})]})})})}import{jsx as he}from"react/jsx-runtime";function we(){let{step:r}=v(),[e,o]=io(null);return r==="otp"?he(ge,{otpEmailData:e,setOtpEmailData:o}):r==="initial"?he(ye,{setOtpEmailData:o}):null}import{jsx as Ot,jsxs as lo}from"react/jsx-runtime";function xe({appearance:r,text:e}){var t,s,i;let{step:o}=v();return o!=="initial"?null:lo("div",{className:"flex items-center justify-center w-full pt-2 pb-3",children:[Ot("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(t=r==null?void 0:r.colors)==null?void 0:t.border}}),e!=null?Ot("p",{className:"flex-none px-2 text-sm text-cm-text-primary",style:{color:(s=r==null?void 0:r.colors)==null?void 0:s.textSecondary},children:e}):null,Ot("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(i=r==null?void 0:r.colors)==null?void 0:i.border}})]})}import{Fragment as ao,jsx as xt,jsxs as be}from"react/jsx-runtime";function Ce(e){var r=Q(e,[]);var u,c,m,p;let{step:o,appearance:t,isLoadingOauthUrlMap:s}=v(),{createPopupAndSetupListeners:i,isLoading:n}=tt("google"),l=s||n;return o!=="initial"?null:be("button",_(B({className:T("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",l?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(u=t==null?void 0:t.colors)==null?void 0:u.buttonBackground},onClick:l?void 0:()=>i()},r),{children:[be(ao,{children:[xt(pt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),l?xt(G,{style:{color:(c=t==null?void 0:t.colors)==null?void 0:c.textSecondary,fill:(m=t==null?void 0:t.colors)==null?void 0:m.textPrimary}}):xt("span",{className:"font-medium",style:{margin:"0px 32px",color:(p=t==null?void 0:t.colors)==null?void 0:p.textPrimary},children:"Sign in with Google"})]}),xt("span",{className:"sr-only",children:"Sign in with Google"})]}))}import{useEffect as Ft,useMemo as mo,useState as uo}from"react";import{useSignIn as co,QRCode as fo}from"@farcaster/auth-kit";import{Fragment as po,jsx as U,jsxs as at}from"react/jsx-runtime";function ve(){var s,i;let{step:r,appearance:e,setStep:o,setError:t}=v();return r==="initial"?U("div",{children:at("button",{className:T("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:e==null?void 0:e.borderRadius,backgroundColor:(s=e==null?void 0:e.colors)==null?void 0:s.buttonBackground},onClick:()=>{o("qrCode"),t(null)},children:[U($t,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),U("span",{className:"font-medium",style:{margin:"0px 32px",color:(i=e==null?void 0:e.colors)==null?void 0:i.textPrimary},children:"Sign in with Farcaster"}),U("span",{className:"sr-only",children:"Sign in with Farcaster"})]})}):r==="qrCode"?U(go,{}):null}function go(){var h,d,x,y,P,A,k,S,f;let{crossmintAuth:r}=K(),{appearance:e,setStep:o,setDialogOpen:t,setError:s}=v(),[i,n]=uo(null),l=mo(()=>({onSuccess:b=>{n(b)}}),[]),{signIn:u,url:c,connect:m,signOut:p,isConnected:a}=co(l),w=b=>C(this,null,function*(){s(null);try{let g=yield r==null?void 0:r.signInWithFarcaster(b);yield r==null?void 0:r.handleRefreshAuthMaterial(g),t(!1),o("initial")}catch(g){console.error("Error during Farcaster sign-in:",g),s("Failed to sign in with Farcaster")}});return Ft(()=>{i!=null&&w(i)},[i]),Ft(()=>{a&&u()},[a]),Ft(()=>{m()},[]),at("div",{children:[U(Z,{onClick:()=>{p(),o("initial")},iconColor:(h=e==null?void 0:e.colors)==null?void 0:h.textPrimary,ringColor:(d=e==null?void 0:e.colors)==null?void 0:d.accent}),at("div",{className:"flex flex-col items-center gap-4",children:[at("div",{className:"text-center",children:[U("h3",{className:"text-lg font-semibold text-cm-text-primary mb-2",style:{color:(x=e==null?void 0:e.colors)==null?void 0:x.textPrimary},children:"Sign in with Farcaster"}),U("p",{className:"text-base font-normal text-cm-text-secondary",style:{color:(y=e==null?void 0:e.colors)==null?void 0:y.textSecondary},children:"Scan with your phone's camera to continue."})]}),U("div",{className:"bg-white aspect-square rounded-lg p-4",style:{backgroundColor:(P=e==null?void 0:e.colors)==null?void 0:P.inputBackground,borderRadius:e==null?void 0:e.borderRadius},children:c!=null?U(fo,{uri:c,size:280}):U("div",{className:"min-h-[246px] flex items-center justify-center",children:U(G,{style:{color:(A=e==null?void 0:e.colors)==null?void 0:A.textSecondary,fill:(k=e==null?void 0:e.colors)==null?void 0:k.textPrimary}})})}),c?at(po,{children:[U("p",{className:"text-base text-center font-normal text-cm-text-secondary",style:{color:(S=e==null?void 0:e.colors)==null?void 0:S.textSecondary},children:"Alternatively, click on this link to open Warpcast."}),U("a",{href:c,rel:"noopener noreferrer",target:"_blank",className:"text-base font-normal text-cm-link",style:{color:(f=e==null?void 0:e.colors)==null?void 0:f.textLink},children:"Open Warpcast"})]}):null]})]})}import{Fragment as yo,jsx as bt,jsxs as Se}from"react/jsx-runtime";function Pe(e){var r=Q(e,[]);var u,c,m,p;let{step:o,appearance:t,isLoadingOauthUrlMap:s}=v(),{createPopupAndSetupListeners:i,isLoading:n}=tt("twitter"),l=s||n;return o!=="initial"?null:Se("button",_(B({className:T("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",l?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(u=t==null?void 0:t.colors)==null?void 0:u.buttonBackground},onClick:l?void 0:()=>i()},r),{children:[Se(yo,{children:[bt(Xt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),l?bt(G,{style:{color:(c=t==null?void 0:t.colors)==null?void 0:c.textSecondary,fill:(m=t==null?void 0:t.colors)==null?void 0:m.textPrimary}}):bt("span",{className:"font-medium",style:{margin:"0px 32px",color:(p=t==null?void 0:t.colors)==null?void 0:p.textPrimary},children:"Sign in with X"})]}),bt("span",{className:"sr-only",children:"Sign in with X"})]}))}import{jsx as Ct,jsxs as ho}from"react/jsx-runtime";function Ae(){var s,i,n,l,u;let{step:r,appearance:e,setStep:o,setError:t}=v();return r!=="initial"?null:ho("button",{className:T("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:e==null?void 0:e.borderRadius,borderColor:(s=e==null?void 0:e.colors)==null?void 0:s.border,backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.buttonBackground},onClick:()=>{o("web3"),t(null)},children:[Ct(Yt,{className:"h-[21px] w-[21px] absolute left-[20px]",style:{color:(n=e==null?void 0:e.colors)==null?void 0:n.textPrimary}}),Ct("span",{className:"font-medium",style:{margin:"0px 32px",color:(l=e==null?void 0:e.colors)==null?void 0:l.textPrimary},children:"Continue with a wallet"}),Ct(Qt,{className:"h-[21px] w-[21px] absolute right-[20px]",style:{color:(u=e==null?void 0:e.colors)==null?void 0:u.textSecondary}}),Ct("span",{className:"sr-only",children:"Continue with a wallet"})]})}import{DynamicEmbeddedWidget as wo}from"@dynamic-labs/sdk-react-core";import{Fragment as xo,jsx as mt,jsxs as bo}from"react/jsx-runtime";function We(){var t,s;let{appearance:r,step:e,setStep:o}=v();return e==="web3"?bo(xo,{children:[mt(Z,{onClick:()=>o("initial"),iconColor:(t=r==null?void 0:r.colors)==null?void 0:t.textPrimary,ringColor:(s=r==null?void 0:r.colors)==null?void 0:s.accent}),mt("div",{className:"flex flex-col items-center",children:mt("div",{className:"flex flex-col gap-[10px] w-full",children:mt("div",{className:"widget-container",children:mt(wo,{background:"none"})})})})]}):null}import{jsx as ke}from"react/jsx-runtime";function Ee(){let{step:r}=v();return r.startsWith("web3")?ke(We,{}):r==="initial"?ke(Ae,{}):null}import{jsx as M,jsxs as ut}from"react/jsx-runtime";function Oe({className:r}){var u,c,m,p,a,w,h,d,x,y,P,A,k;let{step:e,appearance:o,loginMethods:t,baseUrl:s,error:i,termsOfServiceText:n,authModalTitle:l}=v();return ut("div",{className:T("relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",r),children:[i!=null?ut("div",{className:"flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",style:{backgroundColor:new Co((c=(u=o==null?void 0:o.colors)==null?void 0:u.danger)!=null?c:"#f44336").alpha(.12).toString()},children:[M("div",{className:"min-w-[20px]",children:M(ft,{customColor:(p=(m=o==null?void 0:o.colors)==null?void 0:m.danger)!=null?p:"#f44336"})}),M("p",{className:"ml-2 text-sm",style:{color:(w=(a=o==null?void 0:o.colors)==null?void 0:a.danger)!=null?w:"#f44336"},children:i})]}):null,e==="initial"?ut("div",{children:[M("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(h=o==null?void 0:o.colors)==null?void 0:h.textPrimary},children:l!=null?l:"Sign in to Crossmint"}),M("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(d=o==null?void 0:o.colors)==null?void 0:d.textSecondary},children:"Access using one of the options below."})]}):null,t.includes("google")?M(Ce,{}):null,t.includes("farcaster")?M(Jt,{baseUrl:s,children:M(ve,{})}):null,t.includes("twitter")?M(Pe,{}):null,t.some(S=>S.startsWith("web3"))?M(Ee,{}):null,t.includes("email")?ut("div",{children:[t.length>1?M(xe,{appearance:o,text:"OR"}):null,M(we,{})]}):null,e==="initial"&&n!=null?ut("div",{className:"text-sm text-center text-cm-text-secondary mt-2",style:{color:(x=o==null?void 0:o.colors)==null?void 0:x.textSecondary},children:[M("style",{children:`
|
|
1
|
+
import{a as jt}from"./chunk-P7UQAP6A.js";import{a as Jt}from"./chunk-JSNUJJQJ.js";import{b as te}from"./chunk-4KDASQO6.js";import{a as Zt}from"./chunk-LD3MRJ3F.js";import{a as Bt}from"./chunk-JOMJPVZA.js";import{a as Kt}from"./chunk-EMXNIC4M.js";import{a as Lt,e as Ut,h as Mt,i as Dt}from"./chunk-UDQUVZUQ.js";import{a as Vt,b as Ht,c as $}from"./chunk-VHNBXIOC.js";import{a as Rt}from"./chunk-2VBA64WU.js";import{a as G}from"./chunk-TNCETEEL.js";import{a as T}from"./chunk-NBJIJZGO.js";import{a as _t}from"./chunk-BFHQZOV3.js";import{a as nt}from"./chunk-C22ZEFQD.js";import{a as ee}from"./chunk-ZZYJ6XM2.js";import{a as ft}from"./chunk-RZG2PAKA.js";import{a as pt}from"./chunk-WW6GUXHG.js";import{a as qt}from"./chunk-SFDQPSSP.js";import{a as Xt}from"./chunk-JPJKOERH.js";import{a as Yt}from"./chunk-VWL76U5G.js";import{a as zt}from"./chunk-AITWNSJU.js";import{a as gt}from"./chunk-UAFW3OWA.js";import{a as Qt}from"./chunk-VLDE23JX.js";import{a as Gt}from"./chunk-C3JRTLQP.js";import{a as $t}from"./chunk-E4TBJMOO.js";import{b as Y}from"./chunk-ROJ6HFVK.js";import{a as oe}from"./chunk-WQVJJ44F.js";import{a as B,b as _,c as Q,d as C}from"./chunk-PXDN3KFO.js";import{createContext as Mo,useContext as Do,useRef as Le,useState as Nt,useEffect as Bo,useMemo as _o}from"react";import{CrossmintWallets as Ko}from"@crossmint/wallets-sdk";import{PublicKey as Vo}from"@solana/web3.js";import dt from"bs58";import{environmentToCrossmintBaseURL as Ho}from"@crossmint/common-sdk-base";import{useContext as Ve}from"react";import{createContext as De,useMemo as re,useState as le}from"react";import{createPortal as Be}from"react-dom";import{CrossmintWallets as _e}from"@crossmint/wallets-sdk";import{jsx as st,jsxs as Ke}from"react/jsx-runtime";var Pt=De({status:"not-loaded",getOrCreateWallet:()=>Promise.resolve({startedCreation:!1}),createPasskeySigner:()=>Promise.resolve(null),clearWallet:()=>{}});function ae({children:r,showPasskeyHelpers:e=!0,appearance:o,experimental_enableRecoveryKeys:t=!1,experimental_signersURL:s=void 0}){let[i,n]=le({status:"not-loaded"}),l={walletState:i,setWalletState:n,showPasskeyHelpers:e,appearance:o,experimental_enableRecoveryKeys:t};return t?st(ft,{children:st(se,{walletState:i,setWalletState:n,appearance:o,signersURL:s,children:st(ne,_(B({},l),{children:r}))})}):st(ne,_(B({},l),{children:r}))}function ne({children:r,showPasskeyHelpers:e=!0,appearance:o,walletState:t,setWalletState:s,experimental_enableRecoveryKeys:i}){let{crossmint:n}=Y("CrossmintWalletProvider must be used within CrossmintProvider"),{experimental_getOrCreateWalletWithRecoveryKey:l}=ie({enabled:i!=null?i:!1}),c=re(()=>_e.from({apiKey:n.apiKey,jwt:n==null?void 0:n.jwt}),[n.apiKey,n.jwt]),[f,m]=le({open:!1}),y=x=>C(this,null,function*(){var p,A;if(t.status=="in-progress")return{startedCreation:!1,reason:"Wallet is already loading."};if(n.jwt==null)return{startedCreation:!1,reason:'Jwt not set in "CrossmintProvider".'};try{s({status:"in-progress"});let S={onWalletCreationStart:a("create-wallet"),onWalletCreationFail:a("create-wallet-error"),onTransactionStart:a("transaction"),onTransactionFail:a("transaction-error")};switch(x.type){case"evm-smart-wallet":{let W={adminSigner:(p=x.args.adminSigner)!=null?p:{type:"evm-passkey"},linkedUser:x.args.linkedUser},P=yield c.getOrCreateWallet("evm-smart-wallet",W,{experimental_callbacks:((A=W.adminSigner)==null?void 0:A.type)==="evm-passkey"?S:void 0});s({status:"loaded",wallet:P,type:"evm-smart-wallet"});break}case"solana-smart-wallet":{let W=yield c.getOrCreateWallet("solana-smart-wallet",x.args);s({status:"loaded",wallet:W,type:"solana-smart-wallet"});break}}}catch(S){console.error("There was an error creating a wallet ",S),s(nt(S))}return{startedCreation:!0}}),a=x=>()=>new Promise(p=>{if(!e){p();return}m({type:x,open:!0,primaryActionOnClick:()=>{m({open:!1}),p()},secondaryActionOnClick:()=>{m({open:!1}),p()}})}),w=()=>{s({status:"not-loaded"})},h=(x,p)=>C(this,null,function*(){return p!=null&&(yield a(p)()),yield _t(x)}),d=re(()=>_(B({},t),{getOrCreateWallet:y,createPasskeySigner:h,clearWallet:w,experimental_getOrCreateWalletWithRecoveryKey:l}),[t,l]);return Ke(Pt.Provider,{value:d,children:[r,f.open?Be(st(Bt,{state:f,appearance:o}),document.body):null]})}function me(){let r=Ve(Pt);if(!r)throw new Error("useWallet must be used within CrossmintAuthProvider or CrossmintWalletProvider");return r}import{useContext as Uo}from"react";import{createContext as Wo,useEffect as It,useMemo as Re,useRef as ko,useState as ct,useCallback as J}from"react";import{CrossmintAuth as Eo,getCookie as Oo}from"@crossmint/client-sdk-auth";import{validateApiKeyAndGetCrossmintBaseUrl as Fo}from"@crossmint/common-sdk-base";import{SESSION_PREFIX as To}from"@crossmint/common-sdk-auth";import{VisuallyHidden as Fe}from"@radix-ui/react-visually-hidden";import{createContext as Ge,useCallback as je,useContext as ze,useEffect as qe,useState as yt}from"react";import{CrossmintAuthenticationError as $e}from"@crossmint/common-sdk-auth";import{useContext as He}from"react";function K(){let r=He(it);if(!r)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return r}import{jsx as Je}from"react/jsx-runtime";var ue={google:"",twitter:""},ce=Ge(void 0),v=()=>{let r=ze(ce);if(!r)throw new Error("useAuthForm must be used within an AuthFormProvider");return r},de=({setDialogOpen:r,preFetchOAuthUrls:e,initialState:o,children:t})=>{let{crossmintAuth:s}=K(),[i,n]=yt("initial"),[l,c]=yt(null),[f,m]=yt(ue),[y,a]=yt(!0),{loginMethods:w,baseUrl:h,appearance:d,termsOfServiceText:x,authModalTitle:p,defaultEmail:A}=o,S=je(()=>C(void 0,null,function*(){a(!0);try{let b=w.filter(O=>O in ue).map(O=>C(void 0,null,function*(){let M=yield s==null?void 0:s.getOAuthUrl(O);return{[O]:M}})),u=Object.assign({},...yield Promise.all(b));m(u)}catch(g){c(g instanceof $e?g.message:"Unable to load oauth providers. Please try again later.")}finally{a(!1)}}),[w,s]);qe(()=>{e&&S()},[S,e]);let P={step:i,error:l,baseUrl:h,appearance:d,termsOfServiceText:x,authModalTitle:p,loginMethods:w,defaultEmail:A,oauthUrlMap:f,isLoadingOauthUrlMap:y,setDialogOpen:(g,b)=>{r==null||r(g,b),g||setTimeout(()=>n("initial"),250)},setError:c,setStep:n};return Je(ce.Provider,{value:P,children:t})};import Co from"color";import{useState as io}from"react";import{useState as At}from"react";import{jsx as fe}from"react/jsx-runtime";var Z=i=>{var n=i,{className:r,iconColor:e,ringColor:o,onClick:t}=n,s=Q(n,["className","iconColor","ringColor","onClick"]);let{setError:l}=v();return fe("button",_(B({className:T("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",r),onClick:c=>{l(null),t==null||t(c)}},s),{children:fe(qt,{className:"w-6 h-6",style:{color:e}})}))};import{jsx as R,jsxs as lt}from"react/jsx-runtime";var Xe=6;function ge({otpEmailData:r,setOtpEmailData:e}){var x,p,A,S,W,P,g,b,u,O,M,H,I,D,V,X,z,F,q,rt;let{crossmintAuth:o}=K(),{appearance:t,setDialogOpen:s,setStep:i,setError:n}=v(),[l,c]=At(""),[f,m]=At(!1),[y,a]=At(!1),w=()=>C(this,null,function*(){var N,vt;a(!0);try{let St=yield o==null?void 0:o.confirmEmailOtp((N=r==null?void 0:r.email)!=null?N:"",(vt=r==null?void 0:r.emailId)!=null?vt:"",l);yield o==null?void 0:o.handleRefreshAuthMaterial(St),s(!1,!0),i("initial")}catch(St){console.error("Error confirming email OTP",St),n("Invalid code. Please try again."),m(!0)}finally{a(!1)}}),h=()=>C(this,null,function*(){var N;try{yield o==null?void 0:o.sendEmailOtp((N=r==null?void 0:r.email)!=null?N:"")}catch(vt){n("Failed to resend code. Please try again.")}});return lt("div",{children:[R(Z,{onClick:()=>{i("initial"),e(null)},iconColor:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary,ringColor:(p=t==null?void 0:t.colors)==null?void 0:p.accent}),lt("div",{className:"flex flex-col items-center justify-start w-full",children:[R("div",{className:"relative left-3",children:R(Gt,{customAccentColor:(A=t==null?void 0:t.colors)==null?void 0:A.accent,customButtonBackgroundColor:(S=t==null?void 0:t.colors)==null?void 0:S.buttonBackground,customBackgroundColor:(W=t==null?void 0:t.colors)==null?void 0:W.background})}),R("p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(P=t==null?void 0:t.colors)==null?void 0:P.textPrimary},children:"Check your email"}),lt("p",{className:"text-center text-cm-text-secondary px-4",style:{color:(g=t==null?void 0:t.colors)==null?void 0:g.textSecondary},children:["A temporary login code has been sent to"," ",r!=null&&r.email?r.email:"your email address"]}),R("div",{className:"py-8",children:R(Vt,{maxLength:Xe,value:l,onChange:N=>{c(N),m(!1),n(null)},onComplete:w,disabled:y,customStyles:{accent:(u=(b=t==null?void 0:t.colors)==null?void 0:b.accent)!=null?u:"#04AA6D",danger:(M=(O=t==null?void 0:t.colors)==null?void 0:O.danger)!=null?M:"#f44336",border:(I=(H=t==null?void 0:t.colors)==null?void 0:H.border)!=null?I:"#E5E7EB",textPrimary:(V=(D=t==null?void 0:t.colors)==null?void 0:D.textPrimary)!=null?V:"#909ca3",buttonBackground:(z=(X=t==null?void 0:t.colors)==null?void 0:X.buttonBackground)!=null?z:"#eff6ff",inputBackground:(q=(F=t==null?void 0:t.colors)==null?void 0:F.inputBackground)!=null?q:"#FFFFFF",borderRadius:t==null?void 0:t.borderRadius},children:lt(Ht,{children:[R($,{index:0,hasError:f}),R($,{index:1,hasError:f}),R($,{index:2,hasError:f}),R($,{index:3,hasError:f}),R($,{index:4,hasError:f}),R($,{index:5,hasError:f})]})})}),R("div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:lt("span",{style:{color:(rt=t==null?void 0:t.colors)==null?void 0:rt.textSecondary},children:["Can't find the email? Check spam folder.",`
|
|
2
|
+
`,"Some emails may take several minutes to arrive."]})}),R(Kt,{initialSeconds:60,appearance:t,countdownText:N=>`Re-send code in ${N}s`,countdownCompleteText:"Re-send code",handleOnClick:h})]})]})}import{useState as kt}from"react";import no from"color";import{isEmailValid as wt}from"@crossmint/common-sdk-auth";import{ChildWindow as Qe,PopupWindow as Ye}from"@crossmint/client-sdk-window";import{useEffect as Ze,useRef as to,useState as eo}from"react";import{z as ht}from"zod";var tt=r=>{let{crossmintAuth:e}=K(),{oauthUrlMap:o,setError:t}=v(),[s,i]=eo(!1),n=to(null);return Ze(()=>(n.current==null&&(n.current=new Qe(window.opener||window.parent,"*",{incomingEvents:oo})),()=>{n.current!=null&&n.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:c=>C(void 0,null,function*(){if(n.current==null)throw new Error("Child window not initialized");i(!0),t(null);let f=new URL(o[r]);if(c!=null){let h=Array.from(f.searchParams.entries());f.search="",c&&f.searchParams.append("provider_login_hint",c),h.forEach(([d,x])=>{f.searchParams.append(d,x)})}let m=yield Ye.init(f.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),y=h=>C(void 0,null,function*(){var d;yield e==null?void 0:e.handleRefreshAuthMaterial(h.oneTimeSecret),(d=n.current)==null||d.off("authMaterialFromPopupCallback"),m.window.close(),i(!1)}),a=h=>{var d;t(h.error),(d=n.current)==null||d.off("errorFromPopupCallback"),m.window.close(),i(!1)};n.current.on("authMaterialFromPopupCallback",y),n.current.on("errorFromPopupCallback",a);let w=setInterval(()=>{var h;m.window.closed&&(clearInterval(w),i(!1),(h=n.current)==null||h.off("authMaterialFromPopupCallback"))},2500)}),isLoading:s}},oo={authMaterialFromPopupCallback:ht.object({oneTimeSecret:ht.string()}),errorFromPopupCallback:ht.object({error:ht.string()})};import{jsx as Wt,jsxs as ro}from"react/jsx-runtime";function pe({emailInput:r,appearance:e}){var s,i,n,l;let{createPopupAndSetupListeners:o,isLoading:t}=tt("google");return ro("button",{type:"button",className:T("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:()=>o(r.trim().toLowerCase()),style:{backgroundColor:(s=e==null?void 0:e.colors)==null?void 0:s.buttonBackground,borderRadius:e==null?void 0:e.borderRadius},children:[Wt(pt,{className:"max-h-[18px] max-w-[18px] h-[18px] w-[18px]"}),t?Wt(G,{style:{color:(i=e==null?void 0:e.colors)==null?void 0:i.textSecondary,fill:(n=e==null?void 0:e.colors)==null?void 0:n.textPrimary,width:"18px",height:"18px"}}):Wt("span",{className:"text-cm-accent",style:{color:(l=e==null?void 0:e.colors)==null?void 0:l.accent},children:"Continue"})]})}import{Fragment as so,jsx as j,jsxs as Et}from"react/jsx-runtime";function ye({setOtpEmailData:r}){var h,d,x,p,A,S,W,P,g,b,u,O,M,H;let{crossmintAuth:e}=K(),{appearance:o,defaultEmail:t,setStep:s,setError:i}=v(),[n,l]=kt(t!=null?t:""),[c,f]=kt(""),[m,y]=kt(!1),a=n.toLowerCase().includes("@gmail.com")&&!n.toLowerCase().includes("+")&&wt(n)&&!m;function w(I){return C(this,null,function*(){I.preventDefault(),y(!0);try{let D=n.trim().toLowerCase(),V=yield e==null?void 0:e.sendEmailOtp(D);r({email:D,emailId:V.emailId}),s("otp")}catch(D){y(!1),i("Failed to send email. Please try again or contact support.")}})}return j(so,{children:j("div",{className:"flex flex-col items-start justify-start w-full rounded-lg",children:Et("div",{className:"w-full",children:[j("label",{className:"text-cm-text-primary block mb-[5px]",style:{color:(h=o==null?void 0:o.colors)==null?void 0:h.textPrimary},children:"Email"}),Et("form",{role:"form",className:"relative",onSubmit:I=>{if(a){I.preventDefault();return}wt(n)?w(I):I.preventDefault()},noValidate:!0,children:[j("label",{htmlFor:"emailInput",className:"sr-only",children:"Email"}),j("input",{className:T("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)]",c?"border-red-500":"",a?"pr-[132px]":"pr-[80px]"),style:{color:(d=o==null?void 0:o.colors)==null?void 0:d.textPrimary,borderRadius:o==null?void 0:o.borderRadius,borderColor:c?(x=o==null?void 0:o.colors)==null?void 0:x.danger:(p=o==null?void 0:o.colors)==null?void 0:p.border,backgroundColor:(A=o==null?void 0:o.colors)==null?void 0:A.inputBackground,"--placeholder-color":(W=(S=o==null?void 0:o.colors)==null?void 0:S.textSecondary)!=null?W:"#67797F","--focus-ring-color":new no((g=(P=o==null?void 0:o.colors)==null?void 0:P.accent)!=null?g:"#04AA6D").alpha(.18).toString()},type:"email",placeholder:"your@email.com",value:n,onChange:I=>{l(I.target.value),f(""),i(null)},readOnly:m,"aria-describedby":"emailError"}),Et("div",{className:"absolute inset-y-0 right-0 flex items-center pr-4",children:[c&&j(gt,{customColor:(b=o==null?void 0:o.colors)==null?void 0:b.danger}),m&&j(G,{style:{color:(u=o==null?void 0:o.colors)==null?void 0:u.textSecondary,fill:(O=o==null?void 0:o.colors)==null?void 0:O.textPrimary}}),a?j(pe,{emailInput:n,appearance:o}):!c&&!m?j("button",{type:"submit",className:T("font-medium text-cm-accent text-nowrap bg-cm-background-primary",wt(n)?"cursor-pointer":"!cursor-not-allowed opacity-60"),style:{color:(M=o==null?void 0:o.colors)==null?void 0:M.accent,backgroundColor:(H=o==null?void 0:o.colors)==null?void 0:H.inputBackground},disabled:!wt(n)||m,children:"Submit"}):null]})]}),c&&j("p",{className:"text-xs text-red-500 mb-2 pt-2",children:c})]})})})}import{jsx as he}from"react/jsx-runtime";function we(){let{step:r}=v(),[e,o]=io(null);return r==="otp"?he(ge,{otpEmailData:e,setOtpEmailData:o}):r==="initial"?he(ye,{setOtpEmailData:o}):null}import{jsx as Ot,jsxs as lo}from"react/jsx-runtime";function xe({appearance:r,text:e}){var t,s,i;let{step:o}=v();return o!=="initial"?null:lo("div",{className:"flex items-center justify-center w-full pt-2 pb-3",children:[Ot("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(t=r==null?void 0:r.colors)==null?void 0:t.border}}),e!=null?Ot("p",{className:"flex-none px-2 text-sm text-cm-text-primary",style:{color:(s=r==null?void 0:r.colors)==null?void 0:s.textSecondary},children:e}):null,Ot("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(i=r==null?void 0:r.colors)==null?void 0:i.border}})]})}import{Fragment as ao,jsx as xt,jsxs as be}from"react/jsx-runtime";function Ce(e){var r=Q(e,[]);var c,f,m,y;let{step:o,appearance:t,isLoadingOauthUrlMap:s}=v(),{createPopupAndSetupListeners:i,isLoading:n}=tt("google"),l=s||n;return o!=="initial"?null:be("button",_(B({className:T("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",l?"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:l?void 0:()=>i()},r),{children:[be(ao,{children:[xt(pt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),l?xt(G,{style:{color:(f=t==null?void 0:t.colors)==null?void 0:f.textSecondary,fill:(m=t==null?void 0:t.colors)==null?void 0:m.textPrimary}}):xt("span",{className:"font-medium",style:{margin:"0px 32px",color:(y=t==null?void 0:t.colors)==null?void 0:y.textPrimary},children:"Sign in with Google"})]}),xt("span",{className:"sr-only",children:"Sign in with Google"})]}))}import{useEffect as Ft,useMemo as mo,useState as uo}from"react";import{useSignIn as co,QRCode as fo}from"@farcaster/auth-kit";import{Fragment as po,jsx as L,jsxs as at}from"react/jsx-runtime";function ve(){var s,i;let{step:r,appearance:e,setStep:o,setError:t}=v();return r==="initial"?L("div",{children:at("button",{className:T("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:e==null?void 0:e.borderRadius,backgroundColor:(s=e==null?void 0:e.colors)==null?void 0:s.buttonBackground},onClick:()=>{o("qrCode"),t(null)},children:[L($t,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),L("span",{className:"font-medium",style:{margin:"0px 32px",color:(i=e==null?void 0:e.colors)==null?void 0:i.textPrimary},children:"Sign in with Farcaster"}),L("span",{className:"sr-only",children:"Sign in with Farcaster"})]})}):r==="qrCode"?L(go,{}):null}function go(){var h,d,x,p,A,S,W,P,g;let{crossmintAuth:r}=K(),{appearance:e,setStep:o,setDialogOpen:t,setError:s}=v(),[i,n]=uo(null),l=mo(()=>({onSuccess:b=>{n(b)}}),[]),{signIn:c,url:f,connect:m,signOut:y,isConnected:a}=co(l),w=b=>C(this,null,function*(){s(null);try{let u=yield r==null?void 0:r.signInWithFarcaster(b);yield r==null?void 0:r.handleRefreshAuthMaterial(u),t(!1),o("initial")}catch(u){console.error("Error during Farcaster sign-in:",u),s("Failed to sign in with Farcaster")}});return Ft(()=>{i!=null&&w(i)},[i]),Ft(()=>{a&&c()},[a]),Ft(()=>{m()},[]),at("div",{children:[L(Z,{onClick:()=>{y(),o("initial")},iconColor:(h=e==null?void 0:e.colors)==null?void 0:h.textPrimary,ringColor:(d=e==null?void 0:e.colors)==null?void 0:d.accent}),at("div",{className:"flex flex-col items-center gap-4",children:[at("div",{className:"text-center",children:[L("h3",{className:"text-lg font-semibold text-cm-text-primary mb-2",style:{color:(x=e==null?void 0:e.colors)==null?void 0:x.textPrimary},children:"Sign in with Farcaster"}),L("p",{className:"text-base font-normal text-cm-text-secondary",style:{color:(p=e==null?void 0:e.colors)==null?void 0:p.textSecondary},children:"Scan with your phone's camera to continue."})]}),L("div",{className:"bg-white aspect-square rounded-lg p-4",style:{backgroundColor:(A=e==null?void 0:e.colors)==null?void 0:A.inputBackground,borderRadius:e==null?void 0:e.borderRadius},children:f!=null?L(fo,{uri:f,size:280}):L("div",{className:"min-h-[246px] flex items-center justify-center",children:L(G,{style:{color:(S=e==null?void 0:e.colors)==null?void 0:S.textSecondary,fill:(W=e==null?void 0:e.colors)==null?void 0:W.textPrimary}})})}),f?at(po,{children:[L("p",{className:"text-base text-center font-normal text-cm-text-secondary",style:{color:(P=e==null?void 0:e.colors)==null?void 0:P.textSecondary},children:"Alternatively, click on this link to open Warpcast."}),L("a",{href:f,rel:"noopener noreferrer",target:"_blank",className:"text-base font-normal text-cm-link",style:{color:(g=e==null?void 0:e.colors)==null?void 0:g.textLink},children:"Open Warpcast"})]}):null]})]})}import{Fragment as yo,jsx as bt,jsxs as Se}from"react/jsx-runtime";function Pe(e){var r=Q(e,[]);var c,f,m,y;let{step:o,appearance:t,isLoadingOauthUrlMap:s}=v(),{createPopupAndSetupListeners:i,isLoading:n}=tt("twitter"),l=s||n;return o!=="initial"?null:Se("button",_(B({className:T("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",l?"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:l?void 0:()=>i()},r),{children:[Se(yo,{children:[bt(Xt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),l?bt(G,{style:{color:(f=t==null?void 0:t.colors)==null?void 0:f.textSecondary,fill:(m=t==null?void 0:t.colors)==null?void 0:m.textPrimary}}):bt("span",{className:"font-medium",style:{margin:"0px 32px",color:(y=t==null?void 0:t.colors)==null?void 0:y.textPrimary},children:"Sign in with X"})]}),bt("span",{className:"sr-only",children:"Sign in with X"})]}))}import{jsx as Ct,jsxs as ho}from"react/jsx-runtime";function Ae(){var s,i,n,l,c;let{step:r,appearance:e,setStep:o,setError:t}=v();return r!=="initial"?null:ho("button",{className:T("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:e==null?void 0:e.borderRadius,borderColor:(s=e==null?void 0:e.colors)==null?void 0:s.border,backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.buttonBackground},onClick:()=>{o("web3"),t(null)},children:[Ct(Yt,{className:"h-[21px] w-[21px] absolute left-[20px]",style:{color:(n=e==null?void 0:e.colors)==null?void 0:n.textPrimary}}),Ct("span",{className:"font-medium",style:{margin:"0px 32px",color:(l=e==null?void 0:e.colors)==null?void 0:l.textPrimary},children:"Continue with a wallet"}),Ct(Qt,{className:"h-[21px] w-[21px] absolute right-[20px]",style:{color:(c=e==null?void 0:e.colors)==null?void 0:c.textSecondary}}),Ct("span",{className:"sr-only",children:"Continue with a wallet"})]})}import{DynamicEmbeddedWidget as wo}from"@dynamic-labs/sdk-react-core";import{Fragment as xo,jsx as mt,jsxs as bo}from"react/jsx-runtime";function We(){var t,s;let{appearance:r,step:e,setStep:o}=v();return e==="web3"?bo(xo,{children:[mt(Z,{onClick:()=>o("initial"),iconColor:(t=r==null?void 0:r.colors)==null?void 0:t.textPrimary,ringColor:(s=r==null?void 0:r.colors)==null?void 0:s.accent}),mt("div",{className:"flex flex-col items-center",children:mt("div",{className:"flex flex-col gap-[10px] w-full",children:mt("div",{className:"widget-container",children:mt(wo,{background:"none"})})})})]}):null}import{jsx as ke}from"react/jsx-runtime";function Ee(){let{step:r}=v();return r.startsWith("web3")?ke(We,{}):r==="initial"?ke(Ae,{}):null}import{jsx as U,jsxs as ut}from"react/jsx-runtime";function Oe({className:r}){var c,f,m,y,a,w,h,d,x,p,A,S,W;let{step:e,appearance:o,loginMethods:t,baseUrl:s,error:i,termsOfServiceText:n,authModalTitle:l}=v();return ut("div",{className:T("relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",r),children:[i!=null?ut("div",{className:"flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",style:{backgroundColor:new Co((f=(c=o==null?void 0:o.colors)==null?void 0:c.danger)!=null?f:"#f44336").alpha(.12).toString()},children:[U("div",{className:"min-w-[20px]",children:U(gt,{customColor:(y=(m=o==null?void 0:o.colors)==null?void 0:m.danger)!=null?y:"#f44336"})}),U("p",{className:"ml-2 text-sm",style:{color:(w=(a=o==null?void 0:o.colors)==null?void 0:a.danger)!=null?w:"#f44336"},children:i})]}):null,e==="initial"?ut("div",{children:[U("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(h=o==null?void 0:o.colors)==null?void 0:h.textPrimary},children:l!=null?l:"Sign in to Crossmint"}),U("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(d=o==null?void 0:o.colors)==null?void 0:d.textSecondary},children:"Access using one of the options below."})]}):null,t.includes("google")?U(Ce,{}):null,t.includes("farcaster")?U(Jt,{baseUrl:s,children:U(ve,{})}):null,t.includes("twitter")?U(Pe,{}):null,t.some(P=>P.startsWith("web3"))?U(Ee,{}):null,t.includes("email")?ut("div",{children:[t.length>1?U(xe,{appearance:o,text:"OR"}):null,U(we,{})]}):null,e==="initial"&&n!=null?ut("div",{className:"text-sm text-center text-cm-text-secondary mt-2",style:{color:(x=o==null?void 0:o.colors)==null?void 0:x.textSecondary},children:[U("style",{children:`
|
|
3
3
|
p a {
|
|
4
|
-
color: ${(
|
|
4
|
+
color: ${(A=(p=o==null?void 0:o.colors)==null?void 0:p.textLink)!=null?A:"#1A74E9"};
|
|
5
5
|
}
|
|
6
|
-
`}),n]}):null,e==="initial"||e==="otp"?M(Rt,{className:"mt-1.5 md:mt-4 justify-center",color:(k=(A=o==null?void 0:o.colors)==null?void 0:A.textSecondary)!=null?k:"#67797F"}):null]})}import{useEffect as vo}from"react";import{jsx as et,jsxs as So}from"react/jsx-runtime";function Tt({open:r}){var t,s,i;let{appearance:e,setDialogOpen:o}=v();return vo(()=>{document.body.style.overflow=r?"hidden":""},[r]),et(Lt,{modal:!1,open:r,onOpenChange:o,children:So(Ut,{onInteractOutside:n=>n.preventDefault(),onOpenAutoFocus:n=>n.preventDefault(),closeButtonColor:(t=e==null?void 0:e.colors)==null?void 0:t.textPrimary,closeButtonRingColor:(s=e==null?void 0:e.colors)==null?void 0:s.accent,className:"!p-0 !min-[480px]:p-0",style:{borderRadius:e==null?void 0:e.borderRadius,backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.background},children:[et(Fe,{asChild:!0,children:et(Mt,{children:"Crossmint Auth"})}),et(Fe,{asChild:!0,children:et(Dt,{children:"Sign in via Crossmint"})}),et(Oe,{className:"max-w-[448px]"})]})})}import Po from"bs58";import{EthereumWalletConnectors as Te}from"@dynamic-labs/ethereum";import{SolanaWalletConnectors as Ie}from"@dynamic-labs/solana";import{jsx as Ao}from"react/jsx-runtime";function Ne({children:r,apiKeyEnvironment:e,enabled:o}){var u,c;let{crossmintAuth:t}=K(),{appearance:s,loginMethods:i}=v(),n=o?[Te,Ie]:void 0;i.includes("web3:evm-only")?n=[Te]:i.includes("web3:solana-only")&&(n=[Ie]);let l=`.powered-by-dynamic { display: none !important; } .wallet-list__scroll-container { padding: 0px !important; } .wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; } .dynamic-footer { display: none !important; } h1 { color: ${(u=s==null?void 0:s.colors)==null?void 0:u.textPrimary} !important; } * { color: ${(c=s==null?void 0:s.colors)==null?void 0:c.textSecondary} !important; }`;return Ao(Zt,{apiKeyEnvironment:e,settings:{walletConnectors:n,cssOverrides:l,events:{onWalletRemoved(){console.log("[CryptoWalletConnectionHandler] onWalletRemoved")},onAuthFlowCancel(){console.log("[CryptoWalletConnectionHandler] onAuthFlowCancel")},onAuthFlowClose(){console.log("[CryptoWalletConnectionHandler] onAuthFlowClose")},onAuthFailure(m,p){console.error("[CryptoWalletConnectionHandler] onAuthFailure",m,p)},onAuthSuccess(m){console.log("[CryptoWalletConnectionHandler] onAuthSuccess",m)}},handlers:{handleConnectedWallet:m=>C(this,null,function*(){var h;console.log("[CryptoWalletConnectionHandler] handleConnectedWallet",m);let p=m.address;if(!p)return console.error("[CryptoWalletConnectionHandler] handleConnectedWallet: address is missing"),!1;let w=(yield te(m))==="solana"?"solana":"evm";try{let d=yield t==null?void 0:t.signInWithSmartWallet(p,w),x=yield(h=m.connector)==null?void 0:h.proveOwnership(p,d.challenge),y=x;if(w==="solana"){let k=Buffer.from(x,"base64");y=Po.encode(k)}let A=(yield t==null?void 0:t.authenticateSmartWallet(p,w,y)).oneTimeSecret;yield t==null?void 0:t.handleRefreshAuthMaterial(A)}catch(d){console.error("[CryptoWalletConnectionHandler] Error authenticating wallet:",d)}return!0})}},children:r},`${e}-${i.join(",")}`)}import{jsx as ot,jsxs as Lo}from"react/jsx-runtime";var Io={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{}},it=Wo(Io),No={createOnLogin:"off",type:"evm-smart-wallet",experimental_enableRecoveryKeys:!1,experimental_signersURL:void 0};function ci({embeddedWallets:r=No,children:e,appearance:o,termsOfServiceText:t,prefetchOAuthUrls:s=!0,authModalTitle:i,onLoginSuccess:n,loginMethods:l=["email","google"],refreshRoute:u,logoutRoute:c}){var z;let[m,p]=ct(void 0),{crossmint:a,setJwt:w}=Y("CrossmintAuthProvider must be used within CrossmintProvider"),h=ko(null),d=Re(()=>(h.current||(h.current=Eo.from(a,{callbacks:{onLogout:()=>{w(void 0),p(void 0)},onTokenRefresh:F=>{w(F.jwt),p(F.user)}},refreshRoute:u,logoutRoute:c})),h.current),[]),x=Fo(a.apiKey),[y,P]=ct(!1),[A,k]=ct(!1),[S,f]=ct(void 0),[b,g]=ct(!1),W=l.some(F=>F.startsWith("web3")),N=J(()=>{n==null||n()},[n]);It(()=>{if(a.jwt==null){let F=Oo(To);w(F)}k(!0)},[a.jwt,w]),It(()=>{a.jwt!=null&&y&&(P(!1),N())},[a.jwt,y,N]);let H=J(F=>{if(a.jwt!=null){console.log("User already logged in");return}F!=null&&typeof F=="string"&&f(F),P(!0)},[a.jwt]),I=J(()=>{d.logout()},[d]),D=J(()=>!A||W&&!b?"initializing":a.jwt!=null?"logged-in":y?"in-progress":"logged-out",[A,a.jwt,y,b,W]),V=J(()=>C(this,null,function*(){if(a.jwt==null){console.log("User not logged in");return}let F=yield d.getUser();p(F)}),[a.jwt,d]),X=Re(()=>({crossmintAuth:d,login:H,logout:I,jwt:a.jwt,user:m,status:D(),getUser:V}),[d,H,I,a.jwt,m,D,V]);return ot(gt,{children:ot(it.Provider,{value:X,children:ot(ae,{showPasskeyHelpers:r.showPasskeyHelpers,appearance:o,experimental_enableRecoveryKeys:(z=r.experimental_enableRecoveryKeys)!=null?z:!1,children:ot(de,{setDialogOpen:(F,q)=>{P(F),q&&N()},preFetchOAuthUrls:D()==="logged-out"&&s,initialState:{appearance:o,loginMethods:l,termsOfServiceText:t,authModalTitle:i,embeddedWallets:r,baseUrl:x,defaultEmail:S},children:Lo(Ne,{enabled:W,apiKeyEnvironment:a.apiKey.includes("production")?"production":"staging",children:[ot(Ro,{embeddedWallets:r,accessToken:a.jwt,setIsDynamicSdkLoaded:g,isWeb3Enabled:W}),e,ot(Tt,{open:y})]})})},a.jwt)})})}function Ro({embeddedWallets:r,accessToken:e,setIsDynamicSdkLoaded:o,isWeb3Enabled:t}){let{getOrCreateWallet:s,clearWallet:i,status:n}=me(),{sdkHasLoaded:l,getAdminSigner:u,cleanup:c,isDynamicWalletConnected:m}=oe(t,o,e),{createOnLogin:p,adminSigner:a,linkedUser:w}=r,h=p==="all-users"&&n==="not-loaded"&&e!=null&&l,d=J(()=>C(this,null,function*(){var A,k;if(!h)return;let y=a,P=r.type;if(m&&(y=(A=yield u())!=null?A:y,P=(k=ee(y==null?void 0:y.type))!=null?k:P),!m&&r.type==null){console.error("[CrossmintAuthProvider] \u26A0\uFE0F embeddedWallets.type is required when no external wallet is connected");return}s({type:P,args:{adminSigner:y,linkedUser:w}})}),[h,s,w,a,r.type,u]),x=J(()=>{e==null&&n==="loaded"&&i(),c()},[n,e,i,c]);return It(()=>{d(),x()},[d,x]),null}function vi(){let r=Uo(it);if(r===void 0)throw new Error("useAuth must be used within an AuthProvider");return r}import{jsx as Go,jsxs as jo}from"react/jsx-runtime";var Ue={timeoutMs:1e4,intervalMs:5e3},Me=Mo(null);function se({children:r,setWalletState:e,appearance:o,signersURL:t}){let{crossmint:{apiKey:s,jwt:i}}=Y(),n=_o(()=>Ko.from({apiKey:s,jwt:i}),[s,i]),l=qt(t),[u,c]=Nt(""),[m,p]=Nt("initial"),[a,w]=Nt(!1),h=Le(null),d=Le(null),x=S=>C(this,null,function*(){try{e({status:"in-progress"}),c(S.email);let f=Ho(s.startsWith("ck_development_")?"development":"staging"),W=(yield(yield fetch(`${f}/api/unstable/wallets/ncs/doesnt-matter/public-key`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`,"x-api-key":s},body:JSON.stringify({authId:`email:${S.email}`,signingAlgorithm:"EDDSA_ED25519"})})).json()).publicKey,N=Uint8Array.from(atob(W),V=>V.charCodeAt(0)),H=dt.encode(N),I=yield k(H),D=_(B({},I),{sendTransaction:V=>C(this,null,function*(){return new Promise((X,z)=>{let F=()=>{w(!1),p("initial")},q=()=>C(this,null,function*(){F();try{let R=yield I.sendTransaction(V);X(R)}catch(R){z(R)}}),rt=R=>{F(),z(R)};h.current=q,d.current=rt,y(S.email).then(q).catch(rt)})})});e({status:"loaded",wallet:D,type:"solana-smart-wallet"})}catch(f){throw console.error("There was an error creating a wallet ",f),e(nt(f)),f}});function y(S){return C(this,null,function*(){if(!l.current||i==null)throw new Error("[handleGetRecoverySigner] IFrame window not initialized or JWT not set");return new Promise((f,b)=>C(this,null,function*(){var g;try{let W=yield(g=l.current)==null?void 0:g.sendAction({event:"request:get-public-key",responseEvent:"response:get-public-key",data:{authData:{jwt:i,apiKey:s},data:{chainLayer:"solana"}}});if((W==null?void 0:W.status)==="success")return console.log("Signer already exists, skipping OTP flow"),f();h.current=()=>f(),d.current=N=>b(N),S!=null?yield P(S):(p("initial"),w(!0))}catch(W){console.error("Error getting recovery signer",W),b(W)}}))})}let P=S=>C(this,null,function*(){var f,b;if(!l.current||i==null)throw new Error("[handleSendEmailOTP] IFrame window not initialized or JWT not set");try{console.log("Creating Recovery Key");let g=yield(f=l.current)==null?void 0:f.sendAction({event:"request:create-signer",responseEvent:"response:create-signer",data:{authData:{jwt:i,apiKey:s},data:{chainLayer:"solana",authId:`email:${S}`}}});if(g.status==="error")throw new Error(g.error);if(g.status==="success"&&g.address!=null){console.log("Signer already exists, skipping OTP flow"),p("initial"),w(!1);return}console.log("Proceeding to OTP flow"),p("otp"),w(!0)}catch(g){throw console.error("Error in email submission:",g),(b=d.current)==null||b.call(d,g),g}}),A=S=>C(this,null,function*(){var f,b;if(!l.current||i==null)throw new Error("[handleOTPSubmit] IFrame window not initialized or JWT not set");try{let g=yield l.current.sendAction({event:"request:send-otp",responseEvent:"response:send-otp",data:{authData:{jwt:i,apiKey:s},data:{encryptedOtp:S,chainLayer:"solana"}}});if(g.status==="error")throw new Error(g.error);p("initial"),w(!1),(f=h.current)==null||f.call(h)}catch(g){throw console.error("Error in OTP submission:",g),(b=d.current)==null||b.call(d,g),g}});function k(S){return C(this,null,function*(){if(i==null)throw new Error("[getOrCreateSolanaWalletWithSigner] JWT not set!");try{return yield n.getOrCreateWallet("solana-smart-wallet",{adminSigner:{type:"solana-keypair",address:S,signer:{signMessage:f=>C(this,null,function*(){if(l.current==null)throw new Error("IFrame window not initialized");let b=yield l.current.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:s},data:{keyType:"ed25519",bytes:dt.encode(f),encoding:"base58"}},options:Ue});if(b.status==="error")throw new Error(b.error);if(b.signature==null)throw new Error("Failed to sign message");return dt.decode(b.signature)}),signTransaction:f=>C(this,null,function*(){var W;console.log("Signing transaction...",f);let b=f.message.serialize(),g=yield(W=l.current)==null?void 0:W.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:s},data:{keyType:"ed25519",bytes:dt.encode(b),encoding:"base58"}},options:Ue});if((g==null?void 0:g.status)==="error")throw new Error(g.error);if((g==null?void 0:g.signature)==null)throw new Error("Failed to sign transaction");return f.addSignature(new Vo(S),dt.decode(g.signature)),f})}}})}catch(f){throw console.error("Error creating wallet with signer:",f),e(nt(f)),f}})}return Bo(()=>{document.body.style.overflow=a?"hidden":""},[a]),jo(Me.Provider,{value:{experimental_getOrCreateWalletWithRecoveryKey:x},children:[Go(zt,{email:u,setEmail:c,open:a,setOpen:w,step:m,setStep:p,onSubmitOTP:A,onResendOTPCode:P,onSubmitEmail:P,appearance:o}),r]})}function ie({enabled:r=!0}={}){let e=Do(Me);if(!r)return{experimental_getOrCreateWalletWithRecoveryKey:()=>C(this,null,function*(){yield Promise.reject(new Error("useCrossmintSigner is disabled, please set 'experimental_enableRecoveryKeys' to true"))})};if(e===null)throw new Error("useCrossmintSigner must be used within a CrossmintSignerProvider");return e}export{Me as a,se as b,ie as c,Pt as d,ae as e,me as f,K as g,v as h,de as i,Z as j,Xe as k,ge as l,tt as m,pe as n,ye as o,we as p,xe as q,Ce as r,ve as s,Pe as t,Ae as u,We as v,Ee as w,Oe as x,Tt as y,Ne as z,it as A,ci as B,vi as C};
|
|
6
|
+
`}),n]}):null,e==="initial"||e==="otp"?U(Rt,{className:"mt-1.5 md:mt-4 justify-center",color:(W=(S=o==null?void 0:o.colors)==null?void 0:S.textSecondary)!=null?W:"#67797F"}):null]})}import{useEffect as vo}from"react";import{jsx as et,jsxs as So}from"react/jsx-runtime";function Tt({open:r}){var t,s,i;let{appearance:e,setDialogOpen:o}=v();return vo(()=>{document.body.style.overflow=r?"hidden":""},[r]),et(Lt,{modal:!1,open:r,onOpenChange:o,children:So(Ut,{onInteractOutside:n=>n.preventDefault(),onOpenAutoFocus:n=>n.preventDefault(),closeButtonColor:(t=e==null?void 0:e.colors)==null?void 0:t.textPrimary,closeButtonRingColor:(s=e==null?void 0:e.colors)==null?void 0:s.accent,className:"!p-0 !min-[480px]:p-0",style:{borderRadius:e==null?void 0:e.borderRadius,backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.background},children:[et(Fe,{asChild:!0,children:et(Mt,{children:"Crossmint Auth"})}),et(Fe,{asChild:!0,children:et(Dt,{children:"Sign in via Crossmint"})}),et(Oe,{className:"max-w-[448px]"})]})})}import Po from"bs58";import{EthereumWalletConnectors as Te}from"@dynamic-labs/ethereum";import{SolanaWalletConnectors as Ie}from"@dynamic-labs/solana";import{jsx as Ao}from"react/jsx-runtime";function Ne({children:r,apiKeyEnvironment:e,enabled:o}){var c,f;let{crossmintAuth:t}=K(),{appearance:s,loginMethods:i}=v(),n=o?[Te,Ie]:void 0;i.includes("web3:evm-only")?n=[Te]:i.includes("web3:solana-only")&&(n=[Ie]);let l=`.powered-by-dynamic { display: none !important; } .wallet-list__scroll-container { padding: 0px !important; } .wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; } .dynamic-footer { display: none !important; } h1 { color: ${(c=s==null?void 0:s.colors)==null?void 0:c.textPrimary} !important; } * { color: ${(f=s==null?void 0:s.colors)==null?void 0:f.textSecondary} !important; }`;return Ao(Zt,{apiKeyEnvironment:e,settings:{walletConnectors:n,cssOverrides:l,events:{onWalletRemoved(){console.log("[CryptoWalletConnectionHandler] onWalletRemoved")},onAuthFlowCancel(){console.log("[CryptoWalletConnectionHandler] onAuthFlowCancel")},onAuthFlowClose(){console.log("[CryptoWalletConnectionHandler] onAuthFlowClose")},onAuthFailure(m,y){console.error("[CryptoWalletConnectionHandler] onAuthFailure",m,y)},onAuthSuccess(m){console.log("[CryptoWalletConnectionHandler] onAuthSuccess",m)}},handlers:{handleConnectedWallet:m=>C(this,null,function*(){var h;console.log("[CryptoWalletConnectionHandler] handleConnectedWallet",m);let y=m.address;if(!y)return console.error("[CryptoWalletConnectionHandler] handleConnectedWallet: address is missing"),!1;let w=(yield te(m))==="solana"?"solana":"evm";try{let d=yield t==null?void 0:t.signInWithSmartWallet(y,w),x=yield(h=m.connector)==null?void 0:h.proveOwnership(y,d.challenge),p=x;if(w==="solana"){let W=Buffer.from(x,"base64");p=Po.encode(W)}let S=(yield t==null?void 0:t.authenticateSmartWallet(y,w,p)).oneTimeSecret;yield t==null?void 0:t.handleRefreshAuthMaterial(S)}catch(d){console.error("[CryptoWalletConnectionHandler] Error authenticating wallet:",d)}return!0})}},children:r},`${e}-${i.join(",")}`)}import{jsx as ot,jsxs as Lo}from"react/jsx-runtime";var Io={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{}},it=Wo(Io),No={createOnLogin:"off",type:"evm-smart-wallet",experimental_enableRecoveryKeys:!1,experimental_signersURL:void 0};function ci({embeddedWallets:r=No,children:e,appearance:o,termsOfServiceText:t,prefetchOAuthUrls:s=!0,authModalTitle:i,onLoginSuccess:n,loginMethods:l=["email","google"],refreshRoute:c,logoutRoute:f}){var z;let[m,y]=ct(void 0),{crossmint:a,setJwt:w}=Y("CrossmintAuthProvider must be used within CrossmintProvider"),h=ko(null),d=Re(()=>(h.current||(h.current=Eo.from(a,{callbacks:{onLogout:()=>{w(void 0),y(void 0)},onTokenRefresh:F=>{w(F.jwt),y(F.user)}},refreshRoute:c,logoutRoute:f})),h.current),[]),x=Fo(a.apiKey),[p,A]=ct(!1),[S,W]=ct(!1),[P,g]=ct(void 0),[b,u]=ct(!1),O=l.some(F=>F.startsWith("web3")),M=J(()=>{n==null||n()},[n]);It(()=>{if(a.jwt==null){let F=Oo(To);w(F)}W(!0)},[a.jwt,w]),It(()=>{a.jwt!=null&&p&&(A(!1),M())},[a.jwt,p,M]);let H=J(F=>{if(a.jwt!=null){console.log("User already logged in");return}F!=null&&typeof F=="string"&&g(F),A(!0)},[a.jwt]),I=J(()=>{d.logout()},[d]),D=J(()=>!S||O&&!b?"initializing":a.jwt!=null?"logged-in":p?"in-progress":"logged-out",[S,a.jwt,p,b,O]),V=J(()=>C(this,null,function*(){if(a.jwt==null){console.log("User not logged in");return}let F=yield d.getUser();y(F)}),[a.jwt,d]),X=Re(()=>({crossmintAuth:d,login:H,logout:I,jwt:a.jwt,user:m,status:D(),getUser:V}),[d,H,I,a.jwt,m,D,V]);return ot(ft,{children:ot(it.Provider,{value:X,children:ot(ae,{showPasskeyHelpers:r.showPasskeyHelpers,appearance:o,experimental_enableRecoveryKeys:(z=r.experimental_enableRecoveryKeys)!=null?z:!1,children:ot(de,{setDialogOpen:(F,q)=>{A(F),q&&M()},preFetchOAuthUrls:D()==="logged-out"&&s,initialState:{appearance:o,loginMethods:l,termsOfServiceText:t,authModalTitle:i,embeddedWallets:r,baseUrl:x,defaultEmail:P},children:Lo(Ne,{enabled:O,apiKeyEnvironment:a.apiKey.includes("production")?"production":"staging",children:[ot(Ro,{embeddedWallets:r,accessToken:a.jwt,setIsDynamicSdkLoaded:u,isWeb3Enabled:O}),e,ot(Tt,{open:p})]})})},a.jwt)})})}function Ro({embeddedWallets:r,accessToken:e,setIsDynamicSdkLoaded:o,isWeb3Enabled:t}){let{getOrCreateWallet:s,clearWallet:i,status:n}=me(),{sdkHasLoaded:l,getAdminSigner:c,cleanup:f,isDynamicWalletConnected:m}=oe(t,o,e),{createOnLogin:y,adminSigner:a,linkedUser:w}=r,h=y==="all-users"&&n==="not-loaded"&&e!=null&&l,d=J(()=>C(this,null,function*(){var S,W;if(!h)return;let p=a,A=r.type;if(m&&(p=(S=yield c())!=null?S:p,A=(W=ee(p==null?void 0:p.type))!=null?W:A),!m&&r.type==null){console.error("[CrossmintAuthProvider] \u26A0\uFE0F embeddedWallets.type is required when no external wallet is connected");return}s({type:A,args:{adminSigner:p,linkedUser:w}})}),[h,s,w,a,r.type,c]),x=J(()=>{e==null&&n==="loaded"&&i(),f()},[n,e,i,f]);return It(()=>{d(),x()},[d,x]),null}function vi(){let r=Uo(it);if(r===void 0)throw new Error("useAuth must be used within an AuthProvider");return r}import{jsx as Go,jsxs as jo}from"react/jsx-runtime";var Ue={timeoutMs:1e4,intervalMs:5e3},Me=Mo(null);function se({children:r,setWalletState:e,appearance:o,signersURL:t}){let{crossmint:{apiKey:s,jwt:i}}=Y(),n=_o(()=>Ko.from({apiKey:s,jwt:i}),[s,i]),l=zt(t),[c,f]=Nt(""),[m,y]=Nt("initial"),[a,w]=Nt(!1),h=Le(null),d=Le(null),x=P=>C(this,null,function*(){try{e({status:"in-progress"}),f(P.email);let g=Ho(s.startsWith("ck_development_")?"development":"staging"),O=(yield(yield fetch(`${g}/api/unstable/wallets/ncs/doesnt-matter/public-key`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`,"x-api-key":s},body:JSON.stringify({authId:`email:${P.email}`,signingAlgorithm:"EDDSA_ED25519"})})).json()).publicKey,M=Uint8Array.from(atob(O),V=>V.charCodeAt(0)),H=dt.encode(M),I=yield W(H),D=_(B({},I),{sendTransaction:V=>C(this,null,function*(){return new Promise((X,z)=>{let F=()=>{w(!1),y("initial")},q=()=>C(this,null,function*(){F();try{let N=yield I.sendTransaction(V);X(N)}catch(N){z(N)}}),rt=N=>{F(),z(N)};h.current=q,d.current=rt,p().then(q).catch(rt)})})});e({status:"loaded",wallet:D,type:"solana-smart-wallet"})}catch(g){throw console.error("There was an error creating a wallet ",g),e(nt(g)),g}});function p(){return C(this,null,function*(){if(!l.current||i==null)throw new Error("[handleGetRecoverySigner] IFrame window not initialized or JWT not set");return new Promise((P,g)=>C(this,null,function*(){var b;try{let u=yield(b=l.current)==null?void 0:b.sendAction({event:"request:get-public-key",responseEvent:"response:get-public-key",data:{authData:{jwt:i,apiKey:s},data:{chainLayer:"solana"}}});if((u==null?void 0:u.status)==="success")return console.log("Signer already exists, skipping OTP flow"),P();h.current=()=>P(),d.current=O=>g(O),y("initial"),w(!0)}catch(u){console.error("Error getting recovery signer",u),g(u)}}))})}let A=P=>C(this,null,function*(){var g,b;if(!l.current||i==null)throw new Error("[handleSendEmailOTP] IFrame window not initialized or JWT not set");try{console.log("Creating Recovery Key");let u=yield(g=l.current)==null?void 0:g.sendAction({event:"request:create-signer",responseEvent:"response:create-signer",data:{authData:{jwt:i,apiKey:s},data:{chainLayer:"solana",authId:`email:${P}`}}});if(u.status==="error")throw new Error(u.error);if(u.status==="success"&&u.address!=null){console.log("Signer already exists, skipping OTP flow"),y("initial"),w(!1);return}console.log("Proceeding to OTP flow"),y("otp"),w(!0)}catch(u){throw console.error("Error in email submission:",u),(b=d.current)==null||b.call(d,u),u}}),S=P=>C(this,null,function*(){var g,b;if(!l.current||i==null)throw new Error("[handleOTPSubmit] IFrame window not initialized or JWT not set");try{let u=yield l.current.sendAction({event:"request:send-otp",responseEvent:"response:send-otp",data:{authData:{jwt:i,apiKey:s},data:{encryptedOtp:P,chainLayer:"solana"}}});if(u.status==="error")throw new Error(u.error);y("initial"),w(!1),(g=h.current)==null||g.call(h)}catch(u){throw console.error("Error in OTP submission:",u),(b=d.current)==null||b.call(d,u),u}});function W(P){return C(this,null,function*(){if(i==null)throw new Error("[getOrCreateSolanaWalletWithSigner] JWT not set!");try{return yield n.getOrCreateWallet("solana-smart-wallet",{adminSigner:{type:"solana-keypair",address:P,signer:{signMessage:g=>C(this,null,function*(){if(l.current==null)throw new Error("IFrame window not initialized");let b=yield l.current.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:s},data:{keyType:"ed25519",bytes:dt.encode(g),encoding:"base58"}},options:Ue});if(b.status==="error")throw new Error(b.error);if(b.signature==null)throw new Error("Failed to sign message");return dt.decode(b.signature)}),signTransaction:g=>C(this,null,function*(){var O;console.log("Signing transaction...",g);let b=g.message.serialize(),u=yield(O=l.current)==null?void 0:O.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:s},data:{keyType:"ed25519",bytes:dt.encode(b),encoding:"base58"}},options:Ue});if((u==null?void 0:u.status)==="error")throw new Error(u.error);if((u==null?void 0:u.signature)==null)throw new Error("Failed to sign transaction");return g.addSignature(new Vo(P),dt.decode(u.signature)),g})}}})}catch(g){throw console.error("Error creating wallet with signer:",g),e(nt(g)),g}})}return Bo(()=>{document.body.style.overflow=a?"hidden":""},[a]),jo(Me.Provider,{value:{experimental_getOrCreateWalletWithRecoveryKey:x},children:[Go(jt,{email:c,open:a,setOpen:w,step:m,onSubmitOTP:S,onResendOTPCode:A,onSubmitEmail:A,appearance:o}),r]})}function ie({enabled:r=!0}={}){let e=Do(Me);if(!r)return{experimental_getOrCreateWalletWithRecoveryKey:()=>C(this,null,function*(){yield Promise.reject(new Error("useCrossmintSigner is disabled, please set 'experimental_enableRecoveryKeys' to true"))})};if(e===null)throw new Error("useCrossmintSigner must be used within a CrossmintSignerProvider");return e}export{Me as a,se as b,ie as c,Pt as d,ae as e,me as f,K as g,v as h,de as i,Z as j,Xe as k,ge as l,tt as m,pe as n,ye as o,we as p,xe as q,Ce as r,ve as s,Pe as t,Ae as u,We as v,Ee as w,Oe as x,Tt as y,Ne as z,it as A,ci as B,vi as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-KGZOWR44.js";import{a as e}from"./chunk-PXDN3KFO.js";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as x}from"./chunk-TNCETEEL.js";import{a}from"./chunk-NBJIJZGO.js";import{d as f}from"./chunk-PXDN3KFO.js";import{useState as v}from"react";import{jsx as o,jsxs as e}from"react/jsx-runtime";function P({email:s,onConfirm:h,onCancel:y,appearance:t}){var m,c,u;let[i,l]=v(!1),[r,g]=v(""),C=()=>f(this,null,function*(){l(!0);try{yield h(s)}catch(w){console.error("Error sending authorization code:",w),g("Failed to send code. Please try again.")}finally{l(!1)}}),b=((m=t==null?void 0:t.colors)==null?void 0:m.accent)||"#4CAF50",n=((c=t==null?void 0:t.colors)==null?void 0:c.textPrimary)||"#000000",d=((u=t==null?void 0:t.colors)==null?void 0:u.border)||"#E0E0E0";return e("div",{className:"flex flex-col w-full max-w-md mx-auto rounded-xl",children:[o("h2",{className:"mb-2",style:{color:n},children:"Send authorization code to"}),o("div",{className:"w-full mb-8 p-4 rounded-xl border",style:{borderColor:d},children:e("div",{className:"flex items-center",children:[o("div",{className:"flex-shrink-0 mr-3",children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-mail-icon lucide-mail",children:[o("path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}),o("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"})]})}),o("span",{style:{color:n},children:s})]})}),r&&o("div",{className:"text-red-500 mb-4 text-sm",children:r}),e("div",{className:"flex gap-3",children:[o("button",{onClick:y,className:"flex-1 py-4 px-6 border rounded-full text-center font-medium",style:{borderColor:d},children:"Cancel"}),o("button",{onClick:C,disabled:i,className:a("flex-1 py-4 px-6 rounded-full text-white text-center font-medium",i?"opacity-70":""),style:{backgroundColor:b},children:i?o("div",{className:"flex justify-center items-center",children:o(x,{style:{color:"white"}})}):"Send code"})]})]})}export{P as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s="1.19.9";var r=s;export{r as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk-5X3MPD2V.js";import{a as y}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-5X3MPD2V.js";import{a as y}from"./chunk-CKR7ABFW.js";import{b as p}from"./chunk-ROJ6HFVK.js";import{a,b as l}from"./chunk-PXDN3KFO.js";import{lazy as v,useEffect as f,useRef as s,useState as C}from"react";import{crossmintEmbeddedCheckoutV3Service as S}from"@crossmint/client-sdk-base";import{Fragment as x,jsx as o,jsxs as H}from"react/jsx-runtime";var V=v(()=>import("./components/embed/v3/crypto/CryptoWalletConnectionHandler.js").then(t=>({default:t.CryptoWalletConnectionHandler})));function K(t){var m;let[e,P]=C(null),[b,g]=C(0),k=s((m=t.payment.crypto.payer)==null?void 0:m.initialChain),n=s(t);if(I(t,n.current)){let r=a({},t),u=w(t,k.current);u.shouldPreserve&&(r.payment.crypto.payer=u.updatedPayer),n.current=r}let{crossmint:E}=p(),d=y(E,{usageOrigin:"client"}),c=S({apiClient:d}),i=s(null);return f(()=>{let r=i.current;!r||e||P(c.iframe.createClient(r))},[i.current,e]),f(()=>{if(e!=null)return e.on("ui:height.changed",r=>g(r.height)),()=>{e.off("ui:height.changed")}},[e]),H(x,{children:[o("iframe",{ref:i,src:c.iframe.getUrl(n.current),id:"crossmint-embedded-checkout.iframe",role:"crossmint-embedded-checkout.iframe",allow:"payment *",style:{boxShadow:"none",border:"none",padding:"0px",width:"100%",minWidth:"100%",overflow:"hidden",display:"block",userSelect:"none",transform:"translate(0px)",opacity:"1",transition:"ease 0s, opacity 0.4s ease 0.1s",height:`${b}px`,backgroundColor:"transparent"}}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?o(h,{payer:n.current.payment.crypto.payer,iframeClient:e}):o(V,{iframeClient:e,apiKeyEnvironment:d.parsedAPIKey.environment}):null,o("span",{id:"crossmint-focus-target",tabIndex:-1})]})}function I(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function w(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:l(a({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}export{K as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C}from"./chunk-EA7H4AXL.js";import{a}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-EA7H4AXL.js";import{a}from"./chunk-CKR7ABFW.js";import{b as l}from"./chunk-ROJ6HFVK.js";import{a as m,b as u,c as s}from"./chunk-PXDN3KFO.js";import{crossmintHostedCheckoutV3Service as M,crossmintHostedCheckoutV3StylesService as N}from"@crossmint/client-sdk-base";import R from"clsx";import{useEffect as T,useState as j}from"react";import{jsx as d,jsxs as w}from"react/jsx-runtime";function z(f){let[h,k]=j(!1),{crossmint:y}=l(),P=a(y),c=f,{recipient:g,locale:H,lineItems:S,payment:V,appearance:v}=c,b=s(c,["recipient","locale","lineItems","payment","appearance"]),n={recipient:g,locale:H,lineItems:S,payment:V,appearance:v},x=M({apiClient:P,hostedCheckoutProps:n}),t=N(n),p=b,{onClick:r,className:E,children:e}=p,I=s(p,["onClick","className","children"]);function B(o){o.preventDefault(),o.stopPropagation(),x.createWindow(),r&&r(o)}let i=t.generateCss();return T(()=>{let{cleanup:o}=t.injectCss(i);return k(!0),o},[i]),h?w("button",u(m({onClick:B,className:R(t.identifiers.buttonClassNames,E)},I),{children:[d(C,{style:{marginRight:"12px",flex:"none"},displayType:"icon-only",id:t.identifiers.logoId,height:16,width:16}),e!=null?e:d("p",{style:{margin:0},children:t.getButtonText()})]})):null}export{z as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkH54CRMEQcjs = require('./chunk-H54CRMEQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');function C(t,i){return new (0, _commonsdkbase.CrossmintApiClient)(t,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-ui",version:_chunkH54CRMEQcjs.a},apiKeyExpectations:i}})}exports.a = C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
1
|
+
import{a as t}from"./chunk-JWA56FBI.js";import{assertValidValidateNFTDetailProps as e,getNFTDetailSrc as i}from"@crossmint/client-sdk-base";import{jsx as s}from"react/jsx-runtime";function d(r){e(r);let o=i(r,t);return s("iframe",{src:o,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-details"})}export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C}from"./chunk-JSOMGEEA.js";import{a}from"./chunk-D62R34F3.js";import{a as g,e as f,h as u,i as x}from"./chunk-UDQUVZUQ.js";import{VisuallyHidden as y}from"@radix-ui/react-visually-hidden";import{jsx as i,jsxs as e}from"react/jsx-runtime";function T({email:t,open:D,setOpen:n,step:s,onSubmitOTP:b,onResendOTPCode:c,onSubmitEmail:v,appearance:o}){var m,r,d;return i(g,{modal:!1,open:D,onOpenChange:n,children:e(f,{onInteractOutside:l=>l.preventDefault(),onOpenAutoFocus:l=>l.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(m=o==null?void 0:o.colors)==null?void 0:m.background},children:[i(y,{asChild:!0,children:i(u,{children:"Confirm it's you"})}),i(y,{asChild:!0,children:i(x,{children:"Create a recovery key"})}),e("div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none max-w-[448px]",children:[s==="initial"?e("div",{className:"flex flex-col gap-4",children:[i("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(r=o==null?void 0:o.colors)==null?void 0:r.textPrimary},children:"Confirm it's you"}),i("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(d=o==null?void 0:o.colors)==null?void 0:d.textSecondary},children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code."})]}):null,s==="otp"?i(a,{email:t,onSubmitOTP:b,onResendCode:()=>c(t),appearance:o}):i(C,{email:t,onConfirm:v,onCancel:()=>n(!1),appearance:o})]})]})})}export{T as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkS5T3GYI3cjs = require('./chunk-S5T3GYI3.cjs');var _jsxruntime = require('react/jsx-runtime');function u(){return _jsxruntime.jsx.call(void 0, _chunkS5T3GYI3cjs.x,{className:"w-full"})}exports.a = u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,b as y}from"./chunk-72P3JMXX.js";import{a as u}from"./chunk-2POV64LQ.js";import{a as p}from"./chunk-
|
|
1
|
+
import{a as d,b as y}from"./chunk-72P3JMXX.js";import{a as u}from"./chunk-2POV64LQ.js";import{a as p}from"./chunk-JWA56FBI.js";import{a as l,c as m}from"./chunk-PXDN3KFO.js";import{useMemo as G}from"react";import{useState as J}from"react";import{clientNames as K,crossmintModalService as Q,crossmintPayButtonService as W}from"@crossmint/client-sdk-base";import{Fragment as Y,jsx as r,jsxs as X}from"react/jsx-runtime";function ct(C){let c=C,{className:g,disabled:P,onClick:h,style:f,tabIndex:I,theme:S="dark",mintTo:B,emailTo:k,listingId:v,auctionId:Z,showOverlay:E=!0,mintConfig:b,whPassThroughArgs:M,environment:T,paymentMethod:t,preferredSigninMethod:x,dismissOverlayOnClick:N,prepay:R,locale:i="en-US",currency:L="usd",successCallbackURL:w="",failureCallbackURL:O="",loginEmail:U="",projectId:H,getButtonText:o,checkoutProps:a={experimental:!1,display:"same-tab",paymentMethods:["fiat","ETH","SOL"]}}=c,s=m(c,["className","disabled","onClick","style","tabIndex","theme","mintTo","emailTo","listingId","auctionId","showOverlay","mintConfig","whPassThroughArgs","environment","paymentMethod","preferredSigninMethod","dismissOverlayOnClick","prepay","locale","currency","successCallbackURL","failureCallbackURL","loginEmail","projectId","getButtonText","checkoutProps"]),_="clientId"in s?s.clientId:s.collectionId,[e,A]=J(!1),{isServerSideRendering:D}=u(),{connect:V}=Q({clientId:_,projectId:H,showOverlay:E,dismissOverlayOnClick:N,setConnecting:A,libVersion:p,environment:T,clientName:K.reactUi,locale:i,currency:L,successCallbackURL:w,failureCallbackURL:O,loginEmail:U}),{getButtonText:$,handleClick:j}=W({onClick:h,connecting:e,paymentMethod:t,locale:i,checkoutProps:a}),q=F=>j(F,()=>{V(b,B,k,v,M,t,x,R,a)}),n=y(d(S)),z=G(()=>r("span",{className:n.crossmintParagraph,role:"button-paragraph",children:o!=null?o(e,t||"fiat"):$(e)}),[e,o,t]);return r(Y,{children:!D&&X("button",{className:`${n.crossmintButton} ${g||""}`,disabled:P,onClick:q,style:l({},f),tabIndex:I,children:[r("img",{className:n.crossmintImg,src:"https://www.crossmint.io/assets/crossmint/logo.svg",alt:"Crossmint logo"}),z]})})}export{ct as a};
|