@magic-sdk/react-native-expo 13.1.1-eebe81d → 13.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,421 @@
1
+ # v13.1.1 (Wed Jan 18 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Adds react-native-inappbrowser-reborn as peer to Bare RN OAuth [#432](https://github.com/magiclabs/magic-js/pull/432) ([@Ariflo](https://github.com/Ariflo))
6
+ - README Updates ([@Ariflo](https://github.com/Ariflo))
7
+ - [CHORE] Clean up magic-js Deployment Stages [#429](https://github.com/magiclabs/magic-js/pull/429) ([@kgrubb](https://github.com/kgrubb))
8
+ - sync with master branch ([@kgrubb](https://github.com/kgrubb))
9
+
10
+ #### 🔩 Dependency Updates
11
+
12
+ - Bump qs from 6.5.2 to 6.5.3 [#400](https://github.com/magiclabs/magic-js/pull/400) ([@dependabot[bot]](https://github.com/dependabot[bot]))
13
+ - Bump decode-uri-component from 0.2.0 to 0.2.2 [#399](https://github.com/magiclabs/magic-js/pull/399) ([@dependabot[bot]](https://github.com/dependabot[bot]))
14
+
15
+ #### Authors: 3
16
+
17
+ - [@dependabot[bot]](https://github.com/dependabot[bot])
18
+ - Arian Flores ([@Ariflo](https://github.com/Ariflo))
19
+ - Keli (Madison) Grubb ([@kgrubb](https://github.com/kgrubb))
20
+
21
+ ---
22
+
23
+ # v13.1.0 (Fri Jan 06 2023)
24
+
25
+ #### 🚀 Enhancement
26
+
27
+ - Bare React Native / Expo React Native Package Split [#412](https://github.com/magiclabs/magic-js/pull/412) ([@Ariflo](https://github.com/Ariflo))
28
+
29
+ #### 🐛 Bug Fix
30
+
31
+ - Update core package versions ([@Ariflo](https://github.com/Ariflo))
32
+ - Expo README Update ([@Ariflo](https://github.com/Ariflo))
33
+ - fix lint errors ([@Ariflo](https://github.com/Ariflo))
34
+ - Upates @magic-sdk/react-native-expo patch version ([@Ariflo](https://github.com/Ariflo))
35
+ - Adds version patch to new SDKs ([@Ariflo](https://github.com/Ariflo))
36
+ - Updates @magic-sdk/types SDK ([@Ariflo](https://github.com/Ariflo))
37
+ - Create @magic-sdk/react-native-expo SDK ([@Ariflo](https://github.com/Ariflo))
38
+
39
+ #### Authors: 1
40
+
41
+ - Arian Flores ([@Ariflo](https://github.com/Ariflo))
42
+
43
+ ---
44
+
45
+ # v10.0.1 (Fri Sep 09 2022)
46
+
47
+ #### 🐛 Bug Fix
48
+
49
+ - Add RN TypedArray stringify conversion logic [#357](https://github.com/magiclabs/magic-js/pull/357) ([@Ethella](https://github.com/Ethella))
50
+
51
+ #### Authors: 1
52
+
53
+ - Jerry Liu ([@Ethella](https://github.com/Ethella))
54
+
55
+ ---
56
+
57
+ # v10.0.0 (Fri Aug 05 2022)
58
+
59
+ #### 💥 Breaking Change
60
+
61
+ - Revert "Revert "Enable bundle Id in Expo"" [#338](https://github.com/magiclabs/magic-js/pull/338) ([@Ethella](https://github.com/Ethella))
62
+ - Enable bundle Id in Expo [#335](https://github.com/magiclabs/magic-js/pull/335) ([@Ethella](https://github.com/Ethella))
63
+
64
+ #### 🐛 Bug Fix
65
+
66
+ - Merge branch 'master' into early-access ([@bcleary06](https://github.com/bcleary06))
67
+ - Update Readme and manual version bump for releases [#339](https://github.com/magiclabs/magic-js/pull/339) ([@Ethella](https://github.com/Ethella))
68
+ - Revert "Enable bundle Id in Expo" [#337](https://github.com/magiclabs/magic-js/pull/337) ([@Ethella](https://github.com/Ethella))
69
+
70
+ #### Authors: 2
71
+
72
+ - Brian Cleary ([@bcleary06](https://github.com/bcleary06))
73
+ - Jerry Liu ([@Ethella](https://github.com/Ethella))
74
+
75
+ ---
76
+
77
+ # v8.2.0 (Mon Mar 07 2022)
78
+
79
+ #### 🐛 Bug Fix
80
+
81
+ - Update READMEs with outdated context/hyperlinks ([@smithki](https://github.com/smithki))
82
+ - Merge branch 'master' into smithki/better-build-system-documentation ([@smithki](https://github.com/smithki))
83
+
84
+ #### 🏠 Internal
85
+
86
+ - Internal documentation updates (`BUILD_SYSTEM.md`) [#283](https://github.com/magiclabs/magic-js/pull/283) ([@smithki](https://github.com/smithki))
87
+
88
+ #### Authors: 1
89
+
90
+ - Ian K Smith ([@smithki](https://github.com/smithki))
91
+
92
+ ---
93
+
94
+ # v8.1.0 (Mon Jan 31 2022)
95
+
96
+ #### 🚀 Enhancement
97
+
98
+ - Add special parsing logic to handle typed array in payload [#275](https://github.com/magiclabs/magic-js/pull/275) ([@Ethella](https://github.com/Ethella))
99
+
100
+ #### Authors: 1
101
+
102
+ - Jerry Liu ([@Ethella](https://github.com/Ethella))
103
+
104
+ ---
105
+
106
+ # v8.0.0 (Tue Jan 25 2022)
107
+
108
+ #### 💥 Breaking Change
109
+
110
+ - Switch from `microbundle` to `esbuild` [#220](https://github.com/magiclabs/magic-js/pull/220) ([@smithki](https://github.com/smithki))
111
+
112
+ #### 🐛 Bug Fix
113
+
114
+ - Merge with master ([@smithki](https://github.com/smithki))
115
+ - Merge branch 'master' into feat/faster-builds ([@smithki](https://github.com/smithki))
116
+ - Remove comments from README files ([@smithki](https://github.com/smithki))
117
+
118
+ #### Authors: 1
119
+
120
+ - Ian K Smith ([@smithki](https://github.com/smithki))
121
+
122
+ ---
123
+
124
+ # v6.1.4 (Thu Oct 21 2021)
125
+
126
+ #### 🐛 Bug Fix
127
+
128
+ - Revert to `.js` extension for ES module builds targeting webpack/CRA [#232](https://github.com/magiclabs/magic-js/pull/232) ([@smithki](https://github.com/smithki))
129
+
130
+ #### Authors: 1
131
+
132
+ - Ian K Smith ([@smithki](https://github.com/smithki))
133
+
134
+ ---
135
+
136
+ # v6.1.3 (Wed Oct 20 2021)
137
+
138
+ #### ⚠️ Pushed to `master`
139
+
140
+ - Fix dist files glob in package.json ([@smithki](https://github.com/smithki))
141
+ - Merge branch 'master' of github.com:magiclabs/magic-js ([@smithki](https://github.com/smithki))
142
+ - Force re-publish ([@smithki](https://github.com/smithki))
143
+
144
+ #### Authors: 1
145
+
146
+ - Ian K Smith ([@smithki](https://github.com/smithki))
147
+
148
+ ---
149
+
150
+ # v6.1.2 (Wed Oct 20 2021)
151
+
152
+ #### 🐛 Bug Fix
153
+
154
+ - Use '.mjs' extension for ESM build files [#230](https://github.com/magiclabs/magic-js/pull/230) ([@smithki](https://github.com/smithki))
155
+
156
+ #### Authors: 1
157
+
158
+ - Ian K Smith ([@smithki](https://github.com/smithki))
159
+
160
+ ---
161
+
162
+ # v6.0.6 (Thu Sep 23 2021)
163
+
164
+ #### 🐛 Bug Fix
165
+
166
+ - Port `@magic-ext/oauth`, `@magic-ext/react-native-oauth`, `@magic-ext/webauthn` extensions to Magic SDK monorepo [#218](https://github.com/magiclabs/magic-js/pull/218) ([@smithki](https://github.com/smithki))
167
+ - Add `@magic-sdk/pnp` package for out-of-the-box login page UIs [#217](https://github.com/magiclabs/magic-js/pull/217) ([@smithki](https://github.com/smithki))
168
+
169
+ #### Authors: 1
170
+
171
+ - Ian K Smith ([@smithki](https://github.com/smithki))
172
+
173
+ ---
174
+
175
+ # v6.0.2 (Tue Sep 14 2021)
176
+
177
+ #### 🐛 Bug Fix
178
+
179
+ - Import regeneratorRuntime in Magic JS (non-CDN version) [#210](https://github.com/magiclabs/magic-js/pull/210) ([@smithki](https://github.com/smithki))
180
+
181
+ #### Authors: 1
182
+
183
+ - Ian K Smith ([@smithki](https://github.com/smithki))
184
+
185
+ ---
186
+
187
+ # v6.0.1 (Tue Sep 14 2021)
188
+
189
+ #### 🐛 Bug Fix
190
+
191
+ - Fix SemVer cyclic dependency issues with some hacks [#209](https://github.com/magiclabs/magic-js/pull/209) ([@smithki](https://github.com/smithki))
192
+
193
+ #### Authors: 1
194
+
195
+ - Ian K Smith ([@smithki](https://github.com/smithki))
196
+
197
+ ---
198
+
199
+ # v6.0.0 (Tue Sep 14 2021)
200
+
201
+ #### 💥 Breaking Change
202
+
203
+ - v6.0.0 [#208](https://github.com/magiclabs/magic-js/pull/208) ([@smithki](https://github.com/smithki))
204
+
205
+ #### Authors: 1
206
+
207
+ - Ian K Smith ([@smithki](https://github.com/smithki))
208
+
209
+ ---
210
+
211
+ # v4.4.2 (Mon Aug 16 2021)
212
+
213
+ #### 🐛 Bug Fix
214
+
215
+ - Migrate unit tests to Jest [#194](https://github.com/magiclabs/magic-js/pull/194) ([@smithki](https://github.com/smithki))
216
+
217
+ #### Authors: 1
218
+
219
+ - Ian K Smith ([@smithki](https://github.com/smithki))
220
+
221
+ ---
222
+
223
+ # v4.4.0 (Wed Jul 28 2021)
224
+
225
+ #### 🚀 Enhancement
226
+
227
+ - Add explicit JSDelivr entry-point for `magic-sdk` [#191](https://github.com/magiclabs/magic-js/pull/191) ([@smithki](https://github.com/smithki))
228
+
229
+ #### Authors: 1
230
+
231
+ - Ian K Smith ([@smithki](https://github.com/smithki))
232
+
233
+ ---
234
+
235
+ # v4.3.1 (Fri Jun 11 2021)
236
+
237
+ #### 🐛 Bug Fix
238
+
239
+ - Upgrade @aveq-research/localforage-asyncstorage-driver [#183](https://github.com/magiclabs/magic-js/pull/183) ([@Ethella](https://github.com/Ethella))
240
+
241
+ #### Authors: 1
242
+
243
+ - Jerry Liu ([@Ethella](https://github.com/Ethella))
244
+
245
+ ---
246
+
247
+ # v4.0.1 (Tue Dec 01 2020)
248
+
249
+ #### 🐛 Bug Fix
250
+
251
+ - Add 'importHelpers: true' to base tsconfig.json [#152](https://github.com/magiclabs/magic-js/pull/152) ([@smithki](https://github.com/smithki))
252
+
253
+ #### 📝 Documentation
254
+
255
+ - Fix incorrect TypeScript project references and update READMEs with changelog links [#151](https://github.com/magiclabs/magic-js/pull/151) ([@smithki](https://github.com/smithki))
256
+
257
+ #### Authors: 1
258
+
259
+ - Ian K Smith ([@smithki](https://github.com/smithki))
260
+
261
+ ---
262
+
263
+ # v4.0.0 (Tue Nov 17 2020)
264
+
265
+ #### 💥 Breaking Change
266
+
267
+ - [All packages] Internal API changes & Cleanups [#149](https://github.com/magiclabs/magic-js/pull/149) ([@smithki](https://github.com/smithki))
268
+
269
+ #### 🐛 Bug Fix
270
+
271
+ - Update CHANGELOGs and CONTRIBUTING guide [#146](https://github.com/magiclabs/magic-js/pull/146) ([@smithki](https://github.com/smithki))
272
+
273
+ #### 🏠 Internal
274
+
275
+ - Simplify scripts [#147](https://github.com/magiclabs/magic-js/pull/147) ([@smithki](https://github.com/smithki))
276
+
277
+ #### Authors: 1
278
+
279
+ - Ian K Smith ([@smithki](https://github.com/smithki))
280
+
281
+ ---
282
+
283
+ ## `3.0.1` - 10/21/2020
284
+
285
+ #### Changed
286
+
287
+ - Removed the following public methods and functions
288
+ - `BaseExtension.utils.encodeQueryParameters`
289
+ - `BaseExtension.utils.decodeQueryParameters`
290
+
291
+ ## `2.8.0` - 09/24/2020
292
+
293
+ #### Added
294
+
295
+ - Adds a Magic SDK extensions runtime compatibility check, ensuring you're version of Magic SDK is designed for the extensions you have in use.
296
+
297
+ ## `2.7.1` - 09/18/2020
298
+
299
+ #### Fixed
300
+
301
+ - Fix missing BigInt dependency #131
302
+
303
+ ## `2.7.0` - 09/15/2020
304
+
305
+ #### Added
306
+
307
+ - New, optional `redirectURI` parameter for the `loginWithMagicLink` method
308
+ - New `loginWithCredential` method for completing a magic link login with redirect: `await magic.auth.loginWithCredential()`
309
+
310
+ ## `2.6.0` - 08/24/2020
311
+
312
+ #### Added
313
+
314
+ - New optional `locale` parameter to SDK constructor
315
+
316
+ ## `2.5.1` - 08/20/2020
317
+
318
+ #### Added
319
+
320
+ - New RPC error code for the `loginWithMagicLink` method: `-10005`
321
+
322
+ ## `2.4.6` - 07/22/2020
323
+
324
+ #### Added
325
+
326
+ - Export `PromiEvent` type and `isPromiEvent` utility from SDK entry-points (`magic-sdk` and `@magic-sdk/react-native`).
327
+
328
+ ## `2.4.1` through `2.4.5` - 07/13/2020
329
+
330
+ #### Fixed
331
+
332
+ - Bug preventing NPM tarball from containing `/dist` files.
333
+
334
+ ## `2.4.0` - 07/13/2020
335
+
336
+ #### Changed
337
+
338
+ - Updated build system to use TypeScript project references instead of Microbundle.
339
+ - Pass `targetOrigin` parameter to `postMessage` calls.
340
+
341
+ ## `2.3.1` - 07/08/2020
342
+
343
+ #### Fixed
344
+
345
+ - Bug affecting `localforage` type imports causing compilation failure in TypeScript.
346
+
347
+ ## `2.3.0` - 07/08/2020
348
+
349
+ #### Added
350
+
351
+ - WebAuthn support.
352
+ - `localforage` APIs for Magic SDK Extensions.
353
+
354
+ ## `2.1.0` - 06/25/2020
355
+
356
+ #### Changed
357
+
358
+ - Update dependencies.
359
+
360
+ #### Added
361
+
362
+ - Add `ExtensionWarning` class.
363
+
364
+ ## `2.0.5` - 06/23/2020
365
+
366
+ #### Changed
367
+
368
+ - Update dependencies.
369
+
370
+ ## `2.0.4` - 06/23/2020
371
+
372
+ #### Changed
373
+
374
+ - Update dependencies.
375
+
376
+ ## `2.0.3` - 06/23/2020
377
+
378
+ #### Changed
379
+
380
+ - Update dependencies.
381
+
382
+ ## `2.0.2` - 06/22/2020
383
+
384
+ #### Changed
385
+
386
+ - Update dependencies.
387
+
388
+ ## `2.0.1` - 06/16/2020
389
+
390
+ #### Added
391
+
392
+ - Introduce the `ExtensionError` type to ease handling of errors rising from Magic SDK Extensions.
393
+
394
+ ## `2.0.0` - 06/12/2020
395
+
396
+ #### Changed
397
+
398
+ - Move "react-native-webivew" to peer dependencies
399
+
400
+ ## `1.0.1` - 06/11/2020
401
+
402
+ #### Changed
403
+
404
+ - Update dependencies.
405
+ - Circle CI tag in readme is broken after namechange from MagicHQ to MagicLabs
406
+
407
+ ## `1.0.0` - 06/02/2020
408
+
409
+ This is the first release our changelog records. Future updates will be logged in the following format:
410
+
411
+ #### Fixed
412
+
413
+ - Bug fixes and patches will be described here.
414
+
415
+ #### Changed
416
+
417
+ - Changes (breaking or otherwise) to current APIs will be described here.
418
+
419
+ #### Added
420
+
421
+ - New features or APIs will be described here.
package/README.md CHANGED
@@ -23,8 +23,11 @@ Please note that splitting the `Expo` and `Bare React Native` Magic package is a
23
23
  ```bash
24
24
  # Via NPM:
25
25
  npm install --save @magic-sdk/react-native-expo
26
+ npm install --save react-native-webview@^8.0.0 # Required Peer Dependency
27
+
26
28
  # Via Yarn:
27
29
  yarn add @magic-sdk/react-native-expo
30
+ yarn add react-native-webview@^8.0.0 # Required Peer Dependency
28
31
  ```
29
32
 
30
33
  ## ⚡️ Quick Start
@@ -36,7 +39,7 @@ Please note that splitting the `Expo` and `Bare React Native` Magic package is a
36
39
  ```tsx
37
40
  import React from 'react';
38
41
  import { Magic } from '@magic-sdk/react-native-expo';
39
- const magic = new Magic('YOUR_API_KEY ');
42
+ const magic = new Magic('YOUR_API_KEY');
40
43
  export default function App() {
41
44
  return <>
42
45
  {/* Render the Magic iframe! */}
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Et=Object.create;var V=Object.defineProperty,Lt=Object.defineProperties,_t=Object.getOwnPropertyDescriptor,Ot=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertyNames,it=Object.getOwnPropertySymbols,Rt=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable;var at=(n,a,i)=>a in n?V(n,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[a]=i,ct=(n,a)=>{for(var i in a||(a={}))st.call(a,i)&&at(n,i,a[i]);if(it)for(var i of it(a))Mt.call(a,i)&&at(n,i,a[i]);return n},lt=(n,a)=>Lt(n,Ot(a));var Gt=(n,a)=>()=>(a||n((a={exports:{}}).exports,a),a.exports),Vt=(n,a)=>{for(var i in a)V(n,i,{get:a[i],enumerable:!0})},D=(n,a,i,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of At(a))!st.call(n,c)&&c!==i&&V(n,c,{get:()=>a[c],enumerable:!(p=_t(a,c))||p.enumerable});return n},u=(n,a,i)=>(D(n,a,"default"),i&&D(i,a,"default")),R=(n,a,i)=>(i=n!=null?Et(Rt(n)):{},D(a||!n||!n.__esModule?V(i,"default",{value:n,enumerable:!0}):i,n)),Nt=n=>D(V({},"__esModule",{value:!0}),n);var T=(n,a,i)=>new Promise((p,c)=>{var E=g=>{try{L(i.next(g))}catch(v){c(v)}},h=g=>{try{L(i.throw(g))}catch(v){c(v)}},L=g=>g.done?p(g.value):Promise.resolve(g.value).then(E,h);L((i=i.apply(n,a)).next())});var ft=Gt((Ct,Q)=>{var X=function(n){"use strict";var a=Object.prototype,i=a.hasOwnProperty,p=Object.defineProperty||function(e,t,r){e[t]=r.value},c,E=typeof Symbol=="function"?Symbol:{},h=E.iterator||"@@iterator",L=E.asyncIterator||"@@asyncIterator",g=E.toStringTag||"@@toStringTag";function v(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{v({},"")}catch{v=function(t,r,s){return t[r]=s}}function _(e,t,r,s){var o=t&&t.prototype instanceof B?t:B,l=Object.create(o.prototype),m=new x(s||[]);return p(l,"_invoke",{value:bt(e,r,m)}),l}n.wrap=_;function K(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(s){return{type:"throw",arg:s}}}var tt="suspendedStart",wt="suspendedYield",et="executing",N="completed",S={};function B(){}function P(){}function O(){}var z={};v(z,h,function(){return this});var F=Object.getPrototypeOf,k=F&&F(F(H([])));k&&k!==a&&i.call(k,h)&&(z=k);var M=O.prototype=B.prototype=Object.create(z);P.prototype=O,p(M,"constructor",{value:O,configurable:!0}),p(O,"constructor",{value:P,configurable:!0}),P.displayName=v(O,g,"GeneratorFunction");function rt(e){["next","throw","return"].forEach(function(t){v(e,t,function(r){return this._invoke(t,r)})})}n.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===P||(t.displayName||t.name)==="GeneratorFunction":!1},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,v(e,g,"GeneratorFunction")),e.prototype=Object.create(M),e},n.awrap=function(e){return{__await:e}};function I(e,t){function r(l,m,d,b){var y=K(e[l],e,m);if(y.type==="throw")b(y.arg);else{var q=y.arg,G=q.value;return G&&typeof G=="object"&&i.call(G,"__await")?t.resolve(G.__await).then(function(A){r("next",A,d,b)},function(A){r("throw",A,d,b)}):t.resolve(G).then(function(A){q.value=A,d(q)},function(A){return r("throw",A,d,b)})}}var s;function o(l,m){function d(){return new t(function(b,y){r(l,m,b,y)})}return s=s?s.then(d,d):d()}p(this,"_invoke",{value:o})}rt(I.prototype),v(I.prototype,L,function(){return this}),n.AsyncIterator=I,n.async=function(e,t,r,s,o){o===void 0&&(o=Promise);var l=new I(_(e,t,r,s),o);return n.isGeneratorFunction(t)?l:l.next().then(function(m){return m.done?m.value:l.next()})};function bt(e,t,r){var s=tt;return function(l,m){if(s===et)throw new Error("Generator is already running");if(s===N){if(l==="throw")throw m;return ot()}for(r.method=l,r.arg=m;;){var d=r.delegate;if(d){var b=nt(d,r);if(b){if(b===S)continue;return b}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(s===tt)throw s=N,r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);s=et;var y=K(e,t,r);if(y.type==="normal"){if(s=r.done?N:wt,y.arg===S)continue;return{value:y.arg,done:r.done}}else y.type==="throw"&&(s=N,r.method="throw",r.arg=y.arg)}}}function nt(e,t){var r=t.method,s=e.iterator[r];if(s===c)return t.delegate=null,r==="throw"&&e.iterator.return&&(t.method="return",t.arg=c,nt(e,t),t.method==="throw")||r!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),S;var o=K(s,e.iterator,t.arg);if(o.type==="throw")return t.method="throw",t.arg=o.arg,t.delegate=null,S;var l=o.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,S;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=c);else return l;return t.delegate=null,S}rt(M),v(M,g,"Generator"),v(M,h,function(){return this}),v(M,"toString",function(){return"[object Generator]"});function St(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function J(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(St,this),this.reset(!0)}n.keys=function(e){var t=Object(e),r=[];for(var s in t)r.push(s);return r.reverse(),function o(){for(;r.length;){var l=r.pop();if(l in t)return o.value=l,o.done=!1,o}return o.done=!0,o}};function H(e){if(e){var t=e[h];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var r=-1,s=function o(){for(;++r<e.length;)if(i.call(e,r))return o.value=e[r],o.done=!1,o;return o.value=c,o.done=!0,o};return s.next=s}}return{next:ot}}n.values=H;function ot(){return{value:c,done:!0}}return x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(J),!e)for(var t in this)t.charAt(0)==="t"&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(b,y){return l.type="throw",l.arg=e,t.next=b,y&&(t.method="next",t.arg=c),!!y}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],l=o.completion;if(o.tryLoc==="root")return r("end");if(o.tryLoc<=this.prev){var m=i.call(o,"catchLoc"),d=i.call(o,"finallyLoc");if(m&&d){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(m){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else if(d){if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var o=s;break}}o&&(e==="break"||e==="continue")&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var l=o?o.completion:{};return l.type=e,l.arg=t,o?(this.method="next",this.next=o.finallyLoc,S):this.complete(l)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),S},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),J(r),S}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var s=r.completion;if(s.type==="throw"){var o=s.arg;J(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:H(e),resultName:t,nextLoc:r},this.method==="next"&&(this.arg=c),S}},n}(typeof Q=="object"?Q.exports:{});try{regeneratorRuntime=X}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=X:Function("r","regeneratorRuntime = r")(X)}});var f={};Vt(f,{Magic:()=>Dt});module.exports=Nt(f);var Yt=R(ft()),vt=require("@magic-sdk/provider"),It=R(require("process")),mt=R(require("localforage")),U=require("whatwg-url"),$=require("buffer"),dt=R(require("lodash")),yt=R(require("expo-application")),gt=require("@aveq-research/localforage-asyncstorage-driver"),Z=R(require("localforage-driver-memory"));var w=R(require("react")),W=require("react-native"),ut=require("react-native-webview"),j=require("@magic-sdk/provider"),ht=require("lodash");var Pt="MAGIC_PAYLOAD_FLAG_TYPED_ARRAY";function kt(){return W.StyleSheet.create({"magic-webview":{flex:1,backgroundColor:"transparent"},"webview-container":{flex:1,width:"100%",backgroundColor:"transparent",position:"absolute",top:0,left:0,right:0,bottom:0},show:{zIndex:1e4,elevation:1e4},hide:{zIndex:-1e4,elevation:0}})}var C=class extends j.ViewController{constructor(){super(...arguments);this.Relayer=()=>{let[i,p]=(0,w.useState)(!1),c=(0,w.useCallback)(_=>{this.webView=_},[]),E=(0,w.useCallback)(_=>{this.container=lt(ct({},_),{showOverlay:h,hideOverlay:L})},[]),h=(0,w.useCallback)(()=>{p(!0)},[]),L=(0,w.useCallback)(()=>{p(!1)},[]),g=(0,w.useMemo)(()=>[this.styles["webview-container"],i?this.styles.show:this.styles.hide],[i]),v=(0,w.useCallback)(_=>{this.handleReactNativeWebViewMessage(_)},[]);return w.default.createElement(W.View,{ref:E,style:g},w.default.createElement(ut.WebView,{ref:c,source:{uri:`${this.endpoint}/send/?params=${encodeURIComponent(this.parameters)}`},onMessage:v,style:this.styles["magic-webview"]}))}}init(){this.webView=null,this.container=null,this.styles=kt()}handleReactNativeWebViewMessage(i){var p;if(i.nativeEvent&&typeof i.nativeEvent.data=="string"&&(i.nativeEvent.url===`${this.endpoint}/send/?params=${encodeURIComponent(this.parameters)}`||i.nativeEvent.url===`${this.endpoint}/send/?params=${this.parameters}`)){let c=JSON.parse(i.nativeEvent.data,(E,h)=>{try{if(h&&typeof h=="object"&&h.flag&&h.flag==="MAGIC_PAYLOAD_FLAG_TYPED_ARRAY")return new global[h.constructor](h.data.split(","))}catch(L){}return h});if(c&&c.msgType&&this.messageHandlers.size){c.response=(p=c.response)!=null?p:{};let E={data:c};for(let h of this.messageHandlers.values())h(E)}}}hideOverlay(){this.container&&this.container.hideOverlay()}showOverlay(){this.container&&this.container.showOverlay()}_post(i){return T(this,null,function*(){if(this.webView&&this.webView.postMessage)this.webView.postMessage(JSON.stringify(i,(p,c)=>(0,ht.isTypedArray)(c)?{constructor:c.constructor.name,data:c.toString(),flag:Pt}:c),this.endpoint);else throw(0,j.createModalNotReadyError)()})}};var pt=require("@magic-sdk/provider"),Y=class extends pt.SDKBase{get Relayer(){return this.overlay.Relayer}};u(f,require("@magic-sdk/commons"),module.exports);global.process=dt.merge(global.process,It);global.process.browser=!1;global.Buffer=$.Buffer;global.URL=U.URL;global.URLSearchParams=U.URLSearchParams;global.btoa=n=>$.Buffer.from(n,"binary").toString("base64");global.atob=n=>$.Buffer.from(n,"base64").toString("binary");var Dt=(0,vt.createSDK)(Y,{platform:"react-native",sdkName:"@magic-sdk/react-native-expo",version:"13.0.3",bundleId:yt.applicationId,defaultEndpoint:"https://box.magic.link/",ViewController:C,configureStorage:()=>T(void 0,null,function*(){let n=mt.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"}),a=(0,gt.driverWithoutSerialization)();return yield Promise.all([n.defineDriver(a),n.defineDriver(Z)]),yield n.setDriver([a._driver,Z._driver]),n})});0&&(module.exports={Magic});
1
+ "use strict";var Et=Object.create;var V=Object.defineProperty,Lt=Object.defineProperties,_t=Object.getOwnPropertyDescriptor,Ot=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertyNames,it=Object.getOwnPropertySymbols,Rt=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable;var at=(n,a,i)=>a in n?V(n,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[a]=i,ct=(n,a)=>{for(var i in a||(a={}))st.call(a,i)&&at(n,i,a[i]);if(it)for(var i of it(a))Mt.call(a,i)&&at(n,i,a[i]);return n},lt=(n,a)=>Lt(n,Ot(a));var Gt=(n,a)=>()=>(a||n((a={exports:{}}).exports,a),a.exports),Vt=(n,a)=>{for(var i in a)V(n,i,{get:a[i],enumerable:!0})},D=(n,a,i,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of At(a))!st.call(n,c)&&c!==i&&V(n,c,{get:()=>a[c],enumerable:!(p=_t(a,c))||p.enumerable});return n},u=(n,a,i)=>(D(n,a,"default"),i&&D(i,a,"default")),R=(n,a,i)=>(i=n!=null?Et(Rt(n)):{},D(a||!n||!n.__esModule?V(i,"default",{value:n,enumerable:!0}):i,n)),Nt=n=>D(V({},"__esModule",{value:!0}),n);var T=(n,a,i)=>new Promise((p,c)=>{var E=g=>{try{L(i.next(g))}catch(v){c(v)}},h=g=>{try{L(i.throw(g))}catch(v){c(v)}},L=g=>g.done?p(g.value):Promise.resolve(g.value).then(E,h);L((i=i.apply(n,a)).next())});var ft=Gt((Ct,Q)=>{var X=function(n){"use strict";var a=Object.prototype,i=a.hasOwnProperty,p=Object.defineProperty||function(e,t,r){e[t]=r.value},c,E=typeof Symbol=="function"?Symbol:{},h=E.iterator||"@@iterator",L=E.asyncIterator||"@@asyncIterator",g=E.toStringTag||"@@toStringTag";function v(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{v({},"")}catch{v=function(t,r,s){return t[r]=s}}function _(e,t,r,s){var o=t&&t.prototype instanceof B?t:B,l=Object.create(o.prototype),m=new x(s||[]);return p(l,"_invoke",{value:bt(e,r,m)}),l}n.wrap=_;function K(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(s){return{type:"throw",arg:s}}}var tt="suspendedStart",wt="suspendedYield",et="executing",N="completed",S={};function B(){}function P(){}function O(){}var z={};v(z,h,function(){return this});var F=Object.getPrototypeOf,k=F&&F(F(H([])));k&&k!==a&&i.call(k,h)&&(z=k);var M=O.prototype=B.prototype=Object.create(z);P.prototype=O,p(M,"constructor",{value:O,configurable:!0}),p(O,"constructor",{value:P,configurable:!0}),P.displayName=v(O,g,"GeneratorFunction");function rt(e){["next","throw","return"].forEach(function(t){v(e,t,function(r){return this._invoke(t,r)})})}n.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===P||(t.displayName||t.name)==="GeneratorFunction":!1},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,v(e,g,"GeneratorFunction")),e.prototype=Object.create(M),e},n.awrap=function(e){return{__await:e}};function I(e,t){function r(l,m,d,b){var y=K(e[l],e,m);if(y.type==="throw")b(y.arg);else{var q=y.arg,G=q.value;return G&&typeof G=="object"&&i.call(G,"__await")?t.resolve(G.__await).then(function(A){r("next",A,d,b)},function(A){r("throw",A,d,b)}):t.resolve(G).then(function(A){q.value=A,d(q)},function(A){return r("throw",A,d,b)})}}var s;function o(l,m){function d(){return new t(function(b,y){r(l,m,b,y)})}return s=s?s.then(d,d):d()}p(this,"_invoke",{value:o})}rt(I.prototype),v(I.prototype,L,function(){return this}),n.AsyncIterator=I,n.async=function(e,t,r,s,o){o===void 0&&(o=Promise);var l=new I(_(e,t,r,s),o);return n.isGeneratorFunction(t)?l:l.next().then(function(m){return m.done?m.value:l.next()})};function bt(e,t,r){var s=tt;return function(l,m){if(s===et)throw new Error("Generator is already running");if(s===N){if(l==="throw")throw m;return ot()}for(r.method=l,r.arg=m;;){var d=r.delegate;if(d){var b=nt(d,r);if(b){if(b===S)continue;return b}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(s===tt)throw s=N,r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);s=et;var y=K(e,t,r);if(y.type==="normal"){if(s=r.done?N:wt,y.arg===S)continue;return{value:y.arg,done:r.done}}else y.type==="throw"&&(s=N,r.method="throw",r.arg=y.arg)}}}function nt(e,t){var r=t.method,s=e.iterator[r];if(s===c)return t.delegate=null,r==="throw"&&e.iterator.return&&(t.method="return",t.arg=c,nt(e,t),t.method==="throw")||r!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),S;var o=K(s,e.iterator,t.arg);if(o.type==="throw")return t.method="throw",t.arg=o.arg,t.delegate=null,S;var l=o.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,S;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=c);else return l;return t.delegate=null,S}rt(M),v(M,g,"Generator"),v(M,h,function(){return this}),v(M,"toString",function(){return"[object Generator]"});function St(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function J(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(St,this),this.reset(!0)}n.keys=function(e){var t=Object(e),r=[];for(var s in t)r.push(s);return r.reverse(),function o(){for(;r.length;){var l=r.pop();if(l in t)return o.value=l,o.done=!1,o}return o.done=!0,o}};function H(e){if(e){var t=e[h];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var r=-1,s=function o(){for(;++r<e.length;)if(i.call(e,r))return o.value=e[r],o.done=!1,o;return o.value=c,o.done=!0,o};return s.next=s}}return{next:ot}}n.values=H;function ot(){return{value:c,done:!0}}return x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(J),!e)for(var t in this)t.charAt(0)==="t"&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(b,y){return l.type="throw",l.arg=e,t.next=b,y&&(t.method="next",t.arg=c),!!y}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],l=o.completion;if(o.tryLoc==="root")return r("end");if(o.tryLoc<=this.prev){var m=i.call(o,"catchLoc"),d=i.call(o,"finallyLoc");if(m&&d){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(m){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else if(d){if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var o=s;break}}o&&(e==="break"||e==="continue")&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var l=o?o.completion:{};return l.type=e,l.arg=t,o?(this.method="next",this.next=o.finallyLoc,S):this.complete(l)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),S},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),J(r),S}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var s=r.completion;if(s.type==="throw"){var o=s.arg;J(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:H(e),resultName:t,nextLoc:r},this.method==="next"&&(this.arg=c),S}},n}(typeof Q=="object"?Q.exports:{});try{regeneratorRuntime=X}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=X:Function("r","regeneratorRuntime = r")(X)}});var f={};Vt(f,{Magic:()=>Dt});module.exports=Nt(f);var Yt=R(ft()),vt=require("@magic-sdk/provider"),It=R(require("process")),mt=R(require("localforage")),U=require("whatwg-url"),$=require("buffer"),dt=R(require("lodash")),yt=R(require("expo-application")),gt=require("@aveq-research/localforage-asyncstorage-driver"),Z=R(require("localforage-driver-memory"));var w=R(require("react")),W=require("react-native"),ut=require("react-native-webview"),j=require("@magic-sdk/provider"),ht=require("lodash");var Pt="MAGIC_PAYLOAD_FLAG_TYPED_ARRAY";function kt(){return W.StyleSheet.create({"magic-webview":{flex:1,backgroundColor:"transparent"},"webview-container":{flex:1,width:"100%",backgroundColor:"transparent",position:"absolute",top:0,left:0,right:0,bottom:0},show:{zIndex:1e4,elevation:1e4},hide:{zIndex:-1e4,elevation:0}})}var C=class extends j.ViewController{constructor(){super(...arguments);this.Relayer=()=>{let[i,p]=(0,w.useState)(!1),c=(0,w.useCallback)(_=>{this.webView=_},[]),E=(0,w.useCallback)(_=>{this.container=lt(ct({},_),{showOverlay:h,hideOverlay:L})},[]),h=(0,w.useCallback)(()=>{p(!0)},[]),L=(0,w.useCallback)(()=>{p(!1)},[]),g=(0,w.useMemo)(()=>[this.styles["webview-container"],i?this.styles.show:this.styles.hide],[i]),v=(0,w.useCallback)(_=>{this.handleReactNativeWebViewMessage(_)},[]);return w.default.createElement(W.View,{ref:E,style:g},w.default.createElement(ut.WebView,{ref:c,source:{uri:`${this.endpoint}/send/?params=${encodeURIComponent(this.parameters)}`},onMessage:v,style:this.styles["magic-webview"]}))}}init(){this.webView=null,this.container=null,this.styles=kt()}handleReactNativeWebViewMessage(i){var p;if(i.nativeEvent&&typeof i.nativeEvent.data=="string"&&(i.nativeEvent.url===`${this.endpoint}/send/?params=${encodeURIComponent(this.parameters)}`||i.nativeEvent.url===`${this.endpoint}/send/?params=${this.parameters}`)){let c=JSON.parse(i.nativeEvent.data,(E,h)=>{try{if(h&&typeof h=="object"&&h.flag&&h.flag==="MAGIC_PAYLOAD_FLAG_TYPED_ARRAY")return new global[h.constructor](h.data.split(","))}catch(L){}return h});if(c&&c.msgType&&this.messageHandlers.size){c.response=(p=c.response)!=null?p:{};let E={data:c};for(let h of this.messageHandlers.values())h(E)}}}hideOverlay(){this.container&&this.container.hideOverlay()}showOverlay(){this.container&&this.container.showOverlay()}_post(i){return T(this,null,function*(){if(this.webView&&this.webView.postMessage)this.webView.postMessage(JSON.stringify(i,(p,c)=>(0,ht.isTypedArray)(c)?{constructor:c.constructor.name,data:c.toString(),flag:Pt}:c),this.endpoint);else throw(0,j.createModalNotReadyError)()})}};var pt=require("@magic-sdk/provider"),Y=class extends pt.SDKBase{get Relayer(){return this.overlay.Relayer}};u(f,require("@magic-sdk/commons"),module.exports);global.process=dt.merge(global.process,It);global.process.browser=!1;global.Buffer=$.Buffer;global.URL=U.URL;global.URLSearchParams=U.URLSearchParams;global.btoa=n=>$.Buffer.from(n,"binary").toString("base64");global.atob=n=>$.Buffer.from(n,"base64").toString("binary");var Dt=(0,vt.createSDK)(Y,{platform:"react-native",sdkName:"@magic-sdk/react-native-expo",version:"13.1.1",bundleId:yt.applicationId,defaultEndpoint:"https://box.magic.link/",ViewController:C,configureStorage:()=>T(void 0,null,function*(){let n=mt.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"}),a=(0,gt.driverWithoutSerialization)();return yield Promise.all([n.defineDriver(a),n.defineDriver(Z)]),yield n.setDriver([a._driver,Z._driver]),n})});0&&(module.exports={Magic});
2
2
  //# sourceMappingURL=index.js.map
package/dist/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var ft=Object.create;var $=Object.defineProperty,ut=Object.defineProperties,ht=Object.getOwnPropertyDescriptor,pt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertyNames,Q=Object.getOwnPropertySymbols,mt=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var Z=(o,s,i)=>s in o?$(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,et=(o,s)=>{for(var i in s||(s={}))tt.call(s,i)&&Z(o,i,s[i]);if(Q)for(var i of Q(s))dt.call(s,i)&&Z(o,i,s[i]);return o},rt=(o,s)=>ut(o,pt(s));var yt=(o,s)=>()=>(s||o((s={exports:{}}).exports,s),s.exports);var gt=(o,s,i,u)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of vt(s))!tt.call(o,c)&&c!==i&&$(o,c,{get:()=>s[c],enumerable:!(u=ht(s,c))||u.enumerable});return o};var wt=(o,s,i)=>(i=o!=null?ft(mt(o)):{},gt(s||!o||!o.__esModule?$(i,"default",{value:o,enumerable:!0}):i,o));var N=(o,s,i)=>new Promise((u,c)=>{var w=d=>{try{b(i.next(d))}catch(h){c(h)}},f=d=>{try{b(i.throw(d))}catch(h){c(h)}},b=d=>d.done?u(d.value):Promise.resolve(d.value).then(w,f);b((i=i.apply(o,s)).next())});var nt=yt((Wt,B)=>{var K=function(o){"use strict";var s=Object.prototype,i=s.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},c,w=typeof Symbol=="function"?Symbol:{},f=w.iterator||"@@iterator",b=w.asyncIterator||"@@asyncIterator",d=w.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch{h=function(t,r,a){return t[r]=a}}function S(e,t,r,a){var n=t&&t.prototype instanceof D?t:D,l=Object.create(n.prototype),p=new j(a||[]);return u(l,"_invoke",{value:ct(e,r,p)}),l}o.wrap=S;function I(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(a){return{type:"throw",arg:a}}}var J="suspendedStart",st="suspendedYield",x="executing",R="completed",g={};function D(){}function M(){}function E(){}var T={};h(T,f,function(){return this});var C=Object.getPrototypeOf,G=C&&C(C(Y([])));G&&G!==s&&i.call(G,f)&&(T=G);var _=E.prototype=D.prototype=Object.create(T);M.prototype=E,u(_,"constructor",{value:E,configurable:!0}),u(E,"constructor",{value:M,configurable:!0}),M.displayName=h(E,d,"GeneratorFunction");function H(e){["next","throw","return"].forEach(function(t){h(e,t,function(r){return this._invoke(t,r)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===M||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,h(e,d,"GeneratorFunction")),e.prototype=Object.create(_),e},o.awrap=function(e){return{__await:e}};function V(e,t){function r(l,p,v,y){var m=I(e[l],e,p);if(m.type==="throw")y(m.arg);else{var U=m.arg,O=U.value;return O&&typeof O=="object"&&i.call(O,"__await")?t.resolve(O.__await).then(function(L){r("next",L,v,y)},function(L){r("throw",L,v,y)}):t.resolve(O).then(function(L){U.value=L,v(U)},function(L){return r("throw",L,v,y)})}}var a;function n(l,p){function v(){return new t(function(y,m){r(l,p,y,m)})}return a=a?a.then(v,v):v()}u(this,"_invoke",{value:n})}H(V.prototype),h(V.prototype,b,function(){return this}),o.AsyncIterator=V,o.async=function(e,t,r,a,n){n===void 0&&(n=Promise);var l=new V(S(e,t,r,a),n);return o.isGeneratorFunction(t)?l:l.next().then(function(p){return p.done?p.value:l.next()})};function ct(e,t,r){var a=J;return function(l,p){if(a===x)throw new Error("Generator is already running");if(a===R){if(l==="throw")throw p;return X()}for(r.method=l,r.arg=p;;){var v=r.delegate;if(v){var y=q(v,r);if(y){if(y===g)continue;return y}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(a===J)throw a=R,r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);a=x;var m=I(e,t,r);if(m.type==="normal"){if(a=r.done?R:st,m.arg===g)continue;return{value:m.arg,done:r.done}}else m.type==="throw"&&(a=R,r.method="throw",r.arg=m.arg)}}}function q(e,t){var r=t.method,a=e.iterator[r];if(a===c)return t.delegate=null,r==="throw"&&e.iterator.return&&(t.method="return",t.arg=c,q(e,t),t.method==="throw")||r!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var n=I(a,e.iterator,t.arg);if(n.type==="throw")return t.method="throw",t.arg=n.arg,t.delegate=null,g;var l=n.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=c);else return l;return t.delegate=null,g}H(_),h(_,d,"Generator"),h(_,f,function(){return this}),h(_,"toString",function(){return"[object Generator]"});function lt(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function W(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(lt,this),this.reset(!0)}o.keys=function(e){var t=Object(e),r=[];for(var a in t)r.push(a);return r.reverse(),function n(){for(;r.length;){var l=r.pop();if(l in t)return n.value=l,n.done=!1,n}return n.done=!0,n}};function Y(e){if(e){var t=e[f];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=c,n.done=!0,n};return a.next=a}}return{next:X}}o.values=Y;function X(){return{value:c,done:!0}}return j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(W),!e)for(var t in this)t.charAt(0)==="t"&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(y,m){return l.type="throw",l.arg=e,t.next=y,m&&(t.method="next",t.arg=c),!!m}for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a],l=n.completion;if(n.tryLoc==="root")return r("end");if(n.tryLoc<=this.prev){var p=i.call(n,"catchLoc"),v=i.call(n,"finallyLoc");if(p&&v){if(this.prev<n.catchLoc)return r(n.catchLoc,!0);if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else if(p){if(this.prev<n.catchLoc)return r(n.catchLoc,!0)}else if(v){if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&i.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var n=a;break}}n&&(e==="break"||e==="continue")&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var l=n?n.completion:{};return l.type=e,l.arg=t,n?(this.method="next",this.next=n.finallyLoc,g):this.complete(l)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),W(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var a=r.completion;if(a.type==="throw"){var n=a.arg;W(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:Y(e),resultName:t,nextLoc:r},this.method==="next"&&(this.arg=c),g}},o}(typeof B=="object"?B.exports:{});try{regeneratorRuntime=K}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=K:Function("r","regeneratorRuntime = r")(K)}});var Jt=wt(nt());import{createSDK as Nt}from"@magic-sdk/provider";import*as Pt from"process";import kt from"localforage";import{URL as It,URLSearchParams as Dt}from"whatwg-url";import{Buffer as z}from"buffer";import*as it from"lodash";import*as at from"expo-application";import{driverWithoutSerialization as Tt}from"@aveq-research/localforage-asyncstorage-driver";import*as F from"localforage-driver-memory";import ot,{useState as bt,useCallback as A,useMemo as St}from"react";import{StyleSheet as Et,View as Lt}from"react-native";import{WebView as _t}from"react-native-webview";import{ViewController as Ot,createModalNotReadyError as At}from"@magic-sdk/provider";import{isTypedArray as Rt}from"lodash";var Mt="MAGIC_PAYLOAD_FLAG_TYPED_ARRAY";function Gt(){return Et.create({"magic-webview":{flex:1,backgroundColor:"transparent"},"webview-container":{flex:1,width:"100%",backgroundColor:"transparent",position:"absolute",top:0,left:0,right:0,bottom:0},show:{zIndex:1e4,elevation:1e4},hide:{zIndex:-1e4,elevation:0}})}var P=class extends Ot{constructor(){super(...arguments);this.Relayer=()=>{let[i,u]=bt(!1),c=A(S=>{this.webView=S},[]),w=A(S=>{this.container=rt(et({},S),{showOverlay:f,hideOverlay:b})},[]),f=A(()=>{u(!0)},[]),b=A(()=>{u(!1)},[]),d=St(()=>[this.styles["webview-container"],i?this.styles.show:this.styles.hide],[i]),h=A(S=>{this.handleReactNativeWebViewMessage(S)},[]);return ot.createElement(Lt,{ref:w,style:d},ot.createElement(_t,{ref:c,source:{uri:`${this.endpoint}/send/?params=${encodeURIComponent(this.parameters)}`},onMessage:h,style:this.styles["magic-webview"]}))}}init(){this.webView=null,this.container=null,this.styles=Gt()}handleReactNativeWebViewMessage(i){var u;if(i.nativeEvent&&typeof i.nativeEvent.data=="string"&&(i.nativeEvent.url===`${this.endpoint}/send/?params=${encodeURIComponent(this.parameters)}`||i.nativeEvent.url===`${this.endpoint}/send/?params=${this.parameters}`)){let c=JSON.parse(i.nativeEvent.data,(w,f)=>{try{if(f&&typeof f=="object"&&f.flag&&f.flag==="MAGIC_PAYLOAD_FLAG_TYPED_ARRAY")return new global[f.constructor](f.data.split(","))}catch(b){}return f});if(c&&c.msgType&&this.messageHandlers.size){c.response=(u=c.response)!=null?u:{};let w={data:c};for(let f of this.messageHandlers.values())f(w)}}}hideOverlay(){this.container&&this.container.hideOverlay()}showOverlay(){this.container&&this.container.showOverlay()}_post(i){return N(this,null,function*(){if(this.webView&&this.webView.postMessage)this.webView.postMessage(JSON.stringify(i,(u,c)=>Rt(c)?{constructor:c.constructor.name,data:c.toString(),flag:Mt}:c),this.endpoint);else throw At()})}};import{SDKBase as Vt}from"@magic-sdk/provider";var k=class extends Vt{get Relayer(){return this.overlay.Relayer}};export*from"@magic-sdk/commons";global.process=it.merge(global.process,Pt);global.process.browser=!1;global.Buffer=z;global.URL=It;global.URLSearchParams=Dt;global.btoa=o=>z.from(o,"binary").toString("base64");global.atob=o=>z.from(o,"base64").toString("binary");var ne=Nt(k,{platform:"react-native",sdkName:"@magic-sdk/react-native-expo",version:"13.0.3",bundleId:at.applicationId,defaultEndpoint:"https://box.magic.link/",ViewController:P,configureStorage:()=>N(void 0,null,function*(){let o=kt.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"}),s=Tt();return yield Promise.all([o.defineDriver(s),o.defineDriver(F)]),yield o.setDriver([s._driver,F._driver]),o})});export{ne as Magic};
1
+ var ft=Object.create;var $=Object.defineProperty,ut=Object.defineProperties,ht=Object.getOwnPropertyDescriptor,pt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertyNames,Q=Object.getOwnPropertySymbols,mt=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var Z=(o,s,i)=>s in o?$(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,et=(o,s)=>{for(var i in s||(s={}))tt.call(s,i)&&Z(o,i,s[i]);if(Q)for(var i of Q(s))dt.call(s,i)&&Z(o,i,s[i]);return o},rt=(o,s)=>ut(o,pt(s));var yt=(o,s)=>()=>(s||o((s={exports:{}}).exports,s),s.exports);var gt=(o,s,i,u)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of vt(s))!tt.call(o,c)&&c!==i&&$(o,c,{get:()=>s[c],enumerable:!(u=ht(s,c))||u.enumerable});return o};var wt=(o,s,i)=>(i=o!=null?ft(mt(o)):{},gt(s||!o||!o.__esModule?$(i,"default",{value:o,enumerable:!0}):i,o));var N=(o,s,i)=>new Promise((u,c)=>{var w=d=>{try{b(i.next(d))}catch(h){c(h)}},f=d=>{try{b(i.throw(d))}catch(h){c(h)}},b=d=>d.done?u(d.value):Promise.resolve(d.value).then(w,f);b((i=i.apply(o,s)).next())});var nt=yt((Wt,B)=>{var K=function(o){"use strict";var s=Object.prototype,i=s.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},c,w=typeof Symbol=="function"?Symbol:{},f=w.iterator||"@@iterator",b=w.asyncIterator||"@@asyncIterator",d=w.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch{h=function(t,r,a){return t[r]=a}}function S(e,t,r,a){var n=t&&t.prototype instanceof D?t:D,l=Object.create(n.prototype),p=new j(a||[]);return u(l,"_invoke",{value:ct(e,r,p)}),l}o.wrap=S;function I(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(a){return{type:"throw",arg:a}}}var J="suspendedStart",st="suspendedYield",x="executing",R="completed",g={};function D(){}function M(){}function E(){}var T={};h(T,f,function(){return this});var C=Object.getPrototypeOf,G=C&&C(C(Y([])));G&&G!==s&&i.call(G,f)&&(T=G);var _=E.prototype=D.prototype=Object.create(T);M.prototype=E,u(_,"constructor",{value:E,configurable:!0}),u(E,"constructor",{value:M,configurable:!0}),M.displayName=h(E,d,"GeneratorFunction");function H(e){["next","throw","return"].forEach(function(t){h(e,t,function(r){return this._invoke(t,r)})})}o.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===M||(t.displayName||t.name)==="GeneratorFunction":!1},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,h(e,d,"GeneratorFunction")),e.prototype=Object.create(_),e},o.awrap=function(e){return{__await:e}};function V(e,t){function r(l,p,v,y){var m=I(e[l],e,p);if(m.type==="throw")y(m.arg);else{var U=m.arg,O=U.value;return O&&typeof O=="object"&&i.call(O,"__await")?t.resolve(O.__await).then(function(L){r("next",L,v,y)},function(L){r("throw",L,v,y)}):t.resolve(O).then(function(L){U.value=L,v(U)},function(L){return r("throw",L,v,y)})}}var a;function n(l,p){function v(){return new t(function(y,m){r(l,p,y,m)})}return a=a?a.then(v,v):v()}u(this,"_invoke",{value:n})}H(V.prototype),h(V.prototype,b,function(){return this}),o.AsyncIterator=V,o.async=function(e,t,r,a,n){n===void 0&&(n=Promise);var l=new V(S(e,t,r,a),n);return o.isGeneratorFunction(t)?l:l.next().then(function(p){return p.done?p.value:l.next()})};function ct(e,t,r){var a=J;return function(l,p){if(a===x)throw new Error("Generator is already running");if(a===R){if(l==="throw")throw p;return X()}for(r.method=l,r.arg=p;;){var v=r.delegate;if(v){var y=q(v,r);if(y){if(y===g)continue;return y}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(a===J)throw a=R,r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);a=x;var m=I(e,t,r);if(m.type==="normal"){if(a=r.done?R:st,m.arg===g)continue;return{value:m.arg,done:r.done}}else m.type==="throw"&&(a=R,r.method="throw",r.arg=m.arg)}}}function q(e,t){var r=t.method,a=e.iterator[r];if(a===c)return t.delegate=null,r==="throw"&&e.iterator.return&&(t.method="return",t.arg=c,q(e,t),t.method==="throw")||r!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var n=I(a,e.iterator,t.arg);if(n.type==="throw")return t.method="throw",t.arg=n.arg,t.delegate=null,g;var l=n.arg;if(!l)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g;if(l.done)t[e.resultName]=l.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=c);else return l;return t.delegate=null,g}H(_),h(_,d,"Generator"),h(_,f,function(){return this}),h(_,"toString",function(){return"[object Generator]"});function lt(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function W(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(lt,this),this.reset(!0)}o.keys=function(e){var t=Object(e),r=[];for(var a in t)r.push(a);return r.reverse(),function n(){for(;r.length;){var l=r.pop();if(l in t)return n.value=l,n.done=!1,n}return n.done=!0,n}};function Y(e){if(e){var t=e[f];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=c,n.done=!0,n};return a.next=a}}return{next:X}}o.values=Y;function X(){return{value:c,done:!0}}return j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(W),!e)for(var t in this)t.charAt(0)==="t"&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(y,m){return l.type="throw",l.arg=e,t.next=y,m&&(t.method="next",t.arg=c),!!m}for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a],l=n.completion;if(n.tryLoc==="root")return r("end");if(n.tryLoc<=this.prev){var p=i.call(n,"catchLoc"),v=i.call(n,"finallyLoc");if(p&&v){if(this.prev<n.catchLoc)return r(n.catchLoc,!0);if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else if(p){if(this.prev<n.catchLoc)return r(n.catchLoc,!0)}else if(v){if(this.prev<n.finallyLoc)return r(n.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&i.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var n=a;break}}n&&(e==="break"||e==="continue")&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var l=n?n.completion:{};return l.type=e,l.arg=t,n?(this.method="next",this.next=n.finallyLoc,g):this.complete(l)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),W(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var a=r.completion;if(a.type==="throw"){var n=a.arg;W(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:Y(e),resultName:t,nextLoc:r},this.method==="next"&&(this.arg=c),g}},o}(typeof B=="object"?B.exports:{});try{regeneratorRuntime=K}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=K:Function("r","regeneratorRuntime = r")(K)}});var Jt=wt(nt());import{createSDK as Nt}from"@magic-sdk/provider";import*as Pt from"process";import kt from"localforage";import{URL as It,URLSearchParams as Dt}from"whatwg-url";import{Buffer as z}from"buffer";import*as it from"lodash";import*as at from"expo-application";import{driverWithoutSerialization as Tt}from"@aveq-research/localforage-asyncstorage-driver";import*as F from"localforage-driver-memory";import ot,{useState as bt,useCallback as A,useMemo as St}from"react";import{StyleSheet as Et,View as Lt}from"react-native";import{WebView as _t}from"react-native-webview";import{ViewController as Ot,createModalNotReadyError as At}from"@magic-sdk/provider";import{isTypedArray as Rt}from"lodash";var Mt="MAGIC_PAYLOAD_FLAG_TYPED_ARRAY";function Gt(){return Et.create({"magic-webview":{flex:1,backgroundColor:"transparent"},"webview-container":{flex:1,width:"100%",backgroundColor:"transparent",position:"absolute",top:0,left:0,right:0,bottom:0},show:{zIndex:1e4,elevation:1e4},hide:{zIndex:-1e4,elevation:0}})}var P=class extends Ot{constructor(){super(...arguments);this.Relayer=()=>{let[i,u]=bt(!1),c=A(S=>{this.webView=S},[]),w=A(S=>{this.container=rt(et({},S),{showOverlay:f,hideOverlay:b})},[]),f=A(()=>{u(!0)},[]),b=A(()=>{u(!1)},[]),d=St(()=>[this.styles["webview-container"],i?this.styles.show:this.styles.hide],[i]),h=A(S=>{this.handleReactNativeWebViewMessage(S)},[]);return ot.createElement(Lt,{ref:w,style:d},ot.createElement(_t,{ref:c,source:{uri:`${this.endpoint}/send/?params=${encodeURIComponent(this.parameters)}`},onMessage:h,style:this.styles["magic-webview"]}))}}init(){this.webView=null,this.container=null,this.styles=Gt()}handleReactNativeWebViewMessage(i){var u;if(i.nativeEvent&&typeof i.nativeEvent.data=="string"&&(i.nativeEvent.url===`${this.endpoint}/send/?params=${encodeURIComponent(this.parameters)}`||i.nativeEvent.url===`${this.endpoint}/send/?params=${this.parameters}`)){let c=JSON.parse(i.nativeEvent.data,(w,f)=>{try{if(f&&typeof f=="object"&&f.flag&&f.flag==="MAGIC_PAYLOAD_FLAG_TYPED_ARRAY")return new global[f.constructor](f.data.split(","))}catch(b){}return f});if(c&&c.msgType&&this.messageHandlers.size){c.response=(u=c.response)!=null?u:{};let w={data:c};for(let f of this.messageHandlers.values())f(w)}}}hideOverlay(){this.container&&this.container.hideOverlay()}showOverlay(){this.container&&this.container.showOverlay()}_post(i){return N(this,null,function*(){if(this.webView&&this.webView.postMessage)this.webView.postMessage(JSON.stringify(i,(u,c)=>Rt(c)?{constructor:c.constructor.name,data:c.toString(),flag:Mt}:c),this.endpoint);else throw At()})}};import{SDKBase as Vt}from"@magic-sdk/provider";var k=class extends Vt{get Relayer(){return this.overlay.Relayer}};export*from"@magic-sdk/commons";global.process=it.merge(global.process,Pt);global.process.browser=!1;global.Buffer=z;global.URL=It;global.URLSearchParams=Dt;global.btoa=o=>z.from(o,"binary").toString("base64");global.atob=o=>z.from(o,"base64").toString("binary");var ne=Nt(k,{platform:"react-native",sdkName:"@magic-sdk/react-native-expo",version:"13.1.1",bundleId:at.applicationId,defaultEndpoint:"https://box.magic.link/",ViewController:P,configureStorage:()=>N(void 0,null,function*(){let o=kt.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"}),s=Tt();return yield Promise.all([o.defineDriver(s),o.defineDriver(F)]),yield o.setDriver([s._driver,F._driver]),o})});export{ne as Magic};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-sdk/react-native-expo",
3
- "version": "13.1.1-eebe81d",
3
+ "version": "13.1.1",
4
4
  "description": "Passwordless authentication for React Native (Expo).",
5
5
  "author": "Magic Labs <team@magic.link> (https://magic.link/)",
6
6
  "license": "MIT",
@@ -48,5 +48,5 @@
48
48
  "react-native": ">=0.60",
49
49
  "react-native-webview": ">=8"
50
50
  },
51
- "gitHead": "1ef062ea699d48d5e9a9375a93b7c147632b05ca"
51
+ "gitHead": "c3f5c0a687e5b6735003159dfd7449f52e92f6b7"
52
52
  }