@yodlpay/react-native 0.8.2 → 0.10.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.
package/README.md CHANGED
@@ -15,9 +15,9 @@ Drop-in crypto payments for React Native. You bring an [EIP-1193](https://eips.e
15
15
  The provider interface is always plain **EIP-1193**. Transaction **batching and paymasters** ride on top via **[EIP-5792](https://eips.ethereum.org/EIPS/eip-5792)** (`wallet_sendCalls`) — available when your wallet supports EIP-5792 natively, or through the optional [EIP-7702 add-on](#optional-eip-7702-fallback) for wallets that don't.
16
16
 
17
17
  ```tsx
18
- import { createSdk, YodlProvider, YodlPayment } from '@yodlpay/react-native';
18
+ import { createYodlSdk, YodlProvider, YodlPayment } from '@yodlpay/react-native';
19
19
 
20
- const sdk = createSdk({
20
+ const sdk = createYodlSdk({
21
21
  integrationAddress: '0x000000000000000000000000000000000000dEaD',
22
22
  supportedChainIds: [1, 8453],
23
23
  });
@@ -81,10 +81,10 @@ Then rebuild the app. That's the full install.
81
81
  Three steps: create the SDK once, wrap your screen in `<YodlProvider>`, render `<YodlPayment>`.
82
82
 
83
83
  ```tsx
84
- import { createSdk, isPaymentQr, YodlProvider, YodlPayment } from '@yodlpay/react-native';
84
+ import { createYodlSdk, isPaymentQr, YodlProvider, YodlPayment } from '@yodlpay/react-native';
85
85
 
86
86
  // 1. Create the SDK once, app-wide.
87
- const sdk = createSdk({
87
+ const sdk = createYodlSdk({
88
88
  integrationAddress: '0x000000000000000000000000000000000000dEaD', // your integration wallet address
89
89
  supportedChainIds: [1, 8453],
90
90
  });
@@ -138,7 +138,7 @@ Most apps just need the install above and a native rebuild. Edge cases:
138
138
 
139
139
  ## Usage
140
140
 
141
- Create the SDK once with `createSdk(config)` and supply wallet state at runtime via `<YodlProvider>`. Stateless helpers like `isPaymentQr(qrData)` are standalone exports — no SDK instance required to call them.
141
+ Create the SDK once with `createYodlSdk(config)` and supply wallet state at runtime via `<YodlProvider>`. Stateless helpers like `isPaymentQr(qrData)` are standalone exports — no SDK instance required to call them.
142
142
 
143
143
  ### Signup flow
144
144
 
@@ -278,6 +278,7 @@ Circular elements — avatars, token icons, sheet grab handles, status rings —
278
278
  - `radiusControl` / `radiusSurface` must be a plain CSS length — a bare `0`, or a number of up to 4 digits with `px`, `rem`, `em`, or `%` (`.5rem` is as valid as `0.5rem`). A unitless number other than zero (`'4'` rather than `'4px'`) is not a CSS length and is rejected, as are expressions such as `calc(…)` and `var(…)`.
279
279
  - **A single invalid key rejects the whole theme**, so the hosted UI falls back to stock rather than applying a half-valid palette. Validate with `safeParseYodlTheme()` before sending — it returns the offending key by name.
280
280
  - Images go under `images.light` / `images.dark`, each with `payBackground`, `loading`, and `processing` slots. `loading` and `processing` are one visual slot: the hosted UI has a single splash state and renders `loading`, falling back to `processing` only when `loading` is unset — setting `loading` alone covers everything, and there is no need to set both. A video URL (`.mp4`, `.m4v`, `.webm`, `.mov`) plays as a looping muted video; anything else renders as an image, so every browser-supported image format works — including animated WebP, APNG, animated AVIF, and GIF. `.ogv` is excluded on purpose — iOS WebViews cannot decode Ogg/Theora, so it would blank the splash there.
281
+ - The `loading` splash renders **above the stepped caption**, in normal flow where the stock Yodl mark sits — not over the whole viewport. The media keeps its own aspect ratio and is scaled proportionally within maximum dimensions; it is not placed into a container of a set size. The maxima are 16rem wide, no more than 70% of the viewport width, and no more than 40% of its height. Width is applied first and the height follows from the asset's own ratio, so a wide asset occupies a shorter band than a square one and the vertical space taken varies by shape. Source pixel dimensions cannot bypass the maxima: a 4000px-wide asset is scaled down to the same width as a 400px-wide one of the same shape, only sharper. The fit is `contain`, so the media is only ever scaled down to stay within the maxima — never cropped to fill the viewport the way a background image would be — and the whole asset stays visible. Images and videos behave identically. Author roughly square (around 512×512) for predictable scaling, keep important detail away from the edges, and use `payBackground` for a full-screen backdrop.
281
282
  - Image URLs must be `https://`, at most 2048 characters, with no whitespace, quotes, or backslashes.
282
283
  - An invalid `theme` or `themeMode` never crashes — it falls back to stock Yodl and logs the error in `__DEV__`.
283
284
 
@@ -292,9 +293,9 @@ Changing `theme` / `themeMode` on a mounted component applies over the bridge **
292
293
  **`sdk.ts`** — create the instance once, app-wide:
293
294
 
294
295
  ```tsx
295
- import { createSdk } from '@yodlpay/react-native';
296
+ import { createYodlSdk } from '@yodlpay/react-native';
296
297
 
297
- export const sdk = createSdk({
298
+ export const sdk = createYodlSdk({
298
299
  integrationAddress: '0x000000000000000000000000000000000000dEaD',
299
300
  // yodlUiBaseUrl defaults to https://sdk-webview.yodl.me
300
301
  supportedChainIds: [1, 42161, 8453, 137, 10, 56, 100],
@@ -400,9 +401,9 @@ Base SDK users can skip this entirely. Without it, a wallet that lacks native EI
400
401
 
401
402
  ## API Reference
402
403
 
403
- ### `createSdk(config)`
404
+ ### `createYodlSdk(config)`
404
405
 
405
- Returns a `Yodl` instance.
406
+ Returns a `YodlSdk` instance.
406
407
 
407
408
  | Option | Type | Required | Default | Description |
408
409
  | ------------------- | ----------------------------- | -------- | ----------------------------- | -------------------------------------------------------------------------- |
@@ -438,8 +439,8 @@ Supplies the SDK instance and wallet state to the components. Render it once, hi
438
439
 
439
440
  | Prop | Type | Required | Description |
440
441
  | ---------- | ----------------- | -------- | ------------------------------------- |
441
- | `sdk` | `Yodl` | Yes | Instance from `createSdk()` |
442
- | `provider` | `EIP1193Provider` | Yes | EIP-1193 provider from any wallet SDK. Prefer the wallet's native EIP-5792 support; only if it lacks it, wrap with `withYodl7702(...)` for the [EIP-7702 fallback](#optional-eip-7702-fallback) |
442
+ | `sdk` | `YodlSdk` | Yes | Instance from `createYodlSdk()` |
443
+ | `provider` | `EIP1193Provider` | Yes | EIP-1193 provider from any wallet SDK (`@yodlpay/sdk-core`'s type: `request` only, events not required; `withYodl7702` accepts and returns the same type, so no cast is needed). Prefer the wallet's native EIP-5792 support; only if it lacks it, wrap with `withYodl7702(...)` for the [EIP-7702 fallback](#optional-eip-7702-fallback) |
443
444
  | `address` | `string` | Yes | Connected wallet address |
444
445
  | `chainId` | `number` | Yes | Chain ID the wallet is currently on |
445
446
  | `theme` | `YodlTheme` | No | Default custom hosted-UI palette; all fields are optional |
@@ -487,7 +488,7 @@ Renders the payment flow for a scanned QR code. Renders nothing if `qrData` is e
487
488
  | `onPaymentDetails` | `(details: YodlPaymentDetails) => void` | No | Called with payment lifecycle details from the UI |
488
489
  | `onError` | `(error: Error) => void` | No | Called on RPC / payment errors |
489
490
 
490
- `navigateOnSubmit="never"` parks the hosted UI on a terminal "sent" frame so your app owns the transition after signing — drive it from `onTransactionSent` or `onPaymentDetails`. Note the moment: the hosted UI moves when the transaction is **submitted**, not when it settles. A host that ignores both callbacks leaves the user on that frame, which is why the default is `'always'`: omit the prop and the URL, and therefore the behavior, is unchanged. The prop feeds the WebView's URL and the WebView is keyed by it, so changing it on a mounted component reloads the hosted UI — pass a constant.
491
+ `navigateOnSubmit="never"` parks the hosted UI on a terminal "sent" frame so your app owns the transition after signing — drive it from `onTransactionSent` or `onPaymentDetails`. Note the moment: the hosted UI moves when the transaction is **submitted**, not when it settles. It keeps polling behind that frame, so `onPaymentDetails` still reports `'processing'` and then `'success'` or `'failure'` — you get a `'submitted'` message first, then the same stream `'always'` produces. A host that ignores both callbacks leaves the user on that frame, which is why the default is `'always'`: omit the prop and the URL, and therefore the behavior, is unchanged. The prop feeds the WebView's URL and the WebView is keyed by it, so changing it on a mounted component reloads the hosted UI — pass a constant.
491
492
 
492
493
  ### `<YodlDashboard />`
493
494
 
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react-native"),n=require("react/jsx-runtime"),r=require("react-native-webview");const i=/^0x[0-9a-fA-F]{40}$/,a=/^(?:#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\(\s*[\d.%\s,/]+\s*\))$/i,o=/^https:\/\/[^\s"\\]+$/,s=/^(?:0|(?:\d{1,4}(?:\.\d{1,3})?|\.\d{1,3})(?:px|rem|em|%))$/i,c=new Set([`system`,`inter`,`geist`,`mono`]),l=[`bg`,`surface`,`surfaceSecondary`,`text`,`textSecondary`,`textMuted`,`border`,`success`,`error`,`warning`,`accent`,`bgDeep`,`surfaceHover`,`skeleton`,`accentStrong`,`accentDeep`,`brandSurface`,`brandSheet`,`brandText`,`brandButton`,`brandButtonText`],u=[`payBackground`,`processing`,`loading`];function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e,t){if(!d(e))return{success:!1,error:`${t}: expected an object`};let n={};for(let r of l){let i=e[r];if(i!==void 0){if(typeof i!=`string`||!a.test(i))return{success:!1,error:`${t}.${r}: colors must be hex, rgb() or rgba()`};n[r]=i}}return{success:!0,data:n}}function p(e,t){if(!d(e))return{success:!1,error:`${t}: expected an object`};let n={};for(let r of u){let i=e[r];if(i!==void 0){if(typeof i!=`string`||i.length>2048||!o.test(i))return{success:!1,error:`${t}.${r}: images must be https:// URLs`};n[r]=i}}return{success:!0,data:n}}function m(e){if(!d(e))return{success:!1,error:`images: expected an object`};let t=Object.keys(e).find(e=>e!==`light`&&e!==`dark`);if(t)return{success:!1,error:`images.${t}: unknown key`};let n={};for(let t of[`light`,`dark`]){if(e[t]===void 0)continue;let r=p(e[t],`images.${t}`);if(!r.success)return r;n[t]=r.data}return{success:!0,data:n}}function h(e){if(!d(e))return{success:!1,error:`(root): expected an object`};let t={};if(e.name!==void 0){if(typeof e.name!=`string`||e.name.length>64)return{success:!1,error:`name: must be a string of at most 64 characters`};t.name=e.name}if(e.font!==void 0){if(typeof e.font!=`string`||!c.has(e.font))return{success:!1,error:`font: must be one of ${[...c].join(`, `)}`};t.font=e.font}for(let n of[`radiusControl`,`radiusSurface`]){let r=e[n];if(r!==void 0){if(typeof r!=`string`||!s.test(r))return{success:!1,error:`${n}: radius must be a css length`};t[n]=r}}for(let n of[`light`,`dark`]){if(e[n]===void 0)continue;let r=f(e[n],n);if(!r.success)return r;t[n]=r.data}if(e.images!==void 0){let n=m(e.images);if(!n.success)return n;t.images=n.data}return{success:!0,data:t}}function g(e,t,n=1){return typeof e==`string`&&e.length>=n&&e.length<=t}function _(e,t){return typeof e==`string`&&t.test(e)}function v(e,t){for(let n in e)if(!t.has(n))return!1;return!0}function y(e){if(!d(e)||Object.keys(e).length!==3)return!1;let{type:t,version:n,sessionId:r}=e;return!(t!==`yodl_ready`||n!==1||!g(r,128))}const b=new Set([`type`,`version`,`sessionId`,`requestId`,`address`]);function x(e){if(!d(e)||!v(e,b))return!1;let{type:t,version:n,sessionId:r,requestId:a,address:o}=e;return!(t!==`yodl_email_attestation_request`||n!==1||!g(r,128)||!g(a,64)||!_(o,i))}const S={light:{background:`#f8f8fc`,spinner:`#52525b`},dark:{background:`#18181b`,spinner:`#a1a1aa`}};function C(e,t){return e===`system`?t===`light`?`light`:`dark`:e}function w(e,t,n){if(e===void 0&&t===void 0)return{envelope:null,error:null};let r=e===void 0?null:h(e),i=t===void 0||t===`system`||t===`light`||t===`dark`,a=i?t??`system`:`system`,o=[r&&!r.success?`Invalid Yodl theme — ${r.error}`:null,i?null:`Invalid Yodl themeMode — themeMode must be system, light or dark`].filter(e=>e!==null);return{envelope:{version:1,authority:`host`,theme:r?.success?r.data:null,preference:a,resolved:C(a,n)},error:o.length>0?o.join(`; `):null}}function T(e,t){let n=S[e?e.resolved:`dark`],r=e?.theme?.[e.resolved];return{background:t??r?.bg??n.background,spinner:r?.textSecondary??n.spinner}}function E(e,t,n){return{yodl:{version:1,sessionId:e,...t?{hostTheme:t}:{},...n?{integrationAddress:n}:{}}}}function ee(e,t){return t?{channel:`yodl`,sessionId:e,type:`theme:update`,payload:t}:{channel:`yodl`,sessionId:e,type:`theme:release`}}function D(e,t){return JSON.stringify(ee(e,t))}function O(e,t,n,r){let{envelope:i,error:a}=w(e,t,n);return a&&r?.(a),i}function k(e,t,n,r,i){if(t===void 0&&n===void 0)return e;let{envelope:a,error:o}=w(t??e?.theme??void 0,n??e?.preference,r);return o&&i?.(o),a}function A(e){typeof __DEV__<`u`&&__DEV__&&console.error(`[@yodlpay/react-native] ${e}`)}const j=(0,e.createContext)(null);function M({sdk:r,provider:i,address:a,chainId:o,theme:s,themeMode:c,children:l}){let u=(0,t.useColorScheme)(),d=(0,e.useMemo)(()=>O(s,c,u,A),[s,c,u]),f=(0,e.useMemo)(()=>({sdk:r,provider:i,address:a,chainId:o,supportedChainIds:r.config.supportedChainIds,hostTheme:d,systemScheme:u}),[r,i,a,o,d,u]);return(0,n.jsx)(j.Provider,{value:f,children:l})}function N(){let t=(0,e.useContext)(j);if(!t)throw Error(`Yodl components must be rendered inside <YodlProvider>.`);return t}function P(t,n){let r=N(),i=(0,e.useMemo)(()=>k(r.hostTheme,t,n,r.systemScheme,A),[r.hostTheme,r.systemScheme,t,n]);return{...r,hostTheme:i}}function F(e){if(e.code===4001)return!0;let t=e.message.toLowerCase();return t.includes(`rejected`)||t.includes(`denied`)}function I(e,t){if(e instanceof Error)return e;if(typeof e==`object`&&e){let t=e;if(typeof t.message==`string`){let e=Error(t.message);return typeof t.code==`number`&&(e.code=t.code),e}}return Error(t)}function L(e,t=-32603){let n=e.code;return{code:typeof n==`number`?n:t,message:e.message}}function R(e){if(typeof e!=`string`||!/^0x(?:0|[1-9a-f][0-9a-f]*)$/i.test(e))return;let t=Number.parseInt(e,16);return Number.isSafeInteger(t)?t:void 0}function z(e){let t=e.code;if(t===4200||t===-32601)return!0;let n=e.message.toLowerCase();return n.includes(`method not found`)||n.includes(`method not supported`)||n.includes(`unsupported method`)||n.includes(`unsupported wc_ method`)||n.includes(`not supported`)||n.includes(`does not exist`)||n.includes(`not available`)}function te(e){return e.match(/^(https?:\/\/[^/?#]+)/i)?.[1]??null}function ne(e,t){if(!e.startsWith(t))return!1;let n=e.charAt(t.length);return n===``||n===`/`||n===`?`||n===`#`}const re=/^0x[a-fA-F0-9]{40}$/;function B(e){let t=e?.integrationAddress?.trim();if(!t)throw Error(`Yodl integrationAddress is required`);if(!re.test(t))throw Error(`Yodl integrationAddress is not a valid address: ${t}`);return t}function V(e){return{"X-Yodl-Integration-Id":B(e),"X-Yodl-SDK-Name":`@yodlpay/react-native`,"X-Yodl-SDK-Version":`0.8.2`}}function ie(e,t){let n=e.yodlUiBaseUrl?te(e.yodlUiBaseUrl):null;if(!(!n||!ne(t,n)))return V(e)}let ae=0;function oe(){return ae+=1,`yodl-${Date.now().toString(36)}-${ae.toString(36)}`}function se(e,t=oe){return{sessionId:t(),initialHostTheme:e}}function ce(e,t){return JSON.stringify({channel:`yodl`,sessionId:e,type:`auth:capabilities`,payload:{emailAttestation:t}})}function le(e,t,n){return JSON.stringify({channel:`yodl`,sessionId:e,type:`auth:email-attestation`,requestId:t,payload:n})}function H(e){return`0x${e.toString(16)}`}function ue(e,t=`unsupported`){let n={};for(let r of e)n[H(r)]={atomic:{status:t}};return n}function U(e){return e.toLowerCase()}function de(e,t){let n=U(t.address),r=e.address!==n,i=e.propChainId!==t.chainId;if(!r&&!i)return null;let a=i&&e.activeChainId!==t.chainId;return{nextAddress:n,nextPropChainId:t.chainId,nextActiveChainId:a?t.chainId:e.activeChainId,...r?{accountsChanged:[n]}:{},...a?{chainChanged:{chainId:t.chainId,chainIdHex:H(t.chainId)}}:{}}}function fe(e){return{sessionId:e,answeredRequestIds:new Set,inFlightRequestId:null,mintCount:0}}function pe(e){return{state:e,decision:{kind:`ignore`}}}function W(e,t,n){return{state:{...e,answeredRequestIds:new Set(e.answeredRequestIds).add(t)},decision:{kind:`reject`,requestId:t,reason:n}}}function me(e,t,n){return!x(t)||t.sessionId!==e.sessionId||e.answeredRequestIds.has(t.requestId)?pe(e):n.supported?U(t.address)===U(n.walletAddress)?e.inFlightRequestId!==null||e.mintCount>=3?W(e,t.requestId,`rate_limited`):{state:{...e,answeredRequestIds:new Set(e.answeredRequestIds).add(t.requestId),inFlightRequestId:t.requestId,mintCount:e.mintCount+1},decision:{kind:`mint`,request:t}}:W(e,t.requestId,`address_mismatch`):W(e,t.requestId,`not_supported`)}function he(e,t){return e.inFlightRequestId===t?{...e,inFlightRequestId:null}:e}const ge=[`wallet_addEthereumChain`,`wallet_switchEthereumChain`];function _e(e){return ge.some(t=>t===e)}function ve(e,t,n){if(!_e(e))return{error:{code:4200,message:`Unsupported chain method: ${e}`}};let r=R((t[0]??{}).chainId);if(typeof r!=`number`)return{error:{code:-32602,message:`Missing or invalid chainId parameter`}};if(!n.includes(r))return{error:{code:4902,message:`Chain ${r} not supported`}};let i=H(r);return{providerMethod:e,providerParams:e===`wallet_switchEthereumChain`?[{chainId:i}]:t,requestedChainId:r,chainIdHex:i,switchesActiveChain:e===`wallet_switchEthereumChain`}}function ye(e,t){let n=e[1];return Array.isArray(n)?n.map(e=>R(e)).filter(e=>typeof e==`number`&&t.includes(e)):t}function be(e){return e.status===200||e.statusCode===200||e.status===`success`||e.status===`CONFIRMED`}function xe(e){return e.status===`0x0`||e.status===`reverted`||e.status===`failure`||e.status===0}function Se(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(!be(t))return;let n=t.receipts;if(n?.length&&!n.some(xe))return n[n.length-1]?.transactionHash}function Ce(e){let t=H(e.chainId);return`(function() {
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react-native"),n=require("react/jsx-runtime"),r=require("react-native-webview");const i=/^0x[a-fA-F0-9]{40}$/;function a(e){return typeof e==`string`&&i.test(e)}function o(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const s=new Set([`checking`,`signed_out`,`signing_up`,`signed_up`]);function c(e){if(e===void 0)return!0;if(!o(e))return!1;let{message:t,code:n}=e;return t!==void 0&&typeof t!=`string`?!1:n===void 0||typeof n==`string`||typeof n==`number`}function l(e){if(!o(e))return!1;switch(e.type){case`yodl_payment_details`:return o(e.details);case`yodl_payment_error`:case`yodl_signup_error`:return c(e.error);case`yodl_signup_status`:return typeof e.status==`string`&&s.has(e.status);case`yodl_signup_complete`:case`yodl_signup_dismissed`:return!0;case`ethereum_rpc_request`:return typeof e.id==`number`&&typeof e.method==`string`&&Array.isArray(e.params);default:return!1}}const u=/^(?:#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\([\d.%\s,/]+\))$/i,d=/^(?:0|(?:\d{1,4}(?:\.\d{1,3})?|\.\d{1,3})(?:px|rem|em|%))$/i,f=/^https:\/\/[^\s"\\]+$/,p=[`system`,`inter`,`geist`,`mono`],m=[`bg`,`surface`,`surfaceSecondary`,`text`,`textSecondary`,`textMuted`,`border`,`success`,`error`,`warning`,`accent`,`bgDeep`,`surfaceHover`,`skeleton`,`accentStrong`,`accentDeep`,`brandSurface`,`brandSheet`,`brandText`,`brandButton`,`brandButtonText`],h=[`payBackground`,`processing`,`loading`];function g(e,t){return t?{channel:`yodl`,sessionId:e,type:`theme:update`,payload:t}:{channel:`yodl`,sessionId:e,type:`theme:release`}}function _(e,t){return{channel:`yodl`,sessionId:e,type:`auth:capabilities`,payload:{emailAttestation:t}}}function v(e,t,n){return{channel:`yodl`,sessionId:e,type:`auth:email-attestation`,requestId:t,payload:n}}const y=new Set([`system`,`light`,`dark`]);function b(e){return typeof e==`string`&&y.has(e)}const x=new Set(p);function S(e,t){if(!o(e))return{success:!1,error:`${t}: expected an object`};let n={};for(let r of m){let i=e[r];if(i!==void 0){if(typeof i!=`string`||i.length>64||!u.test(i))return{success:!1,error:`${t}.${r}: colors must be hex, rgb() or rgba()`};n[r]=i}}return{success:!0,data:n}}function C(e,t){if(!o(e))return{success:!1,error:`${t}: expected an object`};let n={};for(let r of h){let i=e[r];if(i!==void 0){if(typeof i!=`string`||i.length>2048||!f.test(i))return{success:!1,error:`${t}.${r}: images must be https:// URLs`};n[r]=i}}return{success:!0,data:n}}function w(e){if(!o(e))return{success:!1,error:`images: expected an object`};let t=Object.keys(e).find(e=>e!==`light`&&e!==`dark`);if(t)return{success:!1,error:`images.${t}: unknown key`};let n={};for(let t of[`light`,`dark`]){if(e[t]===void 0)continue;let r=C(e[t],`images.${t}`);if(!r.success)return r;n[t]=r.data}return{success:!0,data:n}}function T(e){if(!o(e))return{success:!1,error:`(root): expected an object`};let t={};if(e.name!==void 0){if(typeof e.name!=`string`||e.name.length>64)return{success:!1,error:`name: must be a string of at most 64 characters`};t.name=e.name}if(e.font!==void 0){if(typeof e.font!=`string`||!x.has(e.font))return{success:!1,error:`font: must be one of ${[...x].join(`, `)}`};t.font=e.font}for(let n of[`radiusControl`,`radiusSurface`]){let r=e[n];if(r!==void 0){if(typeof r!=`string`||!d.test(r))return{success:!1,error:`${n}: radius must be a css length`};t[n]=r}}for(let n of[`light`,`dark`]){if(e[n]===void 0)continue;let r=S(e[n],n);if(!r.success)return r;t[n]=r.data}if(e.images!==void 0){let n=w(e.images);if(!n.success)return n;t.images=n.data}return{success:!0,data:t}}function E(e,t,n=1){return typeof e==`string`&&e.length>=n&&e.length<=t}function D(e,t){for(let n in e)if(!t.has(n))return!1;return!0}function O(e){if(!o(e)||Object.keys(e).length!==3)return!1;let{type:t,version:n,sessionId:r}=e;return!(t!==`yodl_ready`||n!==1||!E(r,128))}const k=new Set([`type`,`version`,`sessionId`,`requestId`,`address`]);function ee(e){if(!o(e)||!D(e,k))return!1;let{type:t,version:n,sessionId:r,requestId:i,address:s}=e;return!(t!==`yodl_email_attestation_request`||n!==1||!E(r,128)||!E(i,64)||!a(s))}const A={light:{background:`#f8f8fc`,spinner:`#52525b`},dark:{background:`#18181b`,spinner:`#a1a1aa`}};function j(e,t){return e===`system`?t===`light`?`light`:`dark`:e}function M(e,t,n){if(e===void 0&&t===void 0)return{envelope:null,error:null};let r=e===void 0?null:T(e),i=t===void 0||b(t),a=i?t??`system`:`system`,o=[r&&!r.success?`Invalid Yodl theme — ${r.error}`:null,i?null:`Invalid Yodl themeMode — themeMode must be system, light or dark`].filter(e=>e!==null);return{envelope:{version:1,authority:`host`,theme:r?.success?r.data:null,preference:a,resolved:j(a,n)},error:o.length>0?o.join(`; `):null}}function N(e,t){let n=A[e?e.resolved:`dark`],r=e?.theme?.[e.resolved];return{background:t??r?.bg??n.background,spinner:r?.textSecondary??n.spinner}}function P(e,t,n){return{yodl:{version:1,sessionId:e,...t?{hostTheme:t}:{},...n?{integrationAddress:n}:{}}}}function F(e,t){return JSON.stringify(g(e,t))}function I(e,t,n,r){let{envelope:i,error:a}=M(e,t,n);return a&&r?.(a),i}function L(e,t,n,r,i){if(t===void 0&&n===void 0)return e;let{envelope:a,error:o}=M(t??e?.theme??void 0,n??e?.preference,r);return o&&i?.(o),a}function R(e){typeof __DEV__<`u`&&__DEV__&&console.error(`[@yodlpay/react-native] ${e}`)}const z=(0,e.createContext)(null);function te({sdk:r,provider:i,address:a,chainId:o,theme:s,themeMode:c,children:l}){let u=(0,t.useColorScheme)(),d=(0,e.useMemo)(()=>I(s,c,u,R),[s,c,u]),f=(0,e.useMemo)(()=>({sdk:r,provider:i,address:a,chainId:o,supportedChainIds:r.config.supportedChainIds,hostTheme:d,systemScheme:u}),[r,i,a,o,d,u]);return(0,n.jsx)(z.Provider,{value:f,children:l})}function ne(){let t=(0,e.useContext)(z);if(!t)throw Error(`Yodl components must be rendered inside <YodlProvider>.`);return t}function B(t,n){let r=ne(),i=(0,e.useMemo)(()=>L(r.hostTheme,t,n,r.systemScheme,R),[r.hostTheme,r.systemScheme,t,n]);return{...r,hostTheme:i}}function re(e){let t=e?.integrationAddress?.trim();if(!t)throw Error(`Yodl integrationAddress is required`);if(!a(t))throw Error(`Yodl integrationAddress is not a valid address: ${t}`);return t}function ie(e,t){return{"X-Yodl-Integration-Id":re(e),"X-Yodl-SDK-Name":t.name,"X-Yodl-SDK-Version":t.version}}function V(e,t){if(e instanceof Error)return e;if(typeof e==`object`&&e){let t=e;if(typeof t.message==`string`){let e=Error(t.message);return typeof t.code==`number`&&(e.code=t.code),e}}return Error(t)}function ae(e){return e.code===4001||/rejected|denied/i.test(e.message)}const oe=[`method not found`,`method not supported`,`unsupported method`,`does not exist`],se=[...oe,`not supported`,`not available`];function ce(e,t){let n=[e.message,e.details].filter(e=>typeof e==`string`).join(` `).toLowerCase();return t.some(e=>n.includes(e))}function le(e){let t=e.code;return typeof t==`number`?t===4200||t===-32601||ce(e,oe):ce(e,se)}function ue(e){return e.match(/^(https?:\/\/[^/?#]+)/i)?.[1]??null}function de(e,t){if(!e.startsWith(t))return!1;let n=e.charAt(t.length);return n===``||n===`/`||n===`?`||n===`#`}const fe={name:`@yodlpay/react-native`,version:`0.10.0`};function pe(e){return ie(e,fe)}function me(e,t){let n=e.yodlUiBaseUrl?ue(e.yodlUiBaseUrl):null;if(!(!n||!de(t,n)))return pe(e)}let he=0;function ge(){return he+=1,`yodl-${Date.now().toString(36)}-${he.toString(36)}`}function _e(e,t=ge){return{sessionId:t(),initialHostTheme:e}}function H(e,t=-32603){let n=e.code;return{code:typeof n==`number`?n:t,message:e.message}}function ve(e){if(typeof e!=`string`||!/^0x(?:0|[1-9a-f][0-9a-f]*)$/i.test(e))return;let t=Number.parseInt(e,16);return Number.isSafeInteger(t)?t:void 0}function ye(e,t){let n=e[1];return Array.isArray(n)?n.map(e=>ve(e)).filter(e=>typeof e==`number`&&t.includes(e)):t}function be(e){return e.status===200||e.statusCode===200||e.status===`success`||e.status===`CONFIRMED`}function xe(e){return e.status===`0x0`||e.status===`reverted`||e.status===`failure`||e.status===0}function Se(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(!be(t))return;let n=t.receipts;if(n?.length&&!n.some(xe))return n[n.length-1]?.transactionHash}function U(e){return`0x${e.toString(16)}`}function Ce(e,t=`unsupported`){let n={};for(let r of e)n[U(r)]={atomic:{status:t}};return n}function W(e){return e.toLowerCase()}function we(e,t){let n=W(t.address),r=e.address!==n,i=e.propChainId!==t.chainId;if(!r&&!i)return null;let a=i&&e.activeChainId!==t.chainId;return{nextAddress:n,nextPropChainId:t.chainId,nextActiveChainId:a?t.chainId:e.activeChainId,...r?{accountsChanged:[n]}:{},...a?{chainChanged:{chainId:t.chainId,chainIdHex:U(t.chainId)}}:{}}}function Te(e){return{sessionId:e,answeredRequestIds:new Set,inFlightRequestId:null,mintCount:0}}function Ee(e){return{state:e,decision:{kind:`ignore`}}}function G(e,t,n){return{state:{...e,answeredRequestIds:new Set(e.answeredRequestIds).add(t)},decision:{kind:`reject`,requestId:t,reason:n}}}function De(e,t,n){return!ee(t)||t.sessionId!==e.sessionId||e.answeredRequestIds.has(t.requestId)?Ee(e):n.supported?W(t.address)===W(n.walletAddress)?e.inFlightRequestId!==null||e.mintCount>=3?G(e,t.requestId,`rate_limited`):{state:{...e,answeredRequestIds:new Set(e.answeredRequestIds).add(t.requestId),inFlightRequestId:t.requestId,mintCount:e.mintCount+1},decision:{kind:`mint`,request:t}}:G(e,t.requestId,`address_mismatch`):G(e,t.requestId,`not_supported`)}function Oe(e,t){return e.inFlightRequestId===t?{...e,inFlightRequestId:null}:e}const ke=[`wallet_addEthereumChain`,`wallet_switchEthereumChain`];function Ae(e){return ke.some(t=>t===e)}function je(e,t,n){if(!Ae(e))return{error:{code:4200,message:`Unsupported chain method: ${e}`}};let r=ve((t[0]??{}).chainId);if(typeof r!=`number`)return{error:{code:-32602,message:`Missing or invalid chainId parameter`}};if(!n.includes(r))return{error:{code:4902,message:`Chain ${r} not supported`}};let i=U(r);return{providerMethod:e,providerParams:e===`wallet_switchEthereumChain`?[{chainId:i}]:t,requestedChainId:r,chainIdHex:i,switchesActiveChain:e===`wallet_switchEthereumChain`}}function Me(e){let t=U(e.chainId);return`(function() {
2
2
  if (window.ethereum) return;
3
3
 
4
4
  var _address = ${JSON.stringify(e.address.toLowerCase())};
@@ -225,4 +225,4 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
225
225
  announceProvider();
226
226
  window.addEventListener("eip6963:requestProvider", announceProvider);
227
227
  })();
228
- true;`}function we(e){return JSON.stringify(e)}function G(e){return{state:e,message:null,readyAccepted:!1}}function Te(e,t){return e.currentFingerprint===e.deliveredFingerprint?{state:e,message:null,readyAccepted:t}:{state:{...e,deliveredFingerprint:e.currentFingerprint},message:D(e.sessionId,e.currentTheme),readyAccepted:t}}function Ee(e,t){let n=we(t);return{sessionId:e,currentTheme:t,currentFingerprint:n,deliveredFingerprint:n,ready:!1}}function De(e,t){let n=we(t);if(n===e.currentFingerprint)return G(e);let r={...e,currentTheme:t,currentFingerprint:n};return r.ready?Te(r,!1):G(r)}function Oe(e,t){return!y(t)||t.sessionId!==e.sessionId?G(e):Te({...e,ready:!0,...e.ready&&{deliveredFingerprint:``}},!0)}function K(e,t,n,r){let i=r?{id:t,error:r}:{id:t,result:n};e.current?.injectJavaScript(`window.ethereum._handleResponse(${JSON.stringify(i)});true;`)}function q(e,t,n){e.current?.injectJavaScript(`window.ethereum._emitEvent(${JSON.stringify(t)},${JSON.stringify(n)});true;`)}function ke(t){let{provider:n,address:r,chainId:i,supportedChainIds:a,onTransactionSent:o,onPaymentDetails:s,onSignupStatusChange:c,onSignedUp:l,onSignupDismissed:u,onError:d,onReady:f,sessionId:p,hostTheme:m=null,initialHostTheme:h=null,fetchEmailAttestation:g}=t,_=(0,e.useRef)(null),v=(0,e.useRef)(U(r)),y=(0,e.useRef)(i),b=(0,e.useRef)(i),x=(0,e.useRef)(new Set),S=(0,e.useRef)(m),C=(0,e.useRef)(p?Ee(p,h):null),w=(0,e.useRef)(p?fe(p):null),T=(0,e.useRef)(g);(0,e.useLayoutEffect)(()=>{S.current=m},[m]),(0,e.useLayoutEffect)(()=>{T.current=g},[g]),(0,e.useLayoutEffect)(()=>{C.current=p?Ee(p,h):null},[h,p]),(0,e.useLayoutEffect)(()=>{w.current=p?fe(p):null},[p]);let E=(0,e.useCallback)(e=>{x.current.has(e)||(x.current.add(e),o?.(e))},[o]);(0,e.useEffect)(()=>{let e=de({address:v.current,propChainId:y.current,activeChainId:b.current},{address:r,chainId:i});e&&(v.current=e.nextAddress,y.current=e.nextPropChainId,b.current=e.nextActiveChainId,e.accountsChanged&&q(_,`accountsChanged`,e.accountsChanged),e.chainChanged&&q(_,`chainChanged`,e.chainChanged.chainIdHex))},[r,i]),(0,e.useEffect)(()=>{if(!C.current)return;let e=De(C.current,m);C.current=e.state,e.message&&_.current?.postMessage(e.message)},[m]);let ee=(0,e.useMemo)(()=>Ce({address:r,chainId:i}),[r,i]),D=(0,e.useCallback)(async(e,t,r)=>{try{let i=ve(t,r,a);if(`error`in i){K(_,e,void 0,i.error);return}await n.request({method:i.providerMethod,params:i.providerParams}),K(_,e,null),i.switchesActiveChain&&(b.current=i.requestedChainId,q(_,`chainChanged`,i.chainIdHex))}catch(t){let n=I(t,`Chain request failed`);K(_,e,void 0,L(n)),d?.(n)}},[n,a,d]),O=(0,e.useCallback)(async(e,t)=>{try{let i=t.length>0?t:[r,a.map(e=>H(e))];K(_,e,await n.request({method:`wallet_getCapabilities`,params:i}))}catch(n){let r=I(n,`Capabilities unavailable`);if(!z(r)){K(_,e,void 0,L(r));return}K(_,e,ue(ye(t,a),`unsupported`))}},[n,r,a]),k=(0,e.useCallback)(async(e,t)=>{try{let r=await n.request({method:`wallet_getCallsStatus`,params:t}),i=Se(r);i&&E(i),K(_,e,r)}catch(t){K(_,e,void 0,L(I(t,`Failed to get call status`)))}},[n,E]),A=(0,e.useCallback)(async(e,t,r)=>{try{let i=await n.request({method:t,params:r});t===`eth_sendTransaction`&&typeof i==`string`&&E(i),K(_,e,i)}catch(t){let n=I(t,`Request failed`),r=F(n);K(_,e,void 0,r?{code:4001,message:n.message}:L(n)),r||d?.(n)}},[n,E,d]),j=(0,e.useCallback)((e,t)=>{let n=w.current;n&&(w.current=he(n,e),_.current?.postMessage(le(n.sessionId,e,t)))},[]),M=(0,e.useCallback)(async(e,t)=>{let n=T.current;if(!n){j(t.requestId,{status:`unavailable`,reason:`not_supported`});return}let r=new AbortController,i=setTimeout(()=>r.abort(),3e4),a;try{let e=await n({address:t.address,signal:r.signal});a=e?.token&&e.email?{status:`ok`,token:e.token,email:e.email}:{status:`unavailable`,reason:`declined`}}catch{a={status:`unavailable`,reason:r.signal.aborted?`timeout`:`error`}}finally{clearTimeout(i)}w.current?.sessionId===e&&j(t.requestId,a)},[j]),N=(0,e.useCallback)(e=>{let t=w.current;if(!t)return;let n=me(t,e,{walletAddress:v.current,supported:!!T.current});if(w.current=n.state,n.decision.kind===`reject`){j(n.decision.requestId,{status:`unavailable`,reason:n.decision.reason});return}n.decision.kind===`mint`&&M(t.sessionId,n.decision.request)},[M,j]);return{uiRef:_,injectedJavaScript:ee,onMessage:(0,e.useCallback)(e=>{let t;try{t=JSON.parse(e.nativeEvent.data)}catch{return}if(!t||typeof t!=`object`||!(`type`in t))return;if(t.type===`yodl_ready`){if(!C.current){f?.();return}let e=De(C.current,S.current);C.current=e.state,e.message&&_.current?.postMessage(e.message);let n=Oe(C.current,t);if(C.current=n.state,!n.readyAccepted)return;n.message&&_.current?.postMessage(n.message);let r=w.current;r&&_.current?.postMessage(ce(r.sessionId,!!T.current)),f?.();return}if(t.type===`yodl_email_attestation_request`){N(t);return}if(t.type===`yodl_payment_details`){s?.(t.details);return}if(t.type===`yodl_payment_error`){let e=t.error?.message??`Payment details error`,n=Error(e);t.error?.code!==void 0&&(n.code=t.error.code),d?.(n);return}if(t.type===`yodl_signup_status`){c?.(t.status);return}if(t.type===`yodl_signup_complete`){l?.();return}if(t.type===`yodl_signup_error`){let e=t.error?.message??`Signup error`,n=Error(e);t.error?.code!==void 0&&(n.code=t.error.code),d?.(n);return}if(t.type===`yodl_signup_dismissed`){u?.();return}if(t.type!==`ethereum_rpc_request`)return;let{id:n,method:r,params:i}=t;_e(r)?D(n,r,i):r===`wallet_getCapabilities`?O(n,i):r===`wallet_getCallsStatus`?k(n,i):A(n,r,i)},[D,O,k,A,N,s,c,l,u,d,f])}}function Ae(e){return(0,n.jsx)(je,{...e},e.uri)}function je({uri:i,sdkConfig:a,provider:o,address:s,chainId:c,supportedChainIds:l,onTransactionSent:u,onPaymentDetails:d,onSignupStatusChange:f,onSignedUp:p,onSignupDismissed:m,onError:h,style:g,backgroundColor:_,hostTheme:v=null,fetchEmailAttestation:y,renderLoading:b,onReady:x,sharedCookiesEnabled:S=!0,thirdPartyCookiesEnabled:C=!0,onLoadStart:w,...ee}){let[D]=(0,e.useState)(()=>se(v)),O=T(v,_),k=O.background,[A,j]=(0,e.useState)(null),M=A===D.sessionId,N=(0,e.useRef)(x);(0,e.useLayoutEffect)(()=>{N.current=x},[x]);let P=(0,e.useRef)(!1),F=(0,e.useCallback)(()=>{j(D.sessionId),!P.current&&(P.current=!0,N.current?.())},[D.sessionId]);(0,e.useEffect)(()=>{if(M)return;let e=setTimeout(F,8e3);return()=>clearTimeout(e)},[F,M]);let{uiRef:I,injectedJavaScript:L,onMessage:R}=ke({provider:o,address:s,chainId:c,supportedChainIds:l,onReady:F,sessionId:D.sessionId,hostTheme:v,initialHostTheme:D.initialHostTheme,...u!==void 0&&{onTransactionSent:u},...d!==void 0&&{onPaymentDetails:d},...f!==void 0&&{onSignupStatusChange:f},...p!==void 0&&{onSignedUp:p},...m!==void 0&&{onSignupDismissed:m},...h!==void 0&&{onError:h},...y!==void 0&&{fetchEmailAttestation:y}}),z=(0,e.useMemo)(()=>te(i),[i]),re=(0,e.useMemo)(()=>{let e=ie(a,i);return e?{uri:i,headers:e}:{uri:i}},[a,i]),B=(0,e.useMemo)(()=>e=>!z||!e?.url?!1:ne(e.url,z)||e.url.startsWith(`about:`),[z]),V=M?null:b?b():(0,n.jsx)(t.ActivityIndicator,{color:O.spinner});return(0,n.jsxs)(t.View,{style:[Me.container,{backgroundColor:k},g],children:[(0,n.jsx)(r.WebView,{ref:I,source:re,originWhitelist:z?[z]:[],onShouldStartLoadWithRequest:B,javaScriptEnabled:!0,sharedCookiesEnabled:S,thirdPartyCookiesEnabled:C,injectedJavaScriptBeforeContentLoaded:L,injectedJavaScriptObject:E(D.sessionId,D.initialHostTheme,a.integrationAddress),onMessage:R,...w!==void 0&&{onLoadStart:w},style:[Me.ui,{backgroundColor:k}],...ee}),V&&(0,n.jsx)(t.View,{style:[Me.overlay,{backgroundColor:k}],children:V})]})}const Me=t.StyleSheet.create({container:{flex:1},ui:{flex:1},overlay:{position:`absolute`,top:0,left:0,right:0,bottom:0,alignItems:`center`,justifyContent:`center`}});function Ne({onTransactionSent:t,onPaymentDetails:r,onError:i,fetchEmailAttestation:a,renderLoading:o,onReady:s,style:c,backgroundColor:l,theme:u,themeMode:d}){let{provider:f,address:p,chainId:m,supportedChainIds:h,sdk:g,hostTheme:_}=P(u,d);return(0,n.jsx)(Ae,{uri:(0,e.useMemo)(()=>g.config.yodlUiBaseUrl.replace(/\/$/,``),[g.config.yodlUiBaseUrl]),sdkConfig:g.config,provider:f,address:p,chainId:m,supportedChainIds:h,hostTheme:_,...t!==void 0&&{onTransactionSent:t},...r!==void 0&&{onPaymentDetails:r},...i!==void 0&&{onError:i},...a!==void 0&&{fetchEmailAttestation:a},...o!==void 0&&{renderLoading:o},...s!==void 0&&{onReady:s},...c!==void 0&&{style:c},...l!==void 0&&{backgroundColor:l}})}function Pe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Fe(e){if(Array.isArray(e))return e}function Ie(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Le(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Re(e,t,n){return t&&Le(e.prototype,t),n&&Le(e,n),e}function ze(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function Be(){throw TypeError(`Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ve(e,t){return Fe(e)||ze(e,t)||Ue(e,t)||Be()}function He(e){"@swc/helpers - typeof";return e&&typeof Symbol<`u`&&e.constructor===Symbol?`symbol`:typeof e}function Ue(e,t){if(e){if(typeof e==`string`)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pe(e,t)}}var We=Object.defineProperty,Ge=function(e,t,n){return t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ke=function(e,t){for(var n in t)We(e,n,{get:t[n],enumerable:!0})},J=function(e,t,n){return Ge(e,(t===void 0?`undefined`:He(t))===`symbol`?t:t+``,n)},qe=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];function Je(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=!0,r=!1,i=void 0;try{for(var a=e[Symbol.iterator](),o;!(n=(o=a.next()).done);n=!0)t=qe[(o.value.charCodeAt(0)^t>>8)&255]^t<<8}catch(e){r=!0,i=e}finally{try{!n&&a.return!=null&&a.return()}finally{if(r)throw i}}return(t^0)&65535}function Ye(e){for(var t=[],n=0;n<e.length;){var r=e.substring(n),i=r.substring(0,2),a=parseInt(r.substring(2,4)),o=r.substring(4,4+a);t.push({id:i,length:a,value:o}),n+=a+4}return t}function Y(e){var t=``,n=!0,r=!1,i=void 0;try{for(var a=e[Symbol.iterator](),o;!(n=(o=a.next()).done);n=!0){var s=o.value;if(t+=s.id,t+=(`00`+s.length).slice(-2),s.subTags){t+=Y(s.subTags);continue}t+=s.value}}catch(e){r=!0,i=e}finally{try{!n&&a.return!=null&&a.return()}finally{if(r)throw i}}return t}function Xe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=Je(e,65535).toString(16);return n=t?n.toUpperCase():n.toLowerCase(),n=(`0000`+n).slice(-4),n}function X(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e+=(`00`+t).slice(-2),e+=`04`,e+=Xe(e,n),e}function Ze(e,t,n){var r=e.find(function(e){return e.id==t});return n?r?.subTags?.find(function(e){return e.id==n}):r}function Z(e,t){return{id:e,length:t.length,value:t}}function Qe(e){var t=e.billerId,n=e.amount,r=e.ref1,i=e.ref2,a=e.ref3,o=[Z(`00`,`A000000677010112`),Z(`01`,t),Z(`02`,r)];i&&o.push(Z(`03`,i));var s=[Z(`00`,`01`),Z(`01`,n?`12`:`11`),Z(`30`,Y(o)),Z(`53`,`764`),Z(`58`,`TH`)];return n&&s.push(Z(`54`,Number(n).toFixed(2))),a&&s.push(Z(`62`,Y([Z(`07`,a)]))),X(Y(s),`63`)}var $e=function(){"use strict";function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Ie(this,e),J(this,`billerId`),J(this,`ref1`),J(this,`ref2`),J(this,`amount`),this.billerId=t,this.ref1=n,this.ref2=r,this.amount=i}return Re(e,[{key:`toString`,value:function(){var e=this,t=e.billerId,n=e.ref1,r=e.ref2,i=e.amount,a=i?String(Number(i.toFixed(2))*100):`0`;return`|${t}\r${n}\r${r??``}\r${a}`}},{key:`toQrTag30`,value:function(){var e=this,t=e.billerId,n=e.ref1,r=e.ref2,i=e.amount;return Qe({billerId:t,ref1:n,ref2:r??void 0,amount:i??void 0})}}],[{key:`fromString`,value:function(t){if(!t.startsWith(`|`))return null;var n=t.slice(1).split(`\r`,4);if(n.length!=4)return null;var r=Ve(n,4),i=r[0],a=r[1],o=r[2],s=r[3];return new e(i,a,o.length>0?o:null,s==`0`?null:Number((parseInt(s)/100).toFixed(2)))}}]),e}(),Q=function(e){return e.MSISDN=`01`,e.NATID=`02`,e.EWALLETID=`03`,e.BANKACC=`04`,e}(Q||{});function et(e){var t=e.type,n=e.target,r=e.amount;t==`MSISDN`&&(n=(`0000000000000`+n.replace(/^0/,`66`)).slice(-13));var i=Y([Z(`00`,`A000000677010111`),Z(Q[t],n)]),a=[Z(`00`,`01`),Z(`01`,r?`12`:`11`),Z(`29`,i),Z(`53`,`764`),Z(`58`,`TH`)];return r&&a.push(Z(`54`,Number(r).toFixed(2))),X(Y(a),`63`)}Ke({},{ProxyType:function(){return Q},anyId:function(){return et},billPayment:function(){return Qe},botBarcode:function(){return tt},slipVerify:function(){return nt},trueMoney:function(){return it},trueMoneySlipVerify:function(){return at}});function tt(e){var t=e.billerId,n=e.ref1,r=e.ref2,i=e.amount;return new $e(t,n,r,i).toString()}function nt(e){var t=e.sendingBank,n=e.transRef;return X(Y([Z(`00`,Y([Z(`00`,`000001`),Z(`01`,t),Z(`02`,n)])),Z(`51`,`TH`)]),`91`)}function rt(e){return e.split(``).map(function(e){return e.charCodeAt(0).toString(16).padStart(4,`0`)}).join(``).toUpperCase()}function it(e){var t=e.mobileNo,n=e.amount,r=e.message,i=Y([Z(`00`,`A000000677010111`),Z(`03`,`14000${t}`)]),a=[Z(`00`,`01`),Z(`01`,n?`12`:`11`),Z(`29`,i),Z(`53`,`764`),Z(`58`,`TH`)];return n&&a.push(Z(`54`,Number(n).toFixed(2))),r&&a.push(Z(`81`,rt(r))),X(Y(a),`63`)}function at(e){var t=e.eventType,n=e.transactionId,r=e.date;return X(Y([Z(`00`,Y([Z(`00`,`01`),Z(`01`,`01`),Z(`02`,t),Z(`03`,n),Z(`04`,r)]))]),`91`,!1)}function ot(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function st(e){if(Array.isArray(e))return e}function ct(e){if(Array.isArray(e))return ot(e)}function lt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dt(e,t,n){return t&&ut(e.prototype,t),n&&ut(e,n),e}function ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function mt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function ht(){throw TypeError(`Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gt(){throw TypeError(`Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ft(e,t,n[t])})}return e}function vt(e,t){return st(e)||mt(e,t)||bt(e,t)||ht()}function yt(e){return ct(e)||pt(e)||bt(e)||gt()}function bt(e,t){if(e){if(typeof e==`string`)return ot(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ot(e,t)}}Ke({},{anyId:function(){return Ct},bcelOneProof:function(){return St},billPayment:function(){return wt},slipVerify:function(){return Tt},trueMoneySlipVerify:function(){return Et}});var xt=function(){"use strict";function e(t,n){lt(this,e),J(this,`payload`),J(this,`tags`),this.payload=t,this.tags=n}return dt(e,[{key:`getTag`,value:function(e,t){return Ze(this.tags,e,t)}},{key:`getTagValue`,value:function(e,t){return this.getTag(e,t)?.value}},{key:`getTags`,value:function(){return this.tags}},{key:`getPayload`,value:function(){return this.payload}},{key:`validate`,value:function(e){var t=X(Y(yt(this.tags).filter(function(t){return t.id!=e})),e);return this.payload===t}}]),e}();function $(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e.match(/^\d{4}.+/)||t&&e.slice(-4).toUpperCase()!=Xe(e.slice(0,-4)))return null;var r=Ye(e);if(r.length==0)return null;if(n){var i=!0,a=!1,o=void 0;try{for(var s=r[Symbol.iterator](),c;!(i=(c=s.next()).done);i=!0){var l=c.value;if(!(typeof l.value!=`string`||!l.value.match(/^\d{4}.+/))){var u=Ye(l.value);u.every(function(e){return e.length>0&&e.length===e.value.length})&&(l.subTags=u)}}}catch(e){a=!0,o=e}finally{try{!i&&s.return!=null&&s.return()}finally{if(a)throw o}}}return new xt(e,r)}function St(e){var t=$(e,!0),n=t?.getTagValue(`33`,`02`),r=t?.getTagValue(`33`,`03`),i=t?.getTagValue(`33`,`04`);return t?.getTagValue(`00`)!==`01`&&t?.getTagValue(`01`)!==`11`&&t?.getTagValue(`33`,`00`)!==`BCEL`&&t?.getTagValue(`33`,`00`)!==`ONEPROOF`?null:{type:n,ticket:r,fccref:i}}function Ct(e){var t=$(e,!0),n=t?.getTagValue(`00`),r=t?.getTagValue(`29`,`00`);if(n!==`01`||r!==`A000000677010111`)return null;var i=Object.entries(Q).find(function(e){var n=vt(e,2)[1];return t?.getTagValue(`29`,n)!==void 0});if(!i)return null;var a=vt(i,2),o=a[0],s=a[1],c=t.getTagValue(`29`,s);o===`MSISDN`&&c.length==13&&c.startsWith(`0066`)&&(c=`0`+c.slice(-9));var l=t?.getTagValue(`54`),u=l===void 0?void 0:parseFloat(l);return _t({type:o,target:c},u!==void 0&&{amount:u})}function wt(e){var t=$(e,!0),n=t?.getTagValue(`00`),r=t?.getTagValue(`30`,`00`),i=t?.getTagValue(`30`,`01`),a=t?.getTagValue(`30`,`02`);if(n!==`01`||r!==`A000000677010112`||!i||!a)return null;var o=t?.getTagValue(`30`,`03`),s=t?.getTagValue(`62`,`07`),c=t?.getTagValue(`54`),l=c===void 0?void 0:parseFloat(c);return _t({billerId:i,ref1:a},o!==void 0&&{ref2:o},s!==void 0&&{ref3:s},l!==void 0&&{amount:l})}function Tt(e){if(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1]){var t=e.lastIndexOf(`9104`);if(t!=-1){var n=e.substring(t+4);n.length>0&&n.length<4&&(e=e.substring(0,t+4)+n.padStart(4,`0`))}}var r=$(e,!0),i=r?.getTagValue(`00`,`00`),a=r?.getTagValue(`00`,`01`),o=r?.getTagValue(`00`,`02`);return i!==`000001`||!a||!o?null:{sendingBank:a,transRef:o}}function Et(e){var t=$(e,!0),n=t?.getTagValue(`00`,`02`),r=t?.getTagValue(`00`,`03`),i=t?.getTagValue(`00`,`04`);return t?.getTagValue(`00`,`00`)!==`01`&&t?.getTagValue(`00`,`01`)!==`01`?null:{eventType:n,transactionId:r,date:i}}const Dt={aeon:[`PH`,`VN`,`BR`,`AR`],manteca:[`AR`,`BR`],bcpilot:[],holdstation:[`VN`]};function Ot(e){return e?e.getTagValue(`58`)??null:null}function kt(e){let t=[];for(let[n,r]of Object.entries(Dt))r.includes(e)&&t.push(n);return t}function At(e,t,n){if(!e||typeof e!=`string`||e.trim().length===0)return[];let r=e.trim(),i=[];try{let e=Ot($(r));if(e){let n=kt(e);for(let e of n)(!t||t.includes(e))&&i.push({provider:e,action:`resolve`});if(i.length>0)return i}}catch{}if(n){let e=n(r);e&&(!t||t.includes(`bcpilot`))&&i.push(e)}return i}function jt(e,t,n={}){let r=Object.entries(n).filter(e=>e[1]!==void 0).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`),i=`${e.replace(/\/+$/,``)}${t?`/${t.replace(/^\/+/,``)}`:``}`;return r?`${i}?${r}`:i}function Mt(e){return jt(e,`/sdk/signup`)}const Nt=`always`;function Pt(e,t,n=Nt){return!e||typeof e!=`string`||e.trim().length===0||!At(e).find(e=>e.action===`resolve`)?null:jt(t,`/resolve`,{data:e,navigateOnSubmit:n===Nt?void 0:n})}function Ft({qrData:t,navigateOnSubmit:r,onTransactionSent:i,onPaymentDetails:a,onError:o,fetchEmailAttestation:s,renderLoading:c,onReady:l,style:u,backgroundColor:d,theme:f,themeMode:p}){let{provider:m,address:h,chainId:g,supportedChainIds:_,sdk:v,hostTheme:y}=P(f,p),b=(0,e.useMemo)(()=>Pt(t,v.config.yodlUiBaseUrl,r),[t,v.config.yodlUiBaseUrl,r]);return b?(0,n.jsx)(Ae,{uri:b,sdkConfig:v.config,provider:m,address:h,chainId:g,supportedChainIds:_,hostTheme:y,...i!==void 0&&{onTransactionSent:i},...a!==void 0&&{onPaymentDetails:a},...o!==void 0&&{onError:o},...s!==void 0&&{fetchEmailAttestation:s},...c!==void 0&&{renderLoading:c},...l!==void 0&&{onReady:l},...u!==void 0&&{style:u},...d!==void 0&&{backgroundColor:d}}):null}function It({onStatusChange:t,onSignedUp:r,onError:i,onDismiss:a,fetchEmailAttestation:o,renderLoading:s,onReady:c,style:l,backgroundColor:u,theme:d,themeMode:f}){let{provider:p,address:m,chainId:h,supportedChainIds:g,sdk:_,hostTheme:v}=P(d,f);return(0,n.jsx)(Ae,{uri:(0,e.useMemo)(()=>Mt(_.config.yodlUiBaseUrl),[_.config.yodlUiBaseUrl]),sdkConfig:_.config,provider:p,address:m,chainId:h,supportedChainIds:g,hostTheme:v,...t!==void 0&&{onSignupStatusChange:t},...r!==void 0&&{onSignedUp:r},...i!==void 0&&{onError:i},...a!==void 0&&{onSignupDismissed:a},...o!==void 0&&{fetchEmailAttestation:o},...s!==void 0&&{renderLoading:s},...c!==void 0&&{onReady:c},...l!==void 0&&{style:l},...u!==void 0&&{backgroundColor:u}})}function Lt(e){return(Array.isArray(e)?e:[e]).some(e=>At(e).some(e=>e.action===`resolve`))}var Rt=class{config;constructor(e){let t=B(e),n=e.supportedChainIds;if(!Array.isArray(n)||n.length===0)throw Error(`Yodl supportedChainIds is required — provide at least one chain id`);this.config={integrationAddress:t,yodlUiBaseUrl:e.yodlUiBaseUrl??`https://sdk-webview.yodl.me`,supportedChainIds:[...n]}}};function zt(e){return new Rt(e)}exports.Yodl=Rt,exports.YodlDashboard=Ne,exports.YodlPayment=Ft,exports.YodlProvider=M,exports.YodlSignup=It,exports.createSdk=zt,exports.isPaymentQr=Lt;
228
+ true;`}function Ne(e){return JSON.stringify(e)}function K(e){return{state:e,message:null,readyAccepted:!1}}function Pe(e,t){return e.currentFingerprint===e.deliveredFingerprint?{state:e,message:null,readyAccepted:t}:{state:{...e,deliveredFingerprint:e.currentFingerprint},message:F(e.sessionId,e.currentTheme),readyAccepted:t}}function Fe(e,t){let n=Ne(t);return{sessionId:e,currentTheme:t,currentFingerprint:n,deliveredFingerprint:n,ready:!1}}function Ie(e,t){let n=Ne(t);if(n===e.currentFingerprint)return K(e);let r={...e,currentTheme:t,currentFingerprint:n};return r.ready?Pe(r,!1):K(r)}function Le(e,t){return!O(t)||t.sessionId!==e.sessionId?K(e):Pe({...e,ready:!0,...e.ready&&{deliveredFingerprint:``}},!0)}function q(e,t,n,r){let i=r?{id:t,error:r}:{id:t,result:n};e.current?.injectJavaScript(`window.ethereum._handleResponse(${JSON.stringify(i)});true;`)}function Re(e,t,n){e.current?.injectJavaScript(`window.ethereum._emitEvent(${JSON.stringify(t)},${JSON.stringify(n)});true;`)}function ze(e){return o(e)&&`type`in e}function Be(e,t){let n=Error(e?.message??t);return e?.code!==void 0&&(n.code=e.code),n}function Ve(t){let{provider:n,address:r,chainId:i,supportedChainIds:a,onTransactionSent:o,onPaymentDetails:s,onSignupStatusChange:c,onSignedUp:u,onSignupDismissed:d,onError:f,onReady:p,sessionId:m,hostTheme:h=null,initialHostTheme:g=null,fetchEmailAttestation:y}=t,b=(0,e.useRef)(null),x=(0,e.useRef)(W(r)),S=(0,e.useRef)(i),C=(0,e.useRef)(i),w=(0,e.useRef)(new Set),T=(0,e.useRef)(h),E=(0,e.useRef)(m?Fe(m,g):null),D=(0,e.useRef)(m?Te(m):null),O=(0,e.useRef)(y);(0,e.useLayoutEffect)(()=>{T.current=h},[h]),(0,e.useLayoutEffect)(()=>{O.current=y},[y]),(0,e.useLayoutEffect)(()=>{E.current=m?Fe(m,g):null},[g,m]),(0,e.useLayoutEffect)(()=>{D.current=m?Te(m):null},[m]);let k=(0,e.useCallback)(e=>{w.current.has(e)||(w.current.add(e),o?.(e))},[o]);(0,e.useEffect)(()=>{let e=we({address:x.current,propChainId:S.current,activeChainId:C.current},{address:r,chainId:i});e&&(x.current=e.nextAddress,S.current=e.nextPropChainId,C.current=e.nextActiveChainId,e.accountsChanged&&Re(b,`accountsChanged`,e.accountsChanged),e.chainChanged&&Re(b,`chainChanged`,e.chainChanged.chainIdHex))},[r,i]),(0,e.useEffect)(()=>{if(!E.current)return;let e=Ie(E.current,h);E.current=e.state,e.message&&b.current?.postMessage(e.message)},[h]);let ee=(0,e.useMemo)(()=>Me({address:r,chainId:i}),[r,i]),A=(0,e.useCallback)(async(e,t,r)=>{try{let i=je(t,r,a);if(`error`in i){q(b,e,void 0,i.error);return}await n.request({method:i.providerMethod,params:i.providerParams}),q(b,e,null),i.switchesActiveChain&&(C.current=i.requestedChainId,Re(b,`chainChanged`,i.chainIdHex))}catch(t){let n=V(t,`Chain request failed`);q(b,e,void 0,H(n)),f?.(n)}},[n,a,f]),j=(0,e.useCallback)(async(e,t)=>{try{let i=t.length>0?t:[r,a.map(e=>U(e))],o=await n.request({method:`wallet_getCapabilities`,params:i});q(b,e,o)}catch(n){let r=V(n,`Capabilities unavailable`);if(!le(r)){q(b,e,void 0,H(r));return}q(b,e,Ce(ye(t,a),`unsupported`))}},[n,r,a]),M=(0,e.useCallback)(async(e,t)=>{try{let r=await n.request({method:`wallet_getCallsStatus`,params:t}),i=Se(r);i&&k(i),q(b,e,r)}catch(t){let n=V(t,`Failed to get call status`);q(b,e,void 0,H(n))}},[n,k]),N=(0,e.useCallback)(async(e,t,r)=>{try{let i=await n.request({method:t,params:r});t===`eth_sendTransaction`&&typeof i==`string`&&k(i),q(b,e,i)}catch(t){let n=V(t,`Request failed`),r=ae(n);q(b,e,void 0,r?{code:4001,message:n.message}:H(n)),r||f?.(n)}},[n,k,f]),P=(0,e.useCallback)((e,t)=>{let n=D.current;n&&(D.current=Oe(n,e),b.current?.postMessage(JSON.stringify(v(n.sessionId,e,t))))},[]),F=(0,e.useCallback)(async(e,t)=>{let n=O.current;if(!n){P(t.requestId,{status:`unavailable`,reason:`not_supported`});return}let r=new AbortController,i=setTimeout(()=>r.abort(),3e4),a;try{let e=await n({address:t.address,signal:r.signal});a=e?.token&&e.email?{status:`ok`,token:e.token,email:e.email}:{status:`unavailable`,reason:`declined`}}catch{a={status:`unavailable`,reason:r.signal.aborted?`timeout`:`error`}}finally{clearTimeout(i)}D.current?.sessionId===e&&P(t.requestId,a)},[P]),I=(0,e.useCallback)(e=>{let t=D.current;if(!t)return;let n=De(t,e,{walletAddress:x.current,supported:!!O.current});if(D.current=n.state,n.decision.kind===`reject`){P(n.decision.requestId,{status:`unavailable`,reason:n.decision.reason});return}n.decision.kind===`mint`&&F(t.sessionId,n.decision.request)},[F,P]),L=(0,e.useCallback)(e=>{switch(e.type){case`yodl_payment_details`:s?.(e.details);return;case`yodl_payment_error`:f?.(Be(e.error,`Payment details error`));return;case`yodl_signup_status`:c?.(e.status);return;case`yodl_signup_complete`:u?.();return;case`yodl_signup_error`:f?.(Be(e.error,`Signup error`));return;case`yodl_signup_dismissed`:d?.();return;case`ethereum_rpc_request`:{let{id:t,method:n,params:r}=e;Ae(n)?A(t,n,r):n===`wallet_getCapabilities`?j(t,r):n===`wallet_getCallsStatus`?M(t,r):N(t,n,r);return}}},[A,j,M,N,s,c,u,d,f]);return{uiRef:b,injectedJavaScript:ee,onMessage:(0,e.useCallback)(e=>{let t;try{t=JSON.parse(e.nativeEvent.data)}catch{return}if(ze(t)){if(t.type===`yodl_ready`){if(!E.current){p?.();return}let e=Ie(E.current,T.current);E.current=e.state,e.message&&b.current?.postMessage(e.message);let n=Le(E.current,t);if(E.current=n.state,!n.readyAccepted)return;n.message&&b.current?.postMessage(n.message);let r=D.current;r&&b.current?.postMessage(JSON.stringify(_(r.sessionId,!!O.current))),p?.();return}if(t.type===`yodl_email_attestation_request`){I(t);return}l(t)&&L(t)}},[L,I,p])}}function He(e){return(0,n.jsx)(Ue,{...e},e.uri)}function Ue({uri:i,sdkConfig:a,provider:o,address:s,chainId:c,supportedChainIds:l,onTransactionSent:u,onPaymentDetails:d,onSignupStatusChange:f,onSignedUp:p,onSignupDismissed:m,onError:h,style:g,backgroundColor:_,hostTheme:v=null,fetchEmailAttestation:y,renderLoading:b,onReady:x,sharedCookiesEnabled:S=!0,thirdPartyCookiesEnabled:C=!0,onLoadStart:w,...T}){let[E]=(0,e.useState)(()=>_e(v)),D=N(v,_),O=D.background,[k,ee]=(0,e.useState)(null),A=k===E.sessionId,j=(0,e.useRef)(x);(0,e.useLayoutEffect)(()=>{j.current=x},[x]);let M=(0,e.useRef)(!1),F=(0,e.useCallback)(()=>{ee(E.sessionId),!M.current&&(M.current=!0,j.current?.())},[E.sessionId]);(0,e.useEffect)(()=>{if(A)return;let e=setTimeout(F,8e3);return()=>clearTimeout(e)},[F,A]);let{uiRef:I,injectedJavaScript:L,onMessage:R}=Ve({provider:o,address:s,chainId:c,supportedChainIds:l,onReady:F,sessionId:E.sessionId,hostTheme:v,initialHostTheme:E.initialHostTheme,...u!==void 0&&{onTransactionSent:u},...d!==void 0&&{onPaymentDetails:d},...f!==void 0&&{onSignupStatusChange:f},...p!==void 0&&{onSignedUp:p},...m!==void 0&&{onSignupDismissed:m},...h!==void 0&&{onError:h},...y!==void 0&&{fetchEmailAttestation:y}}),z=(0,e.useMemo)(()=>ue(i),[i]),te=(0,e.useMemo)(()=>{let e=me(a,i);return e?{uri:i,headers:e}:{uri:i}},[a,i]),ne=(0,e.useMemo)(()=>e=>!z||!e?.url?!1:de(e.url,z)||e.url.startsWith(`about:`),[z]),B=A?null:b?b():(0,n.jsx)(t.ActivityIndicator,{color:D.spinner});return(0,n.jsxs)(t.View,{style:[We.container,{backgroundColor:O},g],children:[(0,n.jsx)(r.WebView,{ref:I,source:te,originWhitelist:z?[z]:[],onShouldStartLoadWithRequest:ne,javaScriptEnabled:!0,sharedCookiesEnabled:S,thirdPartyCookiesEnabled:C,injectedJavaScriptBeforeContentLoaded:L,injectedJavaScriptObject:P(E.sessionId,E.initialHostTheme,a.integrationAddress),onMessage:R,...w!==void 0&&{onLoadStart:w},style:[We.ui,{backgroundColor:O}],...T}),B&&(0,n.jsx)(t.View,{style:[We.overlay,{backgroundColor:O}],children:B})]})}const We=t.StyleSheet.create({container:{flex:1},ui:{flex:1},overlay:{position:`absolute`,top:0,left:0,right:0,bottom:0,alignItems:`center`,justifyContent:`center`}});function Ge({onTransactionSent:t,onPaymentDetails:r,onError:i,fetchEmailAttestation:a,renderLoading:o,onReady:s,style:c,backgroundColor:l,theme:u,themeMode:d}){let{provider:f,address:p,chainId:m,supportedChainIds:h,sdk:g,hostTheme:_}=B(u,d),v=(0,e.useMemo)(()=>g.config.yodlUiBaseUrl.replace(/\/$/,``),[g.config.yodlUiBaseUrl]);return(0,n.jsx)(He,{uri:v,sdkConfig:g.config,provider:f,address:p,chainId:m,supportedChainIds:h,hostTheme:_,...t!==void 0&&{onTransactionSent:t},...r!==void 0&&{onPaymentDetails:r},...i!==void 0&&{onError:i},...a!==void 0&&{fetchEmailAttestation:a},...o!==void 0&&{renderLoading:o},...s!==void 0&&{onReady:s},...c!==void 0&&{style:c},...l!==void 0&&{backgroundColor:l}})}function Ke(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qe(e){if(Array.isArray(e))return e}function Je(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Ye(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xe(e,t,n){return t&&Ye(e.prototype,t),n&&Ye(e,n),e}function Ze(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function Qe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $e(e,t){return qe(e)||Ze(e,t)||tt(e,t)||Qe()}function et(e){"@swc/helpers - typeof";return e&&typeof Symbol<`u`&&e.constructor===Symbol?`symbol`:typeof e}function tt(e,t){if(e){if(typeof e==`string`)return Ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ke(e,t)}}var nt=Object.defineProperty,rt=function(e,t,n){return t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},it=function(e,t){for(var n in t)nt(e,n,{get:t[n],enumerable:!0})},J=function(e,t,n){return rt(e,(t===void 0?`undefined`:et(t))===`symbol`?t:t+``,n)},at=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];function ot(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=!0,r=!1,i=void 0;try{for(var a=e[Symbol.iterator](),o;!(n=(o=a.next()).done);n=!0)t=at[(o.value.charCodeAt(0)^t>>8)&255]^t<<8}catch(e){r=!0,i=e}finally{try{!n&&a.return!=null&&a.return()}finally{if(r)throw i}}return(t^0)&65535}function st(e){for(var t=[],n=0;n<e.length;){var r=e.substring(n),i=r.substring(0,2),a=parseInt(r.substring(2,4)),o=r.substring(4,4+a);t.push({id:i,length:a,value:o}),n+=a+4}return t}function Y(e){var t=``,n=!0,r=!1,i=void 0;try{for(var a=e[Symbol.iterator](),o;!(n=(o=a.next()).done);n=!0){var s=o.value;if(t+=s.id,t+=(`00`+s.length).slice(-2),s.subTags){t+=Y(s.subTags);continue}t+=s.value}}catch(e){r=!0,i=e}finally{try{!n&&a.return!=null&&a.return()}finally{if(r)throw i}}return t}function ct(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=ot(e,65535).toString(16);return n=t?n.toUpperCase():n.toLowerCase(),n=(`0000`+n).slice(-4),n}function X(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e+=(`00`+t).slice(-2),e+=`04`,e+=ct(e,n),e}function lt(e,t,n){var r=e.find(function(e){return e.id==t});return n?r?.subTags?.find(function(e){return e.id==n}):r}function Z(e,t){return{id:e,length:t.length,value:t}}function ut(e){var t=e.billerId,n=e.amount,r=e.ref1,i=e.ref2,a=e.ref3,o=[Z(`00`,`A000000677010112`),Z(`01`,t),Z(`02`,r)];i&&o.push(Z(`03`,i));var s=[Z(`00`,`01`),Z(`01`,n?`12`:`11`),Z(`30`,Y(o)),Z(`53`,`764`),Z(`58`,`TH`)];return n&&s.push(Z(`54`,Number(n).toFixed(2))),a&&s.push(Z(`62`,Y([Z(`07`,a)]))),X(Y(s),`63`)}var dt=function(){"use strict";function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Je(this,e),J(this,`billerId`),J(this,`ref1`),J(this,`ref2`),J(this,`amount`),this.billerId=t,this.ref1=n,this.ref2=r,this.amount=i}return Xe(e,[{key:`toString`,value:function(){var e=this,t=e.billerId,n=e.ref1,r=e.ref2,i=e.amount,a=i?String(Number(i.toFixed(2))*100):`0`;return`|${t}\r${n}\r${r??``}\r${a}`}},{key:`toQrTag30`,value:function(){var e=this,t=e.billerId,n=e.ref1,r=e.ref2,i=e.amount;return ut({billerId:t,ref1:n,ref2:r??void 0,amount:i??void 0})}}],[{key:`fromString`,value:function(t){if(!t.startsWith(`|`))return null;var n=t.slice(1).split(`\r`,4);if(n.length!=4)return null;var r=$e(n,4),i=r[0],a=r[1],o=r[2],s=r[3];return new e(i,a,o.length>0?o:null,s==`0`?null:Number((parseInt(s)/100).toFixed(2)))}}]),e}(),Q=function(e){return e.MSISDN=`01`,e.NATID=`02`,e.EWALLETID=`03`,e.BANKACC=`04`,e}(Q||{});function ft(e){var t=e.type,n=e.target,r=e.amount;t==`MSISDN`&&(n=(`0000000000000`+n.replace(/^0/,`66`)).slice(-13));var i=Y([Z(`00`,`A000000677010111`),Z(Q[t],n)]),a=[Z(`00`,`01`),Z(`01`,r?`12`:`11`),Z(`29`,i),Z(`53`,`764`),Z(`58`,`TH`)];return r&&a.push(Z(`54`,Number(r).toFixed(2))),X(Y(a),`63`)}it({},{ProxyType:function(){return Q},anyId:function(){return ft},billPayment:function(){return ut},botBarcode:function(){return pt},slipVerify:function(){return mt},trueMoney:function(){return gt},trueMoneySlipVerify:function(){return _t}});function pt(e){var t=e.billerId,n=e.ref1,r=e.ref2,i=e.amount;return new dt(t,n,r,i).toString()}function mt(e){var t=e.sendingBank,n=e.transRef;return X(Y([Z(`00`,Y([Z(`00`,`000001`),Z(`01`,t),Z(`02`,n)])),Z(`51`,`TH`)]),`91`)}function ht(e){return e.split(``).map(function(e){return e.charCodeAt(0).toString(16).padStart(4,`0`)}).join(``).toUpperCase()}function gt(e){var t=e.mobileNo,n=e.amount,r=e.message,i=Y([Z(`00`,`A000000677010111`),Z(`03`,`14000${t}`)]),a=[Z(`00`,`01`),Z(`01`,n?`12`:`11`),Z(`29`,i),Z(`53`,`764`),Z(`58`,`TH`)];return n&&a.push(Z(`54`,Number(n).toFixed(2))),r&&a.push(Z(`81`,ht(r))),X(Y(a),`63`)}function _t(e){var t=e.eventType,n=e.transactionId,r=e.date;return X(Y([Z(`00`,Y([Z(`00`,`01`),Z(`01`,`01`),Z(`02`,t),Z(`03`,n),Z(`04`,r)]))]),`91`,!1)}function vt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yt(e){if(Array.isArray(e))return e}function bt(e){if(Array.isArray(e))return vt(e)}function xt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function St(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ct(e,t,n){return t&&St(e.prototype,t),n&&St(e,n),e}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Et(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function Dt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ot(){throw TypeError(`Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){wt(e,t,n[t])})}return e}function At(e,t){return yt(e)||Et(e,t)||Mt(e,t)||Dt()}function jt(e){return bt(e)||Tt(e)||Mt(e)||Ot()}function Mt(e,t){if(e){if(typeof e==`string`)return vt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vt(e,t)}}it({},{anyId:function(){return Ft},bcelOneProof:function(){return Pt},billPayment:function(){return It},slipVerify:function(){return Lt},trueMoneySlipVerify:function(){return Rt}});var Nt=function(){"use strict";function e(t,n){xt(this,e),J(this,`payload`),J(this,`tags`),this.payload=t,this.tags=n}return Ct(e,[{key:`getTag`,value:function(e,t){return lt(this.tags,e,t)}},{key:`getTagValue`,value:function(e,t){return this.getTag(e,t)?.value}},{key:`getTags`,value:function(){return this.tags}},{key:`getPayload`,value:function(){return this.payload}},{key:`validate`,value:function(e){var t=X(Y(jt(this.tags).filter(function(t){return t.id!=e})),e);return this.payload===t}}]),e}();function $(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e.match(/^\d{4}.+/)||t&&e.slice(-4).toUpperCase()!=ct(e.slice(0,-4)))return null;var r=st(e);if(r.length==0)return null;if(n){var i=!0,a=!1,o=void 0;try{for(var s=r[Symbol.iterator](),c;!(i=(c=s.next()).done);i=!0){var l=c.value;if(!(typeof l.value!=`string`||!l.value.match(/^\d{4}.+/))){var u=st(l.value);u.every(function(e){return e.length>0&&e.length===e.value.length})&&(l.subTags=u)}}}catch(e){a=!0,o=e}finally{try{!i&&s.return!=null&&s.return()}finally{if(a)throw o}}}return new Nt(e,r)}function Pt(e){var t=$(e,!0),n=t?.getTagValue(`33`,`02`),r=t?.getTagValue(`33`,`03`),i=t?.getTagValue(`33`,`04`);return t?.getTagValue(`00`)!==`01`&&t?.getTagValue(`01`)!==`11`&&t?.getTagValue(`33`,`00`)!==`BCEL`&&t?.getTagValue(`33`,`00`)!==`ONEPROOF`?null:{type:n,ticket:r,fccref:i}}function Ft(e){var t=$(e,!0),n=t?.getTagValue(`00`),r=t?.getTagValue(`29`,`00`);if(n!==`01`||r!==`A000000677010111`)return null;var i=Object.entries(Q).find(function(e){var n=At(e,2)[1];return t?.getTagValue(`29`,n)!==void 0});if(!i)return null;var a=At(i,2),o=a[0],s=a[1],c=t.getTagValue(`29`,s);o===`MSISDN`&&c.length==13&&c.startsWith(`0066`)&&(c=`0`+c.slice(-9));var l=t?.getTagValue(`54`),u=l===void 0?void 0:parseFloat(l);return kt({type:o,target:c},u!==void 0&&{amount:u})}function It(e){var t=$(e,!0),n=t?.getTagValue(`00`),r=t?.getTagValue(`30`,`00`),i=t?.getTagValue(`30`,`01`),a=t?.getTagValue(`30`,`02`);if(n!==`01`||r!==`A000000677010112`||!i||!a)return null;var o=t?.getTagValue(`30`,`03`),s=t?.getTagValue(`62`,`07`),c=t?.getTagValue(`54`),l=c===void 0?void 0:parseFloat(c);return kt({billerId:i,ref1:a},o!==void 0&&{ref2:o},s!==void 0&&{ref3:s},l!==void 0&&{amount:l})}function Lt(e){if(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1]){var t=e.lastIndexOf(`9104`);if(t!=-1){var n=e.substring(t+4);n.length>0&&n.length<4&&(e=e.substring(0,t+4)+n.padStart(4,`0`))}}var r=$(e,!0),i=r?.getTagValue(`00`,`00`),a=r?.getTagValue(`00`,`01`),o=r?.getTagValue(`00`,`02`);return i!==`000001`||!a||!o?null:{sendingBank:a,transRef:o}}function Rt(e){var t=$(e,!0),n=t?.getTagValue(`00`,`02`),r=t?.getTagValue(`00`,`03`),i=t?.getTagValue(`00`,`04`);return t?.getTagValue(`00`,`00`)!==`01`&&t?.getTagValue(`00`,`01`)!==`01`?null:{eventType:n,transactionId:r,date:i}}const zt={aeon:[`PH`,`VN`,`BR`,`AR`],manteca:[`AR`,`BR`],bcpilot:[],holdstation:[`VN`]};function Bt(e){return e?e.getTagValue(`58`)??null:null}function Vt(e){let t=[];for(let[n,r]of Object.entries(zt))r.includes(e)&&t.push(n);return t}function Ht(e){return e.toLowerCase().startsWith(`upi://`)}function Ut(e,t){if(!e||typeof e!=`string`||e.trim().length===0)return[];let n=e.trim(),r=[];try{let e=Bt($(n));if(e){let n=Vt(e);for(let e of n)(!t||t.includes(e))&&r.push({provider:e,action:`resolve`});if(r.length>0)return r}}catch{}return Ht(n)&&(!t||t.includes(`aeon`))?[{provider:`aeon`,action:`resolve`}]:r}function Wt(e,t){let n=e.filter(e=>e.action===`resolve`).map(e=>e.provider);return t?n.filter(e=>t.includes(e)):n}function Gt(e,t,n={}){let r=Object.entries(n).filter(e=>e[1]!==void 0).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`),i=`${e.replace(/\/+$/,``)}${t?`/${t.replace(/^\/+/,``)}`:``}`;return r?`${i}?${r}`:i}function Kt(e){return Gt(e,`/sdk/signup`)}const qt=`always`;function Jt(e,t,n=qt){return!e||typeof e!=`string`||e.trim().length===0||Wt(Ut(e)).length===0?null:Gt(t,`/resolve`,{data:e,navigateOnSubmit:n===qt?void 0:n})}function Yt({qrData:t,navigateOnSubmit:r,onTransactionSent:i,onPaymentDetails:a,onError:o,fetchEmailAttestation:s,renderLoading:c,onReady:l,style:u,backgroundColor:d,theme:f,themeMode:p}){let{provider:m,address:h,chainId:g,supportedChainIds:_,sdk:v,hostTheme:y}=B(f,p),b=(0,e.useMemo)(()=>Jt(t,v.config.yodlUiBaseUrl,r),[t,v.config.yodlUiBaseUrl,r]);return b?(0,n.jsx)(He,{uri:b,sdkConfig:v.config,provider:m,address:h,chainId:g,supportedChainIds:_,hostTheme:y,...i!==void 0&&{onTransactionSent:i},...a!==void 0&&{onPaymentDetails:a},...o!==void 0&&{onError:o},...s!==void 0&&{fetchEmailAttestation:s},...c!==void 0&&{renderLoading:c},...l!==void 0&&{onReady:l},...u!==void 0&&{style:u},...d!==void 0&&{backgroundColor:d}}):null}function Xt({onStatusChange:t,onSignedUp:r,onError:i,onDismiss:a,fetchEmailAttestation:o,renderLoading:s,onReady:c,style:l,backgroundColor:u,theme:d,themeMode:f}){let{provider:p,address:m,chainId:h,supportedChainIds:g,sdk:_,hostTheme:v}=B(d,f),y=(0,e.useMemo)(()=>Kt(_.config.yodlUiBaseUrl),[_.config.yodlUiBaseUrl]);return(0,n.jsx)(He,{uri:y,sdkConfig:_.config,provider:p,address:m,chainId:h,supportedChainIds:g,hostTheme:v,...t!==void 0&&{onSignupStatusChange:t},...r!==void 0&&{onSignedUp:r},...i!==void 0&&{onError:i},...a!==void 0&&{onSignupDismissed:a},...o!==void 0&&{fetchEmailAttestation:o},...s!==void 0&&{renderLoading:s},...c!==void 0&&{onReady:c},...l!==void 0&&{style:l},...u!==void 0&&{backgroundColor:u}})}function Zt(e){return(Array.isArray(e)?e:[e]).some(e=>Wt(Ut(e)).length>0)}var Qt=class{config;constructor(e){let t=re(e),n=e.supportedChainIds;if(!Array.isArray(n)||n.length===0)throw Error(`Yodl supportedChainIds is required — provide at least one chain id`);this.config={integrationAddress:t,yodlUiBaseUrl:e.yodlUiBaseUrl??`https://sdk-webview.yodl.me`,supportedChainIds:[...n]}}};function $t(e){return new Qt(e)}exports.YodlDashboard=Ge,exports.YodlPayment=Yt,exports.YodlProvider=te,exports.YodlSdk=Qt,exports.YodlSignup=Xt,exports.createYodlSdk=$t,exports.isPaymentQr=Zt;