@crossmint/client-sdk-react-native-ui 1.0.0-beta.5 → 1.0.0-beta.6

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 (153) hide show
  1. package/README.md +0 -1
  2. package/dist/{chunk-QVLCNPNG.mjs → chunk-2TZTJDZU.mjs} +1 -1
  3. package/dist/chunk-2U67EBAU.js +1 -0
  4. package/dist/{chunk-VACQTZRT.js → chunk-2UY6GCV3.js} +1 -1
  5. package/dist/chunk-42DYL4PZ.js +2 -0
  6. package/dist/{chunk-4PMKF2DM.mjs → chunk-42PSUTXE.mjs} +1 -1
  7. package/dist/{chunk-6BGT7YJW.js → chunk-4EKVY6NS.js} +1 -1
  8. package/dist/chunk-4P5ABAFD.mjs +1 -0
  9. package/dist/{chunk-RFFLL7AO.js → chunk-66JRBDJO.js} +1 -1
  10. package/dist/chunk-7JGGPJBX.mjs +1 -0
  11. package/dist/{chunk-RO3XNRC3.mjs → chunk-7LYLPKBG.mjs} +1 -1
  12. package/dist/{chunk-ZCKUSOGC.mjs → chunk-AHAHB7QD.mjs} +1 -1
  13. package/dist/chunk-C7S2X5RD.mjs +1 -0
  14. package/dist/chunk-E5RFE3I6.mjs +2 -0
  15. package/dist/chunk-G4YSWRHL.js +2 -0
  16. package/dist/{chunk-HQFWYQ4L.js → chunk-GU2453HG.js} +1 -1
  17. package/dist/{chunk-X64DPUQJ.js → chunk-IEPHFQWO.js} +1 -1
  18. package/dist/chunk-IJN37RF2.js +1 -0
  19. package/dist/chunk-J62V5BQX.mjs +1 -0
  20. package/dist/{chunk-LLHUAEZP.mjs → chunk-J7VLYBIW.mjs} +1 -1
  21. package/dist/{chunk-F5O5W34O.mjs → chunk-K6ZOIECD.mjs} +1 -1
  22. package/dist/chunk-KVMXUD7B.js +1 -0
  23. package/dist/chunk-LHEOII54.js +1 -0
  24. package/dist/chunk-LPJ4PJPR.mjs +1 -0
  25. package/dist/chunk-MZFVU7OV.js +1 -0
  26. package/dist/{chunk-D5QADN6Z.mjs → chunk-NG4FYS2Z.mjs} +1 -1
  27. package/dist/{chunk-3MXWZO3W.mjs → chunk-NNGGH73Y.mjs} +1 -1
  28. package/dist/{chunk-YVITECJT.js → chunk-NQTZET7B.js} +1 -1
  29. package/dist/{chunk-F7VXWATP.js → chunk-NVBPI6JQ.js} +1 -1
  30. package/dist/{chunk-4HT7GY6N.js → chunk-QHJA7VYD.js} +1 -1
  31. package/dist/chunk-QHTHMZZV.mjs +1 -0
  32. package/dist/chunk-QZWDIIDT.mjs +1 -0
  33. package/dist/chunk-R4AKS6SV.js +1 -0
  34. package/dist/chunk-RIKAIN6N.js +1 -0
  35. package/dist/chunk-RWTMQGU7.js +1 -0
  36. package/dist/chunk-S6RE3WT5.mjs +2 -0
  37. package/dist/chunk-TQIJ7OZD.js +1 -0
  38. package/dist/chunk-TSRZEXRU.mjs +1 -0
  39. package/dist/chunk-TVASK7FQ.js +1 -0
  40. package/dist/{chunk-SHTETN4C.js → chunk-U3CLRKGH.js} +1 -1
  41. package/dist/{chunk-YLJDAK2S.mjs → chunk-WDMEQNBX.mjs} +1 -1
  42. package/dist/chunk-WFE62YZ6.mjs +1 -0
  43. package/dist/{chunk-DC5HCBPK.js → chunk-WH3PVAVN.js} +1 -1
  44. package/dist/chunk-XZ5LQIRB.mjs +1 -0
  45. package/dist/chunk-YJIX6E2P.mjs +0 -0
  46. package/dist/{chunk-OGYBEE5A.js → chunk-Z36IMAC2.js} +1 -1
  47. package/dist/{chunk-FX23A4BR.mjs → chunk-ZP2QWJOD.mjs} +1 -1
  48. package/dist/components/embed/index.js +1 -1
  49. package/dist/components/embed/index.mjs +1 -1
  50. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
  51. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.mjs +1 -1
  52. package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.js +1 -1
  53. package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.mjs +1 -1
  54. package/dist/components/embed/v3/crypto/PayerConnectionHandler.js +1 -1
  55. package/dist/components/embed/v3/crypto/PayerConnectionHandler.mjs +1 -1
  56. package/dist/components/embed/v3/index.js +1 -1
  57. package/dist/components/embed/v3/index.mjs +1 -1
  58. package/dist/components/icons/MailCheckIcon.d.mts +6 -0
  59. package/dist/components/icons/MailCheckIcon.d.ts +6 -0
  60. package/dist/components/icons/MailCheckIcon.js +1 -0
  61. package/dist/components/icons/MailCheckIcon.mjs +1 -0
  62. package/dist/components/icons/MailIcon.d.mts +6 -0
  63. package/dist/components/icons/MailIcon.d.ts +6 -0
  64. package/dist/components/icons/MailIcon.js +1 -0
  65. package/dist/components/icons/MailIcon.mjs +1 -0
  66. package/dist/components/icons/PhoneIcon.d.mts +6 -0
  67. package/dist/components/icons/PhoneIcon.d.ts +6 -0
  68. package/dist/components/icons/PhoneIcon.js +1 -0
  69. package/dist/components/icons/PhoneIcon.mjs +1 -0
  70. package/dist/components/icons/PngIcon.d.mts +10 -0
  71. package/dist/components/icons/PngIcon.d.ts +10 -0
  72. package/dist/components/icons/PngIcon.js +1 -0
  73. package/dist/components/icons/PngIcon.mjs +1 -0
  74. package/dist/components/icons/SmartphoneIcon.d.mts +6 -0
  75. package/dist/components/icons/SmartphoneIcon.d.ts +6 -0
  76. package/dist/components/icons/SmartphoneIcon.js +1 -0
  77. package/dist/components/icons/SmartphoneIcon.mjs +1 -0
  78. package/dist/components/icons/XIcon.d.mts +6 -0
  79. package/dist/components/icons/XIcon.d.ts +6 -0
  80. package/dist/components/icons/XIcon.js +1 -0
  81. package/dist/components/icons/XIcon.mjs +1 -0
  82. package/dist/components/icons/index.d.mts +7 -0
  83. package/dist/components/icons/index.d.ts +7 -0
  84. package/dist/components/icons/index.js +1 -0
  85. package/dist/components/icons/index.mjs +1 -0
  86. package/dist/components/icons/types.d.mts +7 -0
  87. package/dist/components/icons/types.d.ts +7 -0
  88. package/dist/components/icons/types.js +1 -0
  89. package/dist/components/icons/types.mjs +0 -0
  90. package/dist/components/index.js +1 -1
  91. package/dist/components/index.mjs +1 -1
  92. package/dist/components/signers/BaseCodeInput.js +1 -1
  93. package/dist/components/signers/BaseCodeInput.mjs +1 -1
  94. package/dist/components/signers/BaseConfirmation.js +1 -1
  95. package/dist/components/signers/BaseConfirmation.mjs +1 -1
  96. package/dist/components/signers/EmailSignersDialog.js +1 -1
  97. package/dist/components/signers/EmailSignersDialog.mjs +1 -1
  98. package/dist/components/signers/PhoneSignersDialog.js +1 -1
  99. package/dist/components/signers/PhoneSignersDialog.mjs +1 -1
  100. package/dist/components/signers/index.js +1 -1
  101. package/dist/components/signers/index.mjs +1 -1
  102. package/dist/components/wallets/ExportPrivateKeyButton.js +1 -1
  103. package/dist/components/wallets/ExportPrivateKeyButton.mjs +1 -1
  104. package/dist/components/wallets/index.js +1 -1
  105. package/dist/components/wallets/index.mjs +1 -1
  106. package/dist/hooks/index.js +1 -1
  107. package/dist/hooks/index.mjs +1 -1
  108. package/dist/hooks/useAuth.js +1 -1
  109. package/dist/hooks/useAuth.mjs +1 -1
  110. package/dist/hooks/useCrossmintCheckout.js +1 -1
  111. package/dist/hooks/useCrossmintCheckout.mjs +1 -1
  112. package/dist/index.js +1 -1
  113. package/dist/index.mjs +1 -1
  114. package/dist/logger/init.js +1 -1
  115. package/dist/logger/init.mjs +1 -1
  116. package/dist/plugin/mods/addQueryToAndroidManifest.js +1 -1
  117. package/dist/plugin/mods/addQueryToAndroidManifest.mjs +1 -1
  118. package/dist/plugin/withGooglePay.js +1 -1
  119. package/dist/plugin/withGooglePay.mjs +1 -1
  120. package/dist/providers/CrossmintAuthProvider.js +1 -1
  121. package/dist/providers/CrossmintAuthProvider.mjs +1 -1
  122. package/dist/providers/CrossmintProvider.js +1 -1
  123. package/dist/providers/CrossmintProvider.mjs +1 -1
  124. package/dist/providers/CrossmintWalletProvider.d.mts +2 -2
  125. package/dist/providers/CrossmintWalletProvider.d.ts +2 -2
  126. package/dist/providers/CrossmintWalletProvider.js +1 -1
  127. package/dist/providers/CrossmintWalletProvider.mjs +1 -1
  128. package/dist/providers/index.js +1 -1
  129. package/dist/providers/index.mjs +1 -1
  130. package/dist/styles/index.js +1 -1
  131. package/dist/styles/index.mjs +1 -1
  132. package/dist/styles/theme.js +1 -1
  133. package/dist/styles/theme.mjs +1 -1
  134. package/dist/utils/SecureStorage.js +1 -1
  135. package/dist/utils/SecureStorage.mjs +1 -1
  136. package/dist/utils/createCrossmintApiClient.js +1 -1
  137. package/dist/utils/createCrossmintApiClient.mjs +1 -1
  138. package/dist/utils/embed/userAgent.js +1 -1
  139. package/dist/utils/embed/userAgent.mjs +1 -1
  140. package/dist/utils/eventEmitter.js +1 -1
  141. package/dist/utils/eventEmitter.mjs +1 -1
  142. package/package.json +5 -7
  143. package/dist/chunk-3QSVHCEH.mjs +0 -2
  144. package/dist/chunk-4XMG3KIU.mjs +0 -1
  145. package/dist/chunk-F4GXM2ZD.js +0 -1
  146. package/dist/chunk-J42HASCI.js +0 -1
  147. package/dist/chunk-MVVSGLQL.js +0 -2
  148. package/dist/chunk-PSSAAY7D.mjs +0 -1
  149. package/dist/chunk-VGA23PJK.mjs +0 -1
  150. package/dist/chunk-XNDIT72O.mjs +0 -2
  151. package/dist/chunk-XSBVXPEK.mjs +0 -1
  152. package/dist/chunk-YJORUMPB.js +0 -2
  153. package/dist/chunk-ZM4HMYQX.js +0 -1
package/README.md CHANGED
@@ -29,7 +29,6 @@ export default function App() {
29
29
  chain: "solana",
30
30
  signer: { type: "email" }
31
31
  }}
32
- headlessSigningFlow={false}
33
32
  >
34
33
  <MainApp />
35
34
  </CrossmintWalletProvider>
@@ -1 +1 @@
1
- import{a as n}from"./chunk-VGA23PJK.mjs";import{CrossmintApiClient as e}from"@crossmint/common-sdk-base";function C(i,t){return new e(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:n.version},apiKeyExpectations:t}})}export{C as a};
1
+ import{a as n}from"./chunk-LPJ4PJPR.mjs";import{CrossmintApiClient as e}from"@crossmint/common-sdk-base";function C(i,t){return new e(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:n.version},apiKeyExpectations:t}})}export{C as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVASK7FQjs = require('./chunk-TVASK7FQ.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var r=_chunkIJN37RF2js.e.call(void 0, (P,I)=>{I.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABZ0lEQVR4AbTUC1LDMAwE0MDFgJMBJwNOBn4ZLyNcUuzSdroj67crxWnvtxt/qsBj03pr+CzgvzT/4m8EkCAjUsn4zy3ANrP+jcBDb31t9q6A39yNCLuMCGRCm1SS+MnX3NQ5Au+9+mKi3n9iInCSuFYgAh+dcNxg9HvZvIlAHlEuOwzeLOdctvMSIpCmOnEuGHnOqZu2EbABaIxI/HErNdOIgAaTsnnnCQDBf2+AGBkgBLEqmpj4NOoGmvI2uVyEBCMitrzJKIAghHlUY4xvGHAmfPgHOQqkyeQ2QJBYFUYKhlCnJuB/x38TUFjJqshTS0YcUXM3scM/yCMBJFXEtMjEEcqBs5hckIH2AY4EFCsMgWLPWSw555Fc7gfOCShEQMS0fM+2ComdxV8CaTZtRMSqkJwNQY7PGm6bFdCg0WUSAjFC4I7Adny5/Te1IqAJCEEVMy3Isx6rmqUNNI9AAgiBKEtkr/0CAAD//0s8Y9YAAAAGSURBVAMAIbpVMfA3cdgAAAAASUVORK5CYII="});var _jsxruntime = require('react/jsx-runtime');function s({size:p=22,color:c,strokeWidth:n=2}){return _jsxruntime.jsx.call(void 0, _chunkTVASK7FQjs.a,{source:r(),size:p,color:c})}exports.a = s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _react = require('react');function m({payer:r,webViewClient:e}){return _react.useEffect.call(void 0, ()=>{if(e==null)return;let t=e.on("crypto:send-transaction",f=>_chunkJ42HASCIjs.e.call(void 0, this,[f],function*({chain:s,serializedTransaction:c}){try{yield r.handleChainSwitch(s);let n=yield r.handleSignAndSendTransaction(c);n.success?e.send("crypto:send-transaction:success",{txId:n.txId}):e.send("crypto:send-transaction:failed",{error:n.errorMessage})}catch(n){console.error("[PayerConnectionHandler] Failed to send transaction",n),e.send("crypto:send-transaction:failed",{error:n.message||"An unknown error occurred"})}}));return()=>{e.off(t)}},[e]),null}exports.a = m;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _react = require('react');function m({payer:r,webViewClient:e}){return _react.useEffect.call(void 0, ()=>{if(e==null)return;let t=e.on("crypto:send-transaction",f=>_chunkIJN37RF2js.f.call(void 0, this,[f],function*({chain:s,serializedTransaction:c}){try{yield r.handleChainSwitch(s);let n=yield r.handleSignAndSendTransaction(c);n.success?e.send("crypto:send-transaction:success",{txId:n.txId}):e.send("crypto:send-transaction:failed",{error:n.errorMessage})}catch(n){console.error("[PayerConnectionHandler] Failed to send transaction",n),e.send("crypto:send-transaction:failed",{error:n.message||"An unknown error occurred"})}}));return()=>{e.off(t)}},[e]),null}exports.a = m;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNVBPI6JQjs = require('./chunk-NVBPI6JQ.js');var _chunkWH3PVAVNjs = require('./chunk-WH3PVAVN.js');var _chunk2U67EBAUjs = require('./chunk-2U67EBAU.js');var _chunkLHEOII54js = require('./chunk-LHEOII54.js');var _chunkR4AKS6SVjs = require('./chunk-R4AKS6SV.js');var _chunkEI5LOD4Yjs = require('./chunk-EI5LOD4Y.js');var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');var{width:V}=_reactnative.Dimensions.get("window");function H({phone:i,open:n,setOpen:v,step:O,onSubmitOTP:x,onResendOTPCode:I,onSubmitPhone:M,rejectRef:r,appearance:o}){var m,u,c,g,y,b;function s(){var h;n&&((h=r.current)==null||h.call(r,new Error("User cancelled")),v(!1))}let l=_reactnative.StyleSheet.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalContainer:{backgroundColor:((m=o==null?void 0:o.colors)==null?void 0:m.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"],borderRadius:(o==null?void 0:o.borderRadius)||12,padding:32,width:Math.min(V-32,400),maxHeight:"80%",position:"relative",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeButton:{position:"absolute",top:16,right:16,width:32,height:32,borderRadius:6,backgroundColor:((u=o==null?void 0:o.colors)==null?void 0:u.inputBackground)||_chunkEI5LOD4Yjs.a["cm-muted-primary"],alignItems:"center",justifyContent:"center",zIndex:1}});return n?_jsxruntime.jsx.call(void 0, _reactnative.Modal,{visible:n,transparent:!0,animationType:"fade",onRequestClose:s,statusBarTranslucent:!0,children:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:l.modalOverlay,children:_jsxruntime.jsxs.call(void 0, _reactnative.View,{style:l.modalContainer,children:[_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:l.closeButton,onPress:s,hitSlop:{top:10,bottom:10,left:10,right:10},children:_jsxruntime.jsx.call(void 0, _chunkR4AKS6SVjs.a,{size:16,color:((c=o==null?void 0:o.colors)==null?void 0:c.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"]})}),O==="initial"?_jsxruntime.jsx.call(void 0, _chunkWH3PVAVNjs.a,{contactInfo:i!=null?i:"",contactType:"phone",icon:_jsxruntime.jsx.call(void 0, _chunk2U67EBAUjs.a,{size:22,color:((g=o==null?void 0:o.colors)==null?void 0:g.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"]}),onConfirm:M,onCancel:s,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkNVBPI6JQjs.a,{contactInfo:i!=null?i:"",contactType:"phone",icon:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{backgroundColor:((y=o==null?void 0:o.colors)==null?void 0:y.accent)||_chunkEI5LOD4Yjs.a["cm-accent"],borderRadius:999,padding:12},children:_jsxruntime.jsx.call(void 0, _chunkLHEOII54js.a,{size:22,color:((b=o==null?void 0:o.colors)==null?void 0:b.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]})}),title:"Check your phone",description:_jsxruntime.jsxs.call(void 0, _reactnative.Text,{children:["A temporary login code has been sent via SMS to"," ",_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:{fontWeight:"bold"},children:i})]}),helpText:`Can't receive the SMS? Check your phone number.
2
+ Some messages may take several minutes to arrive.`,onSubmitOTP:x,onResendCode:I,appearance:o,otpLength:10,keyboardType:"number-pad",autoComplete:"sms-otp",textContentType:"oneTimeCode"})]})})}):null}exports.a = H;
@@ -1 +1 @@
1
- import{c as h}from"./chunk-PCJMDUSI.mjs";import{a as y}from"./chunk-FX23A4BR.mjs";import{a as f}from"./chunk-QVLCNPNG.mjs";import{a as p}from"./chunk-FFQ6EQCL.mjs";import{a as d,b as m}from"./chunk-PSSAAY7D.mjs";import{useCrossmint as S}from"@crossmint/client-sdk-react-base";import{useEffect as b,useRef as l,useState as g}from"react";import{View as W}from"react-native";import{crossmintEmbeddedCheckoutV3Service as I}from"@crossmint/client-sdk-base";import{RNWebView as A,WebViewParent as M}from"@crossmint/client-sdk-rn-window";import{embeddedCheckoutV3IncomingEvents as R,embeddedCheckoutV3OutgoingEvents as O}from"@crossmint/client-sdk-base";import{jsx as c,jsxs as L}from"react/jsx-runtime";function Y(t){var u;let[e,w]=g(null),[C,v]=g(0),E=l((u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=l(t);if(U(t,n.current)){let r=d({},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=S(),V=f(i,{usageOrigin:"client"}),P=I({apiClient:V}),s=l(null);b(()=>{let r=s.current;if(!r||e)return;let o=new M({current:r},{incomingEvents:R,outgoingEvents:O});w(o)},[s.current,e]),b(()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{p.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return L(W,{style:{flex:1},children:[c(A,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:h,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?c(y,{payer:n.current.payment.crypto.payer,webViewClient:e}):c(H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:m(d({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}export{Y as a};
1
+ import{c as h}from"./chunk-PCJMDUSI.mjs";import{a as y}from"./chunk-ZP2QWJOD.mjs";import{a as f}from"./chunk-2TZTJDZU.mjs";import{a as p}from"./chunk-FFQ6EQCL.mjs";import{a as d,b as m}from"./chunk-4P5ABAFD.mjs";import{useCrossmint as S}from"@crossmint/client-sdk-react-base";import{useEffect as b,useRef as l,useState as g}from"react";import{View as W}from"react-native";import{crossmintEmbeddedCheckoutV3Service as I}from"@crossmint/client-sdk-base";import{RNWebView as A,WebViewParent as M}from"@crossmint/client-sdk-rn-window";import{embeddedCheckoutV3IncomingEvents as R,embeddedCheckoutV3OutgoingEvents as O}from"@crossmint/client-sdk-base";import{jsx as c,jsxs as L}from"react/jsx-runtime";function Y(t){var u;let[e,w]=g(null),[C,v]=g(0),E=l((u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=l(t);if(U(t,n.current)){let r=d({},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=S(),V=f(i,{usageOrigin:"client"}),P=I({apiClient:V}),s=l(null);b(()=>{let r=s.current;if(!r||e)return;let o=new M({current:r},{incomingEvents:R,outgoingEvents:O});w(o)},[s.current,e]),b(()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{p.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return L(W,{style:{flex:1},children:[c(A,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:h,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?c(y,{payer:n.current.payment.crypto.payer,webViewClient:e}):c(H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:m(d({},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}export{Y as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkHQFWYQ4Ljs = require('./chunk-HQFWYQ4L.js');var _react = require('react');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');var l=_clientsdkreactbase.createLoggerContext.call(void 0, );function I({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=_react.useMemo.call(void 0, ()=>_chunkHQFWYQ4Ljs.a.call(void 0, o,r),[o,r]),c=(n=(t=(e=_expoconstants2.default.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=_expoconstants2.default.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return _jsxruntime.jsx.call(void 0, l.Provider,{value:g,children:_jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintProvider,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}exports.a = l; exports.b = I;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkGU2453HGjs = require('./chunk-GU2453HG.js');var _react = require('react');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');var l=_clientsdkreactbase.createLoggerContext.call(void 0, );function I({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=_react.useMemo.call(void 0, ()=>_chunkGU2453HGjs.a.call(void 0, o,r),[o,r]),c=(n=(t=(e=_expoconstants2.default.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=_expoconstants2.default.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return _jsxruntime.jsx.call(void 0, l.Provider,{value:g,children:_jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintProvider,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}exports.a = l; exports.b = I;
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty,p=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;var j=(a,b,c)=>b in a?o(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c,r=(a,b)=>{for(var c in b||(b={}))k.call(b,c)&&j(a,c,b[c]);if(f)for(var c of f(b))l.call(b,c)&&j(a,c,b[c]);return a},s=(a,b)=>p(a,q(b));var t=(a=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(a,{get:(b,c)=>(typeof require!="undefined"?require:b)[c]}):a)(function(a){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var u=(a,b)=>{var c={};for(var d in a)k.call(a,d)&&b.indexOf(d)<0&&(c[d]=a[d]);if(a!=null&&f)for(var d of f(a))b.indexOf(d)<0&&l.call(a,d)&&(c[d]=a[d]);return c};var v=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var w=(a,b,c)=>new Promise((d,i)=>{var m=e=>{try{g(c.next(e))}catch(h){i(h)}},n=e=>{try{g(c.throw(e))}catch(h){i(h)}},g=e=>e.done?d(e.value):Promise.resolve(e.value).then(m,n);g((c=c.apply(a,b)).next())});export{r as a,s as b,t as c,u as d,v as e,w as f};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYVITECJTjs = require('./chunk-YVITECJT.js');var _commonsdkbase = require('@crossmint/common-sdk-base');function a(i,t){return new (0, _commonsdkbase.CrossmintApiClient)(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:_chunkYVITECJTjs.a.version},apiKeyExpectations:t}})}exports.a = a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNQTZET7Bjs = require('./chunk-NQTZET7B.js');var _commonsdkbase = require('@crossmint/common-sdk-base');function a(i,t){return new (0, _commonsdkbase.CrossmintApiClient)(i,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-native-ui",version:_chunkNQTZET7Bjs.a.version},apiKeyExpectations:t}})}exports.a = a;
@@ -0,0 +1 @@
1
+ import{Image as n}from"react-native";import{jsx as t}from"react/jsx-runtime";function g({source:o,size:e=22,color:r}){return t(n,{source:typeof o=="string"?{uri:o}:o,resizeMode:"contain",style:{width:e,height:e,tintColor:r}})}export{g as a};
@@ -1 +1 @@
1
- import{a as m}from"./chunk-LLHUAEZP.mjs";import{useMemo as v}from"react";import d from"expo-constants";import{CrossmintProvider as f,createLoggerContext as P}from"@crossmint/client-sdk-react-base";import{jsx as p}from"react/jsx-runtime";var l=P();function N({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=v(()=>m(o,r),[o,r]),c=(n=(t=(e=d.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=d.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return p(l.Provider,{value:g,children:p(f,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}export{l as a,N as b};
1
+ import{a as m}from"./chunk-J7VLYBIW.mjs";import{useMemo as v}from"react";import d from"expo-constants";import{CrossmintProvider as f,createLoggerContext as P}from"@crossmint/client-sdk-react-base";import{jsx as p}from"react/jsx-runtime";var l=P();function N({children:a,apiKey:o,overrideBaseUrl:C,consoleLogLevel:r}){var e,t,i,s,n;let g=v(()=>m(o,r),[o,r]),c=(n=(t=(e=d.expoConfig)==null?void 0:e.ios)==null?void 0:t.bundleIdentifier)!=null?n:(s=(i=d.expoConfig)==null?void 0:i.android)==null?void 0:s.package;return p(l.Provider,{value:g,children:p(f,{apiKey:o,appId:c,overrideBaseUrl:C,children:a})})}export{l as a,N as b};
@@ -1 +1 @@
1
- import{e as n}from"./chunk-PSSAAY7D.mjs";import*as e from"expo-secure-store";var i=class{get(t){return n(this,null,function*(){try{let r=yield e.getItemAsync(t);if(!r)return;try{let o=JSON.parse(r);if(o.expiresAt&&new Date(o.expiresAt)<new Date){yield this.remove(t);return}return o.value}catch(o){return r}}catch(r){console.error("Error reading from SecureStore:",r);return}})}set(t,r,o){return n(this,null,function*(){try{if(o){let s=JSON.stringify({value:r,expiresAt:o});yield e.setItemAsync(t,s)}else yield e.setItemAsync(t,r)}catch(s){console.error("Error writing to SecureStore:",s)}})}remove(t){return n(this,null,function*(){try{yield e.deleteItemAsync(t)}catch(r){console.error("Error removing from SecureStore:",r)}})}isAvailable(){return n(this,null,function*(){try{return yield e.isAvailableAsync()}catch(t){return!1}})}};export{i as a};
1
+ import{f as n}from"./chunk-4P5ABAFD.mjs";import*as e from"expo-secure-store";var i=class{get(t){return n(this,null,function*(){try{let r=yield e.getItemAsync(t);if(!r)return;try{let o=JSON.parse(r);if(o.expiresAt&&new Date(o.expiresAt)<new Date){yield this.remove(t);return}return o.value}catch(o){return r}}catch(r){console.error("Error reading from SecureStore:",r);return}})}set(t,r,o){return n(this,null,function*(){try{if(o){let s=JSON.stringify({value:r,expiresAt:o});yield e.setItemAsync(t,s)}else yield e.setItemAsync(t,r)}catch(s){console.error("Error writing to SecureStore:",s)}})}remove(t){return n(this,null,function*(){try{yield e.deleteItemAsync(t)}catch(r){console.error("Error removing from SecureStore:",r)}})}isAvailable(){return n(this,null,function*(){try{return yield e.isAvailableAsync()}catch(t){return!1}})}};export{i as a};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-7JGGPJBX.mjs";import{e as I}from"./chunk-4P5ABAFD.mjs";var r=I((f,c)=>{c.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABV0lEQVR4AdzUXVKDQBAEYPRi6snUk+nNdL4pmiIEE5DkJSl6l52Z7t4/8jzc+fdYBq+1W1+Fn4Og8VEa/WSLBCSYdOJAQ+O9+PohBi8V8HxW83QQNEpiYDIZtJvoDfA9arRmVjDG2tV2Zby3x7XVE29pIGFpDlqx8RaYLQ7uSf3S4K2y8z28ZkLYjKGog+2hMeS3NFBAdG5iZmLhpBcjzEQMhzgN48bSoIPVILtNSDWczoYYEM52EFSLo/YEfxmkCGluQhiYEDZjSP1Zf80AgYkZxoiwd8Le1SwhD9N3sCxYG8eIsPe1msTkYZdByLv6LVu0S3Asdk53WwFxl6C9soIcVrt2ZlujHlIdcXodj0GfeFW52z6sS2hi1Xr8C+MQBjMn7iLIT4csyETfiY0NIRzC4F1somcFAmYm6c5fgjr1AU4m5z3x7ucGHfhnw/RMnNatDGit4hcAAP//I+bVpgAAAAZJREFUAwC4slUxPmyOTgAAAABJRU5ErkJggg=="});import{jsx as e}from"react/jsx-runtime";function v({size:i=22,color:n,strokeWidth:t=2}){return e(o,{source:r(),size:i,color:n})}export{v as a};
@@ -0,0 +1,2 @@
1
+ import{a as k}from"./chunk-NG4FYS2Z.mjs";import{a as T}from"./chunk-WDMEQNBX.mjs";import{a as f}from"./chunk-QHTHMZZV.mjs";import{a as C}from"./chunk-XZ5LQIRB.mjs";import{a as S}from"./chunk-TSRZEXRU.mjs";import{a as e}from"./chunk-7USVT6EZ.mjs";import{View as d,StyleSheet as R,Dimensions as B,Modal as z,TouchableOpacity as D,Text as w}from"react-native";import{jsx as t,jsxs as P}from"react/jsx-runtime";var{width:V}=B.get("window");function L({phone:i,open:n,setOpen:v,step:O,onSubmitOTP:x,onResendOTPCode:I,onSubmitPhone:M,rejectRef:r,appearance:o}){var m,u,c,g,y,b;function s(){var h;n&&((h=r.current)==null||h.call(r,new Error("User cancelled")),v(!1))}let l=R.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalContainer:{backgroundColor:((m=o==null?void 0:o.colors)==null?void 0:m.background)||e["cm-background-primary"],borderRadius:(o==null?void 0:o.borderRadius)||12,padding:32,width:Math.min(V-32,400),maxHeight:"80%",position:"relative",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeButton:{position:"absolute",top:16,right:16,width:32,height:32,borderRadius:6,backgroundColor:((u=o==null?void 0:o.colors)==null?void 0:u.inputBackground)||e["cm-muted-primary"],alignItems:"center",justifyContent:"center",zIndex:1}});return n?t(z,{visible:n,transparent:!0,animationType:"fade",onRequestClose:s,statusBarTranslucent:!0,children:t(d,{style:l.modalOverlay,children:P(d,{style:l.modalContainer,children:[t(D,{style:l.closeButton,onPress:s,hitSlop:{top:10,bottom:10,left:10,right:10},children:t(S,{size:16,color:((c=o==null?void 0:o.colors)==null?void 0:c.textSecondary)||e["cm-text-secondary"]})}),O==="initial"?t(T,{contactInfo:i!=null?i:"",contactType:"phone",icon:t(f,{size:22,color:((g=o==null?void 0:o.colors)==null?void 0:g.textPrimary)||e["cm-text-primary"]}),onConfirm:M,onCancel:s,appearance:o}):t(k,{contactInfo:i!=null?i:"",contactType:"phone",icon:t(d,{style:{backgroundColor:((y=o==null?void 0:o.colors)==null?void 0:y.accent)||e["cm-accent"],borderRadius:999,padding:12},children:t(C,{size:22,color:((b=o==null?void 0:o.colors)==null?void 0:b.background)||e["cm-background-primary"]})}),title:"Check your phone",description:P(w,{children:["A temporary login code has been sent via SMS to"," ",t(w,{style:{fontWeight:"bold"},children:i})]}),helpText:`Can't receive the SMS? Check your phone number.
2
+ Some messages may take several minutes to arrive.`,onSubmitOTP:x,onResendCode:I,appearance:o,otpLength:10,keyboardType:"number-pad",autoComplete:"sms-otp",textContentType:"oneTimeCode"})]})})}):null}export{L as a};
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNVBPI6JQjs = require('./chunk-NVBPI6JQ.js');var _chunkWH3PVAVNjs = require('./chunk-WH3PVAVN.js');var _chunkTQIJ7OZDjs = require('./chunk-TQIJ7OZD.js');var _chunkRIKAIN6Njs = require('./chunk-RIKAIN6N.js');var _chunkR4AKS6SVjs = require('./chunk-R4AKS6SV.js');var _chunkEI5LOD4Yjs = require('./chunk-EI5LOD4Y.js');var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');var{width:z}=_reactnative.Dimensions.get("window");function L({email:i,open:n,setOpen:S,step:O,onSubmitOTP:v,onResendOTPCode:P,onSubmitEmail:V,rejectRef:r,appearance:o}){var m,u,c,g,b,h;function s(){var y;n&&((y=r.current)==null||y.call(r,new Error),S(!1))}let d=_reactnative.StyleSheet.create({centeredView:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalView:{backgroundColor:((m=o==null?void 0:o.colors)==null?void 0:m.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"],borderRadius:(o==null?void 0:o.borderRadius)||12,padding:32,alignItems:"center",width:Math.min(z-32,400),maxHeight:"80%",position:"relative",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeButton:{position:"absolute",top:16,right:16,width:32,height:32,borderRadius:6,backgroundColor:((u=o==null?void 0:o.colors)==null?void 0:u.inputBackground)||_chunkEI5LOD4Yjs.a["cm-muted-primary"],alignItems:"center",justifyContent:"center",zIndex:1}});return n?_jsxruntime.jsx.call(void 0, _reactnative.Modal,{visible:n,transparent:!0,animationType:"fade",onRequestClose:s,statusBarTranslucent:!0,children:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:d.centeredView,children:_jsxruntime.jsxs.call(void 0, _reactnative.View,{style:d.modalView,children:[_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:d.closeButton,onPress:s,hitSlop:{top:10,bottom:10,left:10,right:10},children:_jsxruntime.jsx.call(void 0, _chunkR4AKS6SVjs.a,{size:16,color:((c=o==null?void 0:o.colors)==null?void 0:c.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"]})}),O==="initial"?_jsxruntime.jsx.call(void 0, _chunkWH3PVAVNjs.a,{contactInfo:i!=null?i:"",contactType:"email",icon:_jsxruntime.jsx.call(void 0, _chunkRIKAIN6Njs.a,{size:22,color:((g=o==null?void 0:o.colors)==null?void 0:g.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"]}),onConfirm:V,onCancel:s,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkNVBPI6JQjs.a,{contactInfo:i!=null?i:"",contactType:"email",icon:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{backgroundColor:((b=o==null?void 0:o.colors)==null?void 0:b.accent)||_chunkEI5LOD4Yjs.a["cm-accent"],borderRadius:999,padding:12},children:_jsxruntime.jsx.call(void 0, _chunkTQIJ7OZDjs.a,{size:22,color:((h=o==null?void 0:o.colors)==null?void 0:h.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]})}),title:"Check your email",description:_jsxruntime.jsxs.call(void 0, _reactnative.Text,{children:["A temporary login code has been sent to"," ",_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:{fontWeight:"bold"},children:i})]}),helpText:`Can't find the email? Check spam folder.
2
+ Some emails may take several minutes to arrive.`,onSubmitOTP:v,onResendCode:P,appearance:o,otpLength:9,keyboardType:"default",autoComplete:"one-time-code",textContentType:"oneTimeCode"})]})})}):null}exports.a = L;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkYVITECJTjs = require('./chunk-YVITECJT.js');var _commonsdkbase = require('@crossmint/common-sdk-base');var _reactnative = require('react-native');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _expodevice = require('expo-device'); var e = _interopRequireWildcard(_expodevice);function P(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=_commonsdkbase.validateAPIKey.call(void 0, n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new (0, _commonsdkbase.SdkLogger)({packageName:_chunkYVITECJTjs.a.name,packageVersion:_chunkYVITECJTjs.a.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=_expoconstants2.default.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=_expoconstants2.default.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new (0, _commonsdkbase.ReactNativeDatadogSink)(d,N,o);return a.addSink(h),w(a),a}function w(n){_reactnative.AppState.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}exports.a = P;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkNQTZET7Bjs = require('./chunk-NQTZET7B.js');var _commonsdkbase = require('@crossmint/common-sdk-base');var _reactnative = require('react-native');var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _expodevice = require('expo-device'); var e = _interopRequireWildcard(_expodevice);function P(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=_commonsdkbase.validateAPIKey.call(void 0, n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new (0, _commonsdkbase.SdkLogger)({packageName:_chunkNQTZET7Bjs.a.name,packageVersion:_chunkNQTZET7Bjs.a.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=_expoconstants2.default.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=_expoconstants2.default.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new (0, _commonsdkbase.ReactNativeDatadogSink)(d,N,o);return a.addSink(h),w(a),a}function w(n){_reactnative.AppState.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}exports.a = P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYQEWHOQ7js = require('./chunk-YQEWHOQ7.js');var _chunkVACQTZRTjs = require('./chunk-VACQTZRT.js');var _chunkRFFLL7AOjs = require('./chunk-RFFLL7AO.js');var _chunk2D2RJCVXjs = require('./chunk-2D2RJCVX.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _reactnative = require('react-native');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function Q(t){var u;let[e,w]=_react.useState.call(void 0, null),[C,v]=_react.useState.call(void 0, 0),E=_react.useRef.call(void 0, (u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=_react.useRef.call(void 0, t);if(U(t,n.current)){let r=_chunkJ42HASCIjs.a.call(void 0, {},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),V=_chunkRFFLL7AOjs.a.call(void 0, i,{usageOrigin:"client"}),P=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:V}),s=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{let r=s.current;if(!r||e)return;let o=new (0, _clientsdkrnwindow.WebViewParent)({current:r},{incomingEvents:_clientsdkbase.embeddedCheckoutV3IncomingEvents,outgoingEvents:_clientsdkbase.embeddedCheckoutV3OutgoingEvents});w(o)},[s.current,e]),_react.useEffect.call(void 0, ()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{_chunk2D2RJCVXjs.a.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:{flex:1},children:[_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:_chunkYQEWHOQ7js.c,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunkVACQTZRTjs.a,{payer:n.current.payment.crypto.payer,webViewClient:e}):_jsxruntime.jsx.call(void 0, H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunkJ42HASCIjs.b.call(void 0, _chunkJ42HASCIjs.a.call(void 0, {},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}exports.a = Q;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYQEWHOQ7js = require('./chunk-YQEWHOQ7.js');var _chunk2UY6GCV3js = require('./chunk-2UY6GCV3.js');var _chunk66JRBDJOjs = require('./chunk-66JRBDJO.js');var _chunk2D2RJCVXjs = require('./chunk-2D2RJCVX.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _reactnative = require('react-native');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function Q(t){var u;let[e,w]=_react.useState.call(void 0, null),[C,v]=_react.useState.call(void 0, 0),E=_react.useRef.call(void 0, (u=t.payment.crypto.payer)==null?void 0:u.initialChain),n=_react.useRef.call(void 0, t);if(U(t,n.current)){let r=_chunkIJN37RF2js.a.call(void 0, {},t),o=F(t,E.current);o.shouldPreserve&&(r.payment.crypto.payer=o.updatedPayer),n.current=r}let{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),V=_chunk66JRBDJOjs.a.call(void 0, i,{usageOrigin:"client"}),P=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:V}),s=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{let r=s.current;if(!r||e)return;let o=new (0, _clientsdkrnwindow.WebViewParent)({current:r},{incomingEvents:_clientsdkbase.embeddedCheckoutV3IncomingEvents,outgoingEvents:_clientsdkbase.embeddedCheckoutV3OutgoingEvents});w(o)},[s.current,e]),_react.useEffect.call(void 0, ()=>{if(e==null)return;let r=a=>v(a.height);e.on("ui:height.changed",r);let o=a=>{_chunk2D2RJCVXjs.a.emit("order:updated",a)};return e.on("order:updated",o),()=>{e.off("ui:height.changed"),e.off("order:updated")}},[e]);let k=r=>{e&&e.handleMessage(r)};return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:{flex:1},children:[_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:s,globals:i.appId?{crossmintAppId:i.appId}:void 0,source:{uri:P.iframe.getUrl(n.current)},onMessage:k,style:{width:"100%",minWidth:"100%",height:C,backgroundColor:"transparent",overflow:"hidden",opacity:1,padding:0,boxShadow:"none",borderWidth:0,transform:[{translateX:0}]},allowsInlineMediaPlayback:!0,mediaPlaybackRequiresUserAction:!1,allowsBackForwardNavigationGestures:!1,allowsLinkPreview:!1,scrollEnabled:!1,bounces:!1,showsHorizontalScrollIndicator:!1,showsVerticalScrollIndicator:!1,domStorageEnabled:!0,mixedContentMode:"always",allowFileAccess:!0,allowUniversalAccessFromFileURLs:!0,geolocationEnabled:!0,userAgent:_chunkYQEWHOQ7js.c,paymentRequestEnabled:!0}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunk2UY6GCV3js.a,{payer:n.current.payment.crypto.payer,webViewClient:e}):_jsxruntime.jsx.call(void 0, H,{message:"If 'payment.crypto.enabled' is true, 'payment.crypto.payer' must be provided. Support for not providing a payer is not yet implemented."}):null]})}function U(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function F(t,e){return t.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunkIJN37RF2js.b.call(void 0, _chunkIJN37RF2js.a.call(void 0, {},t.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}function H({message:t}){throw new Error(t)}exports.a = Q;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var o=Object.defineProperty,p=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;var j=(a,b,c)=>b in a?o(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c,r= exports.a =(a,b)=>{for(var c in b||(b={}))k.call(b,c)&&j(a,c,b[c]);if(f)for(var c of f(b))l.call(b,c)&&j(a,c,b[c]);return a},s= exports.b =(a,b)=>p(a,q(b));var t=(a=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(a,{get:(b,c)=>(typeof require!="undefined"?require:b)[c]}):a)(function(a){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var u=(a,b)=>{var c={};for(var d in a)k.call(a,d)&&b.indexOf(d)<0&&(c[d]=a[d]);if(a!=null&&f)for(var d of f(a))b.indexOf(d)<0&&l.call(a,d)&&(c[d]=a[d]);return c};var v=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var w=(a,b,c)=>new Promise((d,i)=>{var m=e=>{try{g(c.next(e))}catch(h){i(h)}},n=e=>{try{g(c.throw(e))}catch(h){i(h)}},g=e=>e.done?d(e.value):Promise.resolve(e.value).then(m,n);g((c=c.apply(a,b)).next())});exports.a = r; exports.b = s; exports.c = t; exports.d = u; exports.e = v; exports.f = w;
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-7JGGPJBX.mjs";import{e}from"./chunk-4P5ABAFD.mjs";var r=e((s,i)=>{i.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABPElEQVR4AdzVW1ICMRCF4ajL8FnXoetwLZZaLkzX4VpU6C+kh2Go4RZ4gcrJpZP+TxJCcVsu/Lkug/e4rb/QolO/kY8VTSl5RQJvEclxdE8ud5GJhTkYvEZQeYzqplMYgSiVmTvO9sVMp+5bfmXWqgU0w9EMTpBr+RrnTQ3MMfFFW2x8iJ5ikRy50V2XqcFzTH2EFIv3mQDbMcn5jgojmlWZGlgAOjaxM7FVxroWA2YiKgccw7hqalCDUUn2miTFsORpwAhYzBwgsBzjDc0Z5CJJYxNgYmINMDEx3tI+AwlMxqcBYyqmb82sDjHI5DSyY/2M72yPMdgJmpu8HoP/dsSH1vY0yajMvKLPRvyJ1g+rRxiBKZWZBl6Fp1ddzXYIAwtz+D/AE/Bn4X33CAMLc8OgBs5d5RWdmzvwlgAAAP//5FxmQQAAAAZJREFUAwDOiFAxJLPlDQAAAABJRU5ErkJggg=="});import{jsx as n}from"react/jsx-runtime";function l({size:I=22,color:c,strokeWidth:p=2}){return n(o,{source:r(),size:I,color:c})}export{l as a};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-VGA23PJK.mjs";import{SdkLogger as C,ReactNativeDatadogSink as R,validateAPIKey as S}from"@crossmint/common-sdk-base";import{AppState as b}from"react-native";import D from"expo-constants";import*as e from"expo-device";function _(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=S(n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new C({packageName:r.name,packageVersion:r.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=D.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=D.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new R(d,N,o);return a.addSink(h),w(a),a}function w(n){b.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}export{_ as a};
1
+ import{a as r}from"./chunk-LPJ4PJPR.mjs";import{SdkLogger as C,ReactNativeDatadogSink as R,validateAPIKey as S}from"@crossmint/common-sdk-base";import{AppState as b}from"react-native";import D from"expo-constants";import*as e from"expo-device";function _(n,i){var s,c,f,g,v,m,u,l,p,k,L;let t=S(n);if(!t.isValid)throw new Error(`Invalid API key: ${t.message}`);let{environment:d,projectId:I}=t,a=new C({packageName:r.name,packageVersion:r.version,environment:d,projectId:I,platform:"react-native",consoleLogLevel:i}),N=(m=(v=(c=(s=D.expoConfig)==null?void 0:s.ios)==null?void 0:c.bundleIdentifier)!=null?v:(g=(f=D.expoConfig)==null?void 0:f.android)==null?void 0:g.package)!=null?m:void 0,o={};e!=null&&(o.device=(p=(l=(u=e.modelName)!=null?u:e.deviceName)!=null?l:e.brand)!=null?p:void 0,o.os_version=(k=e.osVersion)!=null?k:void 0,o.os_name=(L=e.osName)!=null?L:void 0);let h=new R(d,N,o);return a.addSink(h),w(a),a}function w(n){b.addEventListener("change",i=>{(i==="background"||i==="inactive")&&typeof n.flush=="function"&&n.flush()})}export{_ as a};
@@ -1 +1 @@
1
- import{a as v}from"./chunk-ZCKUSOGC.mjs";import{d as S,e as c}from"./chunk-PSSAAY7D.mjs";import{createContext as I,useEffect as N,useMemo as L,useState as M,useCallback as W}from"react";import*as n from"expo-web-browser";import p from"expo-constants";import{Platform as T}from"react-native";import{CrossmintAuthBaseProvider as z,useCrossmintAuthBase as F}from"@crossmint/client-sdk-react-base";import{useCrossmint as b,useWallet as Y,useWalletOtpSigner as Z}from"@crossmint/client-sdk-react-base";import{useContext as k}from"react";function R(){let r=k(w);if(r==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return r}import{jsx as d}from"react/jsx-runtime";var B={google:null,twitter:null},G={crossmintAuth:void 0,login:()=>{},logout:()=>c(void 0,null,function*(){}),jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},loginWithOAuth:()=>Promise.resolve(),createAuthSession:()=>Promise.resolve(null)},w=I(G);function V({children:r}){let{setJwt:e}=b(),{jwt:t}=R();return N(()=>{e(t)},[e,t]),r}function _({children:r,appSchema:e}){let t=F(),[h,g]=M(B),[f,i]=M(!1),A=Array.isArray(e)?e[0]:e,P=p.executionEnvironment==="storeClient"||p.appOwnership==="expo"||!!p.expoVersion?"exp://127.0.0.1:8081":A,y=W(()=>c(this,null,function*(){try{let u=Object.keys(B).map(s=>c(this,null,function*(){var m;let l=yield(m=t.crossmintAuth)==null?void 0:m.getOAuthUrl(s,{appSchema:P});return{[s]:l}})),a=Object.assign({},...yield Promise.all(u));g(a)}catch(o){console.error(o)}}),[t.crossmintAuth,P]);N(()=>{t.user==null&&y()},[y,t.user]);let E=()=>t.status==="initializing"?"initializing":f?"in-progress":t.jwt!=null?"logged-in":"logged-out",j=o=>c(this,null,function*(){var u,a;try{i(!0);let s=(a=h[o])!=null?a:yield(u=t.crossmintAuth)==null?void 0:u.getOAuthUrl(o,{appSchema:P});yield n.warmUpAsync();let l=new URL(s);if(o==="google"&&l.searchParams.append("provider_prompt","select_account"),T.OS==="android")yield n.openBrowserAsync(l.toString());else{let m=yield n.openAuthSessionAsync(l.toString());m.type==="success"&&(yield x(m.url))}yield n.coolDownAsync()}catch(s){throw console.error("[CrossmintAuthProvider] Error during OAuth login:",s),new Error(`Error during OAuth login: ${s}`)}finally{i(!1)}}),x=W(o=>c(this,null,function*(){var a;let u=o.includes("://")?D(o):o;if(u!=null)try{return i(!0),yield(a=t.crossmintAuth)==null?void 0:a.handleRefreshAuthMaterial(u)}catch(s){throw s}finally{i(!1)}return null}),[t.crossmintAuth]);return d(w.Provider,{value:{crossmintAuth:t.crossmintAuth,logout:t.logout,jwt:t.jwt,user:t.user,status:E(),getUser:t.getUser,login:()=>{},loginWithOAuth:j,createAuthSession:x},children:d(V,{children:r})})}function at(t){var h=t,{children:r}=h,e=S(h,["children"]);var i,A;let g=(A=e.appSchema)!=null?A:(i=p.expoConfig)==null?void 0:i.scheme,f=L(()=>{var C;return(C=e.storageProvider)!=null?C:new v},[e.storageProvider]);return d(z,{onLoginSuccess:e.onLoginSuccess,refreshRoute:e.refreshRoute,logoutRoute:e.logoutRoute,storageProvider:f,children:d(_,{appSchema:g,children:r})})}var D=r=>{let e=/[?&]oneTimeSecret=([^&#]+)/,t=r.match(e);return t?decodeURIComponent(t[1]):void 0};export{w as a,at as b,R as c,b as d,Y as e,Z as f};
1
+ import{a as v}from"./chunk-AHAHB7QD.mjs";import{d as S,f as c}from"./chunk-4P5ABAFD.mjs";import{createContext as I,useEffect as N,useMemo as L,useState as M,useCallback as W}from"react";import*as n from"expo-web-browser";import p from"expo-constants";import{Platform as T}from"react-native";import{CrossmintAuthBaseProvider as z,useCrossmintAuthBase as F}from"@crossmint/client-sdk-react-base";import{useCrossmint as b,useWallet as Y,useWalletOtpSigner as Z}from"@crossmint/client-sdk-react-base";import{useContext as k}from"react";function R(){let r=k(w);if(r==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return r}import{jsx as d}from"react/jsx-runtime";var B={google:null,twitter:null},G={crossmintAuth:void 0,login:()=>{},logout:()=>c(void 0,null,function*(){}),jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},loginWithOAuth:()=>Promise.resolve(),createAuthSession:()=>Promise.resolve(null)},w=I(G);function V({children:r}){let{setJwt:e}=b(),{jwt:t}=R();return N(()=>{e(t)},[e,t]),r}function _({children:r,appSchema:e}){let t=F(),[h,g]=M(B),[f,i]=M(!1),A=Array.isArray(e)?e[0]:e,P=p.executionEnvironment==="storeClient"||p.appOwnership==="expo"||!!p.expoVersion?"exp://127.0.0.1:8081":A,y=W(()=>c(this,null,function*(){try{let u=Object.keys(B).map(s=>c(this,null,function*(){var m;let l=yield(m=t.crossmintAuth)==null?void 0:m.getOAuthUrl(s,{appSchema:P});return{[s]:l}})),a=Object.assign({},...yield Promise.all(u));g(a)}catch(o){console.error(o)}}),[t.crossmintAuth,P]);N(()=>{t.user==null&&y()},[y,t.user]);let E=()=>t.status==="initializing"?"initializing":f?"in-progress":t.jwt!=null?"logged-in":"logged-out",j=o=>c(this,null,function*(){var u,a;try{i(!0);let s=(a=h[o])!=null?a:yield(u=t.crossmintAuth)==null?void 0:u.getOAuthUrl(o,{appSchema:P});yield n.warmUpAsync();let l=new URL(s);if(o==="google"&&l.searchParams.append("provider_prompt","select_account"),T.OS==="android")yield n.openBrowserAsync(l.toString());else{let m=yield n.openAuthSessionAsync(l.toString());m.type==="success"&&(yield x(m.url))}yield n.coolDownAsync()}catch(s){throw console.error("[CrossmintAuthProvider] Error during OAuth login:",s),new Error(`Error during OAuth login: ${s}`)}finally{i(!1)}}),x=W(o=>c(this,null,function*(){var a;let u=o.includes("://")?D(o):o;if(u!=null)try{return i(!0),yield(a=t.crossmintAuth)==null?void 0:a.handleRefreshAuthMaterial(u)}catch(s){throw s}finally{i(!1)}return null}),[t.crossmintAuth]);return d(w.Provider,{value:{crossmintAuth:t.crossmintAuth,logout:t.logout,jwt:t.jwt,user:t.user,status:E(),getUser:t.getUser,login:()=>{},loginWithOAuth:j,createAuthSession:x},children:d(V,{children:r})})}function at(t){var h=t,{children:r}=h,e=S(h,["children"]);var i,A;let g=(A=e.appSchema)!=null?A:(i=p.expoConfig)==null?void 0:i.scheme,f=L(()=>{var C;return(C=e.storageProvider)!=null?C:new v},[e.storageProvider]);return d(z,{onLoginSuccess:e.onLoginSuccess,refreshRoute:e.refreshRoute,logoutRoute:e.logoutRoute,storageProvider:f,children:d(_,{appSchema:g,children:r})})}var D=r=>{let e=/[?&]oneTimeSecret=([^&#]+)/,t=r.match(e);return t?decodeURIComponent(t[1]):void 0};export{w as a,at as b,R as c,b as d,Y as e,Z as f};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIEPHFQWOjs = require('./chunk-IEPHFQWO.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkIEPHFQWOjs.a,_chunkIJN37RF2js.a.call(void 0, {},d))}exports.a = s;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVASK7FQjs = require('./chunk-TVASK7FQ.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var r=_chunkIJN37RF2js.e.call(void 0, (t,e)=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAxUlEQVR4AeyVbQrCQAxEqx5F9Gyi51E8m+JR/Ji3mIXQlM0PhUK3ZJZt8oa0oXTXw5+vqQZn9X1K76Rg8Qj3ETUAPAqLakqHAYsHrwMouIRuDhKx17JKClboYF72RVEDy90LkVuMNW91jRK18qNNb9AcZB9RH1FzAk1geV/RTTN5SOmY3Yj472/Tjy8weoOX8sSOJSljzVttUYPrt8q8s2cyLDbzsi+KGpxUuUijp1FuKmDx4HVM1AAAcKNN9kyGxSOLjw8AAAD//6BjmDAAAAAGSURBVAMAy+IoMbHLqDcAAAAASUVORK5CYII="});var _jsxruntime = require('react/jsx-runtime');function s({size:n=22,color:p,strokeWidth:c=2}){return _jsxruntime.jsx.call(void 0, _chunkTVASK7FQjs.a,{source:r(),size:n,color:p})}exports.a = s;
@@ -0,0 +1 @@
1
+ var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.0-beta.6",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0",mitt:"3.0.1",zod:"3.22.4","@crossmint/expo-device-signer":"workspace:*"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@crossmint/expo-device-signer":"0.1.0-beta.4","@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"},peerDependenciesMeta:{"@crossmint/expo-device-signer":{optional:!0}}};export{o as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4EKVY6NSjs = require('./chunk-4EKVY6NS.js');var _chunkG4YSWRHLjs = require('./chunk-G4YSWRHL.js');var _chunk42DYL4PZjs = require('./chunk-42DYL4PZ.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _react = require('react');var _reactnative = require('react-native');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _clientsigners = require('@crossmint/client-signers');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _expodevicesigner = require('@crossmint/expo-device-signer');var _jsxruntime = require('react/jsx-runtime');var L="Passkey signers are not supported in React Native. Use a different signer type such as 'email', 'phone', or 'device'.";function ve(c){var i,v;return c==null?!1:!!(((i=c.recovery)==null?void 0:i.type)==="passkey"||(v=c.signers)!=null&&v.some(m=>m.type==="passkey"))}function me({children:c}){let i=_react.useContext.call(void 0, _clientsdkreactbase.CrossmintWalletBaseContext),v=_react.useCallback.call(void 0, d=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var R,I;if(((R=d.recovery)==null?void 0:R.type)==="passkey"||(I=d.signers)!=null&&I.some(r=>r.type==="passkey"))throw new Error(L);return i.createWallet(d)}),[i.createWallet]),m=_react.useCallback.call(void 0, d=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){throw new Error(L)}),[]),V=_react.useMemo.call(void 0, ()=>_chunkIJN37RF2js.b.call(void 0, _chunkIJN37RF2js.a.call(void 0, {},i),{createWallet:v,createPasskeySigner:m}),[i,v,m]);return _jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintWalletBaseContext.Provider,{value:V,children:c})}function pe({children:c,createOnLogin:i,appearance:v,showOtpSignerPrompt:m=!0,callbacks:V,deviceSignerKeyStorage:d}){let R=_react.useMemo.call(void 0, ()=>d!=null?d:new _expodevicesigner.NativeDeviceSignerKeyStorage,[]),{crossmint:I}=_clientsdkreactbase.useCrossmint.call(void 0, "CrossmintWalletProvider must be used within CrossmintProvider"),r=_clientsdkreactbase.useLogger.call(void 0, _chunk4EKVY6NSjs.a),{apiKey:N,appId:O}=I,D=_react.useMemo.call(void 0, ()=>{let e=_commonsdkbase.validateAPIKey.call(void 0, N);if(!e.isValid)throw new Error("Invalid API key");return e},[N]),F=_react.useMemo.call(void 0, ()=>_clientsigners.environmentUrlConfig[D.environment],[D.environment]),y=_react.useRef.call(void 0, null),t=_react.useRef.call(void 0, null),[T,J]=_react.useState.call(void 0, !1),C=_react.useRef.call(void 0, !1),l=_react.useRef.call(void 0, !1),s=_react.useRef.call(void 0, 0),M=_react.useRef.call(void 0, 0),Y=_react.useMemo.call(void 0, ()=>O!=null?{crossmintAppId:O}:{},[O]),w=_react.useCallback.call(void 0, e=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){if(t.current!=null){let n=t.current;if(l.current){r.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e,generation:s.current});return}if(C.current&&n.isConnected){r.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e,generation:s.current});return}l.current=!0;let a=Date.now();M.current=a;let o=s.current;try{r.info("react-native.wallet.webview.handshake.start",{trigger:e,generation:o,platform:_reactnative.Platform.OS}),C.current=!0,n.isConnected=!1,yield n.handshakeWithChild();let u=Date.now()-a;r.info("react-native.wallet.webview.handshake.success",{trigger:e,generation:o,durationMs:u})}catch(u){let f=Date.now()-a;o===s.current&&(C.current=!1),r.error("react-native.wallet.webview.handshake.error",{trigger:e,generation:o,durationMs:f,error:u instanceof Error?u.message:String(u)}),console.error("[CrossmintWalletProvider] Handshake error:",u)}finally{o===s.current&&(l.current=!1)}}else r.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[r]);_react.useEffect.call(void 0, ()=>{y.current!=null&&t.current==null&&(r.info("react-native.wallet.webview.initializing"),t.current=new (0, _clientsdkrnwindow.WebViewParent)(y,{incomingEvents:_clientsigners.signerOutboundEvents,outgoingEvents:_clientsigners.signerInboundEvents,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[_clientsigners.SignerErrorCode.IndexedDbFatal]}}),r.info("react-native.wallet.webview.initialized"),w("eager"))},[T,r,w]);let $=_react.useCallback.call(void 0, ()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var e,n;r.info("react-native.wallet.webview.onLoadEnd",{handshakeInProgress:l.current,isConnected:(n=(e=t.current)==null?void 0:e.isConnected)!=null?n:!1,generation:s.current}),yield w("onLoadEnd")}),[r,w]),q=_react.useCallback.call(void 0, e=>{var o,u;let n=t.current;if(n==null)return;let a=e.nativeEvent.data;if(a==="frame-ready"){r.info("react-native.wallet.webview.frame-ready.received",{handshakeInProgress:l.current,isConnected:(u=(o=t.current)==null?void 0:o.isConnected)!=null?u:!1,generation:s.current,msSinceHandshakeStart:M.current>0?Date.now()-M.current:null}),w("frame-ready");return}try{let f=JSON.parse(a);if(f&&typeof f.type=="string"&&f.type.startsWith("console.")){let x=f.type.split(".")[1],U=(f.data||[]).map(h=>{try{return h==="[Function]"||h==="[Circular Reference]"||h==="[Unserializable Object]"?h:JSON.parse(h)}catch(be){return h}}),k=`react-native.wallet.webview.console.${x}`,P={webview_args:U};switch(x){case"log":r.info(k,P);break;case"error":r.error(k,P);break;case"warn":r.warn(k,P);break;case"info":r.info(k,P);break;case"debug":r.debug(k,P);break;default:r.info("react-native.wallet.webview.console.unknown",{webview_method:x,webview_args:U})}return}}catch(f){}n.handleMessage(e)},[r,w]),Q=()=>{if(t.current==null)throw new Error("WebView not ready or handshake incomplete");return t.current},X=({emailSignerProps:e,phoneSignerProps:n})=>m?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkG4YSWRHLjs.a,_chunkIJN37RF2js.a.call(void 0, {},e)),_jsxruntime.jsx.call(void 0, _chunk42DYL4PZjs.a,_chunkIJN37RF2js.a.call(void 0, {},n))]}):null,Z=()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){r.info("react-native.wallet.webview.init.start"),J(!0);let e=0,n=100;for(;t.current==null&&e<n;)yield new Promise(a=>setTimeout(a,50)),e++;if(t.current==null)throw r.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");r.info("react-native.wallet.webview.init.success",{attempts:e})});return _react.useEffect.call(void 0, ()=>{if(ve(i))throw new Error(L)},[i]),_jsxruntime.jsxs.call(void 0, _clientsdkreactbase.CrossmintWalletBaseProvider,{createOnLogin:i,appearance:v,showOtpSignerPrompt:m,initializeWebView:Z,callbacks:V,renderUI:X,clientTEEConnection:Q,deviceSignerKeyStorage:R,children:[_jsxruntime.jsx.call(void 0, me,{children:c}),T&&_jsxruntime.jsx.call(void 0, _reactnative.View,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:y,source:{uri:F},globals:Y,onLoadEnd:$,onMessage:q,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.terminated",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},onRenderProcessGone:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.renderGone",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[_clientsigners.environmentUrlConfig[D.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function De(c){return _jsxruntime.jsx.call(void 0, pe,_chunkIJN37RF2js.a.call(void 0, {},c))}exports.a = De;
@@ -1 +1 @@
1
- import{a as o}from"./chunk-7USVT6EZ.mjs";import{e as b}from"./chunk-PSSAAY7D.mjs";import{useState as g}from"react";import{View as V,Text as n,TextInput as K,TouchableOpacity as D,StyleSheet as M,ActivityIndicator as Q}from"react-native";import{jsx as e,jsxs as X}from"react/jsx-runtime";function p({icon:H,title:L,description:F,helpText:N,onSubmitOTP:W,onResendCode:y,appearance:t,otpLength:E=9,keyboardType:U="default",autoComplete:$="one-time-code",textContentType:q="oneTimeCode"}){var f,h,B,C,S,I,P,k,R,z,w,O,v;let[r,x]=g(""),[s,u]=g(!1),[c,d]=g(null),[m,T]=g(0),G=()=>b(this,null,function*(){if(r.length!==0){u(!0),d(null);try{yield W(r),x("")}catch(l){console.error("Failed to verify OTP",l),d("Invalid code. Please try again.")}finally{u(!1)}}}),J=()=>b(this,null,function*(){if(!(m>0||!y)){u(!0),d(null);try{yield y(),T(60);let l=setInterval(()=>{T(A=>A<=1?(clearInterval(l),0):A-1)},1e3)}catch(l){console.error("Failed to resend OTP",l),d("Failed to resend code. Please try again.")}finally{u(!1)}}}),i=M.create({container:{width:"100%"},iconContainer:{alignItems:"center",marginBottom:8},title:{fontSize:18,fontWeight:"600",color:((f=t==null?void 0:t.colors)==null?void 0:f.textPrimary)||o["cm-text-primary"],textAlign:"center",marginBottom:8,marginTop:16},description:{fontSize:14,color:((h=t==null?void 0:t.colors)==null?void 0:h.textSecondary)||o["cm-text-secondary"],textAlign:"center",marginBottom:24,lineHeight:20},otpInput:{borderWidth:1,borderColor:c?((B=t==null?void 0:t.colors)==null?void 0:B.danger)||o["cm-danger"]:((C=t==null?void 0:t.colors)==null?void 0:C.border)||o["cm-border"],borderRadius:(t==null?void 0:t.borderRadius)||12,backgroundColor:((S=t==null?void 0:t.colors)==null?void 0:S.inputBackground)||o["cm-muted-primary"],padding:16,fontSize:16,color:((I=t==null?void 0:t.colors)==null?void 0:I.textPrimary)||o["cm-text-primary"],marginBottom:16,textAlign:"center"},errorText:{fontSize:14,color:((P=t==null?void 0:t.colors)==null?void 0:P.danger)||o["cm-danger"],textAlign:"center",marginBottom:16},helpText:{fontSize:12,color:((k=t==null?void 0:t.colors)==null?void 0:k.textSecondary)||o["cm-text-secondary"],textAlign:"center",marginBottom:16,lineHeight:16},submitButton:{backgroundColor:((R=t==null?void 0:t.colors)==null?void 0:R.accent)||o["cm-accent"],paddingVertical:16,paddingHorizontal:32,borderRadius:(t==null?void 0:t.borderRadius)||12,alignItems:"center",marginBottom:16},submitButtonDisabled:{opacity:.6},submitButtonText:{fontSize:16,fontWeight:"500",color:((z=t==null?void 0:t.colors)==null?void 0:z.background)||o["cm-background-primary"]},resendButton:{alignSelf:"center",paddingVertical:12,paddingHorizontal:16},resendButtonText:{fontSize:14,color:((w=t==null?void 0:t.colors)==null?void 0:w.accent)||o["cm-accent"],textAlign:"center"},resendButtonDisabled:{opacity:.6}});return X(V,{style:i.container,children:[e(V,{style:i.iconContainer,children:H}),e(n,{style:i.title,children:L}),e(n,{style:i.description,children:F}),e(K,{style:i.otpInput,placeholder:"Enter code",placeholderTextColor:((O=t==null?void 0:t.colors)==null?void 0:O.textSecondary)||o["cm-text-secondary"],value:r,onChangeText:l=>{x(l),d(null)},keyboardType:U,autoComplete:$,textContentType:q,editable:!s,maxLength:E}),c&&e(n,{style:i.errorText,children:c}),e(n,{style:i.helpText,children:N}),e(D,{style:[i.submitButton,(r.length===0||s)&&i.submitButtonDisabled],onPress:G,disabled:r.length===0||s,children:s?e(Q,{color:((v=t==null?void 0:t.colors)==null?void 0:v.background)||o["cm-background-primary"]}):e(n,{style:i.submitButtonText,children:"Submit"})}),y&&e(D,{style:[i.resendButton,m>0&&i.resendButtonDisabled],onPress:J,disabled:m>0||s,children:e(n,{style:i.resendButtonText,children:m>0?`Re-send code in ${m}s`:"Re-send code"})})]})}export{p as a};
1
+ import{a as o}from"./chunk-7USVT6EZ.mjs";import{f as b}from"./chunk-4P5ABAFD.mjs";import{useState as g}from"react";import{View as V,Text as n,TextInput as K,TouchableOpacity as D,StyleSheet as M,ActivityIndicator as Q}from"react-native";import{jsx as e,jsxs as X}from"react/jsx-runtime";function p({icon:H,title:L,description:F,helpText:N,onSubmitOTP:W,onResendCode:y,appearance:t,otpLength:E=9,keyboardType:U="default",autoComplete:$="one-time-code",textContentType:q="oneTimeCode"}){var f,h,B,C,S,I,P,k,R,z,w,O,v;let[r,x]=g(""),[s,u]=g(!1),[c,d]=g(null),[m,T]=g(0),G=()=>b(this,null,function*(){if(r.length!==0){u(!0),d(null);try{yield W(r),x("")}catch(l){console.error("Failed to verify OTP",l),d("Invalid code. Please try again.")}finally{u(!1)}}}),J=()=>b(this,null,function*(){if(!(m>0||!y)){u(!0),d(null);try{yield y(),T(60);let l=setInterval(()=>{T(A=>A<=1?(clearInterval(l),0):A-1)},1e3)}catch(l){console.error("Failed to resend OTP",l),d("Failed to resend code. Please try again.")}finally{u(!1)}}}),i=M.create({container:{width:"100%"},iconContainer:{alignItems:"center",marginBottom:8},title:{fontSize:18,fontWeight:"600",color:((f=t==null?void 0:t.colors)==null?void 0:f.textPrimary)||o["cm-text-primary"],textAlign:"center",marginBottom:8,marginTop:16},description:{fontSize:14,color:((h=t==null?void 0:t.colors)==null?void 0:h.textSecondary)||o["cm-text-secondary"],textAlign:"center",marginBottom:24,lineHeight:20},otpInput:{borderWidth:1,borderColor:c?((B=t==null?void 0:t.colors)==null?void 0:B.danger)||o["cm-danger"]:((C=t==null?void 0:t.colors)==null?void 0:C.border)||o["cm-border"],borderRadius:(t==null?void 0:t.borderRadius)||12,backgroundColor:((S=t==null?void 0:t.colors)==null?void 0:S.inputBackground)||o["cm-muted-primary"],padding:16,fontSize:16,color:((I=t==null?void 0:t.colors)==null?void 0:I.textPrimary)||o["cm-text-primary"],marginBottom:16,textAlign:"center"},errorText:{fontSize:14,color:((P=t==null?void 0:t.colors)==null?void 0:P.danger)||o["cm-danger"],textAlign:"center",marginBottom:16},helpText:{fontSize:12,color:((k=t==null?void 0:t.colors)==null?void 0:k.textSecondary)||o["cm-text-secondary"],textAlign:"center",marginBottom:16,lineHeight:16},submitButton:{backgroundColor:((R=t==null?void 0:t.colors)==null?void 0:R.accent)||o["cm-accent"],paddingVertical:16,paddingHorizontal:32,borderRadius:(t==null?void 0:t.borderRadius)||12,alignItems:"center",marginBottom:16},submitButtonDisabled:{opacity:.6},submitButtonText:{fontSize:16,fontWeight:"500",color:((z=t==null?void 0:t.colors)==null?void 0:z.background)||o["cm-background-primary"]},resendButton:{alignSelf:"center",paddingVertical:12,paddingHorizontal:16},resendButtonText:{fontSize:14,color:((w=t==null?void 0:t.colors)==null?void 0:w.accent)||o["cm-accent"],textAlign:"center"},resendButtonDisabled:{opacity:.6}});return X(V,{style:i.container,children:[e(V,{style:i.iconContainer,children:H}),e(n,{style:i.title,children:L}),e(n,{style:i.description,children:F}),e(K,{style:i.otpInput,placeholder:"Enter code",placeholderTextColor:((O=t==null?void 0:t.colors)==null?void 0:O.textSecondary)||o["cm-text-secondary"],value:r,onChangeText:l=>{x(l),d(null)},keyboardType:U,autoComplete:$,textContentType:q,editable:!s,maxLength:E}),c&&e(n,{style:i.errorText,children:c}),e(n,{style:i.helpText,children:N}),e(D,{style:[i.submitButton,(r.length===0||s)&&i.submitButtonDisabled],onPress:G,disabled:r.length===0||s,children:s?e(Q,{color:((v=t==null?void 0:t.colors)==null?void 0:v.background)||o["cm-background-primary"]}):e(n,{style:i.submitButtonText,children:"Submit"})}),y&&e(D,{style:[i.resendButton,m>0&&i.resendButtonDisabled],onPress:J,disabled:m>0||s,children:e(n,{style:i.resendButtonText,children:m>0?`Re-send code in ${m}s`:"Re-send code"})})]})}export{p as a};
@@ -1 +1 @@
1
- import{e as p}from"./chunk-PSSAAY7D.mjs";import{useState as v,useCallback as s,useRef as u,useEffect as y}from"react";import{View as g,Text as x,StyleSheet as V,Alert as f}from"react-native";import{useWallet as h,useCrossmint as C}from"@crossmint/client-sdk-react-base";import{environmentUrlConfig as W,exportSignerInboundEvents as P,exportSignerOutboundEvents as S}from"@crossmint/client-signers";import{isExportableSignerAdapter as b}from"@crossmint/wallets-sdk";import{validateAPIKey as F}from"@crossmint/common-sdk-base";import{WebViewParent as I,RNWebView as k}from"@crossmint/client-sdk-rn-window";import{jsx as o}from"react/jsx-runtime";function z({appearance:K}){let{wallet:r}=h(),{crossmint:i}=C(),a=u(null),l=u(null),[c,w]=v("");y(()=>{if(i!=null)try{let e=F(i.apiKey);if(e.isValid){let t=W[e.environment];w(`${t}/export`)}}catch(e){console.error("Failed to get TEE URL:",e)}},[i]);let E=s(e=>p(this,null,function*(){if(!(r==null||a.current==null||e.nativeEvent.loading))try{if(r.signer!=null&&b(r.signer)){let t=new I(a,{incomingEvents:S,outgoingEvents:P});l.current=t,yield t.handshakeWithChild(),yield r.signer._exportPrivateKey(t)}}catch(t){console.error("Failed to export private key:",t),f.alert("Export Failed","Failed to export private key. Please try again.")}}),[r]),d=s(e=>{let{nativeEvent:t}=e;console.error("WebView error:",t),f.alert("Export Failed","Failed to load export interface. Please try again.")},[]),m=s(e=>{l.current&&l.current.handleMessage(e)},[]);return c===""||r==null||r.signer==null||!b(r.signer)?null:o(g,{style:n.webViewContainer,children:o(k,{ref:a,source:{uri:c},style:n.webView,javaScriptEnabled:!0,domStorageEnabled:!0,onLoadEnd:E,onError:d,onHttpError:d,onMessage:m,startInLoadingState:!0,renderLoading:()=>o(g,{style:n.loadingContainer,children:o(x,{style:n.loadingText,children:"Loading..."})})})})}var n=V.create({webViewContainer:{height:56,borderWidth:1,borderColor:"#E5E5E5",borderRadius:12,overflow:"hidden"},webView:{flex:1},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"#F5F5F5"},loadingText:{fontSize:16,color:"#666666"}});export{z as a};
1
+ import{f as p}from"./chunk-4P5ABAFD.mjs";import{useState as v,useCallback as s,useRef as u,useEffect as y}from"react";import{View as g,Text as x,StyleSheet as V,Alert as f}from"react-native";import{useWallet as h,useCrossmint as C}from"@crossmint/client-sdk-react-base";import{environmentUrlConfig as W,exportSignerInboundEvents as P,exportSignerOutboundEvents as S}from"@crossmint/client-signers";import{isExportableSignerAdapter as b}from"@crossmint/wallets-sdk";import{validateAPIKey as F}from"@crossmint/common-sdk-base";import{WebViewParent as I,RNWebView as k}from"@crossmint/client-sdk-rn-window";import{jsx as o}from"react/jsx-runtime";function z({appearance:K}){let{wallet:r}=h(),{crossmint:i}=C(),a=u(null),l=u(null),[c,w]=v("");y(()=>{if(i!=null)try{let e=F(i.apiKey);if(e.isValid){let t=W[e.environment];w(`${t}/export`)}}catch(e){console.error("Failed to get TEE URL:",e)}},[i]);let E=s(e=>p(this,null,function*(){if(!(r==null||a.current==null||e.nativeEvent.loading))try{if(r.signer!=null&&b(r.signer)){let t=new I(a,{incomingEvents:S,outgoingEvents:P});l.current=t,yield t.handshakeWithChild(),yield r.signer._exportPrivateKey(t)}}catch(t){console.error("Failed to export private key:",t),f.alert("Export Failed","Failed to export private key. Please try again.")}}),[r]),d=s(e=>{let{nativeEvent:t}=e;console.error("WebView error:",t),f.alert("Export Failed","Failed to load export interface. Please try again.")},[]),m=s(e=>{l.current&&l.current.handleMessage(e)},[]);return c===""||r==null||r.signer==null||!b(r.signer)?null:o(g,{style:n.webViewContainer,children:o(k,{ref:a,source:{uri:c},style:n.webView,javaScriptEnabled:!0,domStorageEnabled:!0,onLoadEnd:E,onError:d,onHttpError:d,onMessage:m,startInLoadingState:!0,renderLoading:()=>o(g,{style:n.loadingContainer,children:o(x,{style:n.loadingText,children:"Loading..."})})})})}var n=V.create({webViewContainer:{height:56,borderWidth:1,borderColor:"#E5E5E5",borderRadius:12,overflow:"hidden"},webView:{flex:1},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"#F5F5F5"},loadingText:{fontSize:16,color:"#666666"}});export{z as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var c={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.0-beta.5",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0","lucide-react-native":"0.548.0",mitt:"3.0.1","react-native-svg":"15.14.0",zod:"3.22.4","@crossmint/expo-device-signer":"workspace:*"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@crossmint/expo-device-signer":"0.1.0-beta.3","@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"},peerDependenciesMeta:{"@crossmint/expo-device-signer":{optional:!0}}};exports.a = c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var o={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.0-beta.6",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",files:["dist","app.plugin.js","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","generate:docs":"typedoc && node scripts/generate-reference.mjs"},dependencies:{"@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-react-base":"workspace:*","@crossmint/client-sdk-rn-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/wallets-sdk":"workspace:*","@solana/web3.js":"1.98.1",bs58:"^5.0.0","lodash.clonedeep":"4.5.0","lodash.isequal":"4.5.0",mitt:"3.0.1",zod:"3.22.4","@crossmint/expo-device-signer":"workspace:*"},devDependencies:{"@expo/config-plugins":"^9.0.17",typedoc:"0.28.16","@types/react":"19.1.10","expo-constants":"~18.0.9","expo-device":"~8.0.9","expo-secure-store":"~15.0.7","expo-web-browser":"~15.0.8"},peerDependencies:{"@crossmint/expo-device-signer":"0.1.0-beta.4","@expo/config-plugins":">=9.0.0","@solana/web3.js":"^1.98.1","expo-constants":">=17 <19","expo-device":">=7 <9","expo-secure-store":">=14 <16","expo-web-browser":">=14 <16",react:">=17.0.2","react-native":">=0.74.3","react-native-webview":">=13.15.0 <14"},peerDependenciesMeta:{"@crossmint/expo-device-signer":{optional:!0}}};exports.a = o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEI5LOD4Yjs = require('./chunk-EI5LOD4Y.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _react = require('react');var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');function a({icon:H,title:L,description:F,helpText:N,onSubmitOTP:W,onResendCode:y,appearance:t,otpLength:E=9,keyboardType:U="default",autoComplete:$="one-time-code",textContentType:q="oneTimeCode"}){var f,h,B,C,S,I,P,k,R,z,w,O,v;let[r,x]=_react.useState.call(void 0, ""),[s,u]=_react.useState.call(void 0, !1),[c,d]=_react.useState.call(void 0, null),[m,T]=_react.useState.call(void 0, 0),G=()=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){if(r.length!==0){u(!0),d(null);try{yield W(r),x("")}catch(l){console.error("Failed to verify OTP",l),d("Invalid code. Please try again.")}finally{u(!1)}}}),J=()=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){if(!(m>0||!y)){u(!0),d(null);try{yield y(),T(60);let l=setInterval(()=>{T(A=>A<=1?(clearInterval(l),0):A-1)},1e3)}catch(l){console.error("Failed to resend OTP",l),d("Failed to resend code. Please try again.")}finally{u(!1)}}}),i=_reactnative.StyleSheet.create({container:{width:"100%"},iconContainer:{alignItems:"center",marginBottom:8},title:{fontSize:18,fontWeight:"600",color:((f=t==null?void 0:t.colors)==null?void 0:f.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"],textAlign:"center",marginBottom:8,marginTop:16},description:{fontSize:14,color:((h=t==null?void 0:t.colors)==null?void 0:h.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"],textAlign:"center",marginBottom:24,lineHeight:20},otpInput:{borderWidth:1,borderColor:c?((B=t==null?void 0:t.colors)==null?void 0:B.danger)||_chunkEI5LOD4Yjs.a["cm-danger"]:((C=t==null?void 0:t.colors)==null?void 0:C.border)||_chunkEI5LOD4Yjs.a["cm-border"],borderRadius:(t==null?void 0:t.borderRadius)||12,backgroundColor:((S=t==null?void 0:t.colors)==null?void 0:S.inputBackground)||_chunkEI5LOD4Yjs.a["cm-muted-primary"],padding:16,fontSize:16,color:((I=t==null?void 0:t.colors)==null?void 0:I.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"],marginBottom:16,textAlign:"center"},errorText:{fontSize:14,color:((P=t==null?void 0:t.colors)==null?void 0:P.danger)||_chunkEI5LOD4Yjs.a["cm-danger"],textAlign:"center",marginBottom:16},helpText:{fontSize:12,color:((k=t==null?void 0:t.colors)==null?void 0:k.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"],textAlign:"center",marginBottom:16,lineHeight:16},submitButton:{backgroundColor:((R=t==null?void 0:t.colors)==null?void 0:R.accent)||_chunkEI5LOD4Yjs.a["cm-accent"],paddingVertical:16,paddingHorizontal:32,borderRadius:(t==null?void 0:t.borderRadius)||12,alignItems:"center",marginBottom:16},submitButtonDisabled:{opacity:.6},submitButtonText:{fontSize:16,fontWeight:"500",color:((z=t==null?void 0:t.colors)==null?void 0:z.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]},resendButton:{alignSelf:"center",paddingVertical:12,paddingHorizontal:16},resendButtonText:{fontSize:14,color:((w=t==null?void 0:t.colors)==null?void 0:w.accent)||_chunkEI5LOD4Yjs.a["cm-accent"],textAlign:"center"},resendButtonDisabled:{opacity:.6}});return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:i.container,children:[_jsxruntime.jsx.call(void 0, _reactnative.View,{style:i.iconContainer,children:H}),_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.title,children:L}),_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.description,children:F}),_jsxruntime.jsx.call(void 0, _reactnative.TextInput,{style:i.otpInput,placeholder:"Enter code",placeholderTextColor:((O=t==null?void 0:t.colors)==null?void 0:O.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"],value:r,onChangeText:l=>{x(l),d(null)},keyboardType:U,autoComplete:$,textContentType:q,editable:!s,maxLength:E}),c&&_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.errorText,children:c}),_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.helpText,children:N}),_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:[i.submitButton,(r.length===0||s)&&i.submitButtonDisabled],onPress:G,disabled:r.length===0||s,children:s?_jsxruntime.jsx.call(void 0, _reactnative.ActivityIndicator,{color:((v=t==null?void 0:t.colors)==null?void 0:v.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]}):_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.submitButtonText,children:"Submit"})}),y&&_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:[i.resendButton,m>0&&i.resendButtonDisabled],onPress:J,disabled:m>0||s,children:_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.resendButtonText,children:m>0?`Re-send code in ${m}s`:"Re-send code"})})]})}exports.a = a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEI5LOD4Yjs = require('./chunk-EI5LOD4Y.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _react = require('react');var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');function a({icon:H,title:L,description:F,helpText:N,onSubmitOTP:W,onResendCode:y,appearance:t,otpLength:E=9,keyboardType:U="default",autoComplete:$="one-time-code",textContentType:q="oneTimeCode"}){var f,h,B,C,S,I,P,k,R,z,w,O,v;let[r,x]=_react.useState.call(void 0, ""),[s,u]=_react.useState.call(void 0, !1),[c,d]=_react.useState.call(void 0, null),[m,T]=_react.useState.call(void 0, 0),G=()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){if(r.length!==0){u(!0),d(null);try{yield W(r),x("")}catch(l){console.error("Failed to verify OTP",l),d("Invalid code. Please try again.")}finally{u(!1)}}}),J=()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){if(!(m>0||!y)){u(!0),d(null);try{yield y(),T(60);let l=setInterval(()=>{T(A=>A<=1?(clearInterval(l),0):A-1)},1e3)}catch(l){console.error("Failed to resend OTP",l),d("Failed to resend code. Please try again.")}finally{u(!1)}}}),i=_reactnative.StyleSheet.create({container:{width:"100%"},iconContainer:{alignItems:"center",marginBottom:8},title:{fontSize:18,fontWeight:"600",color:((f=t==null?void 0:t.colors)==null?void 0:f.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"],textAlign:"center",marginBottom:8,marginTop:16},description:{fontSize:14,color:((h=t==null?void 0:t.colors)==null?void 0:h.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"],textAlign:"center",marginBottom:24,lineHeight:20},otpInput:{borderWidth:1,borderColor:c?((B=t==null?void 0:t.colors)==null?void 0:B.danger)||_chunkEI5LOD4Yjs.a["cm-danger"]:((C=t==null?void 0:t.colors)==null?void 0:C.border)||_chunkEI5LOD4Yjs.a["cm-border"],borderRadius:(t==null?void 0:t.borderRadius)||12,backgroundColor:((S=t==null?void 0:t.colors)==null?void 0:S.inputBackground)||_chunkEI5LOD4Yjs.a["cm-muted-primary"],padding:16,fontSize:16,color:((I=t==null?void 0:t.colors)==null?void 0:I.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"],marginBottom:16,textAlign:"center"},errorText:{fontSize:14,color:((P=t==null?void 0:t.colors)==null?void 0:P.danger)||_chunkEI5LOD4Yjs.a["cm-danger"],textAlign:"center",marginBottom:16},helpText:{fontSize:12,color:((k=t==null?void 0:t.colors)==null?void 0:k.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"],textAlign:"center",marginBottom:16,lineHeight:16},submitButton:{backgroundColor:((R=t==null?void 0:t.colors)==null?void 0:R.accent)||_chunkEI5LOD4Yjs.a["cm-accent"],paddingVertical:16,paddingHorizontal:32,borderRadius:(t==null?void 0:t.borderRadius)||12,alignItems:"center",marginBottom:16},submitButtonDisabled:{opacity:.6},submitButtonText:{fontSize:16,fontWeight:"500",color:((z=t==null?void 0:t.colors)==null?void 0:z.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]},resendButton:{alignSelf:"center",paddingVertical:12,paddingHorizontal:16},resendButtonText:{fontSize:14,color:((w=t==null?void 0:t.colors)==null?void 0:w.accent)||_chunkEI5LOD4Yjs.a["cm-accent"],textAlign:"center"},resendButtonDisabled:{opacity:.6}});return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:i.container,children:[_jsxruntime.jsx.call(void 0, _reactnative.View,{style:i.iconContainer,children:H}),_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.title,children:L}),_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.description,children:F}),_jsxruntime.jsx.call(void 0, _reactnative.TextInput,{style:i.otpInput,placeholder:"Enter code",placeholderTextColor:((O=t==null?void 0:t.colors)==null?void 0:O.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"],value:r,onChangeText:l=>{x(l),d(null)},keyboardType:U,autoComplete:$,textContentType:q,editable:!s,maxLength:E}),c&&_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.errorText,children:c}),_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.helpText,children:N}),_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:[i.submitButton,(r.length===0||s)&&i.submitButtonDisabled],onPress:G,disabled:r.length===0||s,children:s?_jsxruntime.jsx.call(void 0, _reactnative.ActivityIndicator,{color:((v=t==null?void 0:t.colors)==null?void 0:v.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]}):_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.submitButtonText,children:"Submit"})}),y&&_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:[i.resendButton,m>0&&i.resendButtonDisabled],onPress:J,disabled:m>0||s,children:_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:i.resendButtonText,children:m>0?`Re-send code in ${m}s`:"Re-send code"})})]})}exports.a = a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _react = require('react');var _reactnative = require('react-native');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _clientsigners = require('@crossmint/client-signers');var _walletssdk = require('@crossmint/wallets-sdk');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function j({appearance:K}){let{wallet:r}=_clientsdkreactbase.useWallet.call(void 0, ),{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),a=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),[c,w]=_react.useState.call(void 0, "");_react.useEffect.call(void 0, ()=>{if(i!=null)try{let e=_commonsdkbase.validateAPIKey.call(void 0, i.apiKey);if(e.isValid){let t=_clientsigners.environmentUrlConfig[e.environment];w(`${t}/export`)}}catch(e){console.error("Failed to get TEE URL:",e)}},[i]);let E=_react.useCallback.call(void 0, e=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){if(!(r==null||a.current==null||e.nativeEvent.loading))try{if(r.signer!=null&&_walletssdk.isExportableSignerAdapter.call(void 0, r.signer)){let t=new (0, _clientsdkrnwindow.WebViewParent)(a,{incomingEvents:_clientsigners.exportSignerOutboundEvents,outgoingEvents:_clientsigners.exportSignerInboundEvents});l.current=t,yield t.handshakeWithChild(),yield r.signer._exportPrivateKey(t)}}catch(t){console.error("Failed to export private key:",t),_reactnative.Alert.alert("Export Failed","Failed to export private key. Please try again.")}}),[r]),d=_react.useCallback.call(void 0, e=>{let{nativeEvent:t}=e;console.error("WebView error:",t),_reactnative.Alert.alert("Export Failed","Failed to load export interface. Please try again.")},[]),m=_react.useCallback.call(void 0, e=>{l.current&&l.current.handleMessage(e)},[]);return c===""||r==null||r.signer==null||!_walletssdk.isExportableSignerAdapter.call(void 0, r.signer)?null:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:n.webViewContainer,children:_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:a,source:{uri:c},style:n.webView,javaScriptEnabled:!0,domStorageEnabled:!0,onLoadEnd:E,onError:d,onHttpError:d,onMessage:m,startInLoadingState:!0,renderLoading:()=>_jsxruntime.jsx.call(void 0, _reactnative.View,{style:n.loadingContainer,children:_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:n.loadingText,children:"Loading..."})})})})}var n=_reactnative.StyleSheet.create({webViewContainer:{height:56,borderWidth:1,borderColor:"#E5E5E5",borderRadius:12,overflow:"hidden"},webView:{flex:1},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"#F5F5F5"},loadingText:{fontSize:16,color:"#666666"}});exports.a = j;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _react = require('react');var _reactnative = require('react-native');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _clientsigners = require('@crossmint/client-signers');var _walletssdk = require('@crossmint/wallets-sdk');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkrnwindow = require('@crossmint/client-sdk-rn-window');var _jsxruntime = require('react/jsx-runtime');function j({appearance:K}){let{wallet:r}=_clientsdkreactbase.useWallet.call(void 0, ),{crossmint:i}=_clientsdkreactbase.useCrossmint.call(void 0, ),a=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),[c,w]=_react.useState.call(void 0, "");_react.useEffect.call(void 0, ()=>{if(i!=null)try{let e=_commonsdkbase.validateAPIKey.call(void 0, i.apiKey);if(e.isValid){let t=_clientsigners.environmentUrlConfig[e.environment];w(`${t}/export`)}}catch(e){console.error("Failed to get TEE URL:",e)}},[i]);let E=_react.useCallback.call(void 0, e=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){if(!(r==null||a.current==null||e.nativeEvent.loading))try{if(r.signer!=null&&_walletssdk.isExportableSignerAdapter.call(void 0, r.signer)){let t=new (0, _clientsdkrnwindow.WebViewParent)(a,{incomingEvents:_clientsigners.exportSignerOutboundEvents,outgoingEvents:_clientsigners.exportSignerInboundEvents});l.current=t,yield t.handshakeWithChild(),yield r.signer._exportPrivateKey(t)}}catch(t){console.error("Failed to export private key:",t),_reactnative.Alert.alert("Export Failed","Failed to export private key. Please try again.")}}),[r]),d=_react.useCallback.call(void 0, e=>{let{nativeEvent:t}=e;console.error("WebView error:",t),_reactnative.Alert.alert("Export Failed","Failed to load export interface. Please try again.")},[]),m=_react.useCallback.call(void 0, e=>{l.current&&l.current.handleMessage(e)},[]);return c===""||r==null||r.signer==null||!_walletssdk.isExportableSignerAdapter.call(void 0, r.signer)?null:_jsxruntime.jsx.call(void 0, _reactnative.View,{style:n.webViewContainer,children:_jsxruntime.jsx.call(void 0, _clientsdkrnwindow.RNWebView,{ref:a,source:{uri:c},style:n.webView,javaScriptEnabled:!0,domStorageEnabled:!0,onLoadEnd:E,onError:d,onHttpError:d,onMessage:m,startInLoadingState:!0,renderLoading:()=>_jsxruntime.jsx.call(void 0, _reactnative.View,{style:n.loadingContainer,children:_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:n.loadingText,children:"Loading..."})})})})}var n=_reactnative.StyleSheet.create({webViewContainer:{height:56,borderWidth:1,borderColor:"#E5E5E5",borderRadius:12,overflow:"hidden"},webView:{flex:1},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"#F5F5F5"},loadingText:{fontSize:16,color:"#666666"}});exports.a = j;
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-7JGGPJBX.mjs";import{e}from"./chunk-4P5ABAFD.mjs";var r=e((P,I)=>{I.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABZ0lEQVR4AbTUC1LDMAwE0MDFgJMBJwNOBn4ZLyNcUuzSdroj67crxWnvtxt/qsBj03pr+CzgvzT/4m8EkCAjUsn4zy3ANrP+jcBDb31t9q6A39yNCLuMCGRCm1SS+MnX3NQ5Au+9+mKi3n9iInCSuFYgAh+dcNxg9HvZvIlAHlEuOwzeLOdctvMSIpCmOnEuGHnOqZu2EbABaIxI/HErNdOIgAaTsnnnCQDBf2+AGBkgBLEqmpj4NOoGmvI2uVyEBCMitrzJKIAghHlUY4xvGHAmfPgHOQqkyeQ2QJBYFUYKhlCnJuB/x38TUFjJqshTS0YcUXM3scM/yCMBJFXEtMjEEcqBs5hckIH2AY4EFCsMgWLPWSw555Fc7gfOCShEQMS0fM+2ComdxV8CaTZtRMSqkJwNQY7PGm6bFdCg0WUSAjFC4I7Adny5/Te1IqAJCEEVMy3Isx6rmqUNNI9AAgiBKEtkr/0CAAD//0s8Y9YAAAAGSURBVAMAIbpVMfA3cdgAAAAASUVORK5CYII="});import{jsx as i}from"react/jsx-runtime";function t({size:p=22,color:c,strokeWidth:n=2}){return i(o,{source:r(),size:p,color:c})}export{t as a};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-42PSUTXE.mjs";import{a as e}from"./chunk-4P5ABAFD.mjs";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVASK7FQjs = require('./chunk-TVASK7FQ.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var r=_chunkIJN37RF2js.e.call(void 0, (t,c)=>{c.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABMElEQVR4AezRy20CMRAGYJQiUkcuSQu5pNxc0kJySR1Uwf+hNQ+tx14hIS4gDzue/7UML7s7f54B0wU/bEW/eTX1mufs4OCqFXf0C97D/k4xyKN7YDi4XUIV8BX2X4qQAaNcr44ZDAeX5orgUgXsAxIQMmDEMOPj0ZvBcHBpjuDlVxWAQ0DIgBFDxkpvBsPBpVnVKACZkAEjhj8ZKr0ZDCfj/pkFUDFg9J/L21J6M1hG9dkSUKs3IFsC2s69vTdXev8DbBgzC2DAqO38M27K/s1gOBn3zyiAkAEjhm3n9q43g+HgdhOqAAJCBowYMm4mejMYDi5Nw0/PKoCAkAEjhifR0pjBcHBpFuj8qAIwCBkwcu8VDAe3h++qgI+wFYO0w4ODq1bEKmBFvHXwDJhu7gAAAP//FX4TdAAAAAZJREFUAwAkFUAxInh9owAAAABJRU5ErkJggg=="});var _jsxruntime = require('react/jsx-runtime');function s({size:p=16,color:n,strokeWidth:I=2}){return _jsxruntime.jsx.call(void 0, _chunkTVASK7FQjs.a,{source:r(),size:p,color:n})}exports.a = s;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVASK7FQjs = require('./chunk-TVASK7FQ.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var r=_chunkIJN37RF2js.e.call(void 0, (s,i)=>{i.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABPElEQVR4AdzVW1ICMRCF4ajL8FnXoetwLZZaLkzX4VpU6C+kh2Go4RZ4gcrJpZP+TxJCcVsu/Lkug/e4rb/QolO/kY8VTSl5RQJvEclxdE8ud5GJhTkYvEZQeYzqplMYgSiVmTvO9sVMp+5bfmXWqgU0w9EMTpBr+RrnTQ3MMfFFW2x8iJ5ikRy50V2XqcFzTH2EFIv3mQDbMcn5jgojmlWZGlgAOjaxM7FVxroWA2YiKgccw7hqalCDUUn2miTFsORpwAhYzBwgsBzjDc0Z5CJJYxNgYmINMDEx3tI+AwlMxqcBYyqmb82sDjHI5DSyY/2M72yPMdgJmpu8HoP/dsSH1vY0yajMvKLPRvyJ1g+rRxiBKZWZBl6Fp1ddzXYIAwtz+D/AE/Bn4X33CAMLc8OgBs5d5RWdmzvwlgAAAP//5FxmQQAAAAZJREFUAwDOiFAxJLPlDQAAAABJRU5ErkJggg=="});var _jsxruntime = require('react/jsx-runtime');function f({size:I=22,color:c,strokeWidth:p=2}){return _jsxruntime.jsx.call(void 0, _chunkTVASK7FQjs.a,{source:r(),size:I,color:c})}exports.a = f;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,2 @@
1
+ import{a as T}from"./chunk-NG4FYS2Z.mjs";import{a as k}from"./chunk-WDMEQNBX.mjs";import{a as f}from"./chunk-C7S2X5RD.mjs";import{a as C}from"./chunk-J62V5BQX.mjs";import{a as w}from"./chunk-TSRZEXRU.mjs";import{a as e}from"./chunk-7USVT6EZ.mjs";import{View as l,Modal as M,StyleSheet as R,Dimensions as B,TouchableOpacity as E,Text as x}from"react-native";import{jsx as t,jsxs as I}from"react/jsx-runtime";var{width:z}=B.get("window");function X({email:i,open:n,setOpen:S,step:O,onSubmitOTP:v,onResendOTPCode:P,onSubmitEmail:V,rejectRef:r,appearance:o}){var m,u,c,g,b,h;function s(){var y;n&&((y=r.current)==null||y.call(r,new Error),S(!1))}let d=R.create({centeredView:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:16},modalView:{backgroundColor:((m=o==null?void 0:o.colors)==null?void 0:m.background)||e["cm-background-primary"],borderRadius:(o==null?void 0:o.borderRadius)||12,padding:32,alignItems:"center",width:Math.min(z-32,400),maxHeight:"80%",position:"relative",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:5},closeButton:{position:"absolute",top:16,right:16,width:32,height:32,borderRadius:6,backgroundColor:((u=o==null?void 0:o.colors)==null?void 0:u.inputBackground)||e["cm-muted-primary"],alignItems:"center",justifyContent:"center",zIndex:1}});return n?t(M,{visible:n,transparent:!0,animationType:"fade",onRequestClose:s,statusBarTranslucent:!0,children:t(l,{style:d.centeredView,children:I(l,{style:d.modalView,children:[t(E,{style:d.closeButton,onPress:s,hitSlop:{top:10,bottom:10,left:10,right:10},children:t(w,{size:16,color:((c=o==null?void 0:o.colors)==null?void 0:c.textSecondary)||e["cm-text-secondary"]})}),O==="initial"?t(k,{contactInfo:i!=null?i:"",contactType:"email",icon:t(C,{size:22,color:((g=o==null?void 0:o.colors)==null?void 0:g.textPrimary)||e["cm-text-primary"]}),onConfirm:V,onCancel:s,appearance:o}):t(T,{contactInfo:i!=null?i:"",contactType:"email",icon:t(l,{style:{backgroundColor:((b=o==null?void 0:o.colors)==null?void 0:b.accent)||e["cm-accent"],borderRadius:999,padding:12},children:t(f,{size:22,color:((h=o==null?void 0:o.colors)==null?void 0:h.background)||e["cm-background-primary"]})}),title:"Check your email",description:I(x,{children:["A temporary login code has been sent to"," ",t(x,{style:{fontWeight:"bold"},children:i})]}),helpText:`Can't find the email? Check spam folder.
2
+ Some emails may take several minutes to arrive.`,onSubmitOTP:v,onResendCode:P,appearance:o,otpLength:9,keyboardType:"default",autoComplete:"one-time-code",textContentType:"oneTimeCode"})]})})}):null}export{X as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVASK7FQjs = require('./chunk-TVASK7FQ.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var r=_chunkIJN37RF2js.e.call(void 0, (f,c)=>{c.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABV0lEQVR4AdzUXVKDQBAEYPRi6snUk+nNdL4pmiIEE5DkJSl6l52Z7t4/8jzc+fdYBq+1W1+Fn4Og8VEa/WSLBCSYdOJAQ+O9+PohBi8V8HxW83QQNEpiYDIZtJvoDfA9arRmVjDG2tV2Zby3x7XVE29pIGFpDlqx8RaYLQ7uSf3S4K2y8z28ZkLYjKGog+2hMeS3NFBAdG5iZmLhpBcjzEQMhzgN48bSoIPVILtNSDWczoYYEM52EFSLo/YEfxmkCGluQhiYEDZjSP1Zf80AgYkZxoiwd8Le1SwhD9N3sCxYG8eIsPe1msTkYZdByLv6LVu0S3Asdk53WwFxl6C9soIcVrt2ZlujHlIdcXodj0GfeFW52z6sS2hi1Xr8C+MQBjMn7iLIT4csyETfiY0NIRzC4F1somcFAmYm6c5fgjr1AU4m5z3x7ucGHfhnw/RMnNatDGit4hcAAP//I+bVpgAAAAZJREFUAwC4slUxPmyOTgAAAABJRU5ErkJggg=="});var _jsxruntime = require('react/jsx-runtime');function b({size:i=22,color:n,strokeWidth:t=2}){return _jsxruntime.jsx.call(void 0, _chunkTVASK7FQjs.a,{source:r(),size:i,color:n})}exports.a = b;
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-7JGGPJBX.mjs";import{e as i}from"./chunk-4P5ABAFD.mjs";var r=i((t,c)=>{c.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABMElEQVR4AezRy20CMRAGYJQiUkcuSQu5pNxc0kJySR1Uwf+hNQ+tx14hIS4gDzue/7UML7s7f54B0wU/bEW/eTX1mufs4OCqFXf0C97D/k4xyKN7YDi4XUIV8BX2X4qQAaNcr44ZDAeX5orgUgXsAxIQMmDEMOPj0ZvBcHBpjuDlVxWAQ0DIgBFDxkpvBsPBpVnVKACZkAEjhj8ZKr0ZDCfj/pkFUDFg9J/L21J6M1hG9dkSUKs3IFsC2s69vTdXev8DbBgzC2DAqO38M27K/s1gOBn3zyiAkAEjhm3n9q43g+HgdhOqAAJCBowYMm4mejMYDi5Nw0/PKoCAkAEjhifR0pjBcHBpFuj8qAIwCBkwcu8VDAe3h++qgI+wFYO0w4ODq1bEKmBFvHXwDJhu7gAAAP//FX4TdAAAAAZJREFUAwAkFUAxInh9owAAAABJRU5ErkJggg=="});import{jsx as e}from"react/jsx-runtime";function u({size:p=16,color:n,strokeWidth:I=2}){return e(o,{source:r(),size:p,color:n})}export{u as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');function P({source:o,size:e=22,color:r}){return _jsxruntime.jsx.call(void 0, _reactnative.Image,{source:typeof o=="string"?{uri:o}:o,resizeMode:"contain",style:{width:e,height:e,tintColor:r}})}exports.a = P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _exposecurestore = require('expo-secure-store'); var e = _interopRequireWildcard(_exposecurestore);var i=class{get(t){return _chunkJ42HASCIjs.e.call(void 0, this,null,function*(){try{let r=yield e.getItemAsync(t);if(!r)return;try{let o=JSON.parse(r);if(o.expiresAt&&new Date(o.expiresAt)<new Date){yield this.remove(t);return}return o.value}catch(o){return r}}catch(r){console.error("Error reading from SecureStore:",r);return}})}set(t,r,o){return _chunkJ42HASCIjs.e.call(void 0, this,null,function*(){try{if(o){let s=JSON.stringify({value:r,expiresAt:o});yield e.setItemAsync(t,s)}else yield e.setItemAsync(t,r)}catch(s){console.error("Error writing to SecureStore:",s)}})}remove(t){return _chunkJ42HASCIjs.e.call(void 0, this,null,function*(){try{yield e.deleteItemAsync(t)}catch(r){console.error("Error removing from SecureStore:",r)}})}isAvailable(){return _chunkJ42HASCIjs.e.call(void 0, this,null,function*(){try{return yield e.isAvailableAsync()}catch(t){return!1}})}};exports.a = i;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _exposecurestore = require('expo-secure-store'); var e = _interopRequireWildcard(_exposecurestore);var i=class{get(t){return _chunkIJN37RF2js.f.call(void 0, this,null,function*(){try{let r=yield e.getItemAsync(t);if(!r)return;try{let o=JSON.parse(r);if(o.expiresAt&&new Date(o.expiresAt)<new Date){yield this.remove(t);return}return o.value}catch(o){return r}}catch(r){console.error("Error reading from SecureStore:",r);return}})}set(t,r,o){return _chunkIJN37RF2js.f.call(void 0, this,null,function*(){try{if(o){let s=JSON.stringify({value:r,expiresAt:o});yield e.setItemAsync(t,s)}else yield e.setItemAsync(t,r)}catch(s){console.error("Error writing to SecureStore:",s)}})}remove(t){return _chunkIJN37RF2js.f.call(void 0, this,null,function*(){try{yield e.deleteItemAsync(t)}catch(r){console.error("Error removing from SecureStore:",r)}})}isAvailable(){return _chunkIJN37RF2js.f.call(void 0, this,null,function*(){try{return yield e.isAvailableAsync()}catch(t){return!1}})}};exports.a = i;
@@ -1 +1 @@
1
- import{a as i}from"./chunk-7USVT6EZ.mjs";import{e as w}from"./chunk-PSSAAY7D.mjs";import{useState as P}from"react";import{View as d,Text as n,TouchableOpacity as k,StyleSheet as W,ActivityIndicator as H}from"react-native";import{jsx as r,jsxs as s}from"react/jsx-runtime";function N({contactInfo:I,contactType:e,icon:v,onConfirm:z,onCancel:R,appearance:t}){var u,g,f,b,x,C,h,T,S,B;let[l,m]=P(!1),[c,y]=P(null),V=()=>w(this,null,function*(){m(!0),y(null);try{yield z()}catch(A){console.error(`Failed to send ${e} code`,A),y(`Failed to send ${e==="email"?"email":"SMS"}. Please try again.`)}finally{m(!1)}}),o=W.create({container:{width:"100%"},title:{fontSize:24,fontWeight:"600",color:((u=t==null?void 0:t.colors)==null?void 0:u.textPrimary)||i["cm-text-primary"],textAlign:"center",marginBottom:8},description:{fontSize:16,color:((g=t==null?void 0:t.colors)==null?void 0:g.textSecondary)||i["cm-text-secondary"],textAlign:"center",marginBottom:24,lineHeight:22},contactContainer:{borderWidth:1,borderColor:((f=t==null?void 0:t.colors)==null?void 0:f.border)||i["cm-border"],borderRadius:(t==null?void 0:t.borderRadius)||12,padding:16,marginBottom:24,flexDirection:"row",alignItems:"center"},contactText:{fontSize:16,color:((b=t==null?void 0:t.colors)==null?void 0:b.textPrimary)||i["cm-text-primary"],marginLeft:12,flex:1},errorText:{fontSize:14,color:((x=t==null?void 0:t.colors)==null?void 0:x.danger)||i["cm-danger"],textAlign:"center",marginBottom:16},buttonContainer:{flexDirection:"row",gap:12},button:{flex:1,paddingVertical:16,paddingHorizontal:24,borderRadius:999,alignItems:"center",justifyContent:"center",minHeight:52},primaryButton:{backgroundColor:((C=t==null?void 0:t.colors)==null?void 0:C.accent)||i["cm-accent"]},secondaryButton:{backgroundColor:"transparent",borderWidth:1,borderColor:((h=t==null?void 0:t.colors)==null?void 0:h.border)||i["cm-border"]},disabledButton:{opacity:.6},buttonText:{fontSize:16,fontWeight:"500",color:((T=t==null?void 0:t.colors)==null?void 0:T.background)||i["cm-background-primary"]},secondaryButtonText:{color:((S=t==null?void 0:t.colors)==null?void 0:S.textPrimary)||i["cm-text-primary"]}});return s(d,{style:o.container,children:[r(n,{style:o.title,children:"Confirm it's you"}),s(n,{style:o.description,children:["You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code",e==="phone"?" via SMS":"","."]}),s(d,{style:o.contactContainer,children:[v,r(n,{style:o.contactText,children:I})]}),c&&r(n,{style:o.errorText,children:c}),s(d,{style:o.buttonContainer,children:[r(k,{style:[o.button,o.secondaryButton],onPress:R,disabled:l,children:r(n,{style:[o.buttonText,o.secondaryButtonText],children:"Cancel"})}),r(k,{style:[o.button,o.primaryButton,l&&o.disabledButton],onPress:V,disabled:l,children:l?r(H,{color:((B=t==null?void 0:t.colors)==null?void 0:B.background)||i["cm-background-primary"]}):r(n,{style:o.buttonText,children:"Send code"})})]})]})}export{N as a};
1
+ import{a as i}from"./chunk-7USVT6EZ.mjs";import{f as w}from"./chunk-4P5ABAFD.mjs";import{useState as P}from"react";import{View as d,Text as n,TouchableOpacity as k,StyleSheet as W,ActivityIndicator as H}from"react-native";import{jsx as r,jsxs as s}from"react/jsx-runtime";function N({contactInfo:I,contactType:e,icon:v,onConfirm:z,onCancel:R,appearance:t}){var u,g,f,b,x,C,h,T,S,B;let[l,m]=P(!1),[c,y]=P(null),V=()=>w(this,null,function*(){m(!0),y(null);try{yield z()}catch(A){console.error(`Failed to send ${e} code`,A),y(`Failed to send ${e==="email"?"email":"SMS"}. Please try again.`)}finally{m(!1)}}),o=W.create({container:{width:"100%"},title:{fontSize:24,fontWeight:"600",color:((u=t==null?void 0:t.colors)==null?void 0:u.textPrimary)||i["cm-text-primary"],textAlign:"center",marginBottom:8},description:{fontSize:16,color:((g=t==null?void 0:t.colors)==null?void 0:g.textSecondary)||i["cm-text-secondary"],textAlign:"center",marginBottom:24,lineHeight:22},contactContainer:{borderWidth:1,borderColor:((f=t==null?void 0:t.colors)==null?void 0:f.border)||i["cm-border"],borderRadius:(t==null?void 0:t.borderRadius)||12,padding:16,marginBottom:24,flexDirection:"row",alignItems:"center"},contactText:{fontSize:16,color:((b=t==null?void 0:t.colors)==null?void 0:b.textPrimary)||i["cm-text-primary"],marginLeft:12,flex:1},errorText:{fontSize:14,color:((x=t==null?void 0:t.colors)==null?void 0:x.danger)||i["cm-danger"],textAlign:"center",marginBottom:16},buttonContainer:{flexDirection:"row",gap:12},button:{flex:1,paddingVertical:16,paddingHorizontal:24,borderRadius:999,alignItems:"center",justifyContent:"center",minHeight:52},primaryButton:{backgroundColor:((C=t==null?void 0:t.colors)==null?void 0:C.accent)||i["cm-accent"]},secondaryButton:{backgroundColor:"transparent",borderWidth:1,borderColor:((h=t==null?void 0:t.colors)==null?void 0:h.border)||i["cm-border"]},disabledButton:{opacity:.6},buttonText:{fontSize:16,fontWeight:"500",color:((T=t==null?void 0:t.colors)==null?void 0:T.background)||i["cm-background-primary"]},secondaryButtonText:{color:((S=t==null?void 0:t.colors)==null?void 0:S.textPrimary)||i["cm-text-primary"]}});return s(d,{style:o.container,children:[r(n,{style:o.title,children:"Confirm it's you"}),s(n,{style:o.description,children:["You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code",e==="phone"?" via SMS":"","."]}),s(d,{style:o.contactContainer,children:[v,r(n,{style:o.contactText,children:I})]}),c&&r(n,{style:o.errorText,children:c}),s(d,{style:o.buttonContainer,children:[r(k,{style:[o.button,o.secondaryButton],onPress:R,disabled:l,children:r(n,{style:[o.buttonText,o.secondaryButtonText],children:"Cancel"})}),r(k,{style:[o.button,o.primaryButton,l&&o.disabledButton],onPress:V,disabled:l,children:l?r(H,{color:((B=t==null?void 0:t.colors)==null?void 0:B.background)||i["cm-background-primary"]}):r(n,{style:o.buttonText,children:"Send code"})})]})]})}export{N as a};
@@ -0,0 +1 @@
1
+ import{a as A}from"./chunk-7LYLPKBG.mjs";import{a as _}from"./chunk-S6RE3WT5.mjs";import{a as H}from"./chunk-E5RFE3I6.mjs";import{a as W,b as G,f as b}from"./chunk-4P5ABAFD.mjs";import{useCallback as S,useRef as g,useMemo as E,useEffect as K,useState as ee,useContext as re}from"react";import{Platform as ne,View as te}from"react-native";import{RNWebView as ae,WebViewParent as oe}from"@crossmint/client-sdk-rn-window";import{environmentUrlConfig as z,signerInboundEvents as se,signerOutboundEvents as ie,SignerErrorCode as ce}from"@crossmint/client-signers";import{validateAPIKey as le}from"@crossmint/common-sdk-base";import{CrossmintWalletBaseProvider as ue,CrossmintWalletBaseContext as B,useCrossmint as de}from"@crossmint/client-sdk-react-base";import{NativeDeviceSignerKeyStorage as we}from"@crossmint/expo-device-signer";import{useLogger as fe}from"@crossmint/client-sdk-react-base";import{Fragment as he,jsx as p,jsxs as j}from"react/jsx-runtime";var L="Passkey signers are not supported in React Native. Use a different signer type such as 'email', 'phone', or 'device'.";function ve(c){var i,v;return c==null?!1:!!(((i=c.recovery)==null?void 0:i.type)==="passkey"||(v=c.signers)!=null&&v.some(m=>m.type==="passkey"))}function me({children:c}){let i=re(B),v=S(d=>b(this,null,function*(){var R,I;if(((R=d.recovery)==null?void 0:R.type)==="passkey"||(I=d.signers)!=null&&I.some(r=>r.type==="passkey"))throw new Error(L);return i.createWallet(d)}),[i.createWallet]),m=S(d=>b(this,null,function*(){throw new Error(L)}),[]),V=E(()=>G(W({},i),{createWallet:v,createPasskeySigner:m}),[i,v,m]);return p(B.Provider,{value:V,children:c})}function pe({children:c,createOnLogin:i,appearance:v,showOtpSignerPrompt:m=!0,callbacks:V,deviceSignerKeyStorage:d}){let R=E(()=>d!=null?d:new we,[]),{crossmint:I}=de("CrossmintWalletProvider must be used within CrossmintProvider"),r=fe(A),{apiKey:N,appId:O}=I,D=E(()=>{let e=le(N);if(!e.isValid)throw new Error("Invalid API key");return e},[N]),F=E(()=>z[D.environment],[D.environment]),y=g(null),t=g(null),[T,J]=ee(!1),C=g(!1),l=g(!1),s=g(0),M=g(0),Y=E(()=>O!=null?{crossmintAppId:O}:{},[O]),w=S(e=>b(this,null,function*(){if(t.current!=null){let n=t.current;if(l.current){r.info("react-native.wallet.webview.handshake.skip.in-progress",{trigger:e,generation:s.current});return}if(C.current&&n.isConnected){r.info("react-native.wallet.webview.handshake.skip.already-connected",{trigger:e,generation:s.current});return}l.current=!0;let a=Date.now();M.current=a;let o=s.current;try{r.info("react-native.wallet.webview.handshake.start",{trigger:e,generation:o,platform:ne.OS}),C.current=!0,n.isConnected=!1,yield n.handshakeWithChild();let u=Date.now()-a;r.info("react-native.wallet.webview.handshake.success",{trigger:e,generation:o,durationMs:u})}catch(u){let f=Date.now()-a;o===s.current&&(C.current=!1),r.error("react-native.wallet.webview.handshake.error",{trigger:e,generation:o,durationMs:f,error:u instanceof Error?u.message:String(u)}),console.error("[CrossmintWalletProvider] Handshake error:",u)}finally{o===s.current&&(l.current=!1)}}else r.warn("react-native.wallet.webview.handshake.skip",{trigger:e,reason:"parent not initialized"})}),[r]);K(()=>{y.current!=null&&t.current==null&&(r.info("react-native.wallet.webview.initializing"),t.current=new oe(y,{incomingEvents:ie,outgoingEvents:se,handshakeOptions:{timeoutMs:3e4,intervalMs:100},recovery:{recoverableErrorCodes:[ce.IndexedDbFatal]}}),r.info("react-native.wallet.webview.initialized"),w("eager"))},[T,r,w]);let $=S(()=>b(this,null,function*(){var e,n;r.info("react-native.wallet.webview.onLoadEnd",{handshakeInProgress:l.current,isConnected:(n=(e=t.current)==null?void 0:e.isConnected)!=null?n:!1,generation:s.current}),yield w("onLoadEnd")}),[r,w]),q=S(e=>{var o,u;let n=t.current;if(n==null)return;let a=e.nativeEvent.data;if(a==="frame-ready"){r.info("react-native.wallet.webview.frame-ready.received",{handshakeInProgress:l.current,isConnected:(u=(o=t.current)==null?void 0:o.isConnected)!=null?u:!1,generation:s.current,msSinceHandshakeStart:M.current>0?Date.now()-M.current:null}),w("frame-ready");return}try{let f=JSON.parse(a);if(f&&typeof f.type=="string"&&f.type.startsWith("console.")){let x=f.type.split(".")[1],U=(f.data||[]).map(h=>{try{return h==="[Function]"||h==="[Circular Reference]"||h==="[Unserializable Object]"?h:JSON.parse(h)}catch(be){return h}}),k=`react-native.wallet.webview.console.${x}`,P={webview_args:U};switch(x){case"log":r.info(k,P);break;case"error":r.error(k,P);break;case"warn":r.warn(k,P);break;case"info":r.info(k,P);break;case"debug":r.debug(k,P);break;default:r.info("react-native.wallet.webview.console.unknown",{webview_method:x,webview_args:U})}return}}catch(f){}n.handleMessage(e)},[r,w]),Q=()=>{if(t.current==null)throw new Error("WebView not ready or handshake incomplete");return t.current},X=({emailSignerProps:e,phoneSignerProps:n})=>m?j(he,{children:[p(_,W({},e)),p(H,W({},n))]}):null,Z=()=>b(this,null,function*(){r.info("react-native.wallet.webview.init.start"),J(!0);let e=0,n=100;for(;t.current==null&&e<n;)yield new Promise(a=>setTimeout(a,50)),e++;if(t.current==null)throw r.error("react-native.wallet.webview.init.timeout",{attempts:e}),new Error("WebView not ready or handshake incomplete");r.info("react-native.wallet.webview.init.success",{attempts:e})});return K(()=>{if(ve(i))throw new Error(L)},[i]),j(ue,{createOnLogin:i,appearance:v,showOtpSignerPrompt:m,initializeWebView:Z,callbacks:V,renderUI:X,clientTEEConnection:Q,deviceSignerKeyStorage:R,children:[p(me,{children:c}),T&&p(te,{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:p(ae,{ref:y,source:{uri:F},globals:Y,onLoadEnd:$,onMessage:q,onError:e=>{console.error("[CrossmintWalletProvider] WebView error:",e.nativeEvent)},onHttpError:e=>{console.error("[CrossmintWalletProvider] WebView HTTP error:",e.nativeEvent)},onContentProcessDidTerminate:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.terminated",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},onRenderProcessGone:()=>{var n,a,o;let e=s.current;s.current++,r.warn("react-native.wallet.webview.process.renderGone",{prevGeneration:e,newGeneration:s.current,wasConnected:(a=(n=t.current)==null?void 0:n.isConnected)!=null?a:!1,hadHandshakeInProgress:l.current}),C.current=!1,l.current=!1,t.current!=null&&(t.current.isConnected=!1),(o=y.current)==null||o.reload(),w("eager")},style:{width:1,height:1},javaScriptCanOpenWindowsAutomatically:!1,thirdPartyCookiesEnabled:!1,sharedCookiesEnabled:!1,incognito:!1,setSupportMultipleWindows:!1,originWhitelist:[z[D.environment]],cacheEnabled:!0,cacheMode:"LOAD_DEFAULT"})})]})}function Me(c){return p(pe,W({},c))}export{Me as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEI5LOD4Yjs = require('./chunk-EI5LOD4Y.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _react = require('react');var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');function M({contactInfo:I,contactType:e,icon:v,onConfirm:z,onCancel:R,appearance:t}){var u,g,f,b,x,C,h,T,S,B;let[l,m]=_react.useState.call(void 0, !1),[c,y]=_react.useState.call(void 0, null),V=()=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){m(!0),y(null);try{yield z()}catch(A){console.error(`Failed to send ${e} code`,A),y(`Failed to send ${e==="email"?"email":"SMS"}. Please try again.`)}finally{m(!1)}}),o=_reactnative.StyleSheet.create({container:{width:"100%"},title:{fontSize:24,fontWeight:"600",color:((u=t==null?void 0:t.colors)==null?void 0:u.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"],textAlign:"center",marginBottom:8},description:{fontSize:16,color:((g=t==null?void 0:t.colors)==null?void 0:g.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"],textAlign:"center",marginBottom:24,lineHeight:22},contactContainer:{borderWidth:1,borderColor:((f=t==null?void 0:t.colors)==null?void 0:f.border)||_chunkEI5LOD4Yjs.a["cm-border"],borderRadius:(t==null?void 0:t.borderRadius)||12,padding:16,marginBottom:24,flexDirection:"row",alignItems:"center"},contactText:{fontSize:16,color:((b=t==null?void 0:t.colors)==null?void 0:b.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"],marginLeft:12,flex:1},errorText:{fontSize:14,color:((x=t==null?void 0:t.colors)==null?void 0:x.danger)||_chunkEI5LOD4Yjs.a["cm-danger"],textAlign:"center",marginBottom:16},buttonContainer:{flexDirection:"row",gap:12},button:{flex:1,paddingVertical:16,paddingHorizontal:24,borderRadius:999,alignItems:"center",justifyContent:"center",minHeight:52},primaryButton:{backgroundColor:((C=t==null?void 0:t.colors)==null?void 0:C.accent)||_chunkEI5LOD4Yjs.a["cm-accent"]},secondaryButton:{backgroundColor:"transparent",borderWidth:1,borderColor:((h=t==null?void 0:t.colors)==null?void 0:h.border)||_chunkEI5LOD4Yjs.a["cm-border"]},disabledButton:{opacity:.6},buttonText:{fontSize:16,fontWeight:"500",color:((T=t==null?void 0:t.colors)==null?void 0:T.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]},secondaryButtonText:{color:((S=t==null?void 0:t.colors)==null?void 0:S.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"]}});return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:o.container,children:[_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:o.title,children:"Confirm it's you"}),_jsxruntime.jsxs.call(void 0, _reactnative.Text,{style:o.description,children:["You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code",e==="phone"?" via SMS":"","."]}),_jsxruntime.jsxs.call(void 0, _reactnative.View,{style:o.contactContainer,children:[v,_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:o.contactText,children:I})]}),c&&_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:o.errorText,children:c}),_jsxruntime.jsxs.call(void 0, _reactnative.View,{style:o.buttonContainer,children:[_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:[o.button,o.secondaryButton],onPress:R,disabled:l,children:_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:[o.buttonText,o.secondaryButtonText],children:"Cancel"})}),_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:[o.button,o.primaryButton,l&&o.disabledButton],onPress:V,disabled:l,children:l?_jsxruntime.jsx.call(void 0, _reactnative.ActivityIndicator,{color:((B=t==null?void 0:t.colors)==null?void 0:B.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]}):_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:o.buttonText,children:"Send code"})})]})]})}exports.a = M;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEI5LOD4Yjs = require('./chunk-EI5LOD4Y.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _react = require('react');var _reactnative = require('react-native');var _jsxruntime = require('react/jsx-runtime');function M({contactInfo:I,contactType:e,icon:v,onConfirm:z,onCancel:R,appearance:t}){var u,g,f,b,x,C,h,T,S,B;let[l,m]=_react.useState.call(void 0, !1),[c,y]=_react.useState.call(void 0, null),V=()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){m(!0),y(null);try{yield z()}catch(A){console.error(`Failed to send ${e} code`,A),y(`Failed to send ${e==="email"?"email":"SMS"}. Please try again.`)}finally{m(!1)}}),o=_reactnative.StyleSheet.create({container:{width:"100%"},title:{fontSize:24,fontWeight:"600",color:((u=t==null?void 0:t.colors)==null?void 0:u.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"],textAlign:"center",marginBottom:8},description:{fontSize:16,color:((g=t==null?void 0:t.colors)==null?void 0:g.textSecondary)||_chunkEI5LOD4Yjs.a["cm-text-secondary"],textAlign:"center",marginBottom:24,lineHeight:22},contactContainer:{borderWidth:1,borderColor:((f=t==null?void 0:t.colors)==null?void 0:f.border)||_chunkEI5LOD4Yjs.a["cm-border"],borderRadius:(t==null?void 0:t.borderRadius)||12,padding:16,marginBottom:24,flexDirection:"row",alignItems:"center"},contactText:{fontSize:16,color:((b=t==null?void 0:t.colors)==null?void 0:b.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"],marginLeft:12,flex:1},errorText:{fontSize:14,color:((x=t==null?void 0:t.colors)==null?void 0:x.danger)||_chunkEI5LOD4Yjs.a["cm-danger"],textAlign:"center",marginBottom:16},buttonContainer:{flexDirection:"row",gap:12},button:{flex:1,paddingVertical:16,paddingHorizontal:24,borderRadius:999,alignItems:"center",justifyContent:"center",minHeight:52},primaryButton:{backgroundColor:((C=t==null?void 0:t.colors)==null?void 0:C.accent)||_chunkEI5LOD4Yjs.a["cm-accent"]},secondaryButton:{backgroundColor:"transparent",borderWidth:1,borderColor:((h=t==null?void 0:t.colors)==null?void 0:h.border)||_chunkEI5LOD4Yjs.a["cm-border"]},disabledButton:{opacity:.6},buttonText:{fontSize:16,fontWeight:"500",color:((T=t==null?void 0:t.colors)==null?void 0:T.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]},secondaryButtonText:{color:((S=t==null?void 0:t.colors)==null?void 0:S.textPrimary)||_chunkEI5LOD4Yjs.a["cm-text-primary"]}});return _jsxruntime.jsxs.call(void 0, _reactnative.View,{style:o.container,children:[_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:o.title,children:"Confirm it's you"}),_jsxruntime.jsxs.call(void 0, _reactnative.Text,{style:o.description,children:["You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code",e==="phone"?" via SMS":"","."]}),_jsxruntime.jsxs.call(void 0, _reactnative.View,{style:o.contactContainer,children:[v,_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:o.contactText,children:I})]}),c&&_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:o.errorText,children:c}),_jsxruntime.jsxs.call(void 0, _reactnative.View,{style:o.buttonContainer,children:[_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:[o.button,o.secondaryButton],onPress:R,disabled:l,children:_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:[o.buttonText,o.secondaryButtonText],children:"Cancel"})}),_jsxruntime.jsx.call(void 0, _reactnative.TouchableOpacity,{style:[o.button,o.primaryButton,l&&o.disabledButton],onPress:V,disabled:l,children:l?_jsxruntime.jsx.call(void 0, _reactnative.ActivityIndicator,{color:((B=t==null?void 0:t.colors)==null?void 0:B.background)||_chunkEI5LOD4Yjs.a["cm-background-primary"]}):_jsxruntime.jsx.call(void 0, _reactnative.Text,{style:o.buttonText,children:"Send code"})})]})]})}exports.a = M;
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-7JGGPJBX.mjs";import{e as I}from"./chunk-4P5ABAFD.mjs";var r=I((t,e)=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAxUlEQVR4AeyVbQrCQAxEqx5F9Gyi51E8m+JR/Ji3mIXQlM0PhUK3ZJZt8oa0oXTXw5+vqQZn9X1K76Rg8Qj3ETUAPAqLakqHAYsHrwMouIRuDhKx17JKClboYF72RVEDy90LkVuMNW91jRK18qNNb9AcZB9RH1FzAk1geV/RTTN5SOmY3Yj472/Tjy8weoOX8sSOJSljzVttUYPrt8q8s2cyLDbzsi+KGpxUuUijp1FuKmDx4HVM1AAAcKNN9kyGxSOLjw8AAAD//6BjmDAAAAAGSURBVAMAy+IoMbHLqDcAAAAASUVORK5CYII="});import{jsx as m}from"react/jsx-runtime";function u({size:n=22,color:p,strokeWidth:c=2}){return m(o,{source:r(),size:n,color:p})}export{u as a};
File without changes
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkSHTETN4Cjs = require('./chunk-SHTETN4C.js');var _chunkJ42HASCIjs = require('./chunk-J42HASCI.js');var _react = require('react');var _expowebbrowser = require('expo-web-browser'); var n = _interopRequireWildcard(_expowebbrowser);var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _reactnative = require('react-native');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');function U(){let r=_react.useContext.call(void 0, w);if(r==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return r}var _jsxruntime = require('react/jsx-runtime');var W={google:null,twitter:null},F={crossmintAuth:void 0,login:()=>{},logout:()=>_chunkJ42HASCIjs.e.call(void 0, void 0,null,function*(){}),jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},loginWithOAuth:()=>Promise.resolve(),createAuthSession:()=>Promise.resolve(null)},w= exports.a =_react.createContext.call(void 0, F);function G({children:r}){let{setJwt:e}=_clientsdkreactbase.useCrossmint.call(void 0, ),{jwt:t}=U();return _react.useEffect.call(void 0, ()=>{e(t)},[e,t]),r}function V({children:r,appSchema:e}){let t=_clientsdkreactbase.useCrossmintAuthBase.call(void 0, ),[h,g]=_react.useState.call(void 0, W),[f,i]=_react.useState.call(void 0, !1),A=Array.isArray(e)?e[0]:e,P=_expoconstants2.default.executionEnvironment==="storeClient"||_expoconstants2.default.appOwnership==="expo"||!!_expoconstants2.default.expoVersion?"exp://127.0.0.1:8081":A,y=_react.useCallback.call(void 0, ()=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){try{let u=Object.keys(W).map(s=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){var m;let l=yield(m=t.crossmintAuth)==null?void 0:m.getOAuthUrl(s,{appSchema:P});return{[s]:l}})),a=Object.assign({},...yield Promise.all(u));g(a)}catch(o){console.error(o)}}),[t.crossmintAuth,P]);_react.useEffect.call(void 0, ()=>{t.user==null&&y()},[y,t.user]);let N=()=>t.status==="initializing"?"initializing":f?"in-progress":t.jwt!=null?"logged-in":"logged-out",E=o=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){var u,a;try{i(!0);let s=(a=h[o])!=null?a:yield(u=t.crossmintAuth)==null?void 0:u.getOAuthUrl(o,{appSchema:P});yield n.warmUpAsync();let l=new URL(s);if(o==="google"&&l.searchParams.append("provider_prompt","select_account"),_reactnative.Platform.OS==="android")yield n.openBrowserAsync(l.toString());else{let m=yield n.openAuthSessionAsync(l.toString());m.type==="success"&&(yield x(m.url))}yield n.coolDownAsync()}catch(s){throw console.error("[CrossmintAuthProvider] Error during OAuth login:",s),new Error(`Error during OAuth login: ${s}`)}finally{i(!1)}}),x=_react.useCallback.call(void 0, o=>_chunkJ42HASCIjs.e.call(void 0, this,null,function*(){var a;let u=o.includes("://")?_(o):o;if(u!=null)try{return i(!0),yield(a=t.crossmintAuth)==null?void 0:a.handleRefreshAuthMaterial(u)}catch(s){throw s}finally{i(!1)}return null}),[t.crossmintAuth]);return _jsxruntime.jsx.call(void 0, w.Provider,{value:{crossmintAuth:t.crossmintAuth,logout:t.logout,jwt:t.jwt,user:t.user,status:N(),getUser:t.getUser,login:()=>{},loginWithOAuth:E,createAuthSession:x},children:_jsxruntime.jsx.call(void 0, G,{children:r})})}function ut(t){var h=t,{children:r}=h,e=_chunkJ42HASCIjs.d.call(void 0, h,["children"]);var i,A;let g=(A=e.appSchema)!=null?A:(i=_expoconstants2.default.expoConfig)==null?void 0:i.scheme,f=_react.useMemo.call(void 0, ()=>{var C;return(C=e.storageProvider)!=null?C:new _chunkSHTETN4Cjs.a},[e.storageProvider]);return _jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintAuthBaseProvider,{onLoginSuccess:e.onLoginSuccess,refreshRoute:e.refreshRoute,logoutRoute:e.logoutRoute,storageProvider:f,children:_jsxruntime.jsx.call(void 0, V,{appSchema:g,children:r})})}var _=r=>{let e=/[?&]oneTimeSecret=([^&#]+)/,t=r.match(e);return t?decodeURIComponent(t[1]):void 0};exports.a = w; exports.b = ut; exports.c = U; exports.d = _clientsdkreactbase.useCrossmint; exports.e = _clientsdkreactbase.useWallet; exports.f = _clientsdkreactbase.useWalletOtpSigner;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkU3CLRKGHjs = require('./chunk-U3CLRKGH.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _react = require('react');var _expowebbrowser = require('expo-web-browser'); var n = _interopRequireWildcard(_expowebbrowser);var _expoconstants = require('expo-constants'); var _expoconstants2 = _interopRequireDefault(_expoconstants);var _reactnative = require('react-native');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');function U(){let r=_react.useContext.call(void 0, w);if(r==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return r}var _jsxruntime = require('react/jsx-runtime');var W={google:null,twitter:null},F={crossmintAuth:void 0,login:()=>{},logout:()=>_chunkIJN37RF2js.f.call(void 0, void 0,null,function*(){}),jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},loginWithOAuth:()=>Promise.resolve(),createAuthSession:()=>Promise.resolve(null)},w= exports.a =_react.createContext.call(void 0, F);function G({children:r}){let{setJwt:e}=_clientsdkreactbase.useCrossmint.call(void 0, ),{jwt:t}=U();return _react.useEffect.call(void 0, ()=>{e(t)},[e,t]),r}function V({children:r,appSchema:e}){let t=_clientsdkreactbase.useCrossmintAuthBase.call(void 0, ),[h,g]=_react.useState.call(void 0, W),[f,i]=_react.useState.call(void 0, !1),A=Array.isArray(e)?e[0]:e,P=_expoconstants2.default.executionEnvironment==="storeClient"||_expoconstants2.default.appOwnership==="expo"||!!_expoconstants2.default.expoVersion?"exp://127.0.0.1:8081":A,y=_react.useCallback.call(void 0, ()=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){try{let u=Object.keys(W).map(s=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var m;let l=yield(m=t.crossmintAuth)==null?void 0:m.getOAuthUrl(s,{appSchema:P});return{[s]:l}})),a=Object.assign({},...yield Promise.all(u));g(a)}catch(o){console.error(o)}}),[t.crossmintAuth,P]);_react.useEffect.call(void 0, ()=>{t.user==null&&y()},[y,t.user]);let N=()=>t.status==="initializing"?"initializing":f?"in-progress":t.jwt!=null?"logged-in":"logged-out",E=o=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var u,a;try{i(!0);let s=(a=h[o])!=null?a:yield(u=t.crossmintAuth)==null?void 0:u.getOAuthUrl(o,{appSchema:P});yield n.warmUpAsync();let l=new URL(s);if(o==="google"&&l.searchParams.append("provider_prompt","select_account"),_reactnative.Platform.OS==="android")yield n.openBrowserAsync(l.toString());else{let m=yield n.openAuthSessionAsync(l.toString());m.type==="success"&&(yield x(m.url))}yield n.coolDownAsync()}catch(s){throw console.error("[CrossmintAuthProvider] Error during OAuth login:",s),new Error(`Error during OAuth login: ${s}`)}finally{i(!1)}}),x=_react.useCallback.call(void 0, o=>_chunkIJN37RF2js.f.call(void 0, this,null,function*(){var a;let u=o.includes("://")?_(o):o;if(u!=null)try{return i(!0),yield(a=t.crossmintAuth)==null?void 0:a.handleRefreshAuthMaterial(u)}catch(s){throw s}finally{i(!1)}return null}),[t.crossmintAuth]);return _jsxruntime.jsx.call(void 0, w.Provider,{value:{crossmintAuth:t.crossmintAuth,logout:t.logout,jwt:t.jwt,user:t.user,status:N(),getUser:t.getUser,login:()=>{},loginWithOAuth:E,createAuthSession:x},children:_jsxruntime.jsx.call(void 0, G,{children:r})})}function ut(t){var h=t,{children:r}=h,e=_chunkIJN37RF2js.d.call(void 0, h,["children"]);var i,A;let g=(A=e.appSchema)!=null?A:(i=_expoconstants2.default.expoConfig)==null?void 0:i.scheme,f=_react.useMemo.call(void 0, ()=>{var C;return(C=e.storageProvider)!=null?C:new _chunkU3CLRKGHjs.a},[e.storageProvider]);return _jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintAuthBaseProvider,{onLoginSuccess:e.onLoginSuccess,refreshRoute:e.refreshRoute,logoutRoute:e.logoutRoute,storageProvider:f,children:_jsxruntime.jsx.call(void 0, V,{appSchema:g,children:r})})}var _=r=>{let e=/[?&]oneTimeSecret=([^&#]+)/,t=r.match(e);return t?decodeURIComponent(t[1]):void 0};exports.a = w; exports.b = ut; exports.c = U; exports.d = _clientsdkreactbase.useCrossmint; exports.e = _clientsdkreactbase.useWallet; exports.f = _clientsdkreactbase.useWalletOtpSigner;
@@ -1 +1 @@
1
- import{e as o}from"./chunk-PSSAAY7D.mjs";import{useEffect as a}from"react";function u({payer:r,webViewClient:e}){return a(()=>{if(e==null)return;let t=e.on("crypto:send-transaction",l=>o(this,[l],function*({chain:s,serializedTransaction:c}){try{yield r.handleChainSwitch(s);let n=yield r.handleSignAndSendTransaction(c);n.success?e.send("crypto:send-transaction:success",{txId:n.txId}):e.send("crypto:send-transaction:failed",{error:n.errorMessage})}catch(n){console.error("[PayerConnectionHandler] Failed to send transaction",n),e.send("crypto:send-transaction:failed",{error:n.message||"An unknown error occurred"})}}));return()=>{e.off(t)}},[e]),null}export{u as a};
1
+ import{f as o}from"./chunk-4P5ABAFD.mjs";import{useEffect as a}from"react";function u({payer:r,webViewClient:e}){return a(()=>{if(e==null)return;let t=e.on("crypto:send-transaction",l=>o(this,[l],function*({chain:s,serializedTransaction:c}){try{yield r.handleChainSwitch(s);let n=yield r.handleSignAndSendTransaction(c);n.success?e.send("crypto:send-transaction:success",{txId:n.txId}):e.send("crypto:send-transaction:failed",{error:n.errorMessage})}catch(n){console.error("[PayerConnectionHandler] Failed to send transaction",n),e.send("crypto:send-transaction:failed",{error:n.message||"An unknown error occurred"})}}));return()=>{e.off(t)}},[e]),null}export{u as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-DKQZSNOO.js');require('../../chunk-72MMCJ2E.js');var _chunkZM4HMYQXjs = require('../../chunk-ZM4HMYQX.js');require('../../chunk-X64DPUQJ.js');require('../../chunk-YQEWHOQ7.js');require('../../chunk-VACQTZRT.js');require('../../chunk-RFFLL7AO.js');require('../../chunk-YVITECJT.js');require('../../chunk-2D2RJCVX.js');require('../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunkZM4HMYQXjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-DKQZSNOO.js');require('../../chunk-72MMCJ2E.js');var _chunkKVMXUD7Bjs = require('../../chunk-KVMXUD7B.js');require('../../chunk-IEPHFQWO.js');require('../../chunk-YQEWHOQ7.js');require('../../chunk-2UY6GCV3.js');require('../../chunk-66JRBDJO.js');require('../../chunk-NQTZET7B.js');require('../../chunk-2D2RJCVX.js');require('../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkKVMXUD7Bjs.a;
@@ -1 +1 @@
1
- import"../../chunk-TIQGKXQA.mjs";import"../../chunk-MB7H3PBJ.mjs";import{a}from"../../chunk-4XMG3KIU.mjs";import"../../chunk-4PMKF2DM.mjs";import"../../chunk-PCJMDUSI.mjs";import"../../chunk-FX23A4BR.mjs";import"../../chunk-QVLCNPNG.mjs";import"../../chunk-VGA23PJK.mjs";import"../../chunk-FFQ6EQCL.mjs";import"../../chunk-PSSAAY7D.mjs";export{a as CrossmintEmbeddedCheckout};
1
+ import"../../chunk-TIQGKXQA.mjs";import"../../chunk-MB7H3PBJ.mjs";import{a}from"../../chunk-QZWDIIDT.mjs";import"../../chunk-42PSUTXE.mjs";import"../../chunk-PCJMDUSI.mjs";import"../../chunk-ZP2QWJOD.mjs";import"../../chunk-2TZTJDZU.mjs";import"../../chunk-LPJ4PJPR.mjs";import"../../chunk-FFQ6EQCL.mjs";import"../../chunk-4P5ABAFD.mjs";export{a as CrossmintEmbeddedCheckout};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZM4HMYQXjs = require('../../../chunk-ZM4HMYQX.js');require('../../../chunk-X64DPUQJ.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-RFFLL7AO.js');require('../../../chunk-YVITECJT.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunkZM4HMYQXjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKVMXUD7Bjs = require('../../../chunk-KVMXUD7B.js');require('../../../chunk-IEPHFQWO.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-66JRBDJO.js');require('../../../chunk-NQTZET7B.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkKVMXUD7Bjs.a;
@@ -1 +1 @@
1
- import{a}from"../../../chunk-4XMG3KIU.mjs";import"../../../chunk-4PMKF2DM.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-FX23A4BR.mjs";import"../../../chunk-QVLCNPNG.mjs";import"../../../chunk-VGA23PJK.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-PSSAAY7D.mjs";export{a as CrossmintEmbeddedCheckout};
1
+ import{a}from"../../../chunk-QZWDIIDT.mjs";import"../../../chunk-42PSUTXE.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-ZP2QWJOD.mjs";import"../../../chunk-2TZTJDZU.mjs";import"../../../chunk-LPJ4PJPR.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-4P5ABAFD.mjs";export{a as CrossmintEmbeddedCheckout};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkX64DPUQJjs = require('../../../chunk-X64DPUQJ.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-RFFLL7AO.js');require('../../../chunk-YVITECJT.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-J42HASCI.js');exports.EmbeddedCheckoutV3WebView = _chunkX64DPUQJjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIEPHFQWOjs = require('../../../chunk-IEPHFQWO.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-66JRBDJO.js');require('../../../chunk-NQTZET7B.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-IJN37RF2.js');exports.EmbeddedCheckoutV3WebView = _chunkIEPHFQWOjs.a;
@@ -1 +1 @@
1
- import{a}from"../../../chunk-4PMKF2DM.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-FX23A4BR.mjs";import"../../../chunk-QVLCNPNG.mjs";import"../../../chunk-VGA23PJK.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-PSSAAY7D.mjs";export{a as EmbeddedCheckoutV3WebView};
1
+ import{a}from"../../../chunk-42PSUTXE.mjs";import"../../../chunk-PCJMDUSI.mjs";import"../../../chunk-ZP2QWJOD.mjs";import"../../../chunk-2TZTJDZU.mjs";import"../../../chunk-LPJ4PJPR.mjs";import"../../../chunk-FFQ6EQCL.mjs";import"../../../chunk-4P5ABAFD.mjs";export{a as EmbeddedCheckoutV3WebView};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVACQTZRTjs = require('../../../../chunk-VACQTZRT.js');require('../../../../chunk-J42HASCI.js');exports.PayerConnectionHandler = _chunkVACQTZRTjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2UY6GCV3js = require('../../../../chunk-2UY6GCV3.js');require('../../../../chunk-IJN37RF2.js');exports.PayerConnectionHandler = _chunk2UY6GCV3js.a;
@@ -1 +1 @@
1
- import{a}from"../../../../chunk-FX23A4BR.mjs";import"../../../../chunk-PSSAAY7D.mjs";export{a as PayerConnectionHandler};
1
+ import{a}from"../../../../chunk-ZP2QWJOD.mjs";import"../../../../chunk-4P5ABAFD.mjs";export{a as PayerConnectionHandler};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../../chunk-72MMCJ2E.js');var _chunkZM4HMYQXjs = require('../../../chunk-ZM4HMYQX.js');require('../../../chunk-X64DPUQJ.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-VACQTZRT.js');require('../../../chunk-RFFLL7AO.js');require('../../../chunk-YVITECJT.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-J42HASCI.js');exports.CrossmintEmbeddedCheckout = _chunkZM4HMYQXjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../../chunk-72MMCJ2E.js');var _chunkKVMXUD7Bjs = require('../../../chunk-KVMXUD7B.js');require('../../../chunk-IEPHFQWO.js');require('../../../chunk-YQEWHOQ7.js');require('../../../chunk-2UY6GCV3.js');require('../../../chunk-66JRBDJO.js');require('../../../chunk-NQTZET7B.js');require('../../../chunk-2D2RJCVX.js');require('../../../chunk-IJN37RF2.js');exports.CrossmintEmbeddedCheckout = _chunkKVMXUD7Bjs.a;