@private.me/xbind 1.2.17 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +97 -7
  2. package/dist-standalone/_deps/crypto/base64.js +212 -87
  3. package/dist-standalone/_deps/crypto/cjs/base64.js +653 -91
  4. package/dist-standalone/_deps/crypto/cjs/errors.js +658 -102
  5. package/dist-standalone/_deps/crypto/cjs/hmac.js +468 -66
  6. package/dist-standalone/_deps/crypto/cjs/index.js +848 -82
  7. package/dist-standalone/_deps/crypto/cjs/package.json +1 -0
  8. package/dist-standalone/_deps/crypto/cjs/padding.js +504 -50
  9. package/dist-standalone/_deps/crypto/cjs/share-header.js +369 -65
  10. package/dist-standalone/_deps/crypto/cjs/shares.js +865 -143
  11. package/dist-standalone/_deps/crypto/cjs/tlv.js +1005 -183
  12. package/dist-standalone/_deps/crypto/cjs/uuid.js +437 -55
  13. package/dist-standalone/_deps/crypto/cjs/verify.js +414 -24
  14. package/dist-standalone/_deps/crypto/cjs/xorida.js +888 -186
  15. package/dist-standalone/_deps/crypto/errors.js +179 -89
  16. package/dist-standalone/_deps/crypto/hmac.js +129 -61
  17. package/dist-standalone/_deps/crypto/index.js +140 -40
  18. package/dist-standalone/_deps/crypto/padding.js +151 -45
  19. package/dist-standalone/_deps/crypto/share-header.js +89 -60
  20. package/dist-standalone/_deps/crypto/shares.js +280 -133
  21. package/dist-standalone/_deps/crypto/tlv.js +348 -179
  22. package/dist-standalone/_deps/crypto/uuid.js +130 -50
  23. package/dist-standalone/_deps/crypto/verify.js +71 -15
  24. package/dist-standalone/_deps/crypto/xorida.js +332 -181
  25. package/dist-standalone/_deps/shared/cjs/errors.js +582 -525
  26. package/dist-standalone/_deps/shared/cjs/index.js +413 -409
  27. package/dist-standalone/_deps/shared/cjs/types.js +262 -348
  28. package/dist-standalone/_deps/shared/errors.d.ts +7 -1
  29. package/dist-standalone/_deps/shared/errors.d.ts.map +1 -1
  30. package/dist-standalone/_deps/shared/errors.js +229 -166
  31. package/dist-standalone/_deps/shared/errors.js.map +1 -1
  32. package/dist-standalone/_deps/shared/index.js +50 -54
  33. package/dist-standalone/_deps/shared/types.js +61 -60
  34. package/dist-standalone/_deps/ux-helpers/cjs/errors.js +1 -1
  35. package/dist-standalone/_deps/ux-helpers/cjs/pagination.js +1 -1
  36. package/dist-standalone/_deps/ux-helpers/cjs/progress.js +1 -1
  37. package/dist-standalone/_deps/ux-helpers/cjs/search.js +1 -1
  38. package/dist-standalone/_deps/ux-helpers/errors.js +1 -1
  39. package/dist-standalone/_deps/ux-helpers/pagination.js +1 -1
  40. package/dist-standalone/_deps/ux-helpers/progress.js +1 -1
  41. package/dist-standalone/_deps/ux-helpers/search.js +1 -1
  42. package/dist-standalone/_deps/xchange/auto-accept.js +1 -1
  43. package/dist-standalone/_deps/xchange/cjs/auto-accept.js +1 -1
  44. package/dist-standalone/_deps/xchange/cjs/errors.js +1 -1
  45. package/dist-standalone/_deps/xchange/cjs/index.js +1 -1
  46. package/dist-standalone/_deps/xchange/cjs/invite-client.js +1 -1
  47. package/dist-standalone/_deps/xchange/cjs/lazy-init.js +1 -1
  48. package/dist-standalone/_deps/xchange/cjs/trust-integration.js +1 -1
  49. package/dist-standalone/_deps/xchange/cjs/xchange.js +1 -1
  50. package/dist-standalone/_deps/xchange/errors.js +1 -1
  51. package/dist-standalone/_deps/xchange/index.js +1 -1
  52. package/dist-standalone/_deps/xchange/invite-client.js +1 -1
  53. package/dist-standalone/_deps/xchange/lazy-init.js +1 -1
  54. package/dist-standalone/_deps/xchange/trust-integration.js +1 -1
  55. package/dist-standalone/_deps/xchange/xchange.js +1 -1
  56. package/dist-standalone/_deps/xregistry/cjs/discovery.js +1 -1
  57. package/dist-standalone/_deps/xregistry/cjs/errors.js +1 -1
  58. package/dist-standalone/_deps/xregistry/cjs/index.js +1 -1
  59. package/dist-standalone/_deps/xregistry/cjs/registry.js +1 -1
  60. package/dist-standalone/_deps/xregistry/cjs/schema.js +1 -1
  61. package/dist-standalone/_deps/xregistry/cjs/types.js +1 -1
  62. package/dist-standalone/_deps/xregistry/discovery.js +1 -1
  63. package/dist-standalone/_deps/xregistry/errors.js +1 -1
  64. package/dist-standalone/_deps/xregistry/index.js +1 -1
  65. package/dist-standalone/_deps/xregistry/registry.js +1 -1
  66. package/dist-standalone/_deps/xregistry/schema.js +1 -1
  67. package/dist-standalone/_deps/xregistry/types.js +1 -1
  68. package/dist-standalone/cjs/identity.js +2 -3
  69. package/dist-standalone/cli/setup.d.ts +52 -0
  70. package/dist-standalone/cli/setup.js +515 -0
  71. package/dist-standalone/cli/types.d.ts +79 -0
  72. package/dist-standalone/cli/types.js +27 -0
  73. package/dist-standalone/cli/xbind.d.ts +20 -0
  74. package/dist-standalone/cli/xbind.js +149 -0
  75. package/dist-standalone/identity.js +2 -3
  76. package/package.json +3 -2
  77. package/share1.dat +0 -0
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @private.me/xbind
2
2
 
3
3
  ![npm version](https://img.shields.io/npm/v/@private.me/xbind)
4
- ![version](https://img.shields.io/badge/version-1.2.17-blue)
4
+ ![version](https://img.shields.io/badge/version-1.3.5-blue)
5
5
  ![tests](https://img.shields.io/badge/tests-1245%20passing-brightgreen)
6
6
  ![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)
7
7
  ![license](https://img.shields.io/badge/license-Proprietary-blue)
@@ -12,7 +12,7 @@ Build AI agents that communicate securely using ML-DSA-65 DID identity, ML-KEM-7
12
12
 
13
13
  Part of the **Private.Me** platform—where APIs have keys, but ACIs have identity.
14
14
 
15
- **Version 1.2.17** — **Documentation:** Generic pricing language per Gold Package Requirement #18 (removed specific operation counts). Previous v1.2.16: AWS/gRPC/HTTP Error Mappings - All 49 error codes now include protocol-specific mappings (aws, grpc, http fields) for cross-platform error translation.
15
+ **Version 1.3.5** — **Critical Fix:** ML-KEM key generation is now deterministic from seed (uses `deriveKeyPair()` per FIPS 203). Previous versions had non-deterministic ML-KEM keys which broke `identityFromSeed()` device recovery - registered ML-KEM keys would never match re-derived identity, causing v3 envelope decryption to silently fail. This was the #1 P0 bug reported by early customers. **All users must upgrade immediately.** Previous v1.3.0 (Session 157): v12.0 Deployment Identity with 4-layer Share 2 validation.
16
16
 
17
17
  ## Install
18
18
 
@@ -141,14 +141,104 @@ See [pricing details](../../docs/pricing-reference.md) for current rates and tie
141
141
  **ALL API calls are blocked until you verify your email address.** This links your usage to a verified contact for security notifications and billing.
142
142
 
143
143
  ```bash
144
- npx xbind setup
144
+ npx xbind setup --email user@example.com
145
145
  ```
146
146
 
147
147
  **What happens:**
148
- 1. Enter your email address
149
- 2. Receive 6-digit verification code (check spam folder)
150
- 3. Enter code to activate account
151
- 4. DeploymentID generated (persistent economic identity)
148
+ 1. **DID Generation**: Creates Ed25519 cryptographic identity (did:key:z6Mk...)
149
+ 2. **DeploymentID Creation**: Generates persistent economic identity (DEP-202605-XXXXXXXXXX)
150
+ 3. **Email Code Delivery**: Sends 6-digit verification code to your email
151
+ 4. **Code Verification**: Enter code to link email to DeploymentID
152
+ 5. **Identity Storage**: Saves to `~/.xbind/identity.json` (chmod 600)
153
+ 6. **Ready to Use**: No additional configuration needed
154
+
155
+ **Dual-Mode Verification:**
156
+ - **CLI/Programmatic**: 6-digit code (this method)
157
+ - **Web/Browser**: Magic link (auto-verifies on click)
158
+
159
+ **Command Options:**
160
+ ```bash
161
+ npx xbind setup --email user@example.com # Standard setup
162
+ npx xbind setup --email user@example.com --force # Overwrite existing identity
163
+ npx xbind setup --dev # Development mode (mock email provider)
164
+ ```
165
+
166
+ **Security Notes:**
167
+ - Disposable email services blocked (Mailinator, Guerrilla Mail, etc.)
168
+ - Device fingerprinting active (100+ signals for abuse prevention)
169
+ - DID ≠ DeploymentID (see Identity Model section below)
170
+
171
+ ---
172
+
173
+ ### Identity Model: DID vs DeploymentID
174
+
175
+ **Two complementary identities for different purposes:**
176
+
177
+ #### DID (Decentralized Identifier)
178
+ - **Format**: `did:key:z6Mk...` (Ed25519 public key)
179
+ - **Purpose**: Cryptographic authentication (message signing)
180
+ - **Lifespan**: Ephemeral - can be rotated for security
181
+ - **Use case**: Proving "I sent this message"
182
+ - **Storage**: `~/.xbind/identity.json` (local only)
183
+
184
+ #### DeploymentID (Persistent Economic Identity)
185
+ - **Format**: `DEP-YYYYMM-XXXXXXXXXX` (month prefix + 10 hex digits)
186
+ - **Purpose**: Billing and usage tracking (persistent across DIDs)
187
+ - **Lifespan**: Permanent - never changes for your account
188
+ - **Use case**: "This deployment used 50K operations this month"
189
+ - **Prevents**: Economic state reset attacks (DID rotation to bypass usage limits)
190
+
191
+ **Why Both?**
192
+ - **Security**: Rotate DID without losing billing history
193
+ - **Privacy**: DID is pseudonymous, DeploymentID links to verified email
194
+ - **Billing**: Usage tracked by DeploymentID, even if DID changes
195
+ - **Attack Prevention**: Cannot reset free tier quota by generating new DID
196
+
197
+ **Example:**
198
+ ```
199
+ User creates account:
200
+ - DID: did:key:z6MkABC123... (for signing messages)
201
+ - DeploymentID: DEP-202605-7F3A2B1C (for billing)
202
+
203
+ User rotates DID for security:
204
+ - DID: did:key:z6MkXYZ789... (NEW cryptographic identity)
205
+ - DeploymentID: DEP-202605-7F3A2B1C (SAME billing identity)
206
+ - Usage history: Preserved ✅
207
+ - Free tier quota: Cannot reset ✅
208
+ ```
209
+
210
+ ---
211
+
212
+ ### Device Fingerprinting & Privacy
213
+
214
+ **xBind collects device fingerprints for abuse prevention:**
215
+
216
+ **What We Collect (100+ Signals):**
217
+ 1. **Browser**: User agent, language, timezone, screen resolution
218
+ 2. **OS**: Platform, CPU cores, memory (approximate)
219
+ 3. **Hardware**: GPU vendor, audio context, canvas fingerprint
220
+ 4. **Network**: IP address (hashed), connection type
221
+ 5. **Behavior**: Timing patterns, interaction signals
222
+ 6. **Fonts**: Installed font list (system fingerprint)
223
+
224
+ **Why We Collect:**
225
+ - Detect multi-accounting (creating unlimited free accounts)
226
+ - Identify coordinated abuse patterns
227
+ - Link DeploymentIDs across devices (same user, different machines)
228
+ - Risk scoring (0-100 scale, manual review ≥70)
229
+
230
+ **Privacy Protections:**
231
+ - **SHA-256 hashed**: Fingerprints stored as hashes, not raw data
232
+ - **No PII**: Individual signals don't identify you personally
233
+ - **GDPR compliant**: Right to access, deletion, opt-out
234
+ - **Minimization**: Only signals necessary for abuse detection
235
+ - **Retention**: 90 days for fingerprints, 30 days for raw signals
236
+
237
+ **Opt-Out:**
238
+ Email contact@private.me with subject "Fingerprint Opt-Out" and your DeploymentID. Note: Opting out may trigger manual review for new accounts.
239
+
240
+ **Transparency:**
241
+ Full fingerprinting source code available at `apps/server/src/device-fingerprinting.ts`
152
242
 
153
243
  **Note:** Disposable email services (Mailinator, Guerrilla Mail, etc.) are blocked. Use a real email address.
154
244
 
@@ -1,97 +1,222 @@
1
- const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
2
- const URL_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
3
- /**
4
- * Encode bytes to standard Base64 (RFC 4648).
5
- *
6
- * @param data - Bytes to encode
7
- * @returns Base64-encoded string with padding
8
- */
9
- export function toBase64(data) {
10
- return encode(data, CHARS, true);
1
+ function a0_0x1a56(_0x117fe5, _0x2d1341) {
2
+ _0x117fe5 = _0x117fe5 - 0x137;
3
+ const _0x1feac7 = a0_0x1fea();
4
+ let _0x1a56c9 = _0x1feac7[_0x117fe5];
5
+ if (a0_0x1a56['MLtNOO'] === undefined) {
6
+ var _0x12ed9d = function (_0x52f94e) {
7
+ const _0x285d42 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';
8
+ let _0x220f0f = '', _0x126d3b = '';
9
+ for (let _0x72b6b7 = 0x0, _0x4d0738, _0x3e902c, _0x1471ac = 0x0; _0x3e902c = _0x52f94e['charAt'](_0x1471ac++); ~_0x3e902c && (_0x4d0738 = _0x72b6b7 % 0x4 ? _0x4d0738 * 0x40 + _0x3e902c : _0x3e902c, _0x72b6b7++ % 0x4) ? _0x220f0f += String['fromCharCode'](0xff & _0x4d0738 >> (-0x2 * _0x72b6b7 & 0x6)) : 0x0) {
10
+ _0x3e902c = _0x285d42['indexOf'](_0x3e902c);
11
+ }
12
+ for (let _0x3503b2 = 0x0, _0x5ec380 = _0x220f0f['length']; _0x3503b2 < _0x5ec380; _0x3503b2++) {
13
+ _0x126d3b += '%' + ('00' + _0x220f0f['charCodeAt'](_0x3503b2)['toString'](0x10))['slice'](-0x2);
14
+ }
15
+ return decodeURIComponent(_0x126d3b);
16
+ };
17
+ a0_0x1a56['HKytOx'] = _0x12ed9d, a0_0x1a56['FOcusJ'] = {}, a0_0x1a56['MLtNOO'] = !![];
18
+ }
19
+ const _0x7c7f86 = _0x1feac7[0x0], _0x46e4cd = _0x117fe5 + _0x7c7f86, _0x536556 = a0_0x1a56['FOcusJ'][_0x46e4cd];
20
+ return !_0x536556 ? (_0x1a56c9 = a0_0x1a56['HKytOx'](_0x1a56c9), a0_0x1a56['FOcusJ'][_0x46e4cd] = _0x1a56c9) : _0x1a56c9 = _0x536556, _0x1a56c9;
21
+ }
22
+ function a0_0x1fea() {
23
+ const _0x10e439 = [
24
+ 'nJf4rMLLtNa',
25
+ 'mZiXmdjtug5hwvC',
26
+ 'z0LOuKi',
27
+ 'v256tvG',
28
+ 't3Dprg0',
29
+ 'mtC1mNjlEhv5DG',
30
+ 'swzXrLC',
31
+ 'ndy1mdeYBfzxugT1',
32
+ 'C1fvywO',
33
+ 'wKLsDvq',
34
+ 'C1r0r0m',
35
+ 'sMHPB2e',
36
+ 'CvLewe4',
37
+ 'mtmXmJmWmZvIqwHZCxK',
38
+ 'BgvUz3rO',
39
+ 'z0Hdsg4',
40
+ 'ugPgv1e',
41
+ 'r2LcAuS',
42
+ 'sgvIshi',
43
+ 'qujdrevgr0HjsKTmtu5puffsu1rvvLDywvPHyMnKzwzNAgLQA2XTBM9WCxjZDhv2D3H5EJaXmJm0nty3odKRlW',
44
+ 'mtbWqvjqENq',
45
+ 'mJaXnJmYoe5mCMHeAq',
46
+ 's3fhBLO',
47
+ 'AvD4A3q',
48
+ 'sg5AzeS',
49
+ 'u09MB2G',
50
+ 't1HVuLG',
51
+ 'rxLOvKq',
52
+ 'mtbOywPIseS',
53
+ 'mtq4nJuXmdriDxP2Eu0',
54
+ 'zMXVB3i',
55
+ 'C2v0',
56
+ 'CMvWBgfJzq',
57
+ 'mZGZnJi3mLngr0zOqG',
58
+ 'z2v0',
59
+ 'ndK4ndjzBw1TENO'
60
+ ];
61
+ a0_0x1fea = function () {
62
+ return _0x10e439;
63
+ };
64
+ return a0_0x1fea();
11
65
  }
12
- /**
13
- * Decode standard Base64 string to bytes.
14
- *
15
- * @param str - Base64-encoded string
16
- * @returns Decoded bytes
17
- */
18
- export function fromBase64(str) {
19
- return decode(str, CHARS);
66
+ const a0_0x120b36 = a0_0x1a56;
67
+ (function (_0x210da6, _0x4aa025) {
68
+ const a0_0x8226aa = {
69
+ _0x5e7a46: 0x147,
70
+ _0x132b9b: 0x14f,
71
+ _0x4842b6: 0x139,
72
+ _0x1f3a87: 0x149,
73
+ _0x429453: 0x141,
74
+ _0x1367da: 0x155,
75
+ _0x5329d6: 0x138
76
+ }, _0x2ca543 = a0_0x1a56, _0x506e18 = _0x210da6();
77
+ while (!![]) {
78
+ try {
79
+ const _0x2cb49d = -parseInt(_0x2ca543(0x148)) / 0x1 * (parseInt(_0x2ca543(a0_0x8226aa._0x5e7a46)) / 0x2) + parseInt(_0x2ca543(a0_0x8226aa._0x132b9b)) / 0x3 + -parseInt(_0x2ca543(a0_0x8226aa._0x4842b6)) / 0x4 * (-parseInt(_0x2ca543(0x140)) / 0x5) + parseInt(_0x2ca543(0x14d)) / 0x6 * (parseInt(_0x2ca543(a0_0x8226aa._0x1f3a87)) / 0x7) + -parseInt(_0x2ca543(a0_0x8226aa._0x429453)) / 0x8 + parseInt(_0x2ca543(a0_0x8226aa._0x1367da)) / 0x9 * (parseInt(_0x2ca543(a0_0x8226aa._0x5329d6)) / 0xa) + parseInt(_0x2ca543(0x145)) / 0xb;
80
+ if (_0x2cb49d === _0x4aa025)
81
+ break;
82
+ else
83
+ _0x506e18['push'](_0x506e18['shift']());
84
+ } catch (_0x2e7a6b) {
85
+ _0x506e18['push'](_0x506e18['shift']());
86
+ }
87
+ }
88
+ }(a0_0x1fea, 0xe340c));
89
+ const CHARS = a0_0x120b36(0x137), URL_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
90
+ export function toBase64(_0x1fb314) {
91
+ return encode(_0x1fb314, CHARS, !![]);
20
92
  }
21
- /**
22
- * Encode bytes to Base64url (RFC 4648 Section 5).
23
- * Uses URL-safe characters (-_ instead of +/) and no padding.
24
- *
25
- * @param data - Bytes to encode
26
- * @returns Base64url-encoded string without padding
27
- */
28
- export function toBase64Url(data) {
29
- return encode(data, URL_CHARS, false);
93
+ export function fromBase64(_0x1e6caa) {
94
+ const _0x44599e = a0_0x1a56, _0xe56bee = {
95
+ 'HnZdK': function (_0x3c1faf, _0x492e04, _0x4cc08a) {
96
+ return _0x3c1faf(_0x492e04, _0x4cc08a);
97
+ }
98
+ };
99
+ return _0xe56bee[_0x44599e(0x13c)](decode, _0x1e6caa, CHARS);
30
100
  }
31
- /**
32
- * Decode Base64url string to bytes.
33
- *
34
- * @param str - Base64url-encoded string
35
- * @returns Decoded bytes
36
- */
37
- export function fromBase64Url(str) {
38
- return decode(str, URL_CHARS);
101
+ export function toBase64Url(_0x4655d5) {
102
+ return encode(_0x4655d5, URL_CHARS, ![]);
39
103
  }
40
- /** Encode bytes using the given alphabet. */
41
- function encode(data, alphabet, pad) {
42
- let result = '';
43
- for (let i = 0; i < data.length; i += 3) {
44
- const a = data[i];
45
- const b = i + 1 < data.length ? data[i + 1] : 0;
46
- const c = i + 2 < data.length ? data[i + 2] : 0;
47
- result += alphabet[(a >> 2)];
48
- result += alphabet[((a & 0x03) << 4) | (b >> 4)];
49
- if (i + 1 < data.length) {
50
- result += alphabet[((b & 0x0f) << 2) | (c >> 6)];
51
- }
52
- if (i + 2 < data.length) {
53
- result += alphabet[c & 0x3f];
54
- }
104
+ export function fromBase64Url(_0x5f0a55) {
105
+ const _0x413957 = a0_0x1a56, _0x4e499f = {
106
+ 'OXoRX': function (_0x1ccb30, _0x3f2cea, _0x1789f6) {
107
+ return _0x1ccb30(_0x3f2cea, _0x1789f6);
108
+ }
109
+ };
110
+ return _0x4e499f[_0x413957(0x13e)](decode, _0x5f0a55, URL_CHARS);
111
+ }
112
+ function encode(_0x4e5d82, _0x5e5dba, _0x522ba5) {
113
+ const a0_0x43f2f3 = {
114
+ _0x4370a2: 0x13b,
115
+ _0x456b7a: 0x156,
116
+ _0x47f355: 0x158
117
+ }, _0x54ac56 = a0_0x1a56, _0x536e1f = {
118
+ 'iWxkt': function (_0x319a25, _0xe45684) {
119
+ return _0x319a25 < _0xe45684;
120
+ },
121
+ 'qYDXN': function (_0xa1982, _0x5f0ad9) {
122
+ return _0xa1982 + _0x5f0ad9;
123
+ },
124
+ 'SOfoh': function (_0x418270, _0x293b0c) {
125
+ return _0x418270 | _0x293b0c;
126
+ },
127
+ 'Jmvyp': function (_0x5e46d, _0x26f2c0) {
128
+ return _0x5e46d << _0x26f2c0;
129
+ },
130
+ 'EyhVD': function (_0x28821d, _0x570435) {
131
+ return _0x28821d & _0x570435;
132
+ },
133
+ 'oxoab': function (_0x16e5c7, _0x7b08db) {
134
+ return _0x16e5c7 % _0x7b08db;
135
+ },
136
+ 'ZIRuT': function (_0x2292b7, _0x3e8dd8) {
137
+ return _0x2292b7 === _0x3e8dd8;
138
+ },
139
+ 'PjFWQ': function (_0x4b6ed0, _0x26cc76) {
140
+ return _0x4b6ed0 === _0x26cc76;
141
+ }
142
+ };
143
+ let _0x12c5c4 = '';
144
+ for (let _0x4587e3 = 0x0; _0x536e1f[_0x54ac56(a0_0x43f2f3._0x4370a2)](_0x4587e3, _0x4e5d82[_0x54ac56(a0_0x43f2f3._0x456b7a)]); _0x4587e3 += 0x3) {
145
+ const _0x330004 = _0x4e5d82[_0x4587e3], _0x29f7a7 = _0x536e1f[_0x54ac56(0x154)](_0x4587e3, 0x1) < _0x4e5d82[_0x54ac56(a0_0x43f2f3._0x456b7a)] ? _0x4e5d82[_0x4587e3 + 0x1] : 0x0, _0x1a4eb5 = _0x4587e3 + 0x2 < _0x4e5d82[_0x54ac56(a0_0x43f2f3._0x456b7a)] ? _0x4e5d82[_0x4587e3 + 0x2] : 0x0;
146
+ _0x12c5c4 += _0x5e5dba[_0x330004 >> 0x2], _0x12c5c4 += _0x5e5dba[(_0x330004 & 0x3) << 0x4 | _0x29f7a7 >> 0x4], _0x4587e3 + 0x1 < _0x4e5d82[_0x54ac56(0x156)] && (_0x12c5c4 += _0x5e5dba[_0x536e1f[_0x54ac56(0x13d)](_0x536e1f['Jmvyp'](_0x29f7a7 & 0xf, 0x2), _0x1a4eb5 >> 0x6)]), _0x4587e3 + 0x2 < _0x4e5d82[_0x54ac56(a0_0x43f2f3._0x456b7a)] && (_0x12c5c4 += _0x5e5dba[_0x536e1f[_0x54ac56(0x13f)](_0x1a4eb5, 0x3f)]);
55
147
  }
56
- if (pad) {
57
- const remainder = data.length % 3;
58
- if (remainder === 1)
59
- result += '==';
60
- else if (remainder === 2)
61
- result += '=';
148
+ if (_0x522ba5) {
149
+ const _0x180ba1 = _0x536e1f['oxoab'](_0x4e5d82[_0x54ac56(0x156)], 0x3);
150
+ if (_0x536e1f[_0x54ac56(0x151)](_0x180ba1, 0x1))
151
+ _0x12c5c4 += '==';
152
+ else {
153
+ if (_0x536e1f[_0x54ac56(a0_0x43f2f3._0x47f355)](_0x180ba1, 0x2))
154
+ _0x12c5c4 += '=';
155
+ }
62
156
  }
63
- return result;
157
+ return _0x12c5c4;
64
158
  }
65
- /** Build a reverse lookup map for a Base64 alphabet. */
66
- function buildLookup(alphabet) {
67
- const map = new Map();
68
- for (let i = 0; i < alphabet.length; i++) {
69
- map.set(alphabet[i], i);
159
+ function buildLookup(_0x4b5260) {
160
+ const _0x4d3d7e = a0_0x1a56, _0xbaf997 = new Map();
161
+ for (let _0x40d789 = 0x0; _0x40d789 < _0x4b5260[_0x4d3d7e(0x156)]; _0x40d789++) {
162
+ _0xbaf997[_0x4d3d7e(0x143)](_0x4b5260[_0x40d789], _0x40d789);
70
163
  }
71
- return map;
164
+ return _0xbaf997;
72
165
  }
73
- const STD_LOOKUP = buildLookup(CHARS);
74
- const URL_LOOKUP = buildLookup(URL_CHARS);
75
- /** Decode a Base64 string using the given lookup. Tolerates whitespace (RFC 2045). */
76
- function decode(str, alphabet) {
77
- const lookup = alphabet === CHARS ? STD_LOOKUP : URL_LOOKUP;
78
- const stripped = str.replace(/\s/g, '');
79
- const cleaned = stripped.replace(/=+$/, '');
80
- const byteLen = Math.floor((cleaned.length * 3) / 4);
81
- const result = new Uint8Array(byteLen);
82
- let byteIdx = 0;
83
- for (let i = 0; i < cleaned.length; i += 4) {
84
- const a = lookup.get(cleaned[i]) ?? 0;
85
- const b = lookup.get(cleaned[i + 1]) ?? 0;
86
- const c = i + 2 < cleaned.length ? (lookup.get(cleaned[i + 2]) ?? 0) : 0;
87
- const d = i + 3 < cleaned.length ? (lookup.get(cleaned[i + 3]) ?? 0) : 0;
88
- result[byteIdx++] = (a << 2) | (b >> 4);
89
- if (i + 2 < cleaned.length) {
90
- result[byteIdx++] = ((b & 0x0f) << 4) | (c >> 2);
91
- }
92
- if (i + 3 < cleaned.length) {
93
- result[byteIdx++] = ((c & 0x03) << 6) | d;
94
- }
166
+ const STD_LOOKUP = buildLookup(CHARS), URL_LOOKUP = buildLookup(URL_CHARS);
167
+ function decode(_0x530b35, _0x5712f3) {
168
+ const a0_0x346104 = {
169
+ _0x1d0c6a: 0x146,
170
+ _0x28ad0f: 0x157,
171
+ _0x51aede: 0x146,
172
+ _0x3c4488: 0x153,
173
+ _0x3a6441: 0x14b,
174
+ _0x17787e: 0x156,
175
+ _0x3a4226: 0x150,
176
+ _0x41a44d: 0x15a,
177
+ _0x564a2b: 0x14e
178
+ }, _0x3da2ed = a0_0x1a56, _0x4a79b9 = {
179
+ 'sTtGC': function (_0x4bf897, _0x5e0f4a) {
180
+ return _0x4bf897 === _0x5e0f4a;
181
+ },
182
+ 'gIhRB': function (_0x4e17b8, _0x2b1f61) {
183
+ return _0x4e17b8 * _0x2b1f61;
184
+ },
185
+ 'Jhioa': function (_0x2502d2, _0x3c409d) {
186
+ return _0x2502d2 < _0x3c409d;
187
+ },
188
+ 'KqGnZ': function (_0x2ecf46, _0x49abf6) {
189
+ return _0x2ecf46 + _0x49abf6;
190
+ },
191
+ 'gHCHn': function (_0x9039ae, _0x2d4434) {
192
+ return _0x9039ae + _0x2d4434;
193
+ },
194
+ 'OwODm': function (_0x4fcffa, _0x2fe23f) {
195
+ return _0x4fcffa < _0x2fe23f;
196
+ },
197
+ 'DOIiV': function (_0x4669e0, _0x3f2048) {
198
+ return _0x4669e0 | _0x3f2048;
199
+ },
200
+ 'GiBiK': function (_0x54aa2c, _0x215098) {
201
+ return _0x54aa2c << _0x215098;
202
+ },
203
+ 'WnzMX': function (_0xb5a354, _0x42f674) {
204
+ return _0xb5a354 + _0x42f674;
205
+ },
206
+ 'sQUaj': function (_0x3f50ee, _0x244d7) {
207
+ return _0x3f50ee >> _0x244d7;
208
+ },
209
+ 'HebHr': function (_0x5af300, _0x173576) {
210
+ return _0x5af300 << _0x173576;
211
+ },
212
+ 'IfqFW': function (_0xeceb64, _0x1dba8c) {
213
+ return _0xeceb64 & _0x1dba8c;
214
+ }
215
+ }, _0x40e8ae = _0x4a79b9[_0x3da2ed(0x152)](_0x5712f3, CHARS) ? STD_LOOKUP : URL_LOOKUP, _0x2951c0 = _0x530b35['replace'](/\s/g, ''), _0x5b19bf = _0x2951c0[_0x3da2ed(0x144)](/=+$/, ''), _0x3c1971 = Math[_0x3da2ed(0x142)](_0x4a79b9[_0x3da2ed(0x14a)](_0x5b19bf[_0x3da2ed(0x156)], 0x3) / 0x4), _0x2623d4 = new Uint8Array(_0x3c1971);
216
+ let _0x853ef9 = 0x0;
217
+ for (let _0x36c788 = 0x0; _0x4a79b9['Jhioa'](_0x36c788, _0x5b19bf['length']); _0x36c788 += 0x4) {
218
+ const _0xe90d5b = _0x40e8ae[_0x3da2ed(0x146)](_0x5b19bf[_0x36c788]) ?? 0x0, _0x2fd19a = _0x40e8ae[_0x3da2ed(a0_0x346104._0x1d0c6a)](_0x5b19bf[_0x4a79b9[_0x3da2ed(0x13a)](_0x36c788, 0x1)]) ?? 0x0, _0x2c0a49 = _0x4a79b9[_0x3da2ed(a0_0x346104._0x28ad0f)](_0x36c788, 0x2) < _0x5b19bf[_0x3da2ed(0x156)] ? _0x40e8ae['get'](_0x5b19bf[_0x36c788 + 0x2]) ?? 0x0 : 0x0, _0x3dd321 = _0x4a79b9[_0x3da2ed(0x14c)](_0x36c788 + 0x3, _0x5b19bf['length']) ? _0x40e8ae[_0x3da2ed(a0_0x346104._0x51aede)](_0x5b19bf[_0x4a79b9[_0x3da2ed(a0_0x346104._0x28ad0f)](_0x36c788, 0x3)]) ?? 0x0 : 0x0;
219
+ _0x2623d4[_0x853ef9++] = _0x4a79b9['DOIiV'](_0x4a79b9[_0x3da2ed(0x159)](_0xe90d5b, 0x2), _0x2fd19a >> 0x4), _0x4a79b9[_0x3da2ed(a0_0x346104._0x3c4488)](_0x4a79b9[_0x3da2ed(a0_0x346104._0x3a6441)](_0x36c788, 0x2), _0x5b19bf[_0x3da2ed(a0_0x346104._0x17787e)]) && (_0x2623d4[_0x853ef9++] = (_0x2fd19a & 0xf) << 0x4 | _0x4a79b9[_0x3da2ed(a0_0x346104._0x3a4226)](_0x2c0a49, 0x2)), _0x4a79b9['gHCHn'](_0x36c788, 0x3) < _0x5b19bf[_0x3da2ed(a0_0x346104._0x17787e)] && (_0x2623d4[_0x853ef9++] = _0x4a79b9['DOIiV'](_0x4a79b9[_0x3da2ed(a0_0x346104._0x41a44d)](_0x4a79b9[_0x3da2ed(a0_0x346104._0x564a2b)](_0x2c0a49, 0x3), 0x6), _0x3dd321));
95
220
  }
96
- return result;
97
- }
221
+ return _0x2623d4;
222
+ }