@wppconnect-team/wppconnect 1.40.1 → 1.41.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 1.41.1 (2026-03-18)
2
+
3
+ ### Bug Fixes
4
+
5
+ - t is not a function ([#2718](https://github.com/wppconnect-team/wppconnect/issues/2718)) ([3d65a1c](https://github.com/wppconnect-team/wppconnect/commit/3d65a1cf0ff0ea70d38e79d9a2b788f1050845ed))
6
+
7
+ # 1.41.0 (2026-03-05)
8
+
9
+ ### Features
10
+
11
+ - exposing new stream events and bump wa-version lib ([#2716](https://github.com/wppconnect-team/wppconnect/issues/2716)) ([7c6355e](https://github.com/wppconnect-team/wppconnect/commit/7c6355e5f3e6b0cbeb2066dc3441c959be8d80f5))
12
+
1
13
  ## 1.40.1 (2026-02-28)
2
14
 
3
15
  ### Bug Fixes
@@ -6,7 +6,9 @@ export declare enum ExposedFn {
6
6
  onNotificationMessage = "onNotificationMessage",
7
7
  onParticipantsChanged = "onParticipantsChanged",
8
8
  onStateChange = "onStateChange",
9
- onStreamChange = "onStreamChange",
9
+ onStreamChange = "onStreamChange",// deprecated
10
+ onStreamModeChanged = "onStreamModeChanged",
11
+ onStreamInfoChanged = "onStreamInfoChanged",
10
12
  onIncomingCall = "onIncomingCall",
11
13
  onInterfaceChange = "onInterfaceChange",
12
14
  onPresenceChanged = "onPresenceChanged",
@@ -27,6 +27,8 @@ var ExposedFn;
27
27
  ExposedFn["onParticipantsChanged"] = "onParticipantsChanged";
28
28
  ExposedFn["onStateChange"] = "onStateChange";
29
29
  ExposedFn["onStreamChange"] = "onStreamChange";
30
+ ExposedFn["onStreamModeChanged"] = "onStreamModeChanged";
31
+ ExposedFn["onStreamInfoChanged"] = "onStreamInfoChanged";
30
32
  ExposedFn["onIncomingCall"] = "onIncomingCall";
31
33
  ExposedFn["onInterfaceChange"] = "onInterfaceChange";
32
34
  ExposedFn["onPresenceChanged"] = "onPresenceChanged";
@@ -1,4 +1,5 @@
1
1
  import { MsgKey } from '@wppconnect/wa-js/dist/whatsapp';
2
+ import { StreamInfo, StreamMode } from '@wppconnect/wa-js/dist/whatsapp/enums';
2
3
  import { Page } from 'puppeteer';
3
4
  import { CreateConfig } from '../../config/create-config';
4
5
  import { Ack, Chat, IncomingCall, LiveLocation, Message, ParticipantEvent, PresenceEvent, Wid } from '../model';
@@ -13,6 +14,8 @@ declare global {
13
14
  onAnyMessage: any;
14
15
  onStateChange: any;
15
16
  onStreamChange: any;
17
+ onStreamModeChanged: any;
18
+ onStreamInfoChanged: any;
16
19
  onIncomingCall: any;
17
20
  onAck: any;
18
21
  onMessageEdit: any;
@@ -65,12 +68,27 @@ export declare class ListenerLayer extends ProfileLayer {
65
68
  dispose: () => void;
66
69
  };
67
70
  /**
71
+ * @deprecated in favor of {@link onStreamModeChanged}
68
72
  * @event Returns the current state of the connection
69
73
  * @returns Disposable object to stop the listening
70
74
  */
71
75
  onStreamChange(callback: (state: SocketStream) => void): {
72
76
  dispose: () => void;
73
77
  };
78
+ /**
79
+ * @event Listens to Stream mode changes
80
+ * @returns Disposable object to stop the listening
81
+ */
82
+ onStreamModeChanged(callback: (mode: StreamMode) => void): {
83
+ dispose: () => void;
84
+ };
85
+ /**
86
+ * @event Listens to Stream info changes
87
+ * @returns Disposable object to stop the listening
88
+ */
89
+ onStreamInfoChanged(callback: (info: StreamInfo) => void): {
90
+ dispose: () => void;
91
+ };
74
92
  /**
75
93
  * @event Listens to interface mode change See {@link InterfaceState} and {@link InterfaceMode} for details
76
94
  * @returns Disposable object to stop the listening
@@ -179,7 +179,7 @@ var ListenerLayer = /** @class */ (function (_super) {
179
179
  return [3 /*break*/, 2];
180
180
  case 5: return [4 /*yield*/, this.page
181
181
  .evaluate(function () {
182
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
182
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
183
183
  try {
184
184
  if (!((_a = window['onMessage']) === null || _a === void 0 ? void 0 : _a.exposed)) {
185
185
  WPP.on('chat.new_message', function (msg) {
@@ -255,7 +255,25 @@ var ListenerLayer = /** @class */ (function (_super) {
255
255
  console.error(error);
256
256
  }
257
257
  try {
258
- if (!((_g = window['onAddedToGroup']) === null || _g === void 0 ? void 0 : _g.exposed)) {
258
+ if (!((_g = window['onStreamModeChanged']) === null || _g === void 0 ? void 0 : _g.exposed)) {
259
+ window.WAPI.onStreamModeChanged(window['onStreamModeChanged']);
260
+ window['onStreamModeChanged'].exposed = true;
261
+ }
262
+ }
263
+ catch (error) {
264
+ console.error(error);
265
+ }
266
+ try {
267
+ if (!((_h = window['onStreamInfoChanged']) === null || _h === void 0 ? void 0 : _h.exposed)) {
268
+ window.WAPI.onStreamInfoChanged(window['onStreamInfoChanged']);
269
+ window['onStreamInfoChanged'].exposed = true;
270
+ }
271
+ }
272
+ catch (error) {
273
+ console.error(error);
274
+ }
275
+ try {
276
+ if (!((_j = window['onAddedToGroup']) === null || _j === void 0 ? void 0 : _j.exposed)) {
259
277
  window.WAPI.onAddedToGroup(window['onAddedToGroup']);
260
278
  window['onAddedToGroup'].exposed = true;
261
279
  }
@@ -264,7 +282,7 @@ var ListenerLayer = /** @class */ (function (_super) {
264
282
  console.error(error);
265
283
  }
266
284
  try {
267
- if (!((_h = window['onIncomingCall']) === null || _h === void 0 ? void 0 : _h.exposed)) {
285
+ if (!((_k = window['onIncomingCall']) === null || _k === void 0 ? void 0 : _k.exposed)) {
268
286
  window.WAPI.onIncomingCall(window['onIncomingCall']);
269
287
  window['onIncomingCall'].exposed = true;
270
288
  }
@@ -273,7 +291,7 @@ var ListenerLayer = /** @class */ (function (_super) {
273
291
  console.error(error);
274
292
  }
275
293
  try {
276
- if (!((_j = window['onInterfaceChange']) === null || _j === void 0 ? void 0 : _j.exposed)) {
294
+ if (!((_l = window['onInterfaceChange']) === null || _l === void 0 ? void 0 : _l.exposed)) {
277
295
  window.WAPI.onInterfaceChange(window['onInterfaceChange']);
278
296
  window['onInterfaceChange'].exposed = true;
279
297
  }
@@ -282,7 +300,7 @@ var ListenerLayer = /** @class */ (function (_super) {
282
300
  console.error(error);
283
301
  }
284
302
  try {
285
- if (!((_k = window['onNotificationMessage']) === null || _k === void 0 ? void 0 : _k.exposed)) {
303
+ if (!((_m = window['onNotificationMessage']) === null || _m === void 0 ? void 0 : _m.exposed)) {
286
304
  window.WAPI.onNotificationMessage(window['onNotificationMessage']);
287
305
  window['onNotificationMessage'].exposed = true;
288
306
  }
@@ -291,7 +309,7 @@ var ListenerLayer = /** @class */ (function (_super) {
291
309
  console.error(error);
292
310
  }
293
311
  try {
294
- if (!((_l = window['onPresenceChanged']) === null || _l === void 0 ? void 0 : _l.exposed)) {
312
+ if (!((_o = window['onPresenceChanged']) === null || _o === void 0 ? void 0 : _o.exposed)) {
295
313
  WPP.on('chat.presence_change', window['onPresenceChanged']);
296
314
  window['onPresenceChanged'].exposed = true;
297
315
  }
@@ -300,7 +318,7 @@ var ListenerLayer = /** @class */ (function (_super) {
300
318
  console.error(error);
301
319
  }
302
320
  try {
303
- if (!((_m = window['onLiveLocation']) === null || _m === void 0 ? void 0 : _m.exposed)) {
321
+ if (!((_p = window['onLiveLocation']) === null || _p === void 0 ? void 0 : _p.exposed)) {
304
322
  window.WAPI.onLiveLocation(window['onLiveLocation']);
305
323
  window['onLiveLocation'].exposed = true;
306
324
  }
@@ -309,7 +327,7 @@ var ListenerLayer = /** @class */ (function (_super) {
309
327
  console.error(error);
310
328
  }
311
329
  try {
312
- if (!((_o = window['onRevokedMessage']) === null || _o === void 0 ? void 0 : _o.exposed)) {
330
+ if (!((_q = window['onRevokedMessage']) === null || _q === void 0 ? void 0 : _q.exposed)) {
313
331
  WPP.on('chat.msg_revoke', function (data) {
314
332
  var eventData = {
315
333
  author: data.author,
@@ -327,7 +345,7 @@ var ListenerLayer = /** @class */ (function (_super) {
327
345
  console.error(error);
328
346
  }
329
347
  try {
330
- if (!((_p = window['onReactionMessage']) === null || _p === void 0 ? void 0 : _p.exposed)) {
348
+ if (!((_r = window['onReactionMessage']) === null || _r === void 0 ? void 0 : _r.exposed)) {
331
349
  WPP.on('chat.new_reaction', function (data) {
332
350
  var eventData = {
333
351
  id: data.id,
@@ -347,7 +365,7 @@ var ListenerLayer = /** @class */ (function (_super) {
347
365
  console.error(error);
348
366
  }
349
367
  try {
350
- if (!((_q = window['onPollResponse']) === null || _q === void 0 ? void 0 : _q.exposed)) {
368
+ if (!((_s = window['onPollResponse']) === null || _s === void 0 ? void 0 : _s.exposed)) {
351
369
  WPP.on('chat.poll_response', function (data) {
352
370
  var eventData = {
353
371
  msgId: data.msgId,
@@ -365,7 +383,7 @@ var ListenerLayer = /** @class */ (function (_super) {
365
383
  console.error(error);
366
384
  }
367
385
  try {
368
- if (!((_r = window['onUpdateLabel']) === null || _r === void 0 ? void 0 : _r.exposed)) {
386
+ if (!((_t = window['onUpdateLabel']) === null || _t === void 0 ? void 0 : _t.exposed)) {
369
387
  WPP.on('chat.update_label', function (data) {
370
388
  var eventData = {
371
389
  chat: data.chat,
@@ -382,7 +400,7 @@ var ListenerLayer = /** @class */ (function (_super) {
382
400
  console.error(error);
383
401
  }
384
402
  try {
385
- if (!((_s = window['onOrderStatusUpdate']) === null || _s === void 0 ? void 0 : _s.exposed)) {
403
+ if (!((_u = window['onOrderStatusUpdate']) === null || _u === void 0 ? void 0 : _u.exposed)) {
386
404
  WPP.on('order.payment_status', function (data) {
387
405
  var eventData = {
388
406
  method: data.method,
@@ -399,7 +417,7 @@ var ListenerLayer = /** @class */ (function (_super) {
399
417
  console.error(error);
400
418
  }
401
419
  try {
402
- if (!((_t = window['onParticipantsChanged']) === null || _t === void 0 ? void 0 : _t.exposed)) {
420
+ if (!((_v = window['onParticipantsChanged']) === null || _v === void 0 ? void 0 : _v.exposed)) {
403
421
  WPP.on('group.participant_changed', function (participantChangedEvent) {
404
422
  window['onParticipantsChanged'](participantChangedEvent);
405
423
  });
@@ -410,7 +428,7 @@ var ListenerLayer = /** @class */ (function (_super) {
410
428
  console.error(error);
411
429
  }
412
430
  try {
413
- if (!((_u = window['onNewChat']) === null || _u === void 0 ? void 0 : _u.exposed)) {
431
+ if (!((_w = window['onNewChat']) === null || _w === void 0 ? void 0 : _w.exposed)) {
414
432
  WPP.on('chat.new_chat', function (chat) {
415
433
  window['onNewChat'](chat);
416
434
  });
@@ -478,12 +496,27 @@ var ListenerLayer = /** @class */ (function (_super) {
478
496
  return this.registerEvent(exposed_enum_1.ExposedFn.onStateChange, callback);
479
497
  };
480
498
  /**
499
+ * @deprecated in favor of {@link onStreamModeChanged}
481
500
  * @event Returns the current state of the connection
482
501
  * @returns Disposable object to stop the listening
483
502
  */
484
503
  ListenerLayer.prototype.onStreamChange = function (callback) {
485
504
  return this.registerEvent(exposed_enum_1.ExposedFn.onStreamChange, callback);
486
505
  };
506
+ /**
507
+ * @event Listens to Stream mode changes
508
+ * @returns Disposable object to stop the listening
509
+ */
510
+ ListenerLayer.prototype.onStreamModeChanged = function (callback) {
511
+ return this.registerEvent(exposed_enum_1.ExposedFn.onStreamModeChanged, callback);
512
+ };
513
+ /**
514
+ * @event Listens to Stream info changes
515
+ * @returns Disposable object to stop the listening
516
+ */
517
+ ListenerLayer.prototype.onStreamInfoChanged = function (callback) {
518
+ return this.registerEvent(exposed_enum_1.ExposedFn.onStreamInfoChanged, callback);
519
+ };
487
520
  /**
488
521
  * @event Listens to interface mode change See {@link InterfaceState} and {@link InterfaceMode} for details
489
522
  * @returns Disposable object to stop the listening
@@ -1,3 +1,4 @@
1
+ import { StreamInfo, StreamMode } from '@wppconnect/wa-js/dist/whatsapp/enums';
1
2
  import { CreateConfig } from '../../config/create-config';
2
3
  import { SessionToken } from '../../token-store';
3
4
  import { StatusFind } from './enum';
@@ -13,6 +14,14 @@ export type StatusFindCallback = (status: StatusFind | keyof typeof StatusFind,
13
14
  * A callback will be received, informing data as percentage and loading screen message
14
15
  */
15
16
  export type LoadingScreenCallback = (percent: number, message: string) => void;
17
+ /**
18
+ * A callback will be received, informing the stream mode has changed
19
+ */
20
+ export type OnStreamModeCallback = (mode: StreamMode) => void;
21
+ /**
22
+ * A callback will be received, informing the stream info has changed
23
+ */
24
+ export type OnStreamInfoCallback = (info: StreamInfo) => void;
16
25
  /**
17
26
  * A callback will be received, informing a code to you connect
18
27
  */
@@ -38,6 +47,14 @@ export interface CreateOptions extends CreateConfig {
38
47
  * A callback will be received, informing data as percentage and loading screen message
39
48
  */
40
49
  onLoadingScreen?: LoadingScreenCallback;
50
+ /**
51
+ * A callback will be received, informing the stream mode has changed
52
+ */
53
+ onStreamModeChanged?: OnStreamModeCallback;
54
+ /**
55
+ * A callback will be received, informing the stream info has changed
56
+ */
57
+ onStreamInfoChanged?: OnStreamInfoCallback;
41
58
  /**
42
59
  * Pass the session token information you can receive this token with the await client.getSessionTokenBrowser () function
43
60
  * @deprecated in favor of `sessionToken`
@@ -1,6 +1,6 @@
1
+ import { CatchQRCallback, CreateOptions, LinkByCodeCallback, LoadingScreenCallback, StatusFindCallback } from '../api/model/initializer';
1
2
  import { Whatsapp } from '../api/whatsapp';
2
3
  import { CreateConfig } from '../config/create-config';
3
- import { CatchQRCallback, CreateOptions, LinkByCodeCallback, LoadingScreenCallback, StatusFindCallback } from '../api/model/initializer';
4
4
  import { SessionToken } from '../token-store';
5
5
  /**
6
6
  * Start the bot
@@ -100,15 +100,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
100
100
  };
101
101
  Object.defineProperty(exports, "__esModule", { value: true });
102
102
  exports.create = create;
103
+ var fs = __importStar(require("fs"));
104
+ var path = __importStar(require("path"));
105
+ var sanitize_filename_1 = __importDefault(require("sanitize-filename"));
103
106
  var whatsapp_1 = require("../api/whatsapp");
104
107
  var create_config_1 = require("../config/create-config");
105
- var browser_1 = require("./browser");
106
- var welcome_1 = require("./welcome");
107
108
  var logger_1 = require("../utils/logger");
108
- var path = __importStar(require("path"));
109
- var fs = __importStar(require("fs"));
110
- var sanitize_filename_1 = __importDefault(require("sanitize-filename"));
111
109
  var sleep_1 = require("../utils/sleep");
110
+ var browser_1 = require("./browser");
111
+ var welcome_1 = require("./welcome");
112
112
  process.on('unhandledRejection', function (reason, promise) {
113
113
  var message = 'Unhandled Rejection: ';
114
114
  if (reason instanceof Error) {
@@ -126,11 +126,11 @@ process.on('unhandledRejection', function (reason, promise) {
126
126
  });
127
127
  function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLinkCode, options, browserSessionToken) {
128
128
  return __awaiter(this, void 0, void 0, function () {
129
- var session, usingDeprecatedCreate, mergedOptions, logger, browser, page, client_1, isLogged, waitLoginPromise_1;
129
+ var session, usingDeprecatedCreate, _a, onStreamModeChanged, onStreamInfoChanged, mergedOptions, logger, browser, page, client_1, isLogged, waitLoginPromise_1;
130
130
  var _this = this;
131
- var _a;
132
- return __generator(this, function (_b) {
133
- switch (_b.label) {
131
+ var _b;
132
+ return __generator(this, function (_c) {
133
+ switch (_c.label) {
134
134
  case 0:
135
135
  session = 'session';
136
136
  usingDeprecatedCreate = false;
@@ -157,6 +157,7 @@ function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLink
157
157
  sessionOrOption.browserSessionToken || browserSessionToken;
158
158
  }
159
159
  }
160
+ _a = sessionOrOption, onStreamModeChanged = _a.onStreamModeChanged, onStreamInfoChanged = _a.onStreamInfoChanged;
160
161
  mergedOptions = __assign(__assign({}, create_config_1.defaultOptions), options);
161
162
  logger = mergedOptions.logger;
162
163
  if (usingDeprecatedCreate) {
@@ -168,8 +169,8 @@ function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLink
168
169
  if (!mergedOptions.updatesLog) return [3 /*break*/, 2];
169
170
  return [4 /*yield*/, (0, welcome_1.checkUpdates)()];
170
171
  case 1:
171
- _b.sent();
172
- _b.label = 2;
172
+ _c.sent();
173
+ _c.label = 2;
173
174
  case 2:
174
175
  browser = mergedOptions.browser;
175
176
  page = mergedOptions.page;
@@ -180,7 +181,7 @@ function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLink
180
181
  case 3:
181
182
  if (!(!browser && !page)) return [3 /*break*/, 5];
182
183
  if (!mergedOptions.browserWS &&
183
- !((_a = mergedOptions.puppeteerOptions) === null || _a === void 0 ? void 0 : _a.userDataDir)) {
184
+ !((_b = mergedOptions.puppeteerOptions) === null || _b === void 0 ? void 0 : _b.userDataDir)) {
184
185
  mergedOptions.puppeteerOptions.userDataDir = path.resolve(process.cwd(), path.join(mergedOptions.folderNameToken, (0, sanitize_filename_1.default)(session)));
185
186
  if (!fs.existsSync(mergedOptions.puppeteerOptions.userDataDir)) {
186
187
  fs.mkdirSync(mergedOptions.puppeteerOptions.userDataDir, {
@@ -216,7 +217,7 @@ function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLink
216
217
  throw e;
217
218
  })];
218
219
  case 4:
219
- browser = _b.sent();
220
+ browser = _c.sent();
220
221
  logger.http('checking headless...', {
221
222
  session: session,
222
223
  type: 'browser',
@@ -233,7 +234,7 @@ function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLink
233
234
  type: 'browser',
234
235
  });
235
236
  }
236
- _b.label = 5;
237
+ _c.label = 5;
237
238
  case 5:
238
239
  if (!mergedOptions.browserWS && browser['_process']) {
239
240
  browser['_process'].once('close', function () {
@@ -271,25 +272,31 @@ function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLink
271
272
  return [4 /*yield*/, (0, browser_1.getOrCreatePage)(browser)];
272
273
  case 6:
273
274
  // Initialize a page
274
- page = _b.sent();
275
- _b.label = 7;
275
+ page = _c.sent();
276
+ _c.label = 7;
276
277
  case 7:
277
278
  if (!page) return [3 /*break*/, 12];
278
279
  return [4 /*yield*/, page.setBypassCSP(true)];
279
280
  case 8:
280
- _b.sent();
281
+ _c.sent();
281
282
  client_1 = new whatsapp_1.Whatsapp(page, session, mergedOptions);
282
283
  client_1.catchQR = catchQR;
283
284
  client_1.statusFind = statusFind;
284
285
  client_1.onLoadingScreen = onLoadingScreen;
285
286
  client_1.catchLinkCode = catchLinkCode;
287
+ if (onStreamModeChanged) {
288
+ client_1.onStreamModeChanged(onStreamModeChanged);
289
+ }
290
+ if (onStreamInfoChanged) {
291
+ client_1.onStreamInfoChanged(onStreamInfoChanged);
292
+ }
286
293
  return [4 /*yield*/, client_1.start()];
287
294
  case 9:
288
- _b.sent();
295
+ _c.sent();
289
296
  if (!mergedOptions.waitForLogin) return [3 /*break*/, 11];
290
297
  return [4 /*yield*/, client_1.waitForLogin()];
291
298
  case 10:
292
- isLogged = _b.sent();
299
+ isLogged = _c.sent();
293
300
  if (!isLogged) {
294
301
  throw new Error('Not Logged');
295
302
  }
@@ -321,7 +328,7 @@ function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLink
321
328
  }
322
329
  });
323
330
  }); });
324
- _b.label = 11;
331
+ _c.label = 11;
325
332
  case 11: return [2 /*return*/, client_1];
326
333
  case 12: return [2 /*return*/];
327
334
  }
@@ -1 +1 @@
1
- (()=>{var e={730(e,t,n){"use strict";var r;!function(){function i(e,t,n){var r,i,o,a,p,w,v,P,y,g=0,m=[],A=0,b=!1,W=[],I=[],S=!1,M=!1,C=-1;if(r=(n=n||{}).encoding||"UTF8",(y=n.numRounds||1)!==parseInt(y,10)||1>y)throw Error("numRounds must a integer >= 1");if("SHA-1"===e)p=512,w=F,v=H,a=160,P=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(w=function(t,n){return z(t,n,e)},v=function(t,n,r,i){var o,a;if("SHA-224"===e||"SHA-256"===e)o=15+(n+65>>>9<<4),a=16;else{if("SHA-384"!==e&&"SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");o=31+(n+129>>>10<<5),a=32}for(;t.length<=o;)t.push(0);for(t[n>>>5]|=128<<24-n%32,n+=r,t[o]=4294967295&n,t[o-1]=n/4294967296|0,r=t.length,n=0;n<r;n+=a)i=z(t.slice(n,n+a),i,e);if("SHA-224"===e)t=[i[0],i[1],i[2],i[3],i[4],i[5],i[6]];else if("SHA-256"===e)t=i;else if("SHA-384"===e)t=[i[0].a,i[0].b,i[1].a,i[1].b,i[2].a,i[2].b,i[3].a,i[3].b,i[4].a,i[4].b,i[5].a,i[5].b];else{if("SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");t=[i[0].a,i[0].b,i[1].a,i[1].b,i[2].a,i[2].b,i[3].a,i[3].b,i[4].a,i[4].b,i[5].a,i[5].b,i[6].a,i[6].b,i[7].a,i[7].b]}return t},P=function(e){return e.slice()},"SHA-224"===e)p=512,a=224;else if("SHA-256"===e)p=512,a=256;else if("SHA-384"===e)p=1024,a=384;else{if("SHA-512"!==e)throw Error("Chosen SHA variant is not supported");p=1024,a=512}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("Chosen SHA variant is not supported");var O=6;if(w=B,P=function(e){var t,n=[];for(t=0;5>t;t+=1)n[t]=e[t].slice();return n},C=1,"SHA3-224"===e)p=1152,a=224;else if("SHA3-256"===e)p=1088,a=256;else if("SHA3-384"===e)p=832,a=384;else if("SHA3-512"===e)p=576,a=512;else if("SHAKE128"===e)p=1344,a=-1,O=31,M=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");p=1088,a=-1,O=31,M=!0}v=function(e,t,n,r,i){var o,a=O,s=[],u=(n=p)>>>5,c=0,l=t>>>5;for(o=0;o<l&&t>=n;o+=u)r=B(e.slice(o,o+u),r),t-=n;for(e=e.slice(o),t%=n;e.length<u;)e.push(0);for(e[(o=t>>>3)>>2]^=a<<o%4*8,e[u-1]^=2147483648,r=B(e,r);32*s.length<i&&(e=r[c%5][c/5|0],s.push(e.b),!(32*s.length>=i));)s.push(e.a),0==64*(c+=1)%n&&B(null,r);return s}}o=h(t,r,C),i=R(e),this.setHMACKey=function(t,n,o){var s;if(!0===b)throw Error("HMAC key already set");if(!0===S)throw Error("Cannot set HMAC key after calling update");if(!0===M)throw Error("SHAKE is not supported for HMAC");if(t=(n=h(n,r=(o||{}).encoding||"UTF8",C)(t)).binLen,n=n.value,o=(s=p>>>3)/4-1,s<t/8){for(n=v(n,t,0,R(e),a);n.length<=o;)n.push(0);n[o]&=4294967040}else if(s>t/8){for(;n.length<=o;)n.push(0);n[o]&=4294967040}for(t=0;t<=o;t+=1)W[t]=909522486^n[t],I[t]=1549556828^n[t];i=w(W,i),g=p,b=!0},this.update=function(e){var t,n,r,a=0,s=p>>>5;for(e=(t=o(e,m,A)).binLen,n=t.value,t=e>>>5,r=0;r<t;r+=s)a+p<=e&&(i=w(n.slice(r,r+s),i),a+=p);g+=a,m=n.slice(a>>>5),A=e%p,S=!0},this.getHash=function(t,n){var r,o,h,p;if(!0===b)throw Error("Cannot call getHash after setting HMAC key");if(h=f(n),!0===M){if(-1===h.shakeLen)throw Error("shakeLen must be specified in options");a=h.shakeLen}switch(t){case"HEX":r=function(e){return s(e,a,C,h)};break;case"B64":r=function(e){return u(e,a,C,h)};break;case"BYTES":r=function(e){return c(e,a,C)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{o=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return d(e,a,C)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(p=v(m.slice(),A,g,P(i),a),o=1;o<y;o+=1)!0===M&&0!=a%32&&(p[p.length-1]&=16777215>>>24-a%32),p=v(p,a,0,R(e),a);return r(p)},this.getHMAC=function(t,n){var r,o,h,y;if(!1===b)throw Error("Cannot call getHMAC without first setting HMAC key");switch(h=f(n),t){case"HEX":r=function(e){return s(e,a,C,h)};break;case"B64":r=function(e){return u(e,a,C,h)};break;case"BYTES":r=function(e){return c(e,a,C)};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{r=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return d(e,a,C)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return o=v(m.slice(),A,g,P(i),a),y=w(I,R(e)),r(y=v(o,a,p,y,a))}}function o(e,t){this.a=e,this.b=t}function a(e,t,n,r){var i,o,a,s,u;for(t=t||[0],o=(n=n||0)>>>3,u=-1===r?3:0,i=0;i<e.length;i+=1)a=(s=i+o)>>>2,t.length<=a&&t.push(0),t[a]|=e[i]<<8*(u+s%4*r);return{value:t,binLen:8*e.length+n}}function s(e,t,n,r){var i,o,a,s="";for(t/=8,a=-1===n?3:0,i=0;i<t;i+=1)o=e[i>>>2]>>>8*(a+i%4*n),s+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return r.outputUpper?s.toUpperCase():s}function u(e,t,n,r){var i,o,a,s,u="",c=t/8;for(s=-1===n?3:0,i=0;i<c;i+=3)for(o=i+1<c?e[i+1>>>2]:0,a=i+2<c?e[i+2>>>2]:0,a=(e[i>>>2]>>>8*(s+i%4*n)&255)<<16|(o>>>8*(s+(i+1)%4*n)&255)<<8|a>>>8*(s+(i+2)%4*n)&255,o=0;4>o;o+=1)u+=8*i+6*o<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-o)&63):r.b64Pad;return u}function c(e,t,n){var r,i,o,a="";for(t/=8,o=-1===n?3:0,r=0;r<t;r+=1)i=e[r>>>2]>>>8*(o+r%4*n)&255,a+=String.fromCharCode(i);return a}function l(e,t,n){t/=8;var r,i,o,a=new ArrayBuffer(t);for(o=new Uint8Array(a),i=-1===n?3:0,r=0;r<t;r+=1)o[r]=e[r>>>2]>>>8*(i+r%4*n)&255;return a}function d(e,t,n){t/=8;var r,i,o=new Uint8Array(t);for(i=-1===n?3:0,r=0;r<t;r+=1)o[r]=e[r>>>2]>>>8*(i+r%4*n)&255;return o}function f(e){var t={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty("b64Pad")&&(t.b64Pad=e.b64Pad),!0===e.hasOwnProperty("shakeLen")){if(0!=e.shakeLen%8)throw Error("shakeLen must be a multiple of 8");t.shakeLen=e.shakeLen}if("boolean"!=typeof t.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw Error("Invalid b64Pad formatting option");return t}function h(e,t,n){switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":e=function(e,t,r){var i,o,a,s,u,c,l=e.length;if(0!=l%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],u=(r=r||0)>>>3,c=-1===n?3:0,i=0;i<l;i+=2){if(o=parseInt(e.substr(i,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(a=(s=(i>>>1)+u)>>>2;t.length<=a;)t.push(0);t[a]|=o<<8*(c+s%4*n)}return{value:t,binLen:4*l+r}};break;case"TEXT":e=function(e,r,i){var o,a,s,u,c,l,d,f,h=0;if(r=r||[0],c=(i=i||0)>>>3,"UTF8"===t)for(f=-1===n?3:0,s=0;s<e.length;s+=1)for(a=[],128>(o=e.charCodeAt(s))?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(s)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),u=0;u<a.length;u+=1){for(l=(d=h+c)>>>2;r.length<=l;)r.push(0);r[l]|=a[u]<<8*(f+d%4*n),h+=1}else if("UTF16BE"===t||"UTF16LE"===t)for(f=-1===n?2:0,a="UTF16LE"===t&&1!==n||"UTF16LE"!==t&&1===n,s=0;s<e.length;s+=1){for(o=e.charCodeAt(s),!0===a&&(o=(u=255&o)<<8|o>>>8),l=(d=h+c)>>>2;r.length<=l;)r.push(0);r[l]|=o<<8*(f+d%4*n),h+=2}return{value:r,binLen:8*h+i}};break;case"B64":e=function(e,t,r){var i,o,a,s,u,c,l,d,f=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=e.indexOf("="),e=e.replace(/\=/g,""),-1!==o&&o<e.length)throw Error("Invalid '=' found in base-64 string");for(t=t||[0],c=(r=r||0)>>>3,d=-1===n?3:0,o=0;o<e.length;o+=4){for(u=e.substr(o,4),a=s=0;a<u.length;a+=1)s|=(i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(u.charAt(a)))<<18-6*a;for(a=0;a<u.length-1;a+=1){for(i=(l=f+c)>>>2;t.length<=i;)t.push(0);t[i]|=(s>>>16-8*a&255)<<8*(d+l%4*n),f+=1}}return{value:t,binLen:8*f+r}};break;case"BYTES":e=function(e,t,r){var i,o,a,s,u,c;for(t=t||[0],a=(r=r||0)>>>3,c=-1===n?3:0,o=0;o<e.length;o+=1)i=e.charCodeAt(o),s=(u=o+a)>>>2,t.length<=s&&t.push(0),t[s]|=i<<8*(c+u%4*n);return{value:t,binLen:8*e.length+r}};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}e=function(e,t,r){return a(new Uint8Array(e),t,r,n)};break;case"UINT8ARRAY":try{e=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}e=function(e,t,r){return a(e,t,r,n)};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return e}function p(e,t){return e<<t|e>>>32-t}function w(e,t){return 32<t?(t-=32,new o(e.b<<t|e.a>>>32-t,e.a<<t|e.b>>>32-t)):0!==t?new o(e.a<<t|e.b>>>32-t,e.b<<t|e.a>>>32-t):e}function v(e,t){return e>>>t|e<<32-t}function P(e,t){var n;return n=new o(e.a,e.b),32>=t?new o(n.a>>>t|n.b<<32-t&4294967295,n.b>>>t|n.a<<32-t&4294967295):new o(n.b>>>t-32|n.a<<64-t&4294967295,n.a>>>t-32|n.b<<64-t&4294967295)}function y(e,t){return 32>=t?new o(e.a>>>t,e.b>>>t|e.a<<32-t&4294967295):new o(0,e.a>>>t-32)}function g(e,t,n){return e&t^~e&n}function m(e,t,n){return new o(e.a&t.a^~e.a&n.a,e.b&t.b^~e.b&n.b)}function A(e,t,n){return e&t^e&n^t&n}function b(e,t,n){return new o(e.a&t.a^e.a&n.a^t.a&n.a,e.b&t.b^e.b&n.b^t.b&n.b)}function W(e){return v(e,2)^v(e,13)^v(e,22)}function I(e){var t=P(e,28),n=P(e,34);return e=P(e,39),new o(t.a^n.a^e.a,t.b^n.b^e.b)}function S(e){return v(e,6)^v(e,11)^v(e,25)}function M(e){var t=P(e,14),n=P(e,18);return e=P(e,41),new o(t.a^n.a^e.a,t.b^n.b^e.b)}function C(e){return v(e,7)^v(e,18)^e>>>3}function O(e){var t=P(e,1),n=P(e,8);return e=y(e,7),new o(t.a^n.a^e.a,t.b^n.b^e.b)}function E(e){return v(e,17)^v(e,19)^e>>>10}function _(e){var t=P(e,19),n=P(e,61);return e=y(e,6),new o(t.a^n.a^e.a,t.b^n.b^e.b)}function x(e,t){var n=(65535&e)+(65535&t);return((e>>>16)+(t>>>16)+(n>>>16)&65535)<<16|65535&n}function j(e,t,n,r){var i=(65535&e)+(65535&t)+(65535&n)+(65535&r);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)&65535)<<16|65535&i}function k(e,t,n,r,i){var o=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&i);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)+(o>>>16)&65535)<<16|65535&o}function T(e,t){var n,r,i;return n=(65535&e.b)+(65535&t.b),i=(65535&(r=(e.b>>>16)+(t.b>>>16)+(n>>>16)))<<16|65535&n,n=(65535&e.a)+(65535&t.a)+(r>>>16),new o((65535&(r=(e.a>>>16)+(t.a>>>16)+(n>>>16)))<<16|65535&n,i)}function U(e,t,n,r){var i,a,s;return i=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b),s=(65535&(a=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(i>>>16)))<<16|65535&i,i=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(a>>>16),new o((65535&(a=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(i>>>16)))<<16|65535&i,s)}function L(e,t,n,r,i){var a,s,u;return a=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b)+(65535&i.b),u=(65535&(s=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(i.b>>>16)+(a>>>16)))<<16|65535&a,a=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(65535&i.a)+(s>>>16),new o((65535&(s=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(i.a>>>16)+(a>>>16)))<<16|65535&a,u)}function N(e,t){return new o(e.a^t.a,e.b^t.b)}function R(e){var t,n=[];if("SHA-1"===e)n=[1732584193,4023233417,2562383102,271733878,3285377520];else if(0===e.lastIndexOf("SHA-",0))switch(n=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],t=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],e){case"SHA-224":break;case"SHA-256":n=t;break;case"SHA-384":n=[new o(3418070365,n[0]),new o(1654270250,n[1]),new o(2438529370,n[2]),new o(355462360,n[3]),new o(1731405415,n[4]),new o(41048885895,n[5]),new o(3675008525,n[6]),new o(1203062813,n[7])];break;case"SHA-512":n=[new o(t[0],4089235720),new o(t[1],2227873595),new o(t[2],4271175723),new o(t[3],1595750129),new o(t[4],2917565137),new o(t[5],725511199),new o(t[6],4215389547),new o(t[7],327033209)];break;default:throw Error("Unknown SHA variant")}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("No SHA variants supported");for(e=0;5>e;e+=1)n[e]=[new o(0,0),new o(0,0),new o(0,0),new o(0,0),new o(0,0)]}return n}function F(e,t){var n,r,i,o,a,s,u,c=[];for(n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=0;80>u;u+=1)c[u]=16>u?e[u]:p(c[u-3]^c[u-8]^c[u-14]^c[u-16],1),s=20>u?k(p(n,5),r&i^~r&o,a,1518500249,c[u]):40>u?k(p(n,5),r^i^o,a,1859775393,c[u]):60>u?k(p(n,5),A(r,i,o),a,2400959708,c[u]):k(p(n,5),r^i^o,a,3395469782,c[u]),a=o,o=i,i=p(r,30),r=n,n=s;return t[0]=x(n,t[0]),t[1]=x(r,t[1]),t[2]=x(i,t[2]),t[3]=x(o,t[3]),t[4]=x(a,t[4]),t}function H(e,t,n,r){var i;for(i=15+(t+65>>>9<<4);e.length<=i;)e.push(0);for(e[t>>>5]|=128<<24-t%32,t+=n,e[i]=4294967295&t,e[i-1]=t/4294967296|0,t=e.length,i=0;i<t;i+=16)r=F(e.slice(i,i+16),r);return r}function z(e,t,n){var r,i,a,s,u,c,l,d,f,h,p,w,v,P,y,N,R,F,H,z,B,Y,V,q=[];if("SHA-224"===n||"SHA-256"===n)h=64,w=1,Y=Number,v=x,P=j,y=k,N=C,R=E,F=W,H=S,B=A,z=g,V=D;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");h=80,w=2,Y=o,v=T,P=U,y=L,N=O,R=_,F=I,H=M,B=b,z=m,V=G}for(n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],p=0;p<h;p+=1)16>p?(f=p*w,d=e.length<=f?0:e[f],f=e.length<=f+1?0:e[f+1],q[p]=new Y(d,f)):q[p]=P(R(q[p-2]),q[p-7],N(q[p-15]),q[p-16]),d=y(l,H(s),z(s,u,c),V[p],q[p]),f=v(F(n),B(n,r,i)),l=c,c=u,u=s,s=v(a,d),a=i,i=r,r=n,n=v(d,f);return t[0]=v(n,t[0]),t[1]=v(r,t[1]),t[2]=v(i,t[2]),t[3]=v(a,t[3]),t[4]=v(s,t[4]),t[5]=v(u,t[5]),t[6]=v(c,t[6]),t[7]=v(l,t[7]),t}function B(e,t){var n,r,i,a,s=[],u=[];if(null!==e)for(r=0;r<e.length;r+=2)t[(r>>>1)%5][(r>>>1)/5|0]=N(t[(r>>>1)%5][(r>>>1)/5|0],new o(e[r+1],e[r]));for(n=0;24>n;n+=1){for(a=R("SHA3-"),r=0;5>r;r+=1){i=t[r][0];var c=t[r][1],l=t[r][2],d=t[r][3],f=t[r][4];s[r]=new o(i.a^c.a^l.a^d.a^f.a,i.b^c.b^l.b^d.b^f.b)}for(r=0;5>r;r+=1)u[r]=N(s[(r+4)%5],w(s[(r+1)%5],1));for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)t[r][i]=N(t[r][i],u[r]);for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)a[i][(2*r+3*i)%5]=w(t[r][i],Y[r][i]);for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)t[r][i]=N(a[r][i],new o(~a[(r+1)%5][i].a&a[(r+2)%5][i].a,~a[(r+1)%5][i].b&a[(r+2)%5][i].b));t[0][0]=N(t[0][0],V[n])}return t}var D,G,Y,V;G=[new o((D=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])[0],3609767458),new o(D[1],602891725),new o(D[2],3964484399),new o(D[3],2173295548),new o(D[4],4081628472),new o(D[5],3053834265),new o(D[6],2937671579),new o(D[7],3664609560),new o(D[8],2734883394),new o(D[9],1164996542),new o(D[10],1323610764),new o(D[11],3590304994),new o(D[12],4068182383),new o(D[13],991336113),new o(D[14],633803317),new o(D[15],3479774868),new o(D[16],2666613458),new o(D[17],944711139),new o(D[18],2341262773),new o(D[19],2007800933),new o(D[20],1495990901),new o(D[21],1856431235),new o(D[22],3175218132),new o(D[23],2198950837),new o(D[24],3999719339),new o(D[25],766784016),new o(D[26],2566594879),new o(D[27],3203337956),new o(D[28],1034457026),new o(D[29],2466948901),new o(D[30],3758326383),new o(D[31],168717936),new o(D[32],1188179964),new o(D[33],1546045734),new o(D[34],1522805485),new o(D[35],2643833823),new o(D[36],2343527390),new o(D[37],1014477480),new o(D[38],1206759142),new o(D[39],344077627),new o(D[40],1290863460),new o(D[41],3158454273),new o(D[42],3505952657),new o(D[43],106217008),new o(D[44],3606008344),new o(D[45],1432725776),new o(D[46],1467031594),new o(D[47],851169720),new o(D[48],3100823752),new o(D[49],1363258195),new o(D[50],3750685593),new o(D[51],3785050280),new o(D[52],3318307427),new o(D[53],3812723403),new o(D[54],2003034995),new o(D[55],3602036899),new o(D[56],1575990012),new o(D[57],1125592928),new o(D[58],2716904306),new o(D[59],442776044),new o(D[60],593698344),new o(D[61],3733110249),new o(D[62],2999351573),new o(D[63],3815920427),new o(3391569614,3928383900),new o(3515267271,566280711),new o(3940187606,3454069534),new o(4118630271,4000239992),new o(116418474,1914138554),new o(174292421,2731055270),new o(289380356,3203993006),new o(460393269,320620315),new o(685471733,587496836),new o(852142971,1086792851),new o(1017036298,365543100),new o(1126000580,2618297676),new o(1288033470,3409855158),new o(1501505948,4234509866),new o(1607167915,987167468),new o(1816402316,1246189591)],V=[new o(0,1),new o(0,32898),new o(2147483648,32906),new o(2147483648,2147516416),new o(0,32907),new o(0,2147483649),new o(2147483648,2147516545),new o(2147483648,32777),new o(0,138),new o(0,136),new o(0,2147516425),new o(0,2147483658),new o(0,2147516555),new o(2147483648,139),new o(2147483648,32905),new o(2147483648,32771),new o(2147483648,32770),new o(2147483648,128),new o(0,32778),new o(2147483648,2147483658),new o(2147483648,2147516545),new o(2147483648,32896),new o(0,2147483649),new o(2147483648,2147516424)],Y=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]],void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},496(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(){var e;return e=function*(e){return yield new Promise((t,n)=>{var r=new XMLHttpRequest;r.onload=function(){if(4==r.readyState)if(200==r.status){var e=new FileReader;e.readAsDataURL(r.response),e.onload=function(n){t(e.result.substr(e.result.indexOf(",")+1))}}else console.error(r.statusText);else t(!1)},r.open("GET",e,!0),r.responseType="blob",r.send(null)})},i=function(){var t=this,n=arguments;return new Promise(function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)})},i.apply(this,arguments)}function o(e,t){var n=e.split(","),r=n[0].match(/(?:data:)?(.*?)(?:;base64)?$/i)[1];r=r.split(/\s+;\s+/).join("; ");for(var i=window.Base64?window.Base64.atob(n[1]):atob(n[1]),o=i.length,a=new Uint8Array(o);o--;)a[o]=i.charCodeAt(o);return new File([a],t,{type:r})}var a=n(730);function s(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function u(e){return c.apply(this,arguments)}function c(){var e;return e=function*(e){var t=yield e.arrayBuffer(),n=new a("SHA-256","ARRAYBUFFER");return n.update(t),n.getHash("B64")},c=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,u,"next",e)}function u(e){s(o,r,i,a,u,"throw",e)}a(void 0)})},c.apply(this,arguments)}function l(e){for(var t="",n=0;n<e;n++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function w(){var e;return e=function*(e,t){var n=yield u(t),r=l(32),i=(new AbortController).signal,o=yield window.Store.UploadUtils.encryptAndUpload({blob:t,type:e,signal:i,mediaKey:r});return f(f({},o),{},{clientUrl:o.url,filehash:n,id:n,uploadhash:o.encFilehash,mediaBlob:t})},w=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){p(o,r,i,a,s,"next",e)}function s(e){p(o,r,i,a,s,"throw",e)}a(void 0)})},w.apply(this,arguments)}function v(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function P(){var e;return e=function*(e){var t=[];e?t.push(WAPI.getAllChatsWithNewMsg().map(e=>WAPI.getChat(e.id._serialized))):t.push(WAPI.getAllChatIds().map(e=>WAPI.getChat(e)));var n=(yield Promise.all(t)).flatMap(e=>e),r=JSON.stringify(n);return JSON.parse(r)},P=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){v(o,r,i,a,s,"next",e)}function s(e){v(o,r,i,a,s,"throw",e)}a(void 0)})},P.apply(this,arguments)}function y(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){y(o,r,i,a,s,"next",e)}function s(e){y(o,r,i,a,s,"throw",e)}a(void 0)})}}var m=function(){var e=g(function*(){var e=yield Promise.all(WPP.whatsapp.ContactStore.map(function(){var e=g(function*(e){return yield WAPI._serializeContactObj(e)});return function(t){return e.apply(this,arguments)}}()));return e});return function(){return e.apply(this,arguments)}}();function A(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function b(){var e;return e=function*(e,t,n,r){var i=yield WAPI.sendExist(e),o=[];if(!i.erro){var a=i.msgs.getModelsArray();for(var s in a)if("remove"!==s){var u=a[s],c=WAPI.processMessageObj(u,t,n);c&&o.push(c)}}return void 0!==r&&r(o),o},b=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){A(o,r,i,a,s,"next",e)}function s(e){A(o,r,i,a,s,"throw",e)}a(void 0)})},b.apply(this,arguments)}var W=function(e){return e.unreadCount>0},I=function(e){var t=WPP.whatsapp.ChatStore.filter(W).map(e=>WAPI._serializeChatObj(e));return void 0!==e&&e(t),t};function S(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var M=function(){var e,t=(e=function*(){var e=I().map(e=>WPP.chat.getMessages(e.id,{count:e.unreadCount}));return(yield Promise.all(e)).flat().map(WAPI._serializeMessageObj)},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){S(o,r,i,a,s,"next",e)}function s(e){S(o,r,i,a,s,"throw",e)}a(void 0)})});return function(){return t.apply(this,arguments)}}();function C(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function O(){var e;return e=function*(e,t){var n=yield WAPI.getChat(e);return n=!!n&&WAPI._serializeChatObj(n),void 0!==t&&t(n),n},O=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){C(o,r,i,a,s,"next",e)}function s(e){C(o,r,i,a,s,"throw",e)}a(void 0)})},O.apply(this,arguments)}function E(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function _(){var e;return e=function*(e,t){var n=[],r=window.WAPI.getAllGroups();for(var i in r)try{(yield window.WAPI.getGroupParticipantIDs(r[i].id)).filter(t=>t==e).length&&n.push(r[i])}catch(e){console.log("Error in group:"),console.log(r[i]),console.log(e)}return void 0!==t&&t(n),n},_=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){E(o,r,i,a,s,"next",e)}function s(e){E(o,r,i,a,s,"throw",e)}a(void 0)})},_.apply(this,arguments)}function x(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function j(){var e;return e=function*(e,t){var n=WPP.whatsapp.GroupMetadataStore.find(e);return void 0!==t&&t(n),n},j=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){x(o,r,i,a,s,"next",e)}function s(e){x(o,r,i,a,s,"throw",e)}a(void 0)})},j.apply(this,arguments)}function k(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function T(){var e;return e=function*(e,t){var n=yield Promise.resolve(WPP.group.getParticipants()).then(e=>e.map(e=>e.id));return void 0!==t&&t(n),n},T=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){k(o,r,i,a,s,"next",e)}function s(e){k(o,r,i,a,s,"throw",e)}a(void 0)})},T.apply(this,arguments)}function U(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function L(){var e;return e=function*(e){return(yield WAPI.getGroupMetadata(e)).participants},L=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){U(o,r,i,a,s,"next",e)}function s(e){U(o,r,i,a,s,"throw",e)}a(void 0)})},L.apply(this,arguments)}function N(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function R(){var e;return e=function*(e,t){var n=yield WPP.contact.queryExists(e);if(!n||void 0===n.wid)throw 404;var r=window.WAPI._serializeNumberStatusObj({jid:n.wid,status:200,isBusiness:n.biz});return 200==r.status&&(r.numberExists=!0),void 0!==t&&(t(window.WAPI._serializeNumberStatusObj(n)),t(r)),r},R=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){N(o,r,i,a,s,"next",e)}function s(e){N(o,r,i,a,s,"throw",e)}a(void 0)})},R.apply(this,arguments)}function F(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function H(e,t){return z.apply(this,arguments)}function z(){var e;return e=function*(e,t){var n=WAPI.getChat(e);if(!n)return t&&t(!1),!1;try{yield WPP.whatsapp.MsgStore.findQuery({remote:n.id,count:-1})}catch(e){}for(;!n.msgs.msgLoadState.noEarlierMsgs;)yield n.loadEarlierMsgs();return t&&t(!0),!0},z=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){F(o,r,i,a,s,"next",e)}function s(e){F(o,r,i,a,s,"throw",e)}a(void 0)})},z.apply(this,arguments)}function B(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function D(){var e;return e=function*(e,t,n,r){return WAPI.loadAllEarlierMessages(e).then(i=>{var o=WAPI.getChat(e);if(!o)throw{error:!0,code:"chat_not_found",message:"Chat not found"};var a=[],s=o.msgs.getModelsArray();for(var u in s)if("remove"!==u){var c=s[u],l=WAPI.processMessageObj(c,t,n);l&&a.push(l)}return void 0!==r&&r(a),a})},D=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){B(o,r,i,a,s,"next",e)}function s(e){B(o,r,i,a,s,"throw",e)}a(void 0)})},D.apply(this,arguments)}function G(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Y(){var e;return e=function*(e){var t=WAPI.getChat(e);if(t){var n=yield t.loadEarlierMsgs();if(n)return n.map(WAPI._serializeMessageObj)}return!1},Y=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){G(o,r,i,a,s,"next",e)}function s(e){G(o,r,i,a,s,"throw",e)}a(void 0)})},Y.apply(this,arguments)}function V(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function q(e,t){return J.apply(this,arguments)}function J(){var e;return e=function*(e,t){Array.isArray(t)||(t=[t]);var n=new Store.MediaCollection({chatParticipantCount:e.getParticipantCount()});return yield n.processAttachments("0.4.613"===Debug.VERSION?t:t.map(e=>({file:e})),e,1),n},J=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){V(o,r,i,a,s,"next",e)}function s(e){V(o,r,i,a,s,"throw",e)}a(void 0)})},J.apply(this,arguments)}function K(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Q(){var e;return e=function*(e,t){e=parseInt(e,10);var n=WPP.whatsapp.ChatStore.get(t);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};switch(e){case 0:window.Store.ChatStates.sendChatStateComposing(n.id);break;case 1:window.Store.ChatStates.sendChatStateRecording(n.id);break;case 2:window.Store.ChatStates.sendChatStatePaused(n.id);break;default:return!1}return!0},Q=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){K(o,r,i,a,s,"next",e)}function s(e){K(o,r,i,a,s,"throw",e)}a(void 0)})},Q.apply(this,arguments)}function X(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Z(e,t){return $.apply(this,arguments)}function $(){var e;return e=function*(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("object"==typeof e&&e._serialized&&(e=e._serialized),"string"!=typeof e)return!1;var r=yield WPP.chat.getMessageById(e);if(!r)return!1;var i=!1;if(n)try{i=WAPI.processMessageObj(r,!0,!0)}catch(e){}else i=r;if("function"!=typeof t)return i;t(i)},$=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){X(o,r,i,a,s,"next",e)}function s(e){X(o,r,i,a,s,"throw",e)}a(void 0)})},$.apply(this,arguments)}function ee(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function te(e,t,n,r,i){return ne.apply(this,arguments)}function ne(){var e;return e=function*(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(i=i||"sendFile","string"!=typeof n&&null!=n||"string"!=typeof r&&null!=r)return WAPI.scope(t,!0,null,"incorrect parameter, insert an string.");var u=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);u&&u.length&&(u=u[1]);var c=yield WAPI.sendExist(t);if(c.erro)return c;var l=null;if("string"==typeof a&&a){var d=yield Z(a,null,!1);d&&d.canReply()&&(l=d)}var f=o(e,n),h=(yield q(c,f)).getModelsArray()[0],p=(yield h.sendToChat(c,{caption:r,quotedMsg:l,isViewOnce:s}))||"",w={type:i,filename:n,text:r,mimeType:u},v=yield WAPI.getchatId(c.id);if("success"===p||"OK"===p){var P=WAPI.scope(v,!1,p,null);return Object.assign(P,w),P}return P=WAPI.scope(v,!0,p,null),Object.assign(P,w),P},ne=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ee(o,r,i,a,s,"next",e)}function s(e){ee(o,r,i,a,s,"throw",e)}a(void 0)})},ne.apply(this,arguments)}function re(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ie(){var e;return e=function*(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=yield WAPI.sendExist(t);if(s.erro)return s;var u=null;if("string"==typeof a&&a){var c=yield Z(a,null,!1);c&&c.canReply()&&(u=c)}var l=o(e,n),d=(yield q(s,l)).getModelsArray()[0];d.mediaPrep._mediaData.type="ptt";var f=(yield d.sendToChat(s,{caption:r,quotedMsg:u}))||"";void 0!==i&&i(!0);var h={type:"ptt",filename:n,text:r},p=yield WAPI.getchatId(s.id);if("success"===f||"OK"===f){var w=WAPI.scope(p,!1,f,null);return Object.assign(w,h),w}return w=WAPI.scope(p,!0,f,null),Object.assign(w,h),w},ie=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){re(o,r,i,a,s,"next",e)}function s(e){re(o,r,i,a,s,"throw",e)}a(void 0)})},ie.apply(this,arguments)}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ae(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function se(){var e;return e=function*(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=yield WAPI.sendExist(e);if(i.erro)return i;var o,a={ack:0,id:WPP.chat.generateMessageID(i.id),local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:i.id,isNewMsg:!0,type:"location",lat:t,lng:n,loc:r},s=(yield Promise.all(WPP.whatsapp.functions.addAndSendMsgToChat(i,a)))[1]||"",u={latitude:t,longitude:n,title:r,type:"location"},c=yield WAPI.getchatId(i.id);return"success"==s||"OK"==s?(o=WAPI.scope(c,!1,s,null),Object.assign(o,u),o):(o=WAPI.scope(c,!0,s,null),Object.assign(o,u),o)},se=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ae(o,r,i,a,s,"next",e)}function s(e){ae(o,r,i,a,s,"throw",e)}a(void 0)})},se.apply(this,arguments)}function ue(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ce(){var e;return e=function*(e,t){var n=yield WAPI.sendExist(e);if(n.erro)return n;var r=WPP.chat.generateMessageID(n.id),i={id:r,body:t,type:"chat",subtype:null,t:parseInt((new Date).getTime()/1e3),from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:n.id,self:"out",isNewMsg:!0,local:!0,ack:0,urlText:null,urlNumber:null},o=(yield Promise.all(WPP.whatsapp.functions.addAndSendMsgToChat(n,i)))[1]||"";if("success"===o||"OK"===o)return null==r?void 0:r._serialized;var a={type:"sendtext",text:i},s=yield WAPI.getchatId(n.id),u=WAPI.scope(s,!0,o,null);return Object.assign(u,a),u},ce=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ue(o,r,i,a,s,"next",e)}function s(e){ue(o,r,i,a,s,"throw",e)}a(void 0)})},ce.apply(this,arguments)}function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach(function(t){fe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fe(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function he(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function pe(){var e;return e=function*(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=WPP.chat.get(e)||(yield WPP.chat.find(e)),i={};n.attachment&&(t=(i=yield WWebJS.processMediaData(n.attachment,n.sendAudioAsVoice)).preview,delete n.attachment);var o={};if(n.quotedMessageId){var a=yield Z(n.quotedMessageId,null,!1);a&&a.canReply()&&(o=a.msgContextInfo(r)),delete n.quotedMessageId}n.mentionedJidList&&(n.mentionedJidList=n.mentionedJidList.map(e=>WPP.whatsapp.ContactStore.get(e).id));var s={};n.location&&(s={type:"location",loc:n.location.description,lat:n.location.latitude,lng:n.location.longitude},delete n.location);var u={};if(n.contactCard){var c=WPP.whatsapp.ContactStore.get(n.contactCard);u={body:WPP.whatsapp.VCard.vcardFromContactModel(c).vcard,type:"vcard",vcardFormattedName:c.formattedName},delete n.contactCard}else if(n.contactCardList)u={type:"multi_vcard",vcardList:n.contactCardList.map(e=>WPP.whatsapp.ContactStore.get(e)).map(e=>WPP.whatsapp.VCard.vcardFromContactModel(e)),body:void 0},delete n.contactCardList;else if(n.parseVCards&&"string"==typeof t&&t.startsWith("BEGIN:VCARD")){delete n.parseVCards;try{var l=yield WPP.whatsapp.VCard.parseVcard(t);l&&(u={type:"vcard",vcardFormattedName:yield WPP.whatsapp.VCard.vcardGetNameFromParsed(l)})}catch(e){}}if(n.linkPreview){delete n.linkPreview;var d=yield window.Store.Validators.findLink(t);if(d&&!WPP.conn.isMultiDevice()){var f=yield WPP.whatsapp.functions.queryLinkPreview(d.url);f.preview=!0,f.subtype="url",n=de(de({},n),f)}}var h=WPP.chat.generateMessageID(r.id),p=de(de(de(de(de({id:h,ack:0,body:t,from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:r.id,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),isNewMsg:!0,type:"chat"},n),s),i),o),u);return yield WPP.whatsapp.functions.addAndSendMsgToChat(r,p),h._serialized},pe=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){he(o,r,i,a,s,"next",e)}function s(e){he(o,r,i,a,s,"throw",e)}a(void 0)})},pe.apply(this,arguments)}function we(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ve(){var e;return e=function*(e,t){var n=e.id?e:WPP.whatsapp.ChatStore.get(e),r=n.id._serialized,i=n.msgs.filter(e=>e.__x_isSentByMe)[0];if(!i)return n.sendMessage(t);var o=Object.create(i),a=WPP.chat.generateMessageID(r),s=t.match(/@(\d*)/g).map(e=>new WPP.whatsapp.WidFactory.createUserWid(e.replace("@","")))||void 0,u={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),to:new WPP.whatsapp.WidFactory.createWid(r),isNewMsg:!0,type:"chat",body:t,quotedMsg:null,mentionedJidList:s};return Object.assign(o,u),yield WPP.whatsapp.functions.addAndSendMsgToChat(n,o),a._serialized},ve=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){we(o,r,i,a,s,"next",e)}function s(e){we(o,r,i,a,s,"throw",e)}a(void 0)})},ve.apply(this,arguments)}function Pe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ye(){var e;return e=function*(e,t,n,r,i){var a=yield WAPI.sendExist(t);if(a.erro)return a;var s=o(e,n),u=(yield q(a,s)).getModelsArray()[0];u.mediaPrep._mediaData.isGif=!0,u.mediaPrep._mediaData.gifAttribution=1;var c=(yield u.sendToChat(a,{caption:r}))||"",l={filename:n,text:r},d=yield WAPI.getchatId(a.id);if("success"===c||"OK"===c){void 0!==i&&i(!1);var f=WAPI.scope(d,!1,c,null);return Object.assign(f,l),f}return void 0!==i&&i(!0),f=WAPI.scope(d,!0,c,null),Object.assign(f,l),f},ye=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Pe(o,r,i,a,s,"next",e)}function s(e){Pe(o,r,i,a,s,"throw",e)}a(void 0)})},ye.apply(this,arguments)}function ge(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function me(){var e;return e=function*(e){yield window.Store.Perfil.setPushname(e)},me=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ge(o,r,i,a,s,"next",e)}function s(e){ge(o,r,i,a,s,"throw",e)}a(void 0)})},me.apply(this,arguments)}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function be(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function We(){var e;return e=function*(e,t,n){Array.isArray(t)||(t=[t]),yield WAPI.sendExist(e);var r=WPP.whatsapp.ChatStore.get(e);if(!r)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};var i,o=[],a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ae(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ae(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(a.s();!(i=a.n()).done;){var s=i.value,u="string"==typeof s?s:s.id,c=yield Z(u,null,!1);if(!c)throw{error:!0,code:"message_not_found",message:"Message not Found",messageId:u};o.push(c)}}catch(e){a.e(e)}finally{a.f()}var l=o.filter(e=>!n||!e.isSentByMe);return yield r.forwardMessages(l),yield new Promise(e=>setTimeout(e,100)),r.msgs.getModelsArray().slice(-1*t.length).map(e=>e.id._serialized)},We=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){be(o,r,i,a,s,"next",e)}function s(e){be(o,r,i,a,s,"throw",e)}a(void 0)})},We.apply(this,arguments)}function Ie(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Se(){var e;return e=function*(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=yield WPP.chat.getMessages(e,t);if(!Array.isArray(n)){var r=new Error("Failed to fetch messages for ".concat(e));throw Object.assign(r,n),r}return n.map(e=>new WPP.whatsapp.MsgStore.modelClass(e)).map(e=>WAPI.processMessageObj(e,!0,!0))},Se=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Ie(o,r,i,a,s,"next",e)}function s(e){Ie(o,r,i,a,s,"throw",e)}a(void 0)})},Se.apply(this,arguments)}function Me(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ce(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Me(o,r,i,a,s,"next",e)}function s(e){Me(o,r,i,a,s,"throw",e)}a(void 0)})}}function Oe(){return(Oe=Ce(function*(e){return"dark"==e||"light"==e?(yield Store.Theme.setTheme(e),!0):console.error("Use type dark or light")})).apply(this,arguments)}function Ee(){return(Ee=Ce(function*(){return yield Store.Theme.getTheme()})).apply(this,arguments)}function _e(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function xe(){var e;return e=function*(e,t,n){n=n||"";var r={Protocol:"^(https?:\\/\\/)?",Domain:"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|",IP:"((\\d{1,3}\\.){3}\\d{1,3}))",Port:"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*",Query:"(\\?[;&a-z\\d%_.~+=-]*)?",End:"(\\#[-a-z\\d_]*)?$",Reg:()=>new RegExp(r.Protocol+r.Domain+r.IP+r.Port+r.Query+r.End,"i")};if(!r.Reg().test(t))return n="Use a valid HTTP protocol. Example: https://www.youtube.com/watch?v=V1bFr2SWP1",WAPI.scope(e,!0,null,n);var i=yield WAPI.sendExist(e);if(i.erro)return i;var o=WPP.conn.isMultiDevice()?void 0:yield WPP.whatsapp.functions.queryLinkPreview(t),a=(yield i.sendMessage(n.includes(t)?n:"".concat(t,"\n").concat(n),{linkPreview:o}))||"",s={type:"LinkPreview",url:t,text:n},u=yield WAPI.getchatId(i.id);if("success"===a||"OK"===a){var c=WAPI.scope(u,!1,a,null);return Object.assign(c,s),c}return c=WAPI.scope(u,!0,a,null),Object.assign(c,s),c},xe=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){_e(o,r,i,a,s,"next",e)}function s(e){_e(o,r,i,a,s,"throw",e)}a(void 0)})},xe.apply(this,arguments)}function je(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ke(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){je(o,r,i,a,s,"next",e)}function s(e){je(o,r,i,a,s,"throw",e)}a(void 0)})}}function Te(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{me:WPP.whatsapp.Conn.attributes,to:e,erro:t,text:r,status:n}}function Ue(){return(Ue=ke(function*(e){var t=yield WAPI.getChatById(e),n=t.lastReceivedKey||{},r={formattedName:t.contact.formattedName,isBusiness:t.contact.isBusiness,isMyContact:t.contact.isMyContact,verifiedName:t.contact.verifiedName,pushname:t.contact.pushname};return Object.assign(n,r),n})).apply(this,arguments)}function Le(){return Le=ke(function*(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return Te(e,!0,500,"Chat ID is empty");var r=yield window.WAPI.getChat(e);if(r||"status@broadcast"!==e||(r=new WPP.whatsapp.ChatStore.modelClass({id:WPP.whatsapp.WidFactory.createWid("status@broadcast")}),WPP.whatsapp.ChatStore.add(r),r=yield window.WAPI.getChat(e)),!r&&!e.includes("@g")){var i=yield window.WAPI.checkNumberStatus(e);if(!i.numberExists)return Te(e,!0,i.status,"The number does not exist");yield WPP.chat.find(i.id),e=i.id._serialized,r=yield window.WAPI.getChat(e)}return r?(n&&(yield WPP.chat.markIsRead(r.id).catch(()=>null)),t?r:Te(e,!1,200)):Te(e,!0,404)}),Le.apply(this,arguments)}function Ne(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Re(){var e;return e=function*(e,t){t||(t=WPP.whatsapp.UserPrefs.getMaybeMeUser());var n=WPP.whatsapp.WidFactory.createWid(t),r="data:image/jpeg;base64,";return yield WPP.whatsapp.functions.sendSetPicture(n,r+e.b,r+e.a)},Re=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Ne(o,r,i,a,s,"next",e)}function s(e){Ne(o,r,i,a,s,"throw",e)}a(void 0)})},Re.apply(this,arguments)}function Fe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function He(){var e;return e=function*(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("boolean"!=typeof t||"boolean"!=typeof n)return WAPI.scope(e,!0,null,"incorrect parameter, insert a boolean true or false");var r=t?"pin":"unpin",i=void 0,o=yield WAPI.sendExist(e,!0,n);if(o.erro)return o;var a={type:"pinChat",typefix:r},s=yield WAPI.getchatId(o.id);return yield Store.pinChat.setPin(o,t).then(e=>{var t=WAPI.scope(s,!1,"OK",null);Object.assign(t,a),i=t}).catch(e=>{var t=WAPI.scope(s,!0,e,"Pin Chat first");Object.assign(t,a),i=t}),i},He=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Fe(o,r,i,a,s,"next",e)}function s(e){Fe(o,r,i,a,s,"throw",e)}a(void 0)})},He.apply(this,arguments)}function ze(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Be(){var e;return e=function*(){if(window.localStorage){var e=yield JSON.parse(JSON.stringify(window.localStorage));return{WABrowserId:e.WABrowserId,WASecretBundle:e.WASecretBundle,WAToken1:e.WAToken1,WAToken2:e.WAToken2}}},Be=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ze(o,r,i,a,s,"next",e)}function s(e){ze(o,r,i,a,s,"throw",e)}a(void 0)})},Be.apply(this,arguments)}function De(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ge(){var e;return e=function*(e,t,n){var r=yield WAPI.sendExist(e);if(r.erro)return r;var i,o=null,a=null,s=null,u=yield WAPI.getchatId(r.id),c=yield window.Store.Mute.get(r.id),l={type:"sendMute",time:t,timeType:n};if("number"==typeof t&&"string"==typeof n){switch(n){case"hours":o=parseInt(new Date((new Date).setHours((new Date).getHours()+t)).getTime()/1e3);break;case"minutes":o=parseInt(new Date((new Date).setMinutes((new Date).getMinutes()+t)).getTime()/1e3);break;case"year":o=parseInt(new Date((new Date).setDate((new Date).getDate()+t)).getTime()/1e3)}yield window.Store.SendMute.sendConversationMute(r.id,o,0).then(e=>{a=e}).catch(e=>{a=e})}else s=!0,yield window.Store.SendMute.sendConversationMute(r.id,0,c.__x_expiration).then(e=>{a=e}).catch(e=>{a=e});if(200===a.status){s?(c.__x_expiration=0,c.__x_isMuted=!1):(c.__x_expiration=o,c.__x_isMuted=!0);var d=WAPI.scope(u,!1,a.status,null);return Object.assign(d,l),d}return i=s?"is not mute to remove":"This chat is already mute",d=WAPI.scope(u,!0,a.status,i),Object.assign(d,l),d},Ge=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){De(o,r,i,a,s,"next",e)}function s(e){De(o,r,i,a,s,"throw",e)}a(void 0)})},Ge.apply(this,arguments)}function Ye(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ve(){var e;return e=function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=(yield window.Store.Mute)._models,n=new Array,r=new Array;for(var i in t)t[i].__x_isMuted?r.push(WAPI.interfaceMute(t[i])):n.push(WAPI.interfaceMute(t[i]));var o=null;switch(console.log(0,e),e){case"all":o=[{total:r.length+n.length,amountToMute:r.length,amountnoMute:n.length},r,n];break;case"toMute":o=[{total:r.length},r];break;case"noMute":o=[{total:n.length},n]}return o},Ve=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Ye(o,r,i,a,s,"next",e)}function s(e){Ye(o,r,i,a,s,"throw",e)}a(void 0)})},Ve.apply(this,arguments)}function qe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var Je=null,Ke=!0;function Qe(){return Xe.apply(this,arguments)}function Xe(){var e;return e=function*(){if("MAIN"===WPP.whatsapp.Stream.mode&&"TIMEOUT"!==WPP.whatsapp.Socket.state)return Ke?(Ke=!1,WPP.whatsapp.Socket.sendBasic({tag:WPP.whatsapp.Socket.tag("ping"),data:["admin","test"]}).then(()=>{Ke=!0})):(WPP.whatsapp.Socket.phoneWatchdog.activate(),void WPP.whatsapp.Socket.phoneWatchdog.poke(250))},Xe=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){qe(o,r,i,a,s,"next",e)}function s(e){qe(o,r,i,a,s,"throw",e)}a(void 0)})},Xe.apply(this,arguments)}function Ze(){Je&&clearInterval(Je),Je=null}function $e(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return et(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?et(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function nt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){tt(o,r,i,a,s,"next",e)}function s(e){tt(o,r,i,a,s,"throw",e)}a(void 0)})}}function rt(){return(rt=nt(function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=$e(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=new WPP.whatsapp.WidFactory.createWid(i);Store.Presence.get(o)||(yield Store.Presence.find(o),n++)}}catch(e){r.e(e)}finally{r.f()}return n})).apply(this,arguments)}function it(){return(it=nt(function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=$e(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=new WPP.whatsapp.WidFactory.createWid(i),a=Store.Presence.get(o);a&&(a.delete(),n++)}}catch(e){r.e(e)}finally{r.f()}return n})).apply(this,arguments)}function ot(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function at(){var e;return e=function*(e){void 0===e&&(e=!0),e?yield WPP.whatsapp.ChatPresence.sendPresenceAvailable():yield WPP.whatsapp.ChatPresence.sendPresenceUnavailable()},at=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ot(o,r,i,a,s,"next",e)}function s(e){ot(o,r,i,a,s,"throw",e)}a(void 0)})},at.apply(this,arguments)}function st(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ut(){var e;return e=function*(e,t){var n=WPP.whatsapp.ChatStore.get(e);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};return n.isGroup?yield WPP.group.setProperty(n.id,"ephemeral",t):(t=t?604800:0,yield Store.changeEphemeralDuration(n,t).catch(e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}}),!0)},ut=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){st(o,r,i,a,s,"next",e)}function s(e){st(o,r,i,a,s,"throw",e)}a(void 0)})},ut.apply(this,arguments)}function ct(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function lt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ct(o,r,i,a,s,"next",e)}function s(e){ct(o,r,i,a,s,"throw",e)}a(void 0)})}}function dt(){return dt=lt(function*(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);var n=yield Promise.all(e.map(function(){var e=lt(function*(e){return yield Z(e,null,!1)});return function(t){return e.apply(this,arguments)}}())),r=(n=n.filter(e=>e&&e.star!==t)).reduce(function(e,t){var n=t.id.remote._serialized;return e[n]=e[n]||[],e[n].push(t),e},Object.create(null)),i=0,o=function*(){var e=WPP.whatsapp.ChatStore.get(a),n=r[a];i+=(yield e.sendStarMsgs(n,t).then(()=>n.length).catch(()=>0))};for(var a in r)yield*o();return i}),dt.apply(this,arguments)}function ft(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return window.WAPI._newMessagesCallbacks.push({callback:t,rmAfterUse:e}),!0}function ht(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function pt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var wt={};function vt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var Pt=function(){var e,t=(e=function*(e){var t=WPP.whatsapp.WidFactory.createWid(e),n=WPP.whatsapp.ProfilePicThumbStore.get(t);return n||(n=yield WPP.whatsapp.ProfilePicThumbStore.find(t)),n?WAPI._serializeProfilePicThumb(n):null},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){vt(o,r,i,a,s,"next",e)}function s(e){vt(o,r,i,a,s,"throw",e)}a(void 0)})});return function(e){return t.apply(this,arguments)}}();function yt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function gt(){var e;return e=function*(e){var t=WPP.whatsapp.CatalogStore.get(e);if(t||(t=yield WPP.whatsapp.CatalogStore.find(WPP.whatsapp.WidFactory.createWid(e))),!t)throw{error:!0,code:"catalog_not_found",message:"Catalog not found"};return t.productCollection?t.productCollection.serialize():[]},gt=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){yt(o,r,i,a,s,"next",e)}function s(e){yt(o,r,i,a,s,"throw",e)}a(void 0)})},gt.apply(this,arguments)}function mt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function At(){var e;return e=function*(e){var t=yield Z(e,null,!1);if(!t)throw{error:!0,code:"message_not_found",message:"Message not found"};if("order"!==t.type)throw{error:!0,code:"message_is_not_an_order",message:"Message is not an order"};var n=WPP.order.get(e);if(n||(n=yield WPP.whatsapp.OrderStore.findOrder(t.orderId,t.sellerJid,t.token)),!n)throw{error:!0,code:"order_not_found",message:"Order not found"};return n.products},At=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){mt(o,r,i,a,s,"next",e)}function s(e){mt(o,r,i,a,s,"throw",e)}a(void 0)})},At.apply(this,arguments)}var bt=[{id:"Store",conditions:e=>e.default&&e.default.Chat&&e.default.Msg?e.default:null},{id:"MediaCollection",conditions:e=>e.default&&e.default.prototype&&void 0!==e.default.prototype.processAttachments?e.default:null},{id:"GroupInvite",conditions:e=>e.sendQueryGroupInviteCode?e:null},{id:"Archive",conditions:e=>e.setArchive?e:null},{id:"pinChat",conditions:e=>e.setPin.toString().includes(".unproxy")?e:null},{id:"Perfil",conditions:e=>e.setPushname&&!e.getComposeContents},{id:"ChatStates",conditions:e=>e.sendChatStatePaused&&e.sendChatStateRecording&&e.sendChatStateComposing?e:null},{id:"MediaObject",conditions:e=>e.getOrCreateMediaObject&&e.disassociateMediaFromStickerPack?e:null},{id:"UploadUtils",conditions:e=>e.default&&e.default.encryptAndUpload?e.default:null},{id:"Theme",conditions:e=>e.getTheme&&e.setTheme?e:null},{id:"SendMute",conditions:e=>e.sendConversationMute?e:null},{id:"Validators",conditions:e=>e.findLinks?e:null},{id:"changeEphemeralDuration",conditions:e=>e.changeEphemeralDuration},{id:"sendCreateGroup",conditions:e=>e.sendCreateGroup},{id:"sendQueryGroupInvite",conditions:e=>e.sendQueryGroupInvite?e.sendQueryGroupInvite:null}];function Wt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function It(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Wt(o,r,i,a,s,"next",e)}function s(e){Wt(o,r,i,a,s,"throw",e)}a(void 0)})}}function St(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Mt=new Promise(e=>{WPP.isReady?e():WPP.webpack.onReady(e)});void 0===window.Store&&(window.Store={},window.Store.promises={},Mt.then(()=>{var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return St(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?St(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(bt);try{var n=function(){var t=e.value;window.Store.promises[t.id]=Promise.resolve(WPP.webpack.search(t.conditions)).then(e=>(e||console.error("Store Object '".concat(t.id,"' was not found")),e)).then(t.conditions).then(e=>{"Store"===t.id?window.Store=Object.assign({},window.Store,e):window.Store[t.id]=e})};for(t.s();!(e=t.n()).done;)n()}catch(e){t.e(e)}finally{t.f()}})),void 0===window.WAPI&&(window.WAPI={lastRead:{}},window.WAPI.interfaceMute=function(e){return{attributes:e.attributes,expiration:e.expiration,id:e.id,isMuted:e.isMuted,isState:e.isState,promises:e.promises,stale:e.stale}},window.WAPI.setProfilePic=function(e,t){return Re.apply(this,arguments)},window.WAPI.getSessionTokenBrowser=function(){return Be.apply(this,arguments)},window.WAPI.scope=Te,window.WAPI.getchatId=function(e){return Ue.apply(this,arguments)},window.WAPI.sendExist=function(e){return Le.apply(this,arguments)},window.WAPI.pinChat=function(e){return He.apply(this,arguments)},window.WAPI.setTemporaryMessages=function(e,t){return ut.apply(this,arguments)},window.WAPI.setTheme=function(e){return Oe.apply(this,arguments)},window.WAPI.getTheme=function(){return Ee.apply(this,arguments)},window.WAPI._serializeRawObj=e=>e&&e.toJSON?e.toJSON():{},window.WAPI._serializeChatObj=e=>null==e?null:Object.assign(window.WAPI._serializeRawObj(e),{kind:e.kind,isBroadcast:e.isBroadcast,isGroup:e.isGroup,isUser:e.isUser,contact:e.contact?window.WAPI._serializeContactObj(e.contact):null,groupMetadata:e.groupMetadata?window.WAPI._serializeRawObj(e.groupMetadata):null,presence:e.presence?window.WAPI._serializeRawObj(e.presence):null,msgs:null}),window.WAPI._serializeContactObj=e=>{if(null==e)return null;var t=null;if(!e.profilePicThumb&&e.id&&WPP.whatsapp.ProfilePicThumbStore){var n=WPP.whatsapp.ProfilePicThumbStore.get(e.id);t=n?WAPI._serializeProfilePicThumb(n):{}}return Object.assign(window.WAPI._serializeRawObj(e),{formattedName:e.formattedName,isHighLevelVerified:e.isHighLevelVerified,isMe:e.isMe,isMyContact:e.isMyContact,isPSA:e.isPSA,isUser:e.isUser,isVerified:e.isVerified,isWAContact:e.isWAContact,profilePicThumbObj:t,statusMute:e.statusMute,msgs:null})},window.WAPI._serializeMessageObj=e=>{var t,n,r,i,o,a,s;return null==e?null:(e.quotedMsg&&e.quotedMsgObj&&e.quotedMsgObj(),Object.assign(window.WAPI._serializeRawObj(e),{id:e.id._serialized,from:e.from._serialized,quotedParticipant:null==e||null===(t=e.quotedParticipant)||void 0===t?void 0:t._serialized,author:null==e||null===(n=e.author)||void 0===n?void 0:n._serialized,chatId:(null==e||null===(r=e.id)||void 0===r?void 0:r.remote)||(null==e||null===(i=e.chatId)||void 0===i?void 0:i._serialized),to:null==e||null===(o=e.to)||void 0===o?void 0:o._serialized,fromMe:null==e||null===(a=e.id)||void 0===a?void 0:a.fromMe,sender:e.senderObj?WAPI._serializeContactObj(e.senderObj):null,timestamp:e.t,content:e.body,isGroupMsg:e.isGroupMsg,isLink:e.isLink,isMMS:e.isMMS,isMedia:e.isMedia,isNotification:e.isNotification,isPSA:e.isPSA,type:e.type,quotedMsgId:null==e||null===(s=e._quotedMsgObj)||void 0===s||null===(s=s.id)||void 0===s?void 0:s._serialized,mediaData:window.WAPI._serializeRawObj(e.mediaData)}))},window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI._serializeProfilePicThumb=e=>null==e?null:Object.assign({},{eurl:e.eurl,id:e.id,img:e.img,imgFull:e.imgFull,raw:e.raw,tag:e.tag}),window.WAPI._profilePicfunc=Pt,window.WAPI.sendChatstate=function(e,t){return Q.apply(this,arguments)},window.WAPI.sendMessageWithThumb=function(e,t,n,r,i,o){var a=WAPI.getChat(i);if(void 0===a)return void 0!==o&&o(!1),!1;var s={canonicalUrl:t,description:r,matchedText:t,title:n,thumbnail:e};return a.sendMessage(t,{linkPreview:s,mentionedJidList:[],quotedMsg:null,quotedMsgAdminGroupJid:null}),void 0!==o&&o(!0),!0},window.WAPI.processMessageObj=function(e,t,n){return e.isNotification?n?WAPI._serializeMessageObj(e):void 0:!1===e.id.fromMe||t?WAPI._serializeMessageObj(e):void 0},window.WAPI.sendMessageWithTags=function(e,t){return ve.apply(this,arguments)},window.WAPI.sendMessage=function(e,t){return ce.apply(this,arguments)},window.WAPI.sendMessage2=function(e,t,n){var r=WAPI.getChat(e);if(void 0!==r)try{return void 0!==n?r.sendMessage(t).then(function(){n(!0)}):r.sendMessage(t),!0}catch(e){return void 0!==n&&n(!1),!1}return void 0!==n&&n(!1),!1},window.WAPI.sendImage=function(e,t,n,r,i,o){return te(e,t,n,r,"sendImage",i,o)},window.WAPI.sendPtt=function(e,t,n,r,i){return ie.apply(this,arguments)},window.WAPI.sendFile=te,window.WAPI.setMyName=function(e){return me.apply(this,arguments)},window.WAPI.sendVideoAsGif=function(e,t,n,r,i){return ye.apply(this,arguments)},window.WAPI.processFiles=q,window.WAPI.sendImageWithProduct=function(e,t,n,r,i,a){WPP.whatsapp.CatalogStore.findCarouselCatalog(r).then(r=>{if(r&&r[0]){var s=r[0].productCollection.get(i),u={productMsgOptions:{businessOwnerJid:s.catalogWid.toString({legacy:!0}),productId:s.id.toString(),url:s.url,productImageCount:s.productImageCollection.length,title:s.name,description:s.description,currencyCode:s.currency,priceAmount1000:s.priceAmount1000,type:"product"},caption:n},c=new WPP.whatsapp.WidFactory.createWid(t);return WPP.chat.find(c).then(t=>{var n=o(e,s.name);q(t,n).then(e=>{var n=e.getModelsArray()[0];Object.entries(u.productMsgOptions).map(e=>{var t,r,i=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,r)||function(e,t){if(e){if("string"==typeof e)return oe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oe(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],a=i[1];return n.mediaPrep._mediaData[o]=a}),n.mediaPrep.sendToChat(t,u),void 0!==a&&a(!0)})})}})},window.WAPI.createProduct=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"BRL",u=arguments.length>8?arguments[8]:void 0;WPP.catalog.createProduct({name:t,image:e,description:n,price:r,isHidden:i,url:o,retailerId:a,currency:s}).then(e=>{void 0!==u&&u(e)})},window.WAPI.forwardMessages=function(e,t,n){return We.apply(this,arguments)},window.WAPI.encryptAndUploadFile=function(e,t){return w.apply(this,arguments)},window.WAPI.setOnlinePresence=function(e){return at.apply(this,arguments)},window.WAPI.sendLocation=function(e,t,n){return se.apply(this,arguments)},window.WAPI.sendLinkPreview=function(e,t,n){return xe.apply(this,arguments)},window.WAPI.sendMessageOptions=function(e,t){return pe.apply(this,arguments)},window.WAPI.starMessages=function(e,t){return dt.apply(this,arguments)},window.WAPI.getAllContacts=m,window.WAPI.getMyContacts=function(e){var t=WPP.whatsapp.ContactStore.filter(e=>!0===e.isMyContact).map(e=>WAPI._serializeContactObj(e));return void 0!==e&&e(t),t},window.WAPI.getContact=function(e,t){var n=WPP.whatsapp.ContactStore.get(e);return void 0!==t&&t(window.WAPI._serializeContactObj(n)),window.WAPI._serializeContactObj(n)},window.WAPI.getAllChats=function(e){var t=WPP.whatsapp.ChatStore.map(e=>WAPI._serializeChatObj(e));return void 0!==e&&e(t),t},window.WAPI.haveNewMsg=W,window.WAPI.getAllChatsWithNewMsg=I,window.WAPI.getAllChatIds=function(e){var t=WPP.whatsapp.ChatStore.map(e=>e.id._serialized||e.id);return void 0!==e&&e(t),t},window.WAPI.getAllNewMessages=function(){return I().map(e=>WAPI.getChat(e.id)).flatMap(e=>e.msgs.filter(e=>e.isNewMsg)).map(WAPI._serializeMessageObj)||[]},window.WAPI.getAllUnreadMessages=M,window.WAPI.getAllChatsWithMessages=function(e){return P.apply(this,arguments)},window.WAPI.getAllGroups=function(e){var t=WPP.whatsapp.ChatStore.filter(e=>e.isGroup);return void 0!==e&&e(t),t},window.WAPI.getChat=function(e){if(!e)return!1;e="string"==typeof e?e:e._serialized;var t=WPP.whatsapp.ChatStore.get(e);return t&&(t.sendMessage=t.sendMessage?t.sendMessage:function(){return WPP.whatsapp.functions.sendTextMsgToChat(this,...arguments)}),t},window.WAPI.getChatByName=function(e,t){var n=WPP.chat.find(t=>t.name===e);return void 0!==t&&t(n),n},window.WAPI.getNewId=function(){for(var e="",t=0;t<20;t++)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return e},window.WAPI.getChatById=function(e,t){return O.apply(this,arguments)},window.WAPI.getUnreadMessagesInChat=function(e,t,n,r){for(var i=WAPI.getChat(e).msgs._models,o=[],a=i.length-1;a>=0;a--)if("remove"!==a){var s=i[a];if("boolean"==typeof s.isNewMsg&&!1!==s.isNewMsg){s.isNewMsg=!1;var u=WAPI.processMessageObj(s,t,n);u&&o.push(u)}}return void 0!==r&&r(o),o},window.WAPI.loadEarlierMessages=function(e){return Y.apply(this,arguments)},window.WAPI.loadAllEarlierMessages=H,window.WAPI.asyncLoadAllEarlierMessages=function(e,t){H(e),t()},window.WAPI.areAllMessagesLoaded=function(e,t){return WAPI.getChat(e).msgs.msgLoadState.noEarlierMsgs?(t&&t(!0),!0):(t&&t(!1),!1)},window.WAPI.loadEarlierMessagesTillDate=function(e,t,n){var r=WAPI.getChat(e),i=function(){r.msgs.getModelsArray()[0].t>t&&!r.msgs.msgLoadState.noEarlierMsgs?r.loadEarlierMsgs().then(i):n()};i()},window.WAPI.getAllGroupMetadata=function(e){var t=WPP.whatsapp.GroupMetadataStore.map(e=>e.attributes);return void 0!==e&&e(t),t},window.WAPI.getGroupMetadata=function(e,t){return j.apply(this,arguments)},window.WAPI._getGroupParticipants=function(e){return L.apply(this,arguments)},window.WAPI.getGroupParticipantIDs=function(e,t){return T.apply(this,arguments)},window.WAPI.getAllMessagesInChat=function(e,t,n,r){return b.apply(this,arguments)},window.WAPI.loadAndGetAllMessagesInChat=function(e,t,n,r){return D.apply(this,arguments)},window.WAPI.getUnreadMessages=function(e,t,n,r){var i=WPP.whatsapp.ChatStore.getModelsArray(),o=[];for(var a in i)if(!isNaN(a)){var s=i[a],u=WAPI._serializeChatObj(s);u.messages=[];for(var c=s.msgs._models,l=c.length-1;l>=0;l--){var d=c[l];if("boolean"==typeof d.isNewMsg&&!1!==d.isNewMsg){d.isNewMsg=!1;var f=WAPI.processMessageObj(d,e,t);f&&u.messages.push(f)}}if(u.messages.length>0)o.push(u);else if(n){for(var h=s.unreadCount,p=c.length-1;p>=0;p--){var w=c[p];if(h>0){if(!w.isSentByMe){var v=WAPI.processMessageObj(w,e,t);u.messages.unshift(v),h-=1}}else{if(-1!==h)break;if(!w.isSentByMe){var P=WAPI.processMessageObj(w,e,t);u.messages.unshift(P);break}}}u.messages.length>0&&(s.unreadCount=0,o.push(u))}}return void 0!==r&&r(o),o},window.WAPI.getCommonGroups=function(e,t){return _.apply(this,arguments)},window.WAPI.downloadFile=function(e){return i.apply(this,arguments)},window.WAPI.getNumberProfile=function(e,t){return R.apply(this,arguments)},window.WAPI.getMessageById=Z,window.WAPI.getMessages=function(e){return Se.apply(this,arguments)},window.WAPI.getFileHash=u,window.WAPI.generateMediaKey=l,window.WAPI.arrayBufferToBase64=function(e){for(var t,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),o=i.byteLength,a=o%3,s=o-a,u=0;u<s;u+=3)n+=r[(16515072&(t=i[u]<<16|i[u+1]<<8|i[u+2]))>>18]+r[(258048&t)>>12]+r[(4032&t)>>6]+r[63&t];return 1==a?n+=r[(252&(t=i[s]))>>2]+r[(3&t)<<4]+"==":2==a&&(n+=r[(64512&(t=i[s]<<8|i[s+1]))>>10]+r[(1008&t)>>4]+r[(15&t)<<2]+"="),n},window.WAPI.getListMute=function(){return Ve.apply(this,arguments)},window.WAPI.getHost=function(){return WPP.whatsapp.Conn.attributes},window.WAPI.getWid=function(){var e;return null===(e=WPP.whatsapp.UserPrefs.getMaybeMeUser())||void 0===e?void 0:e._serialized},window.WAPI.getMe=function(e){var t=WPP.whatsapp.ContactStore.get(WPP.whatsapp.UserPrefs.getMaybeMeUser());return void 0!==e&&e(t.all),t.all},window.WAPI.isConnected=function(e){var t=null==document.querySelector('[data-testid="alert-phone"]')&&null==document.querySelector('[data-testid="alert-computer"]');return void 0!==e&&e(t),t},window.WAPI.isLoggedIn=function(e){var t=WPP.whatsapp.ContactStore&&void 0!==WPP.whatsapp.ContactStore.checksum;return void 0!==e&&e(t),t},window.WAPI.getBatteryLevel=function(){return WPP.whatsapp.Conn.attributes.battery},window.WAPI.base64ImageToFile=o,window.WAPI.base64ToFile=o,window.WAPI.sendMute=function(e,t,n){return Ge.apply(this,arguments)},window.WAPI.startPhoneWatchdog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;Ze(),Je=setInterval(Qe,e)},window.WAPI.stopPhoneWatchdog=Ze,window.WAPI.subscribePresence=function(e){return rt.apply(this,arguments)},window.WAPI.unsubscribePresence=function(e){return it.apply(this,arguments)},window.WAPI.getBusinessProfilesProducts=function(e){return gt.apply(this,arguments)},window.WAPI.getOrderbyMsg=function(e){return At.apply(this,arguments)},window.WAPI._newMessagesQueue=[],window.WAPI._newMessagesBuffer=null!=sessionStorage.getItem("saved_msgs")?JSON.parse(sessionStorage.getItem("saved_msgs")):[],window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesCallbacks=[],window.addEventListener("unload",window.WAPI._unloadInform,!1),window.addEventListener("beforeunload",window.WAPI._unloadInform,!1),window.addEventListener("pageunload",window.WAPI._unloadInform,!1),window.WAPI.getProfilePicSmallFromId=function(){var e=It(function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=It(function*(e){return void 0!==e.img&&(yield window.WAPI.downloadFileWithCredentials(e.img))});return function(t){return e.apply(this,arguments)}}(),function(e){return!1})});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getProfilePicFromId=function(){var e=It(function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=It(function*(e){return void 0!==e.imgFull&&(yield window.WAPI.downloadFileWithCredentials(e.imgFull))});return function(t){return e.apply(this,arguments)}}(),function(e){return!1})});return function(t){return e.apply(this,arguments)}}(),window.WAPI.downloadFileWithCredentials=function(){var e=It(function*(e){if(!axios||!e)return!1;var t=(yield axios.get(e,{responseType:"arraybuffer"})).data;return btoa(new Uint8Array(t).reduce((e,t)=>e+String.fromCharCode(t),""))});return function(t){return e.apply(this,arguments)}}(),window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI.checkNumberStatus=function(){var e=It(function*(e){var t=yield WPP.contact.queryExists(e);return t?{id:t.wid,isBusiness:t.biz,canReceiveMessage:!0,numberExists:!0,status:200}:{id:e,isBusiness:!1,canReceiveMessage:!1,numberExists:!1,status:404}});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getChatIsOnline=function(){var e=It(function*(e){var t=WPP.whatsapp.ChatStore.get(e);return!!t&&(yield t.presence.subscribe(),t.presence.attributes.isOnline)});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getLastSeen=function(){var e=It(function*(e){var t=WPP.whatsapp.ChatStore.get(e);return!!t&&(t.presence.hasData||(yield t.presence.subscribe(),yield new Promise(e=>setTimeout(e,100))),t.presence.chatstate.t||!1)});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getWAVersion=function(){return window.Debug.VERSION},window.WAPI.deleteOldChats=function(){var e=It(function*(e){try{var t=yield window.WAPI.chat.list({onlyWithUnreadMessage:!1,onlyUsers:!0});t.reverse();for(var n=Math.min(e,t.length),r=0;r<n;r++)yield window.WAPI.chat.delete(t[r].id._serialized).then(e=>!0).catch(e=>!1)}catch(e){return console.error("Erro:",e),e}});return function(t){return e.apply(this,arguments)}}(),window.WAPI.archiveChat=function(){var e=It(function*(e,t){var n=Store.Archive.setArchive(WPP.whatsapp.ChatStore.get(e),t).then(e=>!0).catch(e=>!1);return yield Promise.resolve(n)});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendTextStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendTextStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendImageStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendImageStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendVideoStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendVideoStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.takeOver=It(function*(){return yield WPP.whatsapp.Socket.takeover(),!0}),window.WAPI.onIncomingCall=function(e){return WPP.whatsapp.CallStore.on("add",e),!0},window.WAPI.onInterfaceChange=function(e){var t=()=>({displayInfo:WPP.whatsapp.Stream.displayInfo,mode:WPP.whatsapp.Stream.mode,info:WPP.whatsapp.Stream.info});return e(t()),WPP.whatsapp.Stream.on("change:info change:displayInfo change:mode",()=>{e(t())}),!0},window.WAPI.setMessagesAdminsOnly=function(){var e=It(function*(e,t){return yield WPP.group.setProperty(e,"announcement",t),!0});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.logout=It(function*(){return yield WPP.conn.logout()}),window.WAPI.isRegistered=function(){return WPP.webpack.search(e=>e.isRegistered).isRegistered()},Mt.then(function(){var e=!1,t=()=>WPP.whatsapp.Socket.stream;window.WAPI.onStreamChange=function(n){return WPP.whatsapp.Socket.on("change:stream",()=>n(t())),e||(e=!0,n(t())),!0}}),Mt.then(function(){var e=!1,t=()=>WPP.whatsapp.Socket.state;window.WAPI.onStateChange=function(n){return WPP.whatsapp.Socket.on("change:state",()=>n(t())),e||(e=!0,n(t())),!0}}),Mt.then(function(){window.WAPI._newMessagesListener=WPP.whatsapp.MsgStore.on("add",e=>{e&&e.isNewMsg&&!e.isSentByMe&&!e.isStatusV3&&setTimeout(()=>{var t=window.WAPI.processMessageObj(e,!1,!1);t&&(window.WAPI._newMessagesQueue.push(t),window.WAPI._newMessagesBuffer.push(t)),!window.WAPI._newMessagesDebouncer&&window.WAPI._newMessagesQueue.length>0&&(window.WAPI._newMessagesDebouncer=setTimeout(()=>{var e=window.WAPI._newMessagesQueue;window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesQueue=[];var t=[];window.WAPI._newMessagesCallbacks.forEach(function(n){void 0!==n.callback&&n.callback(e),!0===n.rmAfterUse&&t.push(n)}),t.forEach(function(e){var t=window.WAPI._newMessagesCallbacks.indexOf(e);window.WAPI._newMessagesCallbacks.splice(t,1)})},1e3))},e.body?0:2e3)}),window.WAPI._unloadInform=e=>{window.WAPI._newMessagesBuffer.forEach(e=>{Object.keys(e).forEach(t=>void 0===e[t]?delete e[t]:"")}),sessionStorage.setItem("saved_msgs",JSON.stringify(window.WAPI._newMessagesBuffer)),window.WAPI._newMessagesCallbacks.forEach(function(e){void 0!==e.callback&&e.callback({status:-1,message:"page will be reloaded, wait and register callback again."})})}}),Mt.then(function(){window.WAPI.waitNewMessages=ft}),Mt.then(function(){window.WAPI.allNewMessagesListener=e=>WPP.whatsapp.MsgStore.on("add",t=>{t&&t.isNewMsg&&setTimeout(()=>{var n=window.WAPI.processMessageObj(t,!0,!1);n&&e(n)},t.body?0:2e3)})}),Mt.then(function(){window.WAPI.waitNewAcknowledgements=function(e){return WPP.whatsapp.MsgStore.on("change:ack",e),!0}}),Mt.then(function(){window.WAPI.onAddedToGroup=function(e){return WPP.whatsapp.MsgStore.on("add",t=>{if(t.isNewMsg&&t.isNotification&&"gp2"===t.type&&"add"===t.subtype)try{var n=WAPI._serializeChatObj(t.chat);e(n)}catch(e){console.error(e)}}),!0}}),Mt.then(function(){var e=[];function t(t){var n=Object.assign({},t);n.jid&&(n.id=n.jid.toString());for(var r=0,i=e;r<i.length;r++){var o=i[r];try{o(n)}catch(e){}}}WPP.on("chat.live_location_start",e=>{t({type:"enable",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,shareDuration:e.shareDuration})}),WPP.on("chat.live_location_update",e=>{t({type:"update",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,elapsed:e.elapsed,lastUpdated:e.lastUpdated})}),WPP.on("chat.live_location_end",e=>{t({type:"disablle",id:e.id.toString(),chat:e.chat.toString()})}),window.WAPI.onLiveLocation=function(){var t,n=(t=function*(t){e.push(t)},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){ht(o,r,i,a,s,"next",e)}function s(e){ht(o,r,i,a,s,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}()}),Mt.then(function(){window.WAPI.onParticipantsChanged=function(){var e,t=(e=function*(e,t){var n=["invite","add","remove","leave","promote","demote"],r=WPP.whatsapp.ChatStore.get(e),i=WPP.whatsapp.GroupMetadataStore.get(e);wt[e]||(wt[e]={},i.participants.forEach(t=>{wt[e][t.id.toString()]={subtype:"add",from:i.owner}}));var o=0;return r.on("change:groupMetadata.participants",i=>r.on("all",(i,a)=>{var s=a.isGroup,u=a.previewMessage;if(s&&"change"===i&&u&&"gp2"===u.type&&n.includes(u.subtype)){var c=u.subtype,l=u.from,d=u.recipients,f=d[0].toString();wt[e][f]&&wt[e][d[0]].subtype==c||(0==o?o++:(wt[e][f]={subtype:c,from:l},t({by:l.toString(),action:c,who:d}),r.off("all",this),o=0))}})),!0},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){pt(o,r,i,a,s,"next",e)}function s(e){pt(o,r,i,a,s,"throw",e)}a(void 0)})});return function(e,n){return t.apply(this,arguments)}}()}),Mt.then(function(){window.WAPI.onNotificationMessage=function(e){return WPP.whatsapp.MsgStore.on("add",t=>{if(t.isNotification&&t.isNewMsg){var n=WAPI._serializeMessageObj(t);e(n)}}),!0}}),Mt.then(function(){window.WAPI.onPresenceChanged=function(e){return setTimeout(()=>{WPP.whatsapp.ChatStore.map(e=>e.presence.subscribe())},1e3),WPP.whatsapp.PresenceStore.on("change:chatstate.type",t=>{try{var n=WPP.whatsapp.PresenceStore.getModelsArray().find(e=>e.chatstate===t);if(!n||!n.hasData||!n.chatstate.type)return;var r=WPP.whatsapp.ContactStore.get(n.id),i={id:n.id,isOnline:n.isOnline,isGroup:n.isGroup,isUser:n.isUser,shortName:r?r.formattedShortName:"",state:n.chatstate.type,t:Date.now()};n.isUser&&(i.isContact=!n.chatstate.deny),n.isGroup&&(i.participants=n.chatstates.getModelsArray().filter(e=>!!e.type).map(e=>{var t=WPP.whatsapp.ContactStore.get(e.id);return{id:e.id.toString(),state:e.type,shortName:t?t.formattedShortName:""}})),e(i)}catch(e){console.log(e)}}),!0}}))},490(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof P?t:P,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:M(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",h="suspendedYield",p="executing",w="completed",v={};function P(){}function y(){}function g(){}var m={};c(m,a,function(){return this});var A=Object.getPrototypeOf,b=A&&A(A(x([])));b&&b!==n&&r.call(b,a)&&(m=b);var W=g.prototype=P.prototype=Object.create(m);function I(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){function n(i,o,a,s){var u=d(e[i],e,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then(function(e){n("next",e,a,s)},function(e){n("throw",e,a,s)}):t.resolve(l).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t(function(t,i){n(e,r,t,i)})}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=f;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===w){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=C(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=w,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var c=d(e,n,r);if("normal"===c.type){if(i=r.done?w:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=w,r.method="throw",r.arg=c.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=d(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function x(e){if(null!=e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=g,i(W,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,u,"GeneratorFunction")),e.prototype=Object.create(W),e},e.awrap=function(e){return{__await:e}},I(S.prototype),c(S.prototype,s,function(){return this}),e.AsyncIterator=S,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new S(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},I(W),c(W,u,"Generator"),c(W,a,function(){return this}),c(W,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=x,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n(490),n(496)})();
1
+ (()=>{var e={730(e,t,n){"use strict";var r;!function(){function i(e,t,n){var r,i,o,a,p,w,v,P,y,g=0,m=[],A=0,b=!1,W=[],I=[],S=!1,M=!1,C=-1;if(r=(n=n||{}).encoding||"UTF8",(y=n.numRounds||1)!==parseInt(y,10)||1>y)throw Error("numRounds must a integer >= 1");if("SHA-1"===e)p=512,w=F,v=H,a=160,P=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(w=function(t,n){return z(t,n,e)},v=function(t,n,r,i){var o,a;if("SHA-224"===e||"SHA-256"===e)o=15+(n+65>>>9<<4),a=16;else{if("SHA-384"!==e&&"SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");o=31+(n+129>>>10<<5),a=32}for(;t.length<=o;)t.push(0);for(t[n>>>5]|=128<<24-n%32,n+=r,t[o]=4294967295&n,t[o-1]=n/4294967296|0,r=t.length,n=0;n<r;n+=a)i=z(t.slice(n,n+a),i,e);if("SHA-224"===e)t=[i[0],i[1],i[2],i[3],i[4],i[5],i[6]];else if("SHA-256"===e)t=i;else if("SHA-384"===e)t=[i[0].a,i[0].b,i[1].a,i[1].b,i[2].a,i[2].b,i[3].a,i[3].b,i[4].a,i[4].b,i[5].a,i[5].b];else{if("SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");t=[i[0].a,i[0].b,i[1].a,i[1].b,i[2].a,i[2].b,i[3].a,i[3].b,i[4].a,i[4].b,i[5].a,i[5].b,i[6].a,i[6].b,i[7].a,i[7].b]}return t},P=function(e){return e.slice()},"SHA-224"===e)p=512,a=224;else if("SHA-256"===e)p=512,a=256;else if("SHA-384"===e)p=1024,a=384;else{if("SHA-512"!==e)throw Error("Chosen SHA variant is not supported");p=1024,a=512}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("Chosen SHA variant is not supported");var O=6;if(w=B,P=function(e){var t,n=[];for(t=0;5>t;t+=1)n[t]=e[t].slice();return n},C=1,"SHA3-224"===e)p=1152,a=224;else if("SHA3-256"===e)p=1088,a=256;else if("SHA3-384"===e)p=832,a=384;else if("SHA3-512"===e)p=576,a=512;else if("SHAKE128"===e)p=1344,a=-1,O=31,M=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");p=1088,a=-1,O=31,M=!0}v=function(e,t,n,r,i){var o,a=O,s=[],u=(n=p)>>>5,c=0,l=t>>>5;for(o=0;o<l&&t>=n;o+=u)r=B(e.slice(o,o+u),r),t-=n;for(e=e.slice(o),t%=n;e.length<u;)e.push(0);for(e[(o=t>>>3)>>2]^=a<<o%4*8,e[u-1]^=2147483648,r=B(e,r);32*s.length<i&&(e=r[c%5][c/5|0],s.push(e.b),!(32*s.length>=i));)s.push(e.a),0==64*(c+=1)%n&&B(null,r);return s}}o=h(t,r,C),i=R(e),this.setHMACKey=function(t,n,o){var s;if(!0===b)throw Error("HMAC key already set");if(!0===S)throw Error("Cannot set HMAC key after calling update");if(!0===M)throw Error("SHAKE is not supported for HMAC");if(t=(n=h(n,r=(o||{}).encoding||"UTF8",C)(t)).binLen,n=n.value,o=(s=p>>>3)/4-1,s<t/8){for(n=v(n,t,0,R(e),a);n.length<=o;)n.push(0);n[o]&=4294967040}else if(s>t/8){for(;n.length<=o;)n.push(0);n[o]&=4294967040}for(t=0;t<=o;t+=1)W[t]=909522486^n[t],I[t]=1549556828^n[t];i=w(W,i),g=p,b=!0},this.update=function(e){var t,n,r,a=0,s=p>>>5;for(e=(t=o(e,m,A)).binLen,n=t.value,t=e>>>5,r=0;r<t;r+=s)a+p<=e&&(i=w(n.slice(r,r+s),i),a+=p);g+=a,m=n.slice(a>>>5),A=e%p,S=!0},this.getHash=function(t,n){var r,o,h,p;if(!0===b)throw Error("Cannot call getHash after setting HMAC key");if(h=f(n),!0===M){if(-1===h.shakeLen)throw Error("shakeLen must be specified in options");a=h.shakeLen}switch(t){case"HEX":r=function(e){return s(e,a,C,h)};break;case"B64":r=function(e){return u(e,a,C,h)};break;case"BYTES":r=function(e){return c(e,a,C)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{o=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return d(e,a,C)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(p=v(m.slice(),A,g,P(i),a),o=1;o<y;o+=1)!0===M&&0!=a%32&&(p[p.length-1]&=16777215>>>24-a%32),p=v(p,a,0,R(e),a);return r(p)},this.getHMAC=function(t,n){var r,o,h,y;if(!1===b)throw Error("Cannot call getHMAC without first setting HMAC key");switch(h=f(n),t){case"HEX":r=function(e){return s(e,a,C,h)};break;case"B64":r=function(e){return u(e,a,C,h)};break;case"BYTES":r=function(e){return c(e,a,C)};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{r=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return d(e,a,C)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return o=v(m.slice(),A,g,P(i),a),y=w(I,R(e)),r(y=v(o,a,p,y,a))}}function o(e,t){this.a=e,this.b=t}function a(e,t,n,r){var i,o,a,s,u;for(t=t||[0],o=(n=n||0)>>>3,u=-1===r?3:0,i=0;i<e.length;i+=1)a=(s=i+o)>>>2,t.length<=a&&t.push(0),t[a]|=e[i]<<8*(u+s%4*r);return{value:t,binLen:8*e.length+n}}function s(e,t,n,r){var i,o,a,s="";for(t/=8,a=-1===n?3:0,i=0;i<t;i+=1)o=e[i>>>2]>>>8*(a+i%4*n),s+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return r.outputUpper?s.toUpperCase():s}function u(e,t,n,r){var i,o,a,s,u="",c=t/8;for(s=-1===n?3:0,i=0;i<c;i+=3)for(o=i+1<c?e[i+1>>>2]:0,a=i+2<c?e[i+2>>>2]:0,a=(e[i>>>2]>>>8*(s+i%4*n)&255)<<16|(o>>>8*(s+(i+1)%4*n)&255)<<8|a>>>8*(s+(i+2)%4*n)&255,o=0;4>o;o+=1)u+=8*i+6*o<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-o)&63):r.b64Pad;return u}function c(e,t,n){var r,i,o,a="";for(t/=8,o=-1===n?3:0,r=0;r<t;r+=1)i=e[r>>>2]>>>8*(o+r%4*n)&255,a+=String.fromCharCode(i);return a}function l(e,t,n){t/=8;var r,i,o,a=new ArrayBuffer(t);for(o=new Uint8Array(a),i=-1===n?3:0,r=0;r<t;r+=1)o[r]=e[r>>>2]>>>8*(i+r%4*n)&255;return a}function d(e,t,n){t/=8;var r,i,o=new Uint8Array(t);for(i=-1===n?3:0,r=0;r<t;r+=1)o[r]=e[r>>>2]>>>8*(i+r%4*n)&255;return o}function f(e){var t={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty("b64Pad")&&(t.b64Pad=e.b64Pad),!0===e.hasOwnProperty("shakeLen")){if(0!=e.shakeLen%8)throw Error("shakeLen must be a multiple of 8");t.shakeLen=e.shakeLen}if("boolean"!=typeof t.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw Error("Invalid b64Pad formatting option");return t}function h(e,t,n){switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":e=function(e,t,r){var i,o,a,s,u,c,l=e.length;if(0!=l%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],u=(r=r||0)>>>3,c=-1===n?3:0,i=0;i<l;i+=2){if(o=parseInt(e.substr(i,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(a=(s=(i>>>1)+u)>>>2;t.length<=a;)t.push(0);t[a]|=o<<8*(c+s%4*n)}return{value:t,binLen:4*l+r}};break;case"TEXT":e=function(e,r,i){var o,a,s,u,c,l,d,f,h=0;if(r=r||[0],c=(i=i||0)>>>3,"UTF8"===t)for(f=-1===n?3:0,s=0;s<e.length;s+=1)for(a=[],128>(o=e.charCodeAt(s))?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(s)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),u=0;u<a.length;u+=1){for(l=(d=h+c)>>>2;r.length<=l;)r.push(0);r[l]|=a[u]<<8*(f+d%4*n),h+=1}else if("UTF16BE"===t||"UTF16LE"===t)for(f=-1===n?2:0,a="UTF16LE"===t&&1!==n||"UTF16LE"!==t&&1===n,s=0;s<e.length;s+=1){for(o=e.charCodeAt(s),!0===a&&(o=(u=255&o)<<8|o>>>8),l=(d=h+c)>>>2;r.length<=l;)r.push(0);r[l]|=o<<8*(f+d%4*n),h+=2}return{value:r,binLen:8*h+i}};break;case"B64":e=function(e,t,r){var i,o,a,s,u,c,l,d,f=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=e.indexOf("="),e=e.replace(/\=/g,""),-1!==o&&o<e.length)throw Error("Invalid '=' found in base-64 string");for(t=t||[0],c=(r=r||0)>>>3,d=-1===n?3:0,o=0;o<e.length;o+=4){for(u=e.substr(o,4),a=s=0;a<u.length;a+=1)s|=(i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(u.charAt(a)))<<18-6*a;for(a=0;a<u.length-1;a+=1){for(i=(l=f+c)>>>2;t.length<=i;)t.push(0);t[i]|=(s>>>16-8*a&255)<<8*(d+l%4*n),f+=1}}return{value:t,binLen:8*f+r}};break;case"BYTES":e=function(e,t,r){var i,o,a,s,u,c;for(t=t||[0],a=(r=r||0)>>>3,c=-1===n?3:0,o=0;o<e.length;o+=1)i=e.charCodeAt(o),s=(u=o+a)>>>2,t.length<=s&&t.push(0),t[s]|=i<<8*(c+u%4*n);return{value:t,binLen:8*e.length+r}};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}e=function(e,t,r){return a(new Uint8Array(e),t,r,n)};break;case"UINT8ARRAY":try{e=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}e=function(e,t,r){return a(e,t,r,n)};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return e}function p(e,t){return e<<t|e>>>32-t}function w(e,t){return 32<t?(t-=32,new o(e.b<<t|e.a>>>32-t,e.a<<t|e.b>>>32-t)):0!==t?new o(e.a<<t|e.b>>>32-t,e.b<<t|e.a>>>32-t):e}function v(e,t){return e>>>t|e<<32-t}function P(e,t){var n;return n=new o(e.a,e.b),32>=t?new o(n.a>>>t|n.b<<32-t&4294967295,n.b>>>t|n.a<<32-t&4294967295):new o(n.b>>>t-32|n.a<<64-t&4294967295,n.a>>>t-32|n.b<<64-t&4294967295)}function y(e,t){return 32>=t?new o(e.a>>>t,e.b>>>t|e.a<<32-t&4294967295):new o(0,e.a>>>t-32)}function g(e,t,n){return e&t^~e&n}function m(e,t,n){return new o(e.a&t.a^~e.a&n.a,e.b&t.b^~e.b&n.b)}function A(e,t,n){return e&t^e&n^t&n}function b(e,t,n){return new o(e.a&t.a^e.a&n.a^t.a&n.a,e.b&t.b^e.b&n.b^t.b&n.b)}function W(e){return v(e,2)^v(e,13)^v(e,22)}function I(e){var t=P(e,28),n=P(e,34);return e=P(e,39),new o(t.a^n.a^e.a,t.b^n.b^e.b)}function S(e){return v(e,6)^v(e,11)^v(e,25)}function M(e){var t=P(e,14),n=P(e,18);return e=P(e,41),new o(t.a^n.a^e.a,t.b^n.b^e.b)}function C(e){return v(e,7)^v(e,18)^e>>>3}function O(e){var t=P(e,1),n=P(e,8);return e=y(e,7),new o(t.a^n.a^e.a,t.b^n.b^e.b)}function E(e){return v(e,17)^v(e,19)^e>>>10}function _(e){var t=P(e,19),n=P(e,61);return e=y(e,6),new o(t.a^n.a^e.a,t.b^n.b^e.b)}function x(e,t){var n=(65535&e)+(65535&t);return((e>>>16)+(t>>>16)+(n>>>16)&65535)<<16|65535&n}function j(e,t,n,r){var i=(65535&e)+(65535&t)+(65535&n)+(65535&r);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)&65535)<<16|65535&i}function k(e,t,n,r,i){var o=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&i);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)+(o>>>16)&65535)<<16|65535&o}function T(e,t){var n,r,i;return n=(65535&e.b)+(65535&t.b),i=(65535&(r=(e.b>>>16)+(t.b>>>16)+(n>>>16)))<<16|65535&n,n=(65535&e.a)+(65535&t.a)+(r>>>16),new o((65535&(r=(e.a>>>16)+(t.a>>>16)+(n>>>16)))<<16|65535&n,i)}function U(e,t,n,r){var i,a,s;return i=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b),s=(65535&(a=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(i>>>16)))<<16|65535&i,i=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(a>>>16),new o((65535&(a=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(i>>>16)))<<16|65535&i,s)}function L(e,t,n,r,i){var a,s,u;return a=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b)+(65535&i.b),u=(65535&(s=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(i.b>>>16)+(a>>>16)))<<16|65535&a,a=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(65535&i.a)+(s>>>16),new o((65535&(s=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(i.a>>>16)+(a>>>16)))<<16|65535&a,u)}function N(e,t){return new o(e.a^t.a,e.b^t.b)}function R(e){var t,n=[];if("SHA-1"===e)n=[1732584193,4023233417,2562383102,271733878,3285377520];else if(0===e.lastIndexOf("SHA-",0))switch(n=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],t=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],e){case"SHA-224":break;case"SHA-256":n=t;break;case"SHA-384":n=[new o(3418070365,n[0]),new o(1654270250,n[1]),new o(2438529370,n[2]),new o(355462360,n[3]),new o(1731405415,n[4]),new o(41048885895,n[5]),new o(3675008525,n[6]),new o(1203062813,n[7])];break;case"SHA-512":n=[new o(t[0],4089235720),new o(t[1],2227873595),new o(t[2],4271175723),new o(t[3],1595750129),new o(t[4],2917565137),new o(t[5],725511199),new o(t[6],4215389547),new o(t[7],327033209)];break;default:throw Error("Unknown SHA variant")}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("No SHA variants supported");for(e=0;5>e;e+=1)n[e]=[new o(0,0),new o(0,0),new o(0,0),new o(0,0),new o(0,0)]}return n}function F(e,t){var n,r,i,o,a,s,u,c=[];for(n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=0;80>u;u+=1)c[u]=16>u?e[u]:p(c[u-3]^c[u-8]^c[u-14]^c[u-16],1),s=20>u?k(p(n,5),r&i^~r&o,a,1518500249,c[u]):40>u?k(p(n,5),r^i^o,a,1859775393,c[u]):60>u?k(p(n,5),A(r,i,o),a,2400959708,c[u]):k(p(n,5),r^i^o,a,3395469782,c[u]),a=o,o=i,i=p(r,30),r=n,n=s;return t[0]=x(n,t[0]),t[1]=x(r,t[1]),t[2]=x(i,t[2]),t[3]=x(o,t[3]),t[4]=x(a,t[4]),t}function H(e,t,n,r){var i;for(i=15+(t+65>>>9<<4);e.length<=i;)e.push(0);for(e[t>>>5]|=128<<24-t%32,t+=n,e[i]=4294967295&t,e[i-1]=t/4294967296|0,t=e.length,i=0;i<t;i+=16)r=F(e.slice(i,i+16),r);return r}function z(e,t,n){var r,i,a,s,u,c,l,d,f,h,p,w,v,P,y,N,R,F,H,z,B,Y,V,q=[];if("SHA-224"===n||"SHA-256"===n)h=64,w=1,Y=Number,v=x,P=j,y=k,N=C,R=E,F=W,H=S,B=A,z=g,V=D;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");h=80,w=2,Y=o,v=T,P=U,y=L,N=O,R=_,F=I,H=M,B=b,z=m,V=G}for(n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],p=0;p<h;p+=1)16>p?(f=p*w,d=e.length<=f?0:e[f],f=e.length<=f+1?0:e[f+1],q[p]=new Y(d,f)):q[p]=P(R(q[p-2]),q[p-7],N(q[p-15]),q[p-16]),d=y(l,H(s),z(s,u,c),V[p],q[p]),f=v(F(n),B(n,r,i)),l=c,c=u,u=s,s=v(a,d),a=i,i=r,r=n,n=v(d,f);return t[0]=v(n,t[0]),t[1]=v(r,t[1]),t[2]=v(i,t[2]),t[3]=v(a,t[3]),t[4]=v(s,t[4]),t[5]=v(u,t[5]),t[6]=v(c,t[6]),t[7]=v(l,t[7]),t}function B(e,t){var n,r,i,a,s=[],u=[];if(null!==e)for(r=0;r<e.length;r+=2)t[(r>>>1)%5][(r>>>1)/5|0]=N(t[(r>>>1)%5][(r>>>1)/5|0],new o(e[r+1],e[r]));for(n=0;24>n;n+=1){for(a=R("SHA3-"),r=0;5>r;r+=1){i=t[r][0];var c=t[r][1],l=t[r][2],d=t[r][3],f=t[r][4];s[r]=new o(i.a^c.a^l.a^d.a^f.a,i.b^c.b^l.b^d.b^f.b)}for(r=0;5>r;r+=1)u[r]=N(s[(r+4)%5],w(s[(r+1)%5],1));for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)t[r][i]=N(t[r][i],u[r]);for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)a[i][(2*r+3*i)%5]=w(t[r][i],Y[r][i]);for(r=0;5>r;r+=1)for(i=0;5>i;i+=1)t[r][i]=N(a[r][i],new o(~a[(r+1)%5][i].a&a[(r+2)%5][i].a,~a[(r+1)%5][i].b&a[(r+2)%5][i].b));t[0][0]=N(t[0][0],V[n])}return t}var D,G,Y,V;G=[new o((D=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])[0],3609767458),new o(D[1],602891725),new o(D[2],3964484399),new o(D[3],2173295548),new o(D[4],4081628472),new o(D[5],3053834265),new o(D[6],2937671579),new o(D[7],3664609560),new o(D[8],2734883394),new o(D[9],1164996542),new o(D[10],1323610764),new o(D[11],3590304994),new o(D[12],4068182383),new o(D[13],991336113),new o(D[14],633803317),new o(D[15],3479774868),new o(D[16],2666613458),new o(D[17],944711139),new o(D[18],2341262773),new o(D[19],2007800933),new o(D[20],1495990901),new o(D[21],1856431235),new o(D[22],3175218132),new o(D[23],2198950837),new o(D[24],3999719339),new o(D[25],766784016),new o(D[26],2566594879),new o(D[27],3203337956),new o(D[28],1034457026),new o(D[29],2466948901),new o(D[30],3758326383),new o(D[31],168717936),new o(D[32],1188179964),new o(D[33],1546045734),new o(D[34],1522805485),new o(D[35],2643833823),new o(D[36],2343527390),new o(D[37],1014477480),new o(D[38],1206759142),new o(D[39],344077627),new o(D[40],1290863460),new o(D[41],3158454273),new o(D[42],3505952657),new o(D[43],106217008),new o(D[44],3606008344),new o(D[45],1432725776),new o(D[46],1467031594),new o(D[47],851169720),new o(D[48],3100823752),new o(D[49],1363258195),new o(D[50],3750685593),new o(D[51],3785050280),new o(D[52],3318307427),new o(D[53],3812723403),new o(D[54],2003034995),new o(D[55],3602036899),new o(D[56],1575990012),new o(D[57],1125592928),new o(D[58],2716904306),new o(D[59],442776044),new o(D[60],593698344),new o(D[61],3733110249),new o(D[62],2999351573),new o(D[63],3815920427),new o(3391569614,3928383900),new o(3515267271,566280711),new o(3940187606,3454069534),new o(4118630271,4000239992),new o(116418474,1914138554),new o(174292421,2731055270),new o(289380356,3203993006),new o(460393269,320620315),new o(685471733,587496836),new o(852142971,1086792851),new o(1017036298,365543100),new o(1126000580,2618297676),new o(1288033470,3409855158),new o(1501505948,4234509866),new o(1607167915,987167468),new o(1816402316,1246189591)],V=[new o(0,1),new o(0,32898),new o(2147483648,32906),new o(2147483648,2147516416),new o(0,32907),new o(0,2147483649),new o(2147483648,2147516545),new o(2147483648,32777),new o(0,138),new o(0,136),new o(0,2147516425),new o(0,2147483658),new o(0,2147516555),new o(2147483648,139),new o(2147483648,32905),new o(2147483648,32771),new o(2147483648,32770),new o(2147483648,128),new o(0,32778),new o(2147483648,2147483658),new o(2147483648,2147516545),new o(2147483648,32896),new o(0,2147483649),new o(2147483648,2147516424)],Y=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]],void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},496(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(){var e;return e=function*(e){var t=WPP.whatsapp.CatalogStore.get(e);if(t||(t=yield WPP.whatsapp.CatalogStore.find(WPP.whatsapp.WidFactory.createWid(e))),!t)throw{error:!0,code:"catalog_not_found",message:"Catalog not found"};return t.productCollection?t.productCollection.serialize():[]},i=function(){var t=this,n=arguments;return new Promise(function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)})},i.apply(this,arguments)}function o(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function a(e,t){return s.apply(this,arguments)}function s(){var e;return e=function*(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("object"==typeof e&&e._serialized&&(e=e._serialized),"string"!=typeof e)return!1;var r=yield WPP.chat.getMessageById(e);if(!r)return!1;var i=!1;if(n)try{i=WAPI.processMessageObj(r,!0,!0)}catch(e){}else i=r;if("function"!=typeof t)return i;t(i)},s=function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)})},s.apply(this,arguments)}function u(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function c(){var e;return e=function*(e){var t=yield a(e,null,!1);if(!t)throw{error:!0,code:"message_not_found",message:"Message not found"};if("order"!==t.type)throw{error:!0,code:"message_is_not_an_order",message:"Message is not an order"};var n=WPP.order.get(e);if(n||(n=yield WPP.whatsapp.OrderStore.findOrder(t.orderId,t.sellerJid,t.token)),!n)throw{error:!0,code:"order_not_found",message:"Order not found"};return n.products},c=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,s,"next",e)}function s(e){u(o,r,i,a,s,"throw",e)}a(void 0)})},c.apply(this,arguments)}function l(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function d(){var e;return e=function*(e){return yield new Promise((t,n)=>{var r=new XMLHttpRequest;r.onload=function(){if(4==r.readyState)if(200==r.status){var e=new FileReader;e.readAsDataURL(r.response),e.onload=function(n){t(e.result.substr(e.result.indexOf(",")+1))}}else console.error(r.statusText);else t(!1)},r.open("GET",e,!0),r.responseType="blob",r.send(null)})},d=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){l(o,r,i,a,s,"next",e)}function s(e){l(o,r,i,a,s,"throw",e)}a(void 0)})},d.apply(this,arguments)}function f(e,t){var n=e.split(","),r=n[0].match(/(?:data:)?(.*?)(?:;base64)?$/i)[1];r=r.split(/\s+;\s+/).join("; ");for(var i=window.Base64?window.Base64.atob(n[1]):atob(n[1]),o=i.length,a=new Uint8Array(o);o--;)a[o]=i.charCodeAt(o);return new File([a],t,{type:r})}var h=n(730);function p(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function w(e){return v.apply(this,arguments)}function v(){var e;return e=function*(e){var t=yield e.arrayBuffer(),n=new h("SHA-256","ARRAYBUFFER");return n.update(t),n.getHash("B64")},v=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){p(o,r,i,a,s,"next",e)}function s(e){p(o,r,i,a,s,"throw",e)}a(void 0)})},v.apply(this,arguments)}function P(e){for(var t="",n=0;n<e;n++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function b(){var e;return e=function*(e,t){var n=yield w(t),r=P(32),i=(new AbortController).signal,o=yield window.Store.UploadUtils.encryptAndUpload({blob:t,type:e,signal:i,mediaKey:r});return g(g({},o),{},{clientUrl:o.url,filehash:n,id:n,uploadhash:o.encFilehash,mediaBlob:t})},b=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){A(o,r,i,a,s,"next",e)}function s(e){A(o,r,i,a,s,"throw",e)}a(void 0)})},b.apply(this,arguments)}function W(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function I(){var e;return e=function*(e){var t=[];e?t.push(WAPI.getAllChatsWithNewMsg().map(e=>WAPI.getChat(e.id._serialized))):t.push(WAPI.getAllChatIds().map(e=>WAPI.getChat(e)));var n=(yield Promise.all(t)).flatMap(e=>e),r=JSON.stringify(n);return JSON.parse(r)},I=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){W(o,r,i,a,s,"next",e)}function s(e){W(o,r,i,a,s,"throw",e)}a(void 0)})},I.apply(this,arguments)}function S(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function M(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){S(o,r,i,a,s,"next",e)}function s(e){S(o,r,i,a,s,"throw",e)}a(void 0)})}}var C=function(){var e=M(function*(){var e=yield Promise.all(WPP.whatsapp.ContactStore.map(function(){var e=M(function*(e){return yield WAPI._serializeContactObj(e)});return function(t){return e.apply(this,arguments)}}()));return e});return function(){return e.apply(this,arguments)}}();function O(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function E(){var e;return e=function*(e,t,n,r){var i=yield WAPI.sendExist(e),o=[];if(!i.erro){var a=i.msgs.getModelsArray();for(var s in a)if("remove"!==s){var u=a[s],c=WAPI.processMessageObj(u,t,n);c&&o.push(c)}}return void 0!==r&&r(o),o},E=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){O(o,r,i,a,s,"next",e)}function s(e){O(o,r,i,a,s,"throw",e)}a(void 0)})},E.apply(this,arguments)}var _=function(e){return e.unreadCount>0},x=function(e){var t=WPP.whatsapp.ChatStore.filter(_).map(e=>WAPI._serializeChatObj(e));return void 0!==e&&e(t),t};function j(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var k=function(){var e,t=(e=function*(){var e=x().map(e=>WPP.chat.getMessages(e.id,{count:e.unreadCount}));return(yield Promise.all(e)).flat().map(WAPI._serializeMessageObj)},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){j(o,r,i,a,s,"next",e)}function s(e){j(o,r,i,a,s,"throw",e)}a(void 0)})});return function(){return t.apply(this,arguments)}}();function T(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function U(){var e;return e=function*(e,t){var n=yield WAPI.getChat(e);return n=!!n&&WAPI._serializeChatObj(n),void 0!==t&&t(n),n},U=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){T(o,r,i,a,s,"next",e)}function s(e){T(o,r,i,a,s,"throw",e)}a(void 0)})},U.apply(this,arguments)}function L(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function N(){var e;return e=function*(e,t){var n=[],r=window.WAPI.getAllGroups();for(var i in r)try{(yield window.WAPI.getGroupParticipantIDs(r[i].id)).filter(t=>t==e).length&&n.push(r[i])}catch(e){console.log("Error in group:"),console.log(r[i]),console.log(e)}return void 0!==t&&t(n),n},N=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){L(o,r,i,a,s,"next",e)}function s(e){L(o,r,i,a,s,"throw",e)}a(void 0)})},N.apply(this,arguments)}function R(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function F(){var e;return e=function*(e,t){var n=WPP.whatsapp.GroupMetadataStore.find(e);return void 0!==t&&t(n),n},F=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){R(o,r,i,a,s,"next",e)}function s(e){R(o,r,i,a,s,"throw",e)}a(void 0)})},F.apply(this,arguments)}function H(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function z(){var e;return e=function*(e,t){var n=yield Promise.resolve(WPP.group.getParticipants()).then(e=>e.map(e=>e.id));return void 0!==t&&t(n),n},z=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){H(o,r,i,a,s,"next",e)}function s(e){H(o,r,i,a,s,"throw",e)}a(void 0)})},z.apply(this,arguments)}function B(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function D(){var e;return e=function*(e){return(yield WAPI.getGroupMetadata(e)).participants},D=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){B(o,r,i,a,s,"next",e)}function s(e){B(o,r,i,a,s,"throw",e)}a(void 0)})},D.apply(this,arguments)}function G(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Y(){var e;return e=function*(e,t){var n=yield WPP.contact.queryExists(e);if(!n||void 0===n.wid)throw 404;var r=window.WAPI._serializeNumberStatusObj({jid:n.wid,status:200,isBusiness:n.biz});return 200==r.status&&(r.numberExists=!0),void 0!==t&&(t(window.WAPI._serializeNumberStatusObj(n)),t(r)),r},Y=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){G(o,r,i,a,s,"next",e)}function s(e){G(o,r,i,a,s,"throw",e)}a(void 0)})},Y.apply(this,arguments)}function V(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function q(e,t){return J.apply(this,arguments)}function J(){var e;return e=function*(e,t){var n=WAPI.getChat(e);if(!n)return t&&t(!1),!1;try{yield WPP.whatsapp.MsgStore.findQuery({remote:n.id,count:-1})}catch(e){}for(;!n.msgs.msgLoadState.noEarlierMsgs;)yield n.loadEarlierMsgs();return t&&t(!0),!0},J=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){V(o,r,i,a,s,"next",e)}function s(e){V(o,r,i,a,s,"throw",e)}a(void 0)})},J.apply(this,arguments)}function K(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Q(){var e;return e=function*(e,t,n,r){return WAPI.loadAllEarlierMessages(e).then(i=>{var o=WAPI.getChat(e);if(!o)throw{error:!0,code:"chat_not_found",message:"Chat not found"};var a=[],s=o.msgs.getModelsArray();for(var u in s)if("remove"!==u){var c=s[u],l=WAPI.processMessageObj(c,t,n);l&&a.push(l)}return void 0!==r&&r(a),a})},Q=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){K(o,r,i,a,s,"next",e)}function s(e){K(o,r,i,a,s,"throw",e)}a(void 0)})},Q.apply(this,arguments)}function X(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Z(){var e;return e=function*(e){var t=WAPI.getChat(e);if(t){var n=yield t.loadEarlierMsgs();if(n)return n.map(WAPI._serializeMessageObj)}return!1},Z=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){X(o,r,i,a,s,"next",e)}function s(e){X(o,r,i,a,s,"throw",e)}a(void 0)})},Z.apply(this,arguments)}function $(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ee(e,t){return te.apply(this,arguments)}function te(){var e;return e=function*(e,t){Array.isArray(t)||(t=[t]);var n=new Store.MediaCollection({chatParticipantCount:e.getParticipantCount()});return yield n.processAttachments("0.4.613"===Debug.VERSION?t:t.map(e=>({file:e})),e,1),n},te=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){$(o,r,i,a,s,"next",e)}function s(e){$(o,r,i,a,s,"throw",e)}a(void 0)})},te.apply(this,arguments)}function ne(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function re(){var e;return e=function*(e,t){e=parseInt(e,10);var n=WPP.whatsapp.ChatStore.get(t);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};switch(e){case 0:window.Store.ChatStates.sendChatStateComposing(n.id);break;case 1:window.Store.ChatStates.sendChatStateRecording(n.id);break;case 2:window.Store.ChatStates.sendChatStatePaused(n.id);break;default:return!1}return!0},re=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ne(o,r,i,a,s,"next",e)}function s(e){ne(o,r,i,a,s,"throw",e)}a(void 0)})},re.apply(this,arguments)}function ie(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function oe(e,t,n,r,i){return ae.apply(this,arguments)}function ae(){var e;return e=function*(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(i=i||"sendFile","string"!=typeof n&&null!=n||"string"!=typeof r&&null!=r)return WAPI.scope(t,!0,null,"incorrect parameter, insert an string.");var u=e.match(/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/);u&&u.length&&(u=u[1]);var c=yield WAPI.sendExist(t);if(c.erro)return c;var l=null;if("string"==typeof o&&o){var d=yield a(o,null,!1);d&&d.canReply()&&(l=d)}var h=f(e,n),p=(yield ee(c,h)).getModelsArray()[0],w=(yield p.sendToChat(c,{caption:r,quotedMsg:l,isViewOnce:s}))||"",v={type:i,filename:n,text:r,mimeType:u},P=yield WAPI.getchatId(c.id);if("success"===w||"OK"===w){var y=WAPI.scope(P,!1,w,null);return Object.assign(y,v),y}return y=WAPI.scope(P,!0,w,null),Object.assign(y,v),y},ae=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ie(o,r,i,a,s,"next",e)}function s(e){ie(o,r,i,a,s,"throw",e)}a(void 0)})},ae.apply(this,arguments)}function se(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ue(){var e;return e=function*(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=yield WAPI.sendExist(t);if(s.erro)return s;var u=null;if("string"==typeof o&&o){var c=yield a(o,null,!1);c&&c.canReply()&&(u=c)}var l=f(e,n),d=(yield ee(s,l)).getModelsArray()[0];d.mediaPrep._mediaData.type="ptt";var h=(yield d.sendToChat(s,{caption:r,quotedMsg:u}))||"";void 0!==i&&i(!0);var p={type:"ptt",filename:n,text:r},w=yield WAPI.getchatId(s.id);if("success"===h||"OK"===h){var v=WAPI.scope(w,!1,h,null);return Object.assign(v,p),v}return v=WAPI.scope(w,!0,h,null),Object.assign(v,p),v},ue=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){se(o,r,i,a,s,"next",e)}function s(e){se(o,r,i,a,s,"throw",e)}a(void 0)})},ue.apply(this,arguments)}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function le(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function de(){var e;return e=function*(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=yield WAPI.sendExist(e);if(i.erro)return i;var o,a={ack:0,id:WPP.chat.generateMessageID(i.id),local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:i.id,isNewMsg:!0,type:"location",lat:t,lng:n,loc:r},s=(yield Promise.all(WPP.whatsapp.functions.addAndSendMsgToChat(i,a)))[1]||"",u={latitude:t,longitude:n,title:r,type:"location"},c=yield WAPI.getchatId(i.id);return"success"==s||"OK"==s?(o=WAPI.scope(c,!1,s,null),Object.assign(o,u),o):(o=WAPI.scope(c,!0,s,null),Object.assign(o,u),o)},de=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){le(o,r,i,a,s,"next",e)}function s(e){le(o,r,i,a,s,"throw",e)}a(void 0)})},de.apply(this,arguments)}function fe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function he(){var e;return e=function*(e,t){var n=yield WAPI.sendExist(e);if(n.erro)return n;var r=WPP.chat.generateMessageID(n.id),i={id:r,body:t,type:"chat",subtype:null,t:parseInt((new Date).getTime()/1e3),from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:n.id,self:"out",isNewMsg:!0,local:!0,ack:0,urlText:null,urlNumber:null},o=(yield Promise.all(WPP.whatsapp.functions.addAndSendMsgToChat(n,i)))[1]||"";if("success"===o||"OK"===o)return null==r?void 0:r._serialized;var a={type:"sendtext",text:i},s=yield WAPI.getchatId(n.id),u=WAPI.scope(s,!0,o,null);return Object.assign(u,a),u},he=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){fe(o,r,i,a,s,"next",e)}function s(e){fe(o,r,i,a,s,"throw",e)}a(void 0)})},he.apply(this,arguments)}function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(n),!0).forEach(function(t){ve(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ve(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ye(){var e;return e=function*(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=WPP.chat.get(e)||(yield WPP.chat.find(e)),i={};n.attachment&&(t=(i=yield WWebJS.processMediaData(n.attachment,n.sendAudioAsVoice)).preview,delete n.attachment);var o={};if(n.quotedMessageId){var s=yield a(n.quotedMessageId,null,!1);s&&s.canReply()&&(o=s.msgContextInfo(r)),delete n.quotedMessageId}n.mentionedJidList&&(n.mentionedJidList=n.mentionedJidList.map(e=>WPP.whatsapp.ContactStore.get(e).id));var u={};n.location&&(u={type:"location",loc:n.location.description,lat:n.location.latitude,lng:n.location.longitude},delete n.location);var c={};if(n.contactCard){var l=WPP.whatsapp.ContactStore.get(n.contactCard);c={body:WPP.whatsapp.VCard.vcardFromContactModel(l).vcard,type:"vcard",vcardFormattedName:l.formattedName},delete n.contactCard}else if(n.contactCardList)c={type:"multi_vcard",vcardList:n.contactCardList.map(e=>WPP.whatsapp.ContactStore.get(e)).map(e=>WPP.whatsapp.VCard.vcardFromContactModel(e)),body:void 0},delete n.contactCardList;else if(n.parseVCards&&"string"==typeof t&&t.startsWith("BEGIN:VCARD")){delete n.parseVCards;try{var d=yield WPP.whatsapp.VCard.parseVcard(t);d&&(c={type:"vcard",vcardFormattedName:yield WPP.whatsapp.VCard.vcardGetNameFromParsed(d)})}catch(e){}}if(n.linkPreview){delete n.linkPreview;var f=yield window.Store.Validators.findLink(t);if(f&&!WPP.conn.isMultiDevice()){var h=yield WPP.whatsapp.functions.queryLinkPreview(f.url);h.preview=!0,h.subtype="url",n=we(we({},n),h)}}var p=WPP.chat.generateMessageID(r.id),w=we(we(we(we(we({id:p,ack:0,body:t,from:WPP.whatsapp.UserPrefs.getMaybeMeUser(),to:r.id,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),isNewMsg:!0,type:"chat"},n),u),i),o),c);return yield WPP.whatsapp.functions.addAndSendMsgToChat(r,w),p._serialized},ye=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Pe(o,r,i,a,s,"next",e)}function s(e){Pe(o,r,i,a,s,"throw",e)}a(void 0)})},ye.apply(this,arguments)}function ge(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function me(){var e;return e=function*(e,t){var n=e.id?e:WPP.whatsapp.ChatStore.get(e),r=n.id._serialized,i=n.msgs.filter(e=>e.__x_isSentByMe)[0];if(!i)return n.sendMessage(t);var o=Object.create(i),a=WPP.chat.generateMessageID(r),s=t.match(/@(\d*)/g).map(e=>new WPP.whatsapp.WidFactory.createUserWid(e.replace("@","")))||void 0,u={ack:0,id:a,local:!0,self:"out",t:parseInt((new Date).getTime()/1e3),to:new WPP.whatsapp.WidFactory.createWid(r),isNewMsg:!0,type:"chat",body:t,quotedMsg:null,mentionedJidList:s};return Object.assign(o,u),yield WPP.whatsapp.functions.addAndSendMsgToChat(n,o),a._serialized},me=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ge(o,r,i,a,s,"next",e)}function s(e){ge(o,r,i,a,s,"throw",e)}a(void 0)})},me.apply(this,arguments)}function Ae(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function be(){var e;return e=function*(e,t,n,r,i){var o=yield WAPI.sendExist(t);if(o.erro)return o;var a=f(e,n),s=(yield ee(o,a)).getModelsArray()[0];s.mediaPrep._mediaData.isGif=!0,s.mediaPrep._mediaData.gifAttribution=1;var u=(yield s.sendToChat(o,{caption:r}))||"",c={filename:n,text:r},l=yield WAPI.getchatId(o.id);if("success"===u||"OK"===u){void 0!==i&&i(!1);var d=WAPI.scope(l,!1,u,null);return Object.assign(d,c),d}return void 0!==i&&i(!0),d=WAPI.scope(l,!0,u,null),Object.assign(d,c),d},be=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Ae(o,r,i,a,s,"next",e)}function s(e){Ae(o,r,i,a,s,"throw",e)}a(void 0)})},be.apply(this,arguments)}function We(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ie(){var e;return e=function*(e){yield window.Store.Perfil.setPushname(e)},Ie=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){We(o,r,i,a,s,"next",e)}function s(e){We(o,r,i,a,s,"throw",e)}a(void 0)})},Ie.apply(this,arguments)}function Se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Me(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ce(){var e;return e=function*(e,t,n){Array.isArray(t)||(t=[t]),yield WAPI.sendExist(e);var r=WPP.whatsapp.ChatStore.get(e);if(!r)throw{error:!0,code:"chat_not_found",message:"Chat not found",chatId:e};var i,o=[],s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Se(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Se(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(s.s();!(i=s.n()).done;){var u=i.value,c="string"==typeof u?u:u.id,l=yield a(c,null,!1);if(!l)throw{error:!0,code:"message_not_found",message:"Message not Found",messageId:c};o.push(l)}}catch(e){s.e(e)}finally{s.f()}var d=o.filter(e=>!n||!e.isSentByMe);return yield r.forwardMessages(d),yield new Promise(e=>setTimeout(e,100)),r.msgs.getModelsArray().slice(-1*t.length).map(e=>e.id._serialized)},Ce=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Me(o,r,i,a,s,"next",e)}function s(e){Me(o,r,i,a,s,"throw",e)}a(void 0)})},Ce.apply(this,arguments)}function Oe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ee(){var e;return e=function*(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=yield WPP.chat.getMessages(e,t);if(!Array.isArray(n)){var r=new Error("Failed to fetch messages for ".concat(e));throw Object.assign(r,n),r}return n.map(e=>new WPP.whatsapp.MsgStore.modelClass(e)).map(e=>WAPI.processMessageObj(e,!0,!0))},Ee=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Oe(o,r,i,a,s,"next",e)}function s(e){Oe(o,r,i,a,s,"throw",e)}a(void 0)})},Ee.apply(this,arguments)}function _e(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function xe(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){_e(o,r,i,a,s,"next",e)}function s(e){_e(o,r,i,a,s,"throw",e)}a(void 0)})}}function je(){return(je=xe(function*(e){return"dark"==e||"light"==e?(yield Store.Theme.setTheme(e),!0):console.error("Use type dark or light")})).apply(this,arguments)}function ke(){return(ke=xe(function*(){return yield Store.Theme.getTheme()})).apply(this,arguments)}function Te(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ue(){var e;return e=function*(e,t,n){n=n||"";var r={Protocol:"^(https?:\\/\\/)?",Domain:"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|",IP:"((\\d{1,3}\\.){3}\\d{1,3}))",Port:"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*",Query:"(\\?[;&a-z\\d%_.~+=-]*)?",End:"(\\#[-a-z\\d_]*)?$",Reg:()=>new RegExp(r.Protocol+r.Domain+r.IP+r.Port+r.Query+r.End,"i")};if(!r.Reg().test(t))return n="Use a valid HTTP protocol. Example: https://www.youtube.com/watch?v=V1bFr2SWP1",WAPI.scope(e,!0,null,n);var i=yield WAPI.sendExist(e);if(i.erro)return i;var o=WPP.conn.isMultiDevice()?void 0:yield WPP.whatsapp.functions.queryLinkPreview(t),a=(yield i.sendMessage(n.includes(t)?n:"".concat(t,"\n").concat(n),{linkPreview:o}))||"",s={type:"LinkPreview",url:t,text:n},u=yield WAPI.getchatId(i.id);if("success"===a||"OK"===a){var c=WAPI.scope(u,!1,a,null);return Object.assign(c,s),c}return c=WAPI.scope(u,!0,a,null),Object.assign(c,s),c},Ue=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Te(o,r,i,a,s,"next",e)}function s(e){Te(o,r,i,a,s,"throw",e)}a(void 0)})},Ue.apply(this,arguments)}function Le(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ne(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Le(o,r,i,a,s,"next",e)}function s(e){Le(o,r,i,a,s,"throw",e)}a(void 0)})}}function Re(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{me:WPP.whatsapp.Conn.attributes,to:e,erro:t,text:r,status:n}}function Fe(){return(Fe=Ne(function*(e){var t=yield WAPI.getChatById(e),n=t.lastReceivedKey||{},r={formattedName:t.contact.formattedName,isBusiness:t.contact.isBusiness,isMyContact:t.contact.isMyContact,verifiedName:t.contact.verifiedName,pushname:t.contact.pushname};return Object.assign(n,r),n})).apply(this,arguments)}function He(){return He=Ne(function*(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return Re(e,!0,500,"Chat ID is empty");var r=yield window.WAPI.getChat(e);if(r||"status@broadcast"!==e||(r=new WPP.whatsapp.ChatStore.modelClass({id:WPP.whatsapp.WidFactory.createWid("status@broadcast")}),WPP.whatsapp.ChatStore.add(r),r=yield window.WAPI.getChat(e)),!r&&!e.includes("@g")){var i=yield window.WAPI.checkNumberStatus(e);if(!i.numberExists)return Re(e,!0,i.status,"The number does not exist");yield WPP.chat.find(i.id),e=i.id._serialized,r=yield window.WAPI.getChat(e)}return r?(n&&(yield WPP.chat.markIsRead(r.id).catch(()=>null)),t?r:Re(e,!1,200)):Re(e,!0,404)}),He.apply(this,arguments)}function ze(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Be(){var e;return e=function*(e,t){t||(t=WPP.whatsapp.UserPrefs.getMaybeMeUser());var n=WPP.whatsapp.WidFactory.createWid(t),r="data:image/jpeg;base64,";return yield WPP.whatsapp.functions.sendSetPicture(n,r+e.b,r+e.a)},Be=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ze(o,r,i,a,s,"next",e)}function s(e){ze(o,r,i,a,s,"throw",e)}a(void 0)})},Be.apply(this,arguments)}function De(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ge(){var e;return e=function*(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("boolean"!=typeof t||"boolean"!=typeof n)return WAPI.scope(e,!0,null,"incorrect parameter, insert a boolean true or false");var r=t?"pin":"unpin",i=void 0,o=yield WAPI.sendExist(e,!0,n);if(o.erro)return o;var a={type:"pinChat",typefix:r},s=yield WAPI.getchatId(o.id);return yield Store.pinChat.setPin(o,t).then(e=>{var t=WAPI.scope(s,!1,"OK",null);Object.assign(t,a),i=t}).catch(e=>{var t=WAPI.scope(s,!0,e,"Pin Chat first");Object.assign(t,a),i=t}),i},Ge=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){De(o,r,i,a,s,"next",e)}function s(e){De(o,r,i,a,s,"throw",e)}a(void 0)})},Ge.apply(this,arguments)}function Ye(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Ve(){var e;return e=function*(){if(window.localStorage){var e=yield JSON.parse(JSON.stringify(window.localStorage));return{WABrowserId:e.WABrowserId,WASecretBundle:e.WASecretBundle,WAToken1:e.WAToken1,WAToken2:e.WAToken2}}},Ve=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Ye(o,r,i,a,s,"next",e)}function s(e){Ye(o,r,i,a,s,"throw",e)}a(void 0)})},Ve.apply(this,arguments)}function qe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Je(){var e;return e=function*(e,t,n){var r=yield WAPI.sendExist(e);if(r.erro)return r;var i,o=null,a=null,s=null,u=yield WAPI.getchatId(r.id),c=yield window.Store.Mute.get(r.id),l={type:"sendMute",time:t,timeType:n};if("number"==typeof t&&"string"==typeof n){switch(n){case"hours":o=parseInt(new Date((new Date).setHours((new Date).getHours()+t)).getTime()/1e3);break;case"minutes":o=parseInt(new Date((new Date).setMinutes((new Date).getMinutes()+t)).getTime()/1e3);break;case"year":o=parseInt(new Date((new Date).setDate((new Date).getDate()+t)).getTime()/1e3)}yield window.Store.SendMute.sendConversationMute(r.id,o,0).then(e=>{a=e}).catch(e=>{a=e})}else s=!0,yield window.Store.SendMute.sendConversationMute(r.id,0,c.__x_expiration).then(e=>{a=e}).catch(e=>{a=e});if(200===a.status){s?(c.__x_expiration=0,c.__x_isMuted=!1):(c.__x_expiration=o,c.__x_isMuted=!0);var d=WAPI.scope(u,!1,a.status,null);return Object.assign(d,l),d}return i=s?"is not mute to remove":"This chat is already mute",d=WAPI.scope(u,!0,a.status,i),Object.assign(d,l),d},Je=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){qe(o,r,i,a,s,"next",e)}function s(e){qe(o,r,i,a,s,"throw",e)}a(void 0)})},Je.apply(this,arguments)}function Ke(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Qe(){var e;return e=function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=(yield window.Store.Mute)._models,n=new Array,r=new Array;for(var i in t)t[i].__x_isMuted?r.push(WAPI.interfaceMute(t[i])):n.push(WAPI.interfaceMute(t[i]));var o=null;switch(console.log(0,e),e){case"all":o=[{total:r.length+n.length,amountToMute:r.length,amountnoMute:n.length},r,n];break;case"toMute":o=[{total:r.length},r];break;case"noMute":o=[{total:n.length},n]}return o},Qe=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Ke(o,r,i,a,s,"next",e)}function s(e){Ke(o,r,i,a,s,"throw",e)}a(void 0)})},Qe.apply(this,arguments)}function Xe(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var Ze=null,$e=!0;function et(){return tt.apply(this,arguments)}function tt(){var e;return e=function*(){if("MAIN"===WPP.whatsapp.Stream.mode&&"TIMEOUT"!==WPP.whatsapp.Socket.state)return $e?($e=!1,WPP.whatsapp.Socket.sendBasic({tag:WPP.whatsapp.Socket.tag("ping"),data:["admin","test"]}).then(()=>{$e=!0})):(WPP.whatsapp.Socket.phoneWatchdog.activate(),void WPP.whatsapp.Socket.phoneWatchdog.poke(250))},tt=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Xe(o,r,i,a,s,"next",e)}function s(e){Xe(o,r,i,a,s,"throw",e)}a(void 0)})},tt.apply(this,arguments)}function nt(){Ze&&clearInterval(Ze),Ze=null}function rt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return it(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?it(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function it(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ot(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function at(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ot(o,r,i,a,s,"next",e)}function s(e){ot(o,r,i,a,s,"throw",e)}a(void 0)})}}function st(){return(st=at(function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=rt(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=new WPP.whatsapp.WidFactory.createWid(i);Store.Presence.get(o)||(yield Store.Presence.find(o),n++)}}catch(e){r.e(e)}finally{r.f()}return n})).apply(this,arguments)}function ut(){return(ut=at(function*(e){Array.isArray(e)||(e=[e]);var t,n=0,r=rt(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=new WPP.whatsapp.WidFactory.createWid(i),a=Store.Presence.get(o);a&&(a.delete(),n++)}}catch(e){r.e(e)}finally{r.f()}return n})).apply(this,arguments)}function ct(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function lt(){var e;return e=function*(e){void 0===e&&(e=!0),e?yield WPP.whatsapp.ChatPresence.sendPresenceAvailable():yield WPP.whatsapp.ChatPresence.sendPresenceUnavailable()},lt=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ct(o,r,i,a,s,"next",e)}function s(e){ct(o,r,i,a,s,"throw",e)}a(void 0)})},lt.apply(this,arguments)}function dt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ft(){var e;return e=function*(e,t){var n=WPP.whatsapp.ChatStore.get(e);if(!n)throw{error:!0,code:"chat_not_found",message:"Chat not found"};return n.isGroup?yield WPP.group.setProperty(n.id,"ephemeral",t):(t=t?604800:0,yield Store.changeEphemeralDuration(n,t).catch(e=>{throw{error:!0,code:e.code||e.status||e.statusCode||"unknown",message:e.message||e.reason||"Unknown Error"}}),!0)},ft=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){dt(o,r,i,a,s,"next",e)}function s(e){dt(o,r,i,a,s,"throw",e)}a(void 0)})},ft.apply(this,arguments)}function ht(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function pt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ht(o,r,i,a,s,"next",e)}function s(e){ht(o,r,i,a,s,"throw",e)}a(void 0)})}}function wt(){return wt=pt(function*(e,t){void 0===t&&(t=!0),Array.isArray(e)||(e=[e]);var n=yield Promise.all(e.map(function(){var e=pt(function*(e){return yield a(e,null,!1)});return function(t){return e.apply(this,arguments)}}())),r=(n=n.filter(e=>e&&e.star!==t)).reduce(function(e,t){var n=t.id.remote._serialized;return e[n]=e[n]||[],e[n].push(t),e},Object.create(null)),i=0,o=function*(){var e=WPP.whatsapp.ChatStore.get(s),n=r[s];i+=(yield e.sendStarMsgs(n,t).then(()=>n.length).catch(()=>0))};for(var s in r)yield*o();return i}),wt.apply(this,arguments)}function vt(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return window.WAPI._newMessagesCallbacks.push({callback:t,rmAfterUse:e}),!0}function Pt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function yt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var gt={};function mt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var At=function(){var e,t=(e=function*(e){var t=WPP.whatsapp.WidFactory.createWid(e),n=WPP.whatsapp.ProfilePicThumbStore.get(t);return n||(n=yield WPP.whatsapp.ProfilePicThumbStore.find(t)),n?WAPI._serializeProfilePicThumb(n):null},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){mt(o,r,i,a,s,"next",e)}function s(e){mt(o,r,i,a,s,"throw",e)}a(void 0)})});return function(e){return t.apply(this,arguments)}}(),bt=[{id:"Store",conditions:e=>e.default&&e.default.Chat&&e.default.Msg?e.default:null},{id:"MediaCollection",conditions:e=>e.default&&e.default.prototype&&void 0!==e.default.prototype.processAttachments?e.default:null},{id:"GroupInvite",conditions:e=>e.sendQueryGroupInviteCode?e:null},{id:"Archive",conditions:e=>e.setArchive?e:null},{id:"pinChat",conditions:e=>e.setPin.toString().includes(".unproxy")?e:null},{id:"Perfil",conditions:e=>e.setPushname&&!e.getComposeContents},{id:"ChatStates",conditions:e=>e.sendChatStatePaused&&e.sendChatStateRecording&&e.sendChatStateComposing?e:null},{id:"MediaObject",conditions:e=>e.getOrCreateMediaObject&&e.disassociateMediaFromStickerPack?e:null},{id:"UploadUtils",conditions:e=>e.default&&e.default.encryptAndUpload?e.default:null},{id:"Theme",conditions:e=>e.getTheme&&e.setTheme?e:null},{id:"SendMute",conditions:e=>e.sendConversationMute?e:null},{id:"Validators",conditions:e=>e.findLinks?e:null},{id:"changeEphemeralDuration",conditions:e=>e.changeEphemeralDuration},{id:"sendCreateGroup",conditions:e=>e.sendCreateGroup},{id:"sendQueryGroupInvite",conditions:e=>e.sendQueryGroupInvite?e.sendQueryGroupInvite:null}];function Wt(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function It(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){Wt(o,r,i,a,s,"next",e)}function s(e){Wt(o,r,i,a,s,"throw",e)}a(void 0)})}}function St(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Mt=new Promise(e=>{WPP.isReady?e():WPP.webpack.onReady(e)});void 0===window.Store&&(window.Store={},window.Store.promises={},Mt.then(()=>{var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return St(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?St(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(bt);try{var n=function(){var t=e.value;window.Store.promises[t.id]=Promise.resolve(WPP.webpack.search(t.conditions)).then(e=>(e||console.error("Store Object '".concat(t.id,"' was not found")),e)).then(t.conditions).then(e=>{"Store"===t.id?window.Store=Object.assign({},window.Store,e):window.Store[t.id]=e})};for(t.s();!(e=t.n()).done;)n()}catch(e){t.e(e)}finally{t.f()}})),void 0===window.WAPI&&(window.WAPI={lastRead:{}},window.WAPI.interfaceMute=function(e){return{attributes:e.attributes,expiration:e.expiration,id:e.id,isMuted:e.isMuted,isState:e.isState,promises:e.promises,stale:e.stale}},window.WAPI.setProfilePic=function(e,t){return Be.apply(this,arguments)},window.WAPI.getSessionTokenBrowser=function(){return Ve.apply(this,arguments)},window.WAPI.scope=Re,window.WAPI.getchatId=function(e){return Fe.apply(this,arguments)},window.WAPI.sendExist=function(e){return He.apply(this,arguments)},window.WAPI.pinChat=function(e){return Ge.apply(this,arguments)},window.WAPI.setTemporaryMessages=function(e,t){return ft.apply(this,arguments)},window.WAPI.setTheme=function(e){return je.apply(this,arguments)},window.WAPI.getTheme=function(){return ke.apply(this,arguments)},window.WAPI._serializeRawObj=e=>e&&e.toJSON?e.toJSON():{},window.WAPI._serializeChatObj=e=>null==e?null:Object.assign(window.WAPI._serializeRawObj(e),{kind:e.kind,isBroadcast:e.isBroadcast,isGroup:e.isGroup,isUser:e.isUser,contact:e.contact?window.WAPI._serializeContactObj(e.contact):null,groupMetadata:e.groupMetadata?window.WAPI._serializeRawObj(e.groupMetadata):null,presence:e.presence?window.WAPI._serializeRawObj(e.presence):null,msgs:null}),window.WAPI._serializeContactObj=e=>{if(null==e)return null;var t=null;if(!e.profilePicThumb&&e.id&&WPP.whatsapp.ProfilePicThumbStore){var n=WPP.whatsapp.ProfilePicThumbStore.get(e.id);t=n?WAPI._serializeProfilePicThumb(n):{}}return Object.assign(window.WAPI._serializeRawObj(e),{formattedName:e.formattedName,isHighLevelVerified:e.isHighLevelVerified,isMe:e.isMe,isMyContact:e.isMyContact,isPSA:e.isPSA,isUser:e.isUser,isVerified:e.isVerified,isWAContact:e.isWAContact,profilePicThumbObj:t,statusMute:e.statusMute,msgs:null})},window.WAPI._serializeMessageObj=e=>{var t,n,r,i,o,a,s;return null==e?null:(e.quotedMsg&&e.quotedMsgObj&&e.quotedMsgObj(),Object.assign(window.WAPI._serializeRawObj(e),{id:e.id._serialized,from:e.from._serialized,quotedParticipant:null==e||null===(t=e.quotedParticipant)||void 0===t?void 0:t._serialized,author:null==e||null===(n=e.author)||void 0===n?void 0:n._serialized,chatId:(null==e||null===(r=e.id)||void 0===r?void 0:r.remote)||(null==e||null===(i=e.chatId)||void 0===i?void 0:i._serialized),to:null==e||null===(o=e.to)||void 0===o?void 0:o._serialized,fromMe:null==e||null===(a=e.id)||void 0===a?void 0:a.fromMe,sender:e.senderObj?WAPI._serializeContactObj(e.senderObj):null,timestamp:e.t,content:e.body,isGroupMsg:e.isGroupMsg,isLink:e.isLink,isMMS:e.isMMS,isMedia:e.isMedia,isNotification:e.isNotification,isPSA:e.isPSA,type:e.type,quotedMsgId:null==e||null===(s=e._quotedMsgObj)||void 0===s||null===(s=s.id)||void 0===s?void 0:s._serialized,mediaData:window.WAPI._serializeRawObj(e.mediaData)}))},window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI._serializeProfilePicThumb=e=>null==e?null:Object.assign({},{eurl:e.eurl,id:e.id,img:e.img,imgFull:e.imgFull,raw:e.raw,tag:e.tag}),window.WAPI._profilePicfunc=At,window.WAPI.sendChatstate=function(e,t){return re.apply(this,arguments)},window.WAPI.sendMessageWithThumb=function(e,t,n,r,i,o){var a=WAPI.getChat(i);if(void 0===a)return void 0!==o&&o(!1),!1;var s={canonicalUrl:t,description:r,matchedText:t,title:n,thumbnail:e};return a.sendMessage(t,{linkPreview:s,mentionedJidList:[],quotedMsg:null,quotedMsgAdminGroupJid:null}),void 0!==o&&o(!0),!0},window.WAPI.processMessageObj=function(e,t,n){return e.isNotification?n?WAPI._serializeMessageObj(e):void 0:!1===e.id.fromMe||t?WAPI._serializeMessageObj(e):void 0},window.WAPI.sendMessageWithTags=function(e,t){return me.apply(this,arguments)},window.WAPI.sendMessage=function(e,t){return he.apply(this,arguments)},window.WAPI.sendMessage2=function(e,t,n){var r=WAPI.getChat(e);if(void 0!==r)try{return void 0!==n?r.sendMessage(t).then(function(){n(!0)}):r.sendMessage(t),!0}catch(e){return void 0!==n&&n(!1),!1}return void 0!==n&&n(!1),!1},window.WAPI.sendImage=function(e,t,n,r,i,o){return oe(e,t,n,r,"sendImage",i,o)},window.WAPI.sendPtt=function(e,t,n,r,i){return ue.apply(this,arguments)},window.WAPI.sendFile=oe,window.WAPI.setMyName=function(e){return Ie.apply(this,arguments)},window.WAPI.sendVideoAsGif=function(e,t,n,r,i){return be.apply(this,arguments)},window.WAPI.processFiles=ee,window.WAPI.sendImageWithProduct=function(e,t,n,r,i,o){WPP.whatsapp.CatalogStore.findCarouselCatalog(r).then(r=>{if(r&&r[0]){var a=r[0].productCollection.get(i),s={productMsgOptions:{businessOwnerJid:a.catalogWid.toString({legacy:!0}),productId:a.id.toString(),url:a.url,productImageCount:a.productImageCollection.length,title:a.name,description:a.description,currencyCode:a.currency,priceAmount1000:a.priceAmount1000,type:"product"},caption:n},u=new WPP.whatsapp.WidFactory.createWid(t);return WPP.chat.find(u).then(t=>{var n=f(e,a.name);ee(t,n).then(e=>{var n=e.getModelsArray()[0];Object.entries(s.productMsgOptions).map(e=>{var t,r,i=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,r)||function(e,t){if(e){if("string"==typeof e)return ce(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],a=i[1];return n.mediaPrep._mediaData[o]=a}),n.mediaPrep.sendToChat(t,s),void 0!==o&&o(!0)})})}})},window.WAPI.createProduct=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"BRL",u=arguments.length>8?arguments[8]:void 0;WPP.catalog.createProduct({name:t,image:e,description:n,price:r,isHidden:i,url:o,retailerId:a,currency:s}).then(e=>{void 0!==u&&u(e)})},window.WAPI.forwardMessages=function(e,t,n){return Ce.apply(this,arguments)},window.WAPI.encryptAndUploadFile=function(e,t){return b.apply(this,arguments)},window.WAPI.setOnlinePresence=function(e){return lt.apply(this,arguments)},window.WAPI.sendLocation=function(e,t,n){return de.apply(this,arguments)},window.WAPI.sendLinkPreview=function(e,t,n){return Ue.apply(this,arguments)},window.WAPI.sendMessageOptions=function(e,t){return ye.apply(this,arguments)},window.WAPI.starMessages=function(e,t){return wt.apply(this,arguments)},window.WAPI.getAllContacts=C,window.WAPI.getMyContacts=function(e){var t=WPP.whatsapp.ContactStore.filter(e=>!0===e.isMyContact).map(e=>WAPI._serializeContactObj(e));return void 0!==e&&e(t),t},window.WAPI.getContact=function(e,t){var n=WPP.whatsapp.ContactStore.get(e);return void 0!==t&&t(window.WAPI._serializeContactObj(n)),window.WAPI._serializeContactObj(n)},window.WAPI.getAllChats=function(e){var t=WPP.whatsapp.ChatStore.map(e=>WAPI._serializeChatObj(e));return void 0!==e&&e(t),t},window.WAPI.haveNewMsg=_,window.WAPI.getAllChatsWithNewMsg=x,window.WAPI.getAllChatIds=function(e){var t=WPP.whatsapp.ChatStore.map(e=>e.id._serialized||e.id);return void 0!==e&&e(t),t},window.WAPI.getAllNewMessages=function(){return x().map(e=>WAPI.getChat(e.id)).flatMap(e=>e.msgs.filter(e=>e.isNewMsg)).map(WAPI._serializeMessageObj)||[]},window.WAPI.getAllUnreadMessages=k,window.WAPI.getAllChatsWithMessages=function(e){return I.apply(this,arguments)},window.WAPI.getAllGroups=function(e){var t=WPP.whatsapp.ChatStore.filter(e=>e.isGroup);return void 0!==e&&e(t),t},window.WAPI.getChat=function(e){if(!e)return!1;e="string"==typeof e?e:e._serialized;var t=WPP.whatsapp.ChatStore.get(e);return t&&(t.sendMessage=t.sendMessage?t.sendMessage:function(){return WPP.whatsapp.functions.sendTextMsgToChat(this,...arguments)}),t},window.WAPI.getChatByName=function(e,t){var n=WPP.chat.find(t=>t.name===e);return void 0!==t&&t(n),n},window.WAPI.getNewId=function(){for(var e="",t=0;t<20;t++)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return e},window.WAPI.getChatById=function(e,t){return U.apply(this,arguments)},window.WAPI.getUnreadMessagesInChat=function(e,t,n,r){for(var i=WAPI.getChat(e).msgs._models,o=[],a=i.length-1;a>=0;a--)if("remove"!==a){var s=i[a];if("boolean"==typeof s.isNewMsg&&!1!==s.isNewMsg){s.isNewMsg=!1;var u=WAPI.processMessageObj(s,t,n);u&&o.push(u)}}return void 0!==r&&r(o),o},window.WAPI.loadEarlierMessages=function(e){return Z.apply(this,arguments)},window.WAPI.loadAllEarlierMessages=q,window.WAPI.asyncLoadAllEarlierMessages=function(e,t){q(e),t()},window.WAPI.areAllMessagesLoaded=function(e,t){return WAPI.getChat(e).msgs.msgLoadState.noEarlierMsgs?(t&&t(!0),!0):(t&&t(!1),!1)},window.WAPI.loadEarlierMessagesTillDate=function(e,t,n){var r=WAPI.getChat(e),i=function(){r.msgs.getModelsArray()[0].t>t&&!r.msgs.msgLoadState.noEarlierMsgs?r.loadEarlierMsgs().then(i):n()};i()},window.WAPI.getAllGroupMetadata=function(e){var t=WPP.whatsapp.GroupMetadataStore.map(e=>e.attributes);return void 0!==e&&e(t),t},window.WAPI.getGroupMetadata=function(e,t){return F.apply(this,arguments)},window.WAPI._getGroupParticipants=function(e){return D.apply(this,arguments)},window.WAPI.getGroupParticipantIDs=function(e,t){return z.apply(this,arguments)},window.WAPI.getAllMessagesInChat=function(e,t,n,r){return E.apply(this,arguments)},window.WAPI.loadAndGetAllMessagesInChat=function(e,t,n,r){return Q.apply(this,arguments)},window.WAPI.getUnreadMessages=function(e,t,n,r){var i=WPP.whatsapp.ChatStore.getModelsArray(),o=[];for(var a in i)if(!isNaN(a)){var s=i[a],u=WAPI._serializeChatObj(s);u.messages=[];for(var c=s.msgs._models,l=c.length-1;l>=0;l--){var d=c[l];if("boolean"==typeof d.isNewMsg&&!1!==d.isNewMsg){d.isNewMsg=!1;var f=WAPI.processMessageObj(d,e,t);f&&u.messages.push(f)}}if(u.messages.length>0)o.push(u);else if(n){for(var h=s.unreadCount,p=c.length-1;p>=0;p--){var w=c[p];if(h>0){if(!w.isSentByMe){var v=WAPI.processMessageObj(w,e,t);u.messages.unshift(v),h-=1}}else{if(-1!==h)break;if(!w.isSentByMe){var P=WAPI.processMessageObj(w,e,t);u.messages.unshift(P);break}}}u.messages.length>0&&(s.unreadCount=0,o.push(u))}}return void 0!==r&&r(o),o},window.WAPI.getCommonGroups=function(e,t){return N.apply(this,arguments)},window.WAPI.downloadFile=function(e){return d.apply(this,arguments)},window.WAPI.getNumberProfile=function(e,t){return Y.apply(this,arguments)},window.WAPI.getMessageById=a,window.WAPI.getMessages=function(e){return Ee.apply(this,arguments)},window.WAPI.getFileHash=w,window.WAPI.generateMediaKey=P,window.WAPI.arrayBufferToBase64=function(e){for(var t,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),o=i.byteLength,a=o%3,s=o-a,u=0;u<s;u+=3)n+=r[(16515072&(t=i[u]<<16|i[u+1]<<8|i[u+2]))>>18]+r[(258048&t)>>12]+r[(4032&t)>>6]+r[63&t];return 1==a?n+=r[(252&(t=i[s]))>>2]+r[(3&t)<<4]+"==":2==a&&(n+=r[(64512&(t=i[s]<<8|i[s+1]))>>10]+r[(1008&t)>>4]+r[(15&t)<<2]+"="),n},window.WAPI.getListMute=function(){return Qe.apply(this,arguments)},window.WAPI.getHost=function(){return WPP.whatsapp.Conn.attributes},window.WAPI.getWid=function(){var e;return null===(e=WPP.whatsapp.UserPrefs.getMaybeMeUser())||void 0===e?void 0:e._serialized},window.WAPI.getMe=function(e){var t=WPP.whatsapp.ContactStore.get(WPP.whatsapp.UserPrefs.getMaybeMeUser());return void 0!==e&&e(t.all),t.all},window.WAPI.isConnected=function(e){var t=null==document.querySelector('[data-testid="alert-phone"]')&&null==document.querySelector('[data-testid="alert-computer"]');return void 0!==e&&e(t),t},window.WAPI.isLoggedIn=function(e){var t=WPP.whatsapp.ContactStore&&void 0!==WPP.whatsapp.ContactStore.checksum;return void 0!==e&&e(t),t},window.WAPI.getBatteryLevel=function(){return WPP.whatsapp.Conn.attributes.battery},window.WAPI.base64ImageToFile=f,window.WAPI.base64ToFile=f,window.WAPI.sendMute=function(e,t,n){return Je.apply(this,arguments)},window.WAPI.startPhoneWatchdog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;nt(),Ze=setInterval(et,e)},window.WAPI.stopPhoneWatchdog=nt,window.WAPI.subscribePresence=function(e){return st.apply(this,arguments)},window.WAPI.unsubscribePresence=function(e){return ut.apply(this,arguments)},window.WAPI.getBusinessProfilesProducts=function(e){return i.apply(this,arguments)},window.WAPI.getOrderbyMsg=function(e){return c.apply(this,arguments)},window.WAPI._newMessagesQueue=[],window.WAPI._newMessagesBuffer=null!=sessionStorage.getItem("saved_msgs")?JSON.parse(sessionStorage.getItem("saved_msgs")):[],window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesCallbacks=[],window.addEventListener("unload",window.WAPI._unloadInform,!1),window.addEventListener("beforeunload",window.WAPI._unloadInform,!1),window.addEventListener("pageunload",window.WAPI._unloadInform,!1),window.WAPI.getProfilePicSmallFromId=function(){var e=It(function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=It(function*(e){return void 0!==e.img&&(yield window.WAPI.downloadFileWithCredentials(e.img))});return function(t){return e.apply(this,arguments)}}(),function(e){return!1})});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getProfilePicFromId=function(){var e=It(function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=It(function*(e){return void 0!==e.imgFull&&(yield window.WAPI.downloadFileWithCredentials(e.imgFull))});return function(t){return e.apply(this,arguments)}}(),function(e){return!1})});return function(t){return e.apply(this,arguments)}}(),window.WAPI.downloadFileWithCredentials=function(){var e=It(function*(e){if(!axios||!e)return!1;var t=(yield axios.get(e,{responseType:"arraybuffer"})).data;return btoa(new Uint8Array(t).reduce((e,t)=>e+String.fromCharCode(t),""))});return function(t){return e.apply(this,arguments)}}(),window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI.checkNumberStatus=function(){var e=It(function*(e){var t=yield WPP.contact.queryExists(e);return t?{id:t.wid,isBusiness:t.biz,canReceiveMessage:!0,numberExists:!0,status:200}:{id:e,isBusiness:!1,canReceiveMessage:!1,numberExists:!1,status:404}});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getChatIsOnline=function(){var e=It(function*(e){var t=WPP.whatsapp.ChatStore.get(e);return!!t&&(yield t.presence.subscribe(),t.presence.attributes.isOnline)});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getLastSeen=function(){var e=It(function*(e){var t=WPP.whatsapp.ChatStore.get(e);return!!t&&(t.presence.hasData||(yield t.presence.subscribe(),yield new Promise(e=>setTimeout(e,100))),t.presence.chatstate.t||!1)});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getWAVersion=function(){return window.Debug.VERSION},window.WAPI.deleteOldChats=function(){var e=It(function*(e){try{var t=yield window.WAPI.chat.list({onlyWithUnreadMessage:!1,onlyUsers:!0});t.reverse();for(var n=Math.min(e,t.length),r=0;r<n;r++)yield window.WAPI.chat.delete(t[r].id._serialized).then(e=>!0).catch(e=>!1)}catch(e){return console.error("Erro:",e),e}});return function(t){return e.apply(this,arguments)}}(),window.WAPI.archiveChat=function(){var e=It(function*(e,t){var n=Store.Archive.setArchive(WPP.whatsapp.ChatStore.get(e),t).then(e=>!0).catch(e=>!1);return yield Promise.resolve(n)});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendTextStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendTextStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendImageStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendImageStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendVideoStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendVideoStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.takeOver=It(function*(){return yield WPP.whatsapp.Socket.takeover(),!0}),window.WAPI.onIncomingCall=function(e){return WPP.whatsapp.CallStore.on("add",e),!0},window.WAPI.onInterfaceChange=function(e){var t=()=>({displayInfo:WPP.whatsapp.Stream.displayInfo,mode:WPP.whatsapp.Stream.mode,info:WPP.whatsapp.Stream.info});return e(t()),WPP.whatsapp.Stream.on("change:info change:displayInfo change:mode",()=>{e(t())}),!0},window.WAPI.onStreamModeChanged=function(e){return e(WPP.conn.getStreamData().mode),WPP.on("conn.stream_mode_changed",t=>{e(t)}),!0},window.WAPI.onStreamInfoChanged=function(e){return e(WPP.conn.getStreamData().info),WPP.on("conn.stream_info_changed",t=>{e(t)}),!0},window.WAPI.setMessagesAdminsOnly=function(){var e=It(function*(e,t){return yield WPP.group.setProperty(e,"announcement",t),!0});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.logout=It(function*(){return yield WPP.conn.logout()}),window.WAPI.isRegistered=function(){return WPP.webpack.search(e=>e.isRegistered).isRegistered()},Mt.then(function(){var e=!1,t=()=>WPP.whatsapp.Socket.stream;window.WAPI.onStreamChange=function(n){return WPP.whatsapp.Socket.on("change:stream",()=>n(t())),e||(e=!0,n(t())),!0}}),Mt.then(function(){var e=!1,t=()=>WPP.whatsapp.Socket.state;window.WAPI.onStateChange=function(n){return WPP.whatsapp.Socket.on("change:state",()=>n(t())),e||(e=!0,n(t())),!0}}),Mt.then(function(){window.WAPI._newMessagesListener=WPP.whatsapp.MsgStore.on("add",e=>{e&&e.isNewMsg&&!e.isSentByMe&&!e.isStatusV3&&setTimeout(()=>{var t=window.WAPI.processMessageObj(e,!1,!1);t&&(window.WAPI._newMessagesQueue.push(t),window.WAPI._newMessagesBuffer.push(t)),!window.WAPI._newMessagesDebouncer&&window.WAPI._newMessagesQueue.length>0&&(window.WAPI._newMessagesDebouncer=setTimeout(()=>{var e=window.WAPI._newMessagesQueue;window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesQueue=[];var t=[];window.WAPI._newMessagesCallbacks.forEach(function(n){void 0!==n.callback&&n.callback(e),!0===n.rmAfterUse&&t.push(n)}),t.forEach(function(e){var t=window.WAPI._newMessagesCallbacks.indexOf(e);window.WAPI._newMessagesCallbacks.splice(t,1)})},1e3))},e.body?0:2e3)}),window.WAPI._unloadInform=e=>{window.WAPI._newMessagesBuffer.forEach(e=>{Object.keys(e).forEach(t=>void 0===e[t]?delete e[t]:"")}),sessionStorage.setItem("saved_msgs",JSON.stringify(window.WAPI._newMessagesBuffer)),window.WAPI._newMessagesCallbacks.forEach(function(e){void 0!==e.callback&&e.callback({status:-1,message:"page will be reloaded, wait and register callback again."})})}}),Mt.then(function(){window.WAPI.waitNewMessages=vt}),Mt.then(function(){window.WAPI.allNewMessagesListener=e=>WPP.whatsapp.MsgStore.on("add",t=>{t&&t.isNewMsg&&setTimeout(()=>{var n=window.WAPI.processMessageObj(t,!0,!1);n&&e(n)},t.body?0:2e3)})}),Mt.then(function(){window.WAPI.waitNewAcknowledgements=function(e){return WPP.whatsapp.MsgStore.on("change:ack",e),!0}}),Mt.then(function(){window.WAPI.onAddedToGroup=function(e){return WPP.whatsapp.MsgStore.on("add",t=>{if(t.isNewMsg&&t.isNotification&&"gp2"===t.type&&"add"===t.subtype)try{var n=WAPI._serializeChatObj(t.chat);e(n)}catch(e){console.error(e)}}),!0}}),Mt.then(function(){var e=[];function t(t){var n=Object.assign({},t);n.jid&&(n.id=n.jid.toString());for(var r=0,i=e;r<i.length;r++){var o=i[r];try{o(n)}catch(e){}}}WPP.on("chat.live_location_start",e=>{t({type:"enable",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,shareDuration:e.shareDuration})}),WPP.on("chat.live_location_update",e=>{t({type:"update",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,elapsed:e.elapsed,lastUpdated:e.lastUpdated})}),WPP.on("chat.live_location_end",e=>{t({type:"disablle",id:e.id.toString(),chat:e.chat.toString()})}),window.WAPI.onLiveLocation=function(){var t,n=(t=function*(t){e.push(t)},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){Pt(o,r,i,a,s,"next",e)}function s(e){Pt(o,r,i,a,s,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}()}),Mt.then(function(){window.WAPI.onParticipantsChanged=function(){var e,t=(e=function*(e,t){var n=["invite","add","remove","leave","promote","demote"],r=WPP.whatsapp.ChatStore.get(e),i=WPP.whatsapp.GroupMetadataStore.get(e);gt[e]||(gt[e]={},i.participants.forEach(t=>{gt[e][t.id.toString()]={subtype:"add",from:i.owner}}));var o=0;return r.on("change:groupMetadata.participants",i=>r.on("all",(i,a)=>{var s=a.isGroup,u=a.previewMessage;if(s&&"change"===i&&u&&"gp2"===u.type&&n.includes(u.subtype)){var c=u.subtype,l=u.from,d=u.recipients,f=d[0].toString();gt[e][f]&&gt[e][d[0]].subtype==c||(0==o?o++:(gt[e][f]={subtype:c,from:l},t({by:l.toString(),action:c,who:d}),r.off("all",this),o=0))}})),!0},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){yt(o,r,i,a,s,"next",e)}function s(e){yt(o,r,i,a,s,"throw",e)}a(void 0)})});return function(e,n){return t.apply(this,arguments)}}()}),Mt.then(function(){window.WAPI.onNotificationMessage=function(e){return WPP.whatsapp.MsgStore.on("add",t=>{if(t.isNotification&&t.isNewMsg){var n=WAPI._serializeMessageObj(t);e(n)}}),!0}}),Mt.then(function(){window.WAPI.onPresenceChanged=function(e){return setTimeout(()=>{WPP.whatsapp.ChatStore.map(e=>e.presence.subscribe())},1e3),WPP.whatsapp.PresenceStore.on("change:chatstate.type",t=>{try{var n=WPP.whatsapp.PresenceStore.getModelsArray().find(e=>e.chatstate===t);if(!n||!n.hasData||!n.chatstate.type)return;var r=WPP.whatsapp.ContactStore.get(n.id),i={id:n.id,isOnline:n.isOnline,isGroup:n.isGroup,isUser:n.isUser,shortName:r?r.formattedShortName:"",state:n.chatstate.type,t:Date.now()};n.isUser&&(i.isContact=!n.chatstate.deny),n.isGroup&&(i.participants=n.chatstates.getModelsArray().filter(e=>!!e.type).map(e=>{var t=WPP.whatsapp.ContactStore.get(e.id);return{id:e.id.toString(),state:e.type,shortName:t?t.formattedShortName:""}})),e(i)}catch(e){console.log(e)}}),!0}}))},490(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof P?t:P,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:M(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",h="suspendedYield",p="executing",w="completed",v={};function P(){}function y(){}function g(){}var m={};c(m,a,function(){return this});var A=Object.getPrototypeOf,b=A&&A(A(x([])));b&&b!==n&&r.call(b,a)&&(m=b);var W=g.prototype=P.prototype=Object.create(m);function I(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){function n(i,o,a,s){var u=d(e[i],e,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then(function(e){n("next",e,a,s)},function(e){n("throw",e,a,s)}):t.resolve(l).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t(function(t,i){n(e,r,t,i)})}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=f;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===w){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=C(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=w,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var c=d(e,n,r);if("normal"===c.type){if(i=r.done?w:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=w,r.method="throw",r.arg=c.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=d(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function x(e){if(null!=e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=g,i(W,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:y,configurable:!0}),y.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,u,"GeneratorFunction")),e.prototype=Object.create(W),e},e.awrap=function(e){return{__await:e}},I(S.prototype),c(S.prototype,s,function(){return this}),e.AsyncIterator=S,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new S(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},I(W),c(W,u,"Generator"),c(W,a,function(){return this}),c(W,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=x,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n(490),n(496)})();
@@ -0,0 +1,130 @@
1
+ // @ts-check
2
+ import js from '@eslint/js';
3
+ import tseslint from 'typescript-eslint';
4
+ import headerPlugin from '@tony.ganchev/eslint-plugin-header';
5
+ import prettierPlugin from 'eslint-plugin-prettier';
6
+ import prettierConfig from 'eslint-config-prettier';
7
+ import globals from 'globals';
8
+
9
+ const licenseHeader = [
10
+ '',
11
+ ' * This file is part of WPPConnect.',
12
+ ' *',
13
+ ' * WPPConnect is free software: you can redistribute it and/or modify',
14
+ ' * it under the terms of the GNU Lesser General Public License as published by',
15
+ ' * the Free Software Foundation, either version 3 of the License, or',
16
+ ' * (at your option) any later version.',
17
+ ' *',
18
+ ' * WPPConnect is distributed in the hope that it will be useful,',
19
+ ' * but WITHOUT ANY WARRANTY; without even the implied warranty of',
20
+ ' * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the',
21
+ ' * GNU Lesser General Public License for more details.',
22
+ ' *',
23
+ ' * You should have received a copy of the GNU Lesser General Public License',
24
+ ' * along with WPPConnect. If not, see <https://www.gnu.org/licenses/>.',
25
+ ' ',
26
+ ];
27
+
28
+ export default tseslint.config(
29
+ // ─── Global ignores ────────────────────────────────────────────────────────
30
+ {
31
+ ignores: ['dist/**', 'node_modules/**', 'tokens/**'],
32
+ },
33
+
34
+ // ─── Base rules for all files ──────────────────────────────────────────────
35
+ {
36
+ extends: [js.configs.recommended],
37
+ plugins: {
38
+ header: headerPlugin,
39
+ prettier: prettierPlugin,
40
+ },
41
+ rules: {
42
+ 'no-async-promise-executor': 'off',
43
+ 'no-constant-condition': 'off',
44
+ 'no-empty': ['error', { allowEmptyCatch: true }],
45
+ 'no-unused-vars': 'off',
46
+ 'no-useless-assignment': 'off',
47
+ 'no-useless-catch': 'off',
48
+ 'no-useless-escape': 'off',
49
+ 'prefer-const': 'off',
50
+ 'preserve-caught-error': 'off',
51
+ 'header/header': [2, 'block', licenseHeader, 1],
52
+ 'prettier/prettier': ['error', { endOfLine: 'auto' }],
53
+ },
54
+ },
55
+
56
+ // ─── TypeScript source files ───────────────────────────────────────────────
57
+ {
58
+ files: ['src/**/*.ts'],
59
+ extends: [...tseslint.configs.recommended],
60
+ rules: {
61
+ '@typescript-eslint/ban-ts-comment': 'off',
62
+ '@typescript-eslint/ban-types': 'off',
63
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
64
+ '@typescript-eslint/no-duplicate-enum-values': 'off',
65
+ '@typescript-eslint/no-empty-function': 'off',
66
+ '@typescript-eslint/no-explicit-any': 'off',
67
+ '@typescript-eslint/no-inferrable-types': 'off',
68
+ '@typescript-eslint/no-namespace': 'off',
69
+ '@typescript-eslint/no-require-imports': 'off',
70
+ '@typescript-eslint/no-unsafe-function-type': 'off',
71
+ '@typescript-eslint/no-unused-expressions': 'off',
72
+ '@typescript-eslint/no-unused-vars': 'off',
73
+ '@typescript-eslint/no-var-requires': 'off',
74
+ '@typescript-eslint/no-wrapper-object-types': 'off',
75
+ '@typescript-eslint/prefer-namespace-keyword': 'off',
76
+ 'prefer-const': 'off',
77
+ },
78
+ },
79
+
80
+ // ─── Lib JS files (browser + custom globals) ──────────────────────────────
81
+ {
82
+ files: ['src/lib/**/*.js'],
83
+ ignores: ['src/lib/**/webpack.*.js', 'src/lib/**/gulpfile.js'],
84
+ languageOptions: {
85
+ ecmaVersion: 2022,
86
+ sourceType: 'module',
87
+ globals: {
88
+ ...globals.browser,
89
+ ...globals.commonjs,
90
+ ...globals.amd,
91
+ ...globals.es2015,
92
+ axios: 'readonly',
93
+ Debug: 'readonly',
94
+ Store: 'readonly',
95
+ WAPI: 'readonly',
96
+ WPP: 'readonly',
97
+ webpackJsonp: 'readonly',
98
+ WWebJS: 'readonly',
99
+ },
100
+ },
101
+ rules: {
102
+ 'no-array-constructor': 'off',
103
+ 'no-prototype-builtins': 'off',
104
+ 'no-redeclare': 'off',
105
+ },
106
+ },
107
+
108
+ // ─── Webpack / gulpfile (Node env, no browser globals) ────────────────────
109
+ {
110
+ files: ['src/lib/**/webpack.*.js', 'src/lib/**/gulpfile.js'],
111
+ languageOptions: {
112
+ globals: globals.node,
113
+ },
114
+ },
115
+
116
+ // ─── Examples ──────────────────────────────────────────────────────────────
117
+ {
118
+ files: ['examples/**/*.js'],
119
+ languageOptions: {
120
+ globals: {
121
+ ...globals.node,
122
+ ...globals.commonjs,
123
+ ...globals.es2015,
124
+ },
125
+ },
126
+ },
127
+
128
+ // ─── Prettier (disable conflicting rules — must be last) ───────────────────
129
+ prettierConfig
130
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wppconnect-team/wppconnect",
3
- "version": "1.40.1",
3
+ "version": "1.41.1",
4
4
  "description": "WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination... 😀🤔💭",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,9 +17,9 @@
17
17
  "docs:build": "npm run docs:clean && typedoc && npm run docs:copy-images",
18
18
  "docs:clean": "shx rm -rf api-docs",
19
19
  "docs:copy-images": "shx cp -R ./img ./api-docs",
20
- "lint:js": "npx eslint -c .eslintrc.js --ext .js src",
21
- "lint:ts": "npx eslint -c .eslintrc.js --ext .ts src",
22
- "lint": "npm run lint:ts && npm run lint:js",
20
+ "lint:js": "eslint 'src/**/*.js'",
21
+ "lint:ts": "eslint 'src/**/*.ts'",
22
+ "lint": "eslint src/",
23
23
  "prepare": "husky install && npm run clean && npm run build",
24
24
  "release": "release-it",
25
25
  "start": "npm run build:client && tsc app.ts && node app.js",
@@ -62,6 +62,7 @@
62
62
  "@commitlint/cli": "^20.4.2",
63
63
  "@commitlint/config-conventional": "^20.4.2",
64
64
  "@commitlint/cz-commitlint": "^20.4.1",
65
+ "@eslint/js": "^10.0.1",
65
66
  "@types/atob": "^2.1.4",
66
67
  "@types/mime-types": "^3.0.1",
67
68
  "@types/mocha": "^10.0.10",
@@ -69,16 +70,15 @@
69
70
  "@types/shelljs": "^0.10.0",
70
71
  "@types/tmp": "^0.2.6",
71
72
  "@types/ws": "^8.18.1",
72
- "@typescript-eslint/eslint-plugin": "^5.62.0",
73
- "@typescript-eslint/parser": "^5.62.0",
74
73
  "babel-loader": "^10.0.0",
75
74
  "commitizen": "^4.3.1",
76
75
  "concurrently": "^9.2.1",
77
76
  "conventional-changelog-cli": "^5.0.0",
78
- "eslint": "^8.57.1",
77
+ "eslint": "10.0.3",
79
78
  "eslint-config-prettier": "^10.1.8",
80
- "eslint-plugin-header": "^3.1.1",
81
- "eslint-plugin-prettier": "^4.2.5",
79
+ "@tony.ganchev/eslint-plugin-header": "^3.3.3",
80
+ "eslint-plugin-prettier": "^5.5.5",
81
+ "globals": "^15.0.0",
82
82
  "husky": "^9.1.7",
83
83
  "mocha": "^11.7.5",
84
84
  "prettier": "^2.8.8",
@@ -89,12 +89,13 @@
89
89
  "ts-node": "^10.9.2",
90
90
  "typedoc": "^0.28.17",
91
91
  "typescript": "^5.9.3",
92
+ "typescript-eslint": "^8.57.1",
92
93
  "webpack": "^5.105.2",
93
94
  "webpack-cli": "^6.0.1"
94
95
  },
95
96
  "dependencies": {
96
- "@wppconnect/wa-js": "^3.22.1",
97
- "@wppconnect/wa-version": "^1.5.3099",
97
+ "@wppconnect/wa-js": "^3.23.2",
98
+ "@wppconnect/wa-version": "^1.5.3379",
98
99
  "atob": "^2.1.2",
99
100
  "axios": "^1.13.5",
100
101
  "boxen": "^5.1.2",