@crossmint/client-sdk-react-ui 1.9.3 → 1.10.1

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.
Files changed (748) hide show
  1. package/dist/chunk-2T2VCED7.js +17 -0
  2. package/dist/chunk-2T2VCED7.js.map +1 -0
  3. package/dist/chunk-33WZFL2D.js +80 -0
  4. package/dist/chunk-33WZFL2D.js.map +1 -0
  5. package/dist/chunk-35RV5AOT.cjs +70 -0
  6. package/dist/chunk-35RV5AOT.cjs.map +1 -0
  7. package/dist/chunk-3C5IQSUX.cjs +50 -0
  8. package/dist/chunk-3C5IQSUX.cjs.map +1 -0
  9. package/dist/chunk-3J6CUUWT.js +50 -0
  10. package/dist/chunk-3J6CUUWT.js.map +1 -0
  11. package/dist/chunk-3KR4GYLF.js +26 -0
  12. package/dist/chunk-3KR4GYLF.js.map +1 -0
  13. package/dist/chunk-3RXUFZTR.cjs +14 -0
  14. package/dist/chunk-3RXUFZTR.cjs.map +1 -0
  15. package/dist/chunk-43P7QWBK.cjs +17 -0
  16. package/dist/chunk-43P7QWBK.cjs.map +1 -0
  17. package/dist/chunk-4DAZAO6Y.cjs +59 -0
  18. package/dist/chunk-4DAZAO6Y.cjs.map +1 -0
  19. package/dist/chunk-5IX763AW.js +10 -0
  20. package/dist/chunk-5IX763AW.js.map +1 -0
  21. package/dist/chunk-5KK3YQWD.cjs +1 -0
  22. package/dist/chunk-5KK3YQWD.cjs.map +1 -0
  23. package/dist/chunk-5RX5WFEW.cjs +11 -0
  24. package/dist/chunk-5RX5WFEW.cjs.map +1 -0
  25. package/dist/chunk-5S4VO6RB.cjs +55 -0
  26. package/dist/chunk-5S4VO6RB.cjs.map +1 -0
  27. package/dist/chunk-6DNBJVR5.js +64 -0
  28. package/dist/chunk-6DNBJVR5.js.map +1 -0
  29. package/dist/chunk-6LO4NSRH.cjs +21 -0
  30. package/dist/chunk-6LO4NSRH.cjs.map +1 -0
  31. package/dist/chunk-7KIY6DLW.js +28 -0
  32. package/dist/chunk-7KIY6DLW.js.map +1 -0
  33. package/dist/chunk-7SBZ6OIH.js +1 -0
  34. package/dist/chunk-7SBZ6OIH.js.map +1 -0
  35. package/dist/chunk-A2JCJ2OV.cjs +119 -0
  36. package/dist/chunk-A2JCJ2OV.cjs.map +1 -0
  37. package/dist/chunk-A7J4DAE7.js +16 -0
  38. package/dist/chunk-A7J4DAE7.js.map +1 -0
  39. package/dist/chunk-ATHR4S2P.js +48 -0
  40. package/dist/chunk-ATHR4S2P.js.map +1 -0
  41. package/dist/chunk-AUEQQ4D3.js +119 -0
  42. package/dist/chunk-AUEQQ4D3.js.map +1 -0
  43. package/dist/chunk-AXZLLRBU.cjs +26 -0
  44. package/dist/chunk-AXZLLRBU.cjs.map +1 -0
  45. package/dist/chunk-B7LYPQ4K.cjs +38 -0
  46. package/dist/chunk-B7LYPQ4K.cjs.map +1 -0
  47. package/dist/chunk-BE2ZLB3L.cjs +19 -0
  48. package/dist/chunk-BE2ZLB3L.cjs.map +1 -0
  49. package/dist/chunk-BKVDVDKX.cjs +1 -0
  50. package/dist/chunk-BKVDVDKX.cjs.map +1 -0
  51. package/dist/chunk-C2VARNXL.js +70 -0
  52. package/dist/chunk-C2VARNXL.js.map +1 -0
  53. package/dist/chunk-CPYPI45H.js +98 -0
  54. package/dist/chunk-CPYPI45H.js.map +1 -0
  55. package/dist/chunk-CRTRMMJ7.js +59 -0
  56. package/dist/chunk-CRTRMMJ7.js.map +1 -0
  57. package/dist/chunk-CUODMU27.js +1265 -0
  58. package/dist/chunk-CUODMU27.js.map +1 -0
  59. package/dist/chunk-DJ32OEWG.cjs +54 -0
  60. package/dist/chunk-DJ32OEWG.cjs.map +1 -0
  61. package/dist/chunk-DZ5MGN25.js +147 -0
  62. package/dist/chunk-DZ5MGN25.js.map +1 -0
  63. package/dist/chunk-ENCR5SUW.cjs +51 -0
  64. package/dist/chunk-ENCR5SUW.cjs.map +1 -0
  65. package/dist/chunk-EOWJ7775.js +18 -0
  66. package/dist/chunk-EOWJ7775.js.map +1 -0
  67. package/dist/chunk-EVL7VEPX.js +14 -0
  68. package/dist/chunk-EVL7VEPX.js.map +1 -0
  69. package/dist/chunk-FKIMKZ4Y.js +17 -0
  70. package/dist/chunk-FKIMKZ4Y.js.map +1 -0
  71. package/dist/chunk-FOCUIKYH.cjs +1265 -0
  72. package/dist/chunk-FOCUIKYH.cjs.map +1 -0
  73. package/dist/chunk-GGE3H4XP.cjs +33 -0
  74. package/dist/chunk-GGE3H4XP.cjs.map +1 -0
  75. package/dist/chunk-GY6G3ZC2.cjs +41 -0
  76. package/dist/chunk-GY6G3ZC2.cjs.map +1 -0
  77. package/dist/chunk-H4F7UVPT.js +34 -0
  78. package/dist/chunk-H4F7UVPT.js.map +1 -0
  79. package/dist/chunk-HATQVB6H.js +19 -0
  80. package/dist/chunk-HATQVB6H.js.map +1 -0
  81. package/dist/chunk-HCW4RO2O.cjs +29 -0
  82. package/dist/chunk-HCW4RO2O.cjs.map +1 -0
  83. package/dist/chunk-HENBZUED.cjs +10 -0
  84. package/dist/chunk-HENBZUED.cjs.map +1 -0
  85. package/dist/chunk-HG57BLPT.js +31 -0
  86. package/dist/chunk-HG57BLPT.js.map +1 -0
  87. package/dist/chunk-HPOZ6I54.cjs +44 -0
  88. package/dist/chunk-HPOZ6I54.cjs.map +1 -0
  89. package/dist/chunk-HYGCZCR2.js +33 -0
  90. package/dist/chunk-HYGCZCR2.js.map +1 -0
  91. package/dist/chunk-I63FQCIV.js +189 -0
  92. package/dist/chunk-I63FQCIV.js.map +1 -0
  93. package/dist/chunk-IP4HQL5I.cjs +147 -0
  94. package/dist/chunk-IP4HQL5I.cjs.map +1 -0
  95. package/dist/chunk-IQPA3QOV.js +27 -0
  96. package/dist/chunk-IQPA3QOV.js.map +1 -0
  97. package/dist/chunk-KAXBBO66.cjs +30 -0
  98. package/dist/chunk-KAXBBO66.cjs.map +1 -0
  99. package/dist/chunk-KEKBOJCF.cjs +50 -0
  100. package/dist/chunk-KEKBOJCF.cjs.map +1 -0
  101. package/dist/chunk-KLWDDALZ.cjs +14 -0
  102. package/dist/chunk-KLWDDALZ.cjs.map +1 -0
  103. package/dist/chunk-KNOUJZN5.cjs +32 -0
  104. package/dist/chunk-KNOUJZN5.cjs.map +1 -0
  105. package/dist/chunk-L3FKENHU.js +14 -0
  106. package/dist/chunk-L3FKENHU.js.map +1 -0
  107. package/dist/chunk-L3L7YEW3.js +22 -0
  108. package/dist/chunk-L3L7YEW3.js.map +1 -0
  109. package/dist/chunk-MH37OJT2.cjs +80 -0
  110. package/dist/chunk-MH37OJT2.cjs.map +1 -0
  111. package/dist/chunk-MJHLKJ6X.cjs +212 -0
  112. package/dist/chunk-MJHLKJ6X.cjs.map +1 -0
  113. package/dist/chunk-MUS7DUPS.cjs +98 -0
  114. package/dist/chunk-MUS7DUPS.cjs.map +1 -0
  115. package/dist/chunk-NMXFWIFA.js +133 -0
  116. package/dist/chunk-NMXFWIFA.js.map +1 -0
  117. package/dist/chunk-OZS4WEKF.js +55 -0
  118. package/dist/chunk-OZS4WEKF.js.map +1 -0
  119. package/dist/chunk-PBSL6JOF.cjs +17 -0
  120. package/dist/chunk-PBSL6JOF.cjs.map +1 -0
  121. package/dist/chunk-PHCGCJSA.js +107 -0
  122. package/dist/chunk-PHCGCJSA.js.map +1 -0
  123. package/dist/chunk-Q3M4UH5U.cjs +48 -0
  124. package/dist/chunk-Q3M4UH5U.cjs.map +1 -0
  125. package/dist/chunk-QDKAU3H2.js +31 -0
  126. package/dist/chunk-QDKAU3H2.js.map +1 -0
  127. package/dist/chunk-QFQWKKVU.js +11 -0
  128. package/dist/chunk-QFQWKKVU.js.map +1 -0
  129. package/dist/chunk-QIPMBCAV.js +86 -0
  130. package/dist/chunk-QIPMBCAV.js.map +1 -0
  131. package/dist/chunk-QJ44PL7L.js +41 -0
  132. package/dist/chunk-QJ44PL7L.js.map +1 -0
  133. package/dist/chunk-QK5J7FD3.cjs +11 -0
  134. package/dist/chunk-QK5J7FD3.cjs.map +1 -0
  135. package/dist/chunk-QKALEGXY.js +153 -0
  136. package/dist/chunk-QKALEGXY.js.map +1 -0
  137. package/dist/chunk-QQXBYOKA.cjs +16 -0
  138. package/dist/chunk-QQXBYOKA.cjs.map +1 -0
  139. package/dist/chunk-QT7UEJZG.cjs +133 -0
  140. package/dist/chunk-QT7UEJZG.cjs.map +1 -0
  141. package/dist/chunk-QTGK3RB5.js +31 -0
  142. package/dist/chunk-QTGK3RB5.js.map +1 -0
  143. package/dist/chunk-QTL5I5C2.js +38 -0
  144. package/dist/chunk-QTL5I5C2.js.map +1 -0
  145. package/dist/chunk-R6IL3WOE.cjs +31 -0
  146. package/dist/chunk-R6IL3WOE.cjs.map +1 -0
  147. package/dist/chunk-RZPQIRIY.js +11 -0
  148. package/dist/chunk-RZPQIRIY.js.map +1 -0
  149. package/dist/chunk-RZT2J42J.js +29 -0
  150. package/dist/chunk-RZT2J42J.js.map +1 -0
  151. package/dist/chunk-SBA6FMFT.cjs +18 -0
  152. package/dist/chunk-SBA6FMFT.cjs.map +1 -0
  153. package/dist/chunk-SVI3L5G5.cjs +86 -0
  154. package/dist/chunk-SVI3L5G5.cjs.map +1 -0
  155. package/dist/chunk-SZA3XDJ5.cjs +1 -0
  156. package/dist/chunk-SZA3XDJ5.cjs.map +1 -0
  157. package/dist/chunk-TIQPIPH5.cjs +31 -0
  158. package/dist/chunk-TIQPIPH5.cjs.map +1 -0
  159. package/dist/chunk-U5EONMPH.js +30 -0
  160. package/dist/chunk-U5EONMPH.js.map +1 -0
  161. package/dist/chunk-UASNCH3A.cjs +27 -0
  162. package/dist/chunk-UASNCH3A.cjs.map +1 -0
  163. package/dist/chunk-UQAKJ4T7.cjs +29 -0
  164. package/dist/chunk-UQAKJ4T7.cjs.map +1 -0
  165. package/dist/chunk-URKPLEPV.cjs +189 -0
  166. package/dist/chunk-URKPLEPV.cjs.map +1 -0
  167. package/dist/chunk-VZIXXIU5.js +32 -0
  168. package/dist/chunk-VZIXXIU5.js.map +1 -0
  169. package/dist/chunk-W2Q46OO4.js +17 -0
  170. package/dist/chunk-W2Q46OO4.js.map +1 -0
  171. package/dist/chunk-W3SNJ5XS.cjs +153 -0
  172. package/dist/chunk-W3SNJ5XS.cjs.map +1 -0
  173. package/dist/chunk-WK5RAFJ3.js +54 -0
  174. package/dist/chunk-WK5RAFJ3.js.map +1 -0
  175. package/dist/chunk-WQ7WULBW.cjs +31 -0
  176. package/dist/chunk-WQ7WULBW.cjs.map +1 -0
  177. package/dist/chunk-XDJ6F7N4.cjs +107 -0
  178. package/dist/chunk-XDJ6F7N4.cjs.map +1 -0
  179. package/dist/chunk-XEZF7G64.js +212 -0
  180. package/dist/chunk-XEZF7G64.js.map +1 -0
  181. package/dist/chunk-XRFRY2LN.js +50 -0
  182. package/dist/chunk-XRFRY2LN.js.map +1 -0
  183. package/dist/chunk-XXJ7LQ44.js +1 -0
  184. package/dist/chunk-XXJ7LQ44.js.map +1 -0
  185. package/dist/chunk-XYMYRPVT.js +1 -0
  186. package/dist/chunk-XYMYRPVT.js.map +1 -0
  187. package/dist/chunk-Y7PF2Z3W.cjs +22 -0
  188. package/dist/chunk-Y7PF2Z3W.cjs.map +1 -0
  189. package/dist/chunk-YE55IKBP.cjs +34 -0
  190. package/dist/chunk-YE55IKBP.cjs.map +1 -0
  191. package/dist/chunk-YNJPYSO4.cjs +17 -0
  192. package/dist/chunk-YNJPYSO4.cjs.map +1 -0
  193. package/dist/chunk-YWVQCHQF.js +51 -0
  194. package/dist/chunk-YWVQCHQF.js.map +1 -0
  195. package/dist/chunk-ZCYU7QA6.cjs +64 -0
  196. package/dist/chunk-ZCYU7QA6.cjs.map +1 -0
  197. package/dist/chunk-ZDQGQY7Z.js +29 -0
  198. package/dist/chunk-ZDQGQY7Z.js.map +1 -0
  199. package/dist/chunk-ZIHCLVCD.js +44 -0
  200. package/dist/chunk-ZIHCLVCD.js.map +1 -0
  201. package/dist/chunk-ZMSST6ZZ.cjs +28 -0
  202. package/dist/chunk-ZMSST6ZZ.cjs.map +1 -0
  203. package/dist/chunk-ZUIS3FET.js +21 -0
  204. package/dist/chunk-ZUIS3FET.js.map +1 -0
  205. package/dist/components/CrossmintNFTCollectionView.cjs +9 -1
  206. package/dist/components/CrossmintNFTCollectionView.cjs.map +1 -0
  207. package/dist/components/CrossmintNFTCollectionView.js +9 -1
  208. package/dist/components/CrossmintNFTCollectionView.js.map +1 -0
  209. package/dist/components/CrossmintNFTDetail.cjs +9 -1
  210. package/dist/components/CrossmintNFTDetail.cjs.map +1 -0
  211. package/dist/components/CrossmintNFTDetail.js +9 -1
  212. package/dist/components/CrossmintNFTDetail.js.map +1 -0
  213. package/dist/components/auth/AuthForm.cjs +37 -1
  214. package/dist/components/auth/AuthForm.cjs.map +1 -0
  215. package/dist/components/auth/AuthForm.js +37 -1
  216. package/dist/components/auth/AuthForm.js.map +1 -0
  217. package/dist/components/auth/AuthFormBackButton.cjs +10 -1
  218. package/dist/components/auth/AuthFormBackButton.cjs.map +1 -0
  219. package/dist/components/auth/AuthFormBackButton.js +10 -1
  220. package/dist/components/auth/AuthFormBackButton.js.map +1 -0
  221. package/dist/components/auth/AuthFormDialog.cjs +37 -1
  222. package/dist/components/auth/AuthFormDialog.cjs.map +1 -0
  223. package/dist/components/auth/AuthFormDialog.js +37 -1
  224. package/dist/components/auth/AuthFormDialog.js.map +1 -0
  225. package/dist/components/auth/EmbeddedAuthForm.cjs +38 -1
  226. package/dist/components/auth/EmbeddedAuthForm.cjs.map +1 -0
  227. package/dist/components/auth/EmbeddedAuthForm.js +38 -1
  228. package/dist/components/auth/EmbeddedAuthForm.js.map +1 -0
  229. package/dist/components/auth/PasskeyPrompt.cjs +14 -1
  230. package/dist/components/auth/PasskeyPrompt.cjs.map +1 -0
  231. package/dist/components/auth/PasskeyPrompt.js +14 -1
  232. package/dist/components/auth/PasskeyPrompt.js.map +1 -0
  233. package/dist/components/auth/methods/email/EmailAuthFlow.cjs +37 -1
  234. package/dist/components/auth/methods/email/EmailAuthFlow.cjs.map +1 -0
  235. package/dist/components/auth/methods/email/EmailAuthFlow.js +37 -1
  236. package/dist/components/auth/methods/email/EmailAuthFlow.js.map +1 -0
  237. package/dist/components/auth/methods/email/EmailOTPInput.cjs +39 -1
  238. package/dist/components/auth/methods/email/EmailOTPInput.cjs.map +1 -0
  239. package/dist/components/auth/methods/email/EmailOTPInput.js +39 -1
  240. package/dist/components/auth/methods/email/EmailOTPInput.js.map +1 -0
  241. package/dist/components/auth/methods/email/EmailSignIn.cjs +37 -1
  242. package/dist/components/auth/methods/email/EmailSignIn.cjs.map +1 -0
  243. package/dist/components/auth/methods/email/EmailSignIn.js +37 -1
  244. package/dist/components/auth/methods/email/EmailSignIn.js.map +1 -0
  245. package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +37 -1
  246. package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs.map +1 -0
  247. package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +37 -1
  248. package/dist/components/auth/methods/farcaster/FarcasterSignIn.js.map +1 -0
  249. package/dist/components/auth/methods/google/GoogleSignIn.cjs +37 -1
  250. package/dist/components/auth/methods/google/GoogleSignIn.cjs.map +1 -0
  251. package/dist/components/auth/methods/google/GoogleSignIn.js +37 -1
  252. package/dist/components/auth/methods/google/GoogleSignIn.js.map +1 -0
  253. package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +37 -0
  254. package/dist/components/auth/methods/web3/Web3AuthFlow.cjs.map +1 -0
  255. package/dist/components/auth/methods/web3/Web3AuthFlow.d.cts +5 -0
  256. package/dist/components/auth/methods/web3/Web3AuthFlow.d.ts +5 -0
  257. package/dist/components/auth/methods/web3/Web3AuthFlow.js +37 -0
  258. package/dist/components/auth/methods/web3/Web3AuthFlow.js.map +1 -0
  259. package/dist/components/auth/methods/web3/Web3AuthWrapper.cjs +37 -0
  260. package/dist/components/auth/methods/web3/Web3AuthWrapper.cjs.map +1 -0
  261. package/dist/components/auth/methods/web3/Web3AuthWrapper.d.cts +10 -0
  262. package/dist/components/auth/methods/web3/Web3AuthWrapper.d.ts +10 -0
  263. package/dist/components/auth/methods/web3/Web3AuthWrapper.js +37 -0
  264. package/dist/components/auth/methods/web3/Web3AuthWrapper.js.map +1 -0
  265. package/dist/components/auth/methods/web3/Web3ConnectButton.cjs +11 -0
  266. package/dist/components/auth/methods/web3/Web3ConnectButton.cjs.map +1 -0
  267. package/dist/components/auth/methods/web3/Web3ConnectButton.d.cts +13 -0
  268. package/dist/components/auth/methods/web3/Web3ConnectButton.d.ts +13 -0
  269. package/dist/components/auth/methods/web3/Web3ConnectButton.js +11 -0
  270. package/dist/components/auth/methods/web3/Web3ConnectButton.js.map +1 -0
  271. package/dist/components/auth/methods/web3/Web3Connectors.cjs +37 -0
  272. package/dist/components/auth/methods/web3/Web3Connectors.cjs.map +1 -0
  273. package/dist/components/auth/methods/web3/Web3Connectors.d.cts +5 -0
  274. package/dist/components/auth/methods/web3/Web3Connectors.d.ts +5 -0
  275. package/dist/components/auth/methods/web3/Web3Connectors.js +37 -0
  276. package/dist/components/auth/methods/web3/Web3Connectors.js.map +1 -0
  277. package/dist/components/auth/methods/web3/Web3ProviderButton.cjs +9 -0
  278. package/dist/components/auth/methods/web3/Web3ProviderButton.cjs.map +1 -0
  279. package/dist/components/auth/methods/web3/Web3ProviderButton.d.cts +11 -0
  280. package/dist/components/auth/methods/web3/Web3ProviderButton.d.ts +11 -0
  281. package/dist/components/auth/methods/web3/Web3ProviderButton.js +9 -0
  282. package/dist/components/auth/methods/web3/Web3ProviderButton.js.map +1 -0
  283. package/dist/components/auth/methods/web3/Web3SignIn.cjs +37 -0
  284. package/dist/components/auth/methods/web3/Web3SignIn.cjs.map +1 -0
  285. package/dist/components/auth/methods/web3/Web3SignIn.d.cts +5 -0
  286. package/dist/components/auth/methods/web3/Web3SignIn.d.ts +5 -0
  287. package/dist/components/auth/methods/web3/Web3SignIn.js +37 -0
  288. package/dist/components/auth/methods/web3/Web3SignIn.js.map +1 -0
  289. package/dist/components/common/Dialog.cjs +26 -1
  290. package/dist/components/common/Dialog.cjs.map +1 -0
  291. package/dist/components/common/Dialog.d.cts +1 -2
  292. package/dist/components/common/Dialog.d.ts +1 -2
  293. package/dist/components/common/Dialog.js +26 -1
  294. package/dist/components/common/Dialog.js.map +1 -0
  295. package/dist/components/common/Divider.cjs +37 -1
  296. package/dist/components/common/Divider.cjs.map +1 -0
  297. package/dist/components/common/Divider.js +37 -1
  298. package/dist/components/common/Divider.js.map +1 -0
  299. package/dist/components/common/InputOTP.cjs +14 -1
  300. package/dist/components/common/InputOTP.cjs.map +1 -0
  301. package/dist/components/common/InputOTP.d.cts +5 -27
  302. package/dist/components/common/InputOTP.d.ts +5 -27
  303. package/dist/components/common/InputOTP.js +14 -1
  304. package/dist/components/common/InputOTP.js.map +1 -0
  305. package/dist/components/common/PoweredByCrossmint.cjs +10 -1
  306. package/dist/components/common/PoweredByCrossmint.cjs.map +1 -0
  307. package/dist/components/common/PoweredByCrossmint.js +10 -1
  308. package/dist/components/common/PoweredByCrossmint.js.map +1 -0
  309. package/dist/components/common/Spinner.cjs +9 -1
  310. package/dist/components/common/Spinner.cjs.map +1 -0
  311. package/dist/components/common/Spinner.js +9 -1
  312. package/dist/components/common/Spinner.js.map +1 -0
  313. package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.cjs +8 -1
  314. package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.cjs.map +1 -0
  315. package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.js +8 -1
  316. package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.js.map +1 -0
  317. package/dist/components/embed/EmbeddedCheckoutIFrame.cjs +8 -1
  318. package/dist/components/embed/EmbeddedCheckoutIFrame.cjs.map +1 -0
  319. package/dist/components/embed/EmbeddedCheckoutIFrame.js +8 -1
  320. package/dist/components/embed/EmbeddedCheckoutIFrame.js.map +1 -0
  321. package/dist/components/embed/crypto/CryptoEmbeddedCheckout.cjs +11 -1
  322. package/dist/components/embed/crypto/CryptoEmbeddedCheckout.cjs.map +1 -0
  323. package/dist/components/embed/crypto/CryptoEmbeddedCheckout.js +11 -1
  324. package/dist/components/embed/crypto/CryptoEmbeddedCheckout.js.map +1 -0
  325. package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.cjs +10 -1
  326. package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.cjs.map +1 -0
  327. package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.js +10 -1
  328. package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.js.map +1 -0
  329. package/dist/components/embed/fiat/FiatEmbeddedCheckout.cjs +11 -1
  330. package/dist/components/embed/fiat/FiatEmbeddedCheckout.cjs.map +1 -0
  331. package/dist/components/embed/fiat/FiatEmbeddedCheckout.js +11 -1
  332. package/dist/components/embed/fiat/FiatEmbeddedCheckout.js.map +1 -0
  333. package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.cjs +10 -1
  334. package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.cjs.map +1 -0
  335. package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.js +10 -1
  336. package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.js.map +1 -0
  337. package/dist/components/embed/fiat/FiatPaymentElement_OLD.cjs +75 -1
  338. package/dist/components/embed/fiat/FiatPaymentElement_OLD.cjs.map +1 -0
  339. package/dist/components/embed/fiat/FiatPaymentElement_OLD.js +75 -1
  340. package/dist/components/embed/fiat/FiatPaymentElement_OLD.js.map +1 -0
  341. package/dist/components/embed/index.cjs +14 -1
  342. package/dist/components/embed/index.cjs.map +1 -0
  343. package/dist/components/embed/index.js +14 -1
  344. package/dist/components/embed/index.js.map +1 -0
  345. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +39 -1
  346. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs.map +1 -0
  347. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +39 -1
  348. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js.map +1 -0
  349. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +38 -1
  350. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs.map +1 -0
  351. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +38 -1
  352. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js.map +1 -0
  353. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +135 -1
  354. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs.map +1 -0
  355. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +135 -1
  356. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js.map +1 -0
  357. package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.cjs +63 -1
  358. package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.cjs.map +1 -0
  359. package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.js +63 -1
  360. package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.js.map +1 -0
  361. package/dist/components/embed/v3/crypto/utils/handleSendTransaction.cjs +8 -1
  362. package/dist/components/embed/v3/crypto/utils/handleSendTransaction.cjs.map +1 -0
  363. package/dist/components/embed/v3/crypto/utils/handleSendTransaction.js +8 -1
  364. package/dist/components/embed/v3/crypto/utils/handleSendTransaction.js.map +1 -0
  365. package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.cjs +51 -1
  366. package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.cjs.map +1 -0
  367. package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.js +51 -1
  368. package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.js.map +1 -0
  369. package/dist/components/embed/v3/index.cjs +40 -1
  370. package/dist/components/embed/v3/index.cjs.map +1 -0
  371. package/dist/components/embed/v3/index.js +40 -1
  372. package/dist/components/embed/v3/index.js.map +1 -0
  373. package/dist/components/hosted/CrossmintPayButton.cjs +11 -1
  374. package/dist/components/hosted/CrossmintPayButton.cjs.map +1 -0
  375. package/dist/components/hosted/CrossmintPayButton.js +11 -1
  376. package/dist/components/hosted/CrossmintPayButton.js.map +1 -0
  377. package/dist/components/hosted/index.cjs +12 -1
  378. package/dist/components/hosted/index.cjs.map +1 -0
  379. package/dist/components/hosted/index.js +12 -1
  380. package/dist/components/hosted/index.js.map +1 -0
  381. package/dist/components/hosted/styles.cjs +10 -1
  382. package/dist/components/hosted/styles.cjs.map +1 -0
  383. package/dist/components/hosted/styles.js +10 -1
  384. package/dist/components/hosted/styles.js.map +1 -0
  385. package/dist/components/index.cjs +70 -1
  386. package/dist/components/index.cjs.map +1 -0
  387. package/dist/components/index.js +70 -1
  388. package/dist/components/index.js.map +1 -0
  389. package/dist/consts/version.cjs +8 -1
  390. package/dist/consts/version.cjs.map +1 -0
  391. package/dist/consts/version.js +8 -1
  392. package/dist/consts/version.js.map +1 -0
  393. package/dist/hooks/index.cjs +49 -1
  394. package/dist/hooks/index.cjs.map +1 -0
  395. package/dist/hooks/index.d.cts +3 -2
  396. package/dist/hooks/index.d.ts +3 -2
  397. package/dist/hooks/index.js +49 -1
  398. package/dist/hooks/index.js.map +1 -0
  399. package/dist/hooks/useAuth.cjs +37 -1
  400. package/dist/hooks/useAuth.cjs.map +1 -0
  401. package/dist/hooks/useAuth.d.cts +8 -10
  402. package/dist/hooks/useAuth.d.ts +8 -10
  403. package/dist/hooks/useAuth.js +37 -1
  404. package/dist/hooks/useAuth.js.map +1 -0
  405. package/dist/hooks/useCrossmint.cjs +10 -1
  406. package/dist/hooks/useCrossmint.cjs.map +1 -0
  407. package/dist/hooks/useCrossmint.d.cts +0 -1
  408. package/dist/hooks/useCrossmint.d.ts +0 -1
  409. package/dist/hooks/useCrossmint.js +10 -1
  410. package/dist/hooks/useCrossmint.js.map +1 -0
  411. package/dist/hooks/useCrossmintAuth.cjs +37 -0
  412. package/dist/hooks/useCrossmintAuth.cjs.map +1 -0
  413. package/dist/hooks/useCrossmintAuth.d.cts +11 -0
  414. package/dist/hooks/useCrossmintAuth.d.ts +11 -0
  415. package/dist/hooks/useCrossmintAuth.js +37 -0
  416. package/dist/hooks/useCrossmintAuth.js.map +1 -0
  417. package/dist/hooks/useCrossmintCheckout.cjs +13 -1
  418. package/dist/hooks/useCrossmintCheckout.cjs.map +1 -0
  419. package/dist/hooks/useCrossmintCheckout.d.cts +2 -1
  420. package/dist/hooks/useCrossmintCheckout.d.ts +2 -1
  421. package/dist/hooks/useCrossmintCheckout.js +13 -1
  422. package/dist/hooks/useCrossmintCheckout.js.map +1 -0
  423. package/dist/hooks/useDeepEffect.cjs +8 -1
  424. package/dist/hooks/useDeepEffect.cjs.map +1 -0
  425. package/dist/hooks/useDeepEffect.js +8 -1
  426. package/dist/hooks/useDeepEffect.js.map +1 -0
  427. package/dist/hooks/useEnvironment.cjs +8 -1
  428. package/dist/hooks/useEnvironment.cjs.map +1 -0
  429. package/dist/hooks/useEnvironment.js +8 -1
  430. package/dist/hooks/useEnvironment.js.map +1 -0
  431. package/dist/hooks/useOAuthWindowListener.cjs +37 -1
  432. package/dist/hooks/useOAuthWindowListener.cjs.map +1 -0
  433. package/dist/hooks/useOAuthWindowListener.d.cts +2 -6
  434. package/dist/hooks/useOAuthWindowListener.d.ts +2 -6
  435. package/dist/hooks/useOAuthWindowListener.js +37 -1
  436. package/dist/hooks/useOAuthWindowListener.js.map +1 -0
  437. package/dist/hooks/useWallet.cjs +37 -1
  438. package/dist/hooks/useWallet.cjs.map +1 -0
  439. package/dist/hooks/useWallet.js +37 -1
  440. package/dist/hooks/useWallet.js.map +1 -0
  441. package/dist/icons/alert.cjs +8 -1
  442. package/dist/icons/alert.cjs.map +1 -0
  443. package/dist/icons/alert.js +8 -1
  444. package/dist/icons/alert.js.map +1 -0
  445. package/dist/icons/base64Icons.cjs +12 -0
  446. package/dist/icons/base64Icons.cjs.map +1 -0
  447. package/dist/icons/base64Icons.d.cts +5 -0
  448. package/dist/icons/base64Icons.d.ts +5 -0
  449. package/dist/icons/base64Icons.js +12 -0
  450. package/dist/icons/base64Icons.js.map +1 -0
  451. package/dist/icons/chevronRight.cjs +8 -0
  452. package/dist/icons/chevronRight.cjs.map +1 -0
  453. package/dist/icons/chevronRight.d.cts +9 -0
  454. package/dist/icons/chevronRight.d.ts +9 -0
  455. package/dist/icons/chevronRight.js +8 -0
  456. package/dist/icons/chevronRight.js.map +1 -0
  457. package/dist/icons/discord.cjs +29 -1
  458. package/dist/icons/discord.cjs.map +1 -0
  459. package/dist/icons/discord.js +29 -1
  460. package/dist/icons/discord.js.map +1 -0
  461. package/dist/icons/emailOTP.cjs +8 -1
  462. package/dist/icons/emailOTP.cjs.map +1 -0
  463. package/dist/icons/emailOTP.js +8 -1
  464. package/dist/icons/emailOTP.js.map +1 -0
  465. package/dist/icons/farcaster.cjs +8 -1
  466. package/dist/icons/farcaster.cjs.map +1 -0
  467. package/dist/icons/farcaster.js +8 -1
  468. package/dist/icons/farcaster.js.map +1 -0
  469. package/dist/icons/fingerprint.cjs +8 -1
  470. package/dist/icons/fingerprint.cjs.map +1 -0
  471. package/dist/icons/fingerprint.js +8 -1
  472. package/dist/icons/fingerprint.js.map +1 -0
  473. package/dist/icons/google.cjs +8 -1
  474. package/dist/icons/google.cjs.map +1 -0
  475. package/dist/icons/google.js +8 -1
  476. package/dist/icons/google.js.map +1 -0
  477. package/dist/icons/leftArrow.cjs +8 -1
  478. package/dist/icons/leftArrow.cjs.map +1 -0
  479. package/dist/icons/leftArrow.js +8 -1
  480. package/dist/icons/leftArrow.js.map +1 -0
  481. package/dist/icons/passkey.cjs +8 -1
  482. package/dist/icons/passkey.cjs.map +1 -0
  483. package/dist/icons/passkey.js +8 -1
  484. package/dist/icons/passkey.js.map +1 -0
  485. package/dist/icons/passkeyPromptLogo.cjs +8 -1
  486. package/dist/icons/passkeyPromptLogo.cjs.map +1 -0
  487. package/dist/icons/passkeyPromptLogo.js +8 -1
  488. package/dist/icons/passkeyPromptLogo.js.map +1 -0
  489. package/dist/icons/poweredByLeaf.cjs +8 -1
  490. package/dist/icons/poweredByLeaf.cjs.map +1 -0
  491. package/dist/icons/poweredByLeaf.d.cts +1 -2
  492. package/dist/icons/poweredByLeaf.d.ts +1 -2
  493. package/dist/icons/poweredByLeaf.js +8 -1
  494. package/dist/icons/poweredByLeaf.js.map +1 -0
  495. package/dist/icons/wallet.cjs +8 -0
  496. package/dist/icons/wallet.cjs.map +1 -0
  497. package/dist/icons/wallet.d.cts +9 -0
  498. package/dist/icons/wallet.d.ts +9 -0
  499. package/dist/icons/wallet.js +8 -0
  500. package/dist/icons/wallet.js.map +1 -0
  501. package/dist/icons/x.cjs +29 -1
  502. package/dist/icons/x.cjs.map +1 -0
  503. package/dist/icons/x.js +29 -1
  504. package/dist/icons/x.js.map +1 -0
  505. package/dist/index.cjs +126 -1
  506. package/dist/index.cjs.map +1 -0
  507. package/dist/index.d.cts +2 -3
  508. package/dist/index.d.ts +2 -3
  509. package/dist/index.js +126 -1
  510. package/dist/index.js.map +1 -0
  511. package/dist/providers/CrossmintAuthProvider.cjs +39 -1
  512. package/dist/providers/CrossmintAuthProvider.cjs.map +1 -0
  513. package/dist/providers/CrossmintAuthProvider.d.cts +9 -6
  514. package/dist/providers/CrossmintAuthProvider.d.ts +9 -6
  515. package/dist/providers/CrossmintAuthProvider.js +39 -1
  516. package/dist/providers/CrossmintAuthProvider.js.map +1 -0
  517. package/dist/providers/CrossmintWalletProvider.cjs +39 -1
  518. package/dist/providers/CrossmintWalletProvider.cjs.map +1 -0
  519. package/dist/providers/CrossmintWalletProvider.js +39 -1
  520. package/dist/providers/CrossmintWalletProvider.js.map +1 -0
  521. package/dist/providers/TwindProvider.cjs +9 -1
  522. package/dist/providers/TwindProvider.cjs.map +1 -0
  523. package/dist/providers/TwindProvider.js +9 -1
  524. package/dist/providers/TwindProvider.js.map +1 -0
  525. package/dist/providers/auth/AuthFormProvider.cjs +39 -1
  526. package/dist/providers/auth/AuthFormProvider.cjs.map +1 -0
  527. package/dist/providers/auth/AuthFormProvider.d.cts +7 -9
  528. package/dist/providers/auth/AuthFormProvider.d.ts +7 -9
  529. package/dist/providers/auth/AuthFormProvider.js +39 -1
  530. package/dist/providers/auth/AuthFormProvider.js.map +1 -0
  531. package/dist/providers/auth/FarcasterProvider.cjs +8 -1
  532. package/dist/providers/auth/FarcasterProvider.cjs.map +1 -0
  533. package/dist/providers/auth/FarcasterProvider.js +8 -1
  534. package/dist/providers/auth/FarcasterProvider.js.map +1 -0
  535. package/dist/providers/auth/web3/WagmiAuthProvider.cjs +8 -0
  536. package/dist/providers/auth/web3/WagmiAuthProvider.cjs.map +1 -0
  537. package/dist/providers/auth/web3/WagmiAuthProvider.d.cts +8 -0
  538. package/dist/providers/auth/web3/WagmiAuthProvider.d.ts +8 -0
  539. package/dist/providers/auth/web3/WagmiAuthProvider.js +8 -0
  540. package/dist/providers/auth/web3/WagmiAuthProvider.js.map +1 -0
  541. package/dist/providers/index.cjs +43 -1
  542. package/dist/providers/index.cjs.map +1 -0
  543. package/dist/providers/index.d.cts +2 -1
  544. package/dist/providers/index.d.ts +2 -1
  545. package/dist/providers/index.js +43 -1
  546. package/dist/providers/index.js.map +1 -0
  547. package/dist/testUtils.cjs +8 -1
  548. package/dist/testUtils.cjs.map +1 -0
  549. package/dist/testUtils.d.cts +1 -2
  550. package/dist/testUtils.d.ts +1 -2
  551. package/dist/testUtils.js +8 -1
  552. package/dist/testUtils.js.map +1 -0
  553. package/dist/twind.config.cjs +8 -1
  554. package/dist/twind.config.cjs.map +1 -0
  555. package/dist/twind.config.d.cts +0 -3
  556. package/dist/twind.config.d.ts +0 -3
  557. package/dist/twind.config.js +8 -1
  558. package/dist/twind.config.js.map +1 -0
  559. package/dist/types/auth.cjs +1 -1
  560. package/dist/types/auth.cjs.map +1 -0
  561. package/dist/types/auth.js +1 -0
  562. package/dist/types/auth.js.map +1 -0
  563. package/dist/utils/classNames.cjs +8 -1
  564. package/dist/utils/classNames.cjs.map +1 -0
  565. package/dist/utils/classNames.js +8 -1
  566. package/dist/utils/classNames.js.map +1 -0
  567. package/dist/utils/createCrossmintApiClient.cjs +9 -1
  568. package/dist/utils/createCrossmintApiClient.cjs.map +1 -0
  569. package/dist/utils/createCrossmintApiClient.js +9 -1
  570. package/dist/utils/createCrossmintApiClient.js.map +1 -0
  571. package/package.json +21 -15
  572. package/src/components/auth/AuthForm.tsx +10 -5
  573. package/src/components/auth/AuthFormBackButton.tsx +1 -5
  574. package/src/components/auth/AuthFormDialog.tsx +7 -2
  575. package/src/components/auth/methods/email/EmailOTPInput.tsx +13 -14
  576. package/src/components/auth/methods/email/EmailSignIn.tsx +15 -19
  577. package/src/components/auth/methods/farcaster/FarcasterSignIn.tsx +10 -14
  578. package/src/components/auth/methods/google/GoogleSignIn.tsx +7 -16
  579. package/src/components/auth/methods/web3/Web3AuthFlow.tsx +17 -0
  580. package/src/components/auth/methods/web3/Web3AuthWrapper.tsx +87 -0
  581. package/src/components/auth/methods/web3/Web3ConnectButton.tsx +62 -0
  582. package/src/components/auth/methods/web3/Web3Connectors.tsx +91 -0
  583. package/src/components/auth/methods/web3/Web3ProviderButton.tsx +38 -0
  584. package/src/components/auth/methods/web3/Web3SignIn.tsx +41 -0
  585. package/src/components/common/Dialog.tsx +10 -29
  586. package/src/components/common/Divider.tsx +1 -1
  587. package/src/components/common/InputOTP.tsx +9 -4
  588. package/src/components/common/PoweredByCrossmint.tsx +3 -10
  589. package/src/components/embed/v3/EmbeddedCheckoutV3IFrame.tsx +11 -3
  590. package/src/components/embed/v3/crypto/utils/handleSendTransaction.ts +12 -6
  591. package/src/hooks/index.ts +0 -1
  592. package/src/hooks/useAuth.ts +2 -2
  593. package/src/hooks/useCrossmint.test.tsx +4 -33
  594. package/src/hooks/useCrossmint.tsx +1 -12
  595. package/src/hooks/useCrossmintAuth.ts +12 -0
  596. package/src/hooks/useCrossmintCheckout.tsx +7 -5
  597. package/src/hooks/useOAuthWindowListener.ts +4 -10
  598. package/src/icons/base64Icons.ts +8 -0
  599. package/src/icons/chevronRight.tsx +21 -0
  600. package/src/icons/poweredByLeaf.tsx +81 -80
  601. package/src/icons/wallet.tsx +23 -0
  602. package/src/providers/CrossmintAuthProvider.test.tsx +72 -87
  603. package/src/providers/CrossmintAuthProvider.tsx +52 -49
  604. package/src/providers/CrossmintWalletProvider.test.tsx +15 -9
  605. package/src/providers/auth/AuthFormProvider.test.tsx +61 -19
  606. package/src/providers/auth/AuthFormProvider.tsx +52 -60
  607. package/src/providers/auth/web3/WagmiAuthProvider.tsx +56 -0
  608. package/src/testUtils.ts +0 -4
  609. package/src/twind.config.ts +12 -5
  610. package/dist/chunk-22TFOKGT.js +0 -1
  611. package/dist/chunk-265BME7Y.cjs +0 -1
  612. package/dist/chunk-2POV64LQ.js +0 -1
  613. package/dist/chunk-2TVTJ6GV.js +0 -1
  614. package/dist/chunk-2VQLMU5A.cjs +0 -1
  615. package/dist/chunk-2WSEHVNP.cjs +0 -1
  616. package/dist/chunk-3BUVHV54.js +0 -0
  617. package/dist/chunk-3JUSQ2QE.cjs +0 -1
  618. package/dist/chunk-47YB6ECI.cjs +0 -1
  619. package/dist/chunk-4IHRWQWT.js +0 -1
  620. package/dist/chunk-4ITU7JF2.js +0 -1
  621. package/dist/chunk-5DCSVXPM.js +0 -1
  622. package/dist/chunk-5IFQJPBE.cjs +0 -1
  623. package/dist/chunk-63OMZNLN.js +0 -1
  624. package/dist/chunk-6GZGVNLH.cjs +0 -1
  625. package/dist/chunk-6IWCD2YY.cjs +0 -1
  626. package/dist/chunk-72MMCJ2E.js +0 -0
  627. package/dist/chunk-72P3JMXX.js +0 -1
  628. package/dist/chunk-77PBG2JJ.js +0 -1
  629. package/dist/chunk-7CPFUVAV.js +0 -1
  630. package/dist/chunk-7HSC6Q3U.js +0 -1
  631. package/dist/chunk-7M23WP3P.js +0 -1
  632. package/dist/chunk-7MUBJ5DE.cjs +0 -1
  633. package/dist/chunk-7MYTZUEK.js +0 -1
  634. package/dist/chunk-7WTGDAJW.js +0 -1
  635. package/dist/chunk-7YJMOHOO.js +0 -1
  636. package/dist/chunk-7Z2T6P5L.cjs +0 -1
  637. package/dist/chunk-A3QHXPHD.js +0 -1
  638. package/dist/chunk-AMP2ZDXD.cjs +0 -1
  639. package/dist/chunk-ASU2E6GU.js +0 -1
  640. package/dist/chunk-B7GHWWM6.cjs +0 -1
  641. package/dist/chunk-BHJ5JTA2.js +0 -1
  642. package/dist/chunk-BR77Q3PK.cjs +0 -1
  643. package/dist/chunk-C3JRTLQP.js +0 -1
  644. package/dist/chunk-D3255LVM.cjs +0 -1
  645. package/dist/chunk-DCG56C7R.cjs +0 -1
  646. package/dist/chunk-DGZQUCSD.js +0 -1
  647. package/dist/chunk-E4TBJMOO.js +0 -1
  648. package/dist/chunk-E75QRQ6Q.js +0 -1
  649. package/dist/chunk-E7T2NBUP.cjs +0 -1
  650. package/dist/chunk-EK4Y233O.js +0 -1
  651. package/dist/chunk-EUXGP4IN.cjs +0 -1
  652. package/dist/chunk-EVADF7QA.js +0 -1
  653. package/dist/chunk-FFIN4TCT.cjs +0 -1
  654. package/dist/chunk-FON43I6G.cjs +0 -1
  655. package/dist/chunk-FYYNH6VT.js +0 -1
  656. package/dist/chunk-G6WJLBM7.js +0 -1
  657. package/dist/chunk-GJTS3VOX.cjs +0 -1
  658. package/dist/chunk-HFIIBQLK.js +0 -1
  659. package/dist/chunk-HHQZJJKE.js +0 -1
  660. package/dist/chunk-HWGRWJUT.cjs +0 -1
  661. package/dist/chunk-HYI4R74V.cjs +0 -1
  662. package/dist/chunk-I4GMMHQR.cjs +0 -1
  663. package/dist/chunk-IAJBYU5C.js +0 -1
  664. package/dist/chunk-IKY4YQDO.js +0 -1
  665. package/dist/chunk-IMV35JZB.cjs +0 -1
  666. package/dist/chunk-JGM3G5E2.js +0 -1
  667. package/dist/chunk-JSNLFGET.js +0 -1
  668. package/dist/chunk-JSNUJJQJ.js +0 -1
  669. package/dist/chunk-KY4UBKAO.cjs +0 -1
  670. package/dist/chunk-LF6WLVWL.js +0 -1
  671. package/dist/chunk-LZ5XEFKY.cjs +0 -1
  672. package/dist/chunk-MC3WZMO2.cjs +0 -1
  673. package/dist/chunk-MJMMQJVO.cjs +0 -1
  674. package/dist/chunk-N4QVZLJB.js +0 -1
  675. package/dist/chunk-NBJIJZGO.js +0 -1
  676. package/dist/chunk-NETRNZFY.js +0 -1
  677. package/dist/chunk-NFLGT52C.cjs +0 -1
  678. package/dist/chunk-NRN4WNQL.cjs +0 -1
  679. package/dist/chunk-NTIINLZM.cjs +0 -1
  680. package/dist/chunk-NY7SDPXG.js +0 -1
  681. package/dist/chunk-NZQIZ4ZY.cjs +0 -1
  682. package/dist/chunk-O5J2ZIJ6.cjs +0 -1
  683. package/dist/chunk-OEAPYLBR.cjs +0 -1
  684. package/dist/chunk-OOLXYAO7.js +0 -1
  685. package/dist/chunk-OVBCANGC.cjs +0 -1
  686. package/dist/chunk-PNUQCT4M.cjs +0 -1
  687. package/dist/chunk-PXDN3KFO.js +0 -1
  688. package/dist/chunk-QASKWI5Y.js +0 -1
  689. package/dist/chunk-QDOP7HRG.js +0 -1
  690. package/dist/chunk-QP4CMLMG.cjs +0 -1
  691. package/dist/chunk-QYQERFYL.cjs +0 -1
  692. package/dist/chunk-QZZXNJMU.js +0 -1
  693. package/dist/chunk-RGOIGFPQ.cjs +0 -1
  694. package/dist/chunk-RJGOALQ6.cjs +0 -1
  695. package/dist/chunk-RUQHINLO.js +0 -1
  696. package/dist/chunk-RYQRCUKB.js +0 -1
  697. package/dist/chunk-S73E6EBO.cjs +0 -1
  698. package/dist/chunk-SC5LQJBG.cjs +0 -1
  699. package/dist/chunk-SFDQPSSP.js +0 -1
  700. package/dist/chunk-SJFJI2OT.cjs +0 -1
  701. package/dist/chunk-SKRQKK2T.cjs +0 -1
  702. package/dist/chunk-SRQAQHYK.cjs +0 -1
  703. package/dist/chunk-SSWWXH5O.cjs +0 -1
  704. package/dist/chunk-SYDMK3TQ.js +0 -1
  705. package/dist/chunk-T422SK4C.cjs +0 -1
  706. package/dist/chunk-T5PSAJ3R.cjs +0 -1
  707. package/dist/chunk-TM7WDKYR.cjs +0 -1
  708. package/dist/chunk-TNCETEEL.js +0 -1
  709. package/dist/chunk-U6FTIAJO.js +0 -1
  710. package/dist/chunk-U7JNW7VQ.js +0 -1
  711. package/dist/chunk-UAFW3OWA.js +0 -1
  712. package/dist/chunk-UI2RH2CP.js +0 -1
  713. package/dist/chunk-UOHM5SBY.cjs +0 -1
  714. package/dist/chunk-UX6T7EAP.js +0 -1
  715. package/dist/chunk-V2YSOSYZ.cjs +0 -1
  716. package/dist/chunk-V4LKDMLV.js +0 -1
  717. package/dist/chunk-VI6TW7JT.cjs +0 -1
  718. package/dist/chunk-VIJFGMUH.js +0 -1
  719. package/dist/chunk-VWBAHXIO.cjs +0 -1
  720. package/dist/chunk-W4UPIFFS.cjs +0 -1
  721. package/dist/chunk-WABJHG6B.cjs +0 -1
  722. package/dist/chunk-WARJE3L2.cjs +0 -1
  723. package/dist/chunk-WF3RK7VH.js +0 -1
  724. package/dist/chunk-X5BBXO27.cjs +0 -1
  725. package/dist/chunk-XIVIIEY5.js +0 -1
  726. package/dist/chunk-XMNGTV3F.cjs +0 -1
  727. package/dist/chunk-Y5RJUIQB.cjs +0 -1
  728. package/dist/chunk-YKC4ST2J.js +0 -1
  729. package/dist/chunk-YLAJFXWZ.js +0 -0
  730. package/dist/chunk-YVTAV6EU.cjs +0 -1
  731. package/dist/chunk-Z2FGFHRQ.cjs +0 -1
  732. package/dist/hooks/useAuthSignIn.cjs +0 -1
  733. package/dist/hooks/useAuthSignIn.d.cts +0 -21
  734. package/dist/hooks/useAuthSignIn.d.ts +0 -21
  735. package/dist/hooks/useAuthSignIn.js +0 -1
  736. package/dist/hooks/useRefreshToken.cjs +0 -1
  737. package/dist/hooks/useRefreshToken.d.cts +0 -11
  738. package/dist/hooks/useRefreshToken.d.ts +0 -11
  739. package/dist/hooks/useRefreshToken.js +0 -1
  740. package/dist/utils/authCookies.cjs +0 -1
  741. package/dist/utils/authCookies.d.cts +0 -5
  742. package/dist/utils/authCookies.d.ts +0 -5
  743. package/dist/utils/authCookies.js +0 -1
  744. package/src/hooks/useAuthSignIn.ts +0 -117
  745. package/src/hooks/useRefreshToken.test.ts +0 -155
  746. package/src/hooks/useRefreshToken.ts +0 -68
  747. package/src/utils/authCookies.test.ts +0 -41
  748. package/src/utils/authCookies.ts +0 -13
@@ -0,0 +1,1265 @@
1
+ import {
2
+ Web3ProviderButton
3
+ } from "./chunk-WK5RAFJ3.js";
4
+ import {
5
+ Web3ConnectButton
6
+ } from "./chunk-6DNBJVR5.js";
7
+ import {
8
+ WagmiAuthProvider
9
+ } from "./chunk-OZS4WEKF.js";
10
+ import {
11
+ FarcasterProvider
12
+ } from "./chunk-A7J4DAE7.js";
13
+ import {
14
+ PasskeyPrompt
15
+ } from "./chunk-XEZF7G64.js";
16
+ import {
17
+ Dialog,
18
+ DialogContent,
19
+ DialogDescription,
20
+ DialogTitle
21
+ } from "./chunk-NMXFWIFA.js";
22
+ import {
23
+ InputOTP,
24
+ InputOTPGroup,
25
+ InputOTPSlot
26
+ } from "./chunk-33WZFL2D.js";
27
+ import {
28
+ PoweredByCrossmint
29
+ } from "./chunk-FKIMKZ4Y.js";
30
+ import {
31
+ Spinner
32
+ } from "./chunk-QTL5I5C2.js";
33
+ import {
34
+ TwindProvider
35
+ } from "./chunk-HATQVB6H.js";
36
+ import {
37
+ AuthFormBackButton
38
+ } from "./chunk-QJ44PL7L.js";
39
+ import {
40
+ classNames
41
+ } from "./chunk-RZPQIRIY.js";
42
+ import {
43
+ WalletIcon
44
+ } from "./chunk-VZIXXIU5.js";
45
+ import {
46
+ AlertIcon
47
+ } from "./chunk-7KIY6DLW.js";
48
+ import {
49
+ metamaskIcon,
50
+ walletConnectIcon
51
+ } from "./chunk-QFQWKKVU.js";
52
+ import {
53
+ ChevronRightIcon
54
+ } from "./chunk-3KR4GYLF.js";
55
+ import {
56
+ EmailOtpIcon
57
+ } from "./chunk-I63FQCIV.js";
58
+ import {
59
+ FarcasterIcon
60
+ } from "./chunk-ZIHCLVCD.js";
61
+ import {
62
+ GoogleIcon
63
+ } from "./chunk-YWVQCHQF.js";
64
+ import {
65
+ useCrossmint
66
+ } from "./chunk-3J6CUUWT.js";
67
+ import {
68
+ __async,
69
+ __objRest,
70
+ __spreadProps,
71
+ __spreadValues
72
+ } from "./chunk-CRTRMMJ7.js";
73
+
74
+ // src/providers/CrossmintWalletProvider.tsx
75
+ import { createContext as createContext3, useMemo as useMemo3, useState as useState9 } from "react";
76
+ import { createPortal } from "react-dom";
77
+ import {
78
+ SmartWalletError,
79
+ SmartWalletSDK
80
+ } from "@crossmint/client-sdk-smart-wallet";
81
+
82
+ // src/hooks/useWallet.ts
83
+ import { useContext } from "react";
84
+ function useWallet() {
85
+ const walletContext = useContext(WalletContext);
86
+ if (!walletContext) {
87
+ throw new Error("useWallet must be used within CrossmintAuthProvider or CrossmintWalletProvider");
88
+ }
89
+ return walletContext;
90
+ }
91
+
92
+ // src/hooks/useAuth.ts
93
+ import { useContext as useContext4 } from "react";
94
+
95
+ // src/providers/CrossmintAuthProvider.tsx
96
+ import { createContext as createContext2, useEffect as useEffect6, useMemo as useMemo2, useRef as useRef2, useState as useState8 } from "react";
97
+ import { CrossmintAuth, getCookie } from "@crossmint/client-sdk-auth";
98
+ import { validateApiKeyAndGetCrossmintBaseUrl } from "@crossmint/common-sdk-base";
99
+ import { SESSION_PREFIX } from "@crossmint/common-sdk-auth";
100
+
101
+ // src/components/auth/AuthFormDialog.tsx
102
+ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
103
+
104
+ // src/providers/auth/AuthFormProvider.tsx
105
+ import { createContext, useCallback, useContext as useContext3, useEffect, useState } from "react";
106
+
107
+ // src/hooks/useCrossmintAuth.ts
108
+ import { useContext as useContext2 } from "react";
109
+ function useCrossmintAuth() {
110
+ const context = useContext2(AuthContext);
111
+ if (!context) {
112
+ throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");
113
+ }
114
+ return context;
115
+ }
116
+
117
+ // src/providers/auth/AuthFormProvider.tsx
118
+ import { jsx } from "react/jsx-runtime";
119
+ var initialOAuthUrlMap = {
120
+ google: ""
121
+ // Farcaster is not included here as it uses a different authentication method
122
+ };
123
+ var AuthFormContext = createContext(void 0);
124
+ var useAuthForm = () => {
125
+ const context = useContext3(AuthFormContext);
126
+ if (!context) {
127
+ throw new Error("useAuthForm must be used within an AuthFormProvider");
128
+ }
129
+ return context;
130
+ };
131
+ var AuthFormProvider = ({
132
+ children,
133
+ initialState
134
+ }) => {
135
+ const { crossmintAuth } = useCrossmintAuth();
136
+ const [step, setStep] = useState("initial");
137
+ const [oauthUrlMap, setOauthUrlMap] = useState(initialOAuthUrlMap);
138
+ const [isLoadingOauthUrlMap, setIsLoadingOauthUrlMap] = useState(true);
139
+ const { loginMethods, baseUrl, setDialogOpen, appearance, embeddedWallets } = initialState;
140
+ if (loginMethods.includes("web3") && (embeddedWallets == null ? void 0 : embeddedWallets.createOnLogin) === "all-users") {
141
+ throw new Error("Creating wallets on login is not yet supported for web3 login method");
142
+ }
143
+ const preFetchAndSetOauthUrl = useCallback(() => __async(void 0, null, function* () {
144
+ setIsLoadingOauthUrlMap(true);
145
+ try {
146
+ const oauthProviders = loginMethods.filter(
147
+ (method) => method in initialOAuthUrlMap
148
+ );
149
+ const oauthPromiseList = oauthProviders.map((provider) => __async(void 0, null, function* () {
150
+ const url = yield crossmintAuth == null ? void 0 : crossmintAuth.getOAuthUrl(provider);
151
+ return { [provider]: url };
152
+ }));
153
+ const oauthUrlMap2 = Object.assign({}, ...yield Promise.all(oauthPromiseList));
154
+ setOauthUrlMap(oauthUrlMap2);
155
+ } catch (error) {
156
+ console.error("Error fetching OAuth URLs:", error);
157
+ } finally {
158
+ setIsLoadingOauthUrlMap(false);
159
+ }
160
+ }), [loginMethods, crossmintAuth]);
161
+ useEffect(() => {
162
+ preFetchAndSetOauthUrl();
163
+ }, [preFetchAndSetOauthUrl]);
164
+ const handleToggleDialog = (open) => {
165
+ setDialogOpen == null ? void 0 : setDialogOpen(open);
166
+ if (!open) {
167
+ setTimeout(() => setStep("initial"), 250);
168
+ }
169
+ };
170
+ const value = {
171
+ step,
172
+ baseUrl,
173
+ appearance,
174
+ loginMethods,
175
+ oauthUrlMap,
176
+ isLoadingOauthUrlMap,
177
+ setDialogOpen: handleToggleDialog,
178
+ setStep
179
+ };
180
+ return /* @__PURE__ */ jsx(AuthFormContext.Provider, { value, children: /* @__PURE__ */ jsx(WagmiAuthProvider, { children }) });
181
+ };
182
+
183
+ // src/components/auth/methods/email/EmailAuthFlow.tsx
184
+ import { useState as useState4 } from "react";
185
+
186
+ // src/components/auth/methods/email/EmailOTPInput.tsx
187
+ import { useState as useState2 } from "react";
188
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
189
+ var EMAIL_VERIFICATION_TOKEN_LENGTH = 6;
190
+ function EmailOTPInput({
191
+ otpEmailData,
192
+ setOtpEmailData
193
+ }) {
194
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
195
+ const { crossmintAuth } = useCrossmintAuth();
196
+ const { appearance, setDialogOpen, setStep } = useAuthForm();
197
+ const [token, setToken] = useState2("");
198
+ const [hasError, setHasError] = useState2(false);
199
+ const [loading, setLoading] = useState2(false);
200
+ const handleOnSubmit = () => __async(this, null, function* () {
201
+ var _a2, _b2;
202
+ setLoading(true);
203
+ try {
204
+ const oneTimeSecret = yield crossmintAuth == null ? void 0 : crossmintAuth.confirmEmailOtp(
205
+ (_a2 = otpEmailData == null ? void 0 : otpEmailData.email) != null ? _a2 : "",
206
+ (_b2 = otpEmailData == null ? void 0 : otpEmailData.emailId) != null ? _b2 : "",
207
+ token
208
+ );
209
+ yield crossmintAuth == null ? void 0 : crossmintAuth.handleRefreshAuthMaterial(oneTimeSecret);
210
+ setDialogOpen(false);
211
+ setStep("initial");
212
+ } catch (e) {
213
+ console.error("Error signing in via email ", e);
214
+ setHasError(true);
215
+ } finally {
216
+ setLoading(false);
217
+ }
218
+ });
219
+ const handleOnBack = () => {
220
+ setStep("initial");
221
+ setOtpEmailData(null);
222
+ };
223
+ return /* @__PURE__ */ jsxs("div", { children: [
224
+ /* @__PURE__ */ jsx2(
225
+ AuthFormBackButton,
226
+ {
227
+ onClick: handleOnBack,
228
+ iconColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary,
229
+ ringColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.accent
230
+ }
231
+ ),
232
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-start w-full", children: [
233
+ /* @__PURE__ */ jsx2("div", { className: "relative left-3", children: /* @__PURE__ */ jsx2(
234
+ EmailOtpIcon,
235
+ {
236
+ customAccentColor: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.accent,
237
+ customButtonBackgroundColor: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.buttonBackground,
238
+ customBackgroundColor: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.background
239
+ }
240
+ ) }),
241
+ /* @__PURE__ */ jsx2(
242
+ "p",
243
+ {
244
+ className: "text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",
245
+ style: { color: (_f = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _f.textPrimary },
246
+ children: "Check your email"
247
+ }
248
+ ),
249
+ /* @__PURE__ */ jsx2(
250
+ "p",
251
+ {
252
+ className: "text-center text-cm-text-secondary px-4",
253
+ style: { color: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.textSecondary },
254
+ children: "A temporary login code has been sent to your email"
255
+ }
256
+ ),
257
+ /* @__PURE__ */ jsx2("div", { className: "py-8", children: /* @__PURE__ */ jsx2(
258
+ InputOTP,
259
+ {
260
+ maxLength: EMAIL_VERIFICATION_TOKEN_LENGTH,
261
+ value: token,
262
+ onChange: (val) => {
263
+ setToken(val);
264
+ setHasError(false);
265
+ },
266
+ onComplete: handleOnSubmit,
267
+ disabled: loading,
268
+ customStyles: {
269
+ accent: (_i = (_h = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _h.accent) != null ? _i : "#04AA6D",
270
+ danger: (_k = (_j = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _j.danger) != null ? _k : "#f44336",
271
+ border: (_m = (_l = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _l.border) != null ? _m : "#E5E7EB",
272
+ textPrimary: (_o = (_n = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _n.textPrimary) != null ? _o : "#909ca3",
273
+ buttonBackground: (_q = (_p = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _p.buttonBackground) != null ? _q : "#eff6ff",
274
+ inputBackground: (_s = (_r = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _r.inputBackground) != null ? _s : "#FFFFFF",
275
+ borderRadius: appearance == null ? void 0 : appearance.borderRadius
276
+ },
277
+ children: /* @__PURE__ */ jsxs(InputOTPGroup, { children: [
278
+ /* @__PURE__ */ jsx2(InputOTPSlot, { index: 0, hasError }),
279
+ /* @__PURE__ */ jsx2(InputOTPSlot, { index: 1, hasError }),
280
+ /* @__PURE__ */ jsx2(InputOTPSlot, { index: 2, hasError }),
281
+ /* @__PURE__ */ jsx2(InputOTPSlot, { index: 3, hasError }),
282
+ /* @__PURE__ */ jsx2(InputOTPSlot, { index: 4, hasError }),
283
+ /* @__PURE__ */ jsx2(InputOTPSlot, { index: 5, hasError })
284
+ ] })
285
+ }
286
+ ) }),
287
+ /* @__PURE__ */ jsxs("p", { className: "text-sm leading-tight text-cm-text-secondary text-center", children: [
288
+ /* @__PURE__ */ jsx2("span", { style: { color: (_t = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _t.textSecondary }, children: "Can't find the email? Check spam folder or contact" }),
289
+ " ",
290
+ /* @__PURE__ */ jsx2(
291
+ "a",
292
+ {
293
+ className: "transition-opacity duration-150 text-cm-link hover:opacity-70",
294
+ style: { color: (_u = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _u.textLink },
295
+ href: "mailto:support@crossmint.io",
296
+ children: "support@crossmint.io"
297
+ },
298
+ "resend-email-link"
299
+ )
300
+ ] })
301
+ ] })
302
+ ] });
303
+ }
304
+
305
+ // src/components/auth/methods/email/EmailSignIn.tsx
306
+ import { useState as useState3 } from "react";
307
+ import Color from "color";
308
+ import { isEmailValid } from "@crossmint/common-sdk-auth";
309
+ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
310
+ function EmailSignIn({ setOtpEmailData }) {
311
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
312
+ const { crossmintAuth } = useCrossmintAuth();
313
+ const { appearance, setStep } = useAuthForm();
314
+ const [emailInput, setEmailInput] = useState3("");
315
+ const [emailError, setEmailError] = useState3("");
316
+ const [isLoading, setIsLoading] = useState3(false);
317
+ function handleOnSubmit(e) {
318
+ return __async(this, null, function* () {
319
+ e.preventDefault();
320
+ if (!isEmailValid(emailInput)) {
321
+ setEmailError("Please enter a valid email address");
322
+ return;
323
+ }
324
+ setIsLoading(true);
325
+ try {
326
+ const trimmedEmailInput = emailInput.trim().toLowerCase();
327
+ const emailSignInRes = yield crossmintAuth == null ? void 0 : crossmintAuth.sendEmailOtp(trimmedEmailInput);
328
+ setOtpEmailData({ email: trimmedEmailInput, emailId: emailSignInRes.emailId });
329
+ setStep("otp");
330
+ } catch (_e2) {
331
+ setIsLoading(false);
332
+ setEmailError("Failed to send email. Please try again or contact support.");
333
+ }
334
+ });
335
+ }
336
+ return /* @__PURE__ */ jsx3(Fragment, { children: /* @__PURE__ */ jsx3("div", { className: "flex flex-col items-start justify-start w-full rounded-lg", children: /* @__PURE__ */ jsxs2("div", { className: "w-full", children: [
337
+ /* @__PURE__ */ jsxs2(
338
+ "form",
339
+ {
340
+ role: "form",
341
+ className: "relative",
342
+ onSubmit: handleOnSubmit,
343
+ noValidate: true,
344
+ children: [
345
+ /* @__PURE__ */ jsx3("label", { htmlFor: "emailInput", className: "sr-only", children: "Email" }),
346
+ /* @__PURE__ */ jsx3(
347
+ "input",
348
+ {
349
+ className: classNames(
350
+ "flex-grow text-cm-text-secondary text-left pl-[16px] pr-[80px] h-[58px] w-full border border-cm-border rounded-xl bg-cm-background-primary placeholder:text-sm placeholder:text-opacity-60",
351
+ "transition-none duration-200 ease-in-out",
352
+ "focus:outline-none focus-ring-custom",
353
+ // Add focus ring
354
+ emailError ? "border-red-500" : ""
355
+ ),
356
+ style: {
357
+ color: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary,
358
+ borderRadius: appearance == null ? void 0 : appearance.borderRadius,
359
+ borderColor: emailError ? (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.danger : (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.border,
360
+ backgroundColor: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.inputBackground,
361
+ // @ts-expect-error Add custom ring color to tailwind
362
+ "--focus-ring-color": new Color((_f = (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.accent) != null ? _f : "#04AA6D").alpha(0.18).toString()
363
+ },
364
+ type: "email",
365
+ placeholder: "Enter email",
366
+ value: emailInput,
367
+ onChange: (e) => {
368
+ setEmailInput(e.target.value);
369
+ setEmailError("");
370
+ },
371
+ readOnly: isLoading,
372
+ "aria-describedby": "emailError"
373
+ }
374
+ ),
375
+ /* @__PURE__ */ jsxs2("div", { className: "absolute inset-y-0 right-0 flex items-center pr-4", children: [
376
+ emailError && /* @__PURE__ */ jsx3(AlertIcon, { customColor: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.danger }),
377
+ isLoading && /* @__PURE__ */ jsx3(
378
+ Spinner,
379
+ {
380
+ style: {
381
+ color: (_h = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _h.textSecondary,
382
+ fill: (_i = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _i.textPrimary
383
+ }
384
+ }
385
+ ),
386
+ !emailError && !isLoading && /* @__PURE__ */ jsx3(
387
+ "button",
388
+ {
389
+ type: "submit",
390
+ className: classNames("cursor-pointer font-medium text-cm-accent text-nowrap"),
391
+ style: { color: (_j = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _j.accent },
392
+ disabled: !emailInput,
393
+ children: "Sign in"
394
+ }
395
+ )
396
+ ] })
397
+ ]
398
+ }
399
+ ),
400
+ emailError && /* @__PURE__ */ jsx3("p", { className: "text-xs text-red-500 mb-2 pt-2", children: emailError })
401
+ ] }) }) });
402
+ }
403
+
404
+ // src/components/auth/methods/email/EmailAuthFlow.tsx
405
+ import { jsx as jsx4 } from "react/jsx-runtime";
406
+ function EmailAuthFlow() {
407
+ const { step } = useAuthForm();
408
+ const [otpEmailData, setOtpEmailData] = useState4(null);
409
+ if (step === "otp") {
410
+ return /* @__PURE__ */ jsx4(EmailOTPInput, { otpEmailData, setOtpEmailData });
411
+ }
412
+ if (step === "initial") {
413
+ return /* @__PURE__ */ jsx4(EmailSignIn, { setOtpEmailData });
414
+ }
415
+ return null;
416
+ }
417
+
418
+ // src/components/common/Divider.tsx
419
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
420
+ function Divider({ appearance, text }) {
421
+ var _a, _b, _c;
422
+ const { step } = useAuthForm();
423
+ if (step !== "initial") {
424
+ return null;
425
+ }
426
+ return /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-center w-full pt-2 pb-3", children: [
427
+ /* @__PURE__ */ jsx5("span", { className: "w-full h-[1px] bg-cm-border", style: { backgroundColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.border } }),
428
+ text != null ? /* @__PURE__ */ jsx5(
429
+ "p",
430
+ {
431
+ className: "flex-none px-2 text-sm text-cm-text-primary",
432
+ style: { color: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.textSecondary },
433
+ children: text
434
+ }
435
+ ) : null,
436
+ /* @__PURE__ */ jsx5("span", { className: "w-full h-[1px] bg-cm-border", style: { backgroundColor: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.border } })
437
+ ] });
438
+ }
439
+
440
+ // src/hooks/useOAuthWindowListener.ts
441
+ import { ChildWindow, PopupWindow } from "@crossmint/client-sdk-window";
442
+ import { useEffect as useEffect2, useRef, useState as useState5 } from "react";
443
+ import { z } from "zod";
444
+ var useOAuthWindowListener = (provider) => {
445
+ const { crossmintAuth } = useCrossmintAuth();
446
+ const { oauthUrlMap } = useAuthForm();
447
+ const [isLoading, setIsLoading] = useState5(false);
448
+ const childRef = useRef(null);
449
+ useEffect2(() => {
450
+ if (childRef.current == null) {
451
+ childRef.current = new ChildWindow(window.opener || window.parent, "*", {
452
+ incomingEvents,
453
+ outgoingEvents
454
+ });
455
+ }
456
+ return () => {
457
+ if (childRef.current != null) {
458
+ childRef.current.off("authMaterialFromPopupCallback");
459
+ }
460
+ };
461
+ }, []);
462
+ const createPopupAndSetupListeners = () => __async(void 0, null, function* () {
463
+ if (childRef.current == null) {
464
+ throw new Error("Child window not initialized");
465
+ }
466
+ setIsLoading(true);
467
+ const popup = yield PopupWindow.init(oauthUrlMap[provider], {
468
+ awaitToLoad: false,
469
+ crossOrigin: true,
470
+ width: 400,
471
+ height: 700
472
+ });
473
+ const handleAuthMaterial = (data) => __async(void 0, null, function* () {
474
+ var _a;
475
+ yield crossmintAuth == null ? void 0 : crossmintAuth.handleRefreshAuthMaterial(data.oneTimeSecret);
476
+ (_a = childRef.current) == null ? void 0 : _a.off("authMaterialFromPopupCallback");
477
+ popup.window.close();
478
+ setIsLoading(false);
479
+ });
480
+ childRef.current.on("authMaterialFromPopupCallback", handleAuthMaterial);
481
+ const checkWindowClosure = setInterval(() => {
482
+ var _a;
483
+ if (popup.window.closed) {
484
+ clearInterval(checkWindowClosure);
485
+ setIsLoading(false);
486
+ (_a = childRef.current) == null ? void 0 : _a.off("authMaterialFromPopupCallback");
487
+ }
488
+ }, 2500);
489
+ });
490
+ return {
491
+ createPopupAndSetupListeners,
492
+ isLoading
493
+ };
494
+ };
495
+ var incomingEvents = {
496
+ authMaterialFromPopupCallback: z.object({ oneTimeSecret: z.string() })
497
+ };
498
+ var outgoingEvents = {
499
+ authMaterialFromAuthFrame: z.object({ oneTimeSecret: z.string() })
500
+ };
501
+
502
+ // src/components/auth/methods/google/GoogleSignIn.tsx
503
+ import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
504
+ function GoogleSignIn(_a) {
505
+ var props = __objRest(_a, []);
506
+ var _a2, _b, _c, _d;
507
+ const { step, appearance, isLoadingOauthUrlMap } = useAuthForm();
508
+ const { createPopupAndSetupListeners, isLoading: isLoadingOAuthWindow } = useOAuthWindowListener("google");
509
+ const isLoading = isLoadingOauthUrlMap || isLoadingOAuthWindow;
510
+ if (step !== "initial") {
511
+ return null;
512
+ }
513
+ return /* @__PURE__ */ jsxs4(
514
+ "button",
515
+ __spreadProps(__spreadValues({
516
+ className: classNames(
517
+ "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center",
518
+ "transition-colors duration-200 ease-in-out",
519
+ "hover:bg-cm-hover focus:bg-cm-hover outline-none",
520
+ isLoading ? "cursor-not-allowed hover:bg-cm-muted-primary" : ""
521
+ ),
522
+ style: {
523
+ borderRadius: appearance == null ? void 0 : appearance.borderRadius,
524
+ backgroundColor: (_a2 = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a2.buttonBackground
525
+ },
526
+ onClick: isLoading ? void 0 : createPopupAndSetupListeners
527
+ }, props), {
528
+ children: [
529
+ /* @__PURE__ */ jsxs4(Fragment2, { children: [
530
+ /* @__PURE__ */ jsx6(GoogleIcon, { className: "h-[25px] w-[25px] absolute left-[18px]" }),
531
+ isLoading ? /* @__PURE__ */ jsx6(
532
+ Spinner,
533
+ {
534
+ style: {
535
+ color: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.textSecondary,
536
+ fill: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textPrimary
537
+ }
538
+ }
539
+ ) : /* @__PURE__ */ jsx6(
540
+ "span",
541
+ {
542
+ className: "font-medium",
543
+ style: { margin: "0px 32px", color: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary },
544
+ children: "Sign in with Google"
545
+ }
546
+ )
547
+ ] }),
548
+ /* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Sign in with Google" })
549
+ ]
550
+ })
551
+ );
552
+ }
553
+
554
+ // src/components/auth/methods/farcaster/FarcasterSignIn.tsx
555
+ import { useEffect as useEffect3, useMemo, useState as useState6 } from "react";
556
+ import { useSignIn, QRCode } from "@farcaster/auth-kit";
557
+ import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
558
+ function FarcasterSignIn() {
559
+ var _a, _b;
560
+ const { step, appearance, setStep } = useAuthForm();
561
+ if (step === "initial") {
562
+ return /* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsxs5(
563
+ "button",
564
+ {
565
+ className: classNames(
566
+ "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center",
567
+ "transition-colors duration-200 ease-in-out",
568
+ "hover:bg-cm-hover focus:bg-cm-hover outline-none"
569
+ ),
570
+ style: {
571
+ borderRadius: appearance == null ? void 0 : appearance.borderRadius,
572
+ backgroundColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.buttonBackground
573
+ },
574
+ onClick: () => {
575
+ setStep("qrCode");
576
+ },
577
+ children: [
578
+ /* @__PURE__ */ jsx7(FarcasterIcon, { className: "h-[25px] w-[25px] absolute left-[18px]" }),
579
+ /* @__PURE__ */ jsx7(
580
+ "span",
581
+ {
582
+ className: "font-medium",
583
+ style: { margin: "0px 32px", color: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.textPrimary },
584
+ children: "Sign in with Farcaster"
585
+ }
586
+ ),
587
+ /* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Sign in with Farcaster" })
588
+ ]
589
+ }
590
+ ) });
591
+ }
592
+ if (step === "qrCode") {
593
+ return /* @__PURE__ */ jsx7(FarcasterQRCode, {});
594
+ }
595
+ return null;
596
+ }
597
+ function FarcasterQRCode() {
598
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
599
+ const { crossmintAuth } = useCrossmintAuth();
600
+ const { appearance, setStep, setDialogOpen } = useAuthForm();
601
+ const [farcasterData, setFarcasterData] = useState6(null);
602
+ const farcasterProps = useMemo(
603
+ () => ({
604
+ onSuccess: (data) => {
605
+ setFarcasterData(data);
606
+ }
607
+ }),
608
+ []
609
+ );
610
+ const { signIn, url: qrCodeUrl, connect, signOut, isConnected } = useSignIn(farcasterProps);
611
+ const handleFarcasterSignIn = (data) => __async(this, null, function* () {
612
+ try {
613
+ const oneTimeSecret = yield crossmintAuth == null ? void 0 : crossmintAuth.signInWithFarcaster(data);
614
+ yield crossmintAuth == null ? void 0 : crossmintAuth.handleRefreshAuthMaterial(oneTimeSecret);
615
+ setDialogOpen(false);
616
+ setStep("initial");
617
+ } catch (error) {
618
+ console.error("Error during Farcaster sign-in:", error);
619
+ }
620
+ });
621
+ useEffect3(() => {
622
+ if (farcasterData != null) {
623
+ handleFarcasterSignIn(farcasterData);
624
+ }
625
+ }, [farcasterData]);
626
+ useEffect3(() => {
627
+ if (isConnected) {
628
+ signIn();
629
+ }
630
+ }, [isConnected]);
631
+ useEffect3(() => {
632
+ connect();
633
+ }, []);
634
+ return /* @__PURE__ */ jsxs5("div", { children: [
635
+ /* @__PURE__ */ jsx7(
636
+ AuthFormBackButton,
637
+ {
638
+ onClick: () => {
639
+ signOut();
640
+ setStep("initial");
641
+ },
642
+ iconColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary,
643
+ ringColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.accent
644
+ }
645
+ ),
646
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center gap-4", children: [
647
+ /* @__PURE__ */ jsxs5("div", { className: "text-center", children: [
648
+ /* @__PURE__ */ jsx7(
649
+ "h3",
650
+ {
651
+ className: "text-lg font-semibold text-cm-text-primary mb-2",
652
+ style: { color: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textPrimary },
653
+ children: "Sign in with Farcaster"
654
+ }
655
+ ),
656
+ /* @__PURE__ */ jsx7(
657
+ "p",
658
+ {
659
+ className: "text-base font-normal text-cm-text-secondary",
660
+ style: { color: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textSecondary },
661
+ children: "Scan with your phone's camera to continue."
662
+ }
663
+ )
664
+ ] }),
665
+ /* @__PURE__ */ jsx7(
666
+ "div",
667
+ {
668
+ className: "bg-white aspect-square rounded-lg p-4",
669
+ style: {
670
+ backgroundColor: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.inputBackground,
671
+ borderRadius: appearance == null ? void 0 : appearance.borderRadius
672
+ },
673
+ children: qrCodeUrl != null ? /* @__PURE__ */ jsx7(QRCode, { uri: qrCodeUrl, size: 280 }) : /* @__PURE__ */ jsx7("div", { className: "min-h-[246px] flex items-center justify-center", children: /* @__PURE__ */ jsx7(
674
+ Spinner,
675
+ {
676
+ style: {
677
+ color: (_f = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _f.textSecondary,
678
+ fill: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.textPrimary
679
+ }
680
+ }
681
+ ) })
682
+ }
683
+ ),
684
+ qrCodeUrl ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
685
+ /* @__PURE__ */ jsx7(
686
+ "p",
687
+ {
688
+ className: "text-base text-center font-normal text-cm-text-secondary",
689
+ style: { color: (_h = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _h.textSecondary },
690
+ children: "Alternatively, click on this link to open Warpcast."
691
+ }
692
+ ),
693
+ /* @__PURE__ */ jsx7(
694
+ "a",
695
+ {
696
+ href: qrCodeUrl,
697
+ rel: "noopener noreferrer",
698
+ target: "_blank",
699
+ className: "text-base font-normal text-cm-link",
700
+ style: { color: (_i = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _i.textLink },
701
+ children: "Open Warpcast"
702
+ }
703
+ )
704
+ ] }) : null
705
+ ] })
706
+ ] });
707
+ }
708
+
709
+ // src/components/auth/methods/web3/Web3SignIn.tsx
710
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
711
+ function Web3SignIn() {
712
+ var _a, _b, _c, _d, _e;
713
+ const { step, appearance, setStep } = useAuthForm();
714
+ if (step !== "initial") {
715
+ return null;
716
+ }
717
+ return /* @__PURE__ */ jsxs6(
718
+ "button",
719
+ {
720
+ className: classNames(
721
+ "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center",
722
+ "transition-colors duration-200 ease-in-out",
723
+ "hover:bg-cm-hover focus:bg-cm-hover outline-none"
724
+ ),
725
+ style: {
726
+ borderRadius: appearance == null ? void 0 : appearance.borderRadius,
727
+ borderColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.border,
728
+ backgroundColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.buttonBackground
729
+ },
730
+ onClick: () => setStep("web3"),
731
+ children: [
732
+ /* @__PURE__ */ jsx8(
733
+ WalletIcon,
734
+ {
735
+ className: "h-[21px] w-[21px] absolute left-[20px]",
736
+ style: { color: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textPrimary }
737
+ }
738
+ ),
739
+ /* @__PURE__ */ jsx8("span", { className: "font-medium", style: { margin: "0px 32px", color: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary }, children: "Continue with a wallet" }),
740
+ /* @__PURE__ */ jsx8(
741
+ ChevronRightIcon,
742
+ {
743
+ className: "h-[21px] w-[21px] absolute right-[20px]",
744
+ style: { color: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.textSecondary }
745
+ }
746
+ ),
747
+ /* @__PURE__ */ jsx8("span", { className: "sr-only", children: "Continue with a wallet" })
748
+ ]
749
+ }
750
+ );
751
+ }
752
+
753
+ // src/components/auth/methods/web3/Web3AuthWrapper.tsx
754
+ import { useState as useState7, useEffect as useEffect4 } from "react";
755
+ import { useAccount, useChainId, useConnect, useSignMessage } from "wagmi";
756
+ import { jsx as jsx9 } from "react/jsx-runtime";
757
+ function Web3AuthWrapper({ providerType, flag, icon }) {
758
+ var _a, _b;
759
+ const { crossmintAuth } = useCrossmintAuth();
760
+ const { appearance } = useAuthForm();
761
+ const [isLoading, setIsLoading] = useState7(false);
762
+ const [error, setError] = useState7(null);
763
+ const chainId = useChainId();
764
+ const { address, status: accountStatus } = useAccount();
765
+ const { signMessageAsync, status: signMessageStatus } = useSignMessage();
766
+ const { connect, connectors } = useConnect({
767
+ mutation: {
768
+ onError: () => setIsLoading(false)
769
+ }
770
+ });
771
+ const isExtensionInstalled = (_b = (_a = window.ethereum) == null ? void 0 : _a[flag]) != null ? _b : false;
772
+ if (!isExtensionInstalled) {
773
+ providerType = "walletConnect";
774
+ }
775
+ const connector = connectors.find((c) => c.id === providerType);
776
+ useEffect4(() => {
777
+ if (address != null) {
778
+ handleSignIn();
779
+ }
780
+ }, [address]);
781
+ const handleSignIn = () => __async(this, null, function* () {
782
+ if (address == null) {
783
+ return;
784
+ }
785
+ setIsLoading(true);
786
+ try {
787
+ const res = yield crossmintAuth == null ? void 0 : crossmintAuth.signInWithSmartWallet(address);
788
+ const signature = yield signMessageAsync({ message: res.challenge });
789
+ const authResponse = yield crossmintAuth == null ? void 0 : crossmintAuth.authenticateSmartWallet(address, signature);
790
+ const oneTimeSecret = authResponse.oneTimeSecret;
791
+ yield crossmintAuth == null ? void 0 : crossmintAuth.handleRefreshAuthMaterial(oneTimeSecret);
792
+ } catch (error2) {
793
+ console.error(`Error connecting to ${providerType}:`, error2);
794
+ setError(`Error connecting to ${providerType}. Please try again or contact support.`);
795
+ } finally {
796
+ setIsLoading(false);
797
+ }
798
+ });
799
+ const isLoadingOrPending = isLoading || accountStatus === "connecting" || accountStatus === "reconnecting" || signMessageStatus === "pending";
800
+ return /* @__PURE__ */ jsx9(
801
+ Web3ConnectButton,
802
+ {
803
+ icon,
804
+ appearance,
805
+ headingText: signMessageStatus === "pending" ? "Sign to verify" : "Connect your wallet",
806
+ buttonText: error != null && !isLoadingOrPending ? "Retry" : isLoadingOrPending ? "Connecting" : "Connect",
807
+ isLoading: isLoadingOrPending,
808
+ onConnectClick: () => {
809
+ if (address != null) {
810
+ handleSignIn();
811
+ } else if (connector) {
812
+ connect({ connector, chainId });
813
+ }
814
+ }
815
+ }
816
+ );
817
+ }
818
+
819
+ // src/components/auth/methods/web3/Web3Connectors.tsx
820
+ import { useAccount as useAccount2, useDisconnect } from "wagmi";
821
+ import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
822
+ function Web3Connectors() {
823
+ var _a, _b, _c, _d, _e, _f, _g;
824
+ const { appearance, step, setStep } = useAuthForm();
825
+ const { isConnected } = useAccount2();
826
+ const { disconnect } = useDisconnect();
827
+ if (step === "web3") {
828
+ return /* @__PURE__ */ jsxs7(Fragment4, { children: [
829
+ /* @__PURE__ */ jsx10(
830
+ AuthFormBackButton,
831
+ {
832
+ onClick: () => setStep("initial"),
833
+ iconColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary,
834
+ ringColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.accent
835
+ }
836
+ ),
837
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center gap-2", children: [
838
+ /* @__PURE__ */ jsx10("div", { className: "text-center mb-6", children: /* @__PURE__ */ jsx10(
839
+ "h3",
840
+ {
841
+ className: "text-lg font-semibold text-cm-text-primary",
842
+ style: { color: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textPrimary },
843
+ children: "Connect wallet"
844
+ }
845
+ ) }),
846
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-[10px] w-full", children: [
847
+ /* @__PURE__ */ jsx10(
848
+ Web3ProviderButton,
849
+ {
850
+ title: "Metamask",
851
+ appearance,
852
+ img: metamaskIcon,
853
+ onClick: () => {
854
+ if (isConnected) {
855
+ disconnect();
856
+ }
857
+ setTimeout(() => {
858
+ setStep("web3/metamask");
859
+ }, 200);
860
+ }
861
+ }
862
+ ),
863
+ /* @__PURE__ */ jsx10(
864
+ Web3ProviderButton,
865
+ {
866
+ title: "WalletConnect",
867
+ appearance,
868
+ img: walletConnectIcon,
869
+ onClick: () => {
870
+ if (isConnected) {
871
+ disconnect();
872
+ }
873
+ setTimeout(() => {
874
+ setStep("web3/walletconnect");
875
+ }, 200);
876
+ }
877
+ }
878
+ )
879
+ ] })
880
+ ] })
881
+ ] });
882
+ }
883
+ if (step === "web3/metamask") {
884
+ return /* @__PURE__ */ jsxs7(Fragment4, { children: [
885
+ /* @__PURE__ */ jsx10(
886
+ AuthFormBackButton,
887
+ {
888
+ onClick: () => setStep("web3"),
889
+ iconColor: (_d = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _d.textPrimary,
890
+ ringColor: (_e = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _e.accent
891
+ }
892
+ ),
893
+ /* @__PURE__ */ jsx10(Web3AuthWrapper, { providerType: "metaMaskSDK", flag: "isMetaMask", icon: metamaskIcon })
894
+ ] });
895
+ }
896
+ if (step === "web3/walletconnect") {
897
+ return /* @__PURE__ */ jsxs7(Fragment4, { children: [
898
+ /* @__PURE__ */ jsx10(
899
+ AuthFormBackButton,
900
+ {
901
+ onClick: () => setStep("web3"),
902
+ iconColor: (_f = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _f.textPrimary,
903
+ ringColor: (_g = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _g.accent
904
+ }
905
+ ),
906
+ /* @__PURE__ */ jsx10(Web3AuthWrapper, { providerType: "walletConnect", icon: walletConnectIcon })
907
+ ] });
908
+ }
909
+ return null;
910
+ }
911
+
912
+ // src/components/auth/methods/web3/Web3AuthFlow.tsx
913
+ import { jsx as jsx11 } from "react/jsx-runtime";
914
+ function Web3AuthFlow() {
915
+ const { step } = useAuthForm();
916
+ if (step.startsWith("web3")) {
917
+ return /* @__PURE__ */ jsx11(Web3Connectors, {});
918
+ }
919
+ if (step === "initial") {
920
+ return /* @__PURE__ */ jsx11(Web3SignIn, {});
921
+ }
922
+ return null;
923
+ }
924
+
925
+ // src/components/auth/AuthForm.tsx
926
+ import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
927
+ function AuthForm({ className }) {
928
+ var _a, _b, _c, _d;
929
+ const { step, appearance, loginMethods, baseUrl } = useAuthForm();
930
+ return /* @__PURE__ */ jsxs8("div", { className: classNames("flex flex-col gap-[10px] antialiased animate-none", className), children: [
931
+ step === "initial" ? /* @__PURE__ */ jsxs8("div", { children: [
932
+ /* @__PURE__ */ jsx12(
933
+ "h1",
934
+ {
935
+ className: "text-2xl font-bold text-cm-text-primary",
936
+ style: { color: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary },
937
+ children: "Sign In"
938
+ }
939
+ ),
940
+ /* @__PURE__ */ jsx12(
941
+ "p",
942
+ {
943
+ className: "text-base font-normal mb-3 text-cm-text-secondary",
944
+ style: { color: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.textSecondary },
945
+ children: "Sign in using one of the options below"
946
+ }
947
+ )
948
+ ] }) : null,
949
+ loginMethods.includes("email") ? /* @__PURE__ */ jsxs8(Fragment5, { children: [
950
+ /* @__PURE__ */ jsx12(EmailAuthFlow, {}),
951
+ loginMethods.length > 1 ? /* @__PURE__ */ jsx12(Divider, { appearance, text: "OR" }) : null
952
+ ] }) : null,
953
+ loginMethods.includes("google") ? /* @__PURE__ */ jsx12(GoogleSignIn, {}) : null,
954
+ loginMethods.includes("farcaster") ? /* @__PURE__ */ jsx12(FarcasterProvider, { baseUrl, children: /* @__PURE__ */ jsx12(FarcasterSignIn, {}) }) : null,
955
+ loginMethods.includes("web3") ? /* @__PURE__ */ jsx12(Web3AuthFlow, {}) : null,
956
+ step === "initial" || step === "otp" ? /* @__PURE__ */ jsx12(
957
+ PoweredByCrossmint,
958
+ {
959
+ className: "mt-4 justify-center",
960
+ color: (_d = (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.textSecondary) != null ? _d : "#A4AFB2"
961
+ }
962
+ ) : null
963
+ ] });
964
+ }
965
+
966
+ // src/components/auth/AuthFormDialog.tsx
967
+ import { useEffect as useEffect5 } from "react";
968
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
969
+ function AuthFormDialog({ open }) {
970
+ var _a, _b, _c;
971
+ const { appearance, setDialogOpen } = useAuthForm();
972
+ useEffect5(() => {
973
+ document.body.style.overflow = open ? "hidden" : "";
974
+ }, [open]);
975
+ return /* @__PURE__ */ jsx13(Dialog, { modal: false, open, onOpenChange: setDialogOpen, children: /* @__PURE__ */ jsxs9(
976
+ DialogContent,
977
+ {
978
+ onInteractOutside: (e) => e.preventDefault(),
979
+ onOpenAutoFocus: (e) => e.preventDefault(),
980
+ closeButtonColor: (_a = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _a.textPrimary,
981
+ closeButtonRingColor: (_b = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _b.accent,
982
+ className: "cm-responsive-border-radius-auth-dialog",
983
+ style: {
984
+ borderRadius: appearance == null ? void 0 : appearance.borderRadius,
985
+ backgroundColor: (_c = appearance == null ? void 0 : appearance.colors) == null ? void 0 : _c.background
986
+ },
987
+ children: [
988
+ /* @__PURE__ */ jsx13(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx13(DialogTitle, { children: "Crossmint Auth" }) }),
989
+ /* @__PURE__ */ jsx13(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx13(DialogDescription, { children: "Sign in via Crossmint" }) }),
990
+ /* @__PURE__ */ jsx13(AuthForm, { className: "max-w-[448px]" })
991
+ ]
992
+ }
993
+ ) });
994
+ }
995
+
996
+ // src/providers/CrossmintAuthProvider.tsx
997
+ import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
998
+ var defaultContextValue = {
999
+ crossmintAuth: void 0,
1000
+ login: () => {
1001
+ },
1002
+ logout: () => {
1003
+ },
1004
+ jwt: void 0,
1005
+ user: void 0,
1006
+ status: "logged-out",
1007
+ getUser: () => {
1008
+ }
1009
+ };
1010
+ var AuthContext = createContext2(defaultContextValue);
1011
+ var defaultEmbeddedWallets = {
1012
+ defaultChain: "base-sepolia",
1013
+ createOnLogin: "off",
1014
+ type: "evm-smart-wallet"
1015
+ };
1016
+ function CrossmintAuthProvider({
1017
+ embeddedWallets = defaultEmbeddedWallets,
1018
+ children,
1019
+ appearance,
1020
+ loginMethods = ["email", "google"],
1021
+ refreshRoute,
1022
+ logoutRoute
1023
+ }) {
1024
+ const [user, setUser] = useState8(void 0);
1025
+ const { crossmint, setJwt } = useCrossmint("CrossmintAuthProvider must be used within CrossmintProvider");
1026
+ const crossmintAuthRef = useRef2(null);
1027
+ const crossmintAuth = useMemo2(() => {
1028
+ if (!crossmintAuthRef.current) {
1029
+ crossmintAuthRef.current = CrossmintAuth.from(crossmint, {
1030
+ callbacks: {
1031
+ onLogout: () => {
1032
+ setJwt(void 0);
1033
+ setUser(void 0);
1034
+ },
1035
+ onTokenRefresh: (authMaterial) => {
1036
+ setJwt(authMaterial.jwt);
1037
+ setUser(authMaterial.user);
1038
+ }
1039
+ },
1040
+ refreshRoute,
1041
+ logoutRoute
1042
+ });
1043
+ }
1044
+ return crossmintAuthRef.current;
1045
+ }, []);
1046
+ const crossmintBaseUrl = validateApiKeyAndGetCrossmintBaseUrl(crossmint.apiKey);
1047
+ const [dialogOpen, setDialogOpen] = useState8(false);
1048
+ useEffect6(() => {
1049
+ if (crossmint.jwt == null) {
1050
+ const jwt = getCookie(SESSION_PREFIX);
1051
+ setJwt(jwt);
1052
+ }
1053
+ }, []);
1054
+ useEffect6(() => {
1055
+ if (crossmint.jwt == null) {
1056
+ return;
1057
+ }
1058
+ setDialogOpen(false);
1059
+ }, [crossmint.jwt]);
1060
+ const login = () => {
1061
+ if (crossmint.jwt != null) {
1062
+ console.log("User already logged in");
1063
+ return;
1064
+ }
1065
+ setDialogOpen(true);
1066
+ };
1067
+ const logout = () => {
1068
+ crossmintAuth.logout();
1069
+ };
1070
+ const getAuthStatus = () => {
1071
+ if (crossmint.jwt != null) {
1072
+ return "logged-in";
1073
+ }
1074
+ if (dialogOpen) {
1075
+ return "in-progress";
1076
+ }
1077
+ return "logged-out";
1078
+ };
1079
+ const getUser = () => __async(this, null, function* () {
1080
+ if (crossmint.jwt == null) {
1081
+ console.log("User not logged in");
1082
+ return;
1083
+ }
1084
+ const user2 = yield crossmintAuth.getUser();
1085
+ setUser(user2);
1086
+ });
1087
+ return /* @__PURE__ */ jsx14(TwindProvider, { children: /* @__PURE__ */ jsx14(
1088
+ AuthContext.Provider,
1089
+ {
1090
+ value: {
1091
+ crossmintAuth,
1092
+ login,
1093
+ logout,
1094
+ jwt: crossmint.jwt,
1095
+ user,
1096
+ status: getAuthStatus(),
1097
+ getUser
1098
+ },
1099
+ children: /* @__PURE__ */ jsx14(
1100
+ CrossmintWalletProvider,
1101
+ {
1102
+ defaultChain: embeddedWallets.defaultChain,
1103
+ showPasskeyHelpers: embeddedWallets.showPasskeyHelpers,
1104
+ appearance,
1105
+ children: /* @__PURE__ */ jsxs10(
1106
+ AuthFormProvider,
1107
+ {
1108
+ initialState: {
1109
+ appearance,
1110
+ setDialogOpen,
1111
+ loginMethods,
1112
+ embeddedWallets,
1113
+ baseUrl: crossmintBaseUrl
1114
+ },
1115
+ children: [
1116
+ /* @__PURE__ */ jsx14(WalletManager, { embeddedWallets, accessToken: crossmint.jwt, children }),
1117
+ /* @__PURE__ */ jsx14(AuthFormDialog, { open: dialogOpen })
1118
+ ]
1119
+ }
1120
+ )
1121
+ }
1122
+ )
1123
+ }
1124
+ ) });
1125
+ }
1126
+ function WalletManager({
1127
+ embeddedWallets,
1128
+ children,
1129
+ accessToken
1130
+ }) {
1131
+ const { getOrCreateWallet, clearWallet, status } = useWallet();
1132
+ useEffect6(() => {
1133
+ if (embeddedWallets.createOnLogin === "all-users" && status === "not-loaded" && accessToken != null) {
1134
+ getOrCreateWallet({
1135
+ type: embeddedWallets.type,
1136
+ signer: { type: "PASSKEY" }
1137
+ });
1138
+ }
1139
+ if (status === "loaded" && accessToken == null) {
1140
+ clearWallet();
1141
+ }
1142
+ }, [accessToken, status]);
1143
+ return /* @__PURE__ */ jsx14(Fragment6, { children });
1144
+ }
1145
+
1146
+ // src/hooks/useAuth.ts
1147
+ function useAuth() {
1148
+ const context = useContext4(AuthContext);
1149
+ if (context === void 0) {
1150
+ throw new Error("useAuth must be used within an AuthProvider");
1151
+ }
1152
+ return context;
1153
+ }
1154
+
1155
+ // src/providers/CrossmintWalletProvider.tsx
1156
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1157
+ var WalletContext = createContext3({
1158
+ status: "not-loaded",
1159
+ getOrCreateWallet: () => Promise.resolve({ startedCreation: false }),
1160
+ clearWallet: () => {
1161
+ }
1162
+ });
1163
+ function CrossmintWalletProvider({
1164
+ children,
1165
+ defaultChain,
1166
+ showPasskeyHelpers = true,
1167
+ // enabled by default
1168
+ appearance
1169
+ }) {
1170
+ const { crossmint } = useCrossmint("CrossmintWalletProvider must be used within CrossmintProvider");
1171
+ const smartWalletSDK = useMemo3(() => SmartWalletSDK.init({ clientApiKey: crossmint.apiKey }), [crossmint.apiKey]);
1172
+ const [walletState, setWalletState] = useState9({ status: "not-loaded" });
1173
+ const [passkeyPromptState, setPasskeyPromptState] = useState9({ open: false });
1174
+ const getOrCreateWallet = (..._0) => __async(this, [..._0], function* (config = { type: "evm-smart-wallet", signer: { type: "PASSKEY" } }) {
1175
+ if (walletState.status == "in-progress") {
1176
+ console.log("Wallet already loading");
1177
+ return { startedCreation: false, reason: "Wallet is already loading." };
1178
+ }
1179
+ if (crossmint.jwt == null) {
1180
+ return { startedCreation: false, reason: `Jwt not set in "CrossmintProvider".` };
1181
+ }
1182
+ try {
1183
+ setWalletState({ status: "in-progress" });
1184
+ const wallet = yield smartWalletSDK.getOrCreateWallet(
1185
+ { jwt: crossmint.jwt },
1186
+ defaultChain,
1187
+ enhanceConfigWithPasskeyPrompts(config)
1188
+ );
1189
+ setWalletState({ status: "loaded", wallet });
1190
+ } catch (error) {
1191
+ console.error("There was an error creating a wallet ", error);
1192
+ setWalletState(deriveErrorState(error));
1193
+ }
1194
+ return { startedCreation: true };
1195
+ });
1196
+ const enhanceConfigWithPasskeyPrompts = (config) => {
1197
+ if (showPasskeyHelpers && config.signer.type === "PASSKEY") {
1198
+ return __spreadProps(__spreadValues({}, config), {
1199
+ signer: __spreadProps(__spreadValues({}, config.signer), {
1200
+ onPrePasskeyRegistration: createPasskeyPrompt("create-wallet"),
1201
+ onPasskeyRegistrationError: createPasskeyPrompt("create-wallet-error"),
1202
+ onFirstTimePasskeySigning: createPasskeyPrompt("transaction"),
1203
+ onFirstTimePasskeySigningError: createPasskeyPrompt("transaction-error")
1204
+ })
1205
+ });
1206
+ }
1207
+ return config;
1208
+ };
1209
+ const createPasskeyPrompt = (type) => () => new Promise((resolve) => {
1210
+ setPasskeyPromptState({
1211
+ type,
1212
+ open: true,
1213
+ primaryActionOnClick: () => {
1214
+ setPasskeyPromptState({ open: false });
1215
+ resolve();
1216
+ },
1217
+ secondaryActionOnClick: () => {
1218
+ setPasskeyPromptState({ open: false });
1219
+ resolve();
1220
+ }
1221
+ });
1222
+ });
1223
+ const clearWallet = () => {
1224
+ setWalletState({ status: "not-loaded" });
1225
+ };
1226
+ return /* @__PURE__ */ jsxs11(WalletContext.Provider, { value: __spreadProps(__spreadValues({}, walletState), { getOrCreateWallet, clearWallet }), children: [
1227
+ children,
1228
+ passkeyPromptState.open ? createPortal(/* @__PURE__ */ jsx15(PasskeyPrompt, { state: passkeyPromptState, appearance }), document.body) : null
1229
+ ] });
1230
+ }
1231
+ function deriveErrorState(error) {
1232
+ if (error instanceof SmartWalletError) {
1233
+ return { status: "loading-error", error };
1234
+ }
1235
+ const message = error instanceof Error ? error.message : String(error);
1236
+ const stack = error instanceof Error ? error.stack : void 0;
1237
+ return { status: "loading-error", error: new SmartWalletError(`Unknown Wallet Error: ${message}`, stack) };
1238
+ }
1239
+
1240
+ export {
1241
+ WalletContext,
1242
+ CrossmintWalletProvider,
1243
+ useWallet,
1244
+ useCrossmintAuth,
1245
+ useAuthForm,
1246
+ AuthFormProvider,
1247
+ EMAIL_VERIFICATION_TOKEN_LENGTH,
1248
+ EmailOTPInput,
1249
+ EmailSignIn,
1250
+ EmailAuthFlow,
1251
+ Divider,
1252
+ useOAuthWindowListener,
1253
+ GoogleSignIn,
1254
+ FarcasterSignIn,
1255
+ Web3SignIn,
1256
+ Web3AuthWrapper,
1257
+ Web3Connectors,
1258
+ Web3AuthFlow,
1259
+ AuthForm,
1260
+ AuthFormDialog,
1261
+ AuthContext,
1262
+ CrossmintAuthProvider,
1263
+ useAuth
1264
+ };
1265
+ //# sourceMappingURL=chunk-CUODMU27.js.map