@halliday-sdk/payments 0.2.0 → 2.2.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 +37 -31
- package/dist/paymentsApiClient/index.cjs.min.js +2 -0
- package/dist/paymentsApiClient/index.cjs.min.js.map +1 -0
- package/dist/paymentsApiClient/index.d.ts +1899 -0
- package/dist/paymentsApiClient/index.esm.min.js +2 -0
- package/dist/paymentsApiClient/index.esm.min.js.map +1 -0
- package/dist/paymentsWidget/ethers/index.d.ts +1 -1
- package/dist/paymentsWidget/index.cjs.min.js +1 -1
- package/dist/paymentsWidget/index.cjs.min.js.map +1 -1
- package/dist/paymentsWidget/index.d.ts +157 -8
- package/dist/paymentsWidget/index.esm.min.js +1 -1
- package/dist/paymentsWidget/index.esm.min.js.map +1 -1
- package/dist/paymentsWidget/index.umd.min.js +1 -1
- package/dist/paymentsWidget/index.umd.min.js.map +1 -1
- package/dist/paymentsWidget/viem/index.cjs.min.js +1 -1
- package/dist/paymentsWidget/viem/index.cjs.min.js.map +1 -1
- package/dist/paymentsWidget/viem/index.d.ts +1 -1
- package/dist/paymentsWidget/viem/index.esm.min.js +1 -1
- package/dist/paymentsWidget/viem/index.esm.min.js.map +1 -1
- package/dist/paymentsWidget/viem/index.umd.min.js +1 -1
- package/dist/paymentsWidget/viem/index.umd.min.js.map +1 -1
- package/package.json +19 -6
package/README.md
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
# @halliday-sdk/payments
|
|
2
2
|
|
|
3
|
-
📖 **[Full Documentation](https://docs.halliday.xyz/pages/payments-
|
|
3
|
+
📖 **[Full Documentation](https://docs.halliday.xyz/pages/payments-sdk-docs)**
|
|
4
4
|
|
|
5
5
|
**Main Features:**
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
6
|
+
|
|
7
|
+
- **Payments Widget** - Embeddable cryptocurrency payments widget for seamless onramp/swap transactions
|
|
8
|
+
- **Multi-wallet Integration** - Built-in support for Ethers.js and viem wallet interactions
|
|
9
|
+
- **Flexible Display Modes** - Support modal, popup, and embed widget display
|
|
10
|
+
- **TypeScript Support** - Full type safety with Zod schema validation
|
|
10
11
|
|
|
11
12
|
**Key Widget Capabilities:**
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
13
|
+
|
|
14
|
+
- **Asset Filtering** - Configure input/output assets and supported ramp providers
|
|
15
|
+
- **Custom Branding** - Customize colors, styling, and logo to match your application
|
|
16
|
+
- **Wallet Integration** - Handle message signing, typed data signing, and transaction sending
|
|
15
17
|
|
|
16
18
|
**Display Options:**
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
+
|
|
20
|
+
- **Modal Mode** - Opens widget as a modal on the center of the screen (default)
|
|
21
|
+
- **Popup Mode** - Opens widget in a separate popup window
|
|
22
|
+
- **Embedded Mode** - Embeds widget directly into a specified DOM element
|
|
19
23
|
|
|
20
24
|
**Role-based Access:**
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
25
|
+
|
|
26
|
+
- **Owner Role** - Full access with signing and transaction capabilities
|
|
27
|
+
- **Funder Role** - Transaction sending capabilities for funding operations
|
|
28
|
+
- **Flexible Configuration** - Mix and match roles based on your application needs
|
|
24
29
|
|
|
25
30
|
## Installation
|
|
26
31
|
|
|
@@ -30,31 +35,32 @@ npm install @halliday-sdk/payments
|
|
|
30
35
|
|
|
31
36
|
## Usage
|
|
32
37
|
|
|
33
|
-
### Basic
|
|
38
|
+
### Basic Modal Widget
|
|
34
39
|
|
|
35
40
|
```typescript
|
|
36
|
-
import { openHallidayPayments } from
|
|
41
|
+
import { openHallidayPayments } from "@halliday-sdk/payments";
|
|
37
42
|
|
|
38
43
|
await openHallidayPayments({
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
apiKey: "your-api-key",
|
|
45
|
+
outputs: ["ethereum:0x"], // ether on ethereum mainnet
|
|
41
46
|
});
|
|
42
47
|
```
|
|
43
48
|
|
|
44
49
|
### Embedded Widget
|
|
45
50
|
|
|
46
51
|
```typescript
|
|
47
|
-
import { openHallidayPayments } from
|
|
52
|
+
import { openHallidayPayments } from "@halliday-sdk/payments";
|
|
48
53
|
|
|
49
54
|
await openHallidayPayments({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
apiKey: "your-api-key",
|
|
56
|
+
outputs: ["ethereum:0x"], // ether on ethereum mainnet
|
|
57
|
+
windowType: "EMBED",
|
|
58
|
+
targetElementId: "payments-container",
|
|
54
59
|
});
|
|
55
60
|
```
|
|
56
61
|
|
|
57
62
|
### With Wallet Integration (Ethers.js)
|
|
63
|
+
|
|
58
64
|
This requires `ethers` as a peer dependency.
|
|
59
65
|
|
|
60
66
|
```
|
|
@@ -62,19 +68,19 @@ npm install ethers @halliday-sdk/payments
|
|
|
62
68
|
```
|
|
63
69
|
|
|
64
70
|
```typescript
|
|
65
|
-
import { openHallidayPayments } from
|
|
66
|
-
import { connectSigner } from
|
|
71
|
+
import { openHallidayPayments } from "@halliday-sdk/payments";
|
|
72
|
+
import { connectSigner } from "@halliday-sdk/payments/ethers";
|
|
67
73
|
|
|
68
74
|
const provider = new ethers.BrowserProvider(window.ethereum);
|
|
69
75
|
const ownerMethods = connectSigner(provider.getSigner);
|
|
70
76
|
|
|
71
77
|
await openHallidayPayments({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
apiKey: "your-api-key",
|
|
79
|
+
outputs: ["ethereum:0x"], // ether on ethereum mainnet
|
|
80
|
+
destinationAddress: await signer.getAddress(),
|
|
81
|
+
owner: {
|
|
82
|
+
address: await signer.getAddress(),
|
|
83
|
+
...ownerMethods,
|
|
84
|
+
},
|
|
79
85
|
});
|
|
80
86
|
```
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("axios");function t(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function n(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function r(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in s.prototype)Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=r}const i=n?.Parent??Object;class o extends i{}function s(e){var t;const i=n?.Parent?new o:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(const e of i._zod.deferred)e();return i}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}"function"==typeof SuppressedError&&SuppressedError;class i extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const o={};function s(e){return o}function a(e,t){return"bigint"==typeof t?t.toString():t}function u(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function c(e){return null==e}function p(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function d(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function l(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function f(e=10){const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let r=0;r<e;r++)n+=t[Math.floor(26*Math.random())];return n}function h(e){return JSON.stringify(e)}function m(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const v=u((()=>{try{return new Function(""),!0}catch(e){return!1}}));function y(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}const _=new Set(["string","number","symbol"]);function g(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function b(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const k={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function z(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n].continue)return!0;return!1}function E(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function x(e){return"string"==typeof e?e:e?.message}function $(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=x(e.inst?._zod.def?.error?.(e))??x(t?.error?.(e))??x(n.customError?.(e))??x(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function O(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function R(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const I=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,a,2),enumerable:!0})},A=r("$ZodError",I),P=r("$ZodError",I,{Parent:Error});const T=e=>(t,n,r,o)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},a);if(u instanceof Promise)throw new i;if(u.issues.length){const t=new(o?.Err??e)(u.issues.map((e=>$(e,a,s()))));throw Error.captureStackTrace(t,o?.callee),t}return u.value},S=e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const t=new(i?.Err??e)(a.issues.map((e=>$(e,o,s()))));throw Error.captureStackTrace(t,i?.callee),t}return a.value},Z=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new i;return a.issues.length?{success:!1,error:new(e??A)(a.issues.map((e=>$(e,o,s()))))}:{success:!0,data:a.value}},N=Z(P),j=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map((e=>$(e,i,s()))))}:{success:!0,data:o.value}},C=j(P),F=/^[cC][^\s-]{8,}$/,M=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,V=/^[0-9a-vA-V]{20}$/,q=/^[A-Za-z0-9]{27}$/,U=/^[a-zA-Z0-9_-]{21}$/,L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,W=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,B=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const G=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,K=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,J=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Q=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,X=/^[A-Za-z0-9_-]*$/,ee=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,te=/^\+(?:[0-9]){6,14}[0-9]$/,ne="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",re=new RegExp(`^${ne}$`);function ie(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}const oe=/^\d+n?$/,se=/^\d+$/,ae=/^-?\d+(?:\.\d+)?/i,ue=/true|false/i,ce=/^[^A-Z]*$/,pe=/^[^a-z]*$/,de=r("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),le={number:"number",bigint:"bigint",object:"date"},fe=r("$ZodCheckLessThan",((e,t)=>{de.init(e,t);const n=le[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),he=r("$ZodCheckGreaterThan",((e,t)=>{de.init(e,t);const n=le[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),me=r("$ZodCheckMultipleOf",((e,t)=>{de.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),ve=r("$ZodCheckNumberFormat",((e,t)=>{de.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,o]=k[t.format];e._zod.onattach.push((e=>{const r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=o,n&&(r.pattern=se)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,format:t.format,code:"invalid_type",input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}))}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:e})}})),ye=r("$ZodCheckMaxLength",((e,t)=>{de.init(e,t),e._zod.when=e=>{const t=e.value;return!c(t)&&void 0!==t.length},e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=O(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,input:r,inst:e,continue:!t.abort})}})),_e=r("$ZodCheckMinLength",((e,t)=>{de.init(e,t),e._zod.when=e=>{const t=e.value;return!c(t)&&void 0!==t.length},e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=O(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,input:r,inst:e,continue:!t.abort})}})),ge=r("$ZodCheckLengthEquals",((e,t)=>{de.init(e,t),e._zod.when=e=>{const t=e.value;return!c(t)&&void 0!==t.length},e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const r=n.value,i=r.length;if(i===t.length)return;const o=O(r),s=i>t.length;n.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:n.value,inst:e,continue:!t.abort})}})),we=r("$ZodCheckStringFormat",((e,t)=>{var n;de.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),(n=e._zod).check??(n.check=n=>{if(!t.pattern)throw new Error("Not implemented.");t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})})),be=r("$ZodCheckRegex",((e,t)=>{we.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),ke=r("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=ce),we.init(e,t)})),ze=r("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=pe),we.init(e,t)})),Ee=r("$ZodCheckIncludes",((e,t)=>{de.init(e,t);const n=g(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),xe=r("$ZodCheckStartsWith",((e,t)=>{de.init(e,t);const n=new RegExp(`^${g(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),$e=r("$ZodCheckEndsWith",((e,t)=>{de.init(e,t);const n=new RegExp(`.*${g(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),Oe=r("$ZodCheckOverwrite",((e,t)=>{de.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Re{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),r=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Ie={major:4,minor:0,patch:0},Ae=r("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.id=t.type+"_"+f(10),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ie;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let r,o=z(e);for(const s of t){if(s._zod.when){if(!s._zod.when(e))continue}else if(o)continue;const t=e.issues.length,a=s._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new i;if(r||a instanceof Promise)r=(r??Promise.resolve()).then((async()=>{await a;e.issues.length!==t&&(o||(o=z(e,t)))}));else{if(e.issues.length===t)continue;o||(o=z(e,t))}}return r?r.then((()=>e)):e};e._zod.run=(n,o)=>{const s=e._zod.parse(n,o);if(s instanceof Promise){if(!1===o.async)throw new i;return s.then((e=>t(e,r,o)))}return t(s,r,o)}}e["~standard"]={validate:t=>{try{const n=N(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return C(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),Pe=r("$ZodString",((e,t)=>{var n;Ae.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),Te=r("$ZodStringFormat",((e,t)=>{we.init(e,t),Pe.init(e,t)})),Se=r("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=W),Te.init(e,t)})),Ze=r("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=H(e))}else t.pattern??(t.pattern=H());Te.init(e,t)})),Ne=r("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=B),Te.init(e,t)})),je=r("$ZodURL",((e,t)=>{Te.init(e,t),e._zod.check=n=>{try{const r=new URL(n.value);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ee.source,input:n.value,inst:e})),void(t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e})))}catch(t){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e})}}})),Ce=r("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Te.init(e,t)})),Fe=r("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=U),Te.init(e,t)})),Me=r("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=F),Te.init(e,t)})),De=r("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=M),Te.init(e,t)})),Ve=r("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),Te.init(e,t)})),qe=r("$ZodXID",((e,t)=>{t.pattern??(t.pattern=V),Te.init(e,t)})),Ue=r("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=q),Te.init(e,t)})),Le=r("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){let t=`${ne}T${ie(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}(t)),Te.init(e,t)})),We=r("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=re),Te.init(e,t)})),He=r("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ie(t)}$`)),Te.init(e,t)})),Be=r("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=L),Te.init(e,t)})),Ge=r("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=G),Te.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Ke=r("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=K),Te.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:e})}}})),Je=r("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=J),Te.init(e,t)})),Ye=r("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Y),Te.init(e,t),e._zod.check=t=>{const[n,r]=t.value.split("/");try{if(!r)throw new Error;const e=Number(r);if(`${e}`!==r)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${n}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:e})}}}));function Qe(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Xe=r("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=Q),Te.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=t=>{Qe(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:e})}}));const et=r("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=X),Te.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=t=>{(function(e){if(!X.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Qe(t.padEnd(4*Math.ceil(t.length/4),"="))})(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:e})}})),tt=r("$ZodE164",((e,t)=>{t.pattern??(t.pattern=te),Te.init(e,t)}));const nt=r("$ZodJWT",((e,t)=>{Te.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n,i=JSON.parse(atob(r));return!("typ"in i&&"JWT"!==i?.typ||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e})}})),rt=r("$ZodNumber",((e,t)=>{Ae.init(e,t),e._zod.pattern=e._zod.bag.pattern??ae,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;const o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}})),it=r("$ZodNumber",((e,t)=>{ve.init(e,t),rt.init(e,t)})),ot=r("$ZodBoolean",((e,t)=>{Ae.init(e,t),e._zod.pattern=ue,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}})),st=r("$ZodBigInt",((e,t)=>{Ae.init(e,t),e._zod.pattern=oe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}const{value:i}=n;return"bigint"==typeof i||n.issues.push({expected:"bigint",code:"invalid_type",input:i,inst:e}),n}})),at=r("$ZodAny",((e,t)=>{Ae.init(e,t),e._zod.parse=e=>e})),ut=r("$ZodUnknown",((e,t)=>{Ae.init(e,t),e._zod.parse=e=>e})),ct=r("$ZodNever",((e,t)=>{Ae.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}));function pt(e,t,n){e.issues.length&&t.issues.push(...E(n,e.issues)),t.value[n]=e.value}const dt=r("$ZodArray",((e,t)=>{Ae.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const o=[];for(let e=0;e<i.length;e++){const s=i[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?o.push(a.then((t=>pt(t,n,e)))):pt(a,n,e)}return o.length?Promise.all(o).then((()=>n)):n}}));function lt(e,t,n){e.issues.length&&t.issues.push(...E(n,e.issues)),t.value[n]=e.value}function ft(e,t,n,r){e.issues.length?void 0===r[n]?t.value[n]=n in r?void 0:e.value:t.issues.push(...E(n,e.issues)):void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const ht=r("$ZodObject",((e,t)=>{Ae.init(e,t);const n=u((()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof Ae))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=t.shape,Object.keys(r).filter((e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout)));var r;return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}));d(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n}));let r;const i=m,s=!o.jitless,a=s&&v.value,{catchall:c}=t;let p;e._zod.parse=(o,u)=>{p??(p=n.value);const d=o.value;if(!i(d))return o.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),o;const l=[];if(s&&a&&!1===u?.async&&!0!==u.jitless)r||(r=(e=>{const t=new Re(["shape","payload","ctx"]),{keys:r,optionalKeys:i}=n.value,o=e=>{const t=h(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);for(const e of r)s[e]=f(15);t.write("const newResult = {}");for(const e of r)if(i.has(e)){const n=s[e];t.write(`const ${n} = ${o(e)};`);const r=h(e);t.write(`\n if (${n}.issues.length) {\n if (input[${r}] === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${r} in input) newResult[${r}] = undefined;\n } else {\n newResult[${r}] = ${n}.value;\n }\n `)}else{const n=s[e];t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${h(e)}, ...iss.path] : [${h(e)}]\n })));`),t.write(`newResult[${h(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),o=r(o,u);else{o.value={};const e=p.shape;for(const t of p.keys){const n=e[t],r=n._zod.run({value:d[t],issues:[]},u),i="optional"===n._zod.optin&&"optional"===n._zod.optout;r instanceof Promise?l.push(r.then((e=>i?ft(e,o,t,d):lt(e,o,t)))):i?ft(r,o,t,d):lt(r,o,t)}}if(!c)return l.length?Promise.all(l).then((()=>o)):o;const m=[],v=p.keySet,y=c._zod,_=y.def.type;for(const e of Object.keys(d)){if(v.has(e))continue;if("never"===_){m.push(e);continue}const t=y.run({value:d[e],issues:[]},u);t instanceof Promise?l.push(t.then((t=>lt(t,o,e)))):lt(t,o,e)}return m.length&&o.issues.push({code:"unrecognized_keys",keys:m,input:d,inst:e}),l.length?Promise.all(l).then((()=>o)):o}}));function mt(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>$(e,r,s())))))}),t}const vt=r("$ZodUnion",((e,t)=>{Ae.init(e,t),d(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),d(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>p(e.source))).join("|")})$`)}})),e._zod.parse=(n,r)=>{let i=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)o.push(t),i=!0;else{if(0===t.issues.length)return t;o.push(t)}}return i?Promise.all(o).then((t=>mt(t,n,e,r))):mt(o,n,e,r)}})),yt=r("$ZodDiscriminatedUnion",((e,t)=>{vt.init(e,t);const n=e._zod.parse;d(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e}));const r=u((()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n}));e._zod.parse=(i,o)=>{const s=i.value;if(!m(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),i)}})),_t=r("$ZodIntersection",((e,t)=>{Ae.init(e,t),e._zod.parse=(e,n)=>{const{value:r}=e,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then((([t,n])=>wt(e,t,n))):wt(e,i,o)}}));function gt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(y(e)&&y(t)){const n=Object.keys(t),r=Object.keys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=gt(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=gt(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wt(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),z(e))return e;const r=gt(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const bt=r("$ZodRecord",((e,t)=>{Ae.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!y(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const s=t.valueType._zod.run({value:i[e],issues:[]},r);s instanceof Promise?o.push(s.then((t=>{t.issues.length&&n.issues.push(...E(e,t.issues)),n.value[e]=t.value}))):(s.issues.length&&n.issues.push(...E(e,s.issues)),n.value[e]=s.value)}let a;for(const e in i)s.has(e)||(a=a??[],a.push(e));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a})}else{n.value={};for(const a of Reflect.ownKeys(i)){if("__proto__"===a)continue;const u=t.keyType._zod.run({value:a,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:u.issues.map((e=>$(e,r,s()))),input:a,path:[a],inst:e}),n.value[u.value]=u.value;continue}const c=t.valueType._zod.run({value:i[a],issues:[]},r);c instanceof Promise?o.push(c.then((e=>{e.issues.length&&n.issues.push(...E(a,e.issues)),n.value[u.value]=e.value}))):(c.issues.length&&n.issues.push(...E(a,c.issues)),n.value[u.value]=c.value)}}return o.length?Promise.all(o).then((()=>n)):n}})),kt=r("$ZodEnum",((e,t)=>{Ae.init(e,t);const n=function(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter((e=>_.has(typeof e))).map((e=>"string"==typeof e?g(e):e.toString())).join("|")})$`),e._zod.parse=(t,r)=>{const i=t.value;return e._zod.values.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}})),zt=r("$ZodLiteral",((e,t)=>{Ae.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?g(e):e?e.toString():String(e))).join("|")})$`),e._zod.parse=(n,r)=>{const i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}})),Et=r("$ZodTransform",((e,t)=>{Ae.init(e,t),e._zod.parse=(e,n)=>{const r=t.transform(e.value,e);if(n.async){return(r instanceof Promise?r:Promise.resolve(r)).then((t=>(e.value=t,e)))}if(r instanceof Promise)throw new i;return e.value=r,e}})),xt=r("$ZodOptional",((e,t)=>{Ae.init(e,t),e._zod.optin="optional",e._zod.optout="optional",d(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),d(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${p(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>void 0===e.value?e:t.innerType._zod.run(e,n)})),$t=r("$ZodNullable",((e,t)=>{Ae.init(e,t),d(e._zod,"optin",(()=>t.innerType._zod.optin)),d(e._zod,"optout",(()=>t.innerType._zod.optout)),d(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${p(e.source)}|null)$`):void 0})),d(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),Ot=r("$ZodDefault",((e,t)=>{Ae.init(e,t),e._zod.optin="optional",d(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((e=>Rt(e,t))):Rt(r,t)}}));function Rt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const It=r("$ZodPrefault",((e,t)=>{Ae.init(e,t),e._zod.optin="optional",d(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),At=r("$ZodNonOptional",((e,t)=>{Ae.init(e,t),d(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then((t=>Pt(t,e))):Pt(i,e)}}));function Pt(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Tt=r("$ZodCatch",((e,t)=>{Ae.init(e,t),d(e._zod,"optin",(()=>t.innerType._zod.optin)),d(e._zod,"optout",(()=>t.innerType._zod.optout)),d(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>$(e,n,s())))},input:e.value}),e.issues=[]),e))):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>$(e,n,s())))},input:e.value}),e.issues=[]),e)}})),St=r("$ZodPipe",((e,t)=>{Ae.init(e,t),d(e._zod,"values",(()=>t.in._zod.values)),d(e._zod,"optin",(()=>t.in._zod.optin)),d(e._zod,"optout",(()=>t.out._zod.optout)),e._zod.parse=(e,n)=>{const r=t.in._zod.run(e,n);return r instanceof Promise?r.then((e=>Zt(e,t,n))):Zt(r,t,n)}}));function Zt(e,t,n){return z(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const Nt=r("$ZodReadonly",((e,t)=>{Ae.init(e,t),d(e._zod,"propValues",(()=>t.innerType._zod.propValues)),d(e._zod,"optin",(()=>t.innerType._zod.optin)),d(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(jt):jt(r)}}));function jt(e){return e.value=Object.freeze(e.value),e}const Ct=r("$ZodCustom",((e,t)=>{de.init(e,t),Ae.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then((t=>Ft(t,n,r,e)));Ft(i,n,r,e)}}));function Ft(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(R(e))}}class Mt{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function Dt(){return new Mt}const Vt=Dt();function qt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(t)})}function Ut(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(t)})}function Lt(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(t)})}function Wt(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(t)})}function Ht(e,t){return new fe({check:"less_than",...b(t),value:e,inclusive:!1})}function Bt(e,t){return new fe({check:"less_than",...b(t),value:e,inclusive:!0})}function Gt(e,t){return new he({check:"greater_than",...b(t),value:e,inclusive:!1})}function Kt(e,t){return new he({check:"greater_than",...b(t),value:e,inclusive:!0})}function Jt(e,t){return new me({check:"multiple_of",...b(t),value:e})}function Yt(e,t){return new ye({check:"max_length",...b(t),maximum:e})}function Qt(e,t){return new _e({check:"min_length",...b(t),minimum:e})}function Xt(e,t){return new ge({check:"length_equals",...b(t),length:e})}function en(e){return new Oe({check:"overwrite",tx:e})}const tn=r("ZodISODateTime",((e,t)=>{Le.init(e,t),bn.init(e,t)}));function nn(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(t)})}(tn,e)}const rn=r("ZodISODate",((e,t)=>{We.init(e,t),bn.init(e,t)}));function on(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...b(t)})}(rn,e)}const sn=r("ZodISOTime",((e,t)=>{He.init(e,t),bn.init(e,t)}));function an(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(t)})}(sn,e)}const un=r("ZodISODuration",((e,t)=>{Be.init(e,t),bn.init(e,t)}));function cn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...b(t)})}(un,e)}const pn=(e,t)=>{A.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>i({issues:e})));else if("invalid_key"===t.code)i({issues:t.issues});else if("invalid_element"===t.code)i({issues:t.issues});else if(0===t.path.length)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){const r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},dn=r("ZodError",pn),ln=r("ZodError",pn,{Parent:Error}),fn=T(ln),hn=S(ln),mn=Z(ln),vn=j(ln),yn=r("ZodType",((e,t)=>(Ae.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>w(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>fn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>mn(e,t,n),e.parseAsync=async(t,n)=>hn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>vn(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...b(n)})}(Rr,e,t)}(t,n)),e.superRefine=t=>e.check(function(e,t){const n=function(e,t){const n=new de({check:"custom",...b(t)});return n._zod.check=e,n}((t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(R(e,t.value,n._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=t.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),t.issues.push(R(r))}},e(t.value,t))),t);return n}(t)),e.overwrite=t=>e.check(en(t)),e.optional=()=>_r(e),e.nullable=()=>wr(e),e.nullish=()=>_r(wr(e)),e.nonoptional=t=>function(e,t){return new zr({type:"nonoptional",innerType:e,...b(t)})}(e,t),e.array=()=>tr(e),e.or=t=>or([e,t]),e.and=t=>new ur({type:"intersection",left:e,right:t}),e.transform=t=>$r(e,vr(t)),e.default=t=>{return n=t,new br({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.prefault=t=>{return n=t,new kr({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.catch=t=>{return new Er({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>$r(e,t),e.readonly=()=>new Or({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Vt.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Vt.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Vt.get(e);const n=e.clone();return Vt.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),_n=r("_ZodString",((e,t)=>{Pe.init(e,t),yn.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new be({check:"string_format",format:"regex",...b(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ee({check:"string_format",format:"includes",...b(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new xe({check:"string_format",format:"starts_with",...b(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new $e({check:"string_format",format:"ends_with",...b(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Qt(...t)),e.max=(...t)=>e.check(Yt(...t)),e.length=(...t)=>e.check(Xt(...t)),e.nonempty=(...t)=>e.check(Qt(1,...t)),e.lowercase=t=>e.check(function(e){return new ke({check:"string_format",format:"lowercase",...b(e)})}(t)),e.uppercase=t=>e.check(function(e){return new ze({check:"string_format",format:"uppercase",...b(e)})}(t)),e.trim=()=>e.check(en((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return en((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(en((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(en((e=>e.toUpperCase())))})),gn=r("ZodString",((e,t)=>{Pe.init(e,t),_n.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(t)})}(kn,t)),e.url=t=>e.check(Ut(xn,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(t)})}(Dn,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(t)})}($n,t)),e.guid=t=>e.check(qt(zn,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(t)})}(En,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(t)})}(En,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(t)})}(En,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(t)})}(En,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(t)})}(On,t)),e.guid=t=>e.check(qt(zn,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(t)})}(Rn,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(t)})}(In,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(t)})}(An,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(t)})}(Cn,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(t)})}(Fn,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(t)})}(Pn,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(t)})}(Tn,t)),e.ipv4=t=>e.check(Lt(Sn,t)),e.ipv6=t=>e.check(Wt(Zn,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(t)})}(Nn,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(t)})}(jn,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(t)})}(Mn,t)),e.datetime=t=>e.check(nn(t)),e.date=t=>e.check(on(t)),e.time=t=>e.check(an(t)),e.duration=t=>e.check(cn(t))}));function wn(e){return function(e,t){return new e({type:"string",...b(t)})}(gn,e)}const bn=r("ZodStringFormat",((e,t)=>{Te.init(e,t),_n.init(e,t)})),kn=r("ZodEmail",((e,t)=>{Ne.init(e,t),bn.init(e,t)})),zn=r("ZodGUID",((e,t)=>{Se.init(e,t),bn.init(e,t)})),En=r("ZodUUID",((e,t)=>{Ze.init(e,t),bn.init(e,t)})),xn=r("ZodURL",((e,t)=>{je.init(e,t),bn.init(e,t)}));const $n=r("ZodEmoji",((e,t)=>{Ce.init(e,t),bn.init(e,t)})),On=r("ZodNanoID",((e,t)=>{Fe.init(e,t),bn.init(e,t)})),Rn=r("ZodCUID",((e,t)=>{Me.init(e,t),bn.init(e,t)})),In=r("ZodCUID2",((e,t)=>{De.init(e,t),bn.init(e,t)})),An=r("ZodULID",((e,t)=>{Ve.init(e,t),bn.init(e,t)})),Pn=r("ZodXID",((e,t)=>{qe.init(e,t),bn.init(e,t)})),Tn=r("ZodKSUID",((e,t)=>{Ue.init(e,t),bn.init(e,t)})),Sn=r("ZodIPv4",((e,t)=>{Ge.init(e,t),bn.init(e,t)}));const Zn=r("ZodIPv6",((e,t)=>{Ke.init(e,t),bn.init(e,t)}));const Nn=r("ZodCIDRv4",((e,t)=>{Je.init(e,t),bn.init(e,t)})),jn=r("ZodCIDRv6",((e,t)=>{Ye.init(e,t),bn.init(e,t)})),Cn=r("ZodBase64",((e,t)=>{Xe.init(e,t),bn.init(e,t)})),Fn=r("ZodBase64URL",((e,t)=>{et.init(e,t),bn.init(e,t)})),Mn=r("ZodE164",((e,t)=>{tt.init(e,t),bn.init(e,t)})),Dn=r("ZodJWT",((e,t)=>{nt.init(e,t),bn.init(e,t)})),Vn=r("ZodNumber",((e,t)=>{rt.init(e,t),yn.init(e,t),e.gt=(t,n)=>e.check(Gt(t,n)),e.gte=(t,n)=>e.check(Kt(t,n)),e.min=(t,n)=>e.check(Kt(t,n)),e.lt=(t,n)=>e.check(Ht(t,n)),e.lte=(t,n)=>e.check(Bt(t,n)),e.max=(t,n)=>e.check(Bt(t,n)),e.int=t=>e.check(Ln(t)),e.safe=t=>e.check(Ln(t)),e.positive=t=>e.check(Gt(0,t)),e.nonnegative=t=>e.check(Kt(0,t)),e.negative=t=>e.check(Ht(0,t)),e.nonpositive=t=>e.check(Bt(0,t)),e.multipleOf=(t,n)=>e.check(Jt(t,n)),e.step=(t,n)=>e.check(Jt(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function qn(e){return function(e,t){return new e({type:"number",checks:[],...b(t)})}(Vn,e)}const Un=r("ZodNumberFormat",((e,t)=>{it.init(e,t),Vn.init(e,t)}));function Ln(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...b(t)})}(Un,e)}const Wn=r("ZodBoolean",((e,t)=>{ot.init(e,t),yn.init(e,t)}));function Hn(e){return function(e,t){return new e({type:"boolean",...b(t)})}(Wn,e)}const Bn=r("ZodBigInt",((e,t)=>{st.init(e,t),yn.init(e,t),e.gte=(t,n)=>e.check(Kt(t,n)),e.min=(t,n)=>e.check(Kt(t,n)),e.gt=(t,n)=>e.check(Gt(t,n)),e.gte=(t,n)=>e.check(Kt(t,n)),e.min=(t,n)=>e.check(Kt(t,n)),e.lt=(t,n)=>e.check(Ht(t,n)),e.lte=(t,n)=>e.check(Bt(t,n)),e.max=(t,n)=>e.check(Bt(t,n)),e.positive=t=>e.check(Gt(BigInt(0),t)),e.negative=t=>e.check(Ht(BigInt(0),t)),e.nonpositive=t=>e.check(Bt(BigInt(0),t)),e.nonnegative=t=>e.check(Kt(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Jt(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}));function Gn(e){return function(e,t){return new e({type:"bigint",...b(t)})}(Bn,e)}const Kn=r("ZodAny",((e,t)=>{at.init(e,t),yn.init(e,t)}));const Jn=r("ZodUnknown",((e,t)=>{ut.init(e,t),yn.init(e,t)}));function Yn(){return new Jn({type:"unknown"})}const Qn=r("ZodNever",((e,t)=>{ct.init(e,t),yn.init(e,t)}));function Xn(e){return function(e,t){return new e({type:"never",...b(t)})}(Qn,e)}const er=r("ZodArray",((e,t)=>{dt.init(e,t),yn.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Qt(t,n)),e.nonempty=t=>e.check(Qt(1,t)),e.max=(t,n)=>e.check(Yt(t,n)),e.length=(t,n)=>e.check(Xt(t,n)),e.unwrap=()=>e.element}));function tr(e,t){return function(e,t,n){return new e({type:"array",element:t,...b(n)})}(er,e,t)}const nr=r("ZodObject",((e,t)=>{ht.init(e,t),yn.init(e,t),d(e,"shape",(()=>Object.fromEntries(Object.entries(e._zod.def.shape)))),e.keyof=()=>lr(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Yn()}),e.loose=()=>e.clone({...e._zod.def,catchall:Yn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Xn()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return l(this,"shape",n),n},checks:[]};return w(e,n)}(e,t),e.merge=t=>{return r=t,w(n=e,{...n._zod.def,get shape(){const e={...n._zod.def.shape,...r._zod.def.shape};return l(this,"shape",e),e},catchall:r._zod.def.catchall,checks:[]});var n,r},e.pick=t=>function(e,t){const n={},r=e._zod.def;for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return w(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.omit=t=>function(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return w(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return w(t,{...t._zod.def,shape:i,checks:[]})}(yr,e,t[0]),e.required=(...t)=>function(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)i[t]=new e({type:"nonoptional",innerType:r[t]});return w(t,{...t._zod.def,shape:i,checks:[]})}(zr,e,t[0])}));function rr(e,t){const n={type:"object",get shape(){return l(this,"shape",{...e}),this.shape},...b(t)};return new nr(n)}const ir=r("ZodUnion",((e,t)=>{vt.init(e,t),yn.init(e,t),e.options=t.options}));function or(e,t){return new ir({type:"union",options:e,...b(t)})}const sr=r("ZodDiscriminatedUnion",((e,t)=>{ir.init(e,t),yt.init(e,t)}));function ar(e,t,n){return new sr({type:"union",options:t,discriminator:e,...b(n)})}const ur=r("ZodIntersection",((e,t)=>{_t.init(e,t),yn.init(e,t)}));const cr=r("ZodRecord",((e,t)=>{bt.init(e,t),yn.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}));function pr(e,t,n){return new cr({type:"record",keyType:e,valueType:t,...b(n)})}const dr=r("ZodEnum",((e,t)=>{kt.init(e,t),yn.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const i={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);i[r]=t.entries[r]}return new dr({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{const i={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete i[t]}return new dr({...t,checks:[],...b(r),entries:i})}}));function lr(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new dr({type:"enum",entries:n,...b(t)})}const fr=r("ZodLiteral",((e,t)=>{zt.init(e,t),yn.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}));function hr(e,t){return new fr({type:"literal",values:Array.isArray(e)?e:[e],...b(t)})}const mr=r("ZodTransform",((e,t)=>{Et.init(e,t),yn.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if("string"==typeof r)n.issues.push(R(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),t.continue??(t.continue=!0),n.issues.push(R(t))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then((e=>(n.value=e,n))):(n.value=i,n)}}));function vr(e){return new mr({type:"transform",transform:e})}const yr=r("ZodOptional",((e,t)=>{xt.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function _r(e){return new yr({type:"optional",innerType:e})}const gr=r("ZodNullable",((e,t)=>{$t.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function wr(e){return new gr({type:"nullable",innerType:e})}const br=r("ZodDefault",((e,t)=>{Ot.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));const kr=r("ZodPrefault",((e,t)=>{It.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType}));const zr=r("ZodNonOptional",((e,t)=>{At.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType}));const Er=r("ZodCatch",((e,t)=>{Tt.init(e,t),yn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));const xr=r("ZodPipe",((e,t)=>{St.init(e,t),yn.init(e,t),e.in=t.in,e.out=t.out}));function $r(e,t){return new xr({type:"pipe",in:e,out:t})}const Or=r("ZodReadonly",((e,t)=>{Nt.init(e,t),yn.init(e,t)}));const Rr=r("ZodCustom",((e,t)=>{Ct.init(e,t),yn.init(e,t)}));const Ir="https://v2.prod.halliday.xyz",Ar=/^(https:\/\/(?:[\w-]+\.)*halliday\.xyz(?:\/.*)?|http:\/\/localhost(?::\d+)?(?:\/.*)?|https:\/\/localhost(?::\d+)?(?:\/.*)?)$/,Pr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,Tr=wn().refine((e=>/^(0|[1-9]\d*)(\.\d+)?$/.test(e)),{message:"Invalid amount"}),Sr=/^(0x|0x[a-fA-F0-9]{40})$/,Zr=wn().refine((e=>Sr.test(e)),{message:"Invalid EVM token address"}),Nr=Zr.refine((e=>"0x"!==e),{message:"Invalid EVM address"}),jr=/^[1-9A-HJ-NP-Za-km-z]{32,44}$/,Cr=/^So[1-2]{41}$/,Fr=wn().refine((e=>jr.test(e)||Cr.test(e)),{message:"Invalid Solana token address"}),Mr=wn().refine((e=>jr.test(e)),{message:"Invalid Solana address"}),Dr=or([Nr,Mr]),Vr=wn().refine((e=>/^[a-zA-Z_]{3,}$/.test(e)),{message:"Invalid fiat"}),qr=rr({issuer:wn(),name:wn(),alias:wn().optional(),symbol:wn(),decimals:qn()}),Ur=wn(),Lr=wn().regex(/^[a-zA-Z]\w{1,7}$/,{message:"Must be a short alpha-numeric symbol"}),Wr=qn().min(0).max(18),Hr=wn().url(),Br=wn(),Gr=rr({chain:wn(),address:Zr}),Kr=rr({chain:hr("solana"),address:Fr}),Jr=rr({chain:wn(),address:wn()}),Yr=or([Gr,Kr,Jr]),Qr=wn().refine((e=>{const[t,n]=e.split(":");return Yr.safeParse({chain:t,address:n}).success}),{message:"Invalid token"}),Xr=rr({name:Ur,symbol:Lr,decimals:Wr,alias:Lr.optional(),image_url:Hr.optional(),coingecko_id:Br.optional(),wrapper:Lr.optional(),is_native:Hn().optional()}),ei=Gr.extend(Xr.shape),ti=Kr.extend(Xr.shape),ni=or([ei,ti,Jr.extend(Xr.shape)]),ri=or([Qr,Vr]),ii=or([ni,qr]),oi=ar("type",[rr({type:hr("chain"),chain:wn()}),rr({type:hr("issuer"),issuer:wn()})]),si=wn().transform((e=>e.toLowerCase())),ai=(ui=e=>"string"==typeof e?e.toUpperCase():e,ci=lr(["ONRAMP","OFFRAMP"]),$r(vr(ui),ci));var ui,ci;const pi=rr({to:Nr,from:Nr.optional(),nonce:qn().optional(),gasLimit:Gn().optional(),gasPrice:Gn().optional(),maxPriorityFeePerGas:Gn().optional(),maxFeePerGas:Gn().optional(),data:wn().optional(),value:Gn().optional(),chainId:qn()}),di=rr({transactionHash:wn().optional(),blockHash:wn().optional(),blockNumber:qn().optional(),from:Nr.optional(),to:Nr.optional(),rawReceipt:new Kn({type:"any"})}),li=rr({chain_id:Gn(),network:wn(),native_currency:rr({name:wn(),symbol:wn(),decimals:qn()}),rpc:wn(),image:wn(),is_testnet:Hn(),explorer:wn()}),fi=rr({chain_id:Gn(),network:wn()}),hi=or([li,fi]),mi=lr(["CREDIT_CARD","DEBIT_CARD","ACH","FIAT_BALANCE","TOKEN_BALANCE","APPLE_PAY","PAYPAL","VENMO","REVOLUT","GOOGLE_PAY","SEPA","FASTER_PAYMENTS","PIX","UPI","WIRE"]);class vi{static stringify(e,t){return JSON.stringify(e,this.replacer,t)}static parse(e){return JSON.parse(e,this.reviver)}}vi.replacer=(e,t)=>"bigint"==typeof t?{"#":t.toString()}:t,vi.reviver=(e,t)=>t&&"object"==typeof t&&"#"in t&&1===Object.keys(t).length?BigInt(t["#"]):t;var yi,_i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},gi={};!function(){return yi||(yi=1,function(e){!function(){var t="object"==typeof globalThis?globalThis:"object"==typeof _i?_i:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=r(e);function r(e,t){return function(n,r){Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0!==t.Reflect&&(n=r(t.Reflect,n)),function(e,t){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,a={__proto__:[]}instanceof Array,u=!s&&!a,c={create:s?function(){return de(Object.create(null))}:a?function(){return de({__proto__:null})}:function(){return de({})},has:u?function(e,t){return n.call(e,t)}:function(e,t){return t in e},get:u?function(e,t){return n.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},p=Object.getPrototypeOf(Function),d="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:ue(),l="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:ce(),f="function"==typeof WeakMap?WeakMap:pe(),h=r?Symbol.for("@reflect-metadata:registry"):void 0,m=ie(),v=oe(m);function y(e,t,n,r){if(C(n)){if(!H(e))throw new TypeError;if(!G(t))throw new TypeError;return O(e,t)}if(!H(e))throw new TypeError;if(!D(t))throw new TypeError;if(!D(r)&&!C(r)&&!F(r))throw new TypeError;return F(r)&&(r=void 0),R(e,t,n=W(n),r)}function _(e,t){function n(n,r){if(!D(n))throw new TypeError;if(!C(r)&&!K(r))throw new TypeError;S(e,t,n,r)}return n}function g(e,t,n,r){if(!D(n))throw new TypeError;return C(r)||(r=W(r)),S(e,t,n,r)}function w(e,t,n){if(!D(t))throw new TypeError;return C(n)||(n=W(n)),I(e,t,n)}function b(e,t,n){if(!D(t))throw new TypeError;return C(n)||(n=W(n)),A(e,t,n)}function k(e,t,n){if(!D(t))throw new TypeError;return C(n)||(n=W(n)),P(e,t,n)}function z(e,t,n){if(!D(t))throw new TypeError;return C(n)||(n=W(n)),T(e,t,n)}function E(e,t){if(!D(e))throw new TypeError;return C(t)||(t=W(t)),Z(e,t)}function x(e,t){if(!D(e))throw new TypeError;return C(t)||(t=W(t)),N(e,t)}function $(e,t,n){if(!D(t))throw new TypeError;if(C(n)||(n=W(n)),!D(t))throw new TypeError;C(n)||(n=W(n));var r=ae(t,n,!1);return!C(r)&&r.OrdinaryDeleteMetadata(e,t,n)}function O(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!C(r)&&!F(r)){if(!G(r))throw new TypeError;t=r}}return t}function R(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!C(o)&&!F(o)){if(!D(o))throw new TypeError;r=o}}return r}function I(e,t,n){if(A(e,t,n))return!0;var r=ne(t);return!F(r)&&I(e,r,n)}function A(e,t,n){var r=ae(t,n,!1);return!C(r)&&U(r.OrdinaryHasOwnMetadata(e,t,n))}function P(e,t,n){if(A(e,t,n))return T(e,t,n);var r=ne(t);return F(r)?void 0:P(e,r,n)}function T(e,t,n){var r=ae(t,n,!1);if(!C(r))return r.OrdinaryGetOwnMetadata(e,t,n)}function S(e,t,n,r){ae(n,r,!0).OrdinaryDefineOwnMetadata(e,t,n,r)}function Z(e,t){var n=N(e,t),r=ne(e);if(null===r)return n;var i=Z(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new l,s=[],a=0,u=n;a<u.length;a++){var c=u[a];o.has(c)||(o.add(c),s.push(c))}for(var p=0,d=i;p<d.length;p++){c=d[p];o.has(c)||(o.add(c),s.push(c))}return s}function N(e,t){var n=ae(e,t,!1);return n?n.OrdinaryOwnMetadataKeys(e,t):[]}function j(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function C(e){return void 0===e}function F(e){return null===e}function M(e){return"symbol"==typeof e}function D(e){return"object"==typeof e?null!==e:"function"==typeof e}function V(e,t){switch(j(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n="string",r=Y(e,i);if(void 0!==r){var o=r.call(e,n);if(D(o))throw new TypeError;return o}return q(e)}function q(e,t){var n,r,i=e.toString;if(B(i)&&!D(r=i.call(e)))return r;if(B(n=e.valueOf)&&!D(r=n.call(e)))return r;throw new TypeError}function U(e){return!!e}function L(e){return""+e}function W(e){var t=V(e);return M(t)?t:L(t)}function H(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function B(e){return"function"==typeof e}function G(e){return"function"==typeof e}function K(e){switch(j(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){return e===t||e!=e&&t!=t}function Y(e,t){var n=e[t];if(null!=n){if(!B(n))throw new TypeError;return n}}function Q(e){var t=Y(e,o);if(!B(t))throw new TypeError;var n=t.call(e);if(!D(n))throw new TypeError;return n}function X(e){return e.value}function ee(e){var t=e.next();return!t.done&&t}function te(e){var t=e.return;t&&t.call(e)}function ne(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===p)return t;if(t!==p)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function re(){var e,n,r,i;C(h)||void 0===t.Reflect||h in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=se(t.Reflect));var o=new f,s={registerProvider:a,getProvider:c,setProvider:m};return s;function a(t){if(!Object.isExtensible(s))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case C(n):n=t;break;case n===t:break;case C(r):r=t;break;case r===t:break;default:void 0===i&&(i=new l),i.add(t)}}function u(t,o){if(!C(n)){if(n.isProviderFor(t,o))return n;if(!C(r)){if(r.isProviderFor(t,o))return n;if(!C(i))for(var s=Q(i);;){var a=ee(s);if(!a)return;var u=X(a);if(u.isProviderFor(t,o))return te(s),u}}}if(!C(e)&&e.isProviderFor(t,o))return e}function c(e,t){var n,r=o.get(e);return C(r)||(n=r.get(t)),C(n)?(C(n=u(e,t))||(C(r)&&(r=new d,o.set(e,r)),r.set(t,n)),n):n}function p(e){if(C(e))throw new TypeError;return n===e||r===e||!C(i)&&i.has(e)}function m(e,t,n){if(!p(n))throw new Error("Metadata provider not registered.");var r=c(e,t);if(r!==n){if(!C(r))return!1;var i=o.get(e);C(i)&&(i=new d,o.set(e,i)),i.set(t,n)}return!0}}function ie(){var e;return!C(h)&&D(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[h]),C(e)&&(e=re()),!C(h)&&D(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,h,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}function oe(e){var t=new f,n={isProviderFor:function(e,n){var r=t.get(e);return!C(r)&&r.has(n)},OrdinaryDefineOwnMetadata:s,OrdinaryHasOwnMetadata:i,OrdinaryGetOwnMetadata:o,OrdinaryOwnMetadataKeys:a,OrdinaryDeleteMetadata:u};return m.registerProvider(n),n;function r(r,i,o){var s=t.get(r),a=!1;if(C(s)){if(!o)return;s=new d,t.set(r,s),a=!0}var u=s.get(i);if(C(u)){if(!o)return;if(u=new d,s.set(i,u),!e.setProvider(r,i,n))throw s.delete(i),a&&t.delete(r),new Error("Wrong provider for target.")}return u}function i(e,t,n){var i=r(t,n,!1);return!C(i)&&U(i.has(e))}function o(e,t,n){var i=r(t,n,!1);if(!C(i))return i.get(e)}function s(e,t,n,i){r(n,i,!0).set(e,t)}function a(e,t){var n=[],i=r(e,t,!1);if(C(i))return n;for(var o=Q(i.keys()),s=0;;){var a=ee(o);if(!a)return n.length=s,n;var u=X(a);try{n[s]=u}catch(e){try{te(o)}finally{throw e}}s++}}function u(e,n,i){var o=r(n,i,!1);if(C(o))return!1;if(!o.delete(e))return!1;if(0===o.size){var s=t.get(n);C(s)||(s.delete(i),0===s.size&&t.delete(s))}return!0}}function se(e){var t=e.defineMetadata,n=e.hasOwnMetadata,r=e.getOwnMetadata,i=e.getOwnMetadataKeys,o=e.deleteMetadata,s=new f;return{isProviderFor:function(e,t){var n=s.get(e);return!(C(n)||!n.has(t))||!!i(e,t).length&&(C(n)&&(n=new l,s.set(e,n)),n.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:n,OrdinaryGetOwnMetadata:r,OrdinaryOwnMetadataKeys:i,OrdinaryDeleteMetadata:o}}function ae(e,t,n){var r=m.getProvider(e,t);if(!C(r))return r;if(n){if(m.setProvider(e,t,v))return v;throw new Error("Illegal state.")}}function ue(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[o]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,J(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,i)},t.prototype.entries=function(){return new n(this._keys,this._values,s)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[o]=function(){return this.entries()},t.prototype._find=function(e,t){if(!J(this._cacheKey,e)){this._cacheIndex=-1;for(var n=0;n<this._keys.length;n++)if(J(this._keys[n],e)){this._cacheIndex=n;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function i(e,t){return t}function s(e,t){return[e,t]}}function ce(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[o]=function(){return this.keys()},e}()}function pe(){var e=16,t=c.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&c.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?c.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+u()}while(c.has(t,e));return t[e]=!0,e}function o(e,t){if(!n.call(e,r)){if(!t)return;Object.defineProperty(e,r,{value:c.create()})}return e[r]}function s(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function a(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):s(t,e),t}return s(new Array(e),e)}function u(){var t=a(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function de(e){return e.__=void 0,delete e.__,e}e("decorate",y),e("metadata",_),e("defineMetadata",g),e("hasMetadata",w),e("hasOwnMetadata",b),e("getMetadata",k),e("getOwnMetadata",z),e("getMetadataKeys",E),e("getOwnMetadataKeys",x),e("deleteMetadata",$)}(n,t),void 0===t.Reflect&&(t.Reflect=e)}()}(e||(e={}))),gi;var e}();const wi=Symbol("api-method-metadata"),bi=new Map,ki=e=>(t,n)=>{Reflect.defineMetadata(wi,e,t,n);const r=e.httpVerb,i=e.endpoint,o=`${r.toLowerCase()} ${i}`;bi.set(o,e);const s=t.constructor;"function"!=typeof s.toJSON&&Object.defineProperty(s,"toJSON",{value:e=>Reflect.getMetadata(wi,s.prototype,e),writable:!1,configurable:!1})},zi={enabled:!0,debug:!1},Ei=(e,t=zi)=>{if(t.enabled)try{const n=((e,t=Ir)=>{if(!e)return"";let n=new URL(e,t).pathname;return n=n.replace(/\/[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12}/gi,""),n})(e.config.url||"");if(!n)return void(t.debug&&console.debug("[HallidayPaymentsApiClient] No endpoint found in URL:",e.config.url));const r=`${e.config.method?.toLowerCase()||"get"} ${n}`,i=bi.get(r)?.outputSchema;if(!i)return void(t.debug&&console.debug(`[HallidayPaymentsApiClient] No validation schema defined for endpoint: ${n}`));const o=i.safeParse(e.data);o.success||(console.warn(`[HallidayPaymentsApiClient] Response validation failed for ${n}. Your SDK version might be outdated - please check for updates.`),t.debug&&console.debug("[HallidayPaymentsApiClient] Response validation error:",o.error))}catch(e){t.debug&&console.debug("[HallidayPaymentsApiClient] Response validation error:",e)}};var xi;exports.ErrorCodes=void 0,(xi=exports.ErrorCodes||(exports.ErrorCodes={})).VALIDATION_ERROR="VALIDATION_ERROR",xi.API_ERROR="API_ERROR",xi.SERVER_ERROR="SERVER_ERROR",xi.NETWORK_ERROR="NETWORK_ERROR",xi.UNKNOWN_ERROR="UNKNOWN_ERROR";class $i extends Error{constructor({message:e,code:t,status:n,statusText:r,reqHeaders:i,resHeaders:o,data:s,config:a,request:u,response:c,error:p,validationIssues:d,validationMessage:l}){super(e),this.name="HallidayPaymentsApiClientError",this.validationIssues=null,this.validationMessage=null,this.status=null,this.statusText=null,this.reqHeaders=null,this.resHeaders=null,this.data=null,this.config=null,this.request=null,this.response=null,this.error=null,this.code=t,this.message=e,this.status=n??null,this.statusText=r??null,this.reqHeaders=i??null,this.resHeaders=o??null,this.data=s??null,this.config=a??null,this.request=u??null,this.response=c??null,this.error=p??null,this.validationIssues=d??null,this.validationMessage=l??null,Object.setPrototypeOf(this,$i.prototype)}static isPaymentsApiClientError(e){return e instanceof $i}static parseValidationError({message:e,error:t}){return new $i({message:e??t?.message??"Validation error",code:exports.ErrorCodes.VALIDATION_ERROR,validationIssues:t instanceof dn?t.issues:null,validationMessage:t instanceof dn?t.message:null,error:t})}static parseAxiosError(e){if(e.response){const t=e.response.status;let n=e.response.data?.errors||[],r=null;Array.isArray(n)||(n=[n]);let i=n.map((e=>"string"!=typeof e?JSON.stringify(e):e)).join("\n")||e.message||"Unknown error",o=e.response?.statusText;return 500===t?new $i({message:i,code:exports.ErrorCodes.SERVER_ERROR,status:500,statusText:`${e.code??"500"}: ${o??"Server Error"}`,data:e.response?.data,config:e.config,request:e.request,response:e.response,reqHeaders:e.request?.headers,resHeaders:e.response?.headers}):(400===t?(i=`Bad request: ${i}`,o=`${e.code??"400"}: ${o??"Bad Request"}`,r=n):401===t?(i=`Unauthorized: ${i}`,o=`${e.code??"401"}: ${o??"Unauthorized"}`):403===t?(i=`Forbidden: ${i}`,o=`${e.code??"403"}: ${o??"Forbidden"}`):404===t?(i=`Resource not found: ${i}`,o=`${e.code??"404"}: ${o??"Not Found"}`):(i=`Request failed with status ${t}: ${i}`,o=`${e.code??t}: ${o??"Unexpected error"}`),new $i({message:i,code:exports.ErrorCodes.API_ERROR,status:t,statusText:o,data:e.response?.data,config:e.config,request:e.request,response:e.response,reqHeaders:e.request?.headers,resHeaders:e.response?.headers,validationIssues:r}))}return e.request?new $i({message:e.message||`No response received from the server: ${e.code}`,code:exports.ErrorCodes.NETWORK_ERROR,config:e.config,request:e.request,reqHeaders:e.request?.headers}):"ERR_CANCELED"===e.code?null:new $i({message:`${e.code?`${e.code}: `:""}${e.message||"No message"}`,code:exports.ErrorCodes.NETWORK_ERROR,config:e.config,request:e.request,error:e})}toJSON(){return JSON.stringify({name:this.name,code:this.code,message:this.message,validationIssues:this.validationIssues,status:this.status,statusText:this.statusText,config:this.config,stack:this.stack})}}const Oi=({apiKey:t,baseUrl:n=Ir,responseValidationOptions:r=zi})=>{if(!Ar.test(n))throw new Error(`Invalid base URL: ${n}`);if(!t)throw new Error("API key is required");const i=e.create({baseURL:n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},parseReviver:vi.reviver}),o=(s=r,{onFulfilled:e=>(Ei(e,s),e),onRejected:e=>{throw e}});var s;i.interceptors.response.use(o.onFulfilled,o.onRejected);const a={onFulfilled:e=>e,onRejected:t=>{if(e.isAxiosError(t)){const e=$i.parseAxiosError(t);if(e)throw e;return{data:null}}throw new $i({message:t.message||"Unknown error",code:exports.ErrorCodes.UNKNOWN_ERROR,error:t})}};return i.interceptors.response.use(a.onFulfilled,a.onRejected),i},Ri=e=>Object.entries(e).reduce(((e,[t,n])=>{if("sandbox"===t)e.push("sandbox="+(!0===n?"true":"false"));else if(Array.isArray(n))for(const r of n)e.push(`${t}[]=${r}`);else e.push(`${t}=${n}`);return e}),[]).join("&"),Ii=wn().refine((e=>Pr.test(e)),{message:"Invalid payment ID"}),Ai=rr({onramps:tr(si).optional(),offramps:tr(si).optional(),sandbox:Hn().optional().default(!1)}),Pi=Ai.extend({inputs:tr(ri).optional(),outputs:tr(ri)}),Ti=Ai.extend({inputs:tr(ri),outputs:tr(ri).optional()}),Si=or([Pi,Ti]),Zi=rr({asset:ri,amount:Tr}),Ni=rr({token:Qr,amount:Tr}),ji=wn(),Ci=or([Lt(Sn,Fi),function(e){return Wt(Zn,e)}()]);var Fi;const Mi=lr(["BETA_EDGES","ORG_BETA_EDGES","ORG_EDGES"]),Di=rr({price_currency:Vr,onramps:tr(si).optional(),onramp_methods:tr(mi).optional(),customer_ip_address:wn().optional(),customer_id:wn().optional(),parent_payment_id:Ii.optional(),features:tr(Mi).optional()}),Vi=ar("kind",[rr({kind:hr("FIXED_INPUT"),fixed_input_amount:Zi,output_asset:ri})]),qi=Di.extend({request:Vi}),Ui=lr(["USER","DEST","HALLIDAY","SPW","REV_SHARE","BRIDGE"]),Li=lr(["APPROVAL","BALANCE"]),Wi=rr({asset:ri,property:Li}),Hi=rr({account:Ui,resource:Wi}),Bi=or([hr("COMPLETE"),hr("UNREACHABLE"),hr("FAILED")]),Gi=or([Bi,hr("PENDING")]),Ki=lr(["PENDING","COMPLETE","FAILED","EXPIRED","WITHDRAWN","TAINTED"]),Ji=rr({consume:tr(Hi),produce:tr(Hi)}),Yi=Hi.extend({amount:Tr}),Qi=Ji.extend({consume:tr(Yi),produce:tr(Yi)}),Xi=pr(ri,wn()),eo=ar("kind",[rr({kind:or([hr("amount"),hr("amount-downstream")]),given:wn(),limits:rr({min:wn().optional(),max:wn().optional()}),source:wn(),message:wn()}),rr({kind:hr("geolocation"),message:wn()}),rr({kind:hr("provider"),message:wn()}),rr({kind:hr("other"),message:wn()}),rr({kind:hr("unknown"),message:wn()})]),to=rr({service_ids:tr(wn()),latency_seconds:qn(),issues:tr(eo).optional()}),no=or([hr("USER_FUND"),hr("ONCHAIN_STEP"),hr("ONRAMP")]),ro=rr({type:no,net_effect:Qi,pieces_info:tr(rr({type:or([hr("onramp"),hr("poll"),hr("bridge"),hr("rev_share"),hr("transfer_out"),hr("convert")])})),step_index:qn().optional()}),io=rr({payment_id:wn(),output_amount:rr({asset:ri,amount:wn()}),onramp:si.optional(),onramp_method:mi.optional(),fees:rr({total_fees:wn(),conversion_fees:wn(),network_fees:wn(),business_fees:wn(),currency_symbol:Vr}),route:tr(ro)}),oo=ro.extend({status:Gi,transaction_hash:wn().optional()}),so=io.omit({payment_id:!0}).partial({output_amount:!0,onramp:!0,onramp_method:!0,fees:!0}).extend({route:tr(oo)}),ao=rr({quote_request:qi,quotes:tr(io),current_prices:Xi,price_currency:Vr,state_token:wn(),quoted_at:wn(),accept_by:wn(),failures:tr(to)}),uo=rr({payment_id:Ii,state_token:wn(),owner_address:Dr,destination_address:Dr,client_redirect_url:wn().optional()}),co=rr({deposit_token:Qr,deposit_chain:wn(),deposit_amount:Tr,deposit_address:Dr}),po=rr({type:lr(["ONRAMP","TRANSFER_IN"]),payment_id:Ii,funding_page_url:function(e){return Ut(xn,e)}(),deposit_info:tr(co)}),lo=rr({payment_id:Ii,status:Ki,funded:Hn(),created_at:wn(),updated_at:wn(),initiate_fund_by:wn(),completed_at:wn().optional(),quote_request:qi,quoted:io.omit({payment_id:!0}),fulfilled:so,current_prices:Xi,price_currency:Vr,customer_id:wn().optional(),processing_addresses:tr(rr({address:Dr,chain:wn()})),owner_address:Dr,destination_address:Dr,next_instruction:po.optional(),parent_payment_id:Ii.optional()}),fo=lo,ho=rr({payment_id:Ii,redirect_url:wn().optional()}),mo=rr({funding_page_onramp_url:wn(),client_redirect_url:wn().optional(),client_secret:wn().optional()}),vo=rr({id_query:wn().optional(),pagination_key:wn().optional(),dest_address:Dr.optional(),owner_address:Dr.optional(),limit:qn().int().positive().optional(),category:lr(["ALL","NEW_OR_FUNDED"]).optional()}),yo=rr({payment_statuses:tr(fo),next_pagination_key:wn().nullable()}),_o=rr({payment_id:Ii.optional(),custom_queries:tr(rr({address:Dr,token:or([Qr,Yr])})).optional()}).refine((e=>!(!e.payment_id&&!e.custom_queries?.length)),{message:"payment_id or custom_queries is required"}),go=rr({balance_results:tr(rr({address:Dr,token:Qr,value:ar("kind",[rr({kind:hr("amount"),amount:Tr}),rr({kind:hr("error")})])}))}),wo=rr({fiat:Vr,tokens:tr(Qr)}),bo=wn(),ko=rr({payment_id:Ii,token_amounts:tr(Ni),recipient_address:Dr}),zo=rr({payment_id:Ii,withdraw_authorization:bo}),Eo=ko.extend({owner_signature:ji}),xo=rr({payment_id:Ii,transaction_hash:wn()});class $o{constructor(e){this.getChains=async(e=!1)=>{const{data:t}=await this.apiClient.get("/chains?sandbox="+(e?"true":"false"));return t},this.getAssetDetails=async({assets:e=[],sandbox:t})=>{if("boolean"!=typeof t)throw $i.parseValidationError({message:"Invalid sandbox value"});let n=`sandbox=${t}`;if(e){if(!Array.isArray(e))throw $i.parseValidationError({message:"Invalid assets"});for(const t of e)try{n+=`&assets[]=${ri.parse(t)}`}catch(e){throw $i.parseValidationError({message:`Invalid asset: ${t}`,error:e})}}return(await this.apiClient.get(`/assets?${n}`)).data},this.getInputs=async e=>{let t;try{const n=Pi.parse(e);t=Ri(n)}catch(e){throw $i.parseValidationError({message:"Invalid asset filters",error:e})}return(await this.apiClient.get(`/assets/available-inputs?${t}`)).data},this.getOutputs=async e=>{let t;try{const n=Ti.parse(e);t=Ri(n)}catch(e){throw $i.parseValidationError({message:"Invalid asset filters",error:e})}return(await this.apiClient.get(`/assets/available-outputs?${t}`)).data},this.getQuotes=async(e,t)=>{let n;try{n=qi.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid request for quotes",error:e})}return(await this.apiClient.post("/payments/quotes",n,{signal:t})).data},this.confirmQuote=async e=>{let t;try{t=uo.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid request for confirming quote",error:e})}return(await this.apiClient.post("/payments/confirm",t)).data},this.createPaymentSession=async e=>{let t;try{t=ho.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid request for onramp session",error:e})}return(await this.apiClient.post("/onramp",t)).data},this.getStatus=async(e,t)=>{try{Ii.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid payment ID",error:e})}const n=new URLSearchParams;n.set("payment_id",e);const r=n.toString();return(await this.apiClient.get(`/payments?${r}`,{signal:t})).data},this.getPaymentsHistory=async e=>{let t;try{t=vo.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid request for payments",error:e})}const n=new URLSearchParams;t.id_query&&n.set("id_query",t.id_query),t.pagination_key&&n.set("pagination_key",t.pagination_key),t.dest_address&&n.set("dest_address",t.dest_address),t.owner_address&&n.set("owner_address",t.owner_address),t.limit&&n.set("limit",t.limit.toString()),t.category&&n.set("category",t.category);let r=n.toString();r&&(r=`?${r}`);return(await this.apiClient.get(`/payments/${r}`)).data},this.getBalance=async e=>{let t;try{t=_o.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid request for balance",error:e})}return(await this.apiClient.post("/payments/balances",t)).data},this.getPrices=async e=>{let t;try{t=wo.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid request for prices",error:e})}return(await this.apiClient.post("/prices",t)).data},this.getWithdrawAuthorization=async e=>{let t;try{t=ko.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid request for withdraw authorization",error:e})}return(await this.apiClient.post("/payments/withdraw",t)).data},this.withdraw=async e=>{let t;try{t=Eo.parse(e)}catch(e){throw $i.parseValidationError({message:"Invalid request for withdraw",error:e})}return(await this.apiClient.post("/payments/withdraw/confirm",t)).data};const{apiKey:t,baseUrl:n=Ir,responseValidation:r={}}=e,i={...zi,...r};this.apiClient=Oi({baseUrl:n,apiKey:t,responseValidationOptions:i})}static toJSON(e){return Reflect.getMetadata(wi,this.prototype,e)}}t([ki({description:"Retrieves the supported chain configuration.",httpVerb:"GET",endpoint:"/chains",inputSchema:Hn().optional(),outputSchema:pr(wn(),hi)}),n("design:type",Object)],$o.prototype,"getChains",void 0),t([ki({description:"Retrieves the asset details for all or the specified assets.",httpVerb:"GET",endpoint:"/assets",inputSchema:rr({assets:tr(ri).optional(),sandbox:Hn().optional()}),outputSchema:pr(ri,ii)}),n("design:type",Object)],$o.prototype,"getAssetDetails",void 0),t([ki({description:"Retrieves the supported inputs for the specified filters.",httpVerb:"GET",endpoint:"/assets/available-inputs",inputSchema:Pi,outputSchema:pr(ri,rr({fiats:tr(Vr),tokens:tr(Qr)}))}),n("design:type",Object)],$o.prototype,"getInputs",void 0),t([ki({description:"Retrieves the supported outputs for the specified filters.",httpVerb:"GET",endpoint:"/assets/available-outputs",inputSchema:Ti,outputSchema:pr(ri,rr({fiats:tr(Vr),tokens:tr(Qr)}))}),n("design:type",Object)],$o.prototype,"getOutputs",void 0),t([ki({description:"Retrieves quotes for the given input and output asset.",httpVerb:"POST",endpoint:"/payments/quotes",inputSchema:qi,outputSchema:ao}),n("design:type",Object)],$o.prototype,"getQuotes",void 0),t([ki({description:"Confirms a quote.",httpVerb:"POST",endpoint:"/payments/confirm",inputSchema:uo,outputSchema:lo}),n("design:type",Object)],$o.prototype,"confirmQuote",void 0),t([ki({description:"Creates a onramp provider session for a given payment.",httpVerb:"POST",endpoint:"/onramp",inputSchema:ho,outputSchema:mo}),n("design:type",Object)],$o.prototype,"createPaymentSession",void 0),t([ki({description:"Retrieves the status of a given payment.",httpVerb:"GET",endpoint:"/payments",inputSchema:Ii,outputSchema:fo}),n("design:type",Object)],$o.prototype,"getStatus",void 0),t([ki({description:"Retrieves the payments history of a given destination address.",httpVerb:"GET",endpoint:"/payments/history",inputSchema:vo,outputSchema:yo}),n("design:type",Object)],$o.prototype,"getPaymentsHistory",void 0),t([ki({description:"Retrieves the balance of a given workflow or spw address.",httpVerb:"POST",endpoint:"/payments/balances",inputSchema:_o,outputSchema:go}),n("design:type",Object)],$o.prototype,"getBalance",void 0),t([ki({description:"Retrieves the prices tokens in a given fiat currency.",httpVerb:"POST",endpoint:"/prices",inputSchema:wo,outputSchema:Xi}),n("design:type",Object)],$o.prototype,"getPrices",void 0),t([ki({description:"Retrieves the withdraw authorization for a given workflow.",httpVerb:"POST",endpoint:"/payments/withdraw",inputSchema:ko,outputSchema:zo}),n("design:type",Object)],$o.prototype,"getWithdrawAuthorization",void 0),t([ki({description:"Submits the owner signature for a withdraw payload.",httpVerb:"POST",endpoint:"/payments/withdraw/confirm",inputSchema:Eo,outputSchema:xo}),n("design:type",Object)],$o.prototype,"withdraw",void 0),exports.Account=Ui,exports.Address=Dr,exports.Amount=Tr,exports.Asset=ri,exports.AssetDetails=ii,exports.AssetFilters=Si,exports.BalanceResponse=go,exports.ChainConfig=hi,exports.ChangeAmount=Yi,exports.ConfirmQuoteResponse=lo,exports.DepositInfo=co,exports.EVMAddress=Nr,exports.EVMChainConfig=li,exports.EVMTokenAddress=Zr,exports.EVMTokenDetails=ei,exports.Failure=to,exports.Feature=Mi,exports.Fiat=Vr,exports.FiatDetails=qr,exports.Fulfillment=so,exports.FulfillmentRoute=oo,exports.HSON=vi,exports.IPAddressOverride=Ci,exports.InputsAssetFilters=Pi,exports.Issue=eo,exports.NextInstruction=po,exports.ObservedStatus=Gi,exports.OnrampMethod=mi,exports.OnrampSessionResponse=mo,exports.OutputsAssetFilters=Ti,exports.PaymentHistoryResult=yo,exports.PaymentId=Ii,exports.PaymentStatus=fo,exports.PaymentsApiClientError=$i,exports.Prices=Xi,exports.Quote=io,exports.QuotedRoute=ro,exports.QuotesResponse=ao,exports.RampName=si,exports.RampType=ai,exports.Realm=oi,exports.RequestForBalance=_o,exports.RequestForConfirmQuote=uo,exports.RequestForOnrampSession=ho,exports.RequestForPaymentsHistory=vo,exports.RequestForPrices=wo,exports.RequestForQuotes=qi,exports.RequestForWithdraw=Eo,exports.RequestForWithdrawAuthorization=ko,exports.RouteType=no,exports.SolAddress=Mr,exports.SolChainConfig=fi,exports.SolTokenAddress=Fr,exports.SolTokenDetails=ti,exports.Token=Qr,exports.TokenDetails=ni,exports.TransactionReceipt=di,exports.TransactionRequest=pi,exports.TypedData=bo,exports.WithdrawAuthorizationResponse=zo,exports.WithdrawResponse=xo,exports.default=$o;
|
|
2
|
+
//# sourceMappingURL=index.cjs.min.js.map
|