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

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 (69) hide show
  1. package/README.md +104 -162
  2. package/app.plugin.js +1 -1
  3. package/dist/{chunk-G4YSWRHL.js → chunk-3G67LZY4.js} +1 -1
  4. package/dist/{chunk-WFE62YZ6.mjs → chunk-45TP2JXE.mjs} +1 -1
  5. package/dist/{chunk-42PSUTXE.mjs → chunk-4MN4QAOQ.mjs} +1 -1
  6. package/dist/{chunk-E5RFE3I6.mjs → chunk-5MGZBNVP.mjs} +1 -1
  7. package/dist/{chunk-66JRBDJO.js → chunk-62BM5IEW.js} +1 -1
  8. package/dist/chunk-7JOOUJJ2.js +38 -0
  9. package/dist/chunk-BOG3QIA2.js +1 -0
  10. package/dist/{chunk-MZFVU7OV.js → chunk-DFDMGNPK.js} +1 -1
  11. package/dist/{chunk-42DYL4PZ.js → chunk-FPCMLAX5.js} +1 -1
  12. package/dist/{chunk-KVMXUD7B.js → chunk-INSBGTEM.js} +1 -1
  13. package/dist/{chunk-IEPHFQWO.js → chunk-J5TIN2QP.js} +1 -1
  14. package/dist/chunk-LQB6YDSS.js +1 -0
  15. package/dist/{chunk-GU2453HG.js → chunk-M6DWDSXB.js} +1 -1
  16. package/dist/{chunk-7LYLPKBG.mjs → chunk-P75ZW4KS.mjs} +1 -1
  17. package/dist/chunk-QE2FX5MA.mjs +1 -0
  18. package/dist/chunk-R4DCEEUP.mjs +38 -0
  19. package/dist/{chunk-QZWDIIDT.mjs → chunk-R5XJGO2X.mjs} +1 -1
  20. package/dist/{chunk-4EKVY6NS.js → chunk-RQXX5HO4.js} +1 -1
  21. package/dist/{chunk-2TZTJDZU.mjs → chunk-T4QUGUU7.mjs} +1 -1
  22. package/dist/chunk-VQYCHV3U.mjs +1 -0
  23. package/dist/{chunk-J7VLYBIW.mjs → chunk-VTI5IUWS.mjs} +1 -1
  24. package/dist/{chunk-S6RE3WT5.mjs → chunk-YMCYXFCG.mjs} +1 -1
  25. package/dist/components/embed/index.js +1 -1
  26. package/dist/components/embed/index.mjs +1 -1
  27. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
  28. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.mjs +1 -1
  29. package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.js +1 -1
  30. package/dist/components/embed/v3/EmbeddedCheckoutV3WebView.mjs +1 -1
  31. package/dist/components/embed/v3/index.js +1 -1
  32. package/dist/components/embed/v3/index.mjs +1 -1
  33. package/dist/components/icons/index.js +1 -1
  34. package/dist/components/icons/index.mjs +1 -1
  35. package/dist/components/index.js +1 -1
  36. package/dist/components/index.mjs +1 -1
  37. package/dist/components/signers/EmailSignersDialog.js +1 -1
  38. package/dist/components/signers/EmailSignersDialog.mjs +1 -1
  39. package/dist/components/signers/PhoneSignersDialog.js +1 -1
  40. package/dist/components/signers/PhoneSignersDialog.mjs +1 -1
  41. package/dist/components/signers/index.js +1 -1
  42. package/dist/components/signers/index.mjs +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/index.mjs +1 -1
  45. package/dist/logger/init.js +1 -1
  46. package/dist/logger/init.mjs +1 -1
  47. package/dist/plugin/withCrossmintUI.d.mts +6 -0
  48. package/dist/plugin/withCrossmintUI.d.ts +6 -0
  49. package/dist/plugin/withCrossmintUI.js +1 -0
  50. package/dist/plugin/withCrossmintUI.mjs +1 -0
  51. package/dist/plugin/withDeviceSigner.d.mts +5 -0
  52. package/dist/plugin/withDeviceSigner.d.ts +5 -0
  53. package/dist/plugin/withDeviceSigner.js +1 -0
  54. package/dist/plugin/withDeviceSigner.mjs +1 -0
  55. package/dist/plugin/withGooglePay.d.mts +2 -2
  56. package/dist/plugin/withGooglePay.d.ts +2 -2
  57. package/dist/plugin/withGooglePay.js +1 -1
  58. package/dist/plugin/withGooglePay.mjs +1 -1
  59. package/dist/providers/CrossmintProvider.js +1 -1
  60. package/dist/providers/CrossmintProvider.mjs +1 -1
  61. package/dist/providers/CrossmintWalletProvider.js +1 -1
  62. package/dist/providers/CrossmintWalletProvider.mjs +1 -1
  63. package/dist/providers/index.js +1 -1
  64. package/dist/providers/index.mjs +1 -1
  65. package/dist/utils/createCrossmintApiClient.js +1 -1
  66. package/dist/utils/createCrossmintApiClient.mjs +1 -1
  67. package/package.json +9 -9
  68. package/dist/chunk-LPJ4PJPR.mjs +0 -1
  69. package/dist/chunk-NQTZET7B.js +0 -1
package/README.md CHANGED
@@ -1,23 +1,30 @@
1
- # Crossmint React Native SDK
1
+ # @crossmint/client-sdk-react-native-ui
2
2
 
3
- > **Create chain-agnostic wallets for your React Native apps in minutes**
4
- > Supports Solana, 20+ EVM chains (Polygon, Base, etc.), with secure mobile authentication.
3
+ React Native SDK for integrating [Crossmint Wallets](https://docs.crossmint.com) into your mobile application. Provides providers, hooks, and built-in UI for wallet creation, signing, and OTP verification.
5
4
 
6
- ## 🚀 Quick Start
5
+ ## Prerequisites
6
+
7
+ Get a **client** API key from the [Crossmint developer console](https://docs.crossmint.com/introduction/platform/api-keys). Ensure your key has the **Wallet API** scopes enabled.
8
+
9
+ ## Installation
7
10
 
8
11
  ```bash
12
+ npm install @crossmint/client-sdk-react-native-ui expo-secure-store expo-web-browser expo-device
13
+ # or
9
14
  pnpm add @crossmint/client-sdk-react-native-ui expo-secure-store expo-web-browser expo-device
10
15
  ```
11
16
 
17
+ ## Quick Start
18
+
12
19
  ### 1. Setup Providers
13
20
 
14
- **Option A: With Crossmint Authentication (Recommended)**
21
+ **With Crossmint Authentication (Recommended for quickstarts only)**
15
22
 
16
23
  ```tsx
17
24
  import {
18
25
  CrossmintProvider,
19
26
  CrossmintAuthProvider,
20
- CrossmintWalletProvider
27
+ CrossmintWalletProvider,
21
28
  } from "@crossmint/client-sdk-react-native-ui";
22
29
 
23
30
  export default function App() {
@@ -26,8 +33,8 @@ export default function App() {
26
33
  <CrossmintAuthProvider>
27
34
  <CrossmintWalletProvider
28
35
  createOnLogin={{
29
- chain: "solana",
30
- signer: { type: "email" }
36
+ chain: "base-sepolia",
37
+ recovery: { type: "email" },
31
38
  }}
32
39
  >
33
40
  <MainApp />
@@ -38,23 +45,28 @@ export default function App() {
38
45
  }
39
46
  ```
40
47
 
41
- **Option B: 🔧 Bring Your Own Authentication**
48
+ **Bring Your Own Authentication**
42
49
 
43
- Already have authentication? Skip Crossmint Auth and use wallets with your existing system:
44
-
45
- 📖 **[Complete Custom Auth Guide](https://docs.crossmint.com/wallets/advanced/bring-your-own-auth#react-native)** - Full setup with server-side examples and implementation details.
50
+ Already have authentication? Skip `CrossmintAuthProvider` and use wallets with your existing auth system. See the [Custom Auth Guide](https://docs.crossmint.com/wallets/advanced/bring-your-own-auth#react-native) for full details.
46
51
 
47
52
  ```tsx
48
53
  import {
49
54
  CrossmintProvider,
50
- CrossmintWalletProvider
55
+ CrossmintWalletProvider,
51
56
  } from "@crossmint/client-sdk-react-native-ui";
52
57
 
53
58
  export default function App() {
54
59
  return (
55
60
  <CrossmintProvider apiKey={process.env.EXPO_PUBLIC_CROSSMINT_API_KEY}>
56
- {/* No CrossmintAuthProvider needed! */}
57
- <CrossmintWalletProvider>
61
+ <CrossmintWalletProvider
62
+ createOnLogin={{
63
+ chain: "base-sepolia",
64
+ recovery: {
65
+ type: "email",
66
+ email: "user@example.com",
67
+ },
68
+ }}
69
+ >
58
70
  <MainApp />
59
71
  </CrossmintWalletProvider>
60
72
  </CrossmintProvider>
@@ -62,169 +74,115 @@ export default function App() {
62
74
  }
63
75
  ```
64
76
 
65
- ### 2. Use Authentication & Wallets
66
-
67
- The React Native SDK uses [Expo's SecureStore](https://docs.expo.dev/versions/latest/sdk/securestore/) for secure, encrypted storage of authentication tokens. This provides a platform-native secure storage solution that encrypts sensitive data on the device.
77
+ ### 2. Use Wallets
68
78
 
69
79
  ```tsx
70
- import { View, Button, Text } from "react-native";
71
- import { useCrossmintAuth, useWallet } from "@crossmint/client-sdk-react-native-ui";
80
+ import { useWallet } from "@crossmint/client-sdk-react-native-ui";
81
+ import { View, Text, TouchableOpacity } from "react-native";
72
82
 
73
- export default function MainApp() {
74
- const { loginWithOAuth, logout, user } = useCrossmintAuth();
83
+ function WalletActions() {
75
84
  const { wallet, status } = useWallet();
76
85
 
77
- if (!user) {
78
- return (
79
- <View style={{ padding: 20 }}>
80
- <Button
81
- title="Login with Google"
82
- onPress={() => loginWithOAuth("google")}
83
- />
84
- </View>
85
- );
86
- }
86
+ if (status === "in-progress") return <Text>Loading wallet...</Text>;
87
+ if (!wallet) return <Text>No wallet</Text>;
87
88
 
88
- if (status === "loaded") {
89
- return (
90
- <View style={{ padding: 20 }}>
91
- <Text>Welcome {user.email}!</Text>
92
- <Text>Wallet: {wallet?.address}</Text>
93
- <Button
94
- title="Send 1 USDC"
95
- onPress={() => wallet?.send(recipient, "usdc", "1.0")}
96
- />
97
- <Button title="Logout" onPress={logout} />
98
- </View>
99
- );
100
- }
89
+ const handleSend = async () => {
90
+ const tx = await wallet.send("0xRecipient", "usdc", "10");
91
+ console.log("Transaction:", tx.explorerLink);
92
+ };
101
93
 
102
- return <Text>Loading wallet...</Text>;
94
+ return (
95
+ <View>
96
+ <Text>Wallet: {wallet.address}</Text>
97
+ <TouchableOpacity onPress={handleSend}>
98
+ <Text>Send 10 USDC</Text>
99
+ </TouchableOpacity>
100
+ </View>
101
+ );
103
102
  }
104
103
  ```
105
104
 
106
- ## 🔐 Authentication
107
-
108
- ### OAuth Login Methods
109
- ```tsx
110
- const { loginWithOAuth } = useCrossmintAuth();
105
+ ## Providers
111
106
 
112
- // Available OAuth providers
113
- <Button title="Google" onPress={() => loginWithOAuth("google")} />
114
- <Button title="Twitter" onPress={() => loginWithOAuth("twitter")} />
115
- ```
107
+ | Provider | Purpose |
108
+ |---|---|
109
+ | `CrossmintProvider` | Root provider. Required for all Crossmint features. |
110
+ | `CrossmintAuthProvider` | Authentication (OAuth). Optional if using your own auth. |
111
+ | `CrossmintWalletProvider` | Wallet creation, device signer management, and OTP UI. |
116
112
 
117
- ## 💳 Wallets
113
+ ### `CrossmintWalletProvider` Props
118
114
 
119
- ### Multi-Chain Support
120
- - **Solana**: Native SOL, SPL tokens
121
- - **EVM Chains**: Ethereum, Polygon, Base, Arbitrum, and 15+ more
122
- - **Unified API**: Same code works across all chains
115
+ | Prop | Type | Default | Description |
116
+ |---|---|---|---|
117
+ | `createOnLogin` | `CreateOnLogin` | | Auto-create wallet on auth. Uses `recovery` + optional `signers`. |
118
+ | `showOtpSignerPrompt` | `boolean` | `true` | When `true` (default), built-in OTP dialogs are shown during signing flows. Set to `false` to suppress them and handle OTP manually via `useWalletOtpSigner()`. |
119
+ | `deviceSignerKeyStorage` | `DeviceSignerKeyStorage` | — | Override the default native key storage. |
120
+ | `appearance` | `UIConfig` | — | Styling for built-in UI components. |
123
121
 
124
- ### Using Wallets
125
- ```tsx
126
- const { wallet, getOrCreateWallet } = useWallet();
122
+ ## Hooks
127
123
 
128
- // Get wallet info
129
- const address = wallet?.address;
130
- const balance = await wallet?.balances();
124
+ ### `useWallet()`
131
125
 
132
- // Send tokens
133
- const tx = await wallet?.send(recipient, "usdc", "10.5");
134
- console.log("Transaction:", tx.explorerLink);
126
+ Returns the wallet instance and management functions:
135
127
 
136
- // For advanced use cases
137
- const customWallet = await getOrCreateWallet({
138
- chain: "<your-chain>",
139
- signer: { type: "<your-signer-type>" }
140
- });
128
+ ```tsx
129
+ const {
130
+ wallet, // Wallet | undefined
131
+ status, // "not-loaded" | "in-progress" | "loaded" | "error"
132
+ getWallet, // (props: { chain, alias? }) => Promise<Wallet | undefined>
133
+ createWallet, // (props: ClientSideWalletCreateArgs) => Promise<Wallet | undefined>
134
+ createDeviceSigner, // () => Promise<DeviceSignerDescriptor> | undefined
135
+ createPasskeySigner, // (name: string) => Promise<RegisterSignerPasskeyParams>
136
+ } = useWallet();
141
137
  ```
142
138
 
143
- ## Custom Storage Provider
139
+ ### `useWalletOtpSigner()`
144
140
 
145
- If you need to implement a custom storage solution, you can implement the `StorageProvider` interface and pass it to the `CrossmintAuthProvider`:
141
+ For custom OTP UI when using email/phone recovery signers. When `showOtpSignerPrompt` is set to `false`, use this hook to handle OTP flows manually:
146
142
 
147
143
  ```tsx
148
- import { CrossmintAuthProvider, type StorageProvider } from "@crossmint/client-sdk-react-native-ui";
149
-
150
- // Implement your custom storage provider
151
- class CustomStorage implements StorageProvider {
152
- async get(key: string): Promise<string | undefined> {
153
- // Your implementation
154
- }
144
+ const { needsAuth, sendOtp, verifyOtp, reject } = useWalletOtpSigner();
145
+ ```
155
146
 
156
- async set(key: string, value: string, expiresAt?: string): Promise<void> {
157
- // Your implementation
158
- }
147
+ ### `useCrossmintAuth()`
159
148
 
160
- async remove(key: string): Promise<void> {
161
- // Your implementation
162
- }
163
- }
149
+ Authentication state and OAuth login:
164
150
 
165
- // Use your custom storage provider
166
- function App() {
167
- const customStorage = new CustomStorage();
151
+ ```tsx
152
+ const { loginWithOAuth, logout, user } = useCrossmintAuth();
168
153
 
169
- return (
170
- <CrossmintProvider apiKey="YOUR_API_KEY">
171
- <CrossmintAuthProvider customStorageProvider={customStorage}>
172
- {/* Your app content */}
173
- </CrossmintAuthProvider>
174
- </CrossmintProvider>
175
- );
176
- }
154
+ // OAuth providers
155
+ loginWithOAuth("google");
156
+ loginWithOAuth("twitter");
177
157
  ```
178
158
 
179
- ## 🛒 Checkout
159
+ ## Components
180
160
 
181
- Accept credit card payments for tokens and NFTs directly in your React Native app with a fully customizable embedded checkout experience.
161
+ ### `ExportPrivateKeyButton`
182
162
 
183
- ### Setup
163
+ Renders a button to export the wallet's private key via TEE. Only renders for email/phone signers.
184
164
 
185
165
  ```tsx
186
- import {
187
- CrossmintProvider,
188
- CrossmintEmbeddedCheckout
189
- } from "@crossmint/client-sdk-react-native-ui";
166
+ import { ExportPrivateKeyButton } from "@crossmint/client-sdk-react-native-ui";
190
167
 
191
- export default function App() {
192
- return (
193
- <CrossmintProvider apiKey={process.env.EXPO_PUBLIC_CROSSMINT_API_KEY}>
194
- <CrossmintEmbeddedCheckout
195
- recipient={{
196
- walletAddress: "your_recipient_wallet_address"
197
- }}
198
- payment={{
199
- crypto: { enabled: false },
200
- fiat: { enabled: true },
201
- receiptEmail: "customer@example.com" // Required for payment receipts
202
- }}
203
- lineItems={{
204
- tokenLocator: "solana:7EivYFyNfgGj8xbUymR7J4LuxUHLvi7Dgu",
205
- executionParameters: {
206
- mode: "exact-in", // USD amount to spend
207
- amount: "1", // Amount in USD
208
- maxSlippageBps: "500" // 5% slippage tolerance
209
- }
210
- }}
211
- />
212
- </CrossmintProvider>
213
- );
214
- }
168
+ <ExportPrivateKeyButton appearance={{ borderRadius: "12px" }} />
215
169
  ```
216
170
 
217
- ### Environment Variables
171
+ ## Differences from React SDK
218
172
 
219
- Add these to your `.env`:
220
- ```bash
221
- EXPO_PUBLIC_CROSSMINT_API_KEY=your_api_key_here
222
- ```
173
+ | Feature | React | React Native |
174
+ |---|---|---|
175
+ | Device signer storage | Browser iframe (`IframeDeviceSignerKeyStorage`) | Native secure storage (iOS Secure Enclave / Android Keystore) |
176
+ | Device storage override | Not exposed | `deviceSignerKeyStorage` prop on provider |
177
+ | Built-in OTP UI | Always rendered | `showOtpSignerPrompt=true` (shown by default) |
178
+ | Passkey helper UI | `showPasskeyHelpers` prop | Not available |
179
+ | TEE communication | Hidden iframe | Hidden WebView (lazily initialized) |
223
180
 
224
- **[Full Embedded Checkout Quickstart](https://docs.crossmint.com/payments/embedded/quickstarts/credit-card-memecoin-react-native)** - Complete guide with token purchases and NFT minting examples.
181
+ ## Wallets SDK
225
182
 
183
+ The `wallet` object returned by `useWallet()` is a [`Wallet`](https://www.npmjs.com/package/@crossmint/wallets-sdk) instance. For wallet method documentation (send, balances, sign, etc.), see the [`@crossmint/wallets-sdk` README](https://www.npmjs.com/package/@crossmint/wallets-sdk).
226
184
 
227
- ## 🛠️ Environment Setup
185
+ ## Environment Setup
228
186
 
229
187
  1. Get your API key from [Crossmint Console](https://staging.crossmint.com/console/projects/apiKeys)
230
188
 
@@ -242,29 +200,13 @@ EXPO_PUBLIC_CROSSMINT_API_KEY=your_api_key_here
242
200
  }
243
201
  ```
244
202
 
245
- ## 📖 SDK Reference Docs Generation
246
-
247
- ```
248
- Source JSDoc → TypeDoc → api.json ─┐
249
- ├→ generate-reference.mjs → MDX pages (docs/<product>/)
250
- examples.json ─┘
251
- ```
252
-
253
- Run with `pnpm generate:docs` or `node scripts/generate-reference.mjs --product wallets`.
254
-
255
- **Key details for maintainers:**
256
-
257
- - **`api.json` and `docs/` are gitignored** — they're build artifacts, not checked in.
258
- - **Adding a new product** only requires a new entry in the `PRODUCTS` config at the top of `generate-reference.mjs`. No other script changes needed.
259
- - **Exports are auto-classified** by naming convention: `*Provider` → providers page, `use*` → hooks page, everything else → components page.
260
- - **`examples.json`** holds all code snippets, keyed by export name (e.g. `"CrossmintProvider"`, `"useWallet"`). The script validates that every export has a matching example.
261
- - **`MANUAL_RETURNS` / `EXPANDABLE_CHILDREN`** are escape hatches for cross-package types that TypeDoc can't resolve (e.g. wallet args, hook return types). If a new hook's return type shows as `unknown`, you likely need to add an entry here.
262
- - **`skipErrorChecking: true`** in the TypeDoc config is intentional — React packages have peer deps that break type resolution without it.
263
-
264
- ## 📚 Examples & Documentation
203
+ ## Documentation
265
204
 
266
- - **[Wallets Expo Quickstart](https://github.com/Crossmint/wallets-expo-quickstart)** - Create and interact with Crossmint wallets using Crossmint Auth for React Native.
205
+ - [Crossmint Wallets Docs](https://docs.crossmint.com)
206
+ - [SDK Reference](https://docs.crossmint.com/sdk-reference/wallets/react-native)
207
+ - [Wallets Expo Quickstart](https://github.com/Crossmint/wallets-expo-quickstart)
208
+ - [Custom Auth Guide (React Native)](https://docs.crossmint.com/wallets/advanced/bring-your-own-auth#react-native)
267
209
 
268
- ---
210
+ ## License
269
211
 
270
- **Questions?** Visit our [documentation](https://docs.crossmint.com/introduction/about-crossmint) or contact our support team.
212
+ Apache-2.0
package/app.plugin.js CHANGED
@@ -1 +1 @@
1
- module.exports = require("./dist/plugin/withGooglePay");
1
+ module.exports = require("./dist/plugin/withCrossmintUI");
@@ -1,2 +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.
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkR4AKS6SVjs = require('./chunk-R4AKS6SV.js');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 _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
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
- 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
+ import{a as A}from"./chunk-P75ZW4KS.mjs";import{a as _}from"./chunk-YMCYXFCG.mjs";import{a as H}from"./chunk-5MGZBNVP.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
- 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
+ import{a as y}from"./chunk-ZP2QWJOD.mjs";import{c as h}from"./chunk-PCJMDUSI.mjs";import{a as f}from"./chunk-T4QUGUU7.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,2 +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.
1
+ import{a as S}from"./chunk-TSRZEXRU.mjs";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 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
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};
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLQB6YDSSjs = require('./chunk-LQB6YDSS.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:_chunkLQB6YDSSjs.a.version},apiKeyExpectations:t}})}exports.a = a;
@@ -0,0 +1,38 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _configplugins = require('@expo/config-plugins');var _path = require('path'); var _path2 = _interopRequireDefault(_path);var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);var E=l=>_configplugins.withDangerousMod.call(void 0, l,["ios",i=>_chunkIJN37RF2js.f.call(void 0, void 0,null,function*(){let t=_path2.default.join(i.modRequest.platformProjectRoot,"Podfile"),e=_fs2.default.readFileSync(t,"utf8");e.includes("CROSSMINT_RN_PREBUILT_FIX")||(e=e.replace(/(ENV\['RCT_USE_RN_DEP'\][^\n]+\n)(ENV\['RCT_USE_PREBUILT_RNCORE'\][^\n]+\n)/,`$1$2ENV.delete('RCT_USE_RN_DEP') # CROSSMINT_RN_PREBUILT_FIX
2
+ ENV.delete('RCT_USE_PREBUILT_RNCORE') # CROSSMINT_RN_PREBUILT_FIX
3
+ `));let n="# @crossmint/expo-device-signer: CrossmintDeviceSigner autolinking exclusion";if(!e.includes(n)){let a=` ${n}
4
+ # RN 0.82 removed CallInvoker.h from TurboModuleUtils.h, breaking
5
+ # expo-modules-core@3.x. Inject it via a prefix header for that pod.
6
+ require 'fileutils'
7
+ pch_path = "#{installer.sandbox.root}/CrossmintExpoFixes.pch"
8
+ unless File.exist?(pch_path)
9
+ File.write(pch_path, [
10
+ "// Auto-generated by @crossmint/client-sdk-react-native-ui plugin",
11
+ "#ifdef __OBJC__",
12
+ "#endif",
13
+ "#ifdef __cplusplus",
14
+ "// RN 0.82 moved these headers; include from their new locations.",
15
+ "#include <ReactCommon/CallInvoker.h>",
16
+ "#include <ReactCommon/react/bridging/CallbackWrapper.h>",
17
+ "#endif",
18
+ ].join("\\n") + "\\n")
19
+ end
20
+ installer.pods_project.targets.each do |target|
21
+ if target.name == 'ExpoModulesCore'
22
+ target.build_configurations.each do |config|
23
+ config.build_settings['GCC_PREFIX_HEADER'] = pch_path
24
+ config.build_settings['GCC_PRECOMPILE_PREFIX_HEADER'] = 'YES'
25
+ paths = config.build_settings['HEADER_SEARCH_PATHS'] || '$(inherited)'
26
+ # Needed so <ReactCommon/CallInvoker.h> resolves correctly
27
+ extra = '$(PODS_ROOT)/Headers/Public/React-callinvoker'
28
+ config.build_settings['HEADER_SEARCH_PATHS'] = "#{paths} #{extra}" unless paths.include?(extra)
29
+ end
30
+ end
31
+ if target.name == 'CrossmintDeviceSigner'
32
+ target.build_configurations.each do |config|
33
+ config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = ''
34
+ end
35
+ end
36
+ end
37
+ `,o=e.replace(/(post_install do \|installer\|)/,`$1
38
+ ${a}`);if(o===e)throw new Error("[crossmint/client-sdk-react-native-ui] Could not inject post_install hook: expected 'post_install do |installer|' in Podfile");e=o}return _fs2.default.writeFileSync(t,e),i})]);exports.a = E;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLOFHVHXQjs = require('./chunk-LOFHVHXQ.js');var _configplugins = require('@expo/config-plugins');var{addMetaDataItemToMainApplication:l,getMainApplicationOrThrow:d}=_configplugins.AndroidConfig.Manifest,s= exports.a =(n,a={enableGooglePay:!1})=>a.enableGooglePay?_configplugins.withAndroidManifest.call(void 0, n,o=>{let i=d(o.modResults);return l(i,"com.google.android.gms.wallet.api.enabled","true"),o.modResults=_chunkLOFHVHXQjs.a.call(void 0, o.modResults,{intent:[{action:[{$:{"android:name":"org.chromium.intent.action.PAY"}}]},{action:[{$:{"android:name":"org.chromium.intent.action.IS_READY_TO_PAY"}}]},{action:[{$:{"android:name":"org.chromium.intent.action.UPDATE_PAYMENT_DETAILS"}}]}]}),o}):n;exports.a = s;
@@ -1 +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
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRQXX5HO4js = require('./chunk-RQXX5HO4.js');var _chunk3G67LZY4js = require('./chunk-3G67LZY4.js');var _chunkFPCMLAX5js = require('./chunk-FPCMLAX5.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, _chunkRQXX5HO4js.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, _chunk3G67LZY4js.a,_chunkIJN37RF2js.a.call(void 0, {},e)),_jsxruntime.jsx.call(void 0, _chunkFPCMLAX5js.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,2 +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.
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkR4AKS6SVjs = require('./chunk-R4AKS6SV.js');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 _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
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
- "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;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ5TIN2QPjs = require('./chunk-J5TIN2QP.js');var _chunkIJN37RF2js = require('./chunk-IJN37RF2.js');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkJ5TIN2QPjs.a,_chunkIJN37RF2js.a.call(void 0, {},d))}exports.a = s;
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2UY6GCV3js = require('./chunk-2UY6GCV3.js');var _chunkYQEWHOQ7js = require('./chunk-YQEWHOQ7.js');var _chunk62BM5IEWjs = require('./chunk-62BM5IEW.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=_chunk62BM5IEWjs.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={name:"@crossmint/client-sdk-react-native-ui",version:"1.0.0",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","@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}); 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
+ "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 _chunkLQB6YDSSjs = require('./chunk-LQB6YDSS.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:_chunkLQB6YDSSjs.a.name,packageVersion:_chunkLQB6YDSSjs.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;