@toon-protocol/client 0.9.0 → 0.9.2
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 +168 -34
- package/dist/anon-proxy-W3KMM7GU.js +23 -0
- package/dist/chunk-WHAEQLIW.js +276 -0
- package/dist/chunk-WHAEQLIW.js.map +1 -0
- package/dist/gateway-QOK47RKS.js +13 -0
- package/dist/gateway-QOK47RKS.js.map +1 -0
- package/dist/index.d.ts +1413 -34
- package/dist/index.js +2530 -430
- package/dist/index.js.map +1 -1
- package/dist/socks5-WTJBYGME.js +136 -0
- package/dist/socks5-WTJBYGME.js.map +1 -0
- package/package.json +21 -15
- package/dist/chunk-5WRI5ZAA.js +0 -31
- package/dist/mina-signer-J7GFWOGO.js +0 -6317
- package/dist/mina-signer-J7GFWOGO.js.map +0 -1
- /package/dist/{chunk-5WRI5ZAA.js.map → anon-proxy-W3KMM7GU.js.map} +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// src/transport/socks5.ts
|
|
2
|
+
import { createConnection } from "net";
|
|
3
|
+
import { createRequire } from "module";
|
|
4
|
+
var require2 = createRequire(import.meta.url);
|
|
5
|
+
function validateSocks5hUrl(socksProxy) {
|
|
6
|
+
if (!socksProxy.startsWith("socks5h://")) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
`SOCKS5 proxy URL must use socks5h:// scheme (got "${socksProxy.split("://")[0]}://"). The "h" suffix ensures DNS resolution happens at the proxy, preventing leaks of .anyone hostnames.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
const httpUrl = socksProxy.replace(/^socks5h:\/\//, "http://");
|
|
12
|
+
let parsed;
|
|
13
|
+
try {
|
|
14
|
+
parsed = new URL(httpUrl);
|
|
15
|
+
} catch {
|
|
16
|
+
throw new Error(`Malformed SOCKS5 proxy URL: "${socksProxy}"`);
|
|
17
|
+
}
|
|
18
|
+
const host = parsed.hostname;
|
|
19
|
+
const port = parsed.port ? parseInt(parsed.port, 10) : 1080;
|
|
20
|
+
if (!host) {
|
|
21
|
+
throw new Error(`SOCKS5 proxy URL missing host: "${socksProxy}"`);
|
|
22
|
+
}
|
|
23
|
+
if (port < 0 || port > 65535 || !Number.isFinite(port)) {
|
|
24
|
+
throw new Error(`SOCKS5 proxy port out of range (0\u201365535): ${parsed.port}`);
|
|
25
|
+
}
|
|
26
|
+
return { host, port };
|
|
27
|
+
}
|
|
28
|
+
function createSocks5WebSocketFactory(socksProxy) {
|
|
29
|
+
validateSocks5hUrl(socksProxy);
|
|
30
|
+
const { SocksProxyAgent } = require2("socks-proxy-agent");
|
|
31
|
+
const WS = require2("ws");
|
|
32
|
+
const agent = new SocksProxyAgent(socksProxy, { timeout: 12e4 });
|
|
33
|
+
const ws = WS;
|
|
34
|
+
const WSClass = typeof ws === "function" ? ws : typeof ws.default === "function" ? ws.default : typeof ws.WebSocket === "function" ? ws.WebSocket : null;
|
|
35
|
+
if (WSClass === null) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
"createSocks5WebSocketFactory: require('ws') did not yield a constructor on .default, .WebSocket, or the module root."
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return (url) => (
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
new WSClass(url, { agent })
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function createSocks5Fetch(socksProxy) {
|
|
46
|
+
validateSocks5hUrl(socksProxy);
|
|
47
|
+
const { SocksProxyAgent } = require2("socks-proxy-agent");
|
|
48
|
+
const http = require2("node:http");
|
|
49
|
+
const https = require2("node:https");
|
|
50
|
+
const agent = new SocksProxyAgent(socksProxy);
|
|
51
|
+
return (input, init) => {
|
|
52
|
+
const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
53
|
+
const parsedUrl = new URL(url);
|
|
54
|
+
const isHttps = parsedUrl.protocol === "https:";
|
|
55
|
+
const transport = isHttps ? https : http;
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
const method = init?.method ?? "GET";
|
|
58
|
+
const headers = init?.headers ? Object.fromEntries(
|
|
59
|
+
init.headers instanceof Headers ? init.headers.entries() : Array.isArray(init.headers) ? init.headers : Object.entries(init.headers)
|
|
60
|
+
) : {};
|
|
61
|
+
const req = transport.request(
|
|
62
|
+
url,
|
|
63
|
+
{ method, headers, agent, timeout: 3e4 },
|
|
64
|
+
(res) => {
|
|
65
|
+
const chunks = [];
|
|
66
|
+
res.on("data", (chunk) => chunks.push(chunk));
|
|
67
|
+
res.on("end", () => {
|
|
68
|
+
const body = Buffer.concat(chunks);
|
|
69
|
+
const responseHeaders = new Headers();
|
|
70
|
+
for (const [key, val] of Object.entries(res.headers)) {
|
|
71
|
+
if (val)
|
|
72
|
+
responseHeaders.set(
|
|
73
|
+
key,
|
|
74
|
+
Array.isArray(val) ? val.join(", ") : val
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
resolve(
|
|
78
|
+
new Response(body, {
|
|
79
|
+
status: res.statusCode ?? 200,
|
|
80
|
+
statusText: res.statusMessage ?? "",
|
|
81
|
+
headers: responseHeaders
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
req.on("error", reject);
|
|
88
|
+
req.on("timeout", () => {
|
|
89
|
+
req.destroy();
|
|
90
|
+
reject(new Error("SOCKS5 proxied request timeout"));
|
|
91
|
+
});
|
|
92
|
+
if (init?.signal) {
|
|
93
|
+
init.signal.addEventListener("abort", () => {
|
|
94
|
+
req.destroy();
|
|
95
|
+
reject(new Error("Aborted"));
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (init?.body) {
|
|
99
|
+
req.write(typeof init.body === "string" ? init.body : init.body);
|
|
100
|
+
}
|
|
101
|
+
req.end();
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
async function probeSocks5Proxy(socksProxy, timeoutMs = 2e3) {
|
|
106
|
+
const { host, port } = validateSocks5hUrl(socksProxy);
|
|
107
|
+
return new Promise((resolve, reject) => {
|
|
108
|
+
const socket = createConnection({ host, port }, () => {
|
|
109
|
+
socket.destroy();
|
|
110
|
+
resolve();
|
|
111
|
+
});
|
|
112
|
+
socket.setTimeout(timeoutMs, () => {
|
|
113
|
+
socket.destroy();
|
|
114
|
+
reject(
|
|
115
|
+
new Error(
|
|
116
|
+
`SOCKS5 proxy at ${host}:${port} unreachable (timeout ${timeoutMs}ms). Refusing to start without privacy transport (fail-closed).`
|
|
117
|
+
)
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
socket.on("error", (err) => {
|
|
121
|
+
socket.destroy();
|
|
122
|
+
reject(
|
|
123
|
+
new Error(
|
|
124
|
+
`SOCKS5 proxy at ${host}:${port} unreachable: ${err.message}. Refusing to start without privacy transport (fail-closed).`
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
export {
|
|
131
|
+
createSocks5Fetch,
|
|
132
|
+
createSocks5WebSocketFactory,
|
|
133
|
+
probeSocks5Proxy,
|
|
134
|
+
validateSocks5hUrl
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=socks5-WTJBYGME.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/transport/socks5.ts"],"sourcesContent":["/**\n * SOCKS5 transport helpers for Node.js environments.\n *\n * This module is dynamically imported only when `transport.type === 'socks5'`\n * is configured, keeping `ws` and `socks-proxy-agent` out of browser bundles.\n */\n\nimport { createConnection } from 'node:net';\nimport { createRequire } from 'node:module';\nimport type SocksProxyAgentModule from 'socks-proxy-agent';\nimport type WSModule from 'ws';\nimport type httpModule from 'node:http';\nimport type httpsModule from 'node:https';\n\n// ESM-safe require. This module builds as ESM (tsup `format: ['esm']`) with\n// `socks-proxy-agent`/`ws` external, so a bare `require(...)` would be rewritten\n// by esbuild into a `__require` shim that throws\n// `Dynamic require of \"socks-proxy-agent\" is not supported` for any pure-ESM\n// consumer — breaking the SOCKS5/ATOR transport entirely (the npm-consumer\n// toon-client image surfaced this). Building a real require off `import.meta.url`\n// (the same pattern as docker/esbuild.config.mjs's banner) keeps the\n// synchronous, browser-guarded `require(...)` calls below working in the\n// published ESM bundle while leaving the deps external. Browser bundlers never\n// reach this code: the module is dynamically imported only when\n// `transport.type === 'socks5'`, which is Node-only.\nconst require = createRequire(import.meta.url);\n\n/**\n * Parses and validates a `socks5h://` URL.\n * Enforces `socks5h://` scheme (not `socks5://`) to prevent DNS leaks —\n * `.anyone` hostnames must be resolved by the proxy, not locally.\n *\n * Mirrors the connector's `transport/socks-url.ts` validation logic.\n */\nexport function validateSocks5hUrl(socksProxy: string): {\n host: string;\n port: number;\n} {\n if (!socksProxy.startsWith('socks5h://')) {\n throw new Error(\n `SOCKS5 proxy URL must use socks5h:// scheme (got \"${socksProxy.split('://')[0]}://\"). ` +\n 'The \"h\" suffix ensures DNS resolution happens at the proxy, preventing leaks of .anyone hostnames.'\n );\n }\n\n // Parse by converting to http:// for URL constructor compatibility\n const httpUrl = socksProxy.replace(/^socks5h:\\/\\//, 'http://');\n let parsed: URL;\n try {\n parsed = new URL(httpUrl);\n } catch {\n throw new Error(`Malformed SOCKS5 proxy URL: \"${socksProxy}\"`);\n }\n\n const host = parsed.hostname;\n const port = parsed.port ? parseInt(parsed.port, 10) : 1080;\n\n if (!host) {\n throw new Error(`SOCKS5 proxy URL missing host: \"${socksProxy}\"`);\n }\n if (port < 0 || port > 65535 || !Number.isFinite(port)) {\n throw new Error(`SOCKS5 proxy port out of range (0–65535): ${parsed.port}`);\n }\n\n return { host, port };\n}\n\n/**\n * Creates a WebSocket factory that routes connections through a SOCKS5 proxy.\n * Uses the `ws` npm package (Node.js only) which accepts an `agent` option.\n */\nexport function createSocks5WebSocketFactory(\n socksProxy: string\n): (url: string) => WebSocket {\n validateSocks5hUrl(socksProxy);\n\n // Resolved via the module-scoped ESM-safe `require` (createRequire) above.\n const { SocksProxyAgent } =\n require('socks-proxy-agent') as typeof SocksProxyAgentModule;\n const WS = require('ws') as typeof WSModule;\n\n // 120s timeout: the socks library's default is 30s, which is too short for\n // the ATOR network to build circuits to fresh hidden services from certain\n // network paths (e.g., Akash datacenter → public ATOR proxy → local HS).\n // 120s gives the proxy time to find a working introduction-point circuit.\n const agent = new SocksProxyAgent(socksProxy, { timeout: 120_000 });\n\n // CJS/ESM interop: `require('ws')` can return any of three shapes depending on\n // the bundler/loader: the class directly (pure CJS); `{ default: WSClass, ... }`\n // (esModuleInterop=true / synthetic default); or `{ WebSocket: WSClass, ... }`\n // (named export, no default). Walk the ladder so this factory works in all\n // three environments. Pass 2 code review 2026-05-18: previous `(WS as any).default ?? WS`\n // would accept a namespace object as a \"constructor\" and throw cryptically.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const ws = WS as any;\n const WSClass = (typeof ws === 'function'\n ? ws\n : typeof ws.default === 'function'\n ? ws.default\n : typeof ws.WebSocket === 'function'\n ? ws.WebSocket\n : null) as unknown as typeof WSModule.prototype.constructor;\n if (WSClass === null) {\n throw new Error(\n \"createSocks5WebSocketFactory: require('ws') did not yield a constructor on .default, .WebSocket, or the module root.\"\n );\n }\n\n return (url: string) =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (WSClass as any)(url, { agent }) as unknown as WebSocket;\n}\n\n/**\n * Creates a fetch wrapper that routes HTTP requests through a SOCKS5 proxy.\n * Uses `socks-proxy-agent` with Node.js `http`/`https` modules (not native\n * fetch, which uses undici and doesn't support SocksProxyAgent's dispatcher).\n */\nexport function createSocks5Fetch(socksProxy: string): typeof fetch {\n validateSocks5hUrl(socksProxy);\n\n // Resolved via the module-scoped ESM-safe `require` (createRequire) above.\n const { SocksProxyAgent } =\n require('socks-proxy-agent') as typeof SocksProxyAgentModule;\n const http = require('node:http') as typeof httpModule;\n const https = require('node:https') as typeof httpsModule;\n\n const agent = new SocksProxyAgent(socksProxy);\n\n return (input: string | URL | Request, init?: RequestInit) => {\n const url =\n typeof input === 'string'\n ? input\n : input instanceof URL\n ? input.href\n : input.url;\n const parsedUrl = new URL(url);\n const isHttps = parsedUrl.protocol === 'https:';\n const transport = isHttps ? https : http;\n\n return new Promise<Response>((resolve, reject) => {\n const method = init?.method ?? 'GET';\n const headers = init?.headers\n ? Object.fromEntries(\n init.headers instanceof Headers\n ? init.headers.entries()\n : Array.isArray(init.headers)\n ? init.headers\n : Object.entries(init.headers)\n )\n : {};\n\n const req = transport.request(\n url,\n { method, headers, agent, timeout: 30_000 },\n (res) => {\n const chunks: Buffer[] = [];\n res.on('data', (chunk: Buffer) => chunks.push(chunk));\n res.on('end', () => {\n const body = Buffer.concat(chunks);\n const responseHeaders = new Headers();\n for (const [key, val] of Object.entries(res.headers)) {\n if (val)\n responseHeaders.set(\n key,\n Array.isArray(val) ? val.join(', ') : val\n );\n }\n resolve(\n new Response(body, {\n status: res.statusCode ?? 200,\n statusText: res.statusMessage ?? '',\n headers: responseHeaders,\n })\n );\n });\n }\n );\n\n req.on('error', reject);\n req.on('timeout', () => {\n req.destroy();\n reject(new Error('SOCKS5 proxied request timeout'));\n });\n\n if (init?.signal) {\n init.signal.addEventListener('abort', () => {\n req.destroy();\n reject(new Error('Aborted'));\n });\n }\n\n if (init?.body) {\n req.write(typeof init.body === 'string' ? init.body : init.body);\n }\n req.end();\n });\n };\n}\n\n/**\n * Probes SOCKS5 proxy reachability with a TCP connection test.\n * Fail-closed: throws if the proxy is unreachable within the timeout.\n *\n * @param socksProxy - `socks5h://host:port` URL\n * @param timeoutMs - Connection timeout in milliseconds (default: 2000)\n */\nexport async function probeSocks5Proxy(\n socksProxy: string,\n timeoutMs = 2000\n): Promise<void> {\n const { host, port } = validateSocks5hUrl(socksProxy);\n\n return new Promise<void>((resolve, reject) => {\n const socket = createConnection({ host, port }, () => {\n socket.destroy();\n resolve();\n });\n\n socket.setTimeout(timeoutMs, () => {\n socket.destroy();\n reject(\n new Error(\n `SOCKS5 proxy at ${host}:${port} unreachable (timeout ${timeoutMs}ms). ` +\n 'Refusing to start without privacy transport (fail-closed).'\n )\n );\n });\n\n socket.on('error', (err) => {\n socket.destroy();\n reject(\n new Error(\n `SOCKS5 proxy at ${host}:${port} unreachable: ${err.message}. ` +\n 'Refusing to start without privacy transport (fail-closed).'\n )\n );\n });\n });\n}\n"],"mappings":";AAOA,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAiB9B,IAAMA,WAAU,cAAc,YAAY,GAAG;AAStC,SAAS,mBAAmB,YAGjC;AACA,MAAI,CAAC,WAAW,WAAW,YAAY,GAAG;AACxC,UAAM,IAAI;AAAA,MACR,qDAAqD,WAAW,MAAM,KAAK,EAAE,CAAC,CAAC;AAAA,IAEjF;AAAA,EACF;AAGA,QAAM,UAAU,WAAW,QAAQ,iBAAiB,SAAS;AAC7D,MAAI;AACJ,MAAI;AACF,aAAS,IAAI,IAAI,OAAO;AAAA,EAC1B,QAAQ;AACN,UAAM,IAAI,MAAM,gCAAgC,UAAU,GAAG;AAAA,EAC/D;AAEA,QAAM,OAAO,OAAO;AACpB,QAAM,OAAO,OAAO,OAAO,SAAS,OAAO,MAAM,EAAE,IAAI;AAEvD,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,mCAAmC,UAAU,GAAG;AAAA,EAClE;AACA,MAAI,OAAO,KAAK,OAAO,SAAS,CAAC,OAAO,SAAS,IAAI,GAAG;AACtD,UAAM,IAAI,MAAM,kDAA6C,OAAO,IAAI,EAAE;AAAA,EAC5E;AAEA,SAAO,EAAE,MAAM,KAAK;AACtB;AAMO,SAAS,6BACd,YAC4B;AAC5B,qBAAmB,UAAU;AAG7B,QAAM,EAAE,gBAAgB,IACtBA,SAAQ,mBAAmB;AAC7B,QAAM,KAAKA,SAAQ,IAAI;AAMvB,QAAM,QAAQ,IAAI,gBAAgB,YAAY,EAAE,SAAS,KAAQ,CAAC;AASlE,QAAM,KAAK;AACX,QAAM,UAAW,OAAO,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AAC1B,aAAO,QAAQ;AACf;AAAA,QACE,IAAI;AAAA,UACF,mBAAmB,IAAI,IAAI,IAAI,iBAAiB,IAAI,OAAO;AAAA,QAE7D;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;","names":["require"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toon-protocol/client",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "TOON client for ILP-gated Nostr publishing with multi-hop routing and payment channels",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jonathan Green",
|
|
@@ -30,34 +30,40 @@
|
|
|
30
30
|
"dist",
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"build": "tsup",
|
|
35
|
-
"test": "vitest run",
|
|
36
|
-
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
37
|
-
"test:e2e:client": "vitest run --config vitest.e2e.config.ts tests/e2e/docker-client-*.test.ts",
|
|
38
|
-
"test:e2e:client:evm": "vitest run --config vitest.e2e.config.ts tests/e2e/docker-client-evm-e2e.test.ts",
|
|
39
|
-
"test:e2e:client:solana": "vitest run --config vitest.e2e.config.ts tests/e2e/docker-client-solana-e2e.test.ts",
|
|
40
|
-
"test:e2e:client:mina": "vitest run --config vitest.e2e.config.ts tests/e2e/docker-client-mina-e2e.test.ts",
|
|
41
|
-
"test:coverage": "vitest run --coverage"
|
|
42
|
-
},
|
|
43
33
|
"dependencies": {
|
|
34
|
+
"@noble/curves": "^2.0.0",
|
|
44
35
|
"@noble/ed25519": "^2.0.0",
|
|
45
36
|
"@noble/hashes": "^1.4.0",
|
|
46
37
|
"@scure/bip32": "^1.4.0",
|
|
47
38
|
"@scure/bip39": "^1.3.0",
|
|
48
|
-
"@toon-protocol/core": "
|
|
39
|
+
"@toon-protocol/core": "^1.4.1",
|
|
49
40
|
"nostr-tools": "^2.20.0",
|
|
50
41
|
"viem": "^2.0.0"
|
|
51
42
|
},
|
|
52
43
|
"optionalDependencies": {
|
|
53
44
|
"@solana/web3.js": "^1.90.0",
|
|
54
|
-
"mina-
|
|
45
|
+
"@toon-protocol/mina-zkapp": "^0.1.0",
|
|
46
|
+
"mina-signer": "^3.0.0",
|
|
47
|
+
"o1js": "2.14.0",
|
|
48
|
+
"socks-proxy-agent": "^8.0.5",
|
|
49
|
+
"ws": "^8.0.0"
|
|
55
50
|
},
|
|
56
51
|
"devDependencies": {
|
|
57
|
-
"@toon-protocol/relay": "
|
|
52
|
+
"@toon-protocol/relay": "^1.3.1",
|
|
53
|
+
"@toon-protocol/sdk": "^0.5.0",
|
|
58
54
|
"@types/node": "^20.0.0",
|
|
59
55
|
"tsup": "^8.0.0",
|
|
60
56
|
"typescript": "^5.3.0",
|
|
61
57
|
"vitest": "^1.0.0"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsup",
|
|
61
|
+
"test": "vitest run",
|
|
62
|
+
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
63
|
+
"test:e2e:client": "vitest run --config vitest.e2e.config.ts tests/e2e/docker-client-*.test.ts",
|
|
64
|
+
"test:e2e:client:evm": "vitest run --config vitest.e2e.config.ts tests/e2e/docker-client-evm-e2e.test.ts",
|
|
65
|
+
"test:e2e:client:solana": "vitest run --config vitest.e2e.config.ts tests/e2e/docker-client-solana-e2e.test.ts",
|
|
66
|
+
"test:e2e:client:mina": "vitest run --config vitest.e2e.config.ts tests/e2e/docker-client-mina-e2e.test.ts",
|
|
67
|
+
"test:coverage": "vitest run --coverage"
|
|
62
68
|
}
|
|
63
|
-
}
|
|
69
|
+
}
|
package/dist/chunk-5WRI5ZAA.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
__commonJS,
|
|
29
|
-
__toESM
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=chunk-5WRI5ZAA.js.map
|