From a0944f1ede7c5247b3546ee31ac359923140c4ed Mon Sep 17 00:00:00 2001 From: 3mora2 <66757189+3mora2@users.noreply.github.com> Date: Tue, 11 Jun 2024 14:51:09 +0300 Subject: [PATCH] fix Bug Fixes - Fixed checkNumberStatus function - Fixed Perfil not defined in WAPI - Fixed options in send video-image status - Fixed get profile pic for groups (close wppconnect-server Features: - Added support to send mentionedList in images --- WPP_Whatsapp/api/layers/LabelsLayer.py | 13 ++++-- WPP_Whatsapp/api/layers/RetrieverLayer.py | 56 ++++++++++++++++++----- WPP_Whatsapp/api/layers/SenderLayer.py | 22 +++++++-- WPP_Whatsapp/api/layers/StatusLayer.py | 31 +++++++++---- WPP_Whatsapp/js_lib/wapi.js | 2 +- examples/send_text_message.py | 2 +- setup.py | 2 +- 7 files changed, 94 insertions(+), 34 deletions(-) diff --git a/WPP_Whatsapp/api/layers/LabelsLayer.py b/WPP_Whatsapp/api/layers/LabelsLayer.py index 13575c2..f2bd8a1 100644 --- a/WPP_Whatsapp/api/layers/LabelsLayer.py +++ b/WPP_Whatsapp/api/layers/LabelsLayer.py @@ -49,7 +49,7 @@ async def addNewLabel_(self, name, options): WPP.labels.addNewLabel(name, options); }""", {"name": name, "options": options}, page=self.page) - async def addOrRemoveLabels_(self, chatIds, options): + async def addOrRemoveLabels_(self, chatIds: list, options: list[dict]): """ /** * Add or delete label of chatId @@ -58,7 +58,10 @@ async def addOrRemoveLabels_(self, chatIds, options): * @example * ```javascript * client.addOrRemoveLabels(['[number]@c.us','[number]@c.us'], - * [{labelId:'76', type:'add'},{labelId:'75', type:'remove'}]); + * [ + * { labelId:'76', type:'add' }, + * { labelId:'75', type:'remove' } + * ]); * //or * ``` * @param chatIds ChatIds @@ -73,10 +76,12 @@ async def getAllLabels_(self): return await self.ThreadsafeBrowser.page_evaluate("() => WPP.labels.getAllLabels()", page=self.page) async def getLabelById_(self, Id): - return await self.ThreadsafeBrowser.page_evaluate("""({ id }) => {WPP.labels.getLabelById(id); }""", {"id": Id}, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("""({ id }) => {WPP.labels.getLabelById(id); }""", {"id": Id}, + page=self.page) async def deleteAllLabels_(self): return await self.ThreadsafeBrowser.page_evaluate("""() => {WPP.labels.deleteAllLabels();}""", page=self.page) async def deleteLabel_(self, Id): - return await self.ThreadsafeBrowser.page_evaluate("""({ id }) => {WPP.labels.deleteLabel(id); }""", {"id": Id}, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("""({ id }) => {WPP.labels.deleteLabel(id); }""", {"id": Id}, + page=self.page) diff --git a/WPP_Whatsapp/api/layers/RetrieverLayer.py b/WPP_Whatsapp/api/layers/RetrieverLayer.py index 49f057e..e152c16 100644 --- a/WPP_Whatsapp/api/layers/RetrieverLayer.py +++ b/WPP_Whatsapp/api/layers/RetrieverLayer.py @@ -147,7 +147,28 @@ async def getAllChats_(self, withNewMessageOnly=False): async def checkNumberStatus_(self, contactId): # @returns contact detial as promise contactId = self.valid_chatId(contactId) - return await self.ThreadsafeBrowser.page_evaluate("(contactId) => WAPI.checkNumberStatus(contactId)", contactId, page=self.page) + # return await self.ThreadsafeBrowser.page_evaluate("(contactId) => WAPI.checkNumberStatus(contactId)", contactId, page=self.page) + result = await self.ThreadsafeBrowser.page_evaluate( + "(contactId) => WPP.contact.queryExists(contactId)", + contactId, page=self.page) + if not result: + return { + "id": contactId, + "isBusiness": False, + "canReceiveMessage": False, + "numberExists": False, + "status": 404, + "result": result + } + else: + return { + "id": result.get("wid"), + "isBusiness": result.get("biz"), + "canReceiveMessage": True, + "numberExists": True, + "status": 200, + "result": result + } async def getAllChatsWithMessages_(self, withNewMessageOnly=False): # @returns array of [Chat] @@ -179,7 +200,8 @@ async def getAllBroadcastList_(self): async def getContact_(self, contactId): # @returns contact detial as promise contactId = self.valid_chatId(contactId) - return await self.ThreadsafeBrowser.page_evaluate("(contactId) => WAPI.getContact(contactId)", contactId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(contactId) => WAPI.getContact(contactId)", contactId, + page=self.page) async def getAllContacts_(self): # @returns array of [Contact] @@ -187,7 +209,8 @@ async def getAllContacts_(self): async def getChatById_(self, contactId): contactId = self.valid_chatId(contactId) - return await self.ThreadsafeBrowser.page_evaluate("(contactId) => WAPI.getChatById(contactId)", contactId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(contactId) => WAPI.getChatById(contactId)", contactId, + page=self.page) async def getChat_(self, contactId): contactId = self.valid_chatId(contactId) @@ -196,7 +219,8 @@ async def getChat_(self, contactId): async def getProfilePicFromServer_(self, chatId): # @returns url of the chat picture or unasync defined if there is no picture for the chat. chatId = self.valid_chatId(chatId) - return await self.ThreadsafeBrowser.page_evaluate("(chatId) => WAPI._profilePicfunc(chatId)", chatId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(chatId) => WAPI._profilePicfunc(chatId)", chatId, + page=self.page) async def loadEarlierMessages_(self, contactId): contactId = self.valid_chatId(contactId) @@ -216,13 +240,15 @@ async def getStatus_(self, contactId): async def getNumberProfile_(self, contactId): contactId = self.valid_chatId(contactId) - return await self.ThreadsafeBrowser.page_evaluate("(contactId) => WAPI.getNumberProfile(contactId)", contactId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(contactId) => WAPI.getNumberProfile(contactId)", contactId, + page=self.page) async def getUnreadMessages_(self, includeMe, includeNotifications, useUnreadCount): return await self.ThreadsafeBrowser.page_evaluate( """({ includeMe, includeNotifications, useUnreadCount }) => WAPI.getUnreadMessages(includeMe, includeNotifications, useUnreadCount)""", - {"includeMe": includeMe, "includeNotifications": includeNotifications, "useUnreadCount": useUnreadCount}, page=self.page) + {"includeMe": includeMe, "includeNotifications": includeNotifications, "useUnreadCount": useUnreadCount}, + page=self.page) async def getAllUnreadMessages_(self): return await self.ThreadsafeBrowser.page_evaluate("() => WAPI.getAllUnreadMessages()", page=self.page) @@ -240,7 +266,8 @@ async def getAllMessagesInChat_(self, chatId, includeMe=False, includeNotificati return await self.ThreadsafeBrowser.page_evaluate("""({ chatId, includeMe, includeNotifications }) => WAPI.getAllMessagesInChat(chatId, includeMe, includeNotifications)""", {"chatId": chatId, "includeMe": includeMe, - "includeNotifications": includeNotifications}, page=self.page) + "includeNotifications": includeNotifications}, + page=self.page) async def loadAndGetAllMessagesInChat_(self, chatId, includeMe=False, includeNotifications=False): chatId = self.valid_chatId(chatId) @@ -250,15 +277,18 @@ async def loadAndGetAllMessagesInChat_(self, chatId, includeMe=False, includeNot return await self.ThreadsafeBrowser.page_evaluate("""({ chatId, includeMe, includeNotifications }) => WAPI.loadAndGetAllMessagesInChat(chatId, includeMe, includeNotifications)""", {"chatId": chatId, "includeMe": includeMe, - "includeNotifications": includeNotifications}, page=self.page) + "includeNotifications": includeNotifications}, + page=self.page) async def getChatIsOnline_(self, chatId): chatId = self.valid_chatId(chatId) - return await self.ThreadsafeBrowser.page_evaluate("(chatId) => WAPI.getChatIsOnline(chatId)", chatId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(chatId) => WAPI.getChatIsOnline(chatId)", chatId, + page=self.page) async def getLastSeen_(self, chatId): chatId = self.valid_chatId(chatId) - return await self.ThreadsafeBrowser.page_evaluate("(chatId) => WAPI.getLastSeen(chatId)", chatId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(chatId) => WAPI.getLastSeen(chatId)", chatId, + page=self.page) async def getPlatformFromMessage_(self, msgId): """ @@ -269,10 +299,12 @@ async def getPlatformFromMessage_(self, msgId): * web * unknown """ - return await self.ThreadsafeBrowser.page_evaluate("(msgId) => WPP.chat.getPlatformFromMessage(msgId)", msgId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(msgId) => WPP.chat.getPlatformFromMessage(msgId)", msgId, + page=self.page) async def getReactions_(self, msgId): - return await self.ThreadsafeBrowser.page_evaluate("(msgId) => WPP.chat.getReactions(msgId)", msgId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(msgId) => WPP.chat.getReactions(msgId)", msgId, + page=self.page) async def getVotes_(self, msgId): return await self.ThreadsafeBrowser.page_evaluate("(msgId) => WPP.chat.getVotes(msgId)", msgId, page=self.page) diff --git a/WPP_Whatsapp/api/layers/SenderLayer.py b/WPP_Whatsapp/api/layers/SenderLayer.py index 6b34997..bacc058 100644 --- a/WPP_Whatsapp/api/layers/SenderLayer.py +++ b/WPP_Whatsapp/api/layers/SenderLayer.py @@ -187,7 +187,8 @@ async def sendImage_(self, to, filePath, filename="", caption="", quotedMessageI else: raise Exception("Path Not Found") - async def sendImageFromBase64_(self, to, _base64, filename, caption, quotedMessageId, isViewOnce): + async def sendImageFromBase64_(self, to, _base64, filename, caption, quotedMessageId, isViewOnce, + mentionedList=None): mime_type = self.base64MimeType(_base64) if not mime_type: raise Exception("Not valid mimeType") @@ -211,6 +212,8 @@ async def sendImageFromBase64_(self, to, _base64, filename, caption, quotedMessa caption, quotedMsg: quotedMessageId, waitForAck: true, + detectMentioned: true, + mentionedList: mentionedList, }).catch((e) => {return e}); return { @@ -219,8 +222,15 @@ async def sendImageFromBase64_(self, to, _base64, filename, caption, quotedMessa sendMsgResult: await result.sendMsgResult, error: result.message, }; - }""", {"to": to, "base64": _base64, "filename": filename, "caption": caption, "quotedMessageId": quotedMessageId, - "isViewOnce": isViewOnce}, page=self.page) + }""", { + "to": to, + "base64": _base64, + "filename": filename, + "caption": caption, + "quotedMessageId": quotedMessageId, + "isViewOnce": isViewOnce, + "mentionedList": mentionedList + }, page=self.page) return result async def reply_(self, to, content, quotedMsg): @@ -412,7 +422,8 @@ async def sendLocation_(self, to, options): async def sendSeen_(self, chatId): chatId = self.valid_chatId(chatId) - return await self.ThreadsafeBrowser.page_evaluate("(chatId) => WPP.chat.markIsRead(chatId)", chatId, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(chatId) => WPP.chat.markIsRead(chatId)", chatId, + page=self.page) async def startTyping_(self, to, duration=None): to = self.valid_chatId(to) @@ -425,7 +436,8 @@ async def stopTyping_(self, to): return await self.ThreadsafeBrowser.page_evaluate("(to) => WPP.chat.markIsPaused(to)", to, page=self.page) async def setOnlinePresence_(self, online=True): - return await self.ThreadsafeBrowser.page_evaluate("(online) => WPP.conn.markAvailable(online)", online, page=self.page) + return await self.ThreadsafeBrowser.page_evaluate("(online) => WPP.conn.markAvailable(online)", online, + page=self.page) async def sendListMessage_(self, to, options): to = self.valid_chatId(to) diff --git a/WPP_Whatsapp/api/layers/StatusLayer.py b/WPP_Whatsapp/api/layers/StatusLayer.py index 0c886ea..7b2828d 100644 --- a/WPP_Whatsapp/api/layers/StatusLayer.py +++ b/WPP_Whatsapp/api/layers/StatusLayer.py @@ -3,7 +3,7 @@ class StatusLayer(LabelsLayer): - def sendImageStatus(self, pathOrBase64: str, timeout=60): + def sendImageStatus(self, pathOrBase64: str, options: dict = {}, timeout=60): """ /** * Send a image message to status stories @@ -17,9 +17,9 @@ def sendImageStatus(self, pathOrBase64: str, timeout=60): */ """ return self.ThreadsafeBrowser.run_threadsafe( - self.sendImageStatus_, pathOrBase64, timeout_=timeout) + self.sendImageStatus_, pathOrBase64, options, timeout_=timeout) - def sendVideoStatus(self, pathOrBase64: str, timeout=60): + def sendVideoStatus(self, pathOrBase64: str, options: dict = {}, timeout=60): """ /** * Send a video message to status stories @@ -33,7 +33,7 @@ def sendVideoStatus(self, pathOrBase64: str, timeout=60): */ """ return self.ThreadsafeBrowser.run_threadsafe( - self.sendVideoStatus_, pathOrBase64, timeout_=timeout) + self.sendVideoStatus_, pathOrBase64, options, timeout_=timeout) def sendTextStatus(self, text: str, options: dict = {}, timeout=60): """ @@ -67,7 +67,7 @@ def sendReadStatus(self, chatId: str, statusId: str, timeout=60): self.sendReadStatus_, chatId, statusId, timeout_=timeout) ########################################################################## - async def sendImageStatus_(self, pathOrBase64: str): + async def sendImageStatus_(self, pathOrBase64: str, options={}): """ /** * Send a image message to status stories @@ -77,6 +77,12 @@ async def sendImageStatus_(self, pathOrBase64: str): * ```javascript * client.sendImageStatus('data:image/jpeg;base64,'); * ``` + * + * @example + * ```javascript + * // Send with caption + * client.sendImageStatus('data:image/jpeg;base64,', { caption: 'example test' } ); + * ``` * @param pathOrBase64 Path or base 64 image */ """ @@ -108,11 +114,11 @@ async def sendImageStatus_(self, pathOrBase64: str): raise error return await self.ThreadsafeBrowser.page_evaluate( - """({base64}) => WPP.status.sendImageStatus(base64);""", - {"base64": base64}, page=self.page + """({base64, options}) => WPP.status.sendImageStatus(base64, options);""", + {"base64": base64, "options": options}, page=self.page ) - async def sendVideoStatus_(self, pathOrBase64: str): + async def sendVideoStatus_(self, pathOrBase64: str, options={}): """ /** * Send a video message to status stories @@ -122,6 +128,11 @@ async def sendVideoStatus_(self, pathOrBase64: str): * ```javascript * client.sendVideoStatus('data:video/mp4;base64,'); * ``` + * @example + * ```javascript + * // Send with caption + * client.sendVideoStatus('data:video/mp4;base64,', { caption: 'example test' } ); + * ``` * @param pathOrBase64 Path or base 64 image */ """ @@ -141,8 +152,8 @@ async def sendVideoStatus_(self, pathOrBase64: str): raise error return await self.ThreadsafeBrowser.page_evaluate( - """({base64}) => WPP.status.sendVideoStatus(base64);""", - {"base64": base64}, page=self.page + """({base64, options}) => WPP.status.sendVideoStatus(base64, options);""", + {"base64": base64, "options": options}, page=self.page ) async def sendTextStatus_(self, text: str, options: str): diff --git a/WPP_Whatsapp/js_lib/wapi.js b/WPP_Whatsapp/js_lib/wapi.js index 812d88f..c0647ec 100644 --- a/WPP_Whatsapp/js_lib/wapi.js +++ b/WPP_Whatsapp/js_lib/wapi.js @@ -1 +1 @@ -(()=>{var e={588:function(e,t,n){"use strict";var r;!function(i){function o(e,t,n){var r,i,o,a,s,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)s=512,w=H,v=z,a=160,P=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(w=function(t,n){return B(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;nt;t+=1)n[t]=e[t].slice();return n},C=1,"SHA3-224"===e)s=1152,a=224;else if("SHA3-256"===e)s=1088,a=256;else if("SHA3-384"===e)s=832,a=384;else if("SHA3-512"===e)s=576,a=512;else if("SHAKE128"===e)s=1344,a=-1,O=31,M=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");s=1088,a=-1,O=31,M=!0}v=function(e,t,n,r,i){var o,a=O,u=[],c=(n=s)>>>5,l=0,d=t>>>5;for(o=0;o=n;o+=c)r=D(e.slice(o,o+c),r),t-=n;for(e=e.slice(o),t%=n;e.length>>3)>>2]^=a<=i));)u.push(e.a),0==64*(l+=1)%n&&D(null,r);return u}}o=h(t,r,C),i=F(e),this.setHMACKey=function(t,n,o){var u;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=(u=s>>>3)/4-1,ut/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=s,b=!0},this.update=function(e){var t,n,r,a=0,u=s>>>5;for(e=(t=o(e,m,A)).binLen,n=t.value,t=e>>>5,r=0;r>>5),A=e%s,S=!0},this.getHash=function(t,n){var r,o,s,h;if(!0===b)throw Error("Cannot call getHash after setting HMAC key");if(s=p(n),!0===M){if(-1===s.shakeLen)throw Error("shakeLen must be specified in options");a=s.shakeLen}switch(t){case"HEX":r=function(e){return u(e,a,C,s)};break;case"B64":r=function(e){return c(e,a,C,s)};break;case"BYTES":r=function(e){return l(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 d(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 f(e,a,C)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(h=v(m.slice(),A,g,P(i),a),o=1;o>>24-a%32),h=v(h,a,0,F(e),a);return r(h)},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=p(n),t){case"HEX":r=function(e){return u(e,a,C,h)};break;case"B64":r=function(e){return c(e,a,C,h)};break;case"BYTES":r=function(e){return l(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 d(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 f(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,F(e)),r(y=v(o,a,s,y,a))}}function a(e,t){this.a=e,this.b=t}function s(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>>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 u(e,t,n,r){var i,o,a,s="";for(t/=8,a=-1===n?3:0,i=0;i>>2]>>>8*(a+i%4*n),s+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return r.outputUpper?s.toUpperCase():s}function c(e,t,n,r){var i,o,a,s,u="",c=t/8;for(s=-1===n?3:0,i=0;i>>2]:0,a=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 l(e,t,n){var r,i,o,a="";for(t/=8,o=-1===n?3:0,r=0;r>>2]>>>8*(o+r%4*n)&255,a+=String.fromCharCode(i);return a}function d(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>>2]>>>8*(i+r%4*n)&255;return a}function f(e,t,n){t/=8;var r,i,o=new Uint8Array(t);for(i=-1===n?3:0,r=0;r>>2]>>>8*(i+r%4*n)&255;return o}function p(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>>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,p=0;if(r=r||[0],c=(i=i||0)>>>3,"UTF8"===t)for(f=-1===n?3:0,s=0;s(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>>2;r.length<=l;)r.push(0);r[l]|=a[u]<<8*(f+d%4*n),p+=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>>8),l=(d=p+c)>>>2;r.length<=l;)r.push(0);r[l]|=o<<8*(f+d%4*n),p+=2}return{value:r,binLen:8*p+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{"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 Le.apply(this,arguments)},window.WAPI.getSessionTokenBrowser=function(){return He.apply(this,arguments)},window.WAPI.scope=je,window.WAPI.getchatId=function(e){return ke.apply(this,arguments)},window.WAPI.sendExist=function(e){return Te.apply(this,arguments)},window.WAPI.pinChat=function(e){return Re.apply(this,arguments)},window.WAPI.setTemporaryMessages=function(e,t){return at.apply(this,arguments)},window.WAPI.setTheme=function(e){return Me.apply(this,arguments)},window.WAPI.getTheme=function(){return Ce.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=wt,window.WAPI.sendChatstate=function(e,t){return K.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 he.apply(this,arguments)},window.WAPI.sendMessage=function(e,t){return ue.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 ee(e,t,n,r,"sendImage",i,o)},window.WAPI.sendPtt=function(e,t,n,r,i){return re.apply(this,arguments)},window.WAPI.sendFile=ee,window.WAPI.setMyName=function(e){return ye.apply(this,arguments)},window.WAPI.sendVideoAsGif=function(e,t,n,r,i){return ve.apply(this,arguments)},window.WAPI.processFiles=V,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);V(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 ie(e,t);var n=Object.prototype.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)?ie(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 Ae.apply(this,arguments)},window.WAPI.encryptAndUploadFile=function(e,t){return h.apply(this,arguments)},window.WAPI.setOnlinePresence=function(e){return it.apply(this,arguments)},window.WAPI.sendLocation=function(e,t,n){return ae.apply(this,arguments)},window.WAPI.sendLinkPreview=function(e,t,n){return Ee.apply(this,arguments)},window.WAPI.sendMessageOptions=function(e,t){return fe.apply(this,arguments)},window.WAPI.starMessages=function(e,t){return ct.apply(this,arguments)},window.WAPI.getAllContacts=g,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=b,window.WAPI.getAllChatsWithNewMsg=W,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 W().map((e=>WAPI.getChat(e.id))).flatMap((e=>e.msgs.filter((e=>e.isNewMsg)))).map(WAPI._serializeMessageObj)||[]},window.WAPI.getAllUnreadMessages=S,window.WAPI.getAllChatsWithMessages=function(e){return v.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 C.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 G.apply(this,arguments)},window.WAPI.loadAllEarlierMessages=F,window.WAPI.asyncLoadAllEarlierMessages=function(e,t){F(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);!function e(){r.msgs.getModelsArray()[0].t>t&&!r.msgs.msgLoadState.noEarlierMsgs?r.loadEarlierMsgs().then(e):n()}()},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 x.apply(this,arguments)},window.WAPI._getGroupParticipants=function(e){return U.apply(this,arguments)},window.WAPI.getGroupParticipantIDs=function(e,t){return k.apply(this,arguments)},window.WAPI.getAllMessagesInChat=function(e,t,n,r){return A.apply(this,arguments)},window.WAPI.loadAndGetAllMessagesInChat=function(e,t,n,r){return B.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 p=s.unreadCount,h=c.length-1;h>=0;h--){var w=c[h];if(p>0){if(!w.isSentByMe){var v=WAPI.processMessageObj(w,e,t);u.messages.unshift(v),p-=1}}else{if(-1!==p)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 E.apply(this,arguments)},window.WAPI.downloadFile=function(e){return i.apply(this,arguments)},window.WAPI.getNumberProfile=function(e,t){return N.apply(this,arguments)},window.WAPI.getMessageById=X,window.WAPI.getMessages=function(e){return We.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>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 Ge.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 Be.apply(this,arguments)},window.WAPI.startPhoneWatchdog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;Qe(),Ve=setInterval(Je,e)},window.WAPI.stopPhoneWatchdog=Qe,window.WAPI.subscribePresence=function(e){return tt.apply(this,arguments)},window.WAPI.unsubscribePresence=function(e){return nt.apply(this,arguments)},window.WAPI.getBusinessProfilesProducts=function(e){return Pt.apply(this,arguments)},window.WAPI.getOrderbyMsg=function(e){return gt.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=bt((function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=bt((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=bt((function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=bt((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=bt((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=bt((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=bt((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=bt((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=bt((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!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=bt((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=bt((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=bt((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=bt((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=bt((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=bt((function*(e,t){return yield WPP.group.setProperty(e,"announcement",t),!0}));return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.logout=bt((function*(){return yield WPP.conn.logout()})),window.WAPI.isRegistered=function(){return WPP.webpack.search((e=>e.isRegistered)).isRegistered()},It.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}})),It.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}})),It.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."})}))}})),It.then((function(){window.WAPI.waitNewMessages=lt})),It.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)}))})),It.then((function(){window.WAPI.waitNewAcknowledgements=function(e){return WPP.whatsapp.MsgStore.on("change:ack",e),!0}})),It.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}})),It.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{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){dt(o,r,i,a,s,"next",e)}function s(e){dt(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}()})),It.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);pt[e]||(pt[e]={},i.participants.forEach((t=>{pt[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();pt[e][f]&&pt[e][d[0]].subtype==c||(0==o?o++:(pt[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){ft(o,r,i,a,s,"next",e)}function s(e){ft(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}()})),It.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}})),It.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}})))},320: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",p="suspendedYield",h="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===h)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=h;var c=d(e,n,r);if("normal"===c.type){if(i=r.done?w:p,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=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=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=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(320),n(816)})(); \ No newline at end of file +(()=>{var e={730:function(e,t,n){"use strict";var r;!function(i){function o(e,t,n){var r,i,o,a,s,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)s=512,w=H,v=z,a=160,P=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(w=function(t,n){return B(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;nt;t+=1)n[t]=e[t].slice();return n},C=1,"SHA3-224"===e)s=1152,a=224;else if("SHA3-256"===e)s=1088,a=256;else if("SHA3-384"===e)s=832,a=384;else if("SHA3-512"===e)s=576,a=512;else if("SHAKE128"===e)s=1344,a=-1,O=31,M=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");s=1088,a=-1,O=31,M=!0}v=function(e,t,n,r,i){var o,a=O,u=[],c=(n=s)>>>5,l=0,d=t>>>5;for(o=0;o=n;o+=c)r=D(e.slice(o,o+c),r),t-=n;for(e=e.slice(o),t%=n;e.length>>3)>>2]^=a<=i));)u.push(e.a),0==64*(l+=1)%n&&D(null,r);return u}}o=p(t,r,C),i=F(e),this.setHMACKey=function(t,n,o){var u;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=p(n,r=(o||{}).encoding||"UTF8",C)(t)).binLen,n=n.value,o=(u=s>>>3)/4-1,ut/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=s,b=!0},this.update=function(e){var t,n,r,a=0,u=s>>>5;for(e=(t=o(e,m,A)).binLen,n=t.value,t=e>>>5,r=0;r>>5),A=e%s,S=!0},this.getHash=function(t,n){var r,o,s,p;if(!0===b)throw Error("Cannot call getHash after setting HMAC key");if(s=h(n),!0===M){if(-1===s.shakeLen)throw Error("shakeLen must be specified in options");a=s.shakeLen}switch(t){case"HEX":r=function(e){return u(e,a,C,s)};break;case"B64":r=function(e){return c(e,a,C,s)};break;case"BYTES":r=function(e){return l(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 d(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 f(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>>24-a%32),p=v(p,a,0,F(e),a);return r(p)},this.getHMAC=function(t,n){var r,o,p,y;if(!1===b)throw Error("Cannot call getHMAC without first setting HMAC key");switch(p=h(n),t){case"HEX":r=function(e){return u(e,a,C,p)};break;case"B64":r=function(e){return c(e,a,C,p)};break;case"BYTES":r=function(e){return l(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 d(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 f(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,F(e)),r(y=v(o,a,s,y,a))}}function a(e,t){this.a=e,this.b=t}function s(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>>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 u(e,t,n,r){var i,o,a,s="";for(t/=8,a=-1===n?3:0,i=0;i>>2]>>>8*(a+i%4*n),s+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return r.outputUpper?s.toUpperCase():s}function c(e,t,n,r){var i,o,a,s,u="",c=t/8;for(s=-1===n?3:0,i=0;i>>2]:0,a=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 l(e,t,n){var r,i,o,a="";for(t/=8,o=-1===n?3:0,r=0;r>>2]>>>8*(o+r%4*n)&255,a+=String.fromCharCode(i);return a}function d(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>>2]>>>8*(i+r%4*n)&255;return a}function f(e,t,n){t/=8;var r,i,o=new Uint8Array(t);for(i=-1===n?3:0,r=0;r>>2]>>>8*(i+r%4*n)&255;return o}function h(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 p(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>>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(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>>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>>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{"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);!function e(){r.msgs.getModelsArray()[0].t>t&&!r.msgs.msgLoadState.noEarlierMsgs?r.loadEarlierMsgs().then(e):n()}()},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>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!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{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=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=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=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)})(); \ No newline at end of file diff --git a/examples/send_text_message.py b/examples/send_text_message.py index 6b52390..da2ceed 100644 --- a/examples/send_text_message.py +++ b/examples/send_text_message.py @@ -20,7 +20,7 @@ # example # Simple message -result = client.sendText(phone_number, message) +# result = client.sendText(phone_number, message) # print(result) """ diff --git a/setup.py b/setup.py index 221cab2..7ec0452 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ "the creation of any interaction, such as customer service, media sending, intelligence recognition " "based on phrases artificial and many other things, use your imagination") -version = "0.2.5" +version = "0.2.8" setup( name="WPP_Whatsapp",