healcode-client 1.0.4 → 1.0.6

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/bin/healcode.js CHANGED
@@ -5,9 +5,24 @@ import inquirer from 'inquirer';
5
5
  import chalk from 'chalk';
6
6
  import fs from 'fs';
7
7
  import path from 'path';
8
+ import { fileURLToPath } from 'url';
8
9
 
9
- const CONFIG_FILE_NAME = 'healcode.config.json';
10
- const DEFAULT_ENDPOINT = 'https://api.healcode.io';
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+
13
+ // Load URLs from config
14
+ let urlsConfig = { backendUrl: 'https://www.healdcode.somee.com', agentUrl: 'https://www.healdcode.somee.com' };
15
+ try {
16
+ const urlsConfigPath = path.join(__dirname, '..', 'urls.config.json');
17
+ if (fs.existsSync(urlsConfigPath)) {
18
+ urlsConfig = JSON.parse(fs.readFileSync(urlsConfigPath, 'utf-8'));
19
+ }
20
+ } catch (e) {
21
+ // Use defaults
22
+ }
23
+
24
+ const BACKEND_URL = urlsConfig.backendUrl;
25
+ const AGENT_URL = urlsConfig.agentUrl;
11
26
 
12
27
  const program = new Command();
13
28
 
@@ -16,20 +31,184 @@ program
16
31
  .description('HealCode CLI - Automatic error detection and fix generation')
17
32
  .version('1.0.0');
18
33
 
34
+ // Detect project type
35
+ function detectProjectType() {
36
+ const cwd = process.cwd();
37
+
38
+ // Check for Angular
39
+ if (fs.existsSync(path.join(cwd, 'angular.json'))) {
40
+ return 'angular';
41
+ }
42
+
43
+ // Check for React (Create React App or Vite)
44
+ const packageJson = path.join(cwd, 'package.json');
45
+ if (fs.existsSync(packageJson)) {
46
+ const pkg = JSON.parse(fs.readFileSync(packageJson, 'utf-8'));
47
+ if (pkg.dependencies?.react || pkg.devDependencies?.react) {
48
+ return 'react';
49
+ }
50
+ if (pkg.dependencies?.vue || pkg.devDependencies?.vue) {
51
+ return 'vue';
52
+ }
53
+ if (pkg.dependencies?.next || pkg.devDependencies?.next) {
54
+ return 'nextjs';
55
+ }
56
+ }
57
+
58
+ return 'generic';
59
+ }
60
+
61
+ // Find index.html
62
+ function findIndexHtml() {
63
+ const cwd = process.cwd();
64
+ const possiblePaths = [
65
+ path.join(cwd, 'src', 'index.html'), // Angular
66
+ path.join(cwd, 'public', 'index.html'), // React/Vue
67
+ path.join(cwd, 'index.html'), // Vite/Generic
68
+ ];
69
+
70
+ for (const p of possiblePaths) {
71
+ if (fs.existsSync(p)) {
72
+ return p;
73
+ }
74
+ }
75
+ return null;
76
+ }
77
+
78
+ // Generate the inline script
79
+ function generateInlineScript(config) {
80
+ return `
81
+ <!-- HealCode Error Tracking -->
82
+ <script>
83
+ (function(){
84
+ var config = ${JSON.stringify(config)};
85
+ if (!config.enabled) return;
86
+
87
+ var endpoint = config.endpoint || '${AGENT_URL}';
88
+ if (!endpoint.endsWith('/api/logs/')) {
89
+ endpoint = endpoint.replace(/\\/$/, '') + '/api/logs/';
90
+ }
91
+
92
+ var breadcrumbs = [];
93
+ var sentHashes = {};
94
+ var maxBreadcrumbs = config.options?.maxBreadcrumbs || 20;
95
+
96
+ function hash(str) {
97
+ var h = 0;
98
+ for (var i = 0; i < str.length; i++) {
99
+ h = ((h << 5) - h) + str.charCodeAt(i);
100
+ h = h & h;
101
+ }
102
+ return h.toString();
103
+ }
104
+
105
+ function addBreadcrumb(type, message, data) {
106
+ breadcrumbs.push({ type: type, message: message, timestamp: new Date().toISOString(), data: data });
107
+ if (breadcrumbs.length > maxBreadcrumbs) breadcrumbs.shift();
108
+ }
109
+
110
+ function send(level, message, stack) {
111
+ var h = hash(message + (stack || ''));
112
+ if (sentHashes[h]) return;
113
+ sentHashes[h] = true;
114
+ setTimeout(function() { delete sentHashes[h]; }, 300000);
115
+
116
+ var payload = {
117
+ token: config.token,
118
+ message: message,
119
+ stacktrace: stack,
120
+ url: window.location.href,
121
+ level: level,
122
+ userAgent: navigator.userAgent,
123
+ networkStatus: navigator.onLine ? 'online' : 'offline',
124
+ breadcrumbs: breadcrumbs.slice(),
125
+ timestamp: new Date().toISOString()
126
+ };
127
+
128
+ fetch(endpoint, {
129
+ method: 'POST',
130
+ headers: { 'Content-Type': 'application/json', 'X-HealCode-Token': config.token },
131
+ body: JSON.stringify(payload),
132
+ keepalive: true
133
+ }).catch(function(){});
134
+ }
135
+
136
+ // Capture errors
137
+ window.onerror = function(msg, src, line, col, err) {
138
+ send('error', msg + ' at ' + src + ':' + line + ':' + col, err?.stack);
139
+ };
140
+
141
+ window.onunhandledrejection = function(e) {
142
+ send('error', 'Unhandled Rejection: ' + e.reason);
143
+ };
144
+
145
+ if (config.options?.captureConsoleErrors !== false) {
146
+ var origError = console.error;
147
+ console.error = function() {
148
+ var msg = Array.prototype.slice.call(arguments).map(function(a) {
149
+ return typeof a === 'object' ? JSON.stringify(a) : String(a);
150
+ }).join(' ');
151
+ send('error', msg);
152
+ origError.apply(console, arguments);
153
+ };
154
+ }
155
+
156
+ // Breadcrumbs
157
+ document.addEventListener('click', function(e) {
158
+ var t = e.target;
159
+ addBreadcrumb('ui.click', 'Clicked ' + t.tagName, { id: t.id, class: t.className });
160
+ }, true);
161
+
162
+ window.addEventListener('online', function() { addBreadcrumb('network', 'Online'); });
163
+ window.addEventListener('offline', function() { addBreadcrumb('network', 'Offline'); });
164
+
165
+ console.log('[HealCode] Initialized');
166
+ })();
167
+ </script>`;
168
+ }
169
+
170
+ // Inject script into index.html
171
+ function injectScript(indexPath, config) {
172
+ let html = fs.readFileSync(indexPath, 'utf-8');
173
+
174
+ // Check if already injected
175
+ if (html.includes('HealCode Error Tracking')) {
176
+ return { success: false, reason: 'already_injected' };
177
+ }
178
+
179
+ const script = generateInlineScript(config);
180
+
181
+ // Inject before </head>
182
+ if (html.includes('</head>')) {
183
+ html = html.replace('</head>', script + '\n</head>');
184
+ } else if (html.includes('<body')) {
185
+ // Inject at start of body
186
+ html = html.replace(/<body[^>]*>/, (match) => match + '\n' + script);
187
+ } else {
188
+ return { success: false, reason: 'no_injection_point' };
189
+ }
190
+
191
+ fs.writeFileSync(indexPath, html);
192
+ return { success: true };
193
+ }
194
+
19
195
  program
20
196
  .command('init')
21
197
  .description('Initialize HealCode in your project')
22
198
  .action(async () => {
23
199
  console.log(chalk.green.bold('\n🩺 HealCode Setup\n'));
24
200
 
25
- const initialAnswers = await inquirer.prompt([
201
+ const projectType = detectProjectType();
202
+ console.log(chalk.gray(` Detected: ${projectType} project\n`));
203
+
204
+ const { token } = await inquirer.prompt([
26
205
  {
27
206
  type: 'input',
28
207
  name: 'token',
29
208
  message: 'Enter your HealCode token:',
30
209
  validate: (input) => {
31
210
  if (!input || input.trim().length === 0) {
32
- return 'Token is required. Get one at https://healcode.io/dashboard';
211
+ return 'Token is required. Get one at https://healcode.vercel.app/dashboard';
33
212
  }
34
213
  if (!input.startsWith('hc_')) {
35
214
  return 'Invalid token format. Token should start with "hc_"';
@@ -37,164 +216,134 @@ program
37
216
  return true;
38
217
  },
39
218
  },
40
- {
41
- type: 'input',
42
- name: 'endpoint',
43
- message: 'API Endpoint (press Enter for default):',
44
- default: DEFAULT_ENDPOINT,
45
- },
46
219
  ]);
47
220
 
48
221
  // Validate token with API
49
222
  console.log(chalk.yellow('\n⏳ Validating token...'));
50
223
 
51
- let remoteConfig = null;
224
+ let projectName = 'Unknown';
52
225
 
53
226
  try {
54
- const response = await fetch(`${initialAnswers.endpoint}/api/tokens/validate`, {
227
+ const response = await fetch(`${BACKEND_URL}/api/tokens/validate`, {
55
228
  method: 'POST',
56
229
  headers: { 'Content-Type': 'application/json' },
57
- body: JSON.stringify({ token: initialAnswers.token }),
230
+ body: JSON.stringify({ token: token }),
58
231
  });
59
232
 
60
233
  const result = await response.json();
61
234
 
62
235
  if (!result.isValid) {
63
236
  console.log(chalk.red(`\n❌ Token validation failed: ${result.errorMessage || 'Invalid token'}`));
64
- console.log(chalk.gray('Get a valid token at https://healcode.io/dashboard\n'));
237
+ console.log(chalk.gray('Get a valid token at https://healcode.vercel.app/dashboard\n'));
65
238
  process.exit(1);
66
239
  }
67
240
 
68
241
  console.log(chalk.green('✅ Token validated successfully!'));
69
- console.log(chalk.gray(` Project: ${result.projectId}`));
70
-
71
- if (result.configuration) {
72
- remoteConfig = result.configuration;
73
- console.log(chalk.green('✅ Configuration loaded from Dashboard.'));
74
- }
242
+ projectName = result.projectId || 'Unknown';
243
+ console.log(chalk.gray(` Project: ${projectName}`));
75
244
 
76
245
  } catch (error) {
77
- console.log(chalk.yellow('\n⚠️ Could not validate token (API unreachable). Proceeding with manual setup...'));
78
- }
79
-
80
- let options = {};
81
-
82
- if (remoteConfig) {
83
- options = remoteConfig;
84
- } else {
85
- options = await inquirer.prompt([
86
- {
87
- type: 'confirm',
88
- name: 'captureConsoleErrors',
89
- message: 'Capture console.error calls?',
90
- default: true,
91
- },
92
- {
93
- type: 'confirm',
94
- name: 'captureUnhandledRejections',
95
- message: 'Capture unhandled promise rejections?',
96
- default: true,
97
- },
98
- ]);
246
+ console.log(chalk.red('\nCould not validate token. Check your internet connection.'));
247
+ process.exit(1);
99
248
  }
100
249
 
101
- // Create config file
250
+ // Create config
102
251
  const config = {
103
- token: initialAnswers.token,
104
- endpoint: initialAnswers.endpoint === DEFAULT_ENDPOINT ? undefined : initialAnswers.endpoint,
252
+ token: token,
253
+ endpoint: AGENT_URL,
105
254
  enabled: true,
106
255
  options: {
107
- captureConsoleErrors: options.captureConsoleErrors !== false,
108
- captureUnhandledRejections: options.captureUnhandledRejections !== false,
256
+ captureConsoleErrors: true,
257
+ captureUnhandledRejections: true,
109
258
  maxBreadcrumbs: 20,
110
259
  },
111
260
  };
112
261
 
113
- const configPath = path.join(process.cwd(), CONFIG_FILE_NAME);
114
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
115
-
116
- console.log(chalk.green(`\n✅ Config saved to ${CONFIG_FILE_NAME}`));
262
+ // Find and inject into index.html
263
+ console.log(chalk.yellow('\n⏳ Injecting HealCode script...'));
264
+
265
+ const indexPath = findIndexHtml();
266
+
267
+ if (!indexPath) {
268
+ console.log(chalk.red('\n❌ Could not find index.html'));
269
+ console.log(chalk.gray(' Looked in: src/index.html, public/index.html, index.html'));
270
+ process.exit(1);
271
+ }
117
272
 
118
- // Show usage instructions
119
- console.log(chalk.cyan('\n📖 Usage:\n'));
120
- console.log(chalk.white(' // In your main entry file (e.g., main.ts, index.js)'));
121
- console.log(chalk.gray(' import { initFromConfig } from \'@healcode/client\';'));
122
- console.log(chalk.gray(' initFromConfig();\n'));
273
+ const result = injectScript(indexPath, config);
274
+
275
+ if (!result.success) {
276
+ if (result.reason === 'already_injected') {
277
+ console.log(chalk.yellow('\n⚠️ HealCode is already installed in this project.'));
278
+ } else {
279
+ console.log(chalk.red('\n❌ Could not inject script into index.html'));
280
+ }
281
+ process.exit(1);
282
+ }
123
283
 
124
- console.log(chalk.white(' // Or with manual configuration:'));
125
- console.log(chalk.gray(' import { HealCode } from \'@healcode/client\';'));
126
- console.log(chalk.gray(` const healcode = new HealCode({ token: '${answers.token.substring(0, 10)}...' });\n`));
284
+ console.log(chalk.green(`✅ Script injected into ${path.relative(process.cwd(), indexPath)}`));
127
285
 
128
- // Add to .gitignore
286
+ // Add to .gitignore (the config is now embedded, but keep this for reference)
129
287
  const gitignorePath = path.join(process.cwd(), '.gitignore');
130
288
  if (fs.existsSync(gitignorePath)) {
131
289
  const gitignore = fs.readFileSync(gitignorePath, 'utf-8');
132
- if (!gitignore.includes(CONFIG_FILE_NAME)) {
133
- fs.appendFileSync(gitignorePath, `\n# HealCode\n${CONFIG_FILE_NAME}\n`);
134
- console.log(chalk.gray(`Added ${CONFIG_FILE_NAME} to .gitignore`));
290
+ if (!gitignore.includes('healcode.config.json')) {
291
+ fs.appendFileSync(gitignorePath, '\n# HealCode\nhealcode.config.json\n');
135
292
  }
136
293
  }
137
294
 
138
- console.log(chalk.green.bold('\n🎉 HealCode is ready! Errors will be automatically tracked and fixed.\n'));
295
+ console.log(chalk.green.bold('\n🎉 HealCode installed successfully!\n'));
296
+ console.log(chalk.gray(' Errors will be automatically captured and sent to HealCode.'));
297
+ console.log(chalk.gray(' No code changes required.\n'));
139
298
  });
140
299
 
141
300
  program
142
- .command('status')
143
- .description('Check HealCode configuration status')
301
+ .command('remove')
302
+ .description('Remove HealCode from your project')
144
303
  .action(() => {
145
- const configPath = path.join(process.cwd(), CONFIG_FILE_NAME);
146
-
147
- if (!fs.existsSync(configPath)) {
148
- console.log(chalk.yellow('\n⚠️ No HealCode configuration found.'));
149
- console.log(chalk.gray('Run `npx healcode init` to set up.\n'));
304
+ const indexPath = findIndexHtml();
305
+
306
+ if (!indexPath) {
307
+ console.log(chalk.yellow('\n⚠️ Could not find index.html\n'));
150
308
  return;
151
309
  }
152
310
 
153
- try {
154
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
155
- console.log(chalk.green.bold('\n🩺 HealCode Status\n'));
156
- console.log(chalk.white(` Token: ${config.token.substring(0, 15)}...`));
157
- console.log(chalk.white(` Endpoint: ${config.endpoint || DEFAULT_ENDPOINT}`));
158
- console.log(chalk.white(` Enabled: ${config.enabled !== false ? '✅' : '❌'}`));
159
- console.log('');
160
- } catch (error) {
161
- console.log(chalk.red('\n❌ Failed to read configuration file.\n'));
162
- }
163
- });
164
-
165
- program
166
- .command('disable')
167
- .description('Disable HealCode error tracking')
168
- .action(() => {
169
- const configPath = path.join(process.cwd(), CONFIG_FILE_NAME);
170
-
171
- if (!fs.existsSync(configPath)) {
172
- console.log(chalk.yellow('\n⚠️ No HealCode configuration found.\n'));
311
+ let html = fs.readFileSync(indexPath, 'utf-8');
312
+
313
+ // Remove HealCode script block
314
+ const regex = /\n?<!-- HealCode Error Tracking -->[\s\S]*?<\/script>/g;
315
+
316
+ if (!regex.test(html)) {
317
+ console.log(chalk.yellow('\n⚠️ HealCode is not installed in this project.\n'));
173
318
  return;
174
319
  }
175
320
 
176
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
177
- config.enabled = false;
178
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
179
- console.log(chalk.yellow('\n⏸️ HealCode tracking disabled.\n'));
321
+ html = html.replace(regex, '');
322
+ fs.writeFileSync(indexPath, html);
323
+
324
+ console.log(chalk.green('\nHealCode removed successfully.\n'));
180
325
  });
181
326
 
182
327
  program
183
- .command('enable')
184
- .description('Enable HealCode error tracking')
328
+ .command('status')
329
+ .description('Check HealCode installation status')
185
330
  .action(() => {
186
- const configPath = path.join(process.cwd(), CONFIG_FILE_NAME);
187
-
188
- if (!fs.existsSync(configPath)) {
189
- console.log(chalk.yellow('\n⚠️ No HealCode configuration found.'));
190
- console.log(chalk.gray('Run `npx healcode init` to set up.\n'));
331
+ const indexPath = findIndexHtml();
332
+
333
+ if (!indexPath) {
334
+ console.log(chalk.yellow('\n⚠️ Could not find index.html\n'));
191
335
  return;
192
336
  }
193
337
 
194
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
195
- config.enabled = true;
196
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
197
- console.log(chalk.green('\n▶️ HealCode tracking enabled.\n'));
338
+ const html = fs.readFileSync(indexPath, 'utf-8');
339
+
340
+ if (html.includes('HealCode Error Tracking')) {
341
+ console.log(chalk.green.bold('\n🩺 HealCode Status: Installed ✅\n'));
342
+ console.log(chalk.gray(` Location: ${path.relative(process.cwd(), indexPath)}\n`));
343
+ } else {
344
+ console.log(chalk.yellow('\n⚠️ HealCode is not installed.'));
345
+ console.log(chalk.gray(' Run `npx healcode init` to set up.\n'));
346
+ }
198
347
  });
199
348
 
200
349
  program.parse();
package/dist/index.d.mts CHANGED
@@ -55,7 +55,12 @@ declare class HealCode {
55
55
  isEnabled(): boolean;
56
56
  }
57
57
 
58
- declare function loadConfig(configPath?: string): HealCodeFileConfig | null;
59
- declare function initFromConfig(configPath?: string): HealCode | null;
58
+ declare global {
59
+ interface Window {
60
+ __HEALCODE_CONFIG__?: HealCodeFileConfig;
61
+ }
62
+ }
63
+ declare function loadConfig(): HealCodeFileConfig | null;
64
+ declare function initFromConfig(): HealCode | null;
60
65
 
61
66
  export { HealCode, type HealCodeConfig, type HealCodeFileConfig, initFromConfig, loadConfig };
package/dist/index.d.ts CHANGED
@@ -55,7 +55,12 @@ declare class HealCode {
55
55
  isEnabled(): boolean;
56
56
  }
57
57
 
58
- declare function loadConfig(configPath?: string): HealCodeFileConfig | null;
59
- declare function initFromConfig(configPath?: string): HealCode | null;
58
+ declare global {
59
+ interface Window {
60
+ __HEALCODE_CONFIG__?: HealCodeFileConfig;
61
+ }
62
+ }
63
+ declare function loadConfig(): HealCodeFileConfig | null;
64
+ declare function initFromConfig(): HealCode | null;
60
65
 
61
66
  export { HealCode, type HealCodeConfig, type HealCodeFileConfig, initFromConfig, loadConfig };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a0_0x26a3cc=a0_0x2c10;function a0_0x2cd4(){const _0x32d77a=['nZqYn0XetevWzq','l2fWAs9SB2DZ','mtqXodnVzxPRsvC','vw5RBM93BIbLCNjVCG','ywrKrxzLBNrmAxn0zw5LCG','yNjLywrJCNvTyNm','DxrMltG','zxjYB3i','tw9Izhi','AK1prue','B251BMHHBMrSzwrYzwPLy3rPB24','ode5ndiWBMj4Cg1n','zw5KCg9PBNq','zwDnvfK','y29UzMLN','C3rHDhvZ','Dg9tDhjPBMC','w0HLywXdB2rLxsbgywLSzwqGDg8GCMvWB3j0igvYCM9YoG','z2vUzxjHDgviyxnO','qM9wuwe','C3vIC3rYAw5N','zxHPC3rZu3LUyW','D1fYAem','mJuXmgPSu25SBa','z3v2qxa','CenUuNm','ywrKqNjLywrJCNvTyG','Aw50zxjJzxb0v2LUzg93rxjYB3jZ','zNvUy3rPB24','y2fSBa','B3LLEwW','CeDpqMS','y2fWDhvYzq','l2fWAs9SB2DZlW','rgz1sKm','mJbSDKT1BeC','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','uM5QENi','y2XHC3noyw1L','CMvHzezPBgvtEw5J','B3b0Aw9UCW','AgvHBgnVzguUy29UzMLNlMPZB24','Bwf4qNjLywrJCNvTyNm','mta2v0TOuxrK','sgTjCvK','wfnrDhu','ywrK','Bg9N','B25LCNjVCG','AfHesMq','AeHly1C','y2fWDhvYzunVBNnVBgvfCNjVCNm','zw5HyMXLza','CMvZt2e','Aw5PDgLHBgL6zwq','CMvWBgfJzq','ue9tva','C3rYAw5NAwz5','Aw50zxjJzxb0q29UC29Szq','C2ztvLi','ndG4yMrbCeTv','zgLYBMfTzq','BgvUz3rO','Aw50zxjJzxb0vw5Oyw5KBgvKuMvQzwn0Aw9UCW','C2v0Dxbozxr3B3jRtgLZDgvUzxjZ','mJjgyvzbrKi','C3rHy2S','zw5KC1DPDgG','zxHWB3j0CW','B2zMBgLUzq','w0HLywXdB2rLxsbozxr3B3jRigvYCM9YoG','se5kBfm','mtHxvNjuDe8','q29UBMvJDgLVBIbSB3n0','B2jQzwn0','x19LC01VzhvSzq','DgfNtMfTzq','AgfZ','q1rOvgy','mJKWmtu1C2rzthjW','w0HLywXdB2rLxsbjBML0AwfSAxPLzcbZDwnJzxnZzNvSBhK','mta0nZGWDefzDMPn','yMvMB3jLu2vUza','y0XYB2K','DwKUy2XPy2S','zgvMyxvSDa','Dg9ju09tDhjPBMC','AgfZt3DUuhjVCgvYDhK','EvbYsMW','r1fOENy','ChjVDg90ExbL','yKHND2i','yxf5tLe','ntG2otj0zMrcCe0','y3DK','C2vUza','B25mAw5L','C2v0DxbjBNrLCMfJDgLVBKXPC3rLBMvYCW','C3rYAw5N','yxDkuva','zgvSzxrL','y3jLyxrL','zgvMAw5LuhjVCgvYDhK','y2HHCKnVzgvbDa','C2vUDeHHC2HLCW','ovrnBgnuuG','DgfYz2v0','w0HLywXdB2rLxsbgywLSzwqGDg8GBg9HzcbJB25MAwC6','AM9PBG','D2fYBG','mJeXnfHdDu1pvq','AhjLzG','y1nsug8','y2XPy2S','tK5lqLe','y2fWDhvYzvvUAgfUzgXLzfjLAMvJDgLVBNm','BvfyBuq','q29UBMvJDgLVBIbYzxn0B3jLza','C2HPzNq','Ahr0Chm6lY9WCMvWywLKlxrYAwjHBc1PBNzPDgvKlwvUzY50CNLJBg91zgzSyxjLlMnVBq','Dg9Rzw4','vw5Oyw5KBgvKifjLAMvJDgLVBJOG','C2v0rw5HyMXLza','B25SAw5L','u1rIB3m','run4rfy','uxvbs3K','ChvZAa','q2XPy2TLzcbVBIa','AKHPtxm','BMv0D29YAW','z2v0t3DUuhjVCgvYDhLoyw1LCW','DxnLCKfNzw50','Aw5UzxjuzxH0'];a0_0x2cd4=function(){return _0x32d77a;};return a0_0x2cd4();}function a0_0x2c10(_0x34f874,_0x3431ec){_0x34f874=_0x34f874-0xaa;const _0x2cd4a2=a0_0x2cd4();let _0x2c10fb=_0x2cd4a2[_0x34f874];if(a0_0x2c10['dwxIXg']===undefined){var _0x6ec343=function(_0x143d91){const _0x17bc5b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3a29b7='',_0x52baea='';for(let _0x2a57b8=0x0,_0x573207,_0x25789d,_0x52858f=0x0;_0x25789d=_0x143d91['charAt'](_0x52858f++);~_0x25789d&&(_0x573207=_0x2a57b8%0x4?_0x573207*0x40+_0x25789d:_0x25789d,_0x2a57b8++%0x4)?_0x3a29b7+=String['fromCharCode'](0xff&_0x573207>>(-0x2*_0x2a57b8&0x6)):0x0){_0x25789d=_0x17bc5b['indexOf'](_0x25789d);}for(let _0x1b7c88=0x0,_0x302914=_0x3a29b7['length'];_0x1b7c88<_0x302914;_0x1b7c88++){_0x52baea+='%'+('00'+_0x3a29b7['charCodeAt'](_0x1b7c88)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x52baea);};a0_0x2c10['uIEbpy']=_0x6ec343,a0_0x2c10['CNTIaG']={},a0_0x2c10['dwxIXg']=!![];}const _0xd22952=_0x2cd4a2[0x0],_0x141ac8=_0x34f874+_0xd22952,_0x446939=a0_0x2c10['CNTIaG'][_0x141ac8];return!_0x446939?(_0x2c10fb=a0_0x2c10['uIEbpy'](_0x2c10fb),a0_0x2c10['CNTIaG'][_0x141ac8]=_0x2c10fb):_0x2c10fb=_0x446939,_0x2c10fb;}(function(_0x36c766,_0x590d7c){const _0x25769b=a0_0x2c10,_0x123218=_0x36c766();while(!![]){try{const _0x8fefdd=-parseInt(_0x25769b(0x115))/0x1*(-parseInt(_0x25769b(0x101))/0x2)+-parseInt(_0x25769b(0xc1))/0x3*(parseInt(_0x25769b(0x10d))/0x4)+-parseInt(_0x25769b(0xb3))/0x5*(-parseInt(_0x25769b(0xac))/0x6)+-parseInt(_0x25769b(0xea))/0x7*(parseInt(_0x25769b(0x126))/0x8)+parseInt(_0x25769b(0xcd))/0x9*(-parseInt(_0x25769b(0xb5))/0xa)+-parseInt(_0x25769b(0x12b))/0xb*(-parseInt(_0x25769b(0xf5))/0xc)+-parseInt(_0x25769b(0xec))/0xd*(parseInt(_0x25769b(0xd2))/0xe);if(_0x8fefdd===_0x590d7c)break;else _0x123218['push'](_0x123218['shift']());}catch(_0x20a389){_0x123218['push'](_0x123218['shift']());}}}(a0_0x2cd4,0x19dcd));var C=Object[a0_0x26a3cc(0xc9)],l=Object[a0_0x26a3cc(0xca)],m=Object[a0_0x26a3cc(0x10e)],b=Object[a0_0x26a3cc(0xe7)],w=Object['getPrototypeOf'],H=Object[a0_0x26a3cc(0xbe)][a0_0x26a3cc(0xbb)],v=(_0x53ee6e,_0x4721a4)=>{const _0x398984=a0_0x26a3cc,_0x368c2e={'STbos':function(_0x850d39,_0x32f55c,_0x22293e,_0x6d933){return _0x850d39(_0x32f55c,_0x22293e,_0x6d933);}};for(var _0x2e45d5 in _0x4721a4)_0x368c2e[_0x398984(0xe0)](l,_0x53ee6e,_0x2e45d5,{'get':_0x4721a4[_0x2e45d5],'enumerable':!0x0});},u=(_0x589437,_0x2a9bed,_0x5d46d8,_0x27bd52)=>{const _0x2cb87d=a0_0x26a3cc,_0x44b7f3={'bHgwb':function(_0x336ebe,_0xd11a42){return _0x336ebe==_0xd11a42;},'Rnjzr':_0x2cb87d(0xae),'jHiMs':function(_0x9bd15c,_0x40284d){return _0x9bd15c==_0x40284d;},'NNEdo':_0x2cb87d(0x106),'guvAp':function(_0x482f8a,_0x572fdc){return _0x482f8a(_0x572fdc);},'QFWpv':function(_0x104d2d,_0x2b0f2e){return _0x104d2d!==_0x2b0f2e;},'BXNDq':function(_0x50bf54,_0x2211c3,_0xbcdb53,_0x24710d){return _0x50bf54(_0x2211c3,_0xbcdb53,_0x24710d);},'resOa':function(_0x12456b,_0xa3ec07,_0x1cc7a5){return _0x12456b(_0xa3ec07,_0x1cc7a5);}};if(_0x2a9bed&&_0x44b7f3[_0x2cb87d(0xbf)](typeof _0x2a9bed,_0x44b7f3[_0x2cb87d(0x10f)])||_0x44b7f3[_0x2cb87d(0xe5)](typeof _0x2a9bed,_0x44b7f3['NNEdo'])){for(let _0x307787 of _0x44b7f3[_0x2cb87d(0x102)](b,_0x2a9bed))!H[_0x2cb87d(0x107)](_0x589437,_0x307787)&&_0x44b7f3['QFWpv'](_0x307787,_0x5d46d8)&&_0x44b7f3['BXNDq'](l,_0x589437,_0x307787,{'get':()=>_0x2a9bed[_0x307787],'enumerable':!(_0x27bd52=_0x44b7f3[_0x2cb87d(0x11f)](m,_0x2a9bed,_0x307787))||_0x27bd52['enumerable']});}return _0x589437;},f=(_0x149f70,_0x4e9ac1,_0x1ad2cf)=>(_0x1ad2cf=_0x149f70!=null?C(w(_0x149f70)):{},u(_0x4e9ac1||!_0x149f70||!_0x149f70[a0_0x26a3cc(0xaf)]?l(_0x1ad2cf,a0_0x26a3cc(0xb9),{'value':_0x149f70,'enumerable':!0x0}):_0x1ad2cf,_0x149f70)),y=_0x37fae5=>u(l({},a0_0x26a3cc(0xaf),{'value':!0x0}),_0x37fae5),N={};v(N,{'HealCode':()=>s,'initFromConfig':()=>h,'loadConfig':()=>p}),module[a0_0x26a3cc(0x12e)]=y(N);var g=a0_0x26a3cc(0xdb),E=g+a0_0x26a3cc(0x10b),x=0x14,s=class{constructor(_0x4100ed){const _0x299a25=a0_0x26a3cc,_0x41f0a4={'BoVQa':function(_0x3e98c5,_0x358c81){return _0x3e98c5!==_0x358c81;},'GPYiN':function(_0x27450d,_0x4042bf){return _0x27450d!==_0x4042bf;},'XSQtu':function(_0x317897,_0x5d02d9){return _0x317897<_0x5d02d9;}};this[_0x299a25(0xef)]=[],this[_0x299a25(0xcc)]=new Set(),this[_0x299a25(0x120)]=!0x1,(this[_0x299a25(0xf8)]={'token':_0x4100ed[_0x299a25(0xdc)],'endpoint':_0x4100ed[_0x299a25(0xf6)]||E,'enabled':_0x41f0a4['BoVQa'](_0x4100ed['enabled'],!0x1),'captureConsoleErrors':_0x41f0a4[_0x299a25(0xfd)](_0x4100ed[_0x299a25(0x11d)],!0x1),'captureUnhandledRejections':_0x41f0a4['GPYiN'](_0x4100ed['captureUnhandledRejections'],!0x1),'maxBreadcrumbs':_0x4100ed[_0x299a25(0x114)]||x,'beforeSend':_0x4100ed[_0x299a25(0xb6)]},this[_0x299a25(0xf8)][_0x299a25(0x11e)]&&_0x41f0a4[_0x299a25(0x117)](typeof window,'u')&&this['init']());}['init'](){const _0x434d8f=a0_0x26a3cc;this[_0x434d8f(0x120)]||(this[_0x434d8f(0x120)]=!0x0,this[_0x434d8f(0x12a)](),this[_0x434d8f(0xc5)](),this[_0x434d8f(0xf8)]['captureConsoleErrors']&&this['interceptConsole'](),this['interceptWindowErrors'](),this[_0x434d8f(0xf8)]['captureUnhandledRejections']&&this[_0x434d8f(0x129)](),console[_0x434d8f(0x119)](_0x434d8f(0xb4)));}[a0_0x26a3cc(0x12a)](){const _0x578d52=a0_0x26a3cc,_0x2d4815={'pCnRs':_0x578d52(0xdf)};window[_0x578d52(0xee)](_0x2d4815[_0x578d52(0x103)],()=>this[_0x578d52(0x104)](_0x578d52(0xe6),_0x578d52(0xd9),{'status':_0x578d52(0xdf)})),window[_0x578d52(0xee)](_0x578d52(0x12f),()=>this[_0x578d52(0x104)](_0x578d52(0xe6),_0x578d52(0xad),{'status':_0x578d52(0x12f)}));}[a0_0x26a3cc(0xc5)](){const _0x21ea10=a0_0x26a3cc,_0x1f939a={'Unmbs':function(_0x2395bf,_0x24913c){return _0x2395bf===_0x24913c;},'LRUBX':_0x21ea10(0x108),'hSAwv':_0x21ea10(0xd5)};document[_0x21ea10(0xee)](_0x1f939a['hSAwv'],_0xc68733=>{const _0x34418e=_0x21ea10,_0x4ba1d0={'QuAKy':function(_0x1e4093,_0x553fba){return _0x1e4093>_0x553fba;}};if(_0x1f939a['Unmbs'](_0x1f939a['LRUBX'],'ZzvMH')){let _0x37ec61={'type':_0x2c119f,'message':_0x3f6bbe,'timestamp':new _0x23dd91()[_0x34418e(0xba)](),'data':_0x2b4dca};this[_0x34418e(0xef)]['push'](_0x37ec61),_0x4ba1d0[_0x34418e(0xe2)](this['breadcrumbs'][_0x34418e(0x128)],this['config'][_0x34418e(0x114)])&&this[_0x34418e(0xef)][_0x34418e(0xda)]();}else{let _0x4ecc30=_0xc68733[_0x34418e(0xce)];this[_0x34418e(0x104)](_0x34418e(0xb8),'Clicked\x20on\x20'+_0x4ecc30['tagName'],{'id':_0x4ecc30['id']||void 0x0,'className':_0x4ecc30[_0x34418e(0x110)]||void 0x0,'text':_0x4ecc30[_0x34418e(0xe9)]?.[_0x34418e(0xfe)](0x0,0x32)||void 0x0});}},!0x0);}[a0_0x26a3cc(0x124)](){const _0x3b4dd8=a0_0x26a3cc,_0x3135ce={'CThTf':'ui.click','mQXmD':'LJYCe','NNKBQ':_0x3b4dd8(0xf7),'HYCrE':_0x3b4dd8(0xf1)};let _0x3bb761=console['error'];console[_0x3b4dd8(0xf1)]=(..._0x4736b8)=>{const _0x36d67c=_0x3b4dd8;if(_0x3135ce[_0x36d67c(0xd8)]!==_0x3135ce[_0x36d67c(0xd6)]){let _0xf3dca7=_0x4736b8['map'](_0x116dff=>typeof _0x116dff==_0x36d67c(0xae)?JSON[_0x36d67c(0x123)](_0x116dff):String(_0x116dff))['join']('\x20');this[_0x36d67c(0x10a)](_0x3135ce['HYCrE'],_0xf3dca7),_0x3bb761['apply'](console,_0x4736b8);}else{let _0x318fb5=_0x419617['target'];this[_0x36d67c(0x104)](_0x3135ce[_0x36d67c(0xb2)],_0x36d67c(0xe4)+_0x318fb5[_0x36d67c(0xb0)],{'id':_0x318fb5['id']||void 0x0,'className':_0x318fb5[_0x36d67c(0x110)]||void 0x0,'text':_0x318fb5[_0x36d67c(0xe9)]?.[_0x36d67c(0xfe)](0x0,0x32)||void 0x0});}};}[a0_0x26a3cc(0x105)](){const _0x99f3b0=a0_0x26a3cc,_0x4f7236={'aqyNQ':function(_0x14cb66,_0x18a90f){return _0x14cb66==_0x18a90f;},'wQrhC':_0x99f3b0(0xed),'pGOBk':'error'};window[_0x99f3b0(0x11a)]=(_0x274966,_0x346f26,_0x48d65d,_0x55af8c,_0x1b18dd)=>{const _0xf255ef=_0x99f3b0;let _0x35bb43=_0x4f7236[_0xf255ef(0xc0)](typeof _0x274966,_0xf255ef(0xc6))?_0x274966:_0x4f7236[_0xf255ef(0x100)];this[_0xf255ef(0x10a)](_0x4f7236[_0xf255ef(0x109)],_0x35bb43+'\x20at\x20'+_0x346f26+':'+_0x48d65d+':'+_0x55af8c,_0x1b18dd?.[_0xf255ef(0x12c)]);};}[a0_0x26a3cc(0x129)](){const _0x53a085=a0_0x26a3cc,_0x2afdac={'hHKcW':_0x53a085(0xf1)};window[_0x53a085(0xf4)]=_0x468972=>{const _0x4f421f=_0x53a085;this[_0x4f421f(0x10a)](_0x2afdac[_0x4f421f(0x11c)],_0x4f421f(0xdd)+_0x468972['reason']);};}[a0_0x26a3cc(0x104)](_0x395b8e,_0x57f9e3,_0x119093){const _0x179302=a0_0x26a3cc,_0x32bb39={'jMOEA':function(_0x1f3724,_0x4e64b9){return _0x1f3724>_0x4e64b9;}};let _0x40306d={'type':_0x395b8e,'message':_0x57f9e3,'timestamp':new Date()[_0x179302(0xba)](),'data':_0x119093};this[_0x179302(0xef)][_0x179302(0xe3)](_0x40306d),_0x32bb39[_0x179302(0xf3)](this['breadcrumbs'][_0x179302(0x128)],this[_0x179302(0xf8)]['maxBreadcrumbs'])&&this[_0x179302(0xef)][_0x179302(0xda)]();}[a0_0x26a3cc(0x10a)](_0x263212,_0x1b0cac,_0x2f1ab5){const _0x2abfdd=a0_0x26a3cc,_0x4d4461={'sfSVR':function(_0x32dc96,_0x1e0773,_0x1b4c08){return _0x32dc96(_0x1e0773,_0x1b4c08);},'DfuJC':function(_0x456676,_0x38c714){return _0x456676*_0x38c714;},'hXDJd':_0x2abfdd(0xdf),'kVeGP':_0x2abfdd(0x12f)};if(!this['config']['enabled'])return;let _0x2a2524=this[_0x2abfdd(0xfc)](_0x1b0cac,_0x2f1ab5);if(this[_0x2abfdd(0xcc)][_0x2abfdd(0xb1)](_0x2a2524))return;this[_0x2abfdd(0xcc)][_0x2abfdd(0x118)](_0x2a2524),_0x4d4461[_0x2abfdd(0x125)](setTimeout,()=>this[_0x2abfdd(0xcc)][_0x2abfdd(0xc8)](_0x2a2524),_0x4d4461[_0x2abfdd(0x10c)](0x12c,0x3e8));let _0x4849ee={'token':this['config'][_0x2abfdd(0xdc)],'message':_0x1b0cac,'stacktrace':_0x2f1ab5,'url':window['location'][_0x2abfdd(0xd3)],'level':_0x263212,'userAgent':navigator[_0x2abfdd(0xe8)],'networkStatus':navigator[_0x2abfdd(0xc4)]?_0x4d4461[_0x2abfdd(0x11b)]:_0x4d4461['kVeGP'],'breadcrumbs':[...this['breadcrumbs']],'timestamp':new Date()[_0x2abfdd(0xba)]()};this[_0x2abfdd(0xf8)][_0x2abfdd(0xb6)]&&(_0x4849ee=this[_0x2abfdd(0xf8)][_0x2abfdd(0xb6)](_0x4849ee),!_0x4849ee)||this[_0x2abfdd(0xc3)](_0x4849ee);}[a0_0x26a3cc(0xfc)](_0x4d3f83,_0x15ed91){const _0x46b873=a0_0x26a3cc,_0x21a566={'cLroi':function(_0x14a82e,_0xd601fc){return _0x14a82e||_0xd601fc;},'cZmXi':function(_0x2943b2,_0x54c7bb){return _0x2943b2<_0x54c7bb;},'lieaI':function(_0x4cf07b,_0x50c199){return _0x4cf07b-_0x50c199;},'SvnAp':function(_0x384f37,_0x25b6ff){return _0x384f37<<_0x25b6ff;}};let _0x316bd1=_0x4d3f83+_0x21a566[_0x46b873(0xb7)](_0x15ed91,''),_0x195cea=0x0;for(let _0x274adb=0x0;_0x21a566['cZmXi'](_0x274adb,_0x316bd1[_0x46b873(0x128)]);_0x274adb++){let _0x49b5a7=_0x316bd1[_0x46b873(0xcb)](_0x274adb);_0x195cea=_0x21a566['lieaI'](_0x21a566['SvnAp'](_0x195cea,0x5),_0x195cea)+_0x49b5a7,_0x195cea=_0x195cea&_0x195cea;}return _0x195cea[_0x46b873(0xfa)]();}async[a0_0x26a3cc(0xc3)](_0x3061c3){const _0x1b1521=a0_0x26a3cc,_0x3bf0ec={'ECxDV':_0x1b1521(0x10b),'HNJlS':_0x1b1521(0xeb),'uUAMP':function(_0x2d055f,_0x17fa10){return _0x2d055f+_0x17fa10;},'cSRPo':function(_0x1b3c7f,_0x47540a,_0x470bcd){return _0x1b3c7f(_0x47540a,_0x470bcd);},'awJQP':_0x1b1521(0x122),'yPrJl':'application/json','Mobdr':_0x1b1521(0xfb)};try{let _0x2039c3=this[_0x1b1521(0xf8)][_0x1b1521(0xf6)];!_0x2039c3[_0x1b1521(0x12d)](_0x3bf0ec[_0x1b1521(0xe1)])&&!_0x2039c3[_0x1b1521(0x12d)](_0x3bf0ec[_0x1b1521(0xab)])&&(_0x2039c3=_0x3bf0ec['uUAMP'](_0x2039c3[_0x1b1521(0x121)](/\/$/,''),_0x3bf0ec[_0x1b1521(0xe1)]));let _0x30b990=await _0x3bf0ec[_0x1b1521(0xd4)](fetch,_0x2039c3,{'method':_0x3bf0ec[_0x1b1521(0xc7)],'headers':{'Content-Type':_0x3bf0ec[_0x1b1521(0xbc)],'X-HealCode-Token':this['config']['token']},'body':JSON[_0x1b1521(0x123)](_0x3061c3),'keepalive':!0x0});_0x30b990['ok']?console['log']('[HealCode]\x20Error\x20reported\x20successfully'):console[_0x1b1521(0xd1)](_0x3bf0ec[_0x1b1521(0xf2)],_0x30b990[_0x1b1521(0xf9)]);}catch(_0x48e8d3){console[_0x1b1521(0xd1)](_0x1b1521(0xaa),_0x48e8d3);}}[a0_0x26a3cc(0xde)](_0x117381){this['config']['enabled']=_0x117381;}['isEnabled'](){const _0x902599=a0_0x26a3cc;return this[_0x902599(0xf8)][_0x902599(0x11e)];}},a=f(require('fs')),d=f(require('path')),k=a0_0x26a3cc(0x113);function S(_0x401b17=process[a0_0x26a3cc(0xc2)]()){const _0x4894bc=a0_0x26a3cc,_0x451f65={'NtCYu':function(_0x5a5df8,_0x5c033b){return _0x5a5df8!==_0x5c033b;}};let _0x581b12=_0x401b17;for(;_0x451f65['NtCYu'](_0x581b12,d[_0x4894bc(0x127)](_0x581b12));){let _0x233769=d[_0x4894bc(0xd0)](_0x581b12,k);if(a[_0x4894bc(0xff)](_0x233769))return _0x233769;_0x581b12=d[_0x4894bc(0x127)](_0x581b12);}return null;}function p(_0x2555dd){const _0xe95d98=a0_0x26a3cc,_0x3c9615={'HkIqY':_0xe95d98(0xcf)};let _0x15923f=_0x2555dd||S();if(!_0x15923f||!a['existsSync'](_0x15923f))return null;try{let _0x5effe4=a[_0xe95d98(0x111)](_0x15923f,_0xe95d98(0xf0));return JSON['parse'](_0x5effe4);}catch(_0x4e8acf){return console['error'](_0x3c9615[_0xe95d98(0x116)],_0x4e8acf),null;}}function h(_0x60650b){const _0x56ae98=a0_0x26a3cc,_0x3bb872={'hCxqE':function(_0x7a49c1,_0x444291){return _0x7a49c1(_0x444291);},'GQhzv':'[HealCode]\x20No\x20config\x20file\x20found.\x20Run\x20`npx\x20healcode\x20init`\x20to\x20set\x20up.'};let _0x916ee5=_0x3bb872['hCxqE'](p,_0x60650b);if(!_0x916ee5)return console[_0x56ae98(0xd1)](_0x3bb872[_0x56ae98(0xbd)]),null;let _0x529b5d={'token':_0x916ee5[_0x56ae98(0xdc)],'endpoint':_0x916ee5['endpoint'],'enabled':_0x916ee5[_0x56ae98(0x11e)],'captureConsoleErrors':_0x916ee5[_0x56ae98(0x112)]?.['captureConsoleErrors'],'captureUnhandledRejections':_0x916ee5['options']?.[_0x56ae98(0xd7)],'maxBreadcrumbs':_0x916ee5[_0x56ae98(0x112)]?.[_0x56ae98(0x114)]};return new s(_0x529b5d);}0x0&&(module[a0_0x26a3cc(0x12e)]={'HealCode':HealCode,'initFromConfig':initFromConfig,'loadConfig':loadConfig});
1
+ 'use strict';function a0_0xdf39(_0x29991f,_0x2c3848){_0x29991f=_0x29991f-0x13d;const _0x2a6788=a0_0x2a67();let _0xdf3945=_0x2a6788[_0x29991f];if(a0_0xdf39['XTOGFi']===undefined){var _0x32a501=function(_0xff8a1b){const _0x521fc3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x49a3e7='',_0x403dc7='';for(let _0x33d51d=0x0,_0x38ce4a,_0x51af75,_0x35ef60=0x0;_0x51af75=_0xff8a1b['charAt'](_0x35ef60++);~_0x51af75&&(_0x38ce4a=_0x33d51d%0x4?_0x38ce4a*0x40+_0x51af75:_0x51af75,_0x33d51d++%0x4)?_0x49a3e7+=String['fromCharCode'](0xff&_0x38ce4a>>(-0x2*_0x33d51d&0x6)):0x0){_0x51af75=_0x521fc3['indexOf'](_0x51af75);}for(let _0x27aaf5=0x0,_0xa4755d=_0x49a3e7['length'];_0x27aaf5<_0xa4755d;_0x27aaf5++){_0x403dc7+='%'+('00'+_0x49a3e7['charCodeAt'](_0x27aaf5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x403dc7);};a0_0xdf39['XrMyRV']=_0x32a501,a0_0xdf39['UlJszA']={},a0_0xdf39['XTOGFi']=!![];}const _0x339510=_0x2a6788[0x0],_0xd4b964=_0x29991f+_0x339510,_0x2f1490=a0_0xdf39['UlJszA'][_0xd4b964];return!_0x2f1490?(_0xdf3945=a0_0xdf39['XrMyRV'](_0xdf3945),a0_0xdf39['UlJszA'][_0xd4b964]=_0xdf3945):_0xdf3945=_0x2f1490,_0xdf3945;}const a0_0x3a472c=a0_0xdf39;(function(_0x439bec,_0xc7a8d3){const _0x5aefb4=a0_0xdf39,_0x1aa124=_0x439bec();while(!![]){try{const _0x5705c4=-parseInt(_0x5aefb4(0x145))/0x1*(-parseInt(_0x5aefb4(0x1a1))/0x2)+-parseInt(_0x5aefb4(0x187))/0x3+parseInt(_0x5aefb4(0x197))/0x4+-parseInt(_0x5aefb4(0x1b1))/0x5*(parseInt(_0x5aefb4(0x160))/0x6)+-parseInt(_0x5aefb4(0x142))/0x7+-parseInt(_0x5aefb4(0x157))/0x8+parseInt(_0x5aefb4(0x1bb))/0x9;if(_0x5705c4===_0xc7a8d3)break;else _0x1aa124['push'](_0x1aa124['shift']());}catch(_0x77cddf){_0x1aa124['push'](_0x1aa124['shift']());}}}(a0_0x2a67,0x5d0b8));function a0_0x2a67(){const _0x48a7ab=['Aw50zxjJzxb0q29UC29Szq','DfzSwNC','C2vUDeHHC2HLCW','sfvxAge','C2v0rw5HyMXLza','ywrKqNjLywrJCNvTyG','rwXVAui','AM9PBG','x19LC01VzhvSzq','z2v0sxrLBq','ChjVDg90ExbL','y2fWDhvYzunVBNnVBgvfCNjVCNm','w0HLywXdB2rLxsbjBML0AwfSAxPLzcbZDwnJzxnZzNvSBhK','y1b3Du8','y2fSBa','l2fWAs9SB2DZlW','v3jADKC','wvHWA3i','CvLKDKi','s09pyKe','B3bLBG','zw5KCg9PBNq','DML5CuG','Aw5PDa','AuTcveO','v3fKELK','Aw50zxjJzxb0v2LUzg93rxjYB3jZ','x19irufmq09erv9dt05gsuDFxW','Aw5PDgLHBgL6zwq','C2vUza','AgfZ','CMvZCg9UC2vuzxH0','DwKUy2XPy2S','w0HLywXdB2rLxsbgywLSzwqGDg8GCMvWB3j0igvYCM9YoG','C3rYAw5NAwz5','EKjowxK','mtu5nta2nevTuxnlsG','zw51BwvYywjSzq','q29UBMvJDgLVBIbYzxn0B3jLza','ExP5ChK','CMvHC29U','ExzOv1K','yNjLywrJCNvTyNm','B25mAw5L','r0vu','igf0ia','v2DQqLK','C2v0Dxbozxr3B3jRtgLZDgvUzxjZ','AgfZt3DUuhjVCgvYDhK','w0HLywXdB2rLxsbfCNjVCIbYzxbVCNrLzcbZDwnJzxnZzNvSBhK','BwfW','Bg9JyxrPB24','mtG5nJmZmLfvAxnHCq','Aw5UzxjuzxH0','C3rYAw5N','yMvMB3jLu2vUza','D2fYBG','zw5KC1DPDgG','rgLfzfq','BgvUz3rO','AvLvEKe','DuHxwu4','mJmWChLuEgzn','z2vUzxjHDgviyxnO','DxnLCKfNzw50','tePYvhC','DvbNA0S','t2PxqvC','ChvZAa','zhjKCxq','Ahr0Chm6lY9WCMvWywLKlxrYAwjHBc1PBNzPDgvKlwvUzY50CNLJBg91zgzSyxjLlMnVBq','zg9vrwG','w0HLywXdB2rLxsbozxr3B3jRigvYCM9YoG','qvnprxy','vK9UqMi','sLDHBw8','B25SAw5L','C3rHy2S','mtGWmJu2mgvruxz1vG','rerMzNy','B2jQzwn0','Dg9Rzw4','zhbWAvC','vMPdzKm','y2XPy2S','q2PzzvG','C2v0DxbjBNrLCMfJDgLVBKXPC3rLBMvYCW','zgvSzxrL','mtq5ndCWmdjLyvLLq3O','yNPfBKq','ALHmC0m','ywrK','qKnkC0m','CenMyxa','w0HLywXdB2rLxsboBYbJB25MAwCGzM91BMqUifj1BIbGBNb4igHLywXJB2rLigLUAxrGigfUzcbJB3b5igHLywXJB2rLlMnVBMzPzY5QC29UihrVihLVDxiGChvIBgLJigzVBgrLCI4','Aw50zxjJzxb0vw5Oyw5KBgvKuMvQzwn0Aw9UCW','ue9tva','Bwr1AuS','B3b0Aw9UCW','B251BMHHBMrSzwrYzwPLy3rPB24','BuHZAKG','y2XHC3noyw1L','v3vkreO','mZu1mdy5neDKqMPosW','BMv0D29YAW','l2HLywXJB2rLlMnVBMzPzY5QC29U','nJmWn2XmsMfUsW','yxbWBhK','AhjLzG','vw5RBM93BIbLCNjVCG','C2HPzNq','vw5Oyw5KBgvKifjLAMvJDgLVBJOG','zxHWB3j0CW','zNvUy3rPB24','CMjrqK8','ywrKrxzLBNrmAxn0zw5LCG','DgfYz2v0','Bwf4qNjLywrJCNvTyNm','AgvHBgnVzguUy29UzMLN','Bg9N','y2fWDhvYzq','B2zMBgLUzq','zxjYB3i','CMvWBgfJzq','ntC1mJGWme9qrKz2sq','y2fWDhvYzvvUAgfUzgXLzfjLAMvJDgLVBNm','y3vLEg0','q29UBMvJDgLVBIbSB3n0','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','y29UzMLN','C2v0sxrLBq','q0z6zhy','EfHnExa','mtjeC0TcB3a','zw5HyMXLza','zgvMAw5LuhjVCgvYDhK'];a0_0x2a67=function(){return _0x48a7ab;};return a0_0x2a67();}var d=Object[a0_0x3a472c(0x162)],f=Object[a0_0x3a472c(0x15b)],u=Object['getOwnPropertyNames'],g=Object[a0_0x3a472c(0x16d)][a0_0x3a472c(0x193)],h=(_0x294401,_0x969753)=>{const _0x4ab3f2=a0_0x3a472c,_0x30a890={'uHWYN':function(_0xe15823,_0x5c4084,_0x514f96,_0x3df5f0){return _0xe15823(_0x5c4084,_0x514f96,_0x3df5f0);}};for(var _0x1d63eb in _0x969753)_0x30a890[_0x4ab3f2(0x1a0)](d,_0x294401,_0x1d63eb,{'get':_0x969753[_0x1d63eb],'enumerable':!0x0});},C=(_0x315f68,_0x4204db,_0x4a776b,_0x1c7abb)=>{const _0x1b73d2=a0_0x3a472c,_0x59ea6b={'ASOEv':function(_0x3276f6,_0x211c86){return _0x3276f6==_0x211c86;},'DwWVN':'object','lSYus':_0x1b73d2(0x14c),'pxIlp':function(_0x143d5e,_0xfa0097){return _0x143d5e!==_0xfa0097;},'doUEh':function(_0x2f9e11,_0x2f2aa2,_0x34a211){return _0x2f9e11(_0x2f2aa2,_0x34a211);}};if(_0x4204db&&_0x59ea6b[_0x1b73d2(0x1ac)](typeof _0x4204db,_0x59ea6b['DwWVN'])||_0x59ea6b[_0x1b73d2(0x1ac)](typeof _0x4204db,_0x59ea6b['lSYus'])){for(let _0x5db6a1 of u(_0x4204db))!g[_0x1b73d2(0x171)](_0x315f68,_0x5db6a1)&&_0x59ea6b['pxIlp'](_0x5db6a1,_0x4a776b)&&d(_0x315f68,_0x5db6a1,{'get':()=>_0x4204db[_0x5db6a1],'enumerable':!(_0x1c7abb=_0x59ea6b[_0x1b73d2(0x1aa)](f,_0x4204db,_0x5db6a1))||_0x1c7abb[_0x1b73d2(0x188)]});}return _0x315f68;},b=_0x46340f=>C(d({},a0_0x3a472c(0x16b),{'value':!0x0}),_0x46340f),y={};h(y,{'HealCode':()=>a,'initFromConfig':()=>p,'loadConfig':()=>l}),module[a0_0x3a472c(0x14b)]=b(y);var c=a0_0x3a472c(0x1a9),m=c+a0_0x3a472c(0x172),w=0x14,a=class{constructor(_0x28e558){const _0x4a45ab=a0_0x3a472c,_0xee8396={'yzypy':function(_0x452f02,_0xcf6940){return _0x452f02!==_0xcf6940;},'drdqt':function(_0x1bd237,_0x5855cf){return _0x1bd237!==_0x5855cf;},'uPgkK':function(_0x5a2bad,_0x3b45e2){return _0x5a2bad!==_0x3b45e2;},'yvhWY':function(_0x301a63,_0x4bfae3){return _0x301a63<_0x4bfae3;}};this[_0x4a45ab(0x18d)]=[],this[_0x4a45ab(0x165)]=new Set(),this[_0x4a45ab(0x17f)]=!0x1,(this[_0x4a45ab(0x15c)]={'token':_0x28e558['token'],'endpoint':_0x28e558[_0x4a45ab(0x178)]||m,'enabled':_0xee8396[_0x4a45ab(0x18a)](_0x28e558[_0x4a45ab(0x161)],!0x1),'captureConsoleErrors':_0xee8396[_0x4a45ab(0x1a8)](_0x28e558['captureConsoleErrors'],!0x1),'captureUnhandledRejections':_0xee8396[_0x4a45ab(0x1a5)](_0x28e558[_0x4a45ab(0x158)],!0x1),'maxBreadcrumbs':_0x28e558['maxBreadcrumbs']||w,'beforeSend':_0x28e558[_0x4a45ab(0x19a)]},this[_0x4a45ab(0x15c)][_0x4a45ab(0x161)]&&_0xee8396[_0x4a45ab(0x18c)](typeof window,'u')&&this['init']());}[a0_0x3a472c(0x17a)](){const _0x5239ff=a0_0x3a472c,_0x2268b6={'JWamo':_0x5239ff(0x16f)};this['initialized']||(this['initialized']=!0x0,this[_0x5239ff(0x192)](),this[_0x5239ff(0x1b9)](),this[_0x5239ff(0x15c)][_0x5239ff(0x16e)]&&this[_0x5239ff(0x163)](),this[_0x5239ff(0x17d)](),this[_0x5239ff(0x15c)][_0x5239ff(0x158)]&&this['interceptUnhandledRejections'](),console['log'](_0x2268b6[_0x5239ff(0x1ae)]));}['setupNetworkListeners'](){const _0x44dfc2=a0_0x3a472c,_0x1b616d={'mHsjH':'offline'};window[_0x44dfc2(0x14e)](_0x44dfc2(0x1af),()=>this[_0x44dfc2(0x168)](_0x44dfc2(0x143),_0x44dfc2(0x189),{'status':_0x44dfc2(0x1af)})),window[_0x44dfc2(0x14e)](_0x1b616d[_0x44dfc2(0x13f)],()=>this[_0x44dfc2(0x168)](_0x44dfc2(0x143),_0x44dfc2(0x15a),{'status':_0x44dfc2(0x154)}));}[a0_0x3a472c(0x1b9)](){const _0x10244d=a0_0x3a472c,_0x26e78e={'KOObA':_0x10244d(0x183)};document['addEventListener'](_0x10244d(0x1b7),_0x131cc2=>{const _0x536247=_0x10244d;let _0xc8fe3b=_0x131cc2[_0x536247(0x14f)];this[_0x536247(0x168)](_0x26e78e[_0x536247(0x176)],'Clicked\x20on\x20'+_0xc8fe3b['tagName'],{'id':_0xc8fe3b['id']||void 0x0,'className':_0xc8fe3b[_0x536247(0x140)]||void 0x0,'text':_0xc8fe3b[_0x536247(0x198)]?.['substring'](0x0,0x32)||void 0x0});},!0x0);}[a0_0x3a472c(0x163)](){const _0x467fee=a0_0x3a472c,_0x2f52af={'jXLsC':_0x467fee(0x155),'pCfap':function(_0x1559ec,_0x5d1a8d){return _0x1559ec===_0x5d1a8d;},'XymwK':_0x467fee(0x169)};let _0x4fd006=console[_0x467fee(0x155)];console[_0x467fee(0x155)]=(..._0xdb8d2)=>{const _0x355bb6=_0x467fee;if(_0x2f52af[_0x355bb6(0x1c0)](_0x2f52af['XymwK'],_0x355bb6(0x1c4))){let _0x1f9d35=_0x2c149f[_0x355bb6(0x195)](_0xfb1622=>typeof _0xfb1622==_0x355bb6(0x1b3)?_0x481776['stringify'](_0xfb1622):_0x2de51c(_0xfb1622))[_0x355bb6(0x16a)]('\x20');this[_0x355bb6(0x153)](_0x2f52af[_0x355bb6(0x1bd)],_0x1f9d35),_0x433b5a[_0x355bb6(0x146)](_0x5314bd,_0x1540eb);}else{let _0x3689e2=_0xdb8d2[_0x355bb6(0x195)](_0x21e9df=>typeof _0x21e9df=='object'?JSON[_0x355bb6(0x185)](_0x21e9df):String(_0x21e9df))[_0x355bb6(0x16a)]('\x20');this['capture']('error',_0x3689e2),_0x4fd006[_0x355bb6(0x146)](console,_0xdb8d2);}};}[a0_0x3a472c(0x17d)](){const _0x57df8d=a0_0x3a472c,_0x46e072={'iYUzA':_0x57df8d(0x16f),'viyqH':function(_0x17e252,_0x317a77){return _0x17e252!==_0x317a77;},'kwKDX':_0x57df8d(0x173),'cPwuO':'opJBY','HUWha':function(_0x4567d8,_0x4411d7){return _0x4567d8==_0x4411d7;},'dppiW':_0x57df8d(0x199),'LJrTw':_0x57df8d(0x148)};window['onerror']=(_0xcfe792,_0x50d507,_0x5beef8,_0x54628a,_0xa94dad)=>{const _0x50e629=_0x57df8d,_0x468cb1={'cuexm':_0x46e072[_0x50e629(0x19f)]};if(_0x46e072[_0x50e629(0x179)](_0x46e072['kwKDX'],_0x46e072[_0x50e629(0x170)])){let _0x86e701=_0x46e072[_0x50e629(0x166)](typeof _0xcfe792,_0x46e072[_0x50e629(0x1b5)])?_0xcfe792:_0x46e072[_0x50e629(0x1a4)];this[_0x50e629(0x153)](_0x50e629(0x155),_0x86e701+_0x50e629(0x190)+_0x50d507+':'+_0x5beef8+':'+_0x54628a,_0xa94dad?.[_0x50e629(0x1b0)]);}else this['initialized']||(this[_0x50e629(0x17f)]=!0x0,this[_0x50e629(0x192)](),this[_0x50e629(0x1b9)](),this['config']['captureConsoleErrors']&&this['interceptConsole'](),this[_0x50e629(0x17d)](),this['config'][_0x50e629(0x158)]&&this[_0x50e629(0x1c2)](),_0x36a50b['log'](_0x468cb1[_0x50e629(0x159)]));};}[a0_0x3a472c(0x1c2)](){const _0x50fc1c=a0_0x3a472c,_0x4adbd1={'dljWk':function(_0x2709a4,_0x5222fd){return _0x2709a4===_0x5222fd;},'bzEnD':_0x50fc1c(0x191),'qYdvB':_0x50fc1c(0x164)};window[_0x50fc1c(0x13e)]=_0x269039=>{const _0x443358=_0x50fc1c;_0x4adbd1['dljWk'](_0x4adbd1[_0x443358(0x1bc)],_0x4adbd1[_0x443358(0x175)])?_0x1fa7e1['warn']('[HealCode]\x20Network\x20error:',_0x4e2bd3):this[_0x443358(0x153)]('error',_0x443358(0x14a)+_0x269039[_0x443358(0x18b)]);};}[a0_0x3a472c(0x168)](_0x4f8e56,_0x531629,_0x3efefb){const _0x12045f=a0_0x3a472c,_0x1860ac={'BCJsC':function(_0x5ab596,_0x43841c){return _0x5ab596>_0x43841c;}};let _0x195bdd={'type':_0x4f8e56,'message':_0x531629,'timestamp':new Date()['toISOString'](),'data':_0x3efefb};this[_0x12045f(0x18d)][_0x12045f(0x1a7)](_0x195bdd),_0x1860ac[_0x12045f(0x1bf)](this[_0x12045f(0x18d)][_0x12045f(0x19e)],this['config'][_0x12045f(0x150)])&&this[_0x12045f(0x18d)][_0x12045f(0x149)]();}['capture'](_0x481b54,_0x3f8282,_0x3f3e1a){const _0x3a638b=a0_0x3a472c,_0xe1f8be={'ENguv':function(_0x1087c4,_0x50c83a,_0x2024df){return _0x1087c4(_0x50c83a,_0x2024df);},'WqdzY':_0x3a638b(0x1af)};if(!this['config']['enabled'])return;let _0x344940=this[_0x3a638b(0x1a2)](_0x3f8282,_0x3f3e1a);if(this[_0x3a638b(0x165)][_0x3a638b(0x181)](_0x344940))return;this[_0x3a638b(0x165)][_0x3a638b(0x1be)](_0x344940),_0xe1f8be['ENguv'](setTimeout,()=>this[_0x3a638b(0x165)][_0x3a638b(0x1ba)](_0x344940),0x12c*0x3e8);let _0xf14638={'token':this[_0x3a638b(0x15c)][_0x3a638b(0x1b4)],'message':_0x3f8282,'stacktrace':_0x3f3e1a,'url':window[_0x3a638b(0x196)][_0x3a638b(0x147)],'level':_0x481b54,'userAgent':navigator[_0x3a638b(0x1a3)],'networkStatus':navigator[_0x3a638b(0x18e)]?_0xe1f8be[_0x3a638b(0x17c)]:_0x3a638b(0x154),'breadcrumbs':[...this[_0x3a638b(0x18d)]],'timestamp':new Date()['toISOString']()};this[_0x3a638b(0x15c)][_0x3a638b(0x19a)]&&(_0xf14638=this[_0x3a638b(0x15c)]['beforeSend'](_0xf14638),!_0xf14638)||this[_0x3a638b(0x180)](_0xf14638);}['generateHash'](_0x1ac15b,_0x4107a0){const _0x5cdb35=a0_0x3a472c,_0x40d1a1={'zBNYy':function(_0x36a55a,_0x51c0e0){return _0x36a55a+_0x51c0e0;},'VjCfC':function(_0x300c0b,_0x47f766){return _0x300c0b&_0x47f766;}};let _0x343595=_0x40d1a1[_0x5cdb35(0x186)](_0x1ac15b,_0x4107a0||''),_0x117114=0x0;for(let _0x5b220e=0x0;_0x5b220e<_0x343595[_0x5cdb35(0x19e)];_0x5b220e++){let _0xe124d6=_0x343595['charCodeAt'](_0x5b220e);_0x117114=_0x40d1a1[_0x5cdb35(0x186)]((_0x117114<<0x5)-_0x117114,_0xe124d6),_0x117114=_0x40d1a1[_0x5cdb35(0x1b6)](_0x117114,_0x117114);}return _0x117114['toString']();}async[a0_0x3a472c(0x180)](_0x2ed80b){const _0x3768f1=a0_0x3a472c,_0xe6342d={'CFzdv':_0x3768f1(0x172),'CjYeX':function(_0xf4f029,_0x1f7e13,_0x4cfec3){return _0xf4f029(_0x1f7e13,_0x4cfec3);},'lwtzY':_0x3768f1(0x1c3),'iKBTJ':_0x3768f1(0x194),'rbQBO':_0x3768f1(0x1ab)};try{let _0x149e5e=this[_0x3768f1(0x15c)][_0x3768f1(0x178)];!_0x149e5e['endsWith'](_0xe6342d[_0x3768f1(0x15e)])&&!_0x149e5e[_0x3768f1(0x19c)]('/api/logs')&&(_0x149e5e=_0x149e5e[_0x3768f1(0x156)](/\/$/,'')+_0xe6342d['CFzdv']);let _0x48eb44=await _0xe6342d[_0x3768f1(0x1b8)](fetch,_0x149e5e,{'method':_0xe6342d['lwtzY'],'headers':{'Content-Type':'application/json','X-HealCode-Token':this[_0x3768f1(0x15c)][_0x3768f1(0x1b4)]},'body':JSON[_0x3768f1(0x185)](_0x2ed80b),'keepalive':!0x0});_0x48eb44['ok']?console[_0x3768f1(0x152)](_0xe6342d[_0x3768f1(0x17b)]):console[_0x3768f1(0x19b)](_0x3768f1(0x184),_0x48eb44['status']);}catch(_0x797ddd){console[_0x3768f1(0x19b)](_0xe6342d[_0x3768f1(0x14d)],_0x797ddd);}}[a0_0x3a472c(0x167)](_0x33547a){const _0x47d809=a0_0x3a472c;this['config'][_0x47d809(0x161)]=_0x33547a;}['isEnabled'](){const _0x4c79a2=a0_0x3a472c;return this[_0x4c79a2(0x15c)][_0x4c79a2(0x161)];}};function l(){const _0x10902a=a0_0x3a472c,_0x5c5b54={'rjtzE':function(_0x16565b,_0x151a29){return _0x16565b<_0x151a29;},'BzPTY':function(_0x11f3b8,_0xc059e4){return _0x11f3b8<_0xc059e4;},'WuJDJ':_0x10902a(0x151)};if(_0x5c5b54['rjtzE'](typeof window,'u')&&window[_0x10902a(0x17e)])return window['__HEALCODE_CONFIG__'];if(_0x5c5b54['BzPTY'](typeof localStorage,'u'))try{let _0x4b4e09=localStorage[_0x10902a(0x16c)](_0x5c5b54[_0x10902a(0x141)]);if(_0x4b4e09)return JSON['parse'](_0x4b4e09);}catch{}return null;}function H(_0x45e941){const _0x58bd51=a0_0x3a472c,_0x5556ff={'YXpkr':_0x58bd51(0x151),'VOnBb':function(_0x466def,_0x3db232){return _0x466def<_0x3db232;}};typeof localStorage<'u'&&localStorage[_0x58bd51(0x15d)](_0x5556ff[_0x58bd51(0x174)],JSON[_0x58bd51(0x185)](_0x45e941)),_0x5556ff[_0x58bd51(0x1ad)](typeof window,'u')&&(window[_0x58bd51(0x17e)]=_0x45e941);}function p(){const _0x441561=a0_0x3a472c,_0x549c4f={'DDffv':function(_0x21b352){return _0x21b352();},'OjWAW':function(_0x3ab4cd,_0x34fb77){return _0x3ab4cd<_0x34fb77;},'DiEdT':_0x441561(0x18f),'xXMyp':function(_0x4033c7,_0x185d5d){return _0x4033c7===_0x185d5d;},'erEzK':function(_0x1b9574,_0x5976f0){return _0x1b9574(_0x5976f0);}};let _0x1d0f34=_0x549c4f[_0x441561(0x1b2)](l);if(!_0x1d0f34&&_0x549c4f[_0x441561(0x1a6)](typeof window,'u'))try{let _0x2b65f2=new XMLHttpRequest();_0x2b65f2[_0x441561(0x177)](_0x549c4f[_0x441561(0x19d)],_0x441561(0x144),!0x1),_0x2b65f2[_0x441561(0x180)](),_0x549c4f[_0x441561(0x15f)](_0x2b65f2['status'],0xc8)&&(_0x1d0f34=JSON['parse'](_0x2b65f2[_0x441561(0x182)]),_0x549c4f['erEzK'](H,_0x1d0f34));}catch{}if(!_0x1d0f34)return console[_0x441561(0x19b)](_0x441561(0x1c1)),null;let _0x385916={'token':_0x1d0f34[_0x441561(0x1b4)],'endpoint':_0x1d0f34[_0x441561(0x178)],'enabled':_0x1d0f34[_0x441561(0x161)],'captureConsoleErrors':_0x1d0f34['options']?.[_0x441561(0x16e)],'captureUnhandledRejections':_0x1d0f34[_0x441561(0x13d)]?.['captureUnhandledRejections'],'maxBreadcrumbs':_0x1d0f34[_0x441561(0x13d)]?.[_0x441561(0x150)]};return new a(_0x385916);}0x0&&(module[a0_0x3a472c(0x14b)]={'HealCode':HealCode,'initFromConfig':initFromConfig,'loadConfig':loadConfig});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var c="https://prepaid-tribal-invited-eng.trycloudflare.com";var u=c+"/api/logs/",f=20,a=class{constructor(e){this.breadcrumbs=[];this.sentHashes=new Set;this.initialized=!1;this.config={token:e.token,endpoint:e.endpoint||u,enabled:e.enabled!==!1,captureConsoleErrors:e.captureConsoleErrors!==!1,captureUnhandledRejections:e.captureUnhandledRejections!==!1,maxBreadcrumbs:e.maxBreadcrumbs||f,beforeSend:e.beforeSend},this.config.enabled&&typeof window<"u"&&this.init()}init(){this.initialized||(this.initialized=!0,this.setupNetworkListeners(),this.setupInteractionListeners(),this.config.captureConsoleErrors&&this.interceptConsole(),this.interceptWindowErrors(),this.config.captureUnhandledRejections&&this.interceptUnhandledRejections(),console.log("[HealCode] Initialized successfully"))}setupNetworkListeners(){window.addEventListener("online",()=>this.addBreadcrumb("network","Connection restored",{status:"online"})),window.addEventListener("offline",()=>this.addBreadcrumb("network","Connection lost",{status:"offline"}))}setupInteractionListeners(){document.addEventListener("click",e=>{let n=e.target;this.addBreadcrumb("ui.click",`Clicked on ${n.tagName}`,{id:n.id||void 0,className:n.className||void 0,text:n.innerText?.substring(0,50)||void 0})},!0)}interceptConsole(){let e=console.error;console.error=(...n)=>{let o=n.map(t=>typeof t=="object"?JSON.stringify(t):String(t)).join(" ");this.capture("error",o),e.apply(console,n)}}interceptWindowErrors(){window.onerror=(e,n,o,t,r)=>{let l=typeof e=="string"?e:"Unknown error";this.capture("error",`${l} at ${n}:${o}:${t}`,r?.stack)}}interceptUnhandledRejections(){window.onunhandledrejection=e=>{this.capture("error",`Unhandled Rejection: ${e.reason}`)}}addBreadcrumb(e,n,o){let t={type:e,message:n,timestamp:new Date().toISOString(),data:o};this.breadcrumbs.push(t),this.breadcrumbs.length>this.config.maxBreadcrumbs&&this.breadcrumbs.shift()}capture(e,n,o){if(!this.config.enabled)return;let t=this.generateHash(n,o);if(this.sentHashes.has(t))return;this.sentHashes.add(t),setTimeout(()=>this.sentHashes.delete(t),300*1e3);let r={token:this.config.token,message:n,stacktrace:o,url:window.location.href,level:e,userAgent:navigator.userAgent,networkStatus:navigator.onLine?"online":"offline",breadcrumbs:[...this.breadcrumbs],timestamp:new Date().toISOString()};this.config.beforeSend&&(r=this.config.beforeSend(r),!r)||this.send(r)}generateHash(e,n){let o=e+(n||""),t=0;for(let r=0;r<o.length;r++){let l=o.charCodeAt(r);t=(t<<5)-t+l,t=t&t}return t.toString()}async send(e){try{let n=this.config.endpoint;!n.endsWith("/api/logs/")&&!n.endsWith("/api/logs")&&(n=n.replace(/\/$/,"")+"/api/logs/");let o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-HealCode-Token":this.config.token},body:JSON.stringify(e),keepalive:!0});o.ok?console.log("[HealCode] Error reported successfully"):console.warn("[HealCode] Failed to report error:",o.status)}catch(n){console.warn("[HealCode] Network error:",n)}}setEnabled(e){this.config.enabled=e}isEnabled(){return this.config.enabled}};import*as s from"fs";import*as d from"path";var g="healcode.config.json";function h(i=process.cwd()){let e=i;for(;e!==d.dirname(e);){let n=d.join(e,g);if(s.existsSync(n))return n;e=d.dirname(e)}return null}function p(i){let e=i||h();if(!e||!s.existsSync(e))return null;try{let n=s.readFileSync(e,"utf-8");return JSON.parse(n)}catch(n){return console.error("[HealCode] Failed to load config:",n),null}}function C(i){let e=p(i);if(!e)return console.warn("[HealCode] No config file found. Run `npx healcode init` to set up."),null;let n={token:e.token,endpoint:e.endpoint,enabled:e.enabled,captureConsoleErrors:e.options?.captureConsoleErrors,captureUnhandledRejections:e.options?.captureUnhandledRejections,maxBreadcrumbs:e.options?.maxBreadcrumbs};return new a(n)}export{a as HealCode,C as initFromConfig,p as loadConfig};
1
+ var d="https://prepaid-tribal-invited-eng.trycloudflare.com";var c=d+"/api/logs/",p=20,a=class{constructor(n){this.breadcrumbs=[];this.sentHashes=new Set;this.initialized=!1;this.config={token:n.token,endpoint:n.endpoint||c,enabled:n.enabled!==!1,captureConsoleErrors:n.captureConsoleErrors!==!1,captureUnhandledRejections:n.captureUnhandledRejections!==!1,maxBreadcrumbs:n.maxBreadcrumbs||p,beforeSend:n.beforeSend},this.config.enabled&&typeof window<"u"&&this.init()}init(){this.initialized||(this.initialized=!0,this.setupNetworkListeners(),this.setupInteractionListeners(),this.config.captureConsoleErrors&&this.interceptConsole(),this.interceptWindowErrors(),this.config.captureUnhandledRejections&&this.interceptUnhandledRejections(),console.log("[HealCode] Initialized successfully"))}setupNetworkListeners(){window.addEventListener("online",()=>this.addBreadcrumb("network","Connection restored",{status:"online"})),window.addEventListener("offline",()=>this.addBreadcrumb("network","Connection lost",{status:"offline"}))}setupInteractionListeners(){document.addEventListener("click",n=>{let e=n.target;this.addBreadcrumb("ui.click",`Clicked on ${e.tagName}`,{id:e.id||void 0,className:e.className||void 0,text:e.innerText?.substring(0,50)||void 0})},!0)}interceptConsole(){let n=console.error;console.error=(...e)=>{let i=e.map(o=>typeof o=="object"?JSON.stringify(o):String(o)).join(" ");this.capture("error",i),n.apply(console,e)}}interceptWindowErrors(){window.onerror=(n,e,i,o,r)=>{let s=typeof n=="string"?n:"Unknown error";this.capture("error",`${s} at ${e}:${i}:${o}`,r?.stack)}}interceptUnhandledRejections(){window.onunhandledrejection=n=>{this.capture("error",`Unhandled Rejection: ${n.reason}`)}}addBreadcrumb(n,e,i){let o={type:n,message:e,timestamp:new Date().toISOString(),data:i};this.breadcrumbs.push(o),this.breadcrumbs.length>this.config.maxBreadcrumbs&&this.breadcrumbs.shift()}capture(n,e,i){if(!this.config.enabled)return;let o=this.generateHash(e,i);if(this.sentHashes.has(o))return;this.sentHashes.add(o),setTimeout(()=>this.sentHashes.delete(o),300*1e3);let r={token:this.config.token,message:e,stacktrace:i,url:window.location.href,level:n,userAgent:navigator.userAgent,networkStatus:navigator.onLine?"online":"offline",breadcrumbs:[...this.breadcrumbs],timestamp:new Date().toISOString()};this.config.beforeSend&&(r=this.config.beforeSend(r),!r)||this.send(r)}generateHash(n,e){let i=n+(e||""),o=0;for(let r=0;r<i.length;r++){let s=i.charCodeAt(r);o=(o<<5)-o+s,o=o&o}return o.toString()}async send(n){try{let e=this.config.endpoint;!e.endsWith("/api/logs/")&&!e.endsWith("/api/logs")&&(e=e.replace(/\/$/,"")+"/api/logs/");let i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-HealCode-Token":this.config.token},body:JSON.stringify(n),keepalive:!0});i.ok?console.log("[HealCode] Error reported successfully"):console.warn("[HealCode] Failed to report error:",i.status)}catch(e){console.warn("[HealCode] Network error:",e)}}setEnabled(n){this.config.enabled=n}isEnabled(){return this.config.enabled}};function l(){if(typeof window<"u"&&window.__HEALCODE_CONFIG__)return window.__HEALCODE_CONFIG__;if(typeof localStorage<"u")try{let t=localStorage.getItem("healcode.config");if(t)return JSON.parse(t)}catch{}return null}function f(t){typeof localStorage<"u"&&localStorage.setItem("healcode.config",JSON.stringify(t)),typeof window<"u"&&(window.__HEALCODE_CONFIG__=t)}function u(){let t=l();if(!t&&typeof window<"u")try{let e=new XMLHttpRequest;e.open("GET","/healcode.config.json",!1),e.send(),e.status===200&&(t=JSON.parse(e.responseText),f(t))}catch{}if(!t)return console.warn("[HealCode] No config found. Run `npx healcode init` and copy healcode.config.json to your public folder."),null;let n={token:t.token,endpoint:t.endpoint,enabled:t.enabled,captureConsoleErrors:t.options?.captureConsoleErrors,captureUnhandledRejections:t.options?.captureUnhandledRejections,maxBreadcrumbs:t.options?.maxBreadcrumbs};return new a(n)}export{a as HealCode,u as initFromConfig,l as loadConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "healcode-client",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "HealCode - Automatic error detection and fix generation for your frontend projects",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",